diff --git a/packages/extension-map/doc/webpacks/shexmap-webapp.js b/packages/extension-map/doc/webpacks/shexmap-webapp.js index 75ad7024d..6023dcba6 100644 --- a/packages/extension-map/doc/webpacks/shexmap-webapp.js +++ b/packages/extension-map/doc/webpacks/shexmap-webapp.js @@ -4649,11 +4649,26 @@ function ShExMaterializer_constructor(schema, mapper, options) { shape: shapeLabel }; seen[seenKey] = { point: point, shapeLabel: shapeLabel }; - const ret = this._validateShapeExpr(db, point, schema._index.shapeExprs[shapeLabel], shapeLabel, depth, seen); + const ret = this._validateShapeDecl(db, point, schema._index.shapeExprs[shapeLabel], shapeLabel, depth, seen); delete seen[seenKey]; return ret; } + this._validateShapeDecl = function (db, point, shapeExpr, shapeLabel, depth, tracker, seen, subgraph) { + const expr = shapeExpr.type === "ShapeDecl" ? shapeExpr.shapeExpr : shapeExpr; + return this._validateShapeExpr(db, point, expr, shapeLabel, depth, tracker, seen, subgraph); + } + + this._lookupShape = function (label) { + if (!("shapes" in this.schema) || this.schema.shapes.length === 0) { + runtimeError("shape " + label + " not found; no shapes in schema"); + } else if (label in index.shapeExprs) { + return index.shapeExprs[label] + } else { + runtimeError("shape " + label + " not found in:\n" + Object.keys(index.shapeExprs || []).map(s => " " + s).join("\n")); + } + } + this._validateShapeExpr = function (db, point, shapeExpr, shapeLabel, depth, seen) { if ("known" in this && this.known.cached(point, shapeExpr)) return this.known.cached(point, shapeExpr); @@ -6648,7 +6663,7 @@ function trivialMaterializer (schema, nextBNode) { const oldVisitShapeRef = v.visitShapeRef; v.visitShapeRef = function (shapeRef) { - this.visitShapeExpr(index.shapeExprs[shapeRef], shapeRef); + this.visitShapeDecl(index.shapeExprs[shapeRef], shapeRef); return oldVisitShapeRef.call(v, shapeRef); }; @@ -8269,13 +8284,9 @@ this.$ = appendTo($$[$0-1], $$[$0]) // t: startCode3; break; case 26: // t: 1dot 1val1vsMinusiri3?? - if ($$[$0-3].abstract || $$[$0-1].length) { // t: $$[$0-3]: 1dotAbstractShapeCode1 $$[$0-2]: @@ - yy.addShape($$[$0-2], Object.assign({type: "ShapeDecl"}, $$[$0-3], - $$[$0-1].length > 0 ? { restricts: $$[$0-1] } : { }, - {shapeExpr: $$[$0]})) // $$[$01]: t: @@ - } else { - yy.addShape($$[$0-2], $$[$0]); - } + yy.addShape($$[$0-2], Object.assign({type: "ShapeDecl"}, $$[$0-3], + $$[$0-1].length > 0 ? { restricts: $$[$0-1] } : { }, + {shapeExpr: $$[$0]})) // $$[$01]: t: @@ break; case 27: @@ -9790,7 +9801,7 @@ const ShExUtil = { shapes: schema.shapes.reduce(function (ret, shape) { ret[shape.id] = { type: "ASTshape", - expression: _compileShapeToAST(shape.expression, [], schema) + expression: _compileShapeToAST(shape.shapeExpr.expression, [], schema) }; return ret; }, {}) @@ -10020,14 +10031,19 @@ const ShExUtil = { schema.start = v.visitShapeExpr(schema.start); if ("shapes" in schema) schema.shapes = schema.shapes.map((sh, idx) => { - return sh.type === SX.ShapeDecl ? + return sh.type === SX.ShapeExternal + ? { - type: "ShapeDecl", + type: "ShapeExternal", id: sh.id, - abstract: sh.abstract, - shapeExpr: v.visitShapeExpr(sh.shapeExpr) - } : - knownShapeExprs.get(sh.id) ? knownShapeExprs.get(sh.id) : (() => {const n = v.keepShapeExpr(sh); knownShapeExprs.set(sh.id, n); return n;})(); + } + : + { + type: "ShapeDecl", + id: sh.id, + abstract: sh.abstract, + shapeExpr: v.visitShapeExpr(sh.shapeExpr) + }; }); // remove extraneous BNode IDs @@ -10114,7 +10130,7 @@ const ShExUtil = { // Don't delete ret.productions as it's part of the AS. const v = ShExUtil.Visitor(); const knownExpressions = []; - const oldVisitInclusion = v.visitInclusion, oldVisitExpression = v.visitExpression; + const oldVisitInclusion = v.visitInclusion, oldVisitExpression = v.visitExpression, oldVisitExtra = v.visitExtra; v.visitInclusion = function (inclusion) { if (knownExpressions.indexOf(inclusion) === -1 && inclusion in index.tripleExprs) { @@ -10133,6 +10149,9 @@ const ShExUtil = { } return oldVisitExpression.call(v, expression); }; + v.visitExtra = function (l) { + return l.slice().sort(); + } if (trimIRI) { v.visitIRI = function (i) { return i.replace(trimIRI, ""); @@ -10497,10 +10516,10 @@ const ShExUtil = { */ getDependencies: function (schema, ret) { ret = ret || this.BiDiClosure(); - (schema.shapes || []).forEach(function (shape) { + (schema.shapes || []).forEach(function (shapeDecl) { function _walkShapeExpression (shapeExpr, negated) { if (typeof shapeExpr === "string") { // ShapeRef - ret.add(shape.id, shapeExpr); + ret.add(shapeDecl.id, shapeExpr); } else if (shapeExpr.type === "ShapeOr" || shapeExpr.type === "ShapeAnd") { shapeExpr.shapeExprs.forEach(function (expr) { _walkShapeExpression(expr, negated); @@ -10527,15 +10546,15 @@ const ShExUtil = { function _walkTripleConstraint (tc, negated) { if (tc.valueExpr) _walkShapeExpression(tc.valueExpr, negated); - if (negated && ret.inCycle.indexOf(shape.id) !== -1) // illDefined/negatedRefCycle.err - throw Error("Structural error: " + shape.id + " appears in negated cycle"); + if (negated && ret.inCycle.indexOf(shapeDecl.id) !== -1) // illDefined/negatedRefCycle.err + throw Error("Structural error: " + shapeDecl.id + " appears in negated cycle"); } if (typeof tripleExpr === "string") { // Inclusion - ret.add(shape.id, tripleExpr); + ret.add(shapeDecl.id, tripleExpr); } else { if ("id" in tripleExpr) - ret.addIn(tripleExpr.id, shape.id) + ret.addIn(tripleExpr.id, shapeDecl.id) if (tripleExpr.type === "TripleConstraint") { _walkTripleConstraint(tripleExpr, negated); } else if (tripleExpr.type === "OneOf" || tripleExpr.type === "EachOf") { @@ -10549,15 +10568,13 @@ const ShExUtil = { (["extends", "restricts"]).forEach(attr => { if (shape[attr] && shape[attr].length > 0) shape[attr].forEach(function (i) { - ret.add(shape.id, i); + ret.add(shapeDecl.id, i); }); }) if (shape.expression) _walkTripleExpression(shape.expression, negated); } - if (shape.type === "ShapeDecl") - shape = shape.shapeExpr; - _walkShapeExpression(shape, 0); // 0 means false for bitwise XOR + _walkShapeExpression(shapeDecl.shapeExpr, 0); // 0 means false for bitwise XOR }); return ret; }, @@ -11152,14 +11169,17 @@ const ShExUtil = { const shapes = values[SX.shapes]; if (shapes) { ret.shapes = shapes.map(v => { // @@ console.log(v.nested); - var t = v.nested[RDF.type][0].ldterm; - var obj = t === SX.ShapeDecl ? - { - type: SX.ShapeDecl, - abstract: !!v.nested[SX["abstract"]][0].ldterm.value, - shapeExpr: shapeExpr(v.nested[SX.shapeExpr][0].nested) - } : - shapeExpr(v.nested); + var t = v.nested[RDF.type][0].ldterm;debugger; + const obj = t === SX.ShapeExternal + ? { type: t } + : Object.assign( + {}, + { type: SX.ShapeDecl }, + SX["abstract"] in v.nested + ? {abstract: !!v.nested[SX["abstract"]]?.[0].ldterm.value} + : {}, + {shapeExpr: shapeExpr(v.nested[SX.shapeExpr][0].nested)} + ); return extend({id: v.ldterm}, obj); }); } @@ -12746,7 +12766,7 @@ function ShExValidator_constructor(schema, db, options) { // Override visitShapeRef to follow references. // tests: Extend3G-pass, vitals-RESTRICTS-pass_lie-Vital... visitor.visitShapeRef = function (inclusion) { - return visitor.visitShapeDecl(this._lookupShape(inclusion)); + return visitor.visitShapeDecl(_ShExValidator._lookupShape(inclusion)); }; // Visit shape's EXTENDS and expression. diff --git a/packages/extension-map/doc/webpacks/shexmap-webapp.min.js b/packages/extension-map/doc/webpacks/shexmap-webapp.min.js index 91aca4a0d..6e32d45b6 100644 --- a/packages/extension-map/doc/webpacks/shexmap-webapp.min.js +++ b/packages/extension-map/doc/webpacks/shexmap-webapp.min.js @@ -1,2 +1,2 @@ /*! For license information please see shexmap-webapp.min.js.LICENSE.txt */ -(()=>{var t={752:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JisonLexer=void 0;var n=function(){function e(e){void 0===e&&(e={}),this.yy=e,this.EOF=1,this.options={},this.yyleng=0,this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0}}return e.prototype.parseError=function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},e.prototype.setInput=function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},e.prototype.input=function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},e.prototype.unput=function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var s=this.yylloc.range,i={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t};return this.yylloc=i,this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},e.prototype.more=function(){return this._more=!0,this},e.prototype.reject=function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},e.prototype.less=function(e){this.unput(this.match.slice(e))},e.prototype.pastInput=function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},e.prototype.upcomingInput=function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},e.prototype.showPosition=function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},e.prototype.test_match=function(e,t){var n,r,s;if(this.options.backtrack_lexer&&(s={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.yylloc.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(s.yylloc.range=this.yylloc.range.slice(0))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var i in s)this[i]=s[i];return!1}return!1},e.prototype.next=function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r=null;this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),i=0;ir[0].length)){if(r=t,n=i,this.options.backtrack_lexer){if(!1!==(e=this.test_match(t,s[i])))return e;if(this._backtrack){r=null;continue}return!1}if(!this.options.flex)break}return r?!1!==(e=this.test_match(r,s[n]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},e.prototype.lex=function(){var e=this.next();return e||this.lex()},e.prototype.begin=function(e){this.conditionStack.push(e)},e.prototype.popState=function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},e.prototype._currentRules=function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},e.prototype.topState=function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},e.prototype.pushState=function(e){this.begin(e)},e.prototype.stateStackSize=function(){return this.conditionStack.length},e}();t.JisonLexer=n},41:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.o=t.JisonParser=void 0;var n=function(){function e(e,t){void 0===e&&(e={}),this.yy=e,this.lexer=t}return e.prototype.trace=function(e){},e.prototype.parseError=function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},e.prototype.parse=function(e,t){void 0===t&&(t="function"==typeof this.yy&&"function"==typeof this.yy.constructor?new this.yy(this,this.lexer):Object.create(this.yy));var n=this,r=[0],s=[null],i=[],a=this.table,o="",u=0,c=0,l=0,p=2,f=1,h=i.slice.call(arguments,1),d=Object.create(this.lexer),m={yy:t};d.setInput(e,m.yy),m.yy.lexer=d,m.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var y=d.yylloc;i.push(y);var x=d.options&&d.options.ranges;function g(e){r.length=r.length-2*e,s.length=s.length-e,i.length=i.length-e}"function"==typeof m.yy.parseError&&(this.parseError=m.yy.parseError);for(var _,E,b,S,v,A,O,w,T,I=function(){var e;return"number"!=typeof(e=d.lex()||f)&&(e=n.symbols_[e]||e),e},N={};;){if(b=r[r.length-1],this.defaultActions[b]?S=this.defaultActions[b]:(null==_&&(_=I()),S=a[b]&&a[b][_]),void 0===S||!S.length||!S[0]){var k=null,F="";if(l)E!==f&&(k=R(b));else{for(var L in k=R(b),T=[],a[b])A=Number(L),this.terminals_[A]&&A>p&&T.push("'"+this.terminals_[A]+"'");F=d.showPosition?"Parse error on line "+(u+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(u+1)+": Unexpected "+(_==f?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(F,{text:d.match,token:this.terminals_[_]||_,line:d.yylineno,loc:d.yylloc,expected:T,recoverable:null!==k})}if(3==l){if(_===f||E===f)throw new Error(F||"Parsing halted while starting to recover from another error.");c=d.yyleng,o=d.yytext,u=d.yylineno,y=d.yylloc,_=I()}if(null===k)throw new Error(F||"Parsing halted. No suitable error recovery rule available.");g(k||0),E=_==p?null:_,_=p,b=r[r.length-1],S=a[b]&&a[b][p],l=3}if(S[0]instanceof Array&&S.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+_);switch(S[0]){case 1:r.push(_),s.push(d.yytext),i.push(d.yylloc),r.push(S[1]),_=null,E?(_=E,E=null):(c=d.yyleng,o=d.yytext,u=d.yylineno,y=d.yylloc,l>0&&l--);break;case 2:if(O=this.productions_[S[1]][1],N.$=s[s.length-O],N._$={first_line:i[i.length-(O||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(O||1)].first_column,last_column:i[i.length-1].last_column},x&&(N._$.range=[i[i.length-(O||1)].range[0],i[i.length-1].range[1]]),void 0!==(v=this.performAction.apply(N,[o,c,u,m.yy,S[1],s,i].concat(h))))return v;O&&(r=r.slice(0,-1*O*2),s=s.slice(0,-1*O),i=i.slice(0,-1*O)),r.push(this.productions_[S[1]][0]),s.push(N.$),i.push(N._$),w=a[r[r.length-2]][r[r.length-1]],r.push(w);break;case 3:return!0}}return!0;function R(e){for(var t=r.length-1,n=0;;){if(p.toString()in a[e])return n;if(0===e||t<2)return null;e=r[t-=2],++n}}},e}();t.JisonParser=n,t.o=function(e,t,n){var r=e.length;for(n=n||{};r--;n[e[r]]=t);return n}},515:e=>{var t={create:function(){let e={},t={},n={},r={};return{add:function(s,i){if(s in n&&-1!==n[s].indexOf(i))return;let a=s in r?c(s):e[s]=c(s),o=c(i);function u(e,t,n,r){e[r]=e[r].filter((t=>-1===e[n].indexOf(t))).concat(-1===e[n].indexOf(n)?[n]:[],e[n]),e[n].forEach((e=>t[e]=t[e].filter((e=>e!==r&&-1===t[r].indexOf(e))).concat(-1===t[r].indexOf(r)?[r]:[],t[r])))}function c(e){return e in r||(t[e]=[],n[e]=[],r[e]={}),r[e]}a[i]=o,delete e[i],u(n,t,i,s),u(t,n,s,i)},roots:e,parents:t,children:n}},depthFirst:function e(t,n,r){return Object.keys(t).reduce(((s,i)=>s.concat(e(t[i],n,i),r?n(i,r):[])),[])}};e.exports=t},325:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;const n="http://www.w3.org/1999/02/22-rdf-syntax-ns#",r="http://www.w3.org/2001/XMLSchema#",s="http://www.w3.org/2000/10/swap/";var i={xsd:{decimal:`${r}decimal`,boolean:`${r}boolean`,double:`${r}double`,integer:`${r}integer`,string:`${r}string`},rdf:{type:`${n}type`,nil:`${n}nil`,first:`${n}first`,rest:`${n}rest`,langString:`${n}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${s}reify#forSome`,forAll:`${s}reify#forAll`},log:{implies:`${s}log#implies`}};t.default=i},713:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Variable=t.Triple=t.Term=t.Quad=t.NamedNode=t.Literal=t.DefaultGraph=t.BlankNode=void 0,t.escapeQuotes=b,t.termFromId=function e(t,n){if(n=n||f,!t)return n.defaultGraph();switch(t[0]){case"?":return n.variable(t.substr(1));case"_":return n.blankNode(t.substr(2));case'"':if(n===f)return new y(t);if('"'===t[t.length-1])return n.literal(t.substr(1,t.length-2));const r=t.lastIndexOf('"',t.length-1);return n.literal(t.substr(1,r-1),"@"===t[r+1]?t.substr(r+2):n.namedNode(t.substr(r+3)));case"<":const s=p.exec(t);return n.quad(e(S(s[1]),n),e(S(s[2]),n),e(S(s[3]),n),s[4]&&e(S(s[4]),n));default:return n.namedNode(t)}},t.termToId=function e(t){if("string"==typeof t)return t;if(t instanceof d&&"Quad"!==t.termType)return t.id;if(!t)return u.id;switch(t.termType){case"NamedNode":return t.value;case"BlankNode":return`_:${t.value}`;case"Variable":return`?${t.value}`;case"DefaultGraph":return"";case"Literal":return`"${t.value}"${t.language?`@${t.language}`:t.datatype&&t.datatype.value!==o.string?`^^${t.datatype.value}`:""}`;case"Quad":return`<<${b(e(t.subject))} ${b(e(t.predicate))} ${b(e(t.object))}${(0,i.isDefaultGraph)(t.graph)?"":` ${e(t.graph)}`}>>`;default:throw new Error(`Unexpected termType: ${t.termType}`)}},t.unescapeQuotes=S;var r,s=(r=n(325))&&r.__esModule?r:{default:r},i=n(670);const{rdf:a,xsd:o}=s.default;let u,c=0;const l=/^"(.*".*)(?="[^"]*$)/,p=/^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/,f={namedNode:function(e){return new m(e)},blankNode:function(e){return new x(e||"n3-"+c++)},variable:function(e){return new g(e)},literal:function(e,t){if("string"==typeof t)return new y(`"${e}"@${t.toLowerCase()}`);let n=t?t.value:"";""===n&&("boolean"==typeof e?n=o.boolean:"number"==typeof e&&(Number.isFinite(e)?n=Number.isInteger(e)?o.integer:o.double:(n=o.double,Number.isNaN(e)||(e=e>0?"INF":"-INF"))));return""===n||n===o.string?new y(`"${e}"`):new y(`"${e}"^^${n}`)},defaultGraph:function(){return u},quad:v,triple:v};var h=f;t.default=h;class d{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof d?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}t.Term=d;class m extends d{get termType(){return"NamedNode"}}t.NamedNode=m;class y extends d{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`"${t.replace(/"/g,'""')}`))}function S(e){return e.replace(l,((e,t)=>`"${t.replace(/""/g,'"')}`))}function v(e,t,n,r){return new E(e,t,n,r)}t.Triple=t.Quad=E},670:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.inDefaultGraph=function(e){return i(e.graph)},t.isBlankNode=function(e){return!!e&&"BlankNode"===e.termType},t.isDefaultGraph=i,t.isLiteral=function(e){return!!e&&"Literal"===e.termType},t.isNamedNode=function(e){return!!e&&"NamedNode"===e.termType},t.isVariable=function(e){return!!e&&"Variable"===e.termType},t.prefix=function(e,t){return a({"":e.value||e},t)("")},t.prefixes=a;var r,s=(r=n(713))&&r.__esModule?r:{default:r};function i(e){return!!e&&"DefaultGraph"===e.termType}function a(e,t){const n=Object.create(null);for(const t in e)r(t,e[t]);function r(e,r){if("string"==typeof r){const s=Object.create(null);n[e]=e=>s[e]||(s[e]=t.namedNode(r+e))}else if(!(e in n))throw new Error(`Unknown prefix: ${e}`);return n[e]}return t=t||s.default,r}},808:e=>{"use strict";function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,n,r,s){n=n||"&",r=r||"=";var i={};if("string"!=typeof e||0===e.length)return i;var a=/\+/g;e=e.split(n);var o=1e3;s&&"number"==typeof s.maxKeys&&(o=s.maxKeys);var u=e.length;o>0&&u>o&&(u=o);for(var c=0;c=0?(l=d.substr(0,m),p=d.substr(m+1)):(l=d,p=""),f=decodeURIComponent(l),h=decodeURIComponent(p),t(i,f)?Array.isArray(i[f])?i[f].push(h):i[f]=[i[f],h]:i[f]=h}return i}},368:e=>{"use strict";var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,n,r,s){return n=n||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(s){var i=encodeURIComponent(t(s))+r;return Array.isArray(e[s])?e[s].map((function(e){return i+encodeURIComponent(t(e))})).join(n):i+encodeURIComponent(t(e[s]))})).join(n):s?encodeURIComponent(t(s))+r+encodeURIComponent(t(e)):""}},642:(e,t,n)=>{"use strict";t.decode=t.parse=n(808),t.encode=t.stringify=n(368)},362:e=>{"use strict";e.exports={ABSOLUTE:"absolute",PATH_RELATIVE:"pathRelative",ROOT_RELATIVE:"rootRelative",SHORTEST:"shortest"}},779:(e,t,n)=>{"use strict";var r=n(362);function s(e,t){var n=t.removeEmptyQueries&&e.extra.relation.minimumPort;return e.query.string[n?"stripped":"full"]}function i(e,t){return!e.extra.relation.minimumQuery||t.output===r.ABSOLUTE||t.output===r.ROOT_RELATIVE}function a(e,t){var n=t.removeDirectoryIndexes&&e.extra.resourceIsIndex,s=e.extra.relation.minimumResource&&t.output!==r.ABSOLUTE&&t.output!==r.ROOT_RELATIVE;return!!e.resource&&!s&&!n}e.exports=function(e,t){var n="";return n+=function(e,t){var n="";return(e.extra.relation.maximumHost||t.output===r.ABSOLUTE)&&(e.extra.relation.minimumScheme&&t.schemeRelative&&t.output!==r.ABSOLUTE?n+="//":n+=e.scheme+"://"),n}(e,t),n+=function(e,t){return!e.auth||t.removeAuth||!e.extra.relation.maximumHost&&t.output!==r.ABSOLUTE?"":e.auth+"@"}(e,t),n+=function(e,t){return e.host.full&&(e.extra.relation.maximumAuth||t.output===r.ABSOLUTE)?e.host.full:""}(e,t),n+=function(e,t){return e.port&&!e.extra.portIsDefault&&e.extra.relation.maximumHost?":"+e.port:""}(e),n+=function(e,t){var n="",o=e.path.absolute.string,u=e.path.relative.string,c=a(e,t);if(e.extra.relation.maximumHost||t.output===r.ABSOLUTE||t.output===r.ROOT_RELATIVE)n=o;else if(u.length<=o.length&&t.output===r.SHORTEST||t.output===r.PATH_RELATIVE){if(""===(n=u)){var l=i(e,t)&&!!s(e,t);e.extra.relation.maximumPath&&!c?n="./":!e.extra.relation.overridesQuery||c||l||(n="./")}}else n=o;return"/"!==n||c||!t.removeRootTrailingSlash||e.extra.relation.minimumPort&&t.output!==r.ABSOLUTE||(n=""),n}(e,t),n+=function(e,t){return a(e,t)?e.resource:""}(e,t),n+=function(e,t){return i(e,t)?s(e,t):""}(e,t),n+=function(e,t){return e.hash?e.hash:""}(e),n}},755:(e,t,n)=>{"use strict";var r=n(362),s=n(779),i=n(141),a=n(609),o=n(398),u=n(258);function c(e,t){this.options=i(t,{defaultPorts:{ftp:21,http:80,https:443},directoryIndexes:["index.html"],ignore_www:!1,output:c.SHORTEST,rejectedSchemes:["data","javascript","mailto"],removeAuth:!1,removeDirectoryIndexes:!0,removeEmptyQueries:!1,removeRootTrailingSlash:!0,schemeRelative:!0,site:void 0,slashesDenoteHost:!0}),this.from=o.from(e,this.options,null)}c.prototype.relate=function(e,t,n){if(a.isPlainObject(t)?(n=t,t=e,e=null):t||(t=e,e=null),n=i(n,this.options),e=e||n.site,!(e=o.from(e,n,this.from))||!e.href)throw new Error("from value not defined.");if(e.extra.hrefInfo.minimumPathOnly)throw new Error("from value supplied is not absolute: "+e.href);return!1===(t=o.to(t,n)).valid?t.href:(t=u(e,t,n),t=s(t,n))},c.relate=function(e,t,n){return(new c).relate(e,t,n)},a.shallowMerge(c,r),e.exports=c},141:(e,t,n)=>{"use strict";var r=n(609);function s(e,t){return t instanceof Object&&e instanceof Object?t instanceof Array&&e instanceof Array?t.concat(e):r.shallowMerge(e,t):e}e.exports=function(e,t){if(r.isPlainObject(e)){var n={};for(var i in t)t.hasOwnProperty(i)&&(void 0!==e[i]?n[i]=s(e[i],t[i]):n[i]=t[i]);return n}return t}},420:e=>{"use strict";e.exports=function(e,t){if(t.ignore_www){var n=e.host.full;if(n){var r=n;0===n.indexOf("www.")&&(r=n.substr(4)),e.host.stripped=r}}}},849:e=>{"use strict";e.exports=function(e){var t=!(e.scheme||e.auth||e.host.full||e.port),n=t&&!e.path.absolute.string,r=n&&!e.resource,s=r&&!e.query.string.full.length,i=s&&!e.hash;e.extra.hrefInfo.minimumPathOnly=t,e.extra.hrefInfo.minimumResourceOnly=n,e.extra.hrefInfo.minimumQueryOnly=r,e.extra.hrefInfo.minimumHashOnly=s,e.extra.hrefInfo.empty=i}},398:(e,t,n)=>{"use strict";var r=n(849),s=n(420),i=n(965),a=n(22),o=n(150),u=n(936),c=n(831);function l(e,t){var n=u(e,t);return!1===n.valid||(s(n,t),a(n,t),i(n,t),o(n,t),r(n)),n}e.exports={from:function(e,t,n){if(e){var r=l(e,t),s=c.resolveDotSegments(r.path.absolute.array);return r.path.absolute.array=s,r.path.absolute.string="/"+c.join(s),r}return n},to:l}},965:e=>{"use strict";function t(e){if("/"!==e){var t=[];return e.split("/").forEach((function(e){""!==e&&t.push(e)})),t}return[]}e.exports=function(e,n){var r=e.path.absolute.string;if(r){var s=r.lastIndexOf("/");if(s>-1){if(++s{"use strict";e.exports=function(e,t){var n=-1;for(var r in t.defaultPorts)if(r===e.scheme&&t.defaultPorts.hasOwnProperty(r)){n=t.defaultPorts[r];break}n>-1&&(n=n.toString(),null===e.port&&(e.port=n),e.extra.portIsDefault=e.port===n)}},150:e=>{"use strict";var t=Object.prototype.hasOwnProperty;function n(e,n){var r=0,s="";for(var i in e)if(""!==i&&!0===t.call(e,i)){var a=e[i];""===a&&n||(s+=1==++r?"?":"&",i=encodeURIComponent(i),s+=""!==a?i+"="+encodeURIComponent(a).replace(/%20/g,"+"):i)}return s}e.exports=function(e,t){e.query.string.full=n(e.query.object,!1),t.removeEmptyQueries&&(e.query.string.stripped=n(e.query.object,!0))}},936:(e,t,n)=>{"use strict";var r=n(883).Qc;e.exports=function(e,t){return function(e,t){var n=!0;return t.rejectedSchemes.every((function(t){return n=!(0===e.indexOf(t+":"))})),n}(e,t)?(n=r(e,!0,t.slashesDenoteHost),(s=n.protocol)&&s.indexOf(":")===s.length-1&&(s=s.substr(0,s.length-1)),n.host={full:n.hostname,stripped:null},n.path={absolute:{array:null,string:n.pathname},relative:{array:null,string:null}},n.query={object:n.query,string:{full:null,stripped:null}},n.extra={hrefInfo:{minimumPathOnly:null,minimumResourceOnly:null,minimumQueryOnly:null,minimumHashOnly:null,empty:null,separatorOnlyQuery:"?"===n.search},portIsDefault:null,relation:{maximumScheme:null,maximumAuth:null,maximumHost:null,maximumPort:null,maximumPath:null,maximumResource:null,maximumQuery:null,maximumHash:null,minimumScheme:null,minimumAuth:null,minimumHost:null,minimumPort:null,minimumPath:null,minimumResource:null,minimumQuery:null,minimumHash:null,overridesQuery:null},resourceIsIndex:null,slashes:n.slashes},n.resource=null,n.scheme=s,delete n.hostname,delete n.pathname,delete n.protocol,delete n.search,delete n.slashes,n):{href:e,valid:!1};var n,s}},799:(e,t,n)=>{"use strict";var r=n(19),s=n(609),i=n(831);e.exports=function(e,t,n){r.upToPath(e,t,n),e.extra.relation.minimumScheme&&(e.scheme=t.scheme),e.extra.relation.minimumAuth&&(e.auth=t.auth),e.extra.relation.minimumHost&&(e.host=s.clone(t.host)),e.extra.relation.minimumPort&&function(e,t){e.port=t.port,e.extra.portIsDefault=t.extra.portIsDefault}(e,t),e.extra.relation.minimumScheme&&function(e,t){if(e.extra.relation.maximumHost||!e.extra.hrefInfo.minimumResourceOnly){var n=e.path.absolute.array,r="/";n?(e.extra.hrefInfo.minimumPathOnly&&0!==e.path.absolute.string.indexOf("/")&&(n=t.path.absolute.array.concat(n)),n=i.resolveDotSegments(n),r+=i.join(n)):n=[],e.path.absolute.array=n,e.path.absolute.string=r}else e.path=s.clone(t.path)}(e,t),r.pathOn(e,t,n),e.extra.relation.minimumResource&&function(e,t){e.resource=t.resource,e.extra.resourceIsIndex=t.extra.resourceIsIndex}(e,t),e.extra.relation.minimumQuery&&(e.query=s.clone(t.query)),e.extra.relation.minimumHash&&(e.hash=t.hash)}},19:e=>{"use strict";e.exports={pathOn:function(e,t,n){var r=e.extra.hrefInfo.minimumQueryOnly,s=e.extra.hrefInfo.minimumHashOnly,i=e.extra.hrefInfo.empty,a=e.extra.relation.minimumPort,o=e.extra.relation.minimumScheme,u=a&&e.path.absolute.string===t.path.absolute.string,c=e.resource===t.resource||!e.resource&&t.extra.resourceIsIndex||n.removeDirectoryIndexes&&e.extra.resourceIsIndex&&!t.resource,l=u&&(c||r||s||i),p=n.removeEmptyQueries?"stripped":"full",f=e.query.string[p],h=t.query.string[p],d=l&&!!f&&f===h||(s||i)&&!e.extra.hrefInfo.separatorOnlyQuery,m=d&&e.hash===t.hash;e.extra.relation.minimumPath=u,e.extra.relation.minimumResource=l,e.extra.relation.minimumQuery=d,e.extra.relation.minimumHash=m,e.extra.relation.maximumPort=!o||o&&!u,e.extra.relation.maximumPath=!o||o&&!l,e.extra.relation.maximumResource=!o||o&&!d,e.extra.relation.maximumQuery=!o||o&&!m,e.extra.relation.maximumHash=!o||o&&!m,e.extra.relation.overridesQuery=u&&e.extra.relation.maximumResource&&!d&&!!h},upToPath:function(e,t,n){var r=e.extra.hrefInfo.minimumPathOnly,s=e.scheme===t.scheme||!e.scheme,i=s&&(e.auth===t.auth||n.removeAuth||r),a=n.ignore_www?"stripped":"full",o=i&&(e.host[a]===t.host[a]||r),u=o&&(e.port===t.port||r);e.extra.relation.minimumScheme=s,e.extra.relation.minimumAuth=i,e.extra.relation.minimumHost=o,e.extra.relation.minimumPort=u,e.extra.relation.maximumScheme=!s||s&&!i,e.extra.relation.maximumAuth=!s||s&&!o,e.extra.relation.maximumHost=!s||s&&!u}}},258:(e,t,n)=>{"use strict";var r=n(799),s=n(255);e.exports=function(e,t,n){return r(t,e,n),s(t,e,n),t}},255:(e,t,n)=>{"use strict";var r=n(831);e.exports=function(e,t,n){if(e.extra.relation.minimumScheme){var s=(i=e.path.absolute.array,a=t.path.absolute.array,o=[],u=!0,c=-1,a.forEach((function(e,t){u&&(i[t]!==e?u=!1:c=t),u||o.push("..")})),i.forEach((function(e,t){t>c&&o.push(e)})),o);e.path.relative.array=s,e.path.relative.string=r.join(s)}var i,a,o,u,c}},609:e=>{"use strict";e.exports={clone:function e(t){if(t instanceof Object){var n=t instanceof Array?[]:{};for(var r in t)t.hasOwnProperty(r)&&(n[r]=e(t[r]));return n}return t},isPlainObject:function(e){return!!e&&"object"==typeof e&&e.constructor===Object},shallowMerge:function(e,t){if(e instanceof Object&&t instanceof Object)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}}},831:e=>{"use strict";e.exports={join:function(e){return e.length>0?e.join("/")+"/":""},resolveDotSegments:function(e){var t=[];return e.forEach((function(e){".."!==e?"."!==e&&t.push(e):t.length>0&&t.splice(t.length-1,1)})),t}}},639:function(e,t,n){var r;e=n.nmd(e),function(s){t&&t.nodeType,e&&e.nodeType;var i="object"==typeof n.g&&n.g;i.global!==i&&i.window!==i&&i.self;var a,o=2147483647,u=36,c=/^xn--/,l=/[^\x20-\x7E]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=Math.floor,d=String.fromCharCode;function m(e){throw RangeError(f[e])}function y(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function x(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+y((e=e.replace(p,".")).split("."),t).join(".")}function g(e){for(var t,n,r=[],s=0,i=e.length;s=55296&&t<=56319&&s65535&&(t+=d((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=d(e)})).join("")}function E(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function b(e,t,n){var r=0;for(e=n?h(e/700):e>>1,e+=h(e/t);e>455;r+=u)e=h(e/35);return h(r+36*e/(e+38))}function S(e){var t,n,r,s,i,a,c,l,p,f,d,y=[],x=e.length,g=0,E=128,S=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r=128&&m("not-basic"),y.push(e.charCodeAt(r));for(s=n>0?n+1:0;s=x&&m("invalid-input"),((l=(d=e.charCodeAt(s++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:u)>=u||l>h((o-g)/a))&&m("overflow"),g+=l*a,!(l<(p=c<=S?1:c>=S+26?26:c-S));c+=u)a>h(o/(f=u-p))&&m("overflow"),a*=f;S=b(g-i,t=y.length+1,0==i),h(g/t)>o-E&&m("overflow"),E+=h(g/t),g%=t,y.splice(g++,0,E)}return _(y)}function v(e){var t,n,r,s,i,a,c,l,p,f,y,x,_,S,v,A=[];for(x=(e=g(e)).length,t=128,n=0,i=72,a=0;a=t&&yh((o-n)/(_=r+1))&&m("overflow"),n+=(c-t)*_,t=c,a=0;ao&&m("overflow"),y==t){for(l=n,p=u;!(l<(f=p<=i?1:p>=i+26?26:p-i));p+=u)v=l-f,S=u-f,A.push(d(E(f+v%S,0))),l=h(v/S);A.push(d(E(l,0))),i=b(n,_,r==s),n=0,++r}++n,++t}return A.join("")}a={version:"1.3.2",ucs2:{decode:g,encode:_},decode:S,encode:v,toASCII:function(e){return x(e,(function(e){return l.test(e)?"xn--"+v(e):e}))},toUnicode:function(e){return x(e,(function(e){return c.test(e)?S(e.slice(4).toLowerCase()):e}))}},void 0===(r=function(){return a}.call(t,n,t,e))||(e.exports=r)}()},883:(e,t,n)=>{"use strict";var r=n(639),s=n(225);function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.Qc=_;var a=/^([a-z0-9.+-]+:)/i,o=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(c),p=["%","/","?",";","#"].concat(l),f=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},x={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},g=n(642);function _(e,t,n){if(e&&s.isObject(e)&&e instanceof i)return e;var r=new i;return r.parse(e,t,n),r}i.prototype.parse=function(e,t,n){if(!s.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),o=-1!==i&&i127?R+="x":R+=L[j];if(!R.match(h)){var D=k.slice(0,T),$=k.slice(T+1),P=L.match(d);P&&(D.push(P[1]),$.unshift(P[2])),$.length&&(_="/"+$.join(".")+_),this.hostname=D.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),N||(this.hostname=r.toASCII(this.hostname));var M=this.port?":"+this.port:"",Q=this.hostname||"";this.host=Q+M,this.href+=this.host,N&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==_[0]&&(_="/"+_))}if(!m[S])for(T=0,F=l.length;T0)&&n.host.split("@"))&&(n.auth=N.shift(),n.host=n.hostname=N.shift());return n.search=e.search,n.query=e.query,s.isNull(n.pathname)&&s.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!v.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var O=v.slice(-1)[0],w=(n.host||e.host||v.length>1)&&("."===O||".."===O)||""===O,T=0,I=v.length;I>=0;I--)"."===(O=v[I])?v.splice(I,1):".."===O?(v.splice(I,1),T++):T&&(v.splice(I,1),T--);if(!b&&!S)for(;T--;T)v.unshift("..");!b||""===v[0]||v[0]&&"/"===v[0].charAt(0)||v.unshift(""),w&&"/"!==v.join("/").substr(-1)&&v.push("");var N,k=""===v[0]||v[0]&&"/"===v[0].charAt(0);A&&(n.hostname=n.host=k?"":v.length?v.shift():"",(N=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=N.shift(),n.host=n.hostname=N.shift()));return(b=b||n.host&&v.length)&&!k&&v.unshift(""),v.length?n.pathname=v.join("/"):(n.pathname=null,n.path=null),s.isNull(n.pathname)&&s.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var e=this.host,t=o.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},225:e=>{"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},863:(e,t,n)=>{const r=function(){const e=n(118);function t(e){e||(e={});for(let t,n=1,r=arguments.length;n0&&0===c[0].errors.length&&c.forEach((n=>{const r="expression"in u?u.expression.solutions.slice():[];"solution"in n&&r.push(n.solution),delete n.solution,n.expression=t({type:e,solutions:r},o)})),0===c.length||c[0].errors.length>0)return s0&&0===a[0].errors.length&&"semActs"in r){const e=[],t=[];a.forEach((n=>{const s=f.dispatchAll(r.semActs,"???",n);0===s.length?e.push(n):([].push.apply(n.errors,s),t.push(n))})),a=e.length>0?e:t}return a}if("TripleConstraint"===r.type){const x="negated"in r&&r.negated||0===h;x&&(l=h=1/0),void 0===i.avail[o]&&(i.avail[o]=c[o].map((e=>e.tNo)));const g={};("min"in r&&1!==r.min||"max"in r&&1!==r.max)&&(g.min=r.min,g.max=r.max),"semActs"in r&&(g.semActs=r.semActs),"annotations"in r&&(g.annotations=r.annotations);const _=i.avail[o].splice(0,l),E=x?0===_.length:_.length>=l,b=[],S=i.matched;if(E)do{const v=_.reduce(((e,t)=>{const n=p[t],s={type:"TestedTriple",subject:n.subject,predicate:n.predicate,object:a(n.object)},u=c[o].find((e=>e.tNo===t));u.res&&Object.keys(u.res).length>0&&(s.referenced=u.res);const l=i.errors.concat("semActs"in r?f.dispatchAll(r.semActs,s,s):[]);return l.length>0?e.fail.push({tripleNo:t,tested:s,semActErrors:l}):e.pass.push({tripleNo:t,tested:s,semActErrors:l}),e}),{pass:[],fail:[]});if(0===v.fail.length){const A=0===_.length?i.errors.slice():[],O=m(v.pass,A);b.push(O)}else v.fail.forEach((e=>b.push(m([e],e.semActErrors))));function m(e,n){return{avail:i.avail.map((e=>e.slice())),errors:n,matched:S.concat({tNos:e.map((e=>e.tripleNo))}),expression:t({type:"TripleConstraintSolutions",predicate:r.predicate},"valueExpr"in r?{valueExpr:r.valueExpr}:{},"id"in r?{productionLabel:r.id}:{},g,{solutions:e.map((e=>e.tested))})}}}while(i.avail[o].length>0&&_.length{const t=[],s=[];return r.expressions.forEach((r=>{const i={avail:e.avail.map((e=>e.slice())),errors:e.errors,matched:e.matched},a=n(r,i);0===a[0].errors.length?([].push.apply(t,a),a.forEach((e=>{const t="solution"in i?i.solution.expressions:[];"expression"in e&&t.push(e.expression),delete e.expression,e.solution={type:"OneOfSolution",expressions:t}}))):[].push.apply(s,a)})),t.length>0?t:s}));if("EachOf"===r.type)return y(d("EachOfSolutions",(e=>r.expressions.reduce(((e,t)=>y(e.reduce(((e,r)=>{const s=n(t,r);return s.forEach((e=>{if(0===e.errors.length){const t="solution"in r?r.solution.expressions.slice():[];"expression"in e&&t.push(e.expression),delete e.expression,e.solution={type:"EachOfSolution",expressions:t}}})),e.concat(s)}),[]))),[e]))));function y(e){return e.reduce(((e,t)=>0===t.errors.length?e.errors?{errors:!1,l:[t]}:{errors:!1,l:e.l.concat(t)}:e.errors?{errors:!0,l:e.l.concat(t)}:e),{errors:!0,l:[]}).l}runtimeError("unexpected expr type: "+r.type)}(i,{avail:[],matched:[],errors:[]}),m=d.reduce(((e,t)=>{if(t.errors.length>0)return e;const n={};return Object.keys(l).forEach((e=>{"NO_TRIPLE_CONSTRAINT"!==l[e]&&(n[e]=l[e])})),t.matched.forEach((e=>{e.tNos.forEach((e=>{delete n[e]}))})),Object.keys(n).forEach((e=>{t.errors.push({type:"ExcessTripleViolation",triple:p[e],constraint:u[n[e]]})})),null!==e?e:Object.keys(n).length>0?null:t}),null);return null!==m?function(t,n,s,i){function o(u){if("OneOfSolutions"===u.type||"EachOfSolutions"===u.type)u.solutions.forEach((e=>{e.expressions.forEach((e=>{o(e)}))}));else{if("TripleConstraintSolutions"!==u.type)throw Error("unexpected expr type in "+JSON.stringify(u));u.solutions=u.solutions.map((o=>{if("TestedTriple"===o.type)return o;const u=s[o.tripleNo],c=n[o.constraintNo],l={type:"TestedTriple",subject:u.subject,predicate:u.predicate,object:a(u.object)};function p(t,n,s){const i=s(t,n);if("errors"in i){const s={type:"ReferenceError",focus:t,shape:n};return"string"==typeof n&&e.isBlank(n)&&(s.referencedShape=r),s.errors=i,[s]}return(("solution"in i||"solutions"in i)&&0!==Object.keys(i.solution||i.solutions).length||"Recursion"===i.type)&&(l.referenced=i),[]}function f(e,t){return p(e,t,recurse)}function h(e,t){return p(e,t,direct)}const d="valueExpr"in c?checkValueExpr(c.inverse?u.subject:u.object,c.valueExpr,f,h):[];return 0===d.length&&"semActs"in c&&[].push.apply(d,i.dispatchAll(c.semActs,l,l)),d.length>0&&(t.errors=t.errors||[],t.errors=t.errors.concat(d)),l}))}}Object.keys(t).length>0&&o(t);"semActs"in r&&(t.semActs=r.semActs);return t}(m.expression,u,p,f):d.length>1?{type:"PossibleErrors",errors:d.reduce(((e,t)=>e.concat([t.errors])),[])}:d[0]}};function a(t){if('"'!==t[0])return t;const n={value:e.getLiteralValue(t)},r=e.getLiteralType(t);r&&"http://www.w3.org/2001/XMLSchema#string"!==r&&"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"!==r&&(n.type=r);const s=e.getLiteralLanguage(t);return s&&(n.language=s),n}}}}();e.exports=r},865:(e,t,n)=>{e.exports=function(e){const t=n(118);n(279);const r="http://www.w3.org/2001/XMLSchema#",s=[r+"integer",r+"nonPositiveInteger",r+"negativeInteger",r+"long",r+"int",r+"short",r+"byte",r+"nonNegativeInteger",r+"unsignedLong",r+"unsignedInt",r+"unsignedShort",r+"unsignedByte",r+"positiveInteger"],i=[r+"decimal"].concat(s),a=[r+"float",r+"double"].concat(i),o={"http://www.w3.org/2001/XMLSchema#integer":function(e,t){return e.match(/^[+-]?[0-9]+$/)||t("illegal integer value '"+e+"'"),parseInt(e)},"http://www.w3.org/2001/XMLSchema#decimal":function(e,t){return e.match(/^[+-]?(?:[0-9]*\.[0-9]+|[0-9]+)$/)||t("illegal integer value '"+e+"'"),parseFloat(e)},"http://www.w3.org/2001/XMLSchema#float":function(e,t){return e.match(/^[+-]?(?:[0-9]*\.[0-9]+|[0-9]+)$/)||t("illegal integer value '"+e+"'"),parseFloat(e)},"http://www.w3.org/2001/XMLSchema#double":function(e,t){return e.match(/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/)||t("illegal integer value '"+e+"'"),Number(e)}},u={length:function(e,t){return e.length===t},minlength:function(e,t){return e.length>=t},maxlength:function(e,t){return e.length<=t}},c={mininclusive:function(e,t){return e>=t},minexclusive:function(e,t){return e>t},maxinclusive:function(e,t){return e<=t},maxexclusive:function(e,t){return e2&&e[t]!==n&&y("expected "+t+" attribute '"+e[t]+"' to equal '"+n+"'.")}function m(){}function y(){const e=Array.prototype.join.call(arguments,""),t=new Error("Runtime error: "+e);throw Error.captureStackTrace(t,y),t}return{construct:function i(h,x,g){if(!(this instanceof i))return new i(h,x,g);this.type="ShExValidator",g=g||{},this.options=g,this.options.or=this.options.or||"someOf",this.options.partition=this.options.partition||"exhaustive","noCache"in g&&g.noCache||(this.known=function(){const e={},t={};return{cached:function(n,r){let s=e[n];if(!s)return e[n]=s=[],void(t[n]=[]);const i=s.indexOf(r);return-1===i?void 0:t[n][i]},remember:function(n,r,s){const i=e[n];if(i){if(-1!==i.indexOf(r))throw Error("not expecting duplicate key "+key)}else e[n]=[],t[n]=[];e[n].push(r),t[n].push(s)}}}());const _=this;this.schema=h,this._expect=this.options.lax?m:d,this._optimize={},this.reset=function(){};const E=this.options.regexModule||n(991);let b=0;const S=g.nextBNode||function(){return"_:b"+b++};this.getAST=function(){return{type:"AST",shapes:Object.keys(this.schema._index.shapeExprs).reduce((function(e,t){return e[t]={type:"ASTshape",expression:f(_.schema._index.shapeExprs[t].expression,[],_.schema)},e}),{})}},this.indexTripleConstraints=function(e){const t=[];return e&&function e(n){"TripleConstraint"===n.type?t.push(n):"OneOf"===n.type||"EachOf"===n.type?n.expressions.forEach((function(t){e(t)})):"Inclusion"===n.type?e(h.productions[n.include]):y("unexpected expr type: "+n.type)}(e),t},this.validate=function(t,n,r,s,i){if(r&&r!==e.Validator.start||(h.start||y("start production not defined"),r=h.start),"string"!=typeof r)return this._validateShapeExpr(t,n,r,"_: -start-",s,i);r in this.schema._index.shapeExprs||y("shape "+r+" not defined");const a=r;void 0===i&&(i={});const o=n+"|"+a;if(o in i)return{type:"Recursion",node:p(n),shape:a};i[o]={point:n,shapeLabel:a};const u=this._validateShapeExpr(t,n,h._index.shapeExprs[a],a,s,i);return delete i[o],u},this._validateShapeExpr=function(e,t,n,r,s,i){if("known"in this&&this.known.cached(t,n))return this.known.cached(t,n);let a=null;if(""===t)throw Error("validation needs a valid focus node");if("string"==typeof n)a=this._validateShapeExpr(e,t,h._index.shapeExprs[n],n,s,i);else if("NodeConstraint"===n.type){const e=this._errorsMatchingNodeConstraint(t,n,null);a=e.length?{type:"Failure",node:p(t),shape:r,errors:e.map((function(e){return{type:"NodeConstraintViolation",shapeExpr:n}}))}:{type:"NodeConstraintTest",node:p(t),shape:r,shapeExpr:n}}else if("Shape"===n.type)a=this._validateShape(e,t,E.compile(h,n),n,r,s,i);else if("ShapeExternal"===n.type)a=this.options.validateExtern(e,t,r,s,i);else if("ShapeOr"===n.type){const o=[];a={type:"ShapeOrFailure",errors:o};for(let u=0;u{}},c.schema,n,y,g,_);const f=o.length,h=p.getQuads().map(t.internalTriple);return o.push.apply(o,h),Array.apply(null,{length:h.length}).map(((e,t)=>t+f))}if("errors"in v){if(m.push({errors:v.errors}),"exhaustive"!==c.options.partition)break;continue}const A={type:"ShapeTest",node:p(r),shape:a};if(Object.keys(v).length>0&&(A.solution=v),!("semActs"in i)||this.semActHandler.dispatchAll(i.semActs,v,A))l=A;else if(m.push({errors:[{type:"SemActFailure",errors:[{type:"UntrackedSemActFailure"}]}]}),"exhaustive"!==c.options.partition)break}if(null===l){const O=[];l={type:"Failure",node:p(r),shape:a,errors:O.concat(1===m.length?m[0].errors:m)}}return"startActs"in h&&0===o&&(l.startActs=h.startActs),l},this._triplesMatchingShapeExpr=function(e,t,n,r,s){const i=this,a=[],o=[];return e.forEach((function(e){const u=n?e.subject:e.object,c=void 0===t?[]:i._errorsMatchingShapeExpr(u,t,r,s);0===c.length?o.push(e):-1===o.indexOf(e)&&a.push({triple:e,errors:c})})),{hits:o,misses:a}},this._errorsMatchingShapeExpr=function(e,t,n,r){const s=this;if("string"==typeof t)return n?n(e,t):[];if("NodeConstraint"===t.type)return this._errorsMatchingNodeConstraint(e,t,null);if("Shape"===t.type)return void 0===r?[]:r(e,t);if("ShapeOr"===t.type){const i=[];for(let a=0;a{if(t)return!0;if("object"!=typeof n||!("value"in n))return!1;const r=p(e);return n.value===r.value&&n.type===r.type&&n.language===r.language}),!1)||-1!==n.values.indexOf(e)||n.values.some((function(t){if("object"==typeof t&&!("value"in t)){if(d(t,"type","StemRange"),"object"==typeof t.stem)d(t.stem,"type","Wildcard");else if(!e.startsWith(t.stem))return!1;return!t.exclusions||!t.exclusions.some((function(t){return"object"==typeof t?(d(t,"type","Stem"),e.startsWith(t.stem)):e===t}))}}))||h("value "+e+" not found in set "+n.values)),"pattern"in n){const r=new RegExp(n.pattern);(m=e,t.isIRI(m)?m:t.isLiteral(m)?t.getLiteralValue(m):m.substr(2)).match(r)||h("value "+e+" did not match pattern "+n.pattern)}var m;const y=t.isLiteral(e)?t.getLiteralValue(e):t.isBlank(e)?e.substring(2):e,x=t.isLiteral(e)?t.getLiteralType(e):null,g=-1!==s.indexOf(x)?r+"integer":-1!==a.indexOf(x)?x:void 0;return Object.keys(u).forEach((function(t){t in n&&!u[t](y,n[t])&&h("facet violation: expected "+t+" of "+n[t]+" but got "+e)})),Object.keys(c).forEach((function(t){t in n&&(g?c[t](o[g](y,h),n[t])||h("facet violation: expected "+t+" of "+n[t]+" but got "+e):h("facet violation: numeric facet "+t+" can't apply to "+e))})),Object.keys(l).forEach((function(t){t in n&&(g===r+"integer"||g===r+"decimal"?l[t](""+o[g](y,h),n[t])||h("facet violation: expected "+t+" of "+n[t]+" but got "+e):h("facet violation: numeric facet "+t+" can't apply to "+e))})),f},this.semActHandler={handlers:{},results:{},register:function(e,t){this.handlers[e]=t},dispatchAll:function(e,t,n){const r=this;return e.reduce((function(e,s){if(e&&s.name in r.handlers){const i="code"in s?s.code:_.options.semActs[s.name],a="extensions"in n&&s.name in n.extensions,o=a?n.extensions[s.name]:{};return e=e&&r.handlers[s.name].dispatch(i,t,o),!a&&Object.keys(o).length>0&&("extensions"in n||(n.extensions={}),n.extensions[s.name]=o),e}return e}),!0)}}},options:{or:{oneOf:"exactly one disjunct must pass",someOf:"one or more disjuncts must pass",firstOf:"disjunct evaluation stops after one passes"},partition:{greedy:"each triple constraint consumes all triples matching predicate and object",exhaustive:"search all mappings of triples to triple constriant"}}}}},991:(e,t,n)=>{const r=function(){const e=n(118),t="|",r="×",s="";function i(e){e||(e={});for(let t,n=1,r=arguments.length;n{e[t].outs.push(n)}))}}();function u(s,a,o,u,l,p,f,h,d,m){const y=this;let x=[],g=[];function _(e,t){const n=Object.keys(t).map((e=>e+":"+t[e])).join(",");return n.length?e+"-"+n:""+e}function E(e,n,s,i){i=i||[];const a=_(n,s.repeats);if(-1!==i.indexOf(a))return;i.push(a);const o=y.states[n];if(o.c===t)return o.outs.reduce(((t,n,r)=>t.concat(E(e,n,s,i))),[]);if(o.c===r){const t=[];n in s.repeats||(s.repeats[n]=0);const r=s.repeats[n];return r(n[r]=parseInt(r)==t?e.repeats[r]+1:e.repeats[r],n)),{});return{state:e.state,repeats:n,matched:e.matched,avail:e.avail.slice(),stack:e.stack}}(s,n),i))),r>=o.min&&r<=o.max&&(t=t.concat(E(e,o.outs[1],function(e,t){const n=Object.keys(e.repeats).reduce(((n,r)=>(parseInt(r)!==t&&(n[r]=e.repeats[r]),n)),{});return{state:e.state,repeats:n,matched:e.matched,avail:e.avail.slice(),stack:e.stack}}(s,n),i))),t}return[e.push({state:n,repeats:s.repeats,avail:s.avail.map((e=>e.slice())),stack:s.stack,matched:s.matched,errors:s.errors})-1]}if(1===y.states.length)return c([],o,l,p,f,h,d);let b=null;for(E(x,this.start,{repeats:{},avail:[],matched:[],stack:[],errors:[]});x.length;){g.length=0,m&&m.push({threads:[]});for(let e=0;e=a)do{const e=y.states.map((e=>e.c===r?e.expr:null)),s=n.stack.map((n=>{let r=t.repeats[e.indexOf(n.c)];return void 0===r?r=0:r-=1,{c:n.c,e:n.e,i:r}})),i={c:n.c,triples:p,stack:s};t.matched=t.matched.concat(i),n.outs.forEach((e=>{E(g,e,t)}))}while(t.avail[i].length>0&&p.length_(e.state,e.repeats)))})}if(0===g.length&&null===b)return S(v(x,y.states));const e=x;x=g,g=e;const t=x.reduce(((e,t)=>null!==e?e:t.state===y.end?t:null),null);t&&(b=t)}if(null===b)return S(v(x,y.states));function S(e){return{type:"Failure",node:a,errors:e}}function v(t,r){const s=r[r.length-1];return t.map((t=>{const r=i({},y.states[t.state].c.valueExpr);if("reference"in r){const t=r.reference;e.isBlank(t)&&(r.reference=n.shapes[t])}return i({type:s.c.negated?"NegatedProperty":t.state===y.end?"ExcessTripleViolation":"MissingProperty",property:s.c.predicate},Object.keys(r).length>0?{valueExpr:r}:{})}))}return"errors"in b.matched?b.matched:c(b.matched,o,l,p,f,h,d)}function c(t,n,r,s,i,o,u){let c=[];const l=[],p=[],f=t.reduce(((t,n)=>{let a,f=0,h=t;for(;f=c.length&&c.push({}),n.stack[f].c!==c[f].c){if(a=[],h.type="EachOf"===n.stack[f].c.type?"EachOfSolutions":"OneOfSolutions",h.solutions=a,"min"in n.stack[f].c&&(h.min=n.stack[f].c.min),"max"in n.stack[f].c&&(h.max=n.stack[f].c.max),"annotations"in n.stack[f].c&&(h.annotations=n.stack[f].c.annotations),"semActs"in n.stack[f].c&&(h.semActs=n.stack[f].c.semActs),h=a,c[f].i=null,"semActs"in n.stack[f].c&&!o.dispatchAll(n.stack[f].c.semActs,"???",h))throw{type:"SemActFailure",errors:[{type:"UntrackedSemActFailure"}]}}else h=h.solutions;if(n.stack[f].i!==c[f].i?(a=[],h[n.stack[f].i]={type:"EachOf"===n.stack[f].c.type?"EachOfSolution":"OneOfSolution",expressions:a},h=a,c[f].e=null):h=h[c[f].i].expressions,n.stack[f].e===c[f].e)throw"how'd we get here?";a={},h[n.stack[f].e]=a,n.stack[f].e>0&&void 0===h[n.stack[f].e-1]&&-1===p.indexOf(h)&&p.push(h),h=a,c.length=f+1,++f}return h.type="TripleConstraintSolutions","min"in n.c&&(h.min=n.c.min),"max"in n.c&&(h.max=n.c.max),h.predicate=n.c.predicate,"valueExpr"in n.c&&(h.valueExpr=n.c.valueExpr),"productionLabel"in n.c&&(h.productionLabel=n.c.productionLabel),h.solutions=n.triples.map((t=>{const a=r[t],c={type:"TestedTriple",subject:a.subject,predicate:a.predicate,object:function(t){if('"'!==t[0])return t;const n={value:e.getLiteralValue(t)},r=e.getLiteralType(t);r&&"http://www.w3.org/2001/XMLSchema#string"!==r&&"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"!==r&&(n.type=r);const s=e.getLiteralLanguage(t);s&&(n.language=s);return n}(a.object)};function p(t,n,r){const s=r(t,n);if("errors"in s){const r={type:"ReferenceError",focus:t,shape:n,errors:s};return"string"==typeof shapeLabel&&e.isBlank(shapeLabel)&&(r.referencedShape=n),[r]}return("solution"in s&&0!==Object.keys(s.solution).length||"Recursion"===s.type)&&(c.referenced=s),[]}return"valueExpr"in h&&[].push.apply(l,u(h.inverse?a.subject:a.object,h.valueExpr,(function(e,t){return p(e,t,s)}),(function(e,t){return p(e,t,i)}))),0===l.length&&"semActs"in n.c&&!o.dispatchAll(n.c.semActs,a,c)&&l.push({type:"SemActFailure",errors:[{type:"UntrackedSemActFailure"}]}),c})),"annotations"in n.c&&(h.annotations=n.c.annotations),"semActs"in n.c&&(h.semActs=n.c.semActs),c=n.stack.slice(),t}),{});return l.length?{type:"SemActFailure",errors:l}:(p.forEach((e=>{for(let t=0;t{const t={collapseSpaces:function(e){return e.replace(/ +/g," ")},trimQuotes:function(e){return void 0===e||e.length<2||'"'!==e[0]&&"'"!==e[0]||e[0]!==e[e.length-1]?e:e.substring(1,e.length-1)},unescapeMetaChars:function(e){return e.replace(/\\([\/^$])/g,"$1")}};e.exports=t},386:(e,t,n)=>{const r=function(){const e=n(445),t=n(521);n(961);function r(e){if(void 0===e)throw Error("Invalid extension function: "+e+"!");const t=(e=e.trim()).indexOf("(",0),n=e.lastIndexOf(")");if(t<2||n<4||n<=t+1||n!=e.length-1)throw Error("Invalid extension function: "+e+"!");return{name:e.substring(0,t),args:e.substring(t+1,n)}}return{lift:function(n,s,i){const a=r(n);switch(a.name){case"hashmap":return e.lift(n,s,i,a.args);case"regex":return t.lift(n,s,i,a.args);case"test":return n;default:throw Error("Unknown extension: "+n+"!")}},lower:function(n,s,i){const a=r(n);switch(a.name){case"hashmap":return e.lower(n,s,i,a.args);case"regex":return t.lower(n,s,i,a.args);case"test":return n;default:throw Error("Unknown extension: "+n+"!")}}}}();e.exports=r},445:(e,t,n)=>{const r=function(){const e=n(961);function t(e,t){if(void 0===t||0===t.length)throw Error("Hashmap extension requires a variable name and map as arguments, but found none!");const n=/^[ ]*([\w:<>]+)[ ]*,[ ]*({.*)$/.exec(t);if(null===n||n.length<3)throw Error("Hashmap extension requires a variable name and map as arguments, but found: "+e+"!");const r=n[1],s=n[2];let i;try{if(i=JSON.parse(s),0===Object.keys(i).length)throw Error("Empty hashmap!")}catch(t){throw Error("Hashmap extension unable to parse map in "+e+"!"+t.message)}const a=Object.values(i);if(a.length!=[...new Set(a)].length)throw Error("Hashmap extension requires unique key/value pairs!");return{varName:r,hash:i}}function r(e,t){const n=e.match(/^([\w]+):(.*)$/);if(null!==n&&3==n.length){const r=n[1],s=n[2];if(0===r.length||0===s.length)throw Error("Hashmap extension given invalid target variable name "+e);if(!(r in t))throw Error("Hashmap extension given undefined variable prefix "+r);expandedName=t[r]+s}else expandedName=e;return expandedName}return{lift:function(n,s,i,a){const o=t(n,a),u=r(o.varName,i),c=e.trimQuotes(s);if(0===c.length)throw Error("Hashmap extension has no input");return{[u]:o.hash[c]}},lower:function(n,s,i,a){const o=t(n,a),u=r(o.varName,i),c=e.trimQuotes(s.get(u));if(void 0===c)throw Error("Unable to find mapped value for "+o.varName);const l=function(e,t){const n=Object.keys(e).find((n=>t===e[n]));if(!n)throw Error("Hashmap extension was unable to invert the value "+t+" with map "+JSON.stringify(e,{depth:null})+"!");return n}(o.hash,c);return 0!==l.length?e.unescapeMetaChars(e.collapseSpaces(l)):l}}}();e.exports=r},521:(e,t,n)=>{const r=function(){const e=n(961),t="(\\?<(?:[a-zA-Z:]+|<[^>]+>)>)";function r(t,n,r){const s=function(e,t){const n=e.match(/^ *(?:<([^>]*)>|([^:]*):([^ ]*)) *$/);if(null===n)throw Error('variable "'+e+'" did not match expected pattern!');let r;if(n[1])r=n[1];else{if(!(n[2]in t))throw Error("Unknown prefix "+n[2]+' in "'+e+'"!');r=t[n[2]]+n[3]}return r}(e.unescapeMetaChars(t.substr(2,t.length-3)),r);if(s in n)throw Error("unable to process prefixes in "+s);return n.push(s),s}function s(e){if(/^\s*\/.*\/\s*$/.test(e)&&(e=/^\s*\/(.*)\/\s*$/.exec(e)[1]).length<1)throw Error(mapDirective+" is missing the required regex pattern");return e}return{lift:function(e,n,i,a){a=s(a);const o=[],u=a.replace(RegExp(t,"g"),(function(e,t,n,s){return r(t,o,i),""}));if(0===o.length)throw Error("Found no capture variable in "+e+"!");let c;try{c=n.match(RegExp(u))}catch(t){throw Error("Error pattern matching "+e+" with "+n+": "+t.message)}if(!c)throw Error(e+' found no match for input "'+n+'"!');const l={};for(let e=1;e{e.exports=function(e){const t=n(386),r=(n(670),n(713).default),s=n(865)(e),i="http://shex.io/extensions/Map/#",a=/^ *(?:<([^>]*)>|([^:]*):([^ ]*)) *$/;function o(e){if("object"!=typeof e)return e;const t='"'+e.value+'"';return"language"in e?t+"@"+e.language:"type"in e?t+"^^"+e.type:t}function u(e,t){const n=/(?:^|"\^\^)([^:\/#"'\^_]*):[^\/]*$/.exec(e);let r,s,i;return n&&(r=n[1],s=t[r],i=n.index),void 0===s?e:0===i?s+e.substr(r.length+1):e.substr(0,i+3)+s+e.substr(i+r.length+4)}return{register:function(n,s){if(void 0===s||!("ShExTerm"in s))throw Error("SemAct extensions must be called with register(validator, {ShExTerm, ...)");const c="_prefixes"in n.schema?n.schema._prefixes:{};return n.semActHandler.results[i]={},n.semActHandler.register(i,{dispatch:function(e,r,s){function o(e){const t=Error(e);throw Error.captureStackTrace(t,o),t}const u=function(t,r){if(!t)throw Error("Invocation error: "+i+' code "'+e+"\" didn't match "+a);const u=function(t){return"string"==typeof t?t:t[1]?t[1]:t[2]in c?c[t[2]]+t[3]:o("unknown prefix "+t[2]+' in "'+e+'".')}(t),l=r;n.semActHandler.results[i][u]=l,s[u]=l};if(/.*[(].*[)].*$/.test(e)){const n=t.lift(e,r.object,c);for(key in n)u(key,n[key])}else{u(e.match(a),r.node||r.object)}return!0}}),{results:n.semActHandler.results[i],binder:function(e){let t=[];const n={};function r(e,t){for(let n in e)Array.isArray(e[n])?r(e[n],t):Object.keys(t).forEach((r=>{if(r in e[n])throw Error("unexpected duplicate key: "+r+" in "+JSON.stringify(e[n]));e[n][r]=t[r]}))}return function e(t){const n=[],s=[],i=Object.keys(t).reduce(((r,i)=>{let a=null;return"object"!=typeof t[i]||"value"in t[i]?a=function(e,t){const n={};return n[e]=t,n}(i,1):(a=e(t[i]),Array.isArray(t[i])?n.push(i):s.push(i)),function(e,t){const n=Object.assign({},e);return Object.keys(t).reduce(((e,n)=>{const r=n in t?t[n]:1;return e[n]=n in e?e[n]+r:r,e}),n)}(r,a)}),{});n.length>0&&(s.forEach((e=>{const s=Object.keys(t[e]).filter((e=>1===i[e]));if(s.length){const i=s.reduce(((n,r)=>(n[r]=t[e][r],n)),{});n.forEach((e=>{r(t[e],i)}))}})),s.reverse(),s.forEach((e=>{t.splice(e,1)})));return i}(e),e=Array.isArray(e)?function e(t){const n=t.reduce(((t,n)=>t.concat(Array.isArray(n)?e(n):n)),[]);return 1===n.length?n[0]:n}(e):[e],{get:function(r){if(null===t)return;if(r in n)return n[r];const s=t.slice();let i=u(s);for(;!(r in i);){let e;for(;!Array.isArray(i);)e=s.pop(),i=o(s);if(i.length===e+1)return void(t=null);s.push(e+1),i=u(s)}t=s.slice();const a=i[r];return delete i[r],a;function o(t){return t.reduce((function(e,t){return e[t]}),e)}function u(e){for(;Array.isArray(o(e));)e.push(0);return o(e)}}}},trivialMaterializer:function(t,r){let i=0;const a=t._index||s.ShExUtil.index(t);return r=r||function(){return"_:b"+i++},{materialize:function(i,o,u,c){u=u&&u!==n.start?u:t.start,c=c||new e.rdfjs.Store;const p={cs:o||r()},f=s.ShExUtil.Visitor(),h=f.visitShapeRef;return f.visitShapeRef=function(e){return this.visitShapeExpr(a.shapeExprs[e],e),h.call(f,e)},f.visitValueRef=function(e){return this.visitExpression(t.shapes[e],e),this._visitValue(e)},f.visitTripleConstraint=function(e){l(e,p,r,c,this,t,i)},f.visitShapeExpr(u,"_: -start-"),c}}},visitTripleConstraint:l};function l(e,n,c,l,p,f,h,d,m,y){function x(e,t,n){return l.addQuad(s.ShExTerm.externalTriple({subject:e,predicate:t,object:n},r)),e}const g=(e.semActs||[]).filter((function(e){return e.name===i}));if(g.length)g.forEach((function(r){const s=r.code,i=s.match(a);let c;if(i){const e=i[1]?i[1]:u(i[2]+":"+i[3],f._prefixes),t=o(h.get(e));void 0!==t&&(c=t)}void 0===c&&/[ a-zA-Z0-9]+\(/.test(s)&&(c=t.lower(s,h,f.prefixes)),void 0===c||(e.inverse?x(c,e.predicate,n.cs):x(n.cs,e.predicate,c))}));else if("string"!=typeof e.valueExpr&&"values"in e.valueExpr&&1===e.valueExpr.values.length)e.inverse?x(e.valueExpr.values[0],e.predicate,n.cs):x(n.cs,e.predicate,o(e.valueExpr.values[0]));else{const t=n.cs;let r="max"in e?-1===e.max?1/0:e.max:1;r>50&&(r=50),d||(r=1);for(let s=0;s{ShExWebApp=function(){const e=n(261);return Object.assign({},{ShExTerm:n(118),Util:n(443),Validator:n(457),Writer:n(95),Api:n(237),Parser:n(931),ShapeMap:e,ShapeMapParser:e.Parser,Map:n(279)})}(),e.exports=ShExWebApp},839:(e,t,n)=>{const r=n(14),s="http://www.w3.org/2001/XMLSchema#",i=s+"boolean",a=/^[a-z][a-z0-9+.-]*:/i;function o(e){e||(e={});for(let t,n=1,r=arguments.length;n>10),56320+(1023&i))}{const e=t[s];if(!e)throw new Error("no replacement found for '"+s+"'");return e}}))}catch(e){return console.warn(e),""}}const{JisonParser:y,o:x}=n(41),g=[1,7],_=[1,16],E=[1,11],b=[1,14],S=[1,25],v=[1,24],A=[1,21],O=[1,22],w=[1,23],T=[1,28],I=[1,26],N=[1,27],k=[1,29],F=[1,12],L=[1,13],R=[1,15],j=[4,9],C=[16,19,20,21],D=[2,25],$=[16,19,20,21,37],P=[16,19,20,21,31,34,37,39,46,48,50,53,54,55,56,76,77,78,79,80,81,82],M=[4,9,16,19,20,21,37,43,74,75],Q=[4,9,43],G=[29,46,80,81,82],B=[4,9,42,43],V=[1,59],U=[46,79,80,81,82],z=[31,34,39,46,48,50,53,54,55,56,76,77,78,80,81,82],J=[1,94],X=[1,85],H=[1,86],q=[1,87],Z=[1,90],K=[1,91],W=[1,92],Y=[1,93],ee=[1,95],te=[33,48,49,50,53,54,55,56,63],ne=[4,9,37,65],re=[1,99],se=[9,37],ie=[9,65];t.HW=class extends y{constructor(e={},t=new oe(e)){super(e,t),this.symbols_={error:2,shapeMap:3,EOF:4,pair:5,Q_O_QGT_COMMA_E_S_Qpair_E_C_E_Star:6,QGT_COMMA_E_Opt:7,O_QGT_COMMA_E_S_Qpair_E_C:8,GT_COMMA:9,nodeSelector:10,statusAndShape:11,Qreason_E_Opt:12,QjsonAttributes_E_Opt:13,reason:14,jsonAttributes:15,GT_AT:16,Qstatus_E_Opt:17,shapeSelector:18,ATSTART:19,ATPNAME_NS:20,ATPNAME_LN:21,status:22,objectTerm:23,triplePattern:24,IT_SPARQL:25,string:26,nodeIri:27,shapeIri:28,START:29,subjectTerm:30,BLANK_NODE_LABEL:31,literal:32,GT_LCURLEY:33,IT_FOCUS:34,nodePredicate:35,O_QobjectTerm_E_Or_QIT___E_C:36,GT_RCURLEY:37,O_QsubjectTerm_E_Or_QIT___E_C:38,IT__:39,GT_NOT:40,GT_OPT:41,GT_DIVIDE:42,GT_DOLLAR:43,O_QAPPINFO_COLON_E_Or_QAPPINFO_SPACE_COLON_E_C:44,jsonValue:45,APPINFO_COLON:46,APPINFO_SPACE_COLON:47,IT_false:48,IT_null:49,IT_true:50,jsonObject:51,jsonArray:52,INTEGER:53,DECIMAL:54,DOUBLE:55,STRING_LITERAL2:56,Q_O_QjsonMember_E_S_QGT_COMMA_E_S_QjsonMember_E_Star_C_E_Opt:57,O_QGT_COMMA_E_S_QjsonMember_E_C:58,jsonMember:59,Q_O_QGT_COMMA_E_S_QjsonMember_E_C_E_Star:60,O_QjsonMember_E_S_QGT_COMMA_E_S_QjsonMember_E_Star_C:61,STRING_LITERAL2_COLON:62,GT_LBRACKET:63,Q_O_QjsonValue_E_S_QGT_COMMA_E_S_QjsonValue_E_Star_C_E_Opt:64,GT_RBRACKET:65,O_QGT_COMMA_E_S_QjsonValue_E_C:66,Q_O_QGT_COMMA_E_S_QjsonValue_E_C_E_Star:67,O_QjsonValue_E_S_QGT_COMMA_E_S_QjsonValue_E_Star_C:68,rdfLiteral:69,numericLiteral:70,booleanLiteral:71,Q_O_QLANGTAG_E_Or_QGT_DTYPE_E_S_QnodeIri_E_C_E_Opt:72,O_QLANGTAG_E_Or_QGT_DTYPE_E_S_QnodeIri_E_C:73,LANGTAG:74,GT_DTYPE:75,STRING_LITERAL1:76,STRING_LITERAL_LONG1:77,STRING_LITERAL_LONG2:78,IT_a:79,IRIREF:80,PNAME_LN:81,PNAME_NS:82,$accept:0,$end:1},this.terminals_={2:"error",4:"EOF",9:"GT_COMMA",16:"GT_AT",19:"ATSTART",20:"ATPNAME_NS",21:"ATPNAME_LN",25:"IT_SPARQL",29:"START",31:"BLANK_NODE_LABEL",33:"GT_LCURLEY",34:"IT_FOCUS",37:"GT_RCURLEY",39:"IT__",40:"GT_NOT",41:"GT_OPT",42:"GT_DIVIDE",43:"GT_DOLLAR",46:"APPINFO_COLON",47:"APPINFO_SPACE_COLON",48:"IT_false",49:"IT_null",50:"IT_true",53:"INTEGER",54:"DECIMAL",55:"DOUBLE",56:"STRING_LITERAL2",62:"STRING_LITERAL2_COLON",63:"GT_LBRACKET",65:"GT_RBRACKET",74:"LANGTAG",75:"GT_DTYPE",76:"STRING_LITERAL1",77:"STRING_LITERAL_LONG1",78:"STRING_LITERAL_LONG2",79:"IT_a",80:"IRIREF",81:"PNAME_LN",82:"PNAME_NS"},this.productions_=[0,[3,1],[3,4],[8,2],[6,0],[6,2],[7,0],[7,1],[5,4],[12,0],[12,1],[13,0],[13,1],[11,3],[11,1],[11,1],[11,1],[17,0],[17,1],[10,1],[10,1],[10,2],[10,2],[18,1],[18,1],[30,1],[30,1],[23,1],[23,1],[24,5],[24,5],[36,1],[36,1],[38,1],[38,1],[22,1],[22,1],[14,2],[15,3],[44,1],[44,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[51,3],[58,2],[60,0],[60,2],[61,2],[57,0],[57,1],[59,2],[52,3],[66,2],[67,0],[67,2],[68,2],[64,0],[64,1],[32,1],[32,1],[32,1],[70,1],[70,1],[70,1],[69,2],[73,1],[73,2],[72,0],[72,1],[71,1],[71,1],[26,1],[26,1],[26,1],[26,1],[35,1],[35,1],[27,1],[27,1],[27,1],[27,1],[28,1],[28,1],[28,1],[28,1]],this.table=[{3:1,4:[1,2],5:3,10:4,23:5,24:6,25:g,26:20,27:8,30:9,31:_,32:10,33:E,46:b,48:S,50:v,53:A,54:O,55:w,56:T,69:17,70:18,71:19,76:I,77:N,78:k,80:F,81:L,82:R},{1:[3]},{1:[2,1]},x(j,[2,4],{6:30}),{11:31,16:[1,32],19:[1,33],20:[1,34],21:[1,35]},x(C,[2,19]),x(C,[2,20]),{26:36,56:T,76:I,77:N,78:k},x(C,D,{26:37,56:T,76:I,77:N,78:k}),x($,[2,27]),x($,[2,28]),{27:42,30:40,31:_,34:[1,38],38:39,39:[1,41],46:b,80:F,81:L,82:R},x(P,[2,84]),x(P,[2,85]),x(P,[2,86]),x(P,[2,87]),x([16,19,20,21,37,46,79,80,81,82],[2,26]),x($,[2,65]),x($,[2,66]),x($,[2,67]),x($,[2,74],{72:43,73:44,74:[1,45],75:[1,46]}),x($,[2,68]),x($,[2,69]),x($,[2,70]),x($,[2,76]),x($,[2,77]),x(M,[2,78]),x(M,[2,79]),x(M,[2,80]),x(M,[2,81]),{4:[2,6],7:47,8:48,9:[1,49]},x(Q,[2,9],{12:50,14:51,42:[1,52]}),x(G,[2,17],{17:53,22:54,40:[1,55],41:[1,56]}),x(B,[2,14]),x(B,[2,15]),x(B,[2,16]),x(C,[2,21]),x(C,[2,22]),{27:58,35:57,46:b,79:V,80:F,81:L,82:R},{27:58,35:60,46:b,79:V,80:F,81:L,82:R},x(U,[2,33]),x(U,[2,34]),x([37,46,79,80,81,82],D),x($,[2,71]),x($,[2,75]),x($,[2,72]),{27:61,46:b,80:F,81:L,82:R},{4:[1,62]},x(j,[2,5]),{4:[2,7],5:63,10:4,23:5,24:6,25:g,26:20,27:8,30:9,31:_,32:10,33:E,46:b,48:S,50:v,53:A,54:O,55:w,56:T,69:17,70:18,71:19,76:I,77:N,78:k,80:F,81:L,82:R},x(j,[2,11],{13:64,15:65,43:[1,66]}),x(Q,[2,10]),{26:67,56:T,76:I,77:N,78:k},{18:68,28:69,29:[1,70],46:[1,73],80:[1,71],81:[1,72],82:[1,74]},x(G,[2,18]),x(G,[2,35]),x(G,[2,36]),{23:76,26:20,27:42,30:9,31:_,32:10,36:75,39:[1,77],46:b,48:S,50:v,53:A,54:O,55:w,56:T,69:17,70:18,71:19,76:I,77:N,78:k,80:F,81:L,82:R},x(z,[2,82]),x(z,[2,83]),{34:[1,78]},x($,[2,73]),{1:[2,2]},x(j,[2,3]),x(j,[2,8]),x(j,[2,12]),{44:79,46:[1,80],47:[1,81]},x(Q,[2,37]),x(B,[2,13]),x(B,[2,23]),x(B,[2,24]),x(B,[2,88]),x(B,[2,89]),x(B,[2,90]),x(B,[2,91]),{37:[1,82]},{37:[2,31]},{37:[2,32]},{37:[1,83]},{33:J,45:84,48:X,49:H,50:q,51:88,52:89,53:Z,54:K,55:W,56:Y,63:ee},x(te,[2,39]),x(te,[2,40]),x(C,[2,29]),x(C,[2,30]),x(j,[2,38]),x(ne,[2,41]),x(ne,[2,42]),x(ne,[2,43]),x(ne,[2,44]),x(ne,[2,45]),x(ne,[2,46]),x(ne,[2,47]),x(ne,[2,48]),x(ne,[2,49]),{37:[2,55],57:96,59:98,61:97,62:re},{33:J,45:102,48:X,49:H,50:q,51:88,52:89,53:Z,54:K,55:W,56:Y,63:ee,64:100,65:[2,63],68:101},{37:[1,103]},{37:[2,56]},x(se,[2,52],{60:104}),{33:J,45:105,48:X,49:H,50:q,51:88,52:89,53:Z,54:K,55:W,56:Y,63:ee},{65:[1,106]},{65:[2,64]},x(ie,[2,60],{67:107}),x(ne,[2,50]),{9:[1,109],37:[2,54],58:108},x(se,[2,57]),x(ne,[2,58]),{9:[1,111],65:[2,62],66:110},x(se,[2,53]),{59:112,62:re},x(ie,[2,61]),{33:J,45:113,48:X,49:H,50:q,51:88,52:89,53:Z,54:K,55:W,56:Y,63:ee},x(se,[2,51]),x(ie,[2,59])],this.defaultActions={2:[2,1],62:[2,2],76:[2,31],77:[2,32],97:[2,56],101:[2,64]}}performAction(e,t,n,s,l,p,y){const x=p.length-1;switch(l){case 1:return[];case 2:return[p[x-3]].concat(p[x-2]);case 3:case 51:case 59:this.$=p[x];break;case 4:case 60:case 63:this.$=[];break;case 5:case 61:this.$=p[x-1].concat(p[x]);break;case 8:this.$=o({node:p[x-3]},p[x-2],p[x-1],p[x]);break;case 9:case 11:case 52:case 55:case 74:this.$={};break;case 13:this.$=o({shape:p[x]},p[x-1]);break;case 14:this.$={shape:r.start};break;case 15:p[x]=p[x].substr(1,p[x].length-1),this.$={shape:d(s.schemaMeta.prefixes,p[x].substr(0,p[x].length-1))};break;case 16:p[x]=p[x].substr(1,p[x].length-1);const e=p[x].indexOf(":");this.$={shape:d(s.schemaMeta.prefixes,p[x].substr(0,e))+p[x].substr(e+1)};break;case 17:this.$={status:"conformant"};break;case 18:this.$={status:p[x]};break;case 21:this.$={type:"Extension",language:"http://www.w3.org/ns/shex#Extensions-sparql",lexical:p[x]["@value"]};break;case 22:this.$={type:"Extension",language:p[x-1],lexical:p[x]["@value"]};break;case 24:this.$=r.start;break;case 29:this.$={type:"TriplePattern",subject:r.focus,predicate:p[x-2],object:p[x-1]};break;case 30:this.$={type:"TriplePattern",subject:p[x-3],predicate:p[x-2],object:r.focus};break;case 32:case 34:case 42:this.$=null;break;case 35:this.$="nonconformant";break;case 36:this.$="unknown";break;case 37:this.$={reason:p[x]};break;case 38:this.$={appinfo:p[x]};break;case 41:this.$=!1;break;case 43:this.$=!0;break;case 46:case 47:case 48:this.$=parseFloat(p[x]);break;case 49:this.$=f(p[x],1)["@value"];break;case 50:case 58:this.$=p[x-1];break;case 53:case 54:case 71:this.$=o(p[x-1],p[x]);break;case 57:this.$={};const t=p[x-1].substr(0,p[x-1].length-1).trim();this.$[f(t,1)["@value"]]=p[x];break;case 62:this.$=[p[x-1]].concat(p[x]);break;case 68:this.$=c(p[x],"http://www.w3.org/2001/XMLSchema#integer");break;case 69:this.$=c(p[x],"http://www.w3.org/2001/XMLSchema#decimal");break;case 70:this.$=c(p[x],"http://www.w3.org/2001/XMLSchema#double");break;case 72:this.$=u("@language",p[x].substr(1).toLowerCase());break;case 73:this.$=u("@type",p[x]);break;case 76:this.$=c("true",i);break;case 77:this.$=c("false",i);break;case 78:case 80:this.$=f(p[x],1);break;case 79:case 81:this.$=f(p[x],3);break;case 83:this.$="http://www.w3.org/1999/02/22-rdf-syntax-ns#type";break;case 84:const n=m(p[x].slice(1,-1),{});this.$=null===s.dataMeta.base||a.test(n)?n:s.dataMeta._resolveIRI(n);break;case 85:case 86:this.$=h(p[x],s.dataMeta.prefixes);break;case 87:this.$=d(s.dataMeta.prefixes,p[x].substr(0,p[x].length-1));break;case 88:const l=m(p[x].slice(1,-1),{});this.$=null===s.schemaMeta.base||a.test(l)?l:s.schemaMeta._resolveIRI(l);break;case 89:case 90:this.$=h(p[x],s.schemaMeta.prefixes);break;case 91:this.$=d(s.schemaMeta.prefixes,p[x].substr(0,p[x].length-1))}}};const{JisonLexer:ae}=n(752);class oe extends ae{constructor(e={}){super(e),this.options={moduleName:"ShapeMapJison"},this.rules=[/^(?:\s+|(#[^\u000a\u000d]*|\/\*([^*]|\*([^/]|\\\/))*\*\/))/,/^(?:(appinfo[\u0020\u000A\u0009]+:))/,/^(?:("([^\u0022\u005C\u000A\u000D]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*"[\u0020\u000A\u0009]*:))/,/^(?:([Ff][Oo][Cc][Uu][Ss]))/,/^(?:([Ss][Tt][Aa][Rr][Tt]))/,/^(?:(@[Ss][Tt][Aa][Rr][Tt]))/,/^(?:([Ss][Pp][Aa][Rr][Qq][Ll]))/,/^(?:(@(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?)?:)(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|:|[0-9]|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.|:|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))*))))/,/^(?:(@((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?)?:)))/,/^(?:(@([A-Za-z])+((-([0-9A-Za-z])+))*))/,/^(?:(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?)?:)(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|:|[0-9]|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.|:|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))*)))/,/^(?:(appinfo:))/,/^(?:((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?)?:))/,/^(?:(([+-])?((([0-9])+\.([0-9])*(([Ee]([+-])?([0-9])+)))|((\.)?([0-9])+(([Ee]([+-])?([0-9])+))))))/,/^(?:(([+-])?([0-9])*\.([0-9])+))/,/^(?:(([+-])?([0-9])+))/,/^(?:(<([^\u0000-\u0020<>\"{}|^`\\]|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*>))/,/^(?:(_:((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|[0-9])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?))/,/^(?:('''(('|'')?([^\'\\]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))))*'''))/,/^(?:("""(("|"")?([^\"\\]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))))*"""))/,/^(?:('([^\u0027\u005c\u000a\u000d]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*'))/,/^(?:("([^\u0022\u005c\u000a\u000d]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*"))/,/^(?:a\b)/,/^(?:,)/,/^(?:\{)/,/^(?:\})/,/^(?:@)/,/^(?:!)/,/^(?:\?)/,/^(?:\/)/,/^(?:\$)/,/^(?:\[)/,/^(?:\])/,/^(?:\^\^)/,/^(?:_\b)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:[a-zA-Z0-9_-]+)/,/^(?:.)/],this.conditions={INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40],inclusive:!0}}}performAction(e,t,n,r){switch(n){case 0:break;case 1:return 47;case 2:return 62;case 3:return 34;case 4:return 29;case 5:return 19;case 6:return 25;case 7:return 21;case 8:return 20;case 9:return 74;case 10:return 81;case 11:return 46;case 12:return 82;case 13:return 55;case 14:return 54;case 15:return 53;case 16:return 80;case 17:return 31;case 18:return 77;case 19:return 78;case 20:return 76;case 21:return 56;case 22:return 79;case 23:return 9;case 24:return 33;case 25:return 37;case 26:return 16;case 27:return 40;case 28:return 41;case 29:return 42;case 30:return 43;case 31:return 63;case 32:return 65;case 33:return 75;case 34:return 39;case 35:return 50;case 36:return 48;case 37:return 49;case 38:return 4;case 39:return'unexpected word "'+t.yytext+'"';case 40:return"invalid character "+t.yytext}}}},18:(e,t,n)=>{const r=function(){ShapeMapJison=n(839).HW;const e=/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i,t=/(?:^|\/)\.\.?(?:$|[\/#?])/;class r{constructor(){}reset(){this.prefixes=null,this.base=this._baseIRI=this._baseIRIPath=this._baseIRIRoot=null}_setBase(t){t||(t=null),(this.base=t)&&(this._basePath=t.replace(/[^\/?]*(?:\?.*)?$/,""),t=t.match(e),this._baseRoot=t[0],this._baseScheme=t[1])}_resolveIRI(e){switch(e[0]){case void 0:return this.base;case"#":return this.base+e;case"?":return this.base.replace(/(?:\?.*)?$/,e);case"/":return("/"===e[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!t.test(e))return e;const n=e.length;let r="",s=-1,i=-1,a="/",o=0;for(;s=i&&(r=r.substr(0,o)),"/"!==a)return r+"/"+e.substr(s+1);o=s+1}}}a=e[++s]}return r+e.substring(o)}expandPrefix(e){return e in this.prefixes||this.error(new Error('Parse error; unknown prefix "'+e+':"')),this.prefixes[e]}}class s{constructor(){this.schemaMeta=new r,this.dataMeta=new r,this._fileName=void 0}reset(){this.schemaMeta.reset(),this.dataMeta.reset()}_setFileName(e){this._fileName=e}error(e){const t={text:this.lexer.match,line:this.lexer.thislineno,loc:this.lexer.thislloc,pos:this.lexer.showPosition()};if(e.hash=t,!this.recoverable)throw e;this.recoverable(e)}}return{construct:function(e,t,n){const r=t.base,i={};for(const e in t.prefixes||{})i[e]=t.prefixes[e];const a=n.base,o={};for(const e in n.prefixes||{})o[e]=n.prefixes[e];const u=new ShapeMapJison,c=u.parse;return u.parse=function t(n,l=null){const p=globalThis.PS=new s;p.schemaMeta.prefixes=Object.create(i),p.schemaMeta._setBase(r),p.dataMeta.prefixes=Object.create(o),p.dataMeta._setBase(a),p._setFileName(e),p._fileName=l;try{return c.call(u,n,p)}catch(n){const r="lexer"in u.yy?u.yy.lexer.yylineno+1:1,s="lexer"in u.yy?u.yy.lexer.showPosition():"",i=Error(`${e}(${r}): ${n.message}\n${s}`);throw Error.captureStackTrace(i,t),p.reset(),i}},u}}}();e.exports=r},14:e=>{const t={focus:{term:"FOCUS"},start:{term:"START"},wildcard:{term:"WILDCARD"}};e.exports=t},261:(e,t,n)=>{const r=function(){const e=n(14);return e.Parser=n(18),e}();e.exports=r},237:(e,t,n)=>{e.exports=function(e={}){const t=n(443),r=n(931),s={load:async function(n,r,l,p,f={},h={}){const d={schema:t.emptySchema(),data:e.rdfjs?new e.rdfjs.Store:null,schemaMeta:[],dataMeta:[]},m=[],y=n.concat(r).map((e=>"object"==typeof e?e.url:e));let x=null;f&&"iriTransform"in f&&(x=f.iriTransform,delete f.iriTransform);const g=function(){const e=[],t=[];let n,r,s=0;const i=new Promise((function(e,t){n=e,r=t}));return i.all=function(t){return 0===t.length?n([]):t.forEach((function(t,n){e.push(t),a(t,n)})),i},i.add=function(t){return e.push(t),a(t,e.length-1),i},i;function a(i,a){i.then((function(r){t[a]=r,++s,s===e.length&&n(t)})).catch((function(e){r(e)}))}}();function _(e){if(!("imports"in e))return e;if(f.keepImports)return e;const t=Object.assign({},e);t.imports;return delete t.imports,e.imports.map((function(e){return x?x(e):e})).filter((function(e){return-1===y.indexOf(e)})).map((e=>{y.push(e),g.add(s.GET(e).then((function(e){const t={url:e.url,base:e.url,prefixes:{}};return a(e.text,"text/shex",e.url,d.schema,t,f,_)})))})),t}return[].push.apply(m,[i(n,d.schemaMeta,"text/shex",a,d.schema,f,_),i(r,d.schemaMeta,"text/json",o,d.schema,f,_),i(l,d.dataMeta,"text/turtle",u,d.data,h),i(p,d.dataMeta,"application/ld+json",c,d.data,h)].reduce(((e,t)=>e.concat(t)),[])),g.all(m).then((function(e){return d.schemaMeta.length>0&&t.isWellDefined(d.schema),d}))},loadExtensions:function(e){return[]},GET:async function(t,n){let r;return(r=t.match("^data:([^,]+),(.*)$"))?Promise.resolve({text:r[2],url:r[0]}):t.match("^(blob:)?[a-z]+://.")?async function(t,n){if("function"!=typeof e.fetch)throw Error(`Unable to fetch ${t} with fetch=${e.fetch}`);let r;try{r=await e.fetch(t,{headers:{Accept:"text/shex,text/turtle,*/*"}})}catch(e){throw Error(`GET <${t}> network failure: ${e.message}`)}if(!r.ok)throw Error(`GET <${t}> failed: ${r.status} ${r.statusText}`);return{text:await r.text(),url:t}}(t):(()=>{throw Error(`Don't know how to fetch ${t}`)})()},loadShExImports_NotUsed:function(e,n,r){const i=[e],a={type:"Schema"};return s.GET(e).then((function e(o){const u=n.parse(o.text),c=u.imports;if(delete u.imports,t.merge(a,u,!1,!0),c){const t=c.map((function(e){return r?r(e):e})).filter((function(e){return-1===i.indexOf(e)}));return Promise.all(t.map((t=>(i.push(t),s.GET(t).then(e))))).then((e=>null))}return null})).then((function(){return t.isWellDefined(a),a}))}};return s;function i(e,n,r,i,a,o,u){return e.map((async e=>"object"==typeof e?async function(e){const n=c(e.url,r);try{return t.merge(a,e.schema,!0,!0),n._prefixes=a._prefixes||{},n.base=a._base,u(e.schema),[r,e.url]}catch(t){const n=Error("error merging schema object "+e.schema+": "+t);throw n.stack=t.stack,n}}(e):await async function(e){return s.GET(e,r).then((function(e){return i(e.text,r,e.url,a,c(e.url,r),o,u)}))}(e)));function c(e,t){const r={mediaType:t,url:e,base:e,prefixes:{}};return n.push(r),r}}function a(e,n,s,i,a,o,u){const c=o&&"parser"in o?o.parser:r.construct(s,{},o);try{const r=c.parse(e,s);return r.base===s&&delete r.base,a.prefixes=r._prefixes||{},a.base=r._base||a.base,t.merge(i,u(r),!1,!0),Promise.resolve([n,s])}catch(e){return e.message="error parsing ShEx "+s+": "+e.message,Promise.reject(e)}}function o(e,n,r,s,i,a,o){try{const a=t.ShExJtoAS(JSON.parse(e));return t.merge(s,a,!0,!0),i.prefixes=s._prefixes,i.base=s.base,o(a),Promise.resolve([n,r])}catch(e){const t=Error("error parsing JSON "+r+": "+e);return Promise.reject(t)}}function u(t,n,r,s,i,a){return new Promise((function(a,o){new e.rdfjs.Parser({baseIRI:r,blankNodePrefix:"",format:"text/turtle"}).parse(t,(function(e,t,u){u&&(i.prefixes=u),e?o("error parsing "+r+": "+e):t?s.addQuad(t):(i.base=this._base,a([n,r]))}))}))}async function c(t,n,r,s,i,a){const o=JSON.parse(t);try{const t=await e.jsonld.toRDF(o,Object.assign({format:"application/nquads",base:r},e.jsonLdOptions||{}));return i.prefixes={},i.base=r,u(t,n,r,s,i)}catch(e){let t=e;throw"details"in t&&(t=t.details),"cause"in t&&(t=t.cause),Error("error parsing JSON-ld "+r+": "+t)}}}},509:(e,t,n)=>{const r=n(443),s="http://www.w3.org/2001/XMLSchema#",i=s+"decimal",a=s+"double",o=s+"boolean",u=[s+"integer",s+"decimal",s+"float",s+"double",s+"string",s+"boolean",s+"dateTime",s+"nonPositiveInteger",s+"negativeInteger",s+"long",s+"int",s+"short",s+"byte",s+"nonNegativeInteger",s+"unsignedLong",s+"unsignedInt",s+"unsignedShort",s+"unsignedByte",s+"positiveInteger"],c=/^[a-z][a-z0-9+.-]*:/i,l=["mininclusive","minexclusive","maxinclusive","maxexclusive"];function p(e){return e.toLowerCase()}function f(e,t){return e.push(t),e}function h(e){e||(e={});for(let t,n=1,r=arguments.length;n0?{restricts:y[O-1]}:{},{shapeExpr:y[O]})):s.addShape(y[O-2],y[O]);break;case 27:case 102:case 108:case 172:this.$={};break;case 28:this.$={abstract:!0};break;case 29:case 95:case 47:case 51:case 54:case 58:case 183:case 199:case 208:case 216:case 227:this.$=[];break;case 31:this.$=v(y[O]);break;case 32:this.$={type:"ShapeExternal"};break;case 33:y[O-2]&&(y[O-1]={type:"ShapeNot",shapeExpr:v(y[O-1])}),y[O]?(y[O].needsAtom.unshift(v(y[O-1])),delete y[O].needsAtom,this.$=y[O]):this.$=y[O-1];break;case 34:y[O-1]={type:"ShapeNot",shapeExpr:v(y[O-1])},y[O]?(y[O].needsAtom.unshift(v(y[O-1])),delete y[O].needsAtom,this.$=y[O]):this.$=y[O-1];break;case 35:y[O].needsAtom.unshift(v(y[O-1])),delete y[O].needsAtom,this.$=y[O];break;case 36:case 231:case 248:this.$=null;break;case 37:case 41:case 44:case 50:case 57:case 188:case 247:case 143:case 150:case 160:case 161:case 201:case 210:case 218:case 265:case 268:this.$=y[O];break;case 39:const w=y[O].map(v);this.$={type:"ShapeOr",shapeExprs:w,needsAtom:w};break;case 40:y[O-1].filter((e=>"ShapeAnd"===e.type)).length,y[O-1].length;const T={type:"ShapeAnd",shapeExprs:y[O-1].reduce(((e,t)=>e.concat("ShapeAnd"!==t.type||t.nested?v(t):t.shapeExprs)),[])};this.$=y[O].length>0?{type:"ShapeOr",shapeExprs:[T].concat(y[O].map(v))}:T,this.$.needsAtom=T.shapeExprs;break;case 43:case 46:case 48:case 52:case 55:case 59:this.$=y[O-1].concat(y[O]);break;case 49:this.$=S("ShapeOr",y[O-1],y[O]);break;case 53:case 56:this.$=S("ShapeAnd",y[O-1],y[O]);break;case 60:case 63:this.$=y[O-1]?{type:"ShapeNot",shapeExpr:v(y[O])}:y[O];break;case 61:this.$=!1;break;case 62:this.$=!0;break;case 64:case 73:case 78:case 80:this.$=y[O]?{type:"ShapeAnd",shapeExprs:[h({type:"NodeConstraint"},y[O-1]),y[O]]}:y[O-1];break;case 66:case 75:this.$=y[O]?S("ShapeAnd",y[O-1],[y[O]]):y[O-1];break;case 67:case 76:case 81:this.$=Object.assign(y[O-1],{nested:!0});break;case 68:case 77:case 82:this.$=s.EmptyShape;break;case 91:y[O]=y[O].substr(1,y[O].length-1);const I=y[O].indexOf(":");this.$=s.addSourceMap(s.expandPrefix(y[O].substr(0,I),s)+y[O].substr(I+1));break;case 92:y[O]=y[O].substr(1,y[O].length-1),this.$=s.addSourceMap(s.expandPrefix(y[O].substr(0,y[O].length-1),s));break;case 93:case 166:case 222:this.$=s.addSourceMap(y[O]);break;case 94:case 97:this.$=y[O-2],y[O-1].length&&(this.$.annotations=y[O-1]),y[O]&&(this.$.semActs=y[O].semActs);break;case 98:this.$=h({type:"NodeConstraint",nodeKind:"literal"},y[O]);break;case 99:-1===u.indexOf(y[O-1])&&l.forEach((function(e){e in y[O]&&s.error(new Error("Parse error: facet "+e+" not allowed for unknown datatype "+y[O-1]))})),this.$=h({type:"NodeConstraint",datatype:y[O-1]},y[O]);break;case 100:this.$={type:"NodeConstraint",values:y[O-1]};break;case 101:case 107:this.$=h({type:"NodeConstraint"},y[O]);break;case 103:case 105:case 111:case 109:-1!==Object.keys(y[O-1]).indexOf(Object.keys(y[O])[0])&&s.error(new Error("Parse error: facet "+Object.keys(y[O])[0]+" defined multiple times")),this.$=h(y[O-1],y[O]);break;case 106:this.$=h({type:"NodeConstraint"},y[O-1],y[O]?y[O]:{});break;case 112:this.$={nodeKind:"iri"};break;case 113:this.$={nodeKind:"bnode"};break;case 114:this.$={nodeKind:"nonliteral"};break;case 117:case 123:this.$=b(y[O-1],parseInt(y[O],10));break;case 118:this.$=function(e){const t=e.lastIndexOf("/");let n=e.substr(1,t-1);n=r.unescapeText(n,{".":"\\.","\\":"\\\\","?":"\\?","*":"\\*","+":"\\+","{":"\\{","}":"\\}","(":"\\(",")":"\\)","|":"\\|","^":"\\^",$:"\\$","[":"\\[","]":"\\]","/":"\\/",t:"\\t",n:"\\n",r:"\\r","-":"\\-","/":"/"});const s={pattern:n};return e.length>t+1&&(s.flags=e.substr(t+1)),s}(y[O]);break;case 119:this.$="length";break;case 120:this.$="minlength";break;case 121:this.$="maxlength";break;case 122:this.$=b(y[O-1],y[O]);break;case 124:this.$=parseInt(y[O],10);break;case 125:case 126:this.$=parseFloat(y[O]);break;case 127:y[O]===i||"http://www.w3.org/2001/XMLSchema#float"===y[O]||y[O]===a?this.$=parseFloat(y[O-2].value):-1!==u.indexOf(y[O])?this.$=parseInt(y[O-2].value):s.error(new Error("Parse error: numeric range facet expected numeric datatype instead of "+y[O]));break;case 128:this.$="mininclusive";break;case 129:this.$="minexclusive";break;case 130:this.$="maxinclusive";break;case 131:this.$="maxexclusive";break;case 132:this.$="totaldigits";break;case 133:this.$="fractiondigits";break;case 134:this.$=y[O-2]===s.EmptyShape?{type:"Shape"}:y[O-2],y[O-1].length&&(this.$.annotations=y[O-1]),y[O]&&(this.$.semActs=y[O].semActs);break;case 135:const N=y[O-1]?{expression:y[O-1]}:s.EmptyObject;this.$=N===s.EmptyObject&&y[O-3]===s.EmptyObject?s.EmptyShape:h({type:"Shape"},N,y[O-3]);break;case 136:this.$=["extends",[y[O]]];break;case 137:this.$=["extra",y[O]];break;case 138:this.$=["closed",!0];break;case 139:this.$=s.EmptyObject;break;case 140:y[O-1]===s.EmptyObject&&(y[O-1]={}),"closed"===y[O][0]?y[O-1].closed=!0:y[O][0]in y[O-1]?y[O-1][y[O][0]]=d(y[O-1][y[O][0]],y[O][1]):y[O-1][y[O][0]]=y[O][1],this.$=y[O-1];break;case 149:this.$={type:"OneOf",expressions:d([y[O-1]],y[O])};break;case 155:case 182:this.$=y[O-1];break;case 159:this.$={type:"EachOf",expressions:d([y[O-2]],y[O-1])};break;case 164:y[O-1]?(this.$=h({id:y[O-1]},y[O]),s.addProduction(y[O-1],this.$)):this.$=y[O];break;case 171:this.$=y[O-4],"min"in y[O-2]&&(this.$.min=y[O-2].min),"max"in y[O-2]&&(this.$.max=y[O-2].max),y[O-1].length&&(this.$.annotations=y[O-1]),y[O]&&(this.$.semActs="semActs"in y[O-4]?y[O-4].semActs.concat(y[O].semActs):y[O].semActs);break;case 174:y[O-3],s.EmptyShape,0,this.$=h({type:"TripleConstraint"},y[O-5],{predicate:y[O-4]},y[O-3]===s.EmptyShape?{}:{valueExpr:y[O-3]},y[O-2],y[O]),y[O-1].length&&(this.$.annotations=y[O-1]);break;case 177:this.$={min:0,max:-1};break;case 178:this.$={min:1,max:-1};break;case 179:this.$={min:0,max:1};break;case 180:y[O]=y[O].substr(1,y[O].length-2);const k=y[O].match(/(\d+)/g);this.$={min:parseInt(k[0],10)},2===k.length?this.$.max=parseInt(k[1],10):-1===y[O].indexOf(",")?this.$.max=parseInt(k[0],10):this.$.max=-1;break;case 181:this.$={inverse:!0};break;case 195:this.$={type:"IriStemRange",stem:{type:"Wildcard"},exclusions:y[O]};break;case 196:this.$={type:"LiteralStemRange",stem:{type:"Wildcard"},exclusions:y[O]};break;case 197:this.$={type:"LanguageStemRange",stem:{type:"Wildcard"},exclusions:y[O]};break;case 198:y[O]?(this.$={type:y[O].length?"IriStemRange":"IriStem",stem:y[O-1]},y[O].length&&(this.$.exclusions=y[O])):this.$=y[O-1];break;case 204:this.$=y[O]?{type:"IriStem",stem:y[O-1]}:y[O-1];break;case 207:y[O]?(this.$={type:y[O].length?"LiteralStemRange":"LiteralStem",stem:y[O-1].value},y[O].length&&(this.$.exclusions=y[O])):this.$=y[O-1];break;case 213:this.$=y[O]?{type:"LiteralStem",stem:y[O-1].value}:y[O-1].value;break;case 214:y[O]?(this.$={type:y[O].length?"LanguageStemRange":"LanguageStem",stem:y[O-1]},y[O].length&&(this.$.exclusions=y[O])):this.$={type:"Language",languageTag:y[O-1]};break;case 215:this.$={type:y[O].length?"LanguageStemRange":"LanguageStem",stem:""},y[O].length&&(this.$.exclusions=y[O]);break;case 221:this.$=y[O]?{type:"LanguageStem",stem:y[O-1]}:y[O-1];break;case 223:this.$={type:"Annotation",predicate:y[O-1],object:y[O]};break;case 226:this.$=y[O].length?{semActs:y[O]}:null;break;case 229:this.$=y[O]?function(e,t){return t=t.substring(1,t.length-2),{type:"SemAct",name:e,code:r.unescapeText(t,x)}}(y[O-1],y[O]):{type:"SemAct",name:y[O-1]};break;case 236:this.$="http://www.w3.org/1999/02/22-rdf-syntax-ns#type";break;case 242:this.$=m(y[O],"http://www.w3.org/2001/XMLSchema#integer");break;case 243:this.$=m(y[O],i);break;case 244:this.$=m(y[O],a);break;case 246:this.$=y[O]?h(y[O-1],{type:y[O]}):y[O-1];break;case 250:this.$={value:"true",type:o};break;case 251:this.$={value:"false",type:o};break;case 252:case 254:this.$=_(y[O],1);break;case 253:case 255:this.$=_(y[O],3);break;case 256:case 258:this.$=E(y[O],1);break;case 257:case 259:this.$=E(y[O],3);break;case 260:const F=r.unescapeText(y[O].slice(1,-1),{});this.$=null===s._base||c.test(F)?F:s._resolveIRI(F);break;case 262:const L=y[O].indexOf(":");this.$=s.expandPrefix(y[O].substr(0,L),s)+r.unescapeText(y[O].substr(L+1),g);break;case 263:this.$=s.expandPrefix(y[O].substr(0,y[O].length-1),s)}}};const{JisonLexer:Yl}=n(752);class ep extends Yl{constructor(e={}){super(e),this.options={moduleName:"ShExJison"},this.rules=[/^(?:\s+|(#[^\u000a\u000d]*|\/\*([^*]|\*([^/]|\\\/))*\*\/))/,/^(?:(@(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?)?:)(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|:|[0-9]|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.|:|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))*))))/,/^(?:(@((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?)?:)))/,/^(?:(@([A-Za-z])+((-([0-9A-Za-z])+))*))/,/^(?:@)/,/^(?:(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?)?:)(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|:|[0-9]|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.|:|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))*)))/,/^(?:(\{((([+-])?([0-9])+))((,(((([+-])?([0-9])+))|\*)?))?\}))/,/^(?:(([+-])?((([0-9])+\.([0-9])*(([Ee]([+-])?([0-9])+)))|((\.)?([0-9])+(([Ee]([+-])?([0-9])+))))))/,/^(?:(([+-])?([0-9])*\.([0-9])+))/,/^(?:(([+-])?([0-9])+))/,/^(?:{ANON})/,/^(?:(<([^\u0000-\u0020<>\"{}|^`\\]|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*>))/,/^(?:((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?)?:))/,/^(?:a\b)/,/^(?:(\/([^\u002f\u005C\u000A\u000D]|\\[nrt\\|.?*+(){}$\u002D\u005B\u005D\u005E/]|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))+\/[smix]*))/,/^(?:(_:((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|[0-9])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?))/,/^(?:(\{([^%\\]|\\[%\\]|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*%\}))/,/^(?:('''(('|'')?([^\'\\]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))))*'''(@([A-Za-z])+((-([0-9A-Za-z])+))*)))/,/^(?:("""(("|"")?([^\"\\]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))))*"""(@([A-Za-z])+((-([0-9A-Za-z])+))*)))/,/^(?:('([^\u0027\u005c\u000a\u000d]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*'(@([A-Za-z])+((-([0-9A-Za-z])+))*)))/,/^(?:("([^\u0022\u005c\u000a\u000d]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*"(@([A-Za-z])+((-([0-9A-Za-z])+))*)))/,/^(?:('''(('|'')?([^\'\\]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))))*'''))/,/^(?:("""(("|"")?([^\"\\]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))))*"""))/,/^(?:('([^\u0027\u005c\u000a\u000d]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*'))/,/^(?:("([^\u0022\u005c\u000a\u000d]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*"))/,/^(?:([Bb][Aa][Ss][Ee]))/,/^(?:([Pp][Rr][Ee][Ff][Ii][Xx]))/,/^(?:([iI][mM][pP][oO][rR][tT]))/,/^(?:([sS][tT][aA][rR][tT]))/,/^(?:([eE][xX][tT][eE][rR][nN][aA][lL]))/,/^(?:([Aa][Bb][Ss][Tt][Rr][Aa][Cc][Tt]))/,/^(?:([Rr][Ee][Ss][Tt][Rr][Ii][Cc][Tt][Ss]))/,/^(?:([Ee][Xx][Tt][Ee][Nn][Dd][Ss]))/,/^(?:([Cc][Ll][Oo][Ss][Ee][Dd]))/,/^(?:([Ee][Xx][Tt][Rr][Aa]))/,/^(?:([Ll][Ii][Tt][Ee][Rr][Aa][Ll]))/,/^(?:([Bb][Nn][Oo][Dd][Ee]))/,/^(?:([Ii][Rr][Ii]))/,/^(?:([Nn][Oo][Nn][Ll][Ii][Tt][Ee][Rr][Aa][Ll]))/,/^(?:([Aa][Nn][Dd]))/,/^(?:([Oo][Rr]))/,/^(?:([No][Oo][Tt]))/,/^(?:([Mm][Ii][Nn][Ii][Nn][Cc][Ll][Uu][Ss][Ii][Vv][Ee]))/,/^(?:([Mm][Ii][Nn][Ee][Xx][Cc][Ll][Uu][Ss][Ii][Vv][Ee]))/,/^(?:([Mm][Aa][Xx][Ii][Nn][Cc][Ll][Uu][Ss][Ii][Vv][Ee]))/,/^(?:([Mm][Aa][Xx][Ee][Xx][Cc][Ll][Uu][Ss][Ii][Vv][Ee]))/,/^(?:([Ll][Ee][Nn][Gg][Tt][Hh]))/,/^(?:([Mm][Ii][Nn][Ll][Ee][Nn][Gg][Tt][Hh]))/,/^(?:([Mm][Aa][Xx][Ll][Ee][Nn][Gg][Tt][Hh]))/,/^(?:([Tt][Oo][Tt][Aa][Ll][Dd][Ii][Gg][Ii][Tt][Ss]))/,/^(?:([Ff][Rr][Aa][Cc][Tt][Ii][Oo][Nn][Dd][Ii][Gg][Ii][Tt][Ss]))/,/^(?:=)/,/^(?:\/\/)/,/^(?:\{)/,/^(?:\})/,/^(?:&)/,/^(?:\|\|)/,/^(?:\|)/,/^(?:,)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\$)/,/^(?:!)/,/^(?:\^\^)/,/^(?:\^)/,/^(?:\.)/,/^(?:~)/,/^(?:;)/,/^(?:\*)/,/^(?:\+)/,/^(?:\?)/,/^(?:-)/,/^(?:%)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:$)/,/^(?:[a-zA-Z0-9_-]+)/,/^(?:.)/],this.conditions={INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79],inclusive:!0}}}performAction(e,t,n,r){switch(n){case 0:break;case 1:return 79;case 2:return 80;case 3:return t.yytext=t.yytext.substr(1),185;case 4:return 81;case 5:return 215;case 6:return 159;case 7:return 109;case 8:return 108;case 9:return 100;case 10:return"ANON";case 11:return 19;case 12:return 21;case 13:return 199;case 14:return 101;case 15:return 216;case 16:return 195;case 17:return 211;case 18:return 213;case 19:return 210;case 20:return 212;case 21:return 207;case 22:return 209;case 23:return 206;case 24:return 208;case 25:return 18;case 26:return 20;case 27:return 23;case 28:return 26;case 29:return 39;case 30:return 36;case 31:return 220;case 32:return 218;case 33:return 125;case 34:return 127;case 35:return 85;case 36:return 97;case 37:return 96;case 38:return 98;case 39:return 53;case 40:return 51;case 41:return 43;case 42:return 112;case 43:return 113;case 44:return 114;case 45:return 115;case 46:return 102;case 47:return 103;case 48:return 104;case 49:return 116;case 50:return 117;case 51:return 27;case 52:return 190;case 53:return 119;case 54:return 121;case 55:return 189;case 56:return"||";case 57:return 135;case 58:return 140;case 59:return 69;case 60:return 70;case 61:return 161;case 62:return 163;case 63:return 148;case 64:return"!";case 65:return 111;case 66:return 160;case 67:return 71;case 68:return 178;case 69:return 141;case 70:return 156;case 71:return 157;case 72:return 158;case 73:return 179;case 74:return 193;case 75:return 204;case 76:return 205;case 77:return 7;case 78:return'unexpected word "'+t.yytext+'"';case 79:return"invalid character "+t.yytext}}}},931:(e,t,n)=>{const r=function(){const e=n(509).Fm,t=/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i,r=/(?:^|\/)\.\.?(?:$|[\/#?])/;class s{constructor(){this.blankId=0,this._fileName=void 0,this.EmptyObject={},this.EmptyShape={type:"Shape"}}reset(){this._prefixes=this._imports=this._sourceMap=this.shapes=this.productions=this.start=this.startActs=null,this._base=this._baseIRI=this._baseIRIPath=this._baseIRIRoot=null}_setFileName(e){this._fileName=e}blank(){return"_:b"+this.blankId++}_resetBlanks(e){this.blankId=void 0===e?0:e}_setBase(e){e||(e=null),(this._base=e)&&(this._basePath=e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(t),this._baseRoot=e[0],this._baseScheme=e[1])}_resolveIRI(e){switch(e[0]){case void 0:return this._base;case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return("/"===e[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!r.test(e))return e;const t=e.length;let n="",s=-1,i=-1,a="/",o=0;for(;s=i&&(n=n.substr(0,o)),"/"!==a)return n+"/"+e.substr(s+1);o=s+1}}}a=e[++s]}return n+e.substring(o)}error(e){const t={text:this.lexer.match,line:this.lexer.yylineno,loc:this.lexer.yylloc,pos:this.lexer.showPosition()};if(e.hash=t,!this.recoverable)throw e;this.recoverable(e)}expandPrefix(e){return e in this._prefixes||this.error(new Error('Parse error; unknown prefix "'+e+':"')),this._prefixes[e]}addShape(e,t){t===this.EmptyShape&&(t={type:"Shape"}),this.productions&&e in this.productions&&this.error(new Error("Structural error: "+e+" is a triple expression")),this.shapes||(this.shapes={}),e in this.shapes?"replace"===this.options.duplicateShape?this.shapes[e]=t:"ignore"!==this.options.duplicateShape&&this.error(new Error("Parse error: "+e+" already defined")):this.shapes[e]=Object.assign({id:e},t)}addProduction(e,t){this.shapes&&e in this.shapes&&this.error(new Error("Structural error: "+e+" is a shape expression")),this.productions||(this.productions={}),e in this.productions?"replace"===this.options.duplicateShape?this.productions[e]=t:"ignore"!==this.options.duplicateShape&&this.error(new Error("Parse error: "+e+" already defined")):this.productions[e]=t}addSourceMap(e){this._sourceMap||(this._sourceMap=new Map);let t=this._sourceMap.get(e);return t||this._sourceMap.set(e,t=[]),t.push(this.lexer.yylloc),e}}return{construct:function(t,n,r){r=r||{};const i={};for(const e in n||{})i[e]=n[e];const a=new e(s),o=a.parse;return a.parse=function(e,n=t,u=r,c=null){const l=globalThis.PS=new s;l._prefixes=Object.create(i),l._imports=[],l._setBase(n),l._setFileName(t),l.options=r;let p=[];l.recoverable=e=>p.push(e);let f=null;try{f=o.call(a,e,l)}catch(e){p.push(e)}if(l.reset(),p.forEach((e=>{if("hash"in e){const t=e.hash,n=t.loc;delete t.loc,Object.assign(e,t,{location:n})}return e})),1==p.length)throw p[0].parsed=f,p[0];if(p.length){const e=new Error(p.length+" parser errors:\n"+p.map((e=>function(e,n){const r=e.location.first_line,s=e.location.first_column+1,i="pos"in e.hash?"\n"+e.hash.pos:"";return`${t}\n line: ${r}, column: ${s}: ${e.message}${i}`}(e,a.yy.lexer))).join("\n"));throw e.errors=p,e.parsed=f,e}return f},a._setBase=function(e){t=e},a}}}();e.exports=r},118:e=>{const t=function(){const e=/^[a-z][a-z0-9+.-]*:/i,t=/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i,n=/(?:^|\/)\.\.?(?:$|[\/#?])/,r="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",s="http://www.w3.org/2001/XMLSchema#string";function i(e){if(!n.test(e))return e;const t=e.length;let r="",s=-1,i=-1,a=0,o="/";for(;s=i&&(r=r.substr(0,a)),"/"!==o)return r+"/"+e.substr(s+1);a=s+1}}}o=e[++s]}return r+e.substring(a)}function a(e){switch(e.termType){case"NamedNode":return e.value;case"BlankNode":return"_:"+e.value;case"Literal":return'"'+e.value.replace(/"/g,'\\"')+'"'+(e.datatypeString===r?"@"+e.language:e.datatypeString===s?"":"^^"+e.datatypeString);default:throw Error("unknown RDFJS node type: "+JSON.stringify(e))}}function o(e,t){if(u(e))return t.namedNode(e);if(l(e))return t.blankNode(e.substr(2));if(c(e)){let n=h(e)||(f(e)===s?null:t.namedNode(f(e)));return t.literal(p(e),n)}throw Error("Unknown internal term type: "+JSON.stringify(e))}function u(e){if("string"!=typeof e)return!1;if(0===e.length)return!0;{const t=e[0];return'"'!==t&&"_"!==t}}function c(e){return"string"==typeof e&&'"'===e[0]}function l(e){return"string"==typeof e&&"_:"===e.substr(0,2)}function p(e){const t=/^"([^]*)"/.exec(e);if(!t)throw new Error(e+" is not a literal");return t[1].replace(/\\"/g,'"')}function f(e){const t=/^"[^]*"(?:\^\^([^"]+)|(@)[^@"]+)?$/.exec(e);if(!t)throw new Error(e+" is not a literal");return t[1]||(t[2]?r:s)}function h(e){const t=/^"[^]*"(?:@([^@"]+)|\^\^[^"]+)?$/.exec(e);if(!t)throw new Error(e+" is not a literal");return t[1]?t[1].toLowerCase():""}const d=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,m=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,y={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};function x(e){let t=y[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}return{RdfLangString:r,XsdString:s,resolveRelativeIRI:function(n,r){if(e.test(r))return r;switch(r[0]){case void 0:return n;case"#":return n+r;case"?":return n.replace(/(?:\?.*)?$/,r);case"/":let e=n.match(t);return("/"===r[1]?e[1]:e[0])+i(r);default:return i(n.replace(/[^\/?]*(?:\?.*)?$/,"")+r)}},isIRI:u,isLiteral:c,isBlank:l,isDefaultGraph:function(e){return!e},inDefaultGraph:function(e){return!e.graph},getLiteralValue:p,getLiteralType:f,getLiteralLanguage:h,internalTerm:a,internalTriple:function(e){return{subject:a(e.subject),predicate:a(e.predicate),object:a(e.object)}},externalTerm:o,externalTriple:function(e,t){return t.quad(o(e.subject,t),o(e.predicate,t),o(e.object,t))},internalTermToTurtle:function(e,t,n){if(u(e)){d.test(e)&&(e=e.replace(m,x));const r=Object.keys(n).find((t=>e.startsWith(n[t])));if(r){const t=e.substr(n[r].length);if(-1===t.indexOf("\\"))return r+":"+t.replace(/([~!$&'()*+,;=/?#@%])/g,"\\$1")}return e.startsWith(t)?"<"+e.substr(t.length)+">":"<"+e+">"}if(l(e))return e;if(c(e)){let r=p(e);const s=f(e),i=h(e);return d.test(r)&&(r=r.replace(m,x)),i?'"'+r+'"@'+i:s&&"http://www.w3.org/2001/XMLSchema#string"!==s?'"'+r+'"^^'+this.internalTermToTurtle(s,t,n):'"'+r+'"'}throw Error("Unknown internal term type: "+JSON.stringify(e))}}}();e.exports=t},443:(t,n,r)=>{const s=function(){const t=r(118),n=r(806),s=r(515),i={_namespace:"http://www.w3.org/ns/shex#"};["Schema","@context","imports","startActs","start","shapes","ShapeDecl","ShapeOr","ShapeAnd","shapeExprs","nodeKind","NodeConstraint","iri","bnode","nonliteral","literal","datatype","length","minlength","maxlength","pattern","flags","mininclusive","minexclusive","maxinclusive","maxexclusive","totaldigits","fractiondigits","values","ShapeNot","shapeExpr","Shape","abstract","closed","extra","expression","extends","restricts","semActs","ShapeRef","reference","ShapeExternal","EachOf","OneOf","expressions","min","max","annotation","TripleConstraint","inverse","negated","predicate","valueExpr","Inclusion","include","Language","languageTag","IriStem","LiteralStem","LanguageStem","stem","IriStemRange","LiteralStemRange","LanguageStemRange","exclusion","Wildcard","SemAct","name","code","Annotation","object"].forEach((e=>{i[e]=i._namespace+e}));const a={_namespace:"http://www.w3.org/1999/02/22-rdf-syntax-ns#"};["type","first","rest","nil"].forEach((e=>{a[e]=a._namespace+e}));const o={_namespace:"http://www.w3.org/2001/XMLSchema#"};["anyURI"].forEach((e=>{o[e]=o._namespace+e}));const u={_namespace:"http://www.w3.org/2002/07/owl#"};["Thing"].forEach((e=>{u[e]=u._namespace+e}));const c={};function l(e){e||(e={});for(let t,n=1,r=arguments.length;nt.set(e.id,null)));const n=this.ShExRVisitor(t);return"start"in e&&(e.start=n.visitShapeExpr(e.start)),"shapes"in e&&(e.shapes=e.shapes.map(((e,r)=>e.type===i.ShapeDecl?{type:"ShapeDecl",id:e.id,abstract:e.abstract,shapeExpr:n.visitShapeExpr(e.shapeExpr)}:t.get(e.id)?t.get(e.id):(()=>{const r=n.keepShapeExpr(e);return t.set(e.id,r),r})()))),n.cleanIds(),e},valGrep:function(e,t,n){const r=this,s=[];for(let i in e){const a=e[i];"object"==typeof a&&("type"in a&&a.type===t&&s.push(n(a)),s.push.apply(s,r.valGrep(a,t,n)))}return s},n3jsToTurtle:function(e){return this.valGrep(e,"TestedTriple",(function(e){return["subject","predicate","object"].map((n=>{return"object"==typeof(r=e[n])?'"'+r.value+'"'+("type"in r?"^^<"+r.type+">":"language"in r?"@"+r.language:""):t.isIRI(r)?"<"+r+">":t.isBlank(r)?r:"???";var r})).join(" ")+" ."}))},valToN3js:function(e,n){return this.valGrep(e,"TestedTriple",(function(e){const r=JSON.parse(JSON.stringify(e));return"object"==typeof e.object&&(r.object='"'+e.object.value+'"'+("type"in e.object?"^^"+e.object.type:"language"in e.object?"@"+e.object.language:"")),t.externalTriple(r,n)}))},n3jsToTurtle:function(e){return e.map((function(e){return["subject","predicate","object"].map((n=>function(e){if(t.isIRI(e))return"<"+e+">";if(t.isBlank(e))return e;const n=t.getLiteralType(e);return n&&"http://www.w3.org/2001/XMLSchema#string"!==n?'"'+t.getLiteralValue(e)+'"^^<'+n+">":e}(e[n]))).join(" ")+" ."}))},canonicalize:function(e,t){const n=JSON.parse(JSON.stringify(e));n["@context"]=n["@context"]||"http://www.w3.org/ns/shex.jsonld",delete n._prefixes,delete n._base;let r=n._index||this.index(e);delete n._index;n._sourceMap;delete n._sourceMap;const s=f.Visitor(),i=[],a=s.visitInclusion,o=s.visitExpression;return s.visitInclusion=function(e){return-1===i.indexOf(e)&&e in r.tripleExprs?(i.push(e),o.call(s,r.tripleExprs[e])):a.call(s,e)},s.visitExpression=function(e){return"object"==typeof e&&"id"in e?-1===i.indexOf(e.id)?(i.push(e.id),o.call(s,r.tripleExprs[e.id])):e.id:o.call(s,e)},t&&(s.visitIRI=function(e){return e.replace(t,"")},"imports"in n&&(n.imports=s.visitImports(n.imports))),"shapes"in n&&(n.shapes=Object.keys(r.shapeExprs).map((e=>("extra"in r.shapeExprs[e]&&r.shapeExprs[e].extra.sort(),s.visitShapeDecl(r.shapeExprs[e]))))),n},BiDiClosure:function(){return{needs:{},neededBy:{},inCycle:[],test:function(){function e(e,t){const n=JSON.stringify(e),r=JSON.stringify(t);if(n!==r)throw Error(n+" !== "+r)}this.add(2,3),e(this.needs,{2:[3]}),e(this.neededBy,{3:[2]}),this.add(1,2),e(this.needs,{1:[2,3],2:[3]}),e(this.neededBy,{3:[2,1],2:[1]}),this.add(1,3),e(this.needs,{1:[2,3],2:[3]}),e(this.neededBy,{3:[2,1],2:[1]}),this.add(3,4),e(this.needs,{1:[2,3,4],2:[3,4],3:[4]}),e(this.neededBy,{3:[2,1],2:[1],4:[3,2,1]}),this.add(6,7),e(this.needs,{6:[7],1:[2,3,4],2:[3,4],3:[4]}),e(this.neededBy,{7:[6],3:[2,1],2:[1],4:[3,2,1]}),this.add(5,6),e(this.needs,{5:[6,7],6:[7],1:[2,3,4],2:[3,4],3:[4]}),e(this.neededBy,{7:[6,5],6:[5],3:[2,1],2:[1],4:[3,2,1]}),this.add(5,7),e(this.needs,{5:[6,7],6:[7],1:[2,3,4],2:[3,4],3:[4]}),e(this.neededBy,{7:[6,5],6:[5],3:[2,1],2:[1],4:[3,2,1]}),this.add(7,8),e(this.needs,{5:[6,7,8],6:[7,8],7:[8],1:[2,3,4],2:[3,4],3:[4]}),e(this.neededBy,{7:[6,5],6:[5],8:[7,6,5],3:[2,1],2:[1],4:[3,2,1]}),this.add(4,5),e(this.needs,{1:[2,3,4,5,6,7,8],2:[3,4,5,6,7,8],3:[4,5,6,7,8],4:[5,6,7,8],5:[6,7,8],6:[7,8],7:[8]}),e(this.neededBy,{2:[1],3:[2,1],4:[3,2,1],5:[4,3,2,1],6:[5,4,3,2,1],7:[6,5,4,3,2,1],8:[7,6,5,4,3,2,1]})},add:function(e,t,n){const r=this;e in r.needs||(r.needs[e]=[]),t in r.neededBy||(r.neededBy[t]=[]),r.needs[e]=r.needs[e].concat([t],r.needs[t]).filter((function(e,t,n){return void 0!==e&&n.indexOf(e)===t})),r.neededBy[t]=r.neededBy[t].concat([e],r.neededBy[e]).filter((function(e,t,n){return void 0!==e&&n.indexOf(e)===t})),e in this.neededBy&&this.neededBy[e].forEach((function(e){r.needs[e]=r.needs[e].concat([t],r.needs[t]).filter((function(e,t,n){return void 0!==e&&n.indexOf(e)===t}))})),t in this.needs&&this.needs[t].forEach((function(t){r.neededBy[t]=r.neededBy[t].concat([e],r.neededBy[e]).filter((function(e,t,n){return void 0!==e&&n.indexOf(e)===t}))})),-1!==r.needs[e].indexOf(e)&&(r.inCycle=r.inCycle.concat(r.needs[e]))},trim:function(){function e(e){for(let t=e.length-1;t>-1;--t)e.indexOf(e[t]){let t=r.shapeExprs[e];if(o(e,null),t=n.skipDecl(t),"Shape"===t.type)"extends"in t&&t.extends.forEach((e=>o(e,t))),"expression"in t&&(n.simpleTripleConstraints(t)||[]).forEach((t=>{o(n.getValueType(t.valueExpr,!0),{type:"tc",shapeLabel:e,tc:t})}));else if("NodeConstraint"!==t.type)throw Error("nestShapes currently only supports Shapes and NodeConstraints")}));let a=Object.keys(i).filter((e=>1===i[e].length&&"tc"===i[e][0].type&&e in r.shapeExprs&&"Shape"===n.skipDecl(r.shapeExprs[e]).type&&!r.shapeExprs[e].abstract)).filter((e=>!("noNestPattern"in t)||!e.match(RegExp(t.noNestPattern)))).reduce(((e,t)=>(e[t]={referrer:i[t][0].shapeLabel,predicate:i[t][0].tc.predicate},e)),{});if(!t.no){let o={};if(t.rename){"transform"in t||(t.transform=function(){let e=s.reduce(((e,t,n)=>(e[t]="_:renamed"+n,e)),{});return function(t,n){return e[t]}}()),Object.keys(a).forEach((e=>{let n=r.shapeExprs[e],u=t.transform(e,n);if(o[e]=n.id=u,s[s.indexOf(e)]=u,a[u]=a[e],a[u].was=e,delete a[e],r.shapeExprs[u]=r.shapeExprs[e],delete r.shapeExprs[e],1!==i[e].length)throw Error("assertion: "+e+" doesn't have one reference: ["+i[e]+"]");let c=i[e][0];if("tc"!==c.type)throw"Shape"===c.type?Error("assertion: rename not implemented for Shape: "+c):Error("assertion: "+c.type+" not TripleConstraint or Shape");if("string"!=typeof c.tc.valueExpr)throw Error("assertion: rename not implemented for TripleConstraint expr: "+c.tc.valueExpr);c.tc.valueExpr=u})),Object.keys(a).forEach((e=>{let t=a[e];t.referrer in o&&(t.newReferrer=o[t.referrer])}));let e={};s.forEach((t=>e[t]=r.shapeExprs[t])),r.shapeExprs=e}else{const t=[],s=e.shapes.map((e=>e.id));Object.keys(a).forEach((a=>{const o=r.shapeExprs[a];i[a][0].tc.valueExpr=n.skipDecl(o);const u=s.indexOf(a);if(e.shapes[u].id!==a)throw Error("assertion: found "+e.shapes[u].id+" instead of "+a);t.push(u),delete r.shapeExprs[a]})),t.sort(((e,t)=>t-e)).forEach((t=>{const n=e.shapes[t].id;if(!a[n])throw Error("deleting unexpected shape "+n);delete e.shapes[t].id,e.shapes.splice(t,1)}))}}return a;function o(e,t){e in i||(i[e]=[]),t&&i[e].push(t)}},getPredicateUsage:function(e,t={}){const n=this;let r=s.create();Object.keys(e.shapes).forEach((t=>{let s=n.skipDecl(e.shapes[t]);"Shape"===s.type&&(s.extends||[]).forEach((e=>r.add(e.reference,t)))})),Object.keys(e.shapes).forEach((e=>{e in r.parents||(r.parents[e]=[])}));let i={};return Object.keys(e.shapes).forEach((s=>{let a=n.skipDecl(e.shapes[s]);if("Shape"===a.type){(n.simpleTripleConstraints(a)||[]).forEach((e=>{let a=n.getValueType(e.valueExpr);if(e.predicate in i){i[e.predicate].uses.push(s);let n=i[e.predicate].commonType;if("object"==typeof n||null===n)t[e.predicate].references.push({shapeLabel:s,newType:a});else if("object"==typeof a)i[e.predicate].commonType=null,t[e.predicate]={shapeLabel:s,predicate:e.predicate,curType:n,newType:a,references:[]};else if(n===a);else if(r.parents[n]&&-1!==r.parents[n].indexOf(a))i[e.predicate].polymorphic=!0;else{let o=r.parents[a]?r.parents[a].indexOf(n):-1;if(-1===o){let o=r.parents[n]?r.parents[n].filter((e=>-1!==r.parents[a].indexOf(e))):[];0===o.length?(t[e.predicate]={shapeLabel:s,predicate:e.predicate,curType:n,newType:a,references:[]},i[e.predicate].commonType=null):(i[e.predicate].commonType=o[0],i[e.predicate].polymorphic=!0)}else i[e.predicate].commonType=r.parents[a][o],i[e.predicate].polymorphic=!0}}else i[e.predicate]={uses:[s],commonType:a,polymorphic:!1},"object"==typeof a&&(t[e.predicate]={shapeLabel:s,predicate:e.predicate,newType:a,references:[]})}))}})),i},simpleTripleConstraints:function(e){if(!("expression"in e))return[];if("TripleConstraint"===e.expression.type)return[e.expression];if("EachOf"===e.expression.type&&!e.expression.expressions.find((e=>"TripleConstraint"!==e.type)))return e.expression.expressions;throw Error("can't (yet) express "+JSON.stringify(e))},skipDecl:function(e){return"ShapeDecl"===e.type?e.shapeExpr:e},getValueType:function(e){return"string"==typeof e?e:e.reference?e.reference:"iri"===e.nodeKind?u.Thing:e.datatype?e.datatype:e},getDependencies:function(e,t){return t=t||this.BiDiClosure(),(e.shapes||[]).forEach((function(e){function n(r,s){if("string"==typeof r)t.add(e.id,r);else if("ShapeOr"===r.type||"ShapeAnd"===r.type)r.shapeExprs.forEach((function(e){n(e,s)}));else if("ShapeNot"===r.type)n(r.shapeExpr,1^s);else if("Shape"===r.type)!function(e,r){function s(r,i){function a(e,t){e.forEach((function(e){s(e,t)}))}function o(r,s){if(r.valueExpr&&n(r.valueExpr,s),s&&-1!==t.inCycle.indexOf(e.id))throw Error("Structural error: "+e.id+" appears in negated cycle")}if("string"==typeof r)t.add(e.id,r);else if("id"in r&&t.addIn(r.id,e.id),"TripleConstraint"===r.type)o(r,i);else{if("OneOf"!==r.type&&"EachOf"!==r.type)throw Error("expected {TripleConstraint,OneOf,EachOf,Inclusion} in "+r);a(r.expressions)}}["extends","restricts"].forEach((n=>{e[n]&&e[n].length>0&&e[n].forEach((function(n){t.add(e.id,n)}))})),e.expression&&s(e.expression,r)}(r,s);else if("NodeConstraint"===r.type);else if("ShapeExternal"!==r.type)throw Error("expected Shape{And,Or,Ref,External} or NodeConstraint in "+JSON.stringify(r))}"ShapeDecl"===e.type&&(e=e.shapeExpr),n(e,0)})),t},partition:function(e,t,n,r){const s=e._index||this.index(e),i={shapeExprs:new Map,tripleExprs:new Map};t=t instanceof Array?t:[t],n=n||this.getDependencies(e),r=r||function(e,t){throw new Error("Error: can't find shape "+(t?t+" dependency "+e:e))};const a={};for(let t in e)a[t]="shapes"===t?[]:e[t];return t.forEach((function(e){if(e in i.shapeExprs);else if(e in s.shapeExprs){const t=s.shapeExprs[e];a.shapes.push(t),i.shapeExprs[t.id]=t,e in n.needs&&n.needs[e].forEach((function(t){if(t in n.foundIn&&(t=n.foundIn[t]),t in i.shapeExprs);else if(t in s.shapeExprs){const e=s.shapeExprs[t];a.shapes.push(e),i.shapeExprs[e.id]=e}else r(t,e)}))}else r(e,"supplied")})),a},flatten:function(e,t,n){return this.Visitor().visitSchema(e)},emptySchema:function(){return{type:"Schema"}},merge:function(e,t,n,r){const s=r?e:this.emptySchema();var i;"_base"in e&&(s._base=e._base),"_base"in t&&("_base"in e&&!n||(s._base=t._base)),i="_prefixes",Object.keys(e[i]||{}).forEach((function(t){i in s||(s[i]={}),s[i][t]=e[i][t]})),Object.keys(t[i]||{}).forEach((function(r){i in e&&r in e[i]&&!n||(i in s||(s[i]={}),s[i][r]=t[i][r])})),function(r){(e[r]||new Map).forEach((function(t,n,i){r in s||(s[r]=new Map),s[r].set(n,e[r].get(n))})),(t[r]||new Map).forEach((function(i,a,o){r in e&&e[r].has(a)&&!n||(r in s||(s[r]=new Map),s[r].set(a,t[r].get(a)))}))}("_sourceMap"),"imports"in t&&("imports"in e&&!n||(s.imports=t.imports)),"startActs"in e&&(s.startActs=e.startActs),"startActs"in t&&("startActs"in e&&!n||(s.startActs=t.startActs)),"start"in e&&(s.start=e.start),"start"in t&&("start"in e&&!n||(s.start=t.start));let a=e._index||this.index(e);return r||(e.shapes||[]).forEach((function(e){"shapes"in s||(s.shapes=[]),s.shapes.push(e)})),(t.shapes||[]).forEach((function(t){"shapes"in e&&t.id in a.shapeExprs&&!n||("shapes"in s||(s.shapes=[]),s.shapes.push(t))})),(e._index||t._index)&&(s._index=this.index(s)),s},absolutizeResults:function(e,n){function r(e,r){-1!==["shape","reference","node","subject","predicate","object"].indexOf(e)&&t.isIRI(r[e])&&(r[e]=t.resolveRelativeIRI(n,r[e]))}return function e(t){Object.keys(t).forEach((function(n){"object"==typeof t[n]&&e(t[n]),r&&r(n,t)}))}(e),e},getProofGraph:function(e,n,r){return function e(s){if("NodeConstraintTest"===s.type);else if("SolutionList"===s.type||"ShapeAndResults"===s.type||"ExtensionResults"===s.type)s.solutions.forEach((t=>{t.solution&&e(t.solution)}));else if("ShapeOrResults"===s.type)e(s.solution);else if("ShapeTest"===s.type)"solution"in s&&e(s.solution);else if("OneOfSolutions"===s.type||"EachOfSolutions"===s.type)s.solutions.forEach((t=>{e(t)}));else if("OneOfSolution"===s.type||"EachOfSolution"===s.type)s.expressions.forEach((t=>{e(t)}));else if("TripleConstraintSolutions"===s.type)s.solutions.map((s=>{if("TestedTriple"!==s.type)throw Error("unexpected result type: "+s.type);const i=s;"object"==typeof i.object&&(i.object='"'+i.object.value.replace(/"/g,'\\"')+'"'+(i.object.language?"@"+i.object.language:i.object.type?"^^"+i.object.type:"")),n.addQuad(t.externalTriple(i,r)),"referenced"in s&&e(s.referenced)}));else if("ExtendedResults"===s.type)e(s.extensions),"local"in s&&e(s.local);else if(-1===["ShapeNotResults","Recursion"].indexOf(s.type))throw Error("unexpected expr type "+s.type+" in "+JSON.stringify(s))}(e),n},validateSchema:function(e){const t=this.Visitor();let n=currentExtra=null,r=!1,i=!1;const a=t.visitShape,o=s.create(),u=s.create();let c=e.index||this.index(e);t.visitShape=function(e,n){const r=currentExtra;currentExtra=e.extra;const s=a.call(t,e,n);return currentExtra=r,s};const l=t.visitShapeNot;t.visitShapeNot=function(e,n){const s=r;r^=!0;const i=l.call(t,e,n);return r=s,i};const p=t.visitTripleConstraint;t.visitTripleConstraint=function(e){const n=r;currentExtra&&-1!==currentExtra.indexOf(e.predicate)&&(r^=!0),i=!0;const s=p.call(t,e);return i=!1,r=n,s};const f=t.visitShapeRef;t.visitShapeRef=function(e){if(!(e in c.shapeExprs))throw y(Error("Structural error: reference to "+JSON.stringify(e)+" not found in schema shape expressions:\n"+m(c.shapeExprs)+"."),e);if(!i&&e===n)throw y(Error("Structural error: circular reference to "+n+"."),e);return(r?o:u).add(n,e),f.call(t,e)};const h=t.visitInclusion;t.visitInclusion=function(e){let n;if(!(n=c.tripleExprs[e]))throw y(Error("Structural error: included shape "+e+" not found in schema triple expressions:\n"+m(c.tripleExprs)+"."),e);return h.call(t,e)},(e.shapes||[]).forEach((function(e){n=e.id,t.visitShapeDecl(e,e.id)}));let d=Object.keys(o.children).filter((e=>o.children[e].filter((t=>t in o.children&&-1!==o.children[t].indexOf(e)||t in u.children&&-1!==u.children[t].indexOf(e))).length>0));if(d.length)throw y(Error("Structural error: circular negative dependencies on "+d.join(",")+"."),d[0]);function m(e){return e?Object.keys(e).map((e=>"_:"===e.substr(0,2)?e:"<"+e+">")).join("\n "):"- none defined -"}function y(t,n){return"_sourceMap"in e&&(t.location=(e._sourceMap.get(n)||[void 0])[0]),t}},isWellDefined:function(e){return this.validateSchema(e),e},walkVal:function(e,t){const n=this;if("string"==typeof e)return null;if("SolutionList"===e.type)return e.solutions.reduce(((e,r)=>{const s=n.walkVal(r,t);return s&&Object.keys(s).forEach((t=>{e[t]=t in e?e[t].concat(s[t]):s[t]})),e}),{});if("NodeConstraintTest"===e.type)return n.walkVal(e.shapeExpr,t);if("NodeConstraint"===e.type)return null;if("ShapeTest"===e.type){const s=[];r(e,s);const i=s.length?{"http://shex.io/reflex":s}:{};return"solution"in e&&Object.assign(i,n.walkVal(e.solution,t)),Object.keys(i).length?i:null}if("Shape"===e.type)return null;if("ShapeNotTest"===e.type)return n.walkVal(e.shapeExpr,t);if("ShapeNotResults"===e.type)return n.walkVal(e.solution,t);if("Failure"===e.type)return null;if("ShapeNot"===e.type)return n.walkVal(e.shapeExpr,t);if("ShapeOrResults"===e.type)return n.walkVal(e.solution,t);if("ShapeOr"===e.type)return e.shapeExprs.reduce(((e,r)=>{const s=n.walkVal(r,t);return s&&Object.keys(s).forEach((t=>{e[t]=t in e?e[t].concat(s[t]):s[t]})),e}),{});if("ShapeAndResults"===e.type||"ExtensionResults"===e.type)return e.solutions.reduce(((e,r)=>{const s=n.walkVal(r,t);return s&&Object.keys(s).forEach((t=>{e[t]=t in e?e[t].concat(s[t]):s[t]})),e}),{});if("ShapeAnd"===e.type)return e.shapeExprs.reduce(((e,r)=>{const s=n.walkVal(r,t);return s&&Object.keys(s).forEach((t=>{e[t]=t in e?e[t].concat(s[t]):s[t]})),e}),{});if("ExtendedResults"===e.type)return["extensions","local"].reduce(((e,r)=>{const s=n.walkVal(r,t);return s&&Object.keys(s).forEach((t=>{e[t]=t in e?e[t].concat(s[t]):s[t]})),e}),{});if("EachOfSolutions"===e.type||"OneOfSolutions"===e.type)return e.solutions.reduce(((e,r)=>(r.expressions.forEach((r=>{const s=n.walkVal(r,t);s&&Object.keys(s).forEach((t=>{e[t]=t in e?e[t].concat(s[t]):s[t]}))})),e)),{});if("TripleConstraintSolutions"===e.type){if("solutions"in e){const t={},n=[];return t[e.predicate]=n,e.solutions.forEach((e=>r(e,n))),n.length?t:null}return null}if("Recursion"===e.type)return null;throw Error("unknown shapeExpression type in "+JSON.stringify(e));function r(e,r){const s=[];if(function e(s){if(!s)return!1;if(s.node===a.nil)return!0;if("solution"in s&&"solutions"in s.solution&&1===s.solution.solutions.length&&"expressions"in s.solution.solutions[0]&&2===s.solution.solutions[0].expressions.length&&"predicate"in s.solution.solutions[0].expressions[0]&&s.solution.solutions[0].expressions[0].predicate===a.first&&s.solution.solutions[0].expressions[1].predicate===a.rest){const i=s.solution.solutions[0].expressions,o=i[0],u=i[1].solutions[0],c=o.solutions[0];let l=t(c);if("referenced"in c){const e=n.walkVal(c.referenced,t);e&&(l?l.nested=e:l=e)}return l&&r.push(l),u.object===a.nil||e("ShapeOrResults"===u.referenced.type?u.referenced.solution:u.referenced)}}(e.referenced))[].push.apply(r,s);else{const s=t(e)||{};if("referenced"in e){const r=n.walkVal(e.referenced,t);r&&(s.nested=r)}Object.keys(s).length>0&&r.push(s)}}},valToValues:function(e){return this.walkVal(e,(function(e){return"object"in e?{ldterm:e.object}:null}))},valToExtension:function(e,t){return function e(n){const r=[];let s={};function i(e){if(null===s)return e;if(Array.isArray(e))return s=null,e;for(k in e){if(k in s)return s=null,e;s[k]=p(e[k])}return e}for(let s in n)if("extensions"===s)n[s]&&r.push(i(p(n[s][t])));else if("nested"===s){const t=e(n[s]);Array.isArray(t)?t.forEach(i):i(t),r.push(t)}else r.push(i(e(n[s])));return 1===r.length?r[0]:s||r}(this.walkVal(e,(function(e){return"extensions"in e?{extensions:e.extensions}:null})))},valuesToSchema:function(e){const t=e;if(e[a.type][0].ldterm===i.Schema){const n={"@context":"http://www.w3.org/ns/shex.jsonld",type:"Schema"};i.startActs in t&&(n.startActs=t[i.startActs].map((e=>{const t={type:"SemAct",name:e.nested[i.name][0].ldterm};return i.code in e.nested&&(t.code=e.nested[i.code][0].ldterm.value),t}))),i.imports in t&&(n.imports=t[i.imports].map((e=>e.ldterm))),e[i.start]&&(n.start=l({id:e[i.start][0].ldterm},r(e[i.start][0].nested)));const s=e[i.shapes];return s&&(n.shapes=s.map((e=>{var t=e.nested[a.type][0].ldterm===i.ShapeDecl?{type:i.ShapeDecl,abstract:!!e.nested[i.abstract][0].ldterm.value,shapeExpr:r(e.nested[i.shapeExpr][0].nested)}:r(e.nested);return l({id:e.ldterm},t)}))),n}throw Error("unknown schema type in "+JSON.stringify(e));function n(e,t,n){const r=e[a.type][0].ldterm.substr(i._namespace.length),s=t[r];if(!s)return c;if(s.nary){const t={type:r};return t[s.prop]=e[i[s.prop]].map((e=>o(e))),t}{const t={type:r};return s.prop&&(t[s.prop]=o(e[i[s.prop]][0])),t}function o(e){return s.expr&&"nested"in e?l({id:e.ldterm},n(e.nested)):e.ldterm}}function r(e){let t=n(e,{ShapeAnd:{nary:!0,expr:!0,prop:"shapeExprs"},ShapeOr:{nary:!0,expr:!0,prop:"shapeExprs"},ShapeNot:{nary:!1,expr:!0,prop:"shapeExpr"},ShapeRef:{nary:!1,expr:!1,prop:"reference"},ShapeExternal:{nary:!1,expr:!1,prop:null}},r);if(t!==c)return t;const u=e[a.type][0].ldterm;if(u===i.ShapeDecl){const t={type:"ShapeDecl"};return["abstract"].forEach((n=>{i[n]in e&&(t[n]=!!e[i[n]][0].ldterm.value)})),i.shapeExpr in e&&(t.shapeExpr="nested"in e[i.shapeExpr][0]?l({id:e[i.shapeExpr][0].ldterm},r(e[i.shapeExpr][0].nested)):e[i.shapeExpr][0].ldterm),t}if(u===i.Shape)return t={type:"Shape"},["closed"].forEach((n=>{i[n]in e&&(t[n]=!!e[i[n]][0].ldterm.value)})),["extra","extends","restricts"].forEach((n=>{i[n]in e&&(t[n]=e[i[n]].map((e=>e.ldterm)))})),i.expression in e&&(t.expression="nested"in e[i.expression][0]?l({id:e[i.expression][0].ldterm},o(e[i.expression][0].nested)):e[i.expression][0].ldterm),i.annotation in e&&(t.annotations=e[i.annotation].map((e=>({type:"Annotation",predicate:e.nested[i.predicate][0].ldterm,object:e.nested[i.object][0].ldterm})))),i.semActs in e&&(t.semActs=e[i.semActs].map((e=>{const t={type:"SemAct",name:e.nested[i.name][0].ldterm};return i.code in e.nested&&(t.code=e.nested[i.code][0].ldterm.value),t}))),t;if(u===i.NodeConstraint){const t={type:"NodeConstraint"};return i.values in e&&(t.values=e[i.values].map((e=>s(e)))),i.nodeKind in e&&(t.nodeKind=e[i.nodeKind][0].ldterm.substr(i._namespace.length)),["length","minlength","maxlength","mininclusive","maxinclusive","minexclusive","maxexclusive","totaldigits","fractiondigits"].forEach((n=>{i[n]in e&&(t[n]=parseFloat(e[i[n]][0].ldterm.value))})),i.pattern in e&&(t.pattern=e[i.pattern][0].ldterm.value),i.flags in e&&(t.flags=e[i.flags][0].ldterm.value),i.datatype in e&&(t.datatype=e[i.datatype][0].ldterm),t}throw Error("unknown shapeExpr type in "+JSON.stringify(e))}function s(e,t){if("nested"in e){const t=e.nested[a.type][0].ldterm;if(-1!==[i.IriStem,i.LiteralStem,i.LanguageStem].indexOf(t)){const n=e.nested[i.stem][0].ldterm.value;return{type:t.substr(i._namespace.length),stem:n}}if(-1!==[i.Language].indexOf(t))return{type:"Language",languageTag:e.nested[i.languageTag][0].ldterm.value};if(-1!==[i.IriStemRange,i.LiteralStemRange,i.LanguageStemRange].indexOf(t)){const n=e.nested[i.stem][0];let r=n;"object"==typeof n&&("object"==typeof n.ldterm?r=n.ldterm:n.ldterm.startsWith("_:")&&(r={type:"Wildcard"}));const a={type:t.substr(i._namespace.length),stem:"Wildcard"!==r.type?r.value:r};return i.exclusion in e.nested&&(a.exclusions=e.nested[i.exclusion].map((e=>s(e,t!==i.IriStemRange)))),a}throw Error("unknown objectValue type in "+JSON.stringify(e))}return t?e.ldterm.value:e.ldterm}function o(e){const t=n(e,{EachOf:{nary:!0,expr:!0,prop:"expressions"},OneOf:{nary:!0,expr:!0,prop:"expressions"},Inclusion:{nary:!1,expr:!1,prop:"include"}},o);if(t!==c)return u(e,t),t;if(e[a.type][0].ldterm===i.TripleConstraint){const t={type:"TripleConstraint",predicate:e[i.predicate][0].ldterm};return["inverse"].forEach((n=>{i[n]in e&&(t[n]=!!e[i[n]][0].ldterm.value)})),i.valueExpr in e&&(t.valueExpr=l({id:e[i.valueExpr][0].ldterm},"nested"in e[i.valueExpr][0]?r(e[i.valueExpr][0].nested):{})),u(e,t),t}throw Error("unknown tripleExpr type in "+JSON.stringify(e))}function u(e,t){return i.min in e&&(t.min=parseInt(e[i.min][0].ldterm.value)),i.max in e&&(t.max=parseInt(e[i.max][0].ldterm.value),isNaN(t.max)&&(t.max=-1)),i.annotation in e&&(t.annotations=e[i.annotation].map((e=>({type:"Annotation",predicate:e.nested[i.predicate][0].ldterm,object:e.nested[i.object][0].ldterm})))),i.semActs in e&&(t.semActs=e[i.semActs].map((e=>{const t={type:"SemAct",name:e.nested[i.name][0].ldterm};return i.code in e.nested&&(t.code=e.nested[i.code][0].ldterm.value),t}))),t}},simpleToShapeMap:function(e){return Object.keys(e).reduce(((t,n)=>(e[n].forEach((e=>{t.push({node:n,shape:e})})),t)),[])},absolutizeShapeMap:function(e,n){return e.map((e=>Object.assign(e,{node:t.resolveRelativeIRI(n,e.node),shape:t.resolveRelativeIRI(n,e.shape)})))},errsToSimple:function(t){const n=this;if("FailureList"===t.type)return t.errors.reduce(((e,t)=>e.concat(n.errsToSimple(t))),[]);if("Failure"===t.type)return["validating "+t.node+" as "+t.shape+":"].concat(function e(t){return t.reduce((function(t,n){const r=Object.keys(n);return t.concat(1===r.length&&"errors"===r[0]?e(n.errors):n)}),[])}(t.errors).reduce(((e,t)=>{const r=n.errsToSimple(t).map((e=>" "+e));return e.length>0?e.concat([" OR"]).concat(r):r.map((e=>" "+e))}),[]));if("TypeMismatch"===t.type){const r=Array.isArray(t.errors)?t.errors.reduce(((e,t)=>e.concat(("string"==typeof t?[t]:n.errsToSimple(t)).map((e=>" "+e)))),[]):" "+("string"==typeof e?[t.errors]:n.errsToSimple(t.errors));return["validating "+h(t.triple.object)+":"].concat(r)}if("RestrictionError"===t.type){var s=t.errors.constructor===Array?t.errors.reduce(((e,t)=>e.concat(("string"==typeof t?[t]:n.errsToSimple(t)).map((e=>" "+e)))),[]):" "+("string"==typeof e?[t.errors]:n.errsToSimple(t.errors));return["validating restrictions on "+h(t.focus)+":"].concat(s)}if("ShapeAndFailure"===t.type)return Array.isArray(t.errors)?t.errors.reduce(((e,t)=>e.concat(("string"==typeof t?[t]:n.errsToSimple(t)).map((e=>" "+e)))),[]):" "+("string"==typeof e?[t.errors]:n.errsToSimple(t.errors));if("ShapeOrFailure"===t.type)return Array.isArray(t.errors)?t.errors.reduce(((e,t)=>e.concat(" OR "+("string"==typeof t?[t]:n.errsToSimple(t)))),[]):" OR "+("string"==typeof e?[t.errors]:n.errsToSimple(t.errors));if("ShapeNotFailure"===t.type)return["Node "+t.errors.node+" expected to NOT pass "+t.errors.shape];if("ExcessTripleViolation"===t.type)return["validating "+h(t.triple.object)+": exceeds cardinality"];if("ClosedShapeViolation"===t.type)return["Unexpected triple(s): {"].concat(t.unexpectedTriples.map((e=>" "+e.subject+" "+e.predicate+" "+h(e.object)+" ."))).concat(["}"]);if("NodeConstraintViolation"===t.type){const e=r(95)();let n;return e._write(e._writeNodeConstraint(t.shapeExpr).join("")),e.end(((e,t)=>{n=t})),["NodeConstraintError: expected to match "+n]}if("MissingProperty"===t.type)return["Missing property: "+t.property];if("NegatedProperty"===t.type)return["Unexpected property: "+t.property];if("AbstractShapeFailure"===t.type)return["Abstract Shape: "+t.shape];if(Array.isArray(t))return t.reduce(((e,t)=>{const r=n.errsToSimple(t).map((e=>" "+e));return e.length?e.concat(["AND"]).concat(r):r}),[]);if("SemActFailure"===t.type){const r=Array.isArray(t.errors)?t.errors.reduce(((e,t)=>e.concat(("string"==typeof t?[t]:n.errsToSimple(t)).map((e=>" "+e)))),[]):" "+("string"==typeof e?[t.errors]:n.errsToSimple(t.errors));return["rejected by semantic action:"].concat(r)}if("SemActViolation"===t.type)return[t.message];if("BooleanSemActFailure"===t.type)return["Failed evaluating "+t.code+" on context "+JSON.stringify(t.ctx)];throw Error('unknown shapeExpression type "'+t.type+'" in '+JSON.stringify(t))},resolveRelativeIRI:t.resolveRelativeIRI,resolvePrefixedIRI:function(e,t){const n=e.indexOf(":");if(-1===n)return null;const r=t[e.substr(0,n)];return void 0===r?null:r+e.substr(n+1)},parsePassedNode:function(e,n,r,s,i){if(void 0===e||0===e.length)return s&&s(n.base)?n.base:r?r():this.NotSupplied;if("_"===e[0]&&":"===e[1])return e;if('"'===e[0]){const r=e.match(/^"((?:[^"\\]|\\")*)"(?:@(.+)|\^\^(?:<(.*)>|([^:]*):(.*)))?$/);if(!r)throw Error("malformed literal: "+e);const s=r[1],i=r[2],a=r[3],o=r[4],u=r[5],c='"'+s+'"';if(void 0!==i)return c+"@"+i;if(void 0!==o){if(!(o in n.prefixes))throw Error("error parsing node "+e+' no prefix for "'+o+'"');return c+"^^"+n.prefixes[o]+u}return void 0!==a?c+"^^"+t.resolveRelativeIRI(n.base,a):c}if(!n)return s(e)?e:this.UnknownIRI;const a="<"===e[0]&&">"===e[e.length-1];a&&(e=e.substr(1,e.length-2));const o=t.resolveRelativeIRI(n.base||"",e);if(s(o))return o;if(!a){const t=this.resolvePrefixedIRI(e,n.prefixes);if(null!==t&&s(t))return t}return i?i(o):this.UnknownIRI},executeQueryPromise:function(e,t){const n=t+"?query="+encodeURIComponent(e);return fetch(n,{headers:{Accept:"application/sparql-results+json"}}).then((e=>e.json())).then((e=>this.parseSparqlJsonResults(e)))},executeQuery:function(e,t){const n=t+"?query="+encodeURIComponent(e),r=new XMLHttpRequest;r.open("GET",n,!1),r.setRequestHeader("Accept","application/sparql-results+json"),r.send();const s=JSON.parse(r.responseText);return this.parseSparqlJsonResults(s)},parseSparqlJsonResults:function(e){const t=e.head.vars;return e.results.bindings.map((e=>t.map((t=>{const n=e[t];switch(n.type){case"uri":return n.value;case"bnode":return"_:"+n.value;case"literal":return'"'+n.value.replace(/"/g,'\\""')+'"'+("xml:lang"in n?"@"+n["xml:lang"]:"")+("datatype"in n?"^^"+n.datatype:"");case"typed-literal":return'"'+n.value.replace(/"/g,'\\""')+'"^^'+n.datatype;default:throw"unknown XML results type: "+n.type}}))))},rdfjsDB:function(e,n){return{getNeighborhood:function(r,s){let i;n&&(i=new Date,n.start(!1,r,s));const a=e.getQuads(r,null,null,null).map(t.internalTriple);if(n){const e=new Date;n.end(a,e.valueOf()-i.valueOf()),i=e}n&&n.start(!0,r,s);const o=e.getQuads(null,null,r,null).map(t.internalTriple);return n&&n.end(o,(new Date).valueOf()-i.valueOf()),{outgoing:a,incoming:o}},getSubjects:function(){return e.getSubjects().map(t.internalTerm)},getPredicates:function(){return e.getPredicates().map(t.internalTerm)},getObjects:function(){return e.getObjects().map(t.internalTerm)},getQuads:function(){return e.getQuads.apply(e,arguments).map(t.internalTriple)},get size(){return e.size}}},makeTriplesDB:function(e){var t=[],n=[];return{getNeighborhood:function(e,r,s){return{outgoing:n,incoming:t}},getTriplesByIRI:function(e,r,s,i){return t.concat(n).filter((t=>!(e&&e!==t.subject||r&&r!==t.predicate||e&&e!==t.object)))},getSubjects:function(){return["!Triples DB can't index subjects"]},getPredicates:function(){return["!Triples DB can't index predicates"]},getObjects:function(){return["!Triples DB can't index objects"]},get size(){},addIncomingTriples:function(e){Array.prototype.push.apply(t,e)},addOutgoingTriples:function(e){Array.prototype.push.apply(n,e)}}},NotSupplied:"-- not supplied --",UnknownIRI:"-- not found --",unescapeText:function(e,t){const n=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\(.)/g;try{return e=e.replace(n,(function(e,n,r,s){let i;if(n){if(i=parseInt(n,16),isNaN(i))throw new Error;return String.fromCharCode(i)}if(r){if(i=parseInt(r,16),isNaN(i))throw new Error;return i<65535?String.fromCharCode(i):String.fromCharCode(55296+((i-=65536)>>10),56320+(1023&i))}{const e=t[s];if(!e)throw new Error("no replacement found for '"+s+"'");return e}}))}catch(e){return console.warn(e),""}}};function h(e){if("object"!=typeof e)return e;const t='"'+e.value+'"';return"language"in e?t+"@"+e.language:"type"in e?t+"^^"+e.type:t}function d(e,t){for(let n in f)t?e.prototype[n]=m(f[n]):e[n]=f[n];return e}function m(e){return function(t){return e(this,t)}}return d(d)}();t.exports=s},457:(e,t,n)=>{const r=function(){const e={term:"START"},t=n(118);let r=n(806),s=n(443);const i=n(515);function a(e){return t.isIRI(e)?e:t.isLiteral(e)?t.getLiteralValue(e):e.substr(2)}const o="http://www.w3.org/2001/XMLSchema#",u=[o+"integer",o+"nonPositiveInteger",o+"negativeInteger",o+"long",o+"int",o+"short",o+"byte",o+"nonNegativeInteger",o+"unsignedLong",o+"unsignedInt",o+"unsignedShort",o+"unsignedByte",o+"positiveInteger"],c=[o+"decimal"].concat(u),l=[o+"float",o+"double"].concat(c),p={"http://www.w3.org/2001/XMLSchema#integer":function(e,t){return e.match(/^[+-]?[0-9]+$/)||t("illegal integer value '"+e+"'"),parseInt(e)},"http://www.w3.org/2001/XMLSchema#decimal":function(e,t){return e.match(/^[+-]?(?:[0-9]*\.[0-9]+|[0-9]+)$/)||t("illegal decimal value '"+e+"'"),parseFloat(e)}},f=/^[+\-]?(?:[0-9]+(?:\.[0-9]*)?|\.[0-9]+)(?:[eE][+\-]?[0-9]+)?$/;p[o+"float"]=function(e,t){return"NaN"===e?NaN:"INF"===e?1/0:"-INF"===e?-1/0:(e.match(f)||t("illegal float value '"+e+"'"),parseFloat(e))},p[o+"double"]=function(e,t){return"NaN"===e?NaN:"INF"===e?1/0:"-INF"===e?-1/0:(e.match(f)||t("illegal double value '"+e+"'"),Number(e))};const h={length:function(e,t){return e.length===t},minlength:function(e,t){return e.length>=t},maxlength:function(e,t){return e.length<=t}},d={mininclusive:function(e,t){return e>=t},minexclusive:function(e,t){return e>t},maxinclusive:function(e,t){return e<=t},maxexclusive:function(e,t){return e!1===e?e:-1!==["value","type","language"].indexOf(t)),!0)}function g(e){return{byPredicate:e.reduce((function(e,t){const n=t.predicate;return n in e||(e[n]=[]),e[n].push(t),e}),{}),candidates:E(e.length).map((function(){return[]})),misses:[]}}function _(e,n){const[r,s]=[e,n].map((e=>t.isBlank(e)?1:t.isLiteral(e)?2:3));return r===s?e.localeCompare(n):r-s}function E(e){return Array.from(Array(e))}function b(e,t,n){t in e||v("expected "+JSON.stringify(e)+" to have a '"+t+"' attribute."),arguments.length>2&&e[t]!==n&&v("expected "+t+" attribute '"+e[t]+"' to equal '"+n+"'.")}function S(){}function v(){const e=Array.prototype.join.call(arguments,""),t=new Error(e);throw Error.captureStackTrace(t,v),t}function A(e){return E(e).map((()=>[]))}return{construct:function c(f,O,w){if(!(this instanceof c))return new c(f,O,w);let T=f._index||r.index(f);this.type="ShExValidator",w=w||{},this.options=w,this.options.coverage=this.options.coverage||"exhaustive","noCache"in w&&w.noCache||(this.known={});const I=this;this.schema=f,this._expect=this.options.lax?S:b,this._optimize={},this.reset=function(){};const N=this.options.regexModule||n(863);function k(e,t,n,r,s){const i=g(t.slice(0,n)),a=g(t.slice(n));return e.reduce((function(e,n,r){n.inverse,n.inverse;const o=(n.inverse?a:i).byPredicate[n.predicate]||[],u=I._triplesMatchingShapeExpr(o,n,s);return u.hits.forEach((function(n){const s=t.indexOf(n.triple);e.constraintList[s].push(r),e.results[r][s]=n.sub})),u.misses.forEach((function(n){const s=t.indexOf(n.triple);e.misses[s]={constraintNo:r,errors:n.errors}})),e}),{misses:{},results:A(e.length),constraintList:A(t.length)})}function F(e,t,n){return e.slice().reduce((function(e,t,r){return"NO_TRIPLE_CONSTRAINT"!==t&&e[t].push({tNo:r,res:n.results[t][r]}),e}),E(t.length).map((()=>[])))}function L(e,t,n,r){if(!("extends"in e))return null;const i=[],a=[];for(let o=0;oc.addOutgoingTriples([e])));const l=I.validate(t,u,r.tracker,r.seen,c);"errors"in l?a.push(l):i.push(l)}return a.length>0?{type:"ExtensionFailure",errors:a}:{type:"ExtensionResults",solutions:i}}this.indexTripleConstraints=function(e){const t=[];return e&&function e(n){return"string"==typeof n?e(T.tripleExprs[n]):"TripleConstraint"===n.type?(t.push(n),[t.length-1]):"OneOf"===n.type||"EachOf"===n.type?n.expressions.reduce((function(t,n){return t.concat(e(n))}),[]):v("unexpected expr type: "+n.type)}(e),t},this.emptyTracker=function(){const e=e=>e;return{recurse:e,known:e,enter:function(e,t){++this.depth},exit:function(e,t,n){--this.depth},depth:0}},this.validate=function(n,r,s,i,a){if("object"==typeof n&&"termType"in n&&(n=t.internalTerm(n)),"object"==typeof n){const e=n;if("api"===this.options.results)return e.map((e=>{let t=new Date;const n=this.validate(e.node,e.shape,r,s);return t=new Date-t,{node:e.node,shape:e.shape,status:"errors"in n?"nonconformant":"conformant",appinfo:n,elapsed:t}}));const t=e.reduce(((e,t)=>{const n=this.validate(t.node,t.shape,r,s,a);return"errors"in n?{passes:e.passes,failures:e.failures.concat(n)}:{passes:e.passes.concat(n),failures:e.failures}}),{passes:[],failures:[]});return t.failures.length>0?1!==t.failures.length?{type:"FailureList",errors:t.failures}:t.failures[0]:1!==t.passes.length?{type:"SolutionList",solutions:t.passes}:t.passes[0]}const o=void 0===s;s||(s=this.emptyTracker()),r&&r!==e||f.start||v("start production not defined");let u=null;if(u=r==e?f.start:this._lookupShape(r),"string"!=typeof r)return this._validateShapeDecl(n,u,e,0,s,i);void 0===i&&(i={});const c=n+"@"+(r===e?"_: -start-":r);if(!a){if(c in i)return s.recurse({type:"Recursion",node:y(n),shape:r});if("known"in this&&c in this.known)return s.known(this.known[c]);i[c]={point:n,shape:r},s.enter(n,r)}const l=this._validateDescendants(n,r,0,s,i,a);return a||(s.exit(n,r,l),delete i[c],"known"in this&&(this.known[c]=l)),"startActs"in f&&o&&(l.startActs=f.startActs),l},this._validateDescendants=function(e,t,n,r,a,o,u){if(o)return this._validateShapeDecl(e,this._lookupShape(t),t,0,r,a,o);let c=[t];c=c.concat(function(e){const t={},n=i.create();return function(e){const r=s.Visitor();let i,a;const o=r.visitShapeDecl;r.visitShapeDecl=function(e){return i=e.id,a=e.abstract,t[e.id]=e.abstract,o.call(r,e,e.id)};r.visitShape;return r.visitShape=function(e){return"extends"in e&&e.extends.forEach((e=>{const t=s.Visitor();t.visitShapeRef=function(e){return n.add(e,i),"null"},t.visitShapeExpr(e)})),"null"},r}().visitSchema(e),n.children}(this.schema)[t]||[]);for(let e=c.length-1;e>=0;--e)c.indexOf(c[e])!this._lookupShape(e).abstract)));const l=c.reduce(((t,n)=>{const s=this._lookupShape(n),i=this._validateShapeDecl(e,s,n,0,r,a,o);return"errors"in i?{passes:t.passes,failures:t.failures.concat(i)}:{passes:t.passes.concat(i),failures:t.failures}}),{passes:[],failures:[]});let p;return p=l.passes.length>0?1!==l.passes.length?{type:"SolutionList",solutions:l.passes}:l.passes[0]:l.failures.length>0?1!==l.failures.length?{type:"FailureList",errors:l.failures}:l.failures[0]:{type:"AbstractShapeFailure",shape:t,errors:t+" has no non-abstract children"},p},this._validateShapeDecl=function(e,t,n,r,s,i,a){const o="ShapeDecl"===t.type?t.shapeExpr:t;return this._validateShapeExpr(e,o,n,r,s,i,a)},this._lookupShape=function(e){if("shapes"in this.schema&&0!==this.schema.shapes.length){if(e in T.shapeExprs)return T.shapeExprs[e];v("shape "+e+" not found in:\n"+Object.keys(T.shapeExprs||[]).map((e=>" "+e)).join("\n"))}else v("shape "+e+" not found; no shapes in schema")},this._validateShapeExpr=function(e,t,n,r,s,i,a){if(""===e)throw Error("validation needs a valid focus node");let o=null;if("string"==typeof t)o=this._validateDescendants(e,t,r,s,i,a,!0);else if("NodeConstraint"===t.type){const r=this._errorsMatchingNodeConstraint(e,t,null);o=r.errors&&r.errors.length?{type:"Failure",node:y(e),shape:n,errors:r.errors.map((function(e){return{type:"NodeConstraintViolation",shapeExpr:t,error:e}}))}:{type:"NodeConstraintTest",node:y(e),shape:n,shapeExpr:t}}else if("Shape"===t.type)o=this._validateShape(e,t,n,r,s,i,a);else if("ShapeExternal"===t.type)o=this.options.validateExtern(e,n,s,i);else if("ShapeOr"===t.type){const u=[];for(let o=0;o0?{type:"ShapeAndFailure",errors:c}:{type:"ShapeAndResults",solutions:u}}}if("string"!=typeof t&&"Shape"!==t.type&&!("errors"in o)&&"semActs"in t){const r=this.semActHandler.dispatchAll(t.semActs,Object.assign({node:e},o),o);if(r.length)return{type:"Failure",node:y(e),shape:n,errors:r}}return o},this._validateShape=function(e,t,n,r,i,a,o){const u={db:O,shapeLabel:n,depth:r,tracker:i,seen:a};let c=null;const l={};if("startActs"in f){const t=this.semActHandler.dispatchAll(f.startActs,null,l);if(t.length)return{type:"Failure",node:y(e),shape:n,errors:t}}const p=(o||O).getNeighborhood(e,n,t),h=p.outgoing.length,d=p.outgoing.sort(((e,t)=>e.predicate.localeCompare(t.predicate)||_(e.object,t.object))).concat(p.incoming.sort(((e,t)=>e.predicate.localeCompare(t.predicate)||_(e.object,t.object)))),m=this.indexTripleConstraints(t.expression),x=function(e){const t=[];"extends"in e&&e.extends.forEach(((e,r)=>{const s={},i={};n(e,s,i),[s,i].forEach((e=>{Object.keys(e).forEach((n=>{let s=e[n];t.push({tripleConstraint:s,extendsNo:r})}))}))}));return t;function n(e,t,r){const i=s.Visitor();let a=1,o=1;const u=i.visitOneOf;i.visitShapeRef=function(e){return i.visitShapeDecl(this._lookupShape(e))},i.visitShape=function(e,s){return"extends"in e&&e.extends.forEach((e=>n(e,t,r))),"expression"in e&&i.visitExpression(e.expression),{type:"Shape"}},i.visitOneOf=function(e){const t=a,n=o;a=0,u.call(i,e),a=t,o=n},i.visitTripleConstraint=function(e){const n=e.inverse?t:r;let s="min"in e?e.min:1;s*=a;let i="max"in e?e.max:1;return i*=o,n[e.predicate]={type:"TripleConstraint",predicate:e.predicate,min:e.predicate in n?Math.max(n[e.predicate].min,s):s,max:e.predicate in n?Math.min(n[e.predicate].max,i):i,seen:e.predicate in n?n[e.predicate].seen+1:1,tcs:e.predicate in n?n[e.predicate].tcs.concat([e]):[e]},e},i.visitShapeExpr(e)}}(t),g=x.map((e=>e.tripleConstraint)).concat(m),b=k(g,d,h,e,u),{misses:S,extras:v}=function(e,t,n,r){const s=[],i=e.constraintList.reduce((function(i,a,o){return 0===a.length&&o0?e[i][0]:t}function a(){if(null!==s&&0===s.length)return!1;if(null===s)return i(),!0;let a=n-1;if(r[a]++,r[a]=e[a].length;){if(0==a)return!1;r[a]=0,s[a]=e[a].length>0?e[a][0]:t,r[--a]++}return s[a]=e[a][r[a]],!0}return{next:a,do:function(e,t){return e.apply(t,s)},get:function(){return s}}}(b.constraintList,"NO_TRIPLE_CONSTRAINT"),w=[],I=N.compile(f,t,T);for(;A.next()&&null===c;){const r=[],s=[],i=E(d.length).map((function(){return 0})),a=A.get(),o=[],l=[],p=E((t.extends||[]).length).map((()=>[]));if(a.forEach(((e,t)=>{if("NO_TRIPLE_CONSTRAINT"!==e&&e"NO_TRIPLE_CONSTRAINT"===o[t]&&"NO_EXTENDS"===l[t]&&-1===v.indexOf(t)));e.length>0&&r.push({type:"ClosedShapeViolation",unexpectedTriples:e})}o.forEach((function(e,t){"NO_TRIPLE_CONSTRAINT"!==e&&(s.push(d[t]),++i[e])}));const f=F(o,g,b);let m=L(t,e,p,u);if(null===m||!("errors"in m)){const t=I.match(O,e,g,f,o,d,this.semActHandler,null);!("errors"in t)&&m?(m={type:"ExtendedResults",extensions:m},Object.keys(t).length>0&&(m.local=t)):m=t}"errors"in m&&[].push.apply(r,m.errors);const _={type:"ShapeTest",node:y(e),shape:n};if(0===r.length&&Object.keys(m).length>0&&(_.solution=m),"semActs"in t){const n=this.semActHandler.dispatchAll(t.semActs,Object.assign({node:e},m),_);n.length&&[].push.apply(r,n)}w.push(r),0===r.length&&(c=_)}const R=S.map((function(e){const t=d[e.tripleNo];return{type:"TypeMismatch",triple:{type:"TestedTriple",subject:t.subject,predicate:t.predicate,object:y(t.object)},constraint:g[e.constraintNo],errors:e.errors}})),j=w[w.length-1];let C=R.concat(1===j.length?j[0]:j);return C.length>0&&(c={type:"Failure",node:y(e),shape:n,errors:C}),function(e,t){"annotations"in e&&(t.annotations=e.annotations);return t}(t,c)},this._triplesMatchingShapeExpr=function(e,t,n){const r=this,s=[],i=[];return e.forEach((function(e){const a=t.inverse?e.subject:e.object;let o;const u=JSON.parse(JSON.stringify(r.semActHandler.results));(void 0===t.valueExpr?void 0:(o=r._errorsMatchingShapeExpr(a,t.valueExpr,n)).errors)?-1===i.indexOf(e)&&(r.semActHandler.results=JSON.parse(JSON.stringify(u)),s.push({triple:e,errors:o})):i.push({triple:e,sub:o})})),{hits:i,misses:s}},this._errorsMatchingShapeExpr=function(e,t,n,r){const s=this;if("string"==typeof t)return s.validate(e,t,n.tracker,n.seen,r);if("NodeConstraint"===t.type)return this._errorsMatchingNodeConstraint(e,t,null);if("Shape"===t.type)return s._validateShapeExpr(e,t,n.shapeLabel,n.depth,n.tracker,n.seen,r);if("ShapeOr"===t.type){const i=[];for(let a=0;a is less than the min:",r.min):e>r.max&&n('"'+e+'"^^<'+t+"> is greater than the max:",r.min)}(p[f](i,g),n.datatype,g):n.datatype===o+"boolean"?"true"!==i&&"false"!==i&&"1"!==i&&"0"!==i&&g("illegal boolean value: "+i):n.datatype===o+"dateTime"&&(i.match(/^[+-]?\d{4}-[01]\d-[0-3]\dT[0-5]\d:[0-5]\d:[0-5]\d(\.\d+)?([+-][0-2]\d:[0-5]\d|Z)?$/)||g("illegal dateTime value: "+i)):g("mismatched datatype: "+e+" is not a literal with datatype "+n.datatype)),n.values&&(t.isLiteral(e)&&n.values.reduce(((t,n)=>{if(t)return!0;const r=y(e);return"Language"===n.type?n.languageTag===r.language:"object"==typeof n&&"value"in n&&(n.value===r.value&&n.type===r.type&&n.language===r.language)}),!1)||-1!==n.values.indexOf(e)||n.values.some((function(n){if("object"==typeof n&&!("value"in n)){"type"in n||v("expected "+JSON.stringify(n)+" to have a 'type' attribute.");const i=["Language","IriStem","LiteralStem","LanguageStem","IriStemRange","LiteralStemRange","LanguageStemRange"];function r(e,r,s){return t.isLiteral(e)?-1!==["LiteralStem","LiteralStemRange"].indexOf(n.type)?s(t.getLiteralValue(e),r):-1!==["LanguageStem","LanguageStemRange"].indexOf(n.type)?s(t.getLiteralLanguage(e)||null,r):g("literal "+e+" not comparable with non-literal "+r):-1===["IriStem","IriStemRange"].indexOf(n.type)?g("nonliteral "+e+" not comparable with literal "+JSON.stringify(r)):s(e,r)}function s(e,t){return r(e,t,((e,t)=>"LanguageStem"===n.type||"LanguageStemRange"===n.type?null!==e&&(e===t||""===t||"-"===e[t.length]):e.startsWith(t)))}if(-1===i.indexOf(n.type)&&v("expected type attribute '"+n.type+"' to be in '"+i+"'."),x(n.stem)){if(!s(e,n.stem))return!1}else b(n.stem,"type","Wildcard");return!n.exclusions||!n.exclusions.some((function(t){if(x(t))return r(e,t,((e,t)=>e===t));{"type"in t||v("expected "+JSON.stringify(t)+" to have a 'type' attribute.");const n=["IriStem","LiteralStem","LanguageStem"];return-1===n.indexOf(t.type)&&v("expected type attribute '"+t.type+"' to be in '"+n+"'."),s(e,t.stem)}}))}}))||g("value "+e+" not found in set "+JSON.stringify(n.values))),"pattern"in n){const t="flags"in n?new RegExp(n.pattern,n.flags):new RegExp(n.pattern);a(e).match(t)||g("value "+a(e)+" did not match pattern "+n.pattern)}Object.keys(h).forEach((function(t){t in n&&!h[t](i,n[t])&&g("facet violation: expected "+t+" of "+n[t]+" but got "+e)})),Object.keys(d).forEach((function(t){t in n&&(f?d[t](p[f](i,g),n[t])||g("facet violation: expected "+t+" of "+n[t]+" but got "+e):g("facet violation: numeric facet "+t+" can't apply to "+e))})),Object.keys(m).forEach((function(t){t in n&&(f===o+"integer"||f===o+"decimal"?m[t](""+p[f](i,g),n[t])||g("facet violation: expected "+t+" of "+n[t]+" but got "+e):g("facet violation: numeric facet "+t+" can't apply to "+e))}));const _={type:null,focus:e,shapeExpr:n};return s.length?(_.type="NodeConstraintViolation",_.errors=s):_.type="NodeConstraintTest",_},this.semActHandler={handlers:{},results:{},register:function(e,t){this.handlers[e]=t},dispatchAll:function(e,t,n){const r=this;return e.reduce((function(e,s){if(0===e.length&&s.name in r.handlers){const i="code"in s?s.code:I.options.semActs[s.name],a="extensions"in n&&s.name in n.extensions,o=a?n.extensions[s.name]:{},u=r.handlers[s.name].dispatch(i,t,o);if("boolean"==typeof u)u||e.push({type:"SemActFailure",errors:[{type:"BooleanSemActFailure",code:i,ctx:t}]});else{if("object"!=typeof u||!Array.isArray(u))throw Error("unsupported response from semantic action handler: "+JSON.stringify(u));u.length>0&&e.push({type:"SemActFailure",errors:u})}return!a&&Object.keys(o).length>0&&("extensions"in n||(n.extensions={}),n.extensions[s.name]=o),e}return e}),[])}}},start:e,options:{coverage:{firstError:"fail on first error (usually used with eval-simple-1err)",exhaustive:"find as many errors as possible (usually used with eval-threaded-nerr)"}}}}();e.exports=r},806:e=>{function t(){function e(e){return"object"!=typeof e||"value"in e&&Object.keys(e).reduce(((e,t)=>!1===e?e:-1!==["value","type","language"].indexOf(t)),!0)}function t(e){return"string"==typeof e}const n={runtimeError:function(e){throw e},visitSchema:function(e){const t={type:"Schema"};return this._expect(e,"type","Schema"),this._maybeSet(e,t,"Schema",["@context","prefixes","base","imports","startActs","start","shapes"],["_base","_prefixes","_index","_sourceMap"]),t},visitPrefixes:function(e){return void 0===e?void 0:function(e,t){const n={};return Object.keys(e).forEach((function(r){n[r]=t(e[r])})),n}(e,(function(e){return e}))},visitIRI:function(e){return e},visitImports:function(e){const t=this;return e.map((function(e){return t.visitIRI(e)}))},visitStartActs:function(e){const t=this;return void 0===e?void 0:e.map((function(e){return t.visitSemAct(e)}))},visitSemActs:function(e){const t=this;if(void 0===e)return;const n=[];return Object.keys(e).forEach((function(r){n.push(t.visitSemAct(e[r],r))})),n},visitSemAct:function(e,t){const n={type:"SemAct"};return this._expect(e,"type","SemAct"),this._maybeSet(e,n,"SemAct",["name","code"]),n},visitShapes:function(e){const t=this;if(void 0!==e)return e.map((e=>t.visitShapeDecl(e)))},visitProductions999:function(e){const t=this;if(void 0===e)return;const n={};return Object.keys(e).forEach((function(r){n[r]=t.visitExpression(e[r],r)})),n},visitShapeDecl:function(e,t){return"ShapeDecl"===e.type?this._maybeSet(e,{type:"ShapeDecl"},"ShapeDecl",["id","abstract","restricts","shapeExpr"]):this.visitShapeExpr(e,t)},visitShapeExpr:function(e,n){if(t(e))return this.visitShapeRef(e);const r="Shape"===e.type?this.visitShape(e,n):"NodeConstraint"===e.type?this.visitNodeConstraint(e,n):"ShapeAnd"===e.type?this.visitShapeAnd(e,n):"ShapeOr"===e.type?this.visitShapeOr(e,n):"ShapeNot"===e.type?this.visitShapeNot(e,n):"ShapeExternal"===e.type?this.visitShapeExternal(e):null;if(null===r)throw Error("unexpected shapeExpr type: "+e.type);return r},_visitShapeGroup:function(e,t){this._testUnknownAttributes(e,["id","shapeExprs"],e.type,this.visitShapeNot);const n=this,r={type:e.type};return"id"in e&&(r.id=e.id),r.shapeExprs=e.shapeExprs.map((function(e){return n.visitShapeExpr(e,t)})),r},visitShapeNot:function(e,t){this._testUnknownAttributes(e,["id","shapeExpr"],"ShapeNot",this.visitShapeNot);const n={type:e.type};return"id"in e&&(n.id=e.id),n.shapeExpr=this.visitShapeExpr(e.shapeExpr,t),n},visitShape:function(e,t){const n={type:"Shape"};return this._expect(e,"type","Shape"),this._maybeSet(e,n,"Shape",["id","abstract","extends","closed","expression","extra","semActs","annotations"]),n},_visitShapeExprList:function(e){const t=this;return e.map((function(e){return t.visitShapeExpr(e,void 0)}))},visitNodeConstraint:function(e,t){const n={type:"NodeConstraint"};return this._expect(e,"type","NodeConstraint"),this._maybeSet(e,n,"NodeConstraint",["id","nodeKind","datatype","pattern","flags","length","reference","minlength","maxlength","mininclusive","minexclusive","maxinclusive","maxexclusive","totaldigits","fractiondigits","values","annotations","semActs"]),n},visitShapeRef:function(e){if("string"!=typeof e){let t=Exception("visitShapeRef expected a string, not "+JSON.stringify(e));throw console.warn(t),t}return e},visitShapeExternal:function(e){return this._testUnknownAttributes(e,["id"],"ShapeExternal",this.visitShapeNot),Object.assign("id"in e?{id:e.id}:{},{type:"ShapeExternal"})},_visitGroup:function(e,t){const n=this,r=Object.assign("id"in e?{id:null}:{},{type:e.type});return r.expressions=e.expressions.map((function(e){return n.visitExpression(e)})),this._maybeSet(e,r,"expr",["id","min","max","annotations","semActs"],["expressions"])},visitTripleConstraint:function(e){return this._maybeSet(e,Object.assign("id"in e?{id:null}:{},{type:"TripleConstraint"}),"TripleConstraint",["id","inverse","predicate","valueExpr","min","max","annotations","semActs"])},visitExpression:function(e){if("string"==typeof e)return this.visitInclusion(e);const t="TripleConstraint"===e.type?this.visitTripleConstraint(e):"OneOf"===e.type?this.visitOneOf(e):"EachOf"===e.type?this.visitEachOf(e):null;if(null===t)throw Error("unexpected expression type: "+e.type);return t},visitValues:function(t){const n=this;return t.map((function(t){return e(t)||"Language"===t.type?t:n.visitStemRange(t)}))},visitStemRange:function(t){const n=this;"type"in t||n.runtimeError(Error("expected "+JSON.stringify(t)+" to have a 'type' attribute."));const r=["IriStem","LiteralStem","LanguageStem","IriStemRange","LiteralStemRange","LanguageStemRange"];let s;return-1===r.indexOf(t.type)&&n.runtimeError(Error("expected type attribute '"+t.type+"' to be in '"+r+"'.")),e(t)?(this._expect(t.stem,"type","Wildcard"),s={type:t.type,stem:{type:"Wildcard"}}):s={type:t.type,stem:t.stem},t.exclusions&&(s.exclusions=t.exclusions.map((function(e){return n.visitExclusion(e)}))),s},visitExclusion:function(t){if(e(t))return t;{"type"in t||_Visitor.runtimeError(Error("expected "+JSON.stringify(t)+" to have a 'type' attribute."));const e=["IriStem","LiteralStem","LanguageStem"];return-1===e.indexOf(t.type)&&_Visitor.runtimeError(Error("expected type attribute '"+t.type+"' to be in '"+e+"'.")),{type:t.type,stem:t.stem}}},visitInclusion:function(e){if("string"!=typeof e){let t=Exception("visitInclusion expected a string, not "+JSON.stringify(e));throw console.warn(t),t}return e},_maybeSet:function(e,t,n,r,s){const i=this;return this._testUnknownAttributes(e,s?r.concat(s):r,n,this._maybeSet),r.forEach((function(n){const r="visit"+n.charAt(0).toUpperCase()+n.slice(1);if(n in e){const s=i[r];if("function"!=typeof s)throw Error(r+" not found in Visitor");const a=s.call(i,e[n]);void 0!==a&&(t[n]=a)}})),t},_visitValue:function(e){return e},_visitList:function(e){return e.slice()},_testUnknownAttributes:function(e,t,n,r){const s=Object.keys(e).reduce((function(e,n){return"type"!==n&&-1===t.indexOf(n)?e.concat(n):e}),[]);if(s.length>0){const t=Error("unknown propert"+(s.length>1?"ies":"y")+": "+s.map((function(e){return'"'+e+'"'})).join(",")+" in "+n+": "+JSON.stringify(e));throw Error.captureStackTrace(t,r),t}},_expect:function(e,t,n){t in e||this.runtimeError(Error("expected "+JSON.stringify(e)+" to have a ."+t)),arguments.length>2&&e[t]!==n&&this.runtimeError(Error("expected "+e[t]+" to equal "+n))}};return n.visitBase=n.visitStart=n.visitClosed=n["visit@context"]=n._visitValue,n.visitRestricts=n.visitExtends=n._visitShapeExprList,n.visitExtra=n.visitAnnotations=n._visitList,n.visitAbstract=n.visitInverse=n.visitPredicate=n._visitValue,n.visitName=n.visitId=n.visitCode=n.visitMin=n.visitMax=n._visitValue,n.visitType=n.visitNodeKind=n.visitDatatype=n.visitPattern=n.visitFlags=n.visitLength=n.visitMinlength=n.visitMaxlength=n.visitMininclusive=n.visitMinexclusive=n.visitMaxinclusive=n.visitMaxexclusive=n.visitTotaldigits=n.visitFractiondigits=n._visitValue,n.visitOneOf=n.visitEachOf=n._visitGroup,n.visitShapeAnd=n.visitShapeOr=n._visitShapeGroup,n.visitInclude=n._visitValue,n.visitValueExpr=n.visitShapeExpr,n}t.index=function(e){let n={shapeExprs:{},tripleExprs:{}},r=t(),s=r.visitExpression;r.visitExpression=function(e){return"object"==typeof e&&"id"in e&&(n.tripleExprs[e.id]=e),s.call(r,e)};let i=r.visitShapeExpr;r.visitShapeExpr=r.visitValueExpr=function(e,t){return"object"==typeof e&&"id"in e&&(n.shapeExprs[e.id]=e),i.call(r,e,t)};let a=r.visitShapeDecl;return r.visitShapeDecl=r.visitValueExpr=function(e,t){return"object"==typeof e&&"id"in e&&(n.shapeExprs[e.id]=e),a.call(r,e,t)},r.visitSchema(e),n},e.exports=t},95:(e,t,n)=>{const r=function(){const e=n(755),t=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,r=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,s={"\\":"\\\\",'"':'\\"',"/":"\\/","\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"},i={iri:"IRI",bnode:"BNODE",literal:"LITERAL",nonliteral:"NONLITERAL"};function a(e,t){if(!(this instanceof a))return new a(e,t);if(e&&"function"!=typeof e.write&&(t=e,e=null),t=t||{},e)this._outputStream=e,this._endStream=void 0===t.end||!!t.end;else{let e="";this._outputStream={write:function(t,n,r){e+=t,r&&r()},end:function(t){t&&t(null,e)}},this._endStream=!0}this._prefixIRIs=Object.create(null),this._baseIRI=t.base||null,t.prefixes&&this.addPrefixes(t.prefixes),this._error=t.error||c,this.forceParens=!t.simplifyParentheses,this._expect=t.lax?p:l}function o(e){let t=s[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 u(e){return e.replace(/\\/g,"\\\\").replace(/%/g,"\\%")}function c(e,t){"function"!=typeof e&&(t=e,e=c);const n=new Error(t);throw Error.captureStackTrace(n,e),n}function l(e,t,n){t in e||this._error(l,"expected "+e+" to have a ."+t),arguments.length>2&&e[t]!==n&&this._error(l,"expected "+e[e]+" to equal ."+n)}function p(){}return a.prototype={_write:function(e,t){this._outputStream.write(e,"utf8",t)},_writeSchema:function(e,t){const n=this;this._expect(e,"type","Schema"),n.addPrefixes(e._prefixes),e._base&&(n._baseIRI=e._base),n._baseIRI&&n._write("BASE <"+n._baseIRI+">\n"),e.imports&&e.imports.forEach((function(e){n._write("IMPORT "+n._encodeIriOrBlankNode(e)+"\n")})),e.startActs&&e.startActs.forEach((function(e){n._expect(e,"type","SemAct"),n._write(" %"+n._encodePredicate(e.name)+("code"in e?"{"+u(e.code)+"%}":"%"))})),e.start&&n._write("start = "+n._writeShapeExpr(e.start,t,!0,0).join("")+"\n"),"shapes"in e&&e.shapes.forEach((function(e){let r=e.id,s="";"ShapeDecl"===e.type&&(e.abstract&&(s="abstract "),e=e.shapeExpr),n._write(s+n._encodeShapeName(r,!1)+" "+n._writeShapeExpr(e,t,!0,0).join("")+"\n",t)}))},_writeShapeExpr:function(e,t,n,r){const s=this,i=[];if("string"==typeof e)i.push("@",s._encodeShapeName(e));else if("ShapeDecl"===e.type)i.push(s._writeShapeExpr(e.shapeExpr,t,!1,3));else if("ShapeExternal"===e.type)i.push("EXTERNAL");else if("ShapeAnd"===e.type){r>=3&&i.push("(");let n=!1;e.shapeExprs.forEach((function(r,a){if(a>0){function o(t){let n=e.shapeExprs[t];return!("NodeConstraint"!==n.type||"nodeKind"in n&&"literal"===n.nodeKind||"datatype"in n||"values"in n)}let c=!n&&(o(a-1)&&function(t){let n=e.shapeExprs[t];return"Shape"===n.type||"ShapeRef"===n.type}(a)||(u=a-1,"Shape"===e.shapeExprs[u].type&&o(a)));i.push(" AND "),n=c}var u;[].push.apply(i,s._writeShapeExpr(r,t,!1,3))})),r>=3&&i.push(")")}else if("ShapeOr"===e.type)r>=2&&i.push("("),e.shapeExprs.forEach((function(e,r){r>0&&i.push(" OR "),[].push.apply(i,s._writeShapeExpr(e,t,n,2))})),r>=2&&i.push(")");else if("ShapeNot"===e.type)r>=4&&i.push("("),i.push("NOT "),[].push.apply(i,s._writeShapeExpr(e.shapeExpr,t,n,4)),r>=4&&i.push(")");else if("Shape"===e.type)[].push.apply(i,s._writeShape(e,t,n));else{if("NodeConstraint"!==e.type)throw Error("expected Shape{,And,Or,Ref} or NodeConstraint in "+JSON.stringify(e));[].push.apply(i,s._writeNodeConstraint(e,t,n))}return i},_writeShape:function(e,t,n){const r=this;try{const a=[];this._expect(e,"type","Shape"),e.closed&&a.push("CLOSED "),[{keyword:"extends",marker:"EXTENDS "}].forEach((n=>{e[n.keyword]&&e[n.keyword].length>0&&(e[n.keyword].forEach((function(e,s){s&&a.push(" "),a.push(n.marker),[].push.apply(a,r._writeShapeExpr(e,t,!0,0))})),a.push(" "))})),e.extra&&e.extra.length>0&&(a.push("EXTRA "),e.extra.forEach((function(e,t){a.push(r._encodeShapeName(e,!1)+" ")})),a.push(" "));function s(e,t){0===e&&1===t?a.push("?"):0===e&&-1===t?a.push("*"):void 0===e&&void 0===t||(1===e&&-1===t?a.push("+"):a.push("{",e,",",-1===t?"*":t,"}"))}return a.push("{\n"),e.expression&&function e(n,i,o){function c(e){e&&e.forEach((function(e){r._expect(e,"type","SemAct"),a.push("\n"+i+" %"),a.push(r._encodeValue(e.name)),"code"in e?a.push("{"+u(e.code)+"%}"):a.push("%")}))}function l(t,n,r,s){const u=r0&&e.push(" "),i(t))e.push(s._encodeValue(t));else{"type"in t||runtimeError("expected "+JSON.stringify(t)+" to have a 'type' attribute.");const o=["Language","IriStem","LiteralStem","LanguageStem","IriStemRange","LiteralStemRange","LanguageStemRange"];function a(e,t){return-1!==["LanguageStem","LanguageStemRange"].indexOf(e.type)?"@"+t:-1!==["LiteralStem","LiteralStemRange"].indexOf(e.type)?'"'+t.replace(r,t)+'"':s._encodeValue(t)}-1===o.indexOf(t.type)&&runtimeError("expected type attribute '"+t.type+"' to be in '"+o+"'."),"Language"===t.type?e.push("@"+t.languageTag):i(t.stem)?e.push(a(t,t.stem)+"~"):(l(t.stem,"type","Wildcard"),e.push(".")),t.exclusions&&t.exclusions.forEach((function(n){if(e.push(" - "),i(n))e.push(a(t,n));else{"type"in n||runtimeError("expected "+JSON.stringify(n)+" to have a 'type' attribute.");const r=["IriStem","LiteralStem","LanguageStem"];-1===r.indexOf(n.type)&&runtimeError("expected type attribute '"+n.type+"' to be in '"+r+"'."),e.push(a(t,n.stem)+"~")}}))}})),e.push("]")),"pattern"in t){const n=t.pattern.replace(/\//g,"\\/"),r="flags"in t?t.flags:"";e.push("/"+n+"/"+r+" ")}return["length","minlength","maxlength","mininclusive","minexclusive","maxinclusive","maxexclusive","totaldigits","fractiondigits"].forEach((function(n){t[n]&&e.push(" ",n," ",t[n])})),e;function i(e){return"object"!=typeof e||"value"in e&&Object.keys(e).reduce(((e,t)=>!1===e?e:-1!==["value","type","language"].indexOf(t)),!0)}},_encodeIriOrBlankNode:function(e,n){if(n=n?" ":"","_"===e[0]&&":"===e[1])return e;t.test(e)&&(e=e.replace(r,o));const s=this._prefixRegex.exec(e);return s?(s[1]?this._prefixIRIs[s[1]]+s[2]:e)+n:this._relateUrl(e)},_relateUrl:function(t){const n=this._baseIRI;try{n&&new URL(n).host===new URL(t).host&&(t=e.relate(n,t,{output:e.ROOT_PATH_RELATIVE}))}catch(e){}return"<"+t+">"},_encodeLiteral:function(e,n,s){return t.test(e)&&(e=e.replace(r,o)),s?'"'+e+'"@'+s:n?"http://www.w3.org/2001/XMLSchema#integer"===n&&e.match(/^[+-]?[0-9]+$/)||"http://www.w3.org/2001/XMLSchema#decimal"===n&&e.match(/^[+-]?[0-9]*\.[0-9]+$/)||"http://www.w3.org/2001/XMLSchema#double"===n&&e.match(/^[+-]?([0-9]+\.[0-9]*[eE][+-]?[0-9]+|\.?[0-9]+[eE][+-]?[0-9]+)$/)?e:'"'+e+'"^^'+this._encodeIriOrBlankNode(n):'"'+e+'"'},_encodeShapeName:function(e,t){if('"'===e[0])throw new Error("A literal as subject is not allowed: "+e);return this._encodeIriOrBlankNode(e,t)},_encodePredicate:function(e){if('"'===e[0])throw new Error("A literal as predicate is not allowed: "+e);return"http://www.w3.org/1999/02/22-rdf-syntax-ns#type"===e?"a":this._encodeIriOrBlankNode(e)},_encodeValue:function(e){return"object"!=typeof e?this._encodeIriOrBlankNode(e):this._encodeLiteral(e.value,e.type,e.language)},_blockedWrite:function(){throw new Error("Cannot write because the writer has been closed.")},writeSchema:function(e,t){this._writeSchema(e,t),this.end(t)},addShape:function(e,t,n){this._write(_ShExWriter._encodeShapeName(t,!1)+" "+_ShExWriter._writeShapeExpr(e,n,!0,0).join(""),n)},addShapes:function(e){for(let t=0;t\n"))}if(r){let e="",t="";for(let r in n)e+=e?"|"+r:r,t+=(t?"|":"")+n[r];e=e.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&"),this._prefixRegex=new RegExp("^(?:"+t+")[^/]*$|^("+e+")([a-zA-Z][\\-_a-zA-Z0-9]*)$")}this._write(r?"\n":"",t)},_prefixRegex:/$0^/,end:function(e){this._write=this._blockedWrite;let t=e&&function(n,r){t=null,e(n,r)};if(this._endStream)try{return this._outputStream.end(t)}catch(e){}t&&t()}},a}();e.exports=r}},n={};function r(e){var s=n[e];if(void 0!==s)return s.exports;var i=n[e]={id:e,loaded:!1,exports:{}};return t[e].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);r(709)})(); \ No newline at end of file +(()=>{var t={752:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JisonLexer=void 0;var n=function(){function e(e){void 0===e&&(e={}),this.yy=e,this.EOF=1,this.options={},this.yyleng=0,this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0}}return e.prototype.parseError=function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},e.prototype.setInput=function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},e.prototype.input=function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},e.prototype.unput=function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var s=this.yylloc.range,i={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t};return this.yylloc=i,this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},e.prototype.more=function(){return this._more=!0,this},e.prototype.reject=function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},e.prototype.less=function(e){this.unput(this.match.slice(e))},e.prototype.pastInput=function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},e.prototype.upcomingInput=function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},e.prototype.showPosition=function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},e.prototype.test_match=function(e,t){var n,r,s;if(this.options.backtrack_lexer&&(s={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.yylloc.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(s.yylloc.range=this.yylloc.range.slice(0))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var i in s)this[i]=s[i];return!1}return!1},e.prototype.next=function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r=null;this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),i=0;ir[0].length)){if(r=t,n=i,this.options.backtrack_lexer){if(!1!==(e=this.test_match(t,s[i])))return e;if(this._backtrack){r=null;continue}return!1}if(!this.options.flex)break}return r?!1!==(e=this.test_match(r,s[n]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},e.prototype.lex=function(){var e=this.next();return e||this.lex()},e.prototype.begin=function(e){this.conditionStack.push(e)},e.prototype.popState=function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},e.prototype._currentRules=function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},e.prototype.topState=function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},e.prototype.pushState=function(e){this.begin(e)},e.prototype.stateStackSize=function(){return this.conditionStack.length},e}();t.JisonLexer=n},41:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.o=t.JisonParser=void 0;var n=function(){function e(e,t){void 0===e&&(e={}),this.yy=e,this.lexer=t}return e.prototype.trace=function(e){},e.prototype.parseError=function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},e.prototype.parse=function(e,t){void 0===t&&(t="function"==typeof this.yy&&"function"==typeof this.yy.constructor?new this.yy(this,this.lexer):Object.create(this.yy));var n=this,r=[0],s=[null],i=[],a=this.table,o="",u=0,c=0,l=0,p=2,f=1,h=i.slice.call(arguments,1),d=Object.create(this.lexer),m={yy:t};d.setInput(e,m.yy),m.yy.lexer=d,m.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var y=d.yylloc;i.push(y);var x=d.options&&d.options.ranges;function g(e){r.length=r.length-2*e,s.length=s.length-e,i.length=i.length-e}"function"==typeof m.yy.parseError&&(this.parseError=m.yy.parseError);for(var _,E,b,S,v,A,O,w,T,I=function(){var e;return"number"!=typeof(e=d.lex()||f)&&(e=n.symbols_[e]||e),e},N={};;){if(b=r[r.length-1],this.defaultActions[b]?S=this.defaultActions[b]:(null==_&&(_=I()),S=a[b]&&a[b][_]),void 0===S||!S.length||!S[0]){var k=null,F="";if(l)E!==f&&(k=R(b));else{for(var L in k=R(b),T=[],a[b])A=Number(L),this.terminals_[A]&&A>p&&T.push("'"+this.terminals_[A]+"'");F=d.showPosition?"Parse error on line "+(u+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(u+1)+": Unexpected "+(_==f?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(F,{text:d.match,token:this.terminals_[_]||_,line:d.yylineno,loc:d.yylloc,expected:T,recoverable:null!==k})}if(3==l){if(_===f||E===f)throw new Error(F||"Parsing halted while starting to recover from another error.");c=d.yyleng,o=d.yytext,u=d.yylineno,y=d.yylloc,_=I()}if(null===k)throw new Error(F||"Parsing halted. No suitable error recovery rule available.");g(k||0),E=_==p?null:_,_=p,b=r[r.length-1],S=a[b]&&a[b][p],l=3}if(S[0]instanceof Array&&S.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+_);switch(S[0]){case 1:r.push(_),s.push(d.yytext),i.push(d.yylloc),r.push(S[1]),_=null,E?(_=E,E=null):(c=d.yyleng,o=d.yytext,u=d.yylineno,y=d.yylloc,l>0&&l--);break;case 2:if(O=this.productions_[S[1]][1],N.$=s[s.length-O],N._$={first_line:i[i.length-(O||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(O||1)].first_column,last_column:i[i.length-1].last_column},x&&(N._$.range=[i[i.length-(O||1)].range[0],i[i.length-1].range[1]]),void 0!==(v=this.performAction.apply(N,[o,c,u,m.yy,S[1],s,i].concat(h))))return v;O&&(r=r.slice(0,-1*O*2),s=s.slice(0,-1*O),i=i.slice(0,-1*O)),r.push(this.productions_[S[1]][0]),s.push(N.$),i.push(N._$),w=a[r[r.length-2]][r[r.length-1]],r.push(w);break;case 3:return!0}}return!0;function R(e){for(var t=r.length-1,n=0;;){if(p.toString()in a[e])return n;if(0===e||t<2)return null;e=r[t-=2],++n}}},e}();t.JisonParser=n,t.o=function(e,t,n){var r=e.length;for(n=n||{};r--;n[e[r]]=t);return n}},515:e=>{var t={create:function(){let e={},t={},n={},r={};return{add:function(s,i){if(s in n&&-1!==n[s].indexOf(i))return;let a=s in r?c(s):e[s]=c(s),o=c(i);function u(e,t,n,r){e[r]=e[r].filter((t=>-1===e[n].indexOf(t))).concat(-1===e[n].indexOf(n)?[n]:[],e[n]),e[n].forEach((e=>t[e]=t[e].filter((e=>e!==r&&-1===t[r].indexOf(e))).concat(-1===t[r].indexOf(r)?[r]:[],t[r])))}function c(e){return e in r||(t[e]=[],n[e]=[],r[e]={}),r[e]}a[i]=o,delete e[i],u(n,t,i,s),u(t,n,s,i)},roots:e,parents:t,children:n}},depthFirst:function e(t,n,r){return Object.keys(t).reduce(((s,i)=>s.concat(e(t[i],n,i),r?n(i,r):[])),[])}};e.exports=t},325:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;const n="http://www.w3.org/1999/02/22-rdf-syntax-ns#",r="http://www.w3.org/2001/XMLSchema#",s="http://www.w3.org/2000/10/swap/";var i={xsd:{decimal:`${r}decimal`,boolean:`${r}boolean`,double:`${r}double`,integer:`${r}integer`,string:`${r}string`},rdf:{type:`${n}type`,nil:`${n}nil`,first:`${n}first`,rest:`${n}rest`,langString:`${n}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${s}reify#forSome`,forAll:`${s}reify#forAll`},log:{implies:`${s}log#implies`}};t.default=i},713:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Variable=t.Triple=t.Term=t.Quad=t.NamedNode=t.Literal=t.DefaultGraph=t.BlankNode=void 0,t.escapeQuotes=b,t.termFromId=function e(t,n){if(n=n||f,!t)return n.defaultGraph();switch(t[0]){case"?":return n.variable(t.substr(1));case"_":return n.blankNode(t.substr(2));case'"':if(n===f)return new y(t);if('"'===t[t.length-1])return n.literal(t.substr(1,t.length-2));const r=t.lastIndexOf('"',t.length-1);return n.literal(t.substr(1,r-1),"@"===t[r+1]?t.substr(r+2):n.namedNode(t.substr(r+3)));case"<":const s=p.exec(t);return n.quad(e(S(s[1]),n),e(S(s[2]),n),e(S(s[3]),n),s[4]&&e(S(s[4]),n));default:return n.namedNode(t)}},t.termToId=function e(t){if("string"==typeof t)return t;if(t instanceof d&&"Quad"!==t.termType)return t.id;if(!t)return u.id;switch(t.termType){case"NamedNode":return t.value;case"BlankNode":return`_:${t.value}`;case"Variable":return`?${t.value}`;case"DefaultGraph":return"";case"Literal":return`"${t.value}"${t.language?`@${t.language}`:t.datatype&&t.datatype.value!==o.string?`^^${t.datatype.value}`:""}`;case"Quad":return`<<${b(e(t.subject))} ${b(e(t.predicate))} ${b(e(t.object))}${(0,i.isDefaultGraph)(t.graph)?"":` ${e(t.graph)}`}>>`;default:throw new Error(`Unexpected termType: ${t.termType}`)}},t.unescapeQuotes=S;var r,s=(r=n(325))&&r.__esModule?r:{default:r},i=n(670);const{rdf:a,xsd:o}=s.default;let u,c=0;const l=/^"(.*".*)(?="[^"]*$)/,p=/^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/,f={namedNode:function(e){return new m(e)},blankNode:function(e){return new x(e||"n3-"+c++)},variable:function(e){return new g(e)},literal:function(e,t){if("string"==typeof t)return new y(`"${e}"@${t.toLowerCase()}`);let n=t?t.value:"";""===n&&("boolean"==typeof e?n=o.boolean:"number"==typeof e&&(Number.isFinite(e)?n=Number.isInteger(e)?o.integer:o.double:(n=o.double,Number.isNaN(e)||(e=e>0?"INF":"-INF"))));return""===n||n===o.string?new y(`"${e}"`):new y(`"${e}"^^${n}`)},defaultGraph:function(){return u},quad:v,triple:v};var h=f;t.default=h;class d{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof d?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}t.Term=d;class m extends d{get termType(){return"NamedNode"}}t.NamedNode=m;class y extends d{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`"${t.replace(/"/g,'""')}`))}function S(e){return e.replace(l,((e,t)=>`"${t.replace(/""/g,'"')}`))}function v(e,t,n,r){return new E(e,t,n,r)}t.Triple=t.Quad=E},670:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.inDefaultGraph=function(e){return i(e.graph)},t.isBlankNode=function(e){return!!e&&"BlankNode"===e.termType},t.isDefaultGraph=i,t.isLiteral=function(e){return!!e&&"Literal"===e.termType},t.isNamedNode=function(e){return!!e&&"NamedNode"===e.termType},t.isVariable=function(e){return!!e&&"Variable"===e.termType},t.prefix=function(e,t){return a({"":e.value||e},t)("")},t.prefixes=a;var r,s=(r=n(713))&&r.__esModule?r:{default:r};function i(e){return!!e&&"DefaultGraph"===e.termType}function a(e,t){const n=Object.create(null);for(const t in e)r(t,e[t]);function r(e,r){if("string"==typeof r){const s=Object.create(null);n[e]=e=>s[e]||(s[e]=t.namedNode(r+e))}else if(!(e in n))throw new Error(`Unknown prefix: ${e}`);return n[e]}return t=t||s.default,r}},808:e=>{"use strict";function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,n,r,s){n=n||"&",r=r||"=";var i={};if("string"!=typeof e||0===e.length)return i;var a=/\+/g;e=e.split(n);var o=1e3;s&&"number"==typeof s.maxKeys&&(o=s.maxKeys);var u=e.length;o>0&&u>o&&(u=o);for(var c=0;c=0?(l=d.substr(0,m),p=d.substr(m+1)):(l=d,p=""),f=decodeURIComponent(l),h=decodeURIComponent(p),t(i,f)?Array.isArray(i[f])?i[f].push(h):i[f]=[i[f],h]:i[f]=h}return i}},368:e=>{"use strict";var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,n,r,s){return n=n||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(s){var i=encodeURIComponent(t(s))+r;return Array.isArray(e[s])?e[s].map((function(e){return i+encodeURIComponent(t(e))})).join(n):i+encodeURIComponent(t(e[s]))})).join(n):s?encodeURIComponent(t(s))+r+encodeURIComponent(t(e)):""}},642:(e,t,n)=>{"use strict";t.decode=t.parse=n(808),t.encode=t.stringify=n(368)},362:e=>{"use strict";e.exports={ABSOLUTE:"absolute",PATH_RELATIVE:"pathRelative",ROOT_RELATIVE:"rootRelative",SHORTEST:"shortest"}},779:(e,t,n)=>{"use strict";var r=n(362);function s(e,t){var n=t.removeEmptyQueries&&e.extra.relation.minimumPort;return e.query.string[n?"stripped":"full"]}function i(e,t){return!e.extra.relation.minimumQuery||t.output===r.ABSOLUTE||t.output===r.ROOT_RELATIVE}function a(e,t){var n=t.removeDirectoryIndexes&&e.extra.resourceIsIndex,s=e.extra.relation.minimumResource&&t.output!==r.ABSOLUTE&&t.output!==r.ROOT_RELATIVE;return!!e.resource&&!s&&!n}e.exports=function(e,t){var n="";return n+=function(e,t){var n="";return(e.extra.relation.maximumHost||t.output===r.ABSOLUTE)&&(e.extra.relation.minimumScheme&&t.schemeRelative&&t.output!==r.ABSOLUTE?n+="//":n+=e.scheme+"://"),n}(e,t),n+=function(e,t){return!e.auth||t.removeAuth||!e.extra.relation.maximumHost&&t.output!==r.ABSOLUTE?"":e.auth+"@"}(e,t),n+=function(e,t){return e.host.full&&(e.extra.relation.maximumAuth||t.output===r.ABSOLUTE)?e.host.full:""}(e,t),n+=function(e,t){return e.port&&!e.extra.portIsDefault&&e.extra.relation.maximumHost?":"+e.port:""}(e),n+=function(e,t){var n="",o=e.path.absolute.string,u=e.path.relative.string,c=a(e,t);if(e.extra.relation.maximumHost||t.output===r.ABSOLUTE||t.output===r.ROOT_RELATIVE)n=o;else if(u.length<=o.length&&t.output===r.SHORTEST||t.output===r.PATH_RELATIVE){if(""===(n=u)){var l=i(e,t)&&!!s(e,t);e.extra.relation.maximumPath&&!c?n="./":!e.extra.relation.overridesQuery||c||l||(n="./")}}else n=o;return"/"!==n||c||!t.removeRootTrailingSlash||e.extra.relation.minimumPort&&t.output!==r.ABSOLUTE||(n=""),n}(e,t),n+=function(e,t){return a(e,t)?e.resource:""}(e,t),n+=function(e,t){return i(e,t)?s(e,t):""}(e,t),n+=function(e,t){return e.hash?e.hash:""}(e),n}},755:(e,t,n)=>{"use strict";var r=n(362),s=n(779),i=n(141),a=n(609),o=n(398),u=n(258);function c(e,t){this.options=i(t,{defaultPorts:{ftp:21,http:80,https:443},directoryIndexes:["index.html"],ignore_www:!1,output:c.SHORTEST,rejectedSchemes:["data","javascript","mailto"],removeAuth:!1,removeDirectoryIndexes:!0,removeEmptyQueries:!1,removeRootTrailingSlash:!0,schemeRelative:!0,site:void 0,slashesDenoteHost:!0}),this.from=o.from(e,this.options,null)}c.prototype.relate=function(e,t,n){if(a.isPlainObject(t)?(n=t,t=e,e=null):t||(t=e,e=null),n=i(n,this.options),e=e||n.site,!(e=o.from(e,n,this.from))||!e.href)throw new Error("from value not defined.");if(e.extra.hrefInfo.minimumPathOnly)throw new Error("from value supplied is not absolute: "+e.href);return!1===(t=o.to(t,n)).valid?t.href:(t=u(e,t,n),t=s(t,n))},c.relate=function(e,t,n){return(new c).relate(e,t,n)},a.shallowMerge(c,r),e.exports=c},141:(e,t,n)=>{"use strict";var r=n(609);function s(e,t){return t instanceof Object&&e instanceof Object?t instanceof Array&&e instanceof Array?t.concat(e):r.shallowMerge(e,t):e}e.exports=function(e,t){if(r.isPlainObject(e)){var n={};for(var i in t)t.hasOwnProperty(i)&&(void 0!==e[i]?n[i]=s(e[i],t[i]):n[i]=t[i]);return n}return t}},420:e=>{"use strict";e.exports=function(e,t){if(t.ignore_www){var n=e.host.full;if(n){var r=n;0===n.indexOf("www.")&&(r=n.substr(4)),e.host.stripped=r}}}},849:e=>{"use strict";e.exports=function(e){var t=!(e.scheme||e.auth||e.host.full||e.port),n=t&&!e.path.absolute.string,r=n&&!e.resource,s=r&&!e.query.string.full.length,i=s&&!e.hash;e.extra.hrefInfo.minimumPathOnly=t,e.extra.hrefInfo.minimumResourceOnly=n,e.extra.hrefInfo.minimumQueryOnly=r,e.extra.hrefInfo.minimumHashOnly=s,e.extra.hrefInfo.empty=i}},398:(e,t,n)=>{"use strict";var r=n(849),s=n(420),i=n(965),a=n(22),o=n(150),u=n(936),c=n(831);function l(e,t){var n=u(e,t);return!1===n.valid||(s(n,t),a(n,t),i(n,t),o(n,t),r(n)),n}e.exports={from:function(e,t,n){if(e){var r=l(e,t),s=c.resolveDotSegments(r.path.absolute.array);return r.path.absolute.array=s,r.path.absolute.string="/"+c.join(s),r}return n},to:l}},965:e=>{"use strict";function t(e){if("/"!==e){var t=[];return e.split("/").forEach((function(e){""!==e&&t.push(e)})),t}return[]}e.exports=function(e,n){var r=e.path.absolute.string;if(r){var s=r.lastIndexOf("/");if(s>-1){if(++s{"use strict";e.exports=function(e,t){var n=-1;for(var r in t.defaultPorts)if(r===e.scheme&&t.defaultPorts.hasOwnProperty(r)){n=t.defaultPorts[r];break}n>-1&&(n=n.toString(),null===e.port&&(e.port=n),e.extra.portIsDefault=e.port===n)}},150:e=>{"use strict";var t=Object.prototype.hasOwnProperty;function n(e,n){var r=0,s="";for(var i in e)if(""!==i&&!0===t.call(e,i)){var a=e[i];""===a&&n||(s+=1==++r?"?":"&",i=encodeURIComponent(i),s+=""!==a?i+"="+encodeURIComponent(a).replace(/%20/g,"+"):i)}return s}e.exports=function(e,t){e.query.string.full=n(e.query.object,!1),t.removeEmptyQueries&&(e.query.string.stripped=n(e.query.object,!0))}},936:(e,t,n)=>{"use strict";var r=n(883).Qc;e.exports=function(e,t){return function(e,t){var n=!0;return t.rejectedSchemes.every((function(t){return n=!(0===e.indexOf(t+":"))})),n}(e,t)?(n=r(e,!0,t.slashesDenoteHost),(s=n.protocol)&&s.indexOf(":")===s.length-1&&(s=s.substr(0,s.length-1)),n.host={full:n.hostname,stripped:null},n.path={absolute:{array:null,string:n.pathname},relative:{array:null,string:null}},n.query={object:n.query,string:{full:null,stripped:null}},n.extra={hrefInfo:{minimumPathOnly:null,minimumResourceOnly:null,minimumQueryOnly:null,minimumHashOnly:null,empty:null,separatorOnlyQuery:"?"===n.search},portIsDefault:null,relation:{maximumScheme:null,maximumAuth:null,maximumHost:null,maximumPort:null,maximumPath:null,maximumResource:null,maximumQuery:null,maximumHash:null,minimumScheme:null,minimumAuth:null,minimumHost:null,minimumPort:null,minimumPath:null,minimumResource:null,minimumQuery:null,minimumHash:null,overridesQuery:null},resourceIsIndex:null,slashes:n.slashes},n.resource=null,n.scheme=s,delete n.hostname,delete n.pathname,delete n.protocol,delete n.search,delete n.slashes,n):{href:e,valid:!1};var n,s}},799:(e,t,n)=>{"use strict";var r=n(19),s=n(609),i=n(831);e.exports=function(e,t,n){r.upToPath(e,t,n),e.extra.relation.minimumScheme&&(e.scheme=t.scheme),e.extra.relation.minimumAuth&&(e.auth=t.auth),e.extra.relation.minimumHost&&(e.host=s.clone(t.host)),e.extra.relation.minimumPort&&function(e,t){e.port=t.port,e.extra.portIsDefault=t.extra.portIsDefault}(e,t),e.extra.relation.minimumScheme&&function(e,t){if(e.extra.relation.maximumHost||!e.extra.hrefInfo.minimumResourceOnly){var n=e.path.absolute.array,r="/";n?(e.extra.hrefInfo.minimumPathOnly&&0!==e.path.absolute.string.indexOf("/")&&(n=t.path.absolute.array.concat(n)),n=i.resolveDotSegments(n),r+=i.join(n)):n=[],e.path.absolute.array=n,e.path.absolute.string=r}else e.path=s.clone(t.path)}(e,t),r.pathOn(e,t,n),e.extra.relation.minimumResource&&function(e,t){e.resource=t.resource,e.extra.resourceIsIndex=t.extra.resourceIsIndex}(e,t),e.extra.relation.minimumQuery&&(e.query=s.clone(t.query)),e.extra.relation.minimumHash&&(e.hash=t.hash)}},19:e=>{"use strict";e.exports={pathOn:function(e,t,n){var r=e.extra.hrefInfo.minimumQueryOnly,s=e.extra.hrefInfo.minimumHashOnly,i=e.extra.hrefInfo.empty,a=e.extra.relation.minimumPort,o=e.extra.relation.minimumScheme,u=a&&e.path.absolute.string===t.path.absolute.string,c=e.resource===t.resource||!e.resource&&t.extra.resourceIsIndex||n.removeDirectoryIndexes&&e.extra.resourceIsIndex&&!t.resource,l=u&&(c||r||s||i),p=n.removeEmptyQueries?"stripped":"full",f=e.query.string[p],h=t.query.string[p],d=l&&!!f&&f===h||(s||i)&&!e.extra.hrefInfo.separatorOnlyQuery,m=d&&e.hash===t.hash;e.extra.relation.minimumPath=u,e.extra.relation.minimumResource=l,e.extra.relation.minimumQuery=d,e.extra.relation.minimumHash=m,e.extra.relation.maximumPort=!o||o&&!u,e.extra.relation.maximumPath=!o||o&&!l,e.extra.relation.maximumResource=!o||o&&!d,e.extra.relation.maximumQuery=!o||o&&!m,e.extra.relation.maximumHash=!o||o&&!m,e.extra.relation.overridesQuery=u&&e.extra.relation.maximumResource&&!d&&!!h},upToPath:function(e,t,n){var r=e.extra.hrefInfo.minimumPathOnly,s=e.scheme===t.scheme||!e.scheme,i=s&&(e.auth===t.auth||n.removeAuth||r),a=n.ignore_www?"stripped":"full",o=i&&(e.host[a]===t.host[a]||r),u=o&&(e.port===t.port||r);e.extra.relation.minimumScheme=s,e.extra.relation.minimumAuth=i,e.extra.relation.minimumHost=o,e.extra.relation.minimumPort=u,e.extra.relation.maximumScheme=!s||s&&!i,e.extra.relation.maximumAuth=!s||s&&!o,e.extra.relation.maximumHost=!s||s&&!u}}},258:(e,t,n)=>{"use strict";var r=n(799),s=n(255);e.exports=function(e,t,n){return r(t,e,n),s(t,e,n),t}},255:(e,t,n)=>{"use strict";var r=n(831);e.exports=function(e,t,n){if(e.extra.relation.minimumScheme){var s=(i=e.path.absolute.array,a=t.path.absolute.array,o=[],u=!0,c=-1,a.forEach((function(e,t){u&&(i[t]!==e?u=!1:c=t),u||o.push("..")})),i.forEach((function(e,t){t>c&&o.push(e)})),o);e.path.relative.array=s,e.path.relative.string=r.join(s)}var i,a,o,u,c}},609:e=>{"use strict";e.exports={clone:function e(t){if(t instanceof Object){var n=t instanceof Array?[]:{};for(var r in t)t.hasOwnProperty(r)&&(n[r]=e(t[r]));return n}return t},isPlainObject:function(e){return!!e&&"object"==typeof e&&e.constructor===Object},shallowMerge:function(e,t){if(e instanceof Object&&t instanceof Object)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}}},831:e=>{"use strict";e.exports={join:function(e){return e.length>0?e.join("/")+"/":""},resolveDotSegments:function(e){var t=[];return e.forEach((function(e){".."!==e?"."!==e&&t.push(e):t.length>0&&t.splice(t.length-1,1)})),t}}},639:function(e,t,n){var r;e=n.nmd(e),function(s){t&&t.nodeType,e&&e.nodeType;var i="object"==typeof n.g&&n.g;i.global!==i&&i.window!==i&&i.self;var a,o=2147483647,u=36,c=/^xn--/,l=/[^\x20-\x7E]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=Math.floor,d=String.fromCharCode;function m(e){throw RangeError(f[e])}function y(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function x(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+y((e=e.replace(p,".")).split("."),t).join(".")}function g(e){for(var t,n,r=[],s=0,i=e.length;s=55296&&t<=56319&&s65535&&(t+=d((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=d(e)})).join("")}function E(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function b(e,t,n){var r=0;for(e=n?h(e/700):e>>1,e+=h(e/t);e>455;r+=u)e=h(e/35);return h(r+36*e/(e+38))}function S(e){var t,n,r,s,i,a,c,l,p,f,d,y=[],x=e.length,g=0,E=128,S=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r=128&&m("not-basic"),y.push(e.charCodeAt(r));for(s=n>0?n+1:0;s=x&&m("invalid-input"),((l=(d=e.charCodeAt(s++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:u)>=u||l>h((o-g)/a))&&m("overflow"),g+=l*a,!(l<(p=c<=S?1:c>=S+26?26:c-S));c+=u)a>h(o/(f=u-p))&&m("overflow"),a*=f;S=b(g-i,t=y.length+1,0==i),h(g/t)>o-E&&m("overflow"),E+=h(g/t),g%=t,y.splice(g++,0,E)}return _(y)}function v(e){var t,n,r,s,i,a,c,l,p,f,y,x,_,S,v,A=[];for(x=(e=g(e)).length,t=128,n=0,i=72,a=0;a=t&&yh((o-n)/(_=r+1))&&m("overflow"),n+=(c-t)*_,t=c,a=0;ao&&m("overflow"),y==t){for(l=n,p=u;!(l<(f=p<=i?1:p>=i+26?26:p-i));p+=u)v=l-f,S=u-f,A.push(d(E(f+v%S,0))),l=h(v/S);A.push(d(E(l,0))),i=b(n,_,r==s),n=0,++r}++n,++t}return A.join("")}a={version:"1.3.2",ucs2:{decode:g,encode:_},decode:S,encode:v,toASCII:function(e){return x(e,(function(e){return l.test(e)?"xn--"+v(e):e}))},toUnicode:function(e){return x(e,(function(e){return c.test(e)?S(e.slice(4).toLowerCase()):e}))}},void 0===(r=function(){return a}.call(t,n,t,e))||(e.exports=r)}()},883:(e,t,n)=>{"use strict";var r=n(639),s=n(225);function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.Qc=_;var a=/^([a-z0-9.+-]+:)/i,o=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(c),p=["%","/","?",";","#"].concat(l),f=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},x={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},g=n(642);function _(e,t,n){if(e&&s.isObject(e)&&e instanceof i)return e;var r=new i;return r.parse(e,t,n),r}i.prototype.parse=function(e,t,n){if(!s.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),o=-1!==i&&i127?R+="x":R+=L[j];if(!R.match(h)){var D=k.slice(0,T),$=k.slice(T+1),P=L.match(d);P&&(D.push(P[1]),$.unshift(P[2])),$.length&&(_="/"+$.join(".")+_),this.hostname=D.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),N||(this.hostname=r.toASCII(this.hostname));var M=this.port?":"+this.port:"",Q=this.hostname||"";this.host=Q+M,this.href+=this.host,N&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==_[0]&&(_="/"+_))}if(!m[S])for(T=0,F=l.length;T0)&&n.host.split("@"))&&(n.auth=N.shift(),n.host=n.hostname=N.shift());return n.search=e.search,n.query=e.query,s.isNull(n.pathname)&&s.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!v.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var O=v.slice(-1)[0],w=(n.host||e.host||v.length>1)&&("."===O||".."===O)||""===O,T=0,I=v.length;I>=0;I--)"."===(O=v[I])?v.splice(I,1):".."===O?(v.splice(I,1),T++):T&&(v.splice(I,1),T--);if(!b&&!S)for(;T--;T)v.unshift("..");!b||""===v[0]||v[0]&&"/"===v[0].charAt(0)||v.unshift(""),w&&"/"!==v.join("/").substr(-1)&&v.push("");var N,k=""===v[0]||v[0]&&"/"===v[0].charAt(0);A&&(n.hostname=n.host=k?"":v.length?v.shift():"",(N=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=N.shift(),n.host=n.hostname=N.shift()));return(b=b||n.host&&v.length)&&!k&&v.unshift(""),v.length?n.pathname=v.join("/"):(n.pathname=null,n.path=null),s.isNull(n.pathname)&&s.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var e=this.host,t=o.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},225:e=>{"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},863:(e,t,n)=>{const r=function(){const e=n(118);function t(e){e||(e={});for(let t,n=1,r=arguments.length;n0&&0===c[0].errors.length&&c.forEach((n=>{const r="expression"in u?u.expression.solutions.slice():[];"solution"in n&&r.push(n.solution),delete n.solution,n.expression=t({type:e,solutions:r},o)})),0===c.length||c[0].errors.length>0)return s0&&0===a[0].errors.length&&"semActs"in r){const e=[],t=[];a.forEach((n=>{const s=f.dispatchAll(r.semActs,"???",n);0===s.length?e.push(n):([].push.apply(n.errors,s),t.push(n))})),a=e.length>0?e:t}return a}if("TripleConstraint"===r.type){const x="negated"in r&&r.negated||0===h;x&&(l=h=1/0),void 0===i.avail[o]&&(i.avail[o]=c[o].map((e=>e.tNo)));const g={};("min"in r&&1!==r.min||"max"in r&&1!==r.max)&&(g.min=r.min,g.max=r.max),"semActs"in r&&(g.semActs=r.semActs),"annotations"in r&&(g.annotations=r.annotations);const _=i.avail[o].splice(0,l),E=x?0===_.length:_.length>=l,b=[],S=i.matched;if(E)do{const v=_.reduce(((e,t)=>{const n=p[t],s={type:"TestedTriple",subject:n.subject,predicate:n.predicate,object:a(n.object)},u=c[o].find((e=>e.tNo===t));u.res&&Object.keys(u.res).length>0&&(s.referenced=u.res);const l=i.errors.concat("semActs"in r?f.dispatchAll(r.semActs,s,s):[]);return l.length>0?e.fail.push({tripleNo:t,tested:s,semActErrors:l}):e.pass.push({tripleNo:t,tested:s,semActErrors:l}),e}),{pass:[],fail:[]});if(0===v.fail.length){const A=0===_.length?i.errors.slice():[],O=m(v.pass,A);b.push(O)}else v.fail.forEach((e=>b.push(m([e],e.semActErrors))));function m(e,n){return{avail:i.avail.map((e=>e.slice())),errors:n,matched:S.concat({tNos:e.map((e=>e.tripleNo))}),expression:t({type:"TripleConstraintSolutions",predicate:r.predicate},"valueExpr"in r?{valueExpr:r.valueExpr}:{},"id"in r?{productionLabel:r.id}:{},g,{solutions:e.map((e=>e.tested))})}}}while(i.avail[o].length>0&&_.length{const t=[],s=[];return r.expressions.forEach((r=>{const i={avail:e.avail.map((e=>e.slice())),errors:e.errors,matched:e.matched},a=n(r,i);0===a[0].errors.length?([].push.apply(t,a),a.forEach((e=>{const t="solution"in i?i.solution.expressions:[];"expression"in e&&t.push(e.expression),delete e.expression,e.solution={type:"OneOfSolution",expressions:t}}))):[].push.apply(s,a)})),t.length>0?t:s}));if("EachOf"===r.type)return y(d("EachOfSolutions",(e=>r.expressions.reduce(((e,t)=>y(e.reduce(((e,r)=>{const s=n(t,r);return s.forEach((e=>{if(0===e.errors.length){const t="solution"in r?r.solution.expressions.slice():[];"expression"in e&&t.push(e.expression),delete e.expression,e.solution={type:"EachOfSolution",expressions:t}}})),e.concat(s)}),[]))),[e]))));function y(e){return e.reduce(((e,t)=>0===t.errors.length?e.errors?{errors:!1,l:[t]}:{errors:!1,l:e.l.concat(t)}:e.errors?{errors:!0,l:e.l.concat(t)}:e),{errors:!0,l:[]}).l}runtimeError("unexpected expr type: "+r.type)}(i,{avail:[],matched:[],errors:[]}),m=d.reduce(((e,t)=>{if(t.errors.length>0)return e;const n={};return Object.keys(l).forEach((e=>{"NO_TRIPLE_CONSTRAINT"!==l[e]&&(n[e]=l[e])})),t.matched.forEach((e=>{e.tNos.forEach((e=>{delete n[e]}))})),Object.keys(n).forEach((e=>{t.errors.push({type:"ExcessTripleViolation",triple:p[e],constraint:u[n[e]]})})),null!==e?e:Object.keys(n).length>0?null:t}),null);return null!==m?function(t,n,s,i){function o(u){if("OneOfSolutions"===u.type||"EachOfSolutions"===u.type)u.solutions.forEach((e=>{e.expressions.forEach((e=>{o(e)}))}));else{if("TripleConstraintSolutions"!==u.type)throw Error("unexpected expr type in "+JSON.stringify(u));u.solutions=u.solutions.map((o=>{if("TestedTriple"===o.type)return o;const u=s[o.tripleNo],c=n[o.constraintNo],l={type:"TestedTriple",subject:u.subject,predicate:u.predicate,object:a(u.object)};function p(t,n,s){const i=s(t,n);if("errors"in i){const s={type:"ReferenceError",focus:t,shape:n};return"string"==typeof n&&e.isBlank(n)&&(s.referencedShape=r),s.errors=i,[s]}return(("solution"in i||"solutions"in i)&&0!==Object.keys(i.solution||i.solutions).length||"Recursion"===i.type)&&(l.referenced=i),[]}function f(e,t){return p(e,t,recurse)}function h(e,t){return p(e,t,direct)}const d="valueExpr"in c?checkValueExpr(c.inverse?u.subject:u.object,c.valueExpr,f,h):[];return 0===d.length&&"semActs"in c&&[].push.apply(d,i.dispatchAll(c.semActs,l,l)),d.length>0&&(t.errors=t.errors||[],t.errors=t.errors.concat(d)),l}))}}Object.keys(t).length>0&&o(t);"semActs"in r&&(t.semActs=r.semActs);return t}(m.expression,u,p,f):d.length>1?{type:"PossibleErrors",errors:d.reduce(((e,t)=>e.concat([t.errors])),[])}:d[0]}};function a(t){if('"'!==t[0])return t;const n={value:e.getLiteralValue(t)},r=e.getLiteralType(t);r&&"http://www.w3.org/2001/XMLSchema#string"!==r&&"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"!==r&&(n.type=r);const s=e.getLiteralLanguage(t);return s&&(n.language=s),n}}}}();e.exports=r},865:(e,t,n)=>{e.exports=function(e){const t=n(118);n(279);const r="http://www.w3.org/2001/XMLSchema#",s=[r+"integer",r+"nonPositiveInteger",r+"negativeInteger",r+"long",r+"int",r+"short",r+"byte",r+"nonNegativeInteger",r+"unsignedLong",r+"unsignedInt",r+"unsignedShort",r+"unsignedByte",r+"positiveInteger"],i=[r+"decimal"].concat(s),a=[r+"float",r+"double"].concat(i),o={"http://www.w3.org/2001/XMLSchema#integer":function(e,t){return e.match(/^[+-]?[0-9]+$/)||t("illegal integer value '"+e+"'"),parseInt(e)},"http://www.w3.org/2001/XMLSchema#decimal":function(e,t){return e.match(/^[+-]?(?:[0-9]*\.[0-9]+|[0-9]+)$/)||t("illegal integer value '"+e+"'"),parseFloat(e)},"http://www.w3.org/2001/XMLSchema#float":function(e,t){return e.match(/^[+-]?(?:[0-9]*\.[0-9]+|[0-9]+)$/)||t("illegal integer value '"+e+"'"),parseFloat(e)},"http://www.w3.org/2001/XMLSchema#double":function(e,t){return e.match(/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/)||t("illegal integer value '"+e+"'"),Number(e)}},u={length:function(e,t){return e.length===t},minlength:function(e,t){return e.length>=t},maxlength:function(e,t){return e.length<=t}},c={mininclusive:function(e,t){return e>=t},minexclusive:function(e,t){return e>t},maxinclusive:function(e,t){return e<=t},maxexclusive:function(e,t){return e2&&e[t]!==n&&y("expected "+t+" attribute '"+e[t]+"' to equal '"+n+"'.")}function m(){}function y(){const e=Array.prototype.join.call(arguments,""),t=new Error("Runtime error: "+e);throw Error.captureStackTrace(t,y),t}return{construct:function i(h,x,g){if(!(this instanceof i))return new i(h,x,g);this.type="ShExValidator",g=g||{},this.options=g,this.options.or=this.options.or||"someOf",this.options.partition=this.options.partition||"exhaustive","noCache"in g&&g.noCache||(this.known=function(){const e={},t={};return{cached:function(n,r){let s=e[n];if(!s)return e[n]=s=[],void(t[n]=[]);const i=s.indexOf(r);return-1===i?void 0:t[n][i]},remember:function(n,r,s){const i=e[n];if(i){if(-1!==i.indexOf(r))throw Error("not expecting duplicate key "+key)}else e[n]=[],t[n]=[];e[n].push(r),t[n].push(s)}}}());const _=this;this.schema=h,this._expect=this.options.lax?m:d,this._optimize={},this.reset=function(){};const E=this.options.regexModule||n(991);let b=0;const S=g.nextBNode||function(){return"_:b"+b++};this.getAST=function(){return{type:"AST",shapes:Object.keys(this.schema._index.shapeExprs).reduce((function(e,t){return e[t]={type:"ASTshape",expression:f(_.schema._index.shapeExprs[t].expression,[],_.schema)},e}),{})}},this.indexTripleConstraints=function(e){const t=[];return e&&function e(n){"TripleConstraint"===n.type?t.push(n):"OneOf"===n.type||"EachOf"===n.type?n.expressions.forEach((function(t){e(t)})):"Inclusion"===n.type?e(h.productions[n.include]):y("unexpected expr type: "+n.type)}(e),t},this.validate=function(t,n,r,s,i){if(r&&r!==e.Validator.start||(h.start||y("start production not defined"),r=h.start),"string"!=typeof r)return this._validateShapeExpr(t,n,r,"_: -start-",s,i);r in this.schema._index.shapeExprs||y("shape "+r+" not defined");const a=r;void 0===i&&(i={});const o=n+"|"+a;if(o in i)return{type:"Recursion",node:p(n),shape:a};i[o]={point:n,shapeLabel:a};const u=this._validateShapeDecl(t,n,h._index.shapeExprs[a],a,s,i);return delete i[o],u},this._validateShapeDecl=function(e,t,n,r,s,i,a,o){const u="ShapeDecl"===n.type?n.shapeExpr:n;return this._validateShapeExpr(e,t,u,r,s,i,a,o)},this._lookupShape=function(e){if("shapes"in this.schema&&0!==this.schema.shapes.length){if(e in index.shapeExprs)return index.shapeExprs[e];y("shape "+e+" not found in:\n"+Object.keys(index.shapeExprs||[]).map((e=>" "+e)).join("\n"))}else y("shape "+e+" not found; no shapes in schema")},this._validateShapeExpr=function(e,t,n,r,s,i){if("known"in this&&this.known.cached(t,n))return this.known.cached(t,n);let a=null;if(""===t)throw Error("validation needs a valid focus node");if("string"==typeof n)a=this._validateShapeExpr(e,t,h._index.shapeExprs[n],n,s,i);else if("NodeConstraint"===n.type){const e=this._errorsMatchingNodeConstraint(t,n,null);a=e.length?{type:"Failure",node:p(t),shape:r,errors:e.map((function(e){return{type:"NodeConstraintViolation",shapeExpr:n}}))}:{type:"NodeConstraintTest",node:p(t),shape:r,shapeExpr:n}}else if("Shape"===n.type)a=this._validateShape(e,t,E.compile(h,n),n,r,s,i);else if("ShapeExternal"===n.type)a=this.options.validateExtern(e,t,r,s,i);else if("ShapeOr"===n.type){const o=[];a={type:"ShapeOrFailure",errors:o};for(let u=0;u{}},c.schema,n,y,g,_);const f=o.length,h=p.getQuads().map(t.internalTriple);return o.push.apply(o,h),Array.apply(null,{length:h.length}).map(((e,t)=>t+f))}if("errors"in v){if(m.push({errors:v.errors}),"exhaustive"!==c.options.partition)break;continue}const A={type:"ShapeTest",node:p(r),shape:a};if(Object.keys(v).length>0&&(A.solution=v),!("semActs"in i)||this.semActHandler.dispatchAll(i.semActs,v,A))l=A;else if(m.push({errors:[{type:"SemActFailure",errors:[{type:"UntrackedSemActFailure"}]}]}),"exhaustive"!==c.options.partition)break}if(null===l){const O=[];l={type:"Failure",node:p(r),shape:a,errors:O.concat(1===m.length?m[0].errors:m)}}return"startActs"in h&&0===o&&(l.startActs=h.startActs),l},this._triplesMatchingShapeExpr=function(e,t,n,r,s){const i=this,a=[],o=[];return e.forEach((function(e){const u=n?e.subject:e.object,c=void 0===t?[]:i._errorsMatchingShapeExpr(u,t,r,s);0===c.length?o.push(e):-1===o.indexOf(e)&&a.push({triple:e,errors:c})})),{hits:o,misses:a}},this._errorsMatchingShapeExpr=function(e,t,n,r){const s=this;if("string"==typeof t)return n?n(e,t):[];if("NodeConstraint"===t.type)return this._errorsMatchingNodeConstraint(e,t,null);if("Shape"===t.type)return void 0===r?[]:r(e,t);if("ShapeOr"===t.type){const i=[];for(let a=0;a{if(t)return!0;if("object"!=typeof n||!("value"in n))return!1;const r=p(e);return n.value===r.value&&n.type===r.type&&n.language===r.language}),!1)||-1!==n.values.indexOf(e)||n.values.some((function(t){if("object"==typeof t&&!("value"in t)){if(d(t,"type","StemRange"),"object"==typeof t.stem)d(t.stem,"type","Wildcard");else if(!e.startsWith(t.stem))return!1;return!t.exclusions||!t.exclusions.some((function(t){return"object"==typeof t?(d(t,"type","Stem"),e.startsWith(t.stem)):e===t}))}}))||h("value "+e+" not found in set "+n.values)),"pattern"in n){const r=new RegExp(n.pattern);(m=e,t.isIRI(m)?m:t.isLiteral(m)?t.getLiteralValue(m):m.substr(2)).match(r)||h("value "+e+" did not match pattern "+n.pattern)}var m;const y=t.isLiteral(e)?t.getLiteralValue(e):t.isBlank(e)?e.substring(2):e,x=t.isLiteral(e)?t.getLiteralType(e):null,g=-1!==s.indexOf(x)?r+"integer":-1!==a.indexOf(x)?x:void 0;return Object.keys(u).forEach((function(t){t in n&&!u[t](y,n[t])&&h("facet violation: expected "+t+" of "+n[t]+" but got "+e)})),Object.keys(c).forEach((function(t){t in n&&(g?c[t](o[g](y,h),n[t])||h("facet violation: expected "+t+" of "+n[t]+" but got "+e):h("facet violation: numeric facet "+t+" can't apply to "+e))})),Object.keys(l).forEach((function(t){t in n&&(g===r+"integer"||g===r+"decimal"?l[t](""+o[g](y,h),n[t])||h("facet violation: expected "+t+" of "+n[t]+" but got "+e):h("facet violation: numeric facet "+t+" can't apply to "+e))})),f},this.semActHandler={handlers:{},results:{},register:function(e,t){this.handlers[e]=t},dispatchAll:function(e,t,n){const r=this;return e.reduce((function(e,s){if(e&&s.name in r.handlers){const i="code"in s?s.code:_.options.semActs[s.name],a="extensions"in n&&s.name in n.extensions,o=a?n.extensions[s.name]:{};return e=e&&r.handlers[s.name].dispatch(i,t,o),!a&&Object.keys(o).length>0&&("extensions"in n||(n.extensions={}),n.extensions[s.name]=o),e}return e}),!0)}}},options:{or:{oneOf:"exactly one disjunct must pass",someOf:"one or more disjuncts must pass",firstOf:"disjunct evaluation stops after one passes"},partition:{greedy:"each triple constraint consumes all triples matching predicate and object",exhaustive:"search all mappings of triples to triple constriant"}}}}},991:(e,t,n)=>{const r=function(){const e=n(118),t="|",r="×",s="";function i(e){e||(e={});for(let t,n=1,r=arguments.length;n{e[t].outs.push(n)}))}}();function u(s,a,o,u,l,p,f,h,d,m){const y=this;let x=[],g=[];function _(e,t){const n=Object.keys(t).map((e=>e+":"+t[e])).join(",");return n.length?e+"-"+n:""+e}function E(e,n,s,i){i=i||[];const a=_(n,s.repeats);if(-1!==i.indexOf(a))return;i.push(a);const o=y.states[n];if(o.c===t)return o.outs.reduce(((t,n,r)=>t.concat(E(e,n,s,i))),[]);if(o.c===r){const t=[];n in s.repeats||(s.repeats[n]=0);const r=s.repeats[n];return r(n[r]=parseInt(r)==t?e.repeats[r]+1:e.repeats[r],n)),{});return{state:e.state,repeats:n,matched:e.matched,avail:e.avail.slice(),stack:e.stack}}(s,n),i))),r>=o.min&&r<=o.max&&(t=t.concat(E(e,o.outs[1],function(e,t){const n=Object.keys(e.repeats).reduce(((n,r)=>(parseInt(r)!==t&&(n[r]=e.repeats[r]),n)),{});return{state:e.state,repeats:n,matched:e.matched,avail:e.avail.slice(),stack:e.stack}}(s,n),i))),t}return[e.push({state:n,repeats:s.repeats,avail:s.avail.map((e=>e.slice())),stack:s.stack,matched:s.matched,errors:s.errors})-1]}if(1===y.states.length)return c([],o,l,p,f,h,d);let b=null;for(E(x,this.start,{repeats:{},avail:[],matched:[],stack:[],errors:[]});x.length;){g.length=0,m&&m.push({threads:[]});for(let e=0;e=a)do{const e=y.states.map((e=>e.c===r?e.expr:null)),s=n.stack.map((n=>{let r=t.repeats[e.indexOf(n.c)];return void 0===r?r=0:r-=1,{c:n.c,e:n.e,i:r}})),i={c:n.c,triples:p,stack:s};t.matched=t.matched.concat(i),n.outs.forEach((e=>{E(g,e,t)}))}while(t.avail[i].length>0&&p.length_(e.state,e.repeats)))})}if(0===g.length&&null===b)return S(v(x,y.states));const e=x;x=g,g=e;const t=x.reduce(((e,t)=>null!==e?e:t.state===y.end?t:null),null);t&&(b=t)}if(null===b)return S(v(x,y.states));function S(e){return{type:"Failure",node:a,errors:e}}function v(t,r){const s=r[r.length-1];return t.map((t=>{const r=i({},y.states[t.state].c.valueExpr);if("reference"in r){const t=r.reference;e.isBlank(t)&&(r.reference=n.shapes[t])}return i({type:s.c.negated?"NegatedProperty":t.state===y.end?"ExcessTripleViolation":"MissingProperty",property:s.c.predicate},Object.keys(r).length>0?{valueExpr:r}:{})}))}return"errors"in b.matched?b.matched:c(b.matched,o,l,p,f,h,d)}function c(t,n,r,s,i,o,u){let c=[];const l=[],p=[],f=t.reduce(((t,n)=>{let a,f=0,h=t;for(;f=c.length&&c.push({}),n.stack[f].c!==c[f].c){if(a=[],h.type="EachOf"===n.stack[f].c.type?"EachOfSolutions":"OneOfSolutions",h.solutions=a,"min"in n.stack[f].c&&(h.min=n.stack[f].c.min),"max"in n.stack[f].c&&(h.max=n.stack[f].c.max),"annotations"in n.stack[f].c&&(h.annotations=n.stack[f].c.annotations),"semActs"in n.stack[f].c&&(h.semActs=n.stack[f].c.semActs),h=a,c[f].i=null,"semActs"in n.stack[f].c&&!o.dispatchAll(n.stack[f].c.semActs,"???",h))throw{type:"SemActFailure",errors:[{type:"UntrackedSemActFailure"}]}}else h=h.solutions;if(n.stack[f].i!==c[f].i?(a=[],h[n.stack[f].i]={type:"EachOf"===n.stack[f].c.type?"EachOfSolution":"OneOfSolution",expressions:a},h=a,c[f].e=null):h=h[c[f].i].expressions,n.stack[f].e===c[f].e)throw"how'd we get here?";a={},h[n.stack[f].e]=a,n.stack[f].e>0&&void 0===h[n.stack[f].e-1]&&-1===p.indexOf(h)&&p.push(h),h=a,c.length=f+1,++f}return h.type="TripleConstraintSolutions","min"in n.c&&(h.min=n.c.min),"max"in n.c&&(h.max=n.c.max),h.predicate=n.c.predicate,"valueExpr"in n.c&&(h.valueExpr=n.c.valueExpr),"productionLabel"in n.c&&(h.productionLabel=n.c.productionLabel),h.solutions=n.triples.map((t=>{const a=r[t],c={type:"TestedTriple",subject:a.subject,predicate:a.predicate,object:function(t){if('"'!==t[0])return t;const n={value:e.getLiteralValue(t)},r=e.getLiteralType(t);r&&"http://www.w3.org/2001/XMLSchema#string"!==r&&"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"!==r&&(n.type=r);const s=e.getLiteralLanguage(t);s&&(n.language=s);return n}(a.object)};function p(t,n,r){const s=r(t,n);if("errors"in s){const r={type:"ReferenceError",focus:t,shape:n,errors:s};return"string"==typeof shapeLabel&&e.isBlank(shapeLabel)&&(r.referencedShape=n),[r]}return("solution"in s&&0!==Object.keys(s.solution).length||"Recursion"===s.type)&&(c.referenced=s),[]}return"valueExpr"in h&&[].push.apply(l,u(h.inverse?a.subject:a.object,h.valueExpr,(function(e,t){return p(e,t,s)}),(function(e,t){return p(e,t,i)}))),0===l.length&&"semActs"in n.c&&!o.dispatchAll(n.c.semActs,a,c)&&l.push({type:"SemActFailure",errors:[{type:"UntrackedSemActFailure"}]}),c})),"annotations"in n.c&&(h.annotations=n.c.annotations),"semActs"in n.c&&(h.semActs=n.c.semActs),c=n.stack.slice(),t}),{});return l.length?{type:"SemActFailure",errors:l}:(p.forEach((e=>{for(let t=0;t{const t={collapseSpaces:function(e){return e.replace(/ +/g," ")},trimQuotes:function(e){return void 0===e||e.length<2||'"'!==e[0]&&"'"!==e[0]||e[0]!==e[e.length-1]?e:e.substring(1,e.length-1)},unescapeMetaChars:function(e){return e.replace(/\\([\/^$])/g,"$1")}};e.exports=t},386:(e,t,n)=>{const r=function(){const e=n(445),t=n(521);n(961);function r(e){if(void 0===e)throw Error("Invalid extension function: "+e+"!");const t=(e=e.trim()).indexOf("(",0),n=e.lastIndexOf(")");if(t<2||n<4||n<=t+1||n!=e.length-1)throw Error("Invalid extension function: "+e+"!");return{name:e.substring(0,t),args:e.substring(t+1,n)}}return{lift:function(n,s,i){const a=r(n);switch(a.name){case"hashmap":return e.lift(n,s,i,a.args);case"regex":return t.lift(n,s,i,a.args);case"test":return n;default:throw Error("Unknown extension: "+n+"!")}},lower:function(n,s,i){const a=r(n);switch(a.name){case"hashmap":return e.lower(n,s,i,a.args);case"regex":return t.lower(n,s,i,a.args);case"test":return n;default:throw Error("Unknown extension: "+n+"!")}}}}();e.exports=r},445:(e,t,n)=>{const r=function(){const e=n(961);function t(e,t){if(void 0===t||0===t.length)throw Error("Hashmap extension requires a variable name and map as arguments, but found none!");const n=/^[ ]*([\w:<>]+)[ ]*,[ ]*({.*)$/.exec(t);if(null===n||n.length<3)throw Error("Hashmap extension requires a variable name and map as arguments, but found: "+e+"!");const r=n[1],s=n[2];let i;try{if(i=JSON.parse(s),0===Object.keys(i).length)throw Error("Empty hashmap!")}catch(t){throw Error("Hashmap extension unable to parse map in "+e+"!"+t.message)}const a=Object.values(i);if(a.length!=[...new Set(a)].length)throw Error("Hashmap extension requires unique key/value pairs!");return{varName:r,hash:i}}function r(e,t){const n=e.match(/^([\w]+):(.*)$/);if(null!==n&&3==n.length){const r=n[1],s=n[2];if(0===r.length||0===s.length)throw Error("Hashmap extension given invalid target variable name "+e);if(!(r in t))throw Error("Hashmap extension given undefined variable prefix "+r);expandedName=t[r]+s}else expandedName=e;return expandedName}return{lift:function(n,s,i,a){const o=t(n,a),u=r(o.varName,i),c=e.trimQuotes(s);if(0===c.length)throw Error("Hashmap extension has no input");return{[u]:o.hash[c]}},lower:function(n,s,i,a){const o=t(n,a),u=r(o.varName,i),c=e.trimQuotes(s.get(u));if(void 0===c)throw Error("Unable to find mapped value for "+o.varName);const l=function(e,t){const n=Object.keys(e).find((n=>t===e[n]));if(!n)throw Error("Hashmap extension was unable to invert the value "+t+" with map "+JSON.stringify(e,{depth:null})+"!");return n}(o.hash,c);return 0!==l.length?e.unescapeMetaChars(e.collapseSpaces(l)):l}}}();e.exports=r},521:(e,t,n)=>{const r=function(){const e=n(961),t="(\\?<(?:[a-zA-Z:]+|<[^>]+>)>)";function r(t,n,r){const s=function(e,t){const n=e.match(/^ *(?:<([^>]*)>|([^:]*):([^ ]*)) *$/);if(null===n)throw Error('variable "'+e+'" did not match expected pattern!');let r;if(n[1])r=n[1];else{if(!(n[2]in t))throw Error("Unknown prefix "+n[2]+' in "'+e+'"!');r=t[n[2]]+n[3]}return r}(e.unescapeMetaChars(t.substr(2,t.length-3)),r);if(s in n)throw Error("unable to process prefixes in "+s);return n.push(s),s}function s(e){if(/^\s*\/.*\/\s*$/.test(e)&&(e=/^\s*\/(.*)\/\s*$/.exec(e)[1]).length<1)throw Error(mapDirective+" is missing the required regex pattern");return e}return{lift:function(e,n,i,a){a=s(a);const o=[],u=a.replace(RegExp(t,"g"),(function(e,t,n,s){return r(t,o,i),""}));if(0===o.length)throw Error("Found no capture variable in "+e+"!");let c;try{c=n.match(RegExp(u))}catch(t){throw Error("Error pattern matching "+e+" with "+n+": "+t.message)}if(!c)throw Error(e+' found no match for input "'+n+'"!');const l={};for(let e=1;e{e.exports=function(e){const t=n(386),r=(n(670),n(713).default),s=n(865)(e),i="http://shex.io/extensions/Map/#",a=/^ *(?:<([^>]*)>|([^:]*):([^ ]*)) *$/;function o(e){if("object"!=typeof e)return e;const t='"'+e.value+'"';return"language"in e?t+"@"+e.language:"type"in e?t+"^^"+e.type:t}function u(e,t){const n=/(?:^|"\^\^)([^:\/#"'\^_]*):[^\/]*$/.exec(e);let r,s,i;return n&&(r=n[1],s=t[r],i=n.index),void 0===s?e:0===i?s+e.substr(r.length+1):e.substr(0,i+3)+s+e.substr(i+r.length+4)}return{register:function(n,s){if(void 0===s||!("ShExTerm"in s))throw Error("SemAct extensions must be called with register(validator, {ShExTerm, ...)");const c="_prefixes"in n.schema?n.schema._prefixes:{};return n.semActHandler.results[i]={},n.semActHandler.register(i,{dispatch:function(e,r,s){function o(e){const t=Error(e);throw Error.captureStackTrace(t,o),t}const u=function(t,r){if(!t)throw Error("Invocation error: "+i+' code "'+e+"\" didn't match "+a);const u=function(t){return"string"==typeof t?t:t[1]?t[1]:t[2]in c?c[t[2]]+t[3]:o("unknown prefix "+t[2]+' in "'+e+'".')}(t),l=r;n.semActHandler.results[i][u]=l,s[u]=l};if(/.*[(].*[)].*$/.test(e)){const n=t.lift(e,r.object,c);for(key in n)u(key,n[key])}else{u(e.match(a),r.node||r.object)}return!0}}),{results:n.semActHandler.results[i],binder:function(e){let t=[];const n={};function r(e,t){for(let n in e)Array.isArray(e[n])?r(e[n],t):Object.keys(t).forEach((r=>{if(r in e[n])throw Error("unexpected duplicate key: "+r+" in "+JSON.stringify(e[n]));e[n][r]=t[r]}))}return function e(t){const n=[],s=[],i=Object.keys(t).reduce(((r,i)=>{let a=null;return"object"!=typeof t[i]||"value"in t[i]?a=function(e,t){const n={};return n[e]=t,n}(i,1):(a=e(t[i]),Array.isArray(t[i])?n.push(i):s.push(i)),function(e,t){const n=Object.assign({},e);return Object.keys(t).reduce(((e,n)=>{const r=n in t?t[n]:1;return e[n]=n in e?e[n]+r:r,e}),n)}(r,a)}),{});n.length>0&&(s.forEach((e=>{const s=Object.keys(t[e]).filter((e=>1===i[e]));if(s.length){const i=s.reduce(((n,r)=>(n[r]=t[e][r],n)),{});n.forEach((e=>{r(t[e],i)}))}})),s.reverse(),s.forEach((e=>{t.splice(e,1)})));return i}(e),e=Array.isArray(e)?function e(t){const n=t.reduce(((t,n)=>t.concat(Array.isArray(n)?e(n):n)),[]);return 1===n.length?n[0]:n}(e):[e],{get:function(r){if(null===t)return;if(r in n)return n[r];const s=t.slice();let i=u(s);for(;!(r in i);){let e;for(;!Array.isArray(i);)e=s.pop(),i=o(s);if(i.length===e+1)return void(t=null);s.push(e+1),i=u(s)}t=s.slice();const a=i[r];return delete i[r],a;function o(t){return t.reduce((function(e,t){return e[t]}),e)}function u(e){for(;Array.isArray(o(e));)e.push(0);return o(e)}}}},trivialMaterializer:function(t,r){let i=0;const a=t._index||s.ShExUtil.index(t);return r=r||function(){return"_:b"+i++},{materialize:function(i,o,u,c){u=u&&u!==n.start?u:t.start,c=c||new e.rdfjs.Store;const p={cs:o||r()},f=s.ShExUtil.Visitor(),h=f.visitShapeRef;return f.visitShapeRef=function(e){return this.visitShapeDecl(a.shapeExprs[e],e),h.call(f,e)},f.visitValueRef=function(e){return this.visitExpression(t.shapes[e],e),this._visitValue(e)},f.visitTripleConstraint=function(e){l(e,p,r,c,this,t,i)},f.visitShapeExpr(u,"_: -start-"),c}}},visitTripleConstraint:l};function l(e,n,c,l,p,f,h,d,m,y){function x(e,t,n){return l.addQuad(s.ShExTerm.externalTriple({subject:e,predicate:t,object:n},r)),e}const g=(e.semActs||[]).filter((function(e){return e.name===i}));if(g.length)g.forEach((function(r){const s=r.code,i=s.match(a);let c;if(i){const e=i[1]?i[1]:u(i[2]+":"+i[3],f._prefixes),t=o(h.get(e));void 0!==t&&(c=t)}void 0===c&&/[ a-zA-Z0-9]+\(/.test(s)&&(c=t.lower(s,h,f.prefixes)),void 0===c||(e.inverse?x(c,e.predicate,n.cs):x(n.cs,e.predicate,c))}));else if("string"!=typeof e.valueExpr&&"values"in e.valueExpr&&1===e.valueExpr.values.length)e.inverse?x(e.valueExpr.values[0],e.predicate,n.cs):x(n.cs,e.predicate,o(e.valueExpr.values[0]));else{const t=n.cs;let r="max"in e?-1===e.max?1/0:e.max:1;r>50&&(r=50),d||(r=1);for(let s=0;s{ShExWebApp=function(){const e=n(261);return Object.assign({},{ShExTerm:n(118),Util:n(443),Validator:n(457),Writer:n(95),Api:n(237),Parser:n(931),ShapeMap:e,ShapeMapParser:e.Parser,Map:n(279)})}(),e.exports=ShExWebApp},839:(e,t,n)=>{const r=n(14),s="http://www.w3.org/2001/XMLSchema#",i=s+"boolean",a=/^[a-z][a-z0-9+.-]*:/i;function o(e){e||(e={});for(let t,n=1,r=arguments.length;n>10),56320+(1023&i))}{const e=t[s];if(!e)throw new Error("no replacement found for '"+s+"'");return e}}))}catch(e){return console.warn(e),""}}const{JisonParser:y,o:x}=n(41),g=[1,7],_=[1,16],E=[1,11],b=[1,14],S=[1,25],v=[1,24],A=[1,21],O=[1,22],w=[1,23],T=[1,28],I=[1,26],N=[1,27],k=[1,29],F=[1,12],L=[1,13],R=[1,15],j=[4,9],C=[16,19,20,21],D=[2,25],$=[16,19,20,21,37],P=[16,19,20,21,31,34,37,39,46,48,50,53,54,55,56,76,77,78,79,80,81,82],M=[4,9,16,19,20,21,37,43,74,75],Q=[4,9,43],G=[29,46,80,81,82],B=[4,9,42,43],V=[1,59],U=[46,79,80,81,82],z=[31,34,39,46,48,50,53,54,55,56,76,77,78,80,81,82],J=[1,94],X=[1,85],H=[1,86],q=[1,87],Z=[1,90],K=[1,91],W=[1,92],Y=[1,93],ee=[1,95],te=[33,48,49,50,53,54,55,56,63],ne=[4,9,37,65],re=[1,99],se=[9,37],ie=[9,65];t.HW=class extends y{constructor(e={},t=new oe(e)){super(e,t),this.symbols_={error:2,shapeMap:3,EOF:4,pair:5,Q_O_QGT_COMMA_E_S_Qpair_E_C_E_Star:6,QGT_COMMA_E_Opt:7,O_QGT_COMMA_E_S_Qpair_E_C:8,GT_COMMA:9,nodeSelector:10,statusAndShape:11,Qreason_E_Opt:12,QjsonAttributes_E_Opt:13,reason:14,jsonAttributes:15,GT_AT:16,Qstatus_E_Opt:17,shapeSelector:18,ATSTART:19,ATPNAME_NS:20,ATPNAME_LN:21,status:22,objectTerm:23,triplePattern:24,IT_SPARQL:25,string:26,nodeIri:27,shapeIri:28,START:29,subjectTerm:30,BLANK_NODE_LABEL:31,literal:32,GT_LCURLEY:33,IT_FOCUS:34,nodePredicate:35,O_QobjectTerm_E_Or_QIT___E_C:36,GT_RCURLEY:37,O_QsubjectTerm_E_Or_QIT___E_C:38,IT__:39,GT_NOT:40,GT_OPT:41,GT_DIVIDE:42,GT_DOLLAR:43,O_QAPPINFO_COLON_E_Or_QAPPINFO_SPACE_COLON_E_C:44,jsonValue:45,APPINFO_COLON:46,APPINFO_SPACE_COLON:47,IT_false:48,IT_null:49,IT_true:50,jsonObject:51,jsonArray:52,INTEGER:53,DECIMAL:54,DOUBLE:55,STRING_LITERAL2:56,Q_O_QjsonMember_E_S_QGT_COMMA_E_S_QjsonMember_E_Star_C_E_Opt:57,O_QGT_COMMA_E_S_QjsonMember_E_C:58,jsonMember:59,Q_O_QGT_COMMA_E_S_QjsonMember_E_C_E_Star:60,O_QjsonMember_E_S_QGT_COMMA_E_S_QjsonMember_E_Star_C:61,STRING_LITERAL2_COLON:62,GT_LBRACKET:63,Q_O_QjsonValue_E_S_QGT_COMMA_E_S_QjsonValue_E_Star_C_E_Opt:64,GT_RBRACKET:65,O_QGT_COMMA_E_S_QjsonValue_E_C:66,Q_O_QGT_COMMA_E_S_QjsonValue_E_C_E_Star:67,O_QjsonValue_E_S_QGT_COMMA_E_S_QjsonValue_E_Star_C:68,rdfLiteral:69,numericLiteral:70,booleanLiteral:71,Q_O_QLANGTAG_E_Or_QGT_DTYPE_E_S_QnodeIri_E_C_E_Opt:72,O_QLANGTAG_E_Or_QGT_DTYPE_E_S_QnodeIri_E_C:73,LANGTAG:74,GT_DTYPE:75,STRING_LITERAL1:76,STRING_LITERAL_LONG1:77,STRING_LITERAL_LONG2:78,IT_a:79,IRIREF:80,PNAME_LN:81,PNAME_NS:82,$accept:0,$end:1},this.terminals_={2:"error",4:"EOF",9:"GT_COMMA",16:"GT_AT",19:"ATSTART",20:"ATPNAME_NS",21:"ATPNAME_LN",25:"IT_SPARQL",29:"START",31:"BLANK_NODE_LABEL",33:"GT_LCURLEY",34:"IT_FOCUS",37:"GT_RCURLEY",39:"IT__",40:"GT_NOT",41:"GT_OPT",42:"GT_DIVIDE",43:"GT_DOLLAR",46:"APPINFO_COLON",47:"APPINFO_SPACE_COLON",48:"IT_false",49:"IT_null",50:"IT_true",53:"INTEGER",54:"DECIMAL",55:"DOUBLE",56:"STRING_LITERAL2",62:"STRING_LITERAL2_COLON",63:"GT_LBRACKET",65:"GT_RBRACKET",74:"LANGTAG",75:"GT_DTYPE",76:"STRING_LITERAL1",77:"STRING_LITERAL_LONG1",78:"STRING_LITERAL_LONG2",79:"IT_a",80:"IRIREF",81:"PNAME_LN",82:"PNAME_NS"},this.productions_=[0,[3,1],[3,4],[8,2],[6,0],[6,2],[7,0],[7,1],[5,4],[12,0],[12,1],[13,0],[13,1],[11,3],[11,1],[11,1],[11,1],[17,0],[17,1],[10,1],[10,1],[10,2],[10,2],[18,1],[18,1],[30,1],[30,1],[23,1],[23,1],[24,5],[24,5],[36,1],[36,1],[38,1],[38,1],[22,1],[22,1],[14,2],[15,3],[44,1],[44,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[51,3],[58,2],[60,0],[60,2],[61,2],[57,0],[57,1],[59,2],[52,3],[66,2],[67,0],[67,2],[68,2],[64,0],[64,1],[32,1],[32,1],[32,1],[70,1],[70,1],[70,1],[69,2],[73,1],[73,2],[72,0],[72,1],[71,1],[71,1],[26,1],[26,1],[26,1],[26,1],[35,1],[35,1],[27,1],[27,1],[27,1],[27,1],[28,1],[28,1],[28,1],[28,1]],this.table=[{3:1,4:[1,2],5:3,10:4,23:5,24:6,25:g,26:20,27:8,30:9,31:_,32:10,33:E,46:b,48:S,50:v,53:A,54:O,55:w,56:T,69:17,70:18,71:19,76:I,77:N,78:k,80:F,81:L,82:R},{1:[3]},{1:[2,1]},x(j,[2,4],{6:30}),{11:31,16:[1,32],19:[1,33],20:[1,34],21:[1,35]},x(C,[2,19]),x(C,[2,20]),{26:36,56:T,76:I,77:N,78:k},x(C,D,{26:37,56:T,76:I,77:N,78:k}),x($,[2,27]),x($,[2,28]),{27:42,30:40,31:_,34:[1,38],38:39,39:[1,41],46:b,80:F,81:L,82:R},x(P,[2,84]),x(P,[2,85]),x(P,[2,86]),x(P,[2,87]),x([16,19,20,21,37,46,79,80,81,82],[2,26]),x($,[2,65]),x($,[2,66]),x($,[2,67]),x($,[2,74],{72:43,73:44,74:[1,45],75:[1,46]}),x($,[2,68]),x($,[2,69]),x($,[2,70]),x($,[2,76]),x($,[2,77]),x(M,[2,78]),x(M,[2,79]),x(M,[2,80]),x(M,[2,81]),{4:[2,6],7:47,8:48,9:[1,49]},x(Q,[2,9],{12:50,14:51,42:[1,52]}),x(G,[2,17],{17:53,22:54,40:[1,55],41:[1,56]}),x(B,[2,14]),x(B,[2,15]),x(B,[2,16]),x(C,[2,21]),x(C,[2,22]),{27:58,35:57,46:b,79:V,80:F,81:L,82:R},{27:58,35:60,46:b,79:V,80:F,81:L,82:R},x(U,[2,33]),x(U,[2,34]),x([37,46,79,80,81,82],D),x($,[2,71]),x($,[2,75]),x($,[2,72]),{27:61,46:b,80:F,81:L,82:R},{4:[1,62]},x(j,[2,5]),{4:[2,7],5:63,10:4,23:5,24:6,25:g,26:20,27:8,30:9,31:_,32:10,33:E,46:b,48:S,50:v,53:A,54:O,55:w,56:T,69:17,70:18,71:19,76:I,77:N,78:k,80:F,81:L,82:R},x(j,[2,11],{13:64,15:65,43:[1,66]}),x(Q,[2,10]),{26:67,56:T,76:I,77:N,78:k},{18:68,28:69,29:[1,70],46:[1,73],80:[1,71],81:[1,72],82:[1,74]},x(G,[2,18]),x(G,[2,35]),x(G,[2,36]),{23:76,26:20,27:42,30:9,31:_,32:10,36:75,39:[1,77],46:b,48:S,50:v,53:A,54:O,55:w,56:T,69:17,70:18,71:19,76:I,77:N,78:k,80:F,81:L,82:R},x(z,[2,82]),x(z,[2,83]),{34:[1,78]},x($,[2,73]),{1:[2,2]},x(j,[2,3]),x(j,[2,8]),x(j,[2,12]),{44:79,46:[1,80],47:[1,81]},x(Q,[2,37]),x(B,[2,13]),x(B,[2,23]),x(B,[2,24]),x(B,[2,88]),x(B,[2,89]),x(B,[2,90]),x(B,[2,91]),{37:[1,82]},{37:[2,31]},{37:[2,32]},{37:[1,83]},{33:J,45:84,48:X,49:H,50:q,51:88,52:89,53:Z,54:K,55:W,56:Y,63:ee},x(te,[2,39]),x(te,[2,40]),x(C,[2,29]),x(C,[2,30]),x(j,[2,38]),x(ne,[2,41]),x(ne,[2,42]),x(ne,[2,43]),x(ne,[2,44]),x(ne,[2,45]),x(ne,[2,46]),x(ne,[2,47]),x(ne,[2,48]),x(ne,[2,49]),{37:[2,55],57:96,59:98,61:97,62:re},{33:J,45:102,48:X,49:H,50:q,51:88,52:89,53:Z,54:K,55:W,56:Y,63:ee,64:100,65:[2,63],68:101},{37:[1,103]},{37:[2,56]},x(se,[2,52],{60:104}),{33:J,45:105,48:X,49:H,50:q,51:88,52:89,53:Z,54:K,55:W,56:Y,63:ee},{65:[1,106]},{65:[2,64]},x(ie,[2,60],{67:107}),x(ne,[2,50]),{9:[1,109],37:[2,54],58:108},x(se,[2,57]),x(ne,[2,58]),{9:[1,111],65:[2,62],66:110},x(se,[2,53]),{59:112,62:re},x(ie,[2,61]),{33:J,45:113,48:X,49:H,50:q,51:88,52:89,53:Z,54:K,55:W,56:Y,63:ee},x(se,[2,51]),x(ie,[2,59])],this.defaultActions={2:[2,1],62:[2,2],76:[2,31],77:[2,32],97:[2,56],101:[2,64]}}performAction(e,t,n,s,l,p,y){const x=p.length-1;switch(l){case 1:return[];case 2:return[p[x-3]].concat(p[x-2]);case 3:case 51:case 59:this.$=p[x];break;case 4:case 60:case 63:this.$=[];break;case 5:case 61:this.$=p[x-1].concat(p[x]);break;case 8:this.$=o({node:p[x-3]},p[x-2],p[x-1],p[x]);break;case 9:case 11:case 52:case 55:case 74:this.$={};break;case 13:this.$=o({shape:p[x]},p[x-1]);break;case 14:this.$={shape:r.start};break;case 15:p[x]=p[x].substr(1,p[x].length-1),this.$={shape:d(s.schemaMeta.prefixes,p[x].substr(0,p[x].length-1))};break;case 16:p[x]=p[x].substr(1,p[x].length-1);const e=p[x].indexOf(":");this.$={shape:d(s.schemaMeta.prefixes,p[x].substr(0,e))+p[x].substr(e+1)};break;case 17:this.$={status:"conformant"};break;case 18:this.$={status:p[x]};break;case 21:this.$={type:"Extension",language:"http://www.w3.org/ns/shex#Extensions-sparql",lexical:p[x]["@value"]};break;case 22:this.$={type:"Extension",language:p[x-1],lexical:p[x]["@value"]};break;case 24:this.$=r.start;break;case 29:this.$={type:"TriplePattern",subject:r.focus,predicate:p[x-2],object:p[x-1]};break;case 30:this.$={type:"TriplePattern",subject:p[x-3],predicate:p[x-2],object:r.focus};break;case 32:case 34:case 42:this.$=null;break;case 35:this.$="nonconformant";break;case 36:this.$="unknown";break;case 37:this.$={reason:p[x]};break;case 38:this.$={appinfo:p[x]};break;case 41:this.$=!1;break;case 43:this.$=!0;break;case 46:case 47:case 48:this.$=parseFloat(p[x]);break;case 49:this.$=f(p[x],1)["@value"];break;case 50:case 58:this.$=p[x-1];break;case 53:case 54:case 71:this.$=o(p[x-1],p[x]);break;case 57:this.$={};const t=p[x-1].substr(0,p[x-1].length-1).trim();this.$[f(t,1)["@value"]]=p[x];break;case 62:this.$=[p[x-1]].concat(p[x]);break;case 68:this.$=c(p[x],"http://www.w3.org/2001/XMLSchema#integer");break;case 69:this.$=c(p[x],"http://www.w3.org/2001/XMLSchema#decimal");break;case 70:this.$=c(p[x],"http://www.w3.org/2001/XMLSchema#double");break;case 72:this.$=u("@language",p[x].substr(1).toLowerCase());break;case 73:this.$=u("@type",p[x]);break;case 76:this.$=c("true",i);break;case 77:this.$=c("false",i);break;case 78:case 80:this.$=f(p[x],1);break;case 79:case 81:this.$=f(p[x],3);break;case 83:this.$="http://www.w3.org/1999/02/22-rdf-syntax-ns#type";break;case 84:const n=m(p[x].slice(1,-1),{});this.$=null===s.dataMeta.base||a.test(n)?n:s.dataMeta._resolveIRI(n);break;case 85:case 86:this.$=h(p[x],s.dataMeta.prefixes);break;case 87:this.$=d(s.dataMeta.prefixes,p[x].substr(0,p[x].length-1));break;case 88:const l=m(p[x].slice(1,-1),{});this.$=null===s.schemaMeta.base||a.test(l)?l:s.schemaMeta._resolveIRI(l);break;case 89:case 90:this.$=h(p[x],s.schemaMeta.prefixes);break;case 91:this.$=d(s.schemaMeta.prefixes,p[x].substr(0,p[x].length-1))}}};const{JisonLexer:ae}=n(752);class oe extends ae{constructor(e={}){super(e),this.options={moduleName:"ShapeMapJison"},this.rules=[/^(?:\s+|(#[^\u000a\u000d]*|\/\*([^*]|\*([^/]|\\\/))*\*\/))/,/^(?:(appinfo[\u0020\u000A\u0009]+:))/,/^(?:("([^\u0022\u005C\u000A\u000D]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*"[\u0020\u000A\u0009]*:))/,/^(?:([Ff][Oo][Cc][Uu][Ss]))/,/^(?:([Ss][Tt][Aa][Rr][Tt]))/,/^(?:(@[Ss][Tt][Aa][Rr][Tt]))/,/^(?:([Ss][Pp][Aa][Rr][Qq][Ll]))/,/^(?:(@(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?)?:)(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|:|[0-9]|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.|:|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))*))))/,/^(?:(@((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?)?:)))/,/^(?:(@([A-Za-z])+((-([0-9A-Za-z])+))*))/,/^(?:(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?)?:)(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|:|[0-9]|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.|:|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))*)))/,/^(?:(appinfo:))/,/^(?:((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?)?:))/,/^(?:(([+-])?((([0-9])+\.([0-9])*(([Ee]([+-])?([0-9])+)))|((\.)?([0-9])+(([Ee]([+-])?([0-9])+))))))/,/^(?:(([+-])?([0-9])*\.([0-9])+))/,/^(?:(([+-])?([0-9])+))/,/^(?:(<([^\u0000-\u0020<>\"{}|^`\\]|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*>))/,/^(?:(_:((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|[0-9])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?))/,/^(?:('''(('|'')?([^\'\\]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))))*'''))/,/^(?:("""(("|"")?([^\"\\]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))))*"""))/,/^(?:('([^\u0027\u005c\u000a\u000d]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*'))/,/^(?:("([^\u0022\u005c\u000a\u000d]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*"))/,/^(?:a\b)/,/^(?:,)/,/^(?:\{)/,/^(?:\})/,/^(?:@)/,/^(?:!)/,/^(?:\?)/,/^(?:\/)/,/^(?:\$)/,/^(?:\[)/,/^(?:\])/,/^(?:\^\^)/,/^(?:_\b)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:[a-zA-Z0-9_-]+)/,/^(?:.)/],this.conditions={INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40],inclusive:!0}}}performAction(e,t,n,r){switch(n){case 0:break;case 1:return 47;case 2:return 62;case 3:return 34;case 4:return 29;case 5:return 19;case 6:return 25;case 7:return 21;case 8:return 20;case 9:return 74;case 10:return 81;case 11:return 46;case 12:return 82;case 13:return 55;case 14:return 54;case 15:return 53;case 16:return 80;case 17:return 31;case 18:return 77;case 19:return 78;case 20:return 76;case 21:return 56;case 22:return 79;case 23:return 9;case 24:return 33;case 25:return 37;case 26:return 16;case 27:return 40;case 28:return 41;case 29:return 42;case 30:return 43;case 31:return 63;case 32:return 65;case 33:return 75;case 34:return 39;case 35:return 50;case 36:return 48;case 37:return 49;case 38:return 4;case 39:return'unexpected word "'+t.yytext+'"';case 40:return"invalid character "+t.yytext}}}},18:(e,t,n)=>{const r=function(){ShapeMapJison=n(839).HW;const e=/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i,t=/(?:^|\/)\.\.?(?:$|[\/#?])/;class r{constructor(){}reset(){this.prefixes=null,this.base=this._baseIRI=this._baseIRIPath=this._baseIRIRoot=null}_setBase(t){t||(t=null),(this.base=t)&&(this._basePath=t.replace(/[^\/?]*(?:\?.*)?$/,""),t=t.match(e),this._baseRoot=t[0],this._baseScheme=t[1])}_resolveIRI(e){switch(e[0]){case void 0:return this.base;case"#":return this.base+e;case"?":return this.base.replace(/(?:\?.*)?$/,e);case"/":return("/"===e[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!t.test(e))return e;const n=e.length;let r="",s=-1,i=-1,a="/",o=0;for(;s=i&&(r=r.substr(0,o)),"/"!==a)return r+"/"+e.substr(s+1);o=s+1}}}a=e[++s]}return r+e.substring(o)}expandPrefix(e){return e in this.prefixes||this.error(new Error('Parse error; unknown prefix "'+e+':"')),this.prefixes[e]}}class s{constructor(){this.schemaMeta=new r,this.dataMeta=new r,this._fileName=void 0}reset(){this.schemaMeta.reset(),this.dataMeta.reset()}_setFileName(e){this._fileName=e}error(e){const t={text:this.lexer.match,line:this.lexer.thislineno,loc:this.lexer.thislloc,pos:this.lexer.showPosition()};if(e.hash=t,!this.recoverable)throw e;this.recoverable(e)}}return{construct:function(e,t,n){const r=t.base,i={};for(const e in t.prefixes||{})i[e]=t.prefixes[e];const a=n.base,o={};for(const e in n.prefixes||{})o[e]=n.prefixes[e];const u=new ShapeMapJison,c=u.parse;return u.parse=function t(n,l=null){const p=globalThis.PS=new s;p.schemaMeta.prefixes=Object.create(i),p.schemaMeta._setBase(r),p.dataMeta.prefixes=Object.create(o),p.dataMeta._setBase(a),p._setFileName(e),p._fileName=l;try{return c.call(u,n,p)}catch(n){const r="lexer"in u.yy?u.yy.lexer.yylineno+1:1,s="lexer"in u.yy?u.yy.lexer.showPosition():"",i=Error(`${e}(${r}): ${n.message}\n${s}`);throw Error.captureStackTrace(i,t),p.reset(),i}},u}}}();e.exports=r},14:e=>{const t={focus:{term:"FOCUS"},start:{term:"START"},wildcard:{term:"WILDCARD"}};e.exports=t},261:(e,t,n)=>{const r=function(){const e=n(14);return e.Parser=n(18),e}();e.exports=r},237:(e,t,n)=>{e.exports=function(e={}){const t=n(443),r=n(931),s={load:async function(n,r,l,p,f={},h={}){const d={schema:t.emptySchema(),data:e.rdfjs?new e.rdfjs.Store:null,schemaMeta:[],dataMeta:[]},m=[],y=n.concat(r).map((e=>"object"==typeof e?e.url:e));let x=null;f&&"iriTransform"in f&&(x=f.iriTransform,delete f.iriTransform);const g=function(){const e=[],t=[];let n,r,s=0;const i=new Promise((function(e,t){n=e,r=t}));return i.all=function(t){return 0===t.length?n([]):t.forEach((function(t,n){e.push(t),a(t,n)})),i},i.add=function(t){return e.push(t),a(t,e.length-1),i},i;function a(i,a){i.then((function(r){t[a]=r,++s,s===e.length&&n(t)})).catch((function(e){r(e)}))}}();function _(e){if(!("imports"in e))return e;if(f.keepImports)return e;const t=Object.assign({},e);t.imports;return delete t.imports,e.imports.map((function(e){return x?x(e):e})).filter((function(e){return-1===y.indexOf(e)})).map((e=>{y.push(e),g.add(s.GET(e).then((function(e){const t={url:e.url,base:e.url,prefixes:{}};return a(e.text,"text/shex",e.url,d.schema,t,f,_)})))})),t}return[].push.apply(m,[i(n,d.schemaMeta,"text/shex",a,d.schema,f,_),i(r,d.schemaMeta,"text/json",o,d.schema,f,_),i(l,d.dataMeta,"text/turtle",u,d.data,h),i(p,d.dataMeta,"application/ld+json",c,d.data,h)].reduce(((e,t)=>e.concat(t)),[])),g.all(m).then((function(e){return d.schemaMeta.length>0&&t.isWellDefined(d.schema),d}))},loadExtensions:function(e){return[]},GET:async function(t,n){let r;return(r=t.match("^data:([^,]+),(.*)$"))?Promise.resolve({text:r[2],url:r[0]}):t.match("^(blob:)?[a-z]+://.")?async function(t,n){if("function"!=typeof e.fetch)throw Error(`Unable to fetch ${t} with fetch=${e.fetch}`);let r;try{r=await e.fetch(t,{headers:{Accept:"text/shex,text/turtle,*/*"}})}catch(e){throw Error(`GET <${t}> network failure: ${e.message}`)}if(!r.ok)throw Error(`GET <${t}> failed: ${r.status} ${r.statusText}`);return{text:await r.text(),url:t}}(t):(()=>{throw Error(`Don't know how to fetch ${t}`)})()},loadShExImports_NotUsed:function(e,n,r){const i=[e],a={type:"Schema"};return s.GET(e).then((function e(o){const u=n.parse(o.text),c=u.imports;if(delete u.imports,t.merge(a,u,!1,!0),c){const t=c.map((function(e){return r?r(e):e})).filter((function(e){return-1===i.indexOf(e)}));return Promise.all(t.map((t=>(i.push(t),s.GET(t).then(e))))).then((e=>null))}return null})).then((function(){return t.isWellDefined(a),a}))}};return s;function i(e,n,r,i,a,o,u){return e.map((async e=>"object"==typeof e?async function(e){const n=c(e.url,r);try{return t.merge(a,e.schema,!0,!0),n._prefixes=a._prefixes||{},n.base=a._base,u(e.schema),[r,e.url]}catch(t){const n=Error("error merging schema object "+e.schema+": "+t);throw n.stack=t.stack,n}}(e):await async function(e){return s.GET(e,r).then((function(e){return i(e.text,r,e.url,a,c(e.url,r),o,u)}))}(e)));function c(e,t){const r={mediaType:t,url:e,base:e,prefixes:{}};return n.push(r),r}}function a(e,n,s,i,a,o,u){const c=o&&"parser"in o?o.parser:r.construct(s,{},o);try{const r=c.parse(e,s);return r.base===s&&delete r.base,a.prefixes=r._prefixes||{},a.base=r._base||a.base,t.merge(i,u(r),!1,!0),Promise.resolve([n,s])}catch(e){return e.message="error parsing ShEx "+s+": "+e.message,Promise.reject(e)}}function o(e,n,r,s,i,a,o){try{const a=t.ShExJtoAS(JSON.parse(e));return t.merge(s,a,!0,!0),i.prefixes=s._prefixes,i.base=s.base,o(a),Promise.resolve([n,r])}catch(e){const t=Error("error parsing JSON "+r+": "+e);return Promise.reject(t)}}function u(t,n,r,s,i,a){return new Promise((function(a,o){new e.rdfjs.Parser({baseIRI:r,blankNodePrefix:"",format:"text/turtle"}).parse(t,(function(e,t,u){u&&(i.prefixes=u),e?o("error parsing "+r+": "+e):t?s.addQuad(t):(i.base=this._base,a([n,r]))}))}))}async function c(t,n,r,s,i,a){const o=JSON.parse(t);try{const t=await e.jsonld.toRDF(o,Object.assign({format:"application/nquads",base:r},e.jsonLdOptions||{}));return i.prefixes={},i.base=r,u(t,n,r,s,i)}catch(e){let t=e;throw"details"in t&&(t=t.details),"cause"in t&&(t=t.cause),Error("error parsing JSON-ld "+r+": "+t)}}}},509:(e,t,n)=>{const r=n(443),s="http://www.w3.org/2001/XMLSchema#",i=s+"decimal",a=s+"double",o=s+"boolean",u=[s+"integer",s+"decimal",s+"float",s+"double",s+"string",s+"boolean",s+"dateTime",s+"nonPositiveInteger",s+"negativeInteger",s+"long",s+"int",s+"short",s+"byte",s+"nonNegativeInteger",s+"unsignedLong",s+"unsignedInt",s+"unsignedShort",s+"unsignedByte",s+"positiveInteger"],c=/^[a-z][a-z0-9+.-]*:/i,l=["mininclusive","minexclusive","maxinclusive","maxexclusive"];function p(e){return e.toLowerCase()}function f(e,t){return e.push(t),e}function h(e){e||(e={});for(let t,n=1,r=arguments.length;n0?{restricts:y[O-1]}:{},{shapeExpr:y[O]}));break;case 27:case 102:case 108:case 172:this.$={};break;case 28:this.$={abstract:!0};break;case 29:case 95:case 47:case 51:case 54:case 58:case 183:case 199:case 208:case 216:case 227:this.$=[];break;case 31:this.$=v(y[O]);break;case 32:this.$={type:"ShapeExternal"};break;case 33:y[O-2]&&(y[O-1]={type:"ShapeNot",shapeExpr:v(y[O-1])}),y[O]?(y[O].needsAtom.unshift(v(y[O-1])),delete y[O].needsAtom,this.$=y[O]):this.$=y[O-1];break;case 34:y[O-1]={type:"ShapeNot",shapeExpr:v(y[O-1])},y[O]?(y[O].needsAtom.unshift(v(y[O-1])),delete y[O].needsAtom,this.$=y[O]):this.$=y[O-1];break;case 35:y[O].needsAtom.unshift(v(y[O-1])),delete y[O].needsAtom,this.$=y[O];break;case 36:case 231:case 248:this.$=null;break;case 37:case 41:case 44:case 50:case 57:case 188:case 247:case 143:case 150:case 160:case 161:case 201:case 210:case 218:case 265:case 268:this.$=y[O];break;case 39:const w=y[O].map(v);this.$={type:"ShapeOr",shapeExprs:w,needsAtom:w};break;case 40:y[O-1].filter((e=>"ShapeAnd"===e.type)).length,y[O-1].length;const T={type:"ShapeAnd",shapeExprs:y[O-1].reduce(((e,t)=>e.concat("ShapeAnd"!==t.type||t.nested?v(t):t.shapeExprs)),[])};this.$=y[O].length>0?{type:"ShapeOr",shapeExprs:[T].concat(y[O].map(v))}:T,this.$.needsAtom=T.shapeExprs;break;case 43:case 46:case 48:case 52:case 55:case 59:this.$=y[O-1].concat(y[O]);break;case 49:this.$=S("ShapeOr",y[O-1],y[O]);break;case 53:case 56:this.$=S("ShapeAnd",y[O-1],y[O]);break;case 60:case 63:this.$=y[O-1]?{type:"ShapeNot",shapeExpr:v(y[O])}:y[O];break;case 61:this.$=!1;break;case 62:this.$=!0;break;case 64:case 73:case 78:case 80:this.$=y[O]?{type:"ShapeAnd",shapeExprs:[h({type:"NodeConstraint"},y[O-1]),y[O]]}:y[O-1];break;case 66:case 75:this.$=y[O]?S("ShapeAnd",y[O-1],[y[O]]):y[O-1];break;case 67:case 76:case 81:this.$=Object.assign(y[O-1],{nested:!0});break;case 68:case 77:case 82:this.$=s.EmptyShape;break;case 91:y[O]=y[O].substr(1,y[O].length-1);const I=y[O].indexOf(":");this.$=s.addSourceMap(s.expandPrefix(y[O].substr(0,I),s)+y[O].substr(I+1));break;case 92:y[O]=y[O].substr(1,y[O].length-1),this.$=s.addSourceMap(s.expandPrefix(y[O].substr(0,y[O].length-1),s));break;case 93:case 166:case 222:this.$=s.addSourceMap(y[O]);break;case 94:case 97:this.$=y[O-2],y[O-1].length&&(this.$.annotations=y[O-1]),y[O]&&(this.$.semActs=y[O].semActs);break;case 98:this.$=h({type:"NodeConstraint",nodeKind:"literal"},y[O]);break;case 99:-1===u.indexOf(y[O-1])&&l.forEach((function(e){e in y[O]&&s.error(new Error("Parse error: facet "+e+" not allowed for unknown datatype "+y[O-1]))})),this.$=h({type:"NodeConstraint",datatype:y[O-1]},y[O]);break;case 100:this.$={type:"NodeConstraint",values:y[O-1]};break;case 101:case 107:this.$=h({type:"NodeConstraint"},y[O]);break;case 103:case 105:case 111:case 109:-1!==Object.keys(y[O-1]).indexOf(Object.keys(y[O])[0])&&s.error(new Error("Parse error: facet "+Object.keys(y[O])[0]+" defined multiple times")),this.$=h(y[O-1],y[O]);break;case 106:this.$=h({type:"NodeConstraint"},y[O-1],y[O]?y[O]:{});break;case 112:this.$={nodeKind:"iri"};break;case 113:this.$={nodeKind:"bnode"};break;case 114:this.$={nodeKind:"nonliteral"};break;case 117:case 123:this.$=b(y[O-1],parseInt(y[O],10));break;case 118:this.$=function(e){const t=e.lastIndexOf("/");let n=e.substr(1,t-1);n=r.unescapeText(n,{".":"\\.","\\":"\\\\","?":"\\?","*":"\\*","+":"\\+","{":"\\{","}":"\\}","(":"\\(",")":"\\)","|":"\\|","^":"\\^",$:"\\$","[":"\\[","]":"\\]","/":"\\/",t:"\\t",n:"\\n",r:"\\r","-":"\\-","/":"/"});const s={pattern:n};return e.length>t+1&&(s.flags=e.substr(t+1)),s}(y[O]);break;case 119:this.$="length";break;case 120:this.$="minlength";break;case 121:this.$="maxlength";break;case 122:this.$=b(y[O-1],y[O]);break;case 124:this.$=parseInt(y[O],10);break;case 125:case 126:this.$=parseFloat(y[O]);break;case 127:y[O]===i||"http://www.w3.org/2001/XMLSchema#float"===y[O]||y[O]===a?this.$=parseFloat(y[O-2].value):-1!==u.indexOf(y[O])?this.$=parseInt(y[O-2].value):s.error(new Error("Parse error: numeric range facet expected numeric datatype instead of "+y[O]));break;case 128:this.$="mininclusive";break;case 129:this.$="minexclusive";break;case 130:this.$="maxinclusive";break;case 131:this.$="maxexclusive";break;case 132:this.$="totaldigits";break;case 133:this.$="fractiondigits";break;case 134:this.$=y[O-2]===s.EmptyShape?{type:"Shape"}:y[O-2],y[O-1].length&&(this.$.annotations=y[O-1]),y[O]&&(this.$.semActs=y[O].semActs);break;case 135:const N=y[O-1]?{expression:y[O-1]}:s.EmptyObject;this.$=N===s.EmptyObject&&y[O-3]===s.EmptyObject?s.EmptyShape:h({type:"Shape"},N,y[O-3]);break;case 136:this.$=["extends",[y[O]]];break;case 137:this.$=["extra",y[O]];break;case 138:this.$=["closed",!0];break;case 139:this.$=s.EmptyObject;break;case 140:y[O-1]===s.EmptyObject&&(y[O-1]={}),"closed"===y[O][0]?y[O-1].closed=!0:y[O][0]in y[O-1]?y[O-1][y[O][0]]=d(y[O-1][y[O][0]],y[O][1]):y[O-1][y[O][0]]=y[O][1],this.$=y[O-1];break;case 149:this.$={type:"OneOf",expressions:d([y[O-1]],y[O])};break;case 155:case 182:this.$=y[O-1];break;case 159:this.$={type:"EachOf",expressions:d([y[O-2]],y[O-1])};break;case 164:y[O-1]?(this.$=h({id:y[O-1]},y[O]),s.addProduction(y[O-1],this.$)):this.$=y[O];break;case 171:this.$=y[O-4],"min"in y[O-2]&&(this.$.min=y[O-2].min),"max"in y[O-2]&&(this.$.max=y[O-2].max),y[O-1].length&&(this.$.annotations=y[O-1]),y[O]&&(this.$.semActs="semActs"in y[O-4]?y[O-4].semActs.concat(y[O].semActs):y[O].semActs);break;case 174:y[O-3],s.EmptyShape,0,this.$=h({type:"TripleConstraint"},y[O-5],{predicate:y[O-4]},y[O-3]===s.EmptyShape?{}:{valueExpr:y[O-3]},y[O-2],y[O]),y[O-1].length&&(this.$.annotations=y[O-1]);break;case 177:this.$={min:0,max:-1};break;case 178:this.$={min:1,max:-1};break;case 179:this.$={min:0,max:1};break;case 180:y[O]=y[O].substr(1,y[O].length-2);const k=y[O].match(/(\d+)/g);this.$={min:parseInt(k[0],10)},2===k.length?this.$.max=parseInt(k[1],10):-1===y[O].indexOf(",")?this.$.max=parseInt(k[0],10):this.$.max=-1;break;case 181:this.$={inverse:!0};break;case 195:this.$={type:"IriStemRange",stem:{type:"Wildcard"},exclusions:y[O]};break;case 196:this.$={type:"LiteralStemRange",stem:{type:"Wildcard"},exclusions:y[O]};break;case 197:this.$={type:"LanguageStemRange",stem:{type:"Wildcard"},exclusions:y[O]};break;case 198:y[O]?(this.$={type:y[O].length?"IriStemRange":"IriStem",stem:y[O-1]},y[O].length&&(this.$.exclusions=y[O])):this.$=y[O-1];break;case 204:this.$=y[O]?{type:"IriStem",stem:y[O-1]}:y[O-1];break;case 207:y[O]?(this.$={type:y[O].length?"LiteralStemRange":"LiteralStem",stem:y[O-1].value},y[O].length&&(this.$.exclusions=y[O])):this.$=y[O-1];break;case 213:this.$=y[O]?{type:"LiteralStem",stem:y[O-1].value}:y[O-1].value;break;case 214:y[O]?(this.$={type:y[O].length?"LanguageStemRange":"LanguageStem",stem:y[O-1]},y[O].length&&(this.$.exclusions=y[O])):this.$={type:"Language",languageTag:y[O-1]};break;case 215:this.$={type:y[O].length?"LanguageStemRange":"LanguageStem",stem:""},y[O].length&&(this.$.exclusions=y[O]);break;case 221:this.$=y[O]?{type:"LanguageStem",stem:y[O-1]}:y[O-1];break;case 223:this.$={type:"Annotation",predicate:y[O-1],object:y[O]};break;case 226:this.$=y[O].length?{semActs:y[O]}:null;break;case 229:this.$=y[O]?function(e,t){return t=t.substring(1,t.length-2),{type:"SemAct",name:e,code:r.unescapeText(t,x)}}(y[O-1],y[O]):{type:"SemAct",name:y[O-1]};break;case 236:this.$="http://www.w3.org/1999/02/22-rdf-syntax-ns#type";break;case 242:this.$=m(y[O],"http://www.w3.org/2001/XMLSchema#integer");break;case 243:this.$=m(y[O],i);break;case 244:this.$=m(y[O],a);break;case 246:this.$=y[O]?h(y[O-1],{type:y[O]}):y[O-1];break;case 250:this.$={value:"true",type:o};break;case 251:this.$={value:"false",type:o};break;case 252:case 254:this.$=_(y[O],1);break;case 253:case 255:this.$=_(y[O],3);break;case 256:case 258:this.$=E(y[O],1);break;case 257:case 259:this.$=E(y[O],3);break;case 260:const F=r.unescapeText(y[O].slice(1,-1),{});this.$=null===s._base||c.test(F)?F:s._resolveIRI(F);break;case 262:const L=y[O].indexOf(":");this.$=s.expandPrefix(y[O].substr(0,L),s)+r.unescapeText(y[O].substr(L+1),g);break;case 263:this.$=s.expandPrefix(y[O].substr(0,y[O].length-1),s)}}};const{JisonLexer:Yl}=n(752);class ep extends Yl{constructor(e={}){super(e),this.options={moduleName:"ShExJison"},this.rules=[/^(?:\s+|(#[^\u000a\u000d]*|\/\*([^*]|\*([^/]|\\\/))*\*\/))/,/^(?:(@(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?)?:)(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|:|[0-9]|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.|:|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))*))))/,/^(?:(@((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?)?:)))/,/^(?:(@([A-Za-z])+((-([0-9A-Za-z])+))*))/,/^(?:@)/,/^(?:(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?)?:)(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|:|[0-9]|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.|:|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))*)))/,/^(?:(\{((([+-])?([0-9])+))((,(((([+-])?([0-9])+))|\*)?))?\}))/,/^(?:(([+-])?((([0-9])+\.([0-9])*(([Ee]([+-])?([0-9])+)))|((\.)?([0-9])+(([Ee]([+-])?([0-9])+))))))/,/^(?:(([+-])?([0-9])*\.([0-9])+))/,/^(?:(([+-])?([0-9])+))/,/^(?:{ANON})/,/^(?:(<([^\u0000-\u0020<>\"{}|^`\\]|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*>))/,/^(?:((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?)?:))/,/^(?:a\b)/,/^(?:(\/([^\u002f\u005C\u000A\u000D]|\\[nrt\\|.?*+(){}$\u002D\u005B\u005D\u005E/]|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))+\/[smix]*))/,/^(?:(_:((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|[0-9])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?))/,/^(?:(\{([^%\\]|\\[%\\]|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*%\}))/,/^(?:('''(('|'')?([^\'\\]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))))*'''(@([A-Za-z])+((-([0-9A-Za-z])+))*)))/,/^(?:("""(("|"")?([^\"\\]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))))*"""(@([A-Za-z])+((-([0-9A-Za-z])+))*)))/,/^(?:('([^\u0027\u005c\u000a\u000d]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*'(@([A-Za-z])+((-([0-9A-Za-z])+))*)))/,/^(?:("([^\u0022\u005c\u000a\u000d]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*"(@([A-Za-z])+((-([0-9A-Za-z])+))*)))/,/^(?:('''(('|'')?([^\'\\]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))))*'''))/,/^(?:("""(("|"")?([^\"\\]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))))*"""))/,/^(?:('([^\u0027\u005c\u000a\u000d]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*'))/,/^(?:("([^\u0022\u005c\u000a\u000d]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*"))/,/^(?:([Bb][Aa][Ss][Ee]))/,/^(?:([Pp][Rr][Ee][Ff][Ii][Xx]))/,/^(?:([iI][mM][pP][oO][rR][tT]))/,/^(?:([sS][tT][aA][rR][tT]))/,/^(?:([eE][xX][tT][eE][rR][nN][aA][lL]))/,/^(?:([Aa][Bb][Ss][Tt][Rr][Aa][Cc][Tt]))/,/^(?:([Rr][Ee][Ss][Tt][Rr][Ii][Cc][Tt][Ss]))/,/^(?:([Ee][Xx][Tt][Ee][Nn][Dd][Ss]))/,/^(?:([Cc][Ll][Oo][Ss][Ee][Dd]))/,/^(?:([Ee][Xx][Tt][Rr][Aa]))/,/^(?:([Ll][Ii][Tt][Ee][Rr][Aa][Ll]))/,/^(?:([Bb][Nn][Oo][Dd][Ee]))/,/^(?:([Ii][Rr][Ii]))/,/^(?:([Nn][Oo][Nn][Ll][Ii][Tt][Ee][Rr][Aa][Ll]))/,/^(?:([Aa][Nn][Dd]))/,/^(?:([Oo][Rr]))/,/^(?:([No][Oo][Tt]))/,/^(?:([Mm][Ii][Nn][Ii][Nn][Cc][Ll][Uu][Ss][Ii][Vv][Ee]))/,/^(?:([Mm][Ii][Nn][Ee][Xx][Cc][Ll][Uu][Ss][Ii][Vv][Ee]))/,/^(?:([Mm][Aa][Xx][Ii][Nn][Cc][Ll][Uu][Ss][Ii][Vv][Ee]))/,/^(?:([Mm][Aa][Xx][Ee][Xx][Cc][Ll][Uu][Ss][Ii][Vv][Ee]))/,/^(?:([Ll][Ee][Nn][Gg][Tt][Hh]))/,/^(?:([Mm][Ii][Nn][Ll][Ee][Nn][Gg][Tt][Hh]))/,/^(?:([Mm][Aa][Xx][Ll][Ee][Nn][Gg][Tt][Hh]))/,/^(?:([Tt][Oo][Tt][Aa][Ll][Dd][Ii][Gg][Ii][Tt][Ss]))/,/^(?:([Ff][Rr][Aa][Cc][Tt][Ii][Oo][Nn][Dd][Ii][Gg][Ii][Tt][Ss]))/,/^(?:=)/,/^(?:\/\/)/,/^(?:\{)/,/^(?:\})/,/^(?:&)/,/^(?:\|\|)/,/^(?:\|)/,/^(?:,)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\$)/,/^(?:!)/,/^(?:\^\^)/,/^(?:\^)/,/^(?:\.)/,/^(?:~)/,/^(?:;)/,/^(?:\*)/,/^(?:\+)/,/^(?:\?)/,/^(?:-)/,/^(?:%)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:$)/,/^(?:[a-zA-Z0-9_-]+)/,/^(?:.)/],this.conditions={INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79],inclusive:!0}}}performAction(e,t,n,r){switch(n){case 0:break;case 1:return 79;case 2:return 80;case 3:return t.yytext=t.yytext.substr(1),185;case 4:return 81;case 5:return 215;case 6:return 159;case 7:return 109;case 8:return 108;case 9:return 100;case 10:return"ANON";case 11:return 19;case 12:return 21;case 13:return 199;case 14:return 101;case 15:return 216;case 16:return 195;case 17:return 211;case 18:return 213;case 19:return 210;case 20:return 212;case 21:return 207;case 22:return 209;case 23:return 206;case 24:return 208;case 25:return 18;case 26:return 20;case 27:return 23;case 28:return 26;case 29:return 39;case 30:return 36;case 31:return 220;case 32:return 218;case 33:return 125;case 34:return 127;case 35:return 85;case 36:return 97;case 37:return 96;case 38:return 98;case 39:return 53;case 40:return 51;case 41:return 43;case 42:return 112;case 43:return 113;case 44:return 114;case 45:return 115;case 46:return 102;case 47:return 103;case 48:return 104;case 49:return 116;case 50:return 117;case 51:return 27;case 52:return 190;case 53:return 119;case 54:return 121;case 55:return 189;case 56:return"||";case 57:return 135;case 58:return 140;case 59:return 69;case 60:return 70;case 61:return 161;case 62:return 163;case 63:return 148;case 64:return"!";case 65:return 111;case 66:return 160;case 67:return 71;case 68:return 178;case 69:return 141;case 70:return 156;case 71:return 157;case 72:return 158;case 73:return 179;case 74:return 193;case 75:return 204;case 76:return 205;case 77:return 7;case 78:return'unexpected word "'+t.yytext+'"';case 79:return"invalid character "+t.yytext}}}},931:(e,t,n)=>{const r=function(){const e=n(509).Fm,t=/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i,r=/(?:^|\/)\.\.?(?:$|[\/#?])/;class s{constructor(){this.blankId=0,this._fileName=void 0,this.EmptyObject={},this.EmptyShape={type:"Shape"}}reset(){this._prefixes=this._imports=this._sourceMap=this.shapes=this.productions=this.start=this.startActs=null,this._base=this._baseIRI=this._baseIRIPath=this._baseIRIRoot=null}_setFileName(e){this._fileName=e}blank(){return"_:b"+this.blankId++}_resetBlanks(e){this.blankId=void 0===e?0:e}_setBase(e){e||(e=null),(this._base=e)&&(this._basePath=e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(t),this._baseRoot=e[0],this._baseScheme=e[1])}_resolveIRI(e){switch(e[0]){case void 0:return this._base;case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return("/"===e[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!r.test(e))return e;const t=e.length;let n="",s=-1,i=-1,a="/",o=0;for(;s=i&&(n=n.substr(0,o)),"/"!==a)return n+"/"+e.substr(s+1);o=s+1}}}a=e[++s]}return n+e.substring(o)}error(e){const t={text:this.lexer.match,line:this.lexer.yylineno,loc:this.lexer.yylloc,pos:this.lexer.showPosition()};if(e.hash=t,!this.recoverable)throw e;this.recoverable(e)}expandPrefix(e){return e in this._prefixes||this.error(new Error('Parse error; unknown prefix "'+e+':"')),this._prefixes[e]}addShape(e,t){t===this.EmptyShape&&(t={type:"Shape"}),this.productions&&e in this.productions&&this.error(new Error("Structural error: "+e+" is a triple expression")),this.shapes||(this.shapes={}),e in this.shapes?"replace"===this.options.duplicateShape?this.shapes[e]=t:"ignore"!==this.options.duplicateShape&&this.error(new Error("Parse error: "+e+" already defined")):this.shapes[e]=Object.assign({id:e},t)}addProduction(e,t){this.shapes&&e in this.shapes&&this.error(new Error("Structural error: "+e+" is a shape expression")),this.productions||(this.productions={}),e in this.productions?"replace"===this.options.duplicateShape?this.productions[e]=t:"ignore"!==this.options.duplicateShape&&this.error(new Error("Parse error: "+e+" already defined")):this.productions[e]=t}addSourceMap(e){this._sourceMap||(this._sourceMap=new Map);let t=this._sourceMap.get(e);return t||this._sourceMap.set(e,t=[]),t.push(this.lexer.yylloc),e}}return{construct:function(t,n,r){r=r||{};const i={};for(const e in n||{})i[e]=n[e];const a=new e(s),o=a.parse;return a.parse=function(e,n=t,u=r,c=null){const l=globalThis.PS=new s;l._prefixes=Object.create(i),l._imports=[],l._setBase(n),l._setFileName(t),l.options=r;let p=[];l.recoverable=e=>p.push(e);let f=null;try{f=o.call(a,e,l)}catch(e){p.push(e)}if(l.reset(),p.forEach((e=>{if("hash"in e){const t=e.hash,n=t.loc;delete t.loc,Object.assign(e,t,{location:n})}return e})),1==p.length)throw p[0].parsed=f,p[0];if(p.length){const e=new Error(p.length+" parser errors:\n"+p.map((e=>function(e,n){const r=e.location.first_line,s=e.location.first_column+1,i="pos"in e.hash?"\n"+e.hash.pos:"";return`${t}\n line: ${r}, column: ${s}: ${e.message}${i}`}(e,a.yy.lexer))).join("\n"));throw e.errors=p,e.parsed=f,e}return f},a._setBase=function(e){t=e},a}}}();e.exports=r},118:e=>{const t=function(){const e=/^[a-z][a-z0-9+.-]*:/i,t=/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i,n=/(?:^|\/)\.\.?(?:$|[\/#?])/,r="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",s="http://www.w3.org/2001/XMLSchema#string";function i(e){if(!n.test(e))return e;const t=e.length;let r="",s=-1,i=-1,a=0,o="/";for(;s=i&&(r=r.substr(0,a)),"/"!==o)return r+"/"+e.substr(s+1);a=s+1}}}o=e[++s]}return r+e.substring(a)}function a(e){switch(e.termType){case"NamedNode":return e.value;case"BlankNode":return"_:"+e.value;case"Literal":return'"'+e.value.replace(/"/g,'\\"')+'"'+(e.datatypeString===r?"@"+e.language:e.datatypeString===s?"":"^^"+e.datatypeString);default:throw Error("unknown RDFJS node type: "+JSON.stringify(e))}}function o(e,t){if(u(e))return t.namedNode(e);if(l(e))return t.blankNode(e.substr(2));if(c(e)){let n=h(e)||(f(e)===s?null:t.namedNode(f(e)));return t.literal(p(e),n)}throw Error("Unknown internal term type: "+JSON.stringify(e))}function u(e){if("string"!=typeof e)return!1;if(0===e.length)return!0;{const t=e[0];return'"'!==t&&"_"!==t}}function c(e){return"string"==typeof e&&'"'===e[0]}function l(e){return"string"==typeof e&&"_:"===e.substr(0,2)}function p(e){const t=/^"([^]*)"/.exec(e);if(!t)throw new Error(e+" is not a literal");return t[1].replace(/\\"/g,'"')}function f(e){const t=/^"[^]*"(?:\^\^([^"]+)|(@)[^@"]+)?$/.exec(e);if(!t)throw new Error(e+" is not a literal");return t[1]||(t[2]?r:s)}function h(e){const t=/^"[^]*"(?:@([^@"]+)|\^\^[^"]+)?$/.exec(e);if(!t)throw new Error(e+" is not a literal");return t[1]?t[1].toLowerCase():""}const d=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,m=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,y={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};function x(e){let t=y[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}return{RdfLangString:r,XsdString:s,resolveRelativeIRI:function(n,r){if(e.test(r))return r;switch(r[0]){case void 0:return n;case"#":return n+r;case"?":return n.replace(/(?:\?.*)?$/,r);case"/":let e=n.match(t);return("/"===r[1]?e[1]:e[0])+i(r);default:return i(n.replace(/[^\/?]*(?:\?.*)?$/,"")+r)}},isIRI:u,isLiteral:c,isBlank:l,isDefaultGraph:function(e){return!e},inDefaultGraph:function(e){return!e.graph},getLiteralValue:p,getLiteralType:f,getLiteralLanguage:h,internalTerm:a,internalTriple:function(e){return{subject:a(e.subject),predicate:a(e.predicate),object:a(e.object)}},externalTerm:o,externalTriple:function(e,t){return t.quad(o(e.subject,t),o(e.predicate,t),o(e.object,t))},internalTermToTurtle:function(e,t,n){if(u(e)){d.test(e)&&(e=e.replace(m,x));const r=Object.keys(n).find((t=>e.startsWith(n[t])));if(r){const t=e.substr(n[r].length);if(-1===t.indexOf("\\"))return r+":"+t.replace(/([~!$&'()*+,;=/?#@%])/g,"\\$1")}return e.startsWith(t)?"<"+e.substr(t.length)+">":"<"+e+">"}if(l(e))return e;if(c(e)){let r=p(e);const s=f(e),i=h(e);return d.test(r)&&(r=r.replace(m,x)),i?'"'+r+'"@'+i:s&&"http://www.w3.org/2001/XMLSchema#string"!==s?'"'+r+'"^^'+this.internalTermToTurtle(s,t,n):'"'+r+'"'}throw Error("Unknown internal term type: "+JSON.stringify(e))}}}();e.exports=t},443:(t,n,r)=>{const s=function(){const t=r(118),n=r(806),s=r(515),i={_namespace:"http://www.w3.org/ns/shex#"};["Schema","@context","imports","startActs","start","shapes","ShapeDecl","ShapeOr","ShapeAnd","shapeExprs","nodeKind","NodeConstraint","iri","bnode","nonliteral","literal","datatype","length","minlength","maxlength","pattern","flags","mininclusive","minexclusive","maxinclusive","maxexclusive","totaldigits","fractiondigits","values","ShapeNot","shapeExpr","Shape","abstract","closed","extra","expression","extends","restricts","semActs","ShapeRef","reference","ShapeExternal","EachOf","OneOf","expressions","min","max","annotation","TripleConstraint","inverse","negated","predicate","valueExpr","Inclusion","include","Language","languageTag","IriStem","LiteralStem","LanguageStem","stem","IriStemRange","LiteralStemRange","LanguageStemRange","exclusion","Wildcard","SemAct","name","code","Annotation","object"].forEach((e=>{i[e]=i._namespace+e}));const a={_namespace:"http://www.w3.org/1999/02/22-rdf-syntax-ns#"};["type","first","rest","nil"].forEach((e=>{a[e]=a._namespace+e}));const o={_namespace:"http://www.w3.org/2001/XMLSchema#"};["anyURI"].forEach((e=>{o[e]=o._namespace+e}));const u={_namespace:"http://www.w3.org/2002/07/owl#"};["Thing"].forEach((e=>{u[e]=u._namespace+e}));const c={};function l(e){e||(e={});for(let t,n=1,r=arguments.length;nt.set(e.id,null)));const n=this.ShExRVisitor(t);return"start"in e&&(e.start=n.visitShapeExpr(e.start)),"shapes"in e&&(e.shapes=e.shapes.map(((e,t)=>e.type===i.ShapeExternal?{type:"ShapeExternal",id:e.id}:{type:"ShapeDecl",id:e.id,abstract:e.abstract,shapeExpr:n.visitShapeExpr(e.shapeExpr)}))),n.cleanIds(),e},valGrep:function(e,t,n){const r=this,s=[];for(let i in e){const a=e[i];"object"==typeof a&&("type"in a&&a.type===t&&s.push(n(a)),s.push.apply(s,r.valGrep(a,t,n)))}return s},n3jsToTurtle:function(e){return this.valGrep(e,"TestedTriple",(function(e){return["subject","predicate","object"].map((n=>{return"object"==typeof(r=e[n])?'"'+r.value+'"'+("type"in r?"^^<"+r.type+">":"language"in r?"@"+r.language:""):t.isIRI(r)?"<"+r+">":t.isBlank(r)?r:"???";var r})).join(" ")+" ."}))},valToN3js:function(e,n){return this.valGrep(e,"TestedTriple",(function(e){const r=JSON.parse(JSON.stringify(e));return"object"==typeof e.object&&(r.object='"'+e.object.value+'"'+("type"in e.object?"^^"+e.object.type:"language"in e.object?"@"+e.object.language:"")),t.externalTriple(r,n)}))},n3jsToTurtle:function(e){return e.map((function(e){return["subject","predicate","object"].map((n=>function(e){if(t.isIRI(e))return"<"+e+">";if(t.isBlank(e))return e;const n=t.getLiteralType(e);return n&&"http://www.w3.org/2001/XMLSchema#string"!==n?'"'+t.getLiteralValue(e)+'"^^<'+n+">":e}(e[n]))).join(" ")+" ."}))},canonicalize:function(e,t){const n=JSON.parse(JSON.stringify(e));n["@context"]=n["@context"]||"http://www.w3.org/ns/shex.jsonld",delete n._prefixes,delete n._base;let r=n._index||this.index(e);delete n._index;n._sourceMap;delete n._sourceMap;const s=f.Visitor(),i=[],a=s.visitInclusion,o=s.visitExpression;s.visitExtra;return s.visitInclusion=function(e){return-1===i.indexOf(e)&&e in r.tripleExprs?(i.push(e),o.call(s,r.tripleExprs[e])):a.call(s,e)},s.visitExpression=function(e){return"object"==typeof e&&"id"in e?-1===i.indexOf(e.id)?(i.push(e.id),o.call(s,r.tripleExprs[e.id])):e.id:o.call(s,e)},s.visitExtra=function(e){return e.slice().sort()},t&&(s.visitIRI=function(e){return e.replace(t,"")},"imports"in n&&(n.imports=s.visitImports(n.imports))),"shapes"in n&&(n.shapes=Object.keys(r.shapeExprs).map((e=>("extra"in r.shapeExprs[e]&&r.shapeExprs[e].extra.sort(),s.visitShapeDecl(r.shapeExprs[e]))))),n},BiDiClosure:function(){return{needs:{},neededBy:{},inCycle:[],test:function(){function e(e,t){const n=JSON.stringify(e),r=JSON.stringify(t);if(n!==r)throw Error(n+" !== "+r)}this.add(2,3),e(this.needs,{2:[3]}),e(this.neededBy,{3:[2]}),this.add(1,2),e(this.needs,{1:[2,3],2:[3]}),e(this.neededBy,{3:[2,1],2:[1]}),this.add(1,3),e(this.needs,{1:[2,3],2:[3]}),e(this.neededBy,{3:[2,1],2:[1]}),this.add(3,4),e(this.needs,{1:[2,3,4],2:[3,4],3:[4]}),e(this.neededBy,{3:[2,1],2:[1],4:[3,2,1]}),this.add(6,7),e(this.needs,{6:[7],1:[2,3,4],2:[3,4],3:[4]}),e(this.neededBy,{7:[6],3:[2,1],2:[1],4:[3,2,1]}),this.add(5,6),e(this.needs,{5:[6,7],6:[7],1:[2,3,4],2:[3,4],3:[4]}),e(this.neededBy,{7:[6,5],6:[5],3:[2,1],2:[1],4:[3,2,1]}),this.add(5,7),e(this.needs,{5:[6,7],6:[7],1:[2,3,4],2:[3,4],3:[4]}),e(this.neededBy,{7:[6,5],6:[5],3:[2,1],2:[1],4:[3,2,1]}),this.add(7,8),e(this.needs,{5:[6,7,8],6:[7,8],7:[8],1:[2,3,4],2:[3,4],3:[4]}),e(this.neededBy,{7:[6,5],6:[5],8:[7,6,5],3:[2,1],2:[1],4:[3,2,1]}),this.add(4,5),e(this.needs,{1:[2,3,4,5,6,7,8],2:[3,4,5,6,7,8],3:[4,5,6,7,8],4:[5,6,7,8],5:[6,7,8],6:[7,8],7:[8]}),e(this.neededBy,{2:[1],3:[2,1],4:[3,2,1],5:[4,3,2,1],6:[5,4,3,2,1],7:[6,5,4,3,2,1],8:[7,6,5,4,3,2,1]})},add:function(e,t,n){const r=this;e in r.needs||(r.needs[e]=[]),t in r.neededBy||(r.neededBy[t]=[]),r.needs[e]=r.needs[e].concat([t],r.needs[t]).filter((function(e,t,n){return void 0!==e&&n.indexOf(e)===t})),r.neededBy[t]=r.neededBy[t].concat([e],r.neededBy[e]).filter((function(e,t,n){return void 0!==e&&n.indexOf(e)===t})),e in this.neededBy&&this.neededBy[e].forEach((function(e){r.needs[e]=r.needs[e].concat([t],r.needs[t]).filter((function(e,t,n){return void 0!==e&&n.indexOf(e)===t}))})),t in this.needs&&this.needs[t].forEach((function(t){r.neededBy[t]=r.neededBy[t].concat([e],r.neededBy[e]).filter((function(e,t,n){return void 0!==e&&n.indexOf(e)===t}))})),-1!==r.needs[e].indexOf(e)&&(r.inCycle=r.inCycle.concat(r.needs[e]))},trim:function(){function e(e){for(let t=e.length-1;t>-1;--t)e.indexOf(e[t]){let t=r.shapeExprs[e];if(o(e,null),t=n.skipDecl(t),"Shape"===t.type)"extends"in t&&t.extends.forEach((e=>o(e,t))),"expression"in t&&(n.simpleTripleConstraints(t)||[]).forEach((t=>{o(n.getValueType(t.valueExpr,!0),{type:"tc",shapeLabel:e,tc:t})}));else if("NodeConstraint"!==t.type)throw Error("nestShapes currently only supports Shapes and NodeConstraints")}));let a=Object.keys(i).filter((e=>1===i[e].length&&"tc"===i[e][0].type&&e in r.shapeExprs&&"Shape"===n.skipDecl(r.shapeExprs[e]).type&&!r.shapeExprs[e].abstract)).filter((e=>!("noNestPattern"in t)||!e.match(RegExp(t.noNestPattern)))).reduce(((e,t)=>(e[t]={referrer:i[t][0].shapeLabel,predicate:i[t][0].tc.predicate},e)),{});if(!t.no){let o={};if(t.rename){"transform"in t||(t.transform=function(){let e=s.reduce(((e,t,n)=>(e[t]="_:renamed"+n,e)),{});return function(t,n){return e[t]}}()),Object.keys(a).forEach((e=>{let n=r.shapeExprs[e],u=t.transform(e,n);if(o[e]=n.id=u,s[s.indexOf(e)]=u,a[u]=a[e],a[u].was=e,delete a[e],r.shapeExprs[u]=r.shapeExprs[e],delete r.shapeExprs[e],1!==i[e].length)throw Error("assertion: "+e+" doesn't have one reference: ["+i[e]+"]");let c=i[e][0];if("tc"!==c.type)throw"Shape"===c.type?Error("assertion: rename not implemented for Shape: "+c):Error("assertion: "+c.type+" not TripleConstraint or Shape");if("string"!=typeof c.tc.valueExpr)throw Error("assertion: rename not implemented for TripleConstraint expr: "+c.tc.valueExpr);c.tc.valueExpr=u})),Object.keys(a).forEach((e=>{let t=a[e];t.referrer in o&&(t.newReferrer=o[t.referrer])}));let e={};s.forEach((t=>e[t]=r.shapeExprs[t])),r.shapeExprs=e}else{const t=[],s=e.shapes.map((e=>e.id));Object.keys(a).forEach((a=>{const o=r.shapeExprs[a];i[a][0].tc.valueExpr=n.skipDecl(o);const u=s.indexOf(a);if(e.shapes[u].id!==a)throw Error("assertion: found "+e.shapes[u].id+" instead of "+a);t.push(u),delete r.shapeExprs[a]})),t.sort(((e,t)=>t-e)).forEach((t=>{const n=e.shapes[t].id;if(!a[n])throw Error("deleting unexpected shape "+n);delete e.shapes[t].id,e.shapes.splice(t,1)}))}}return a;function o(e,t){e in i||(i[e]=[]),t&&i[e].push(t)}},getPredicateUsage:function(e,t={}){const n=this;let r=s.create();Object.keys(e.shapes).forEach((t=>{let s=n.skipDecl(e.shapes[t]);"Shape"===s.type&&(s.extends||[]).forEach((e=>r.add(e.reference,t)))})),Object.keys(e.shapes).forEach((e=>{e in r.parents||(r.parents[e]=[])}));let i={};return Object.keys(e.shapes).forEach((s=>{let a=n.skipDecl(e.shapes[s]);if("Shape"===a.type){(n.simpleTripleConstraints(a)||[]).forEach((e=>{let a=n.getValueType(e.valueExpr);if(e.predicate in i){i[e.predicate].uses.push(s);let n=i[e.predicate].commonType;if("object"==typeof n||null===n)t[e.predicate].references.push({shapeLabel:s,newType:a});else if("object"==typeof a)i[e.predicate].commonType=null,t[e.predicate]={shapeLabel:s,predicate:e.predicate,curType:n,newType:a,references:[]};else if(n===a);else if(r.parents[n]&&-1!==r.parents[n].indexOf(a))i[e.predicate].polymorphic=!0;else{let o=r.parents[a]?r.parents[a].indexOf(n):-1;if(-1===o){let o=r.parents[n]?r.parents[n].filter((e=>-1!==r.parents[a].indexOf(e))):[];0===o.length?(t[e.predicate]={shapeLabel:s,predicate:e.predicate,curType:n,newType:a,references:[]},i[e.predicate].commonType=null):(i[e.predicate].commonType=o[0],i[e.predicate].polymorphic=!0)}else i[e.predicate].commonType=r.parents[a][o],i[e.predicate].polymorphic=!0}}else i[e.predicate]={uses:[s],commonType:a,polymorphic:!1},"object"==typeof a&&(t[e.predicate]={shapeLabel:s,predicate:e.predicate,newType:a,references:[]})}))}})),i},simpleTripleConstraints:function(e){if(!("expression"in e))return[];if("TripleConstraint"===e.expression.type)return[e.expression];if("EachOf"===e.expression.type&&!e.expression.expressions.find((e=>"TripleConstraint"!==e.type)))return e.expression.expressions;throw Error("can't (yet) express "+JSON.stringify(e))},skipDecl:function(e){return"ShapeDecl"===e.type?e.shapeExpr:e},getValueType:function(e){return"string"==typeof e?e:e.reference?e.reference:"iri"===e.nodeKind?u.Thing:e.datatype?e.datatype:e},getDependencies:function(e,t){return t=t||this.BiDiClosure(),(e.shapes||[]).forEach((function(e){function n(r,s){if("string"==typeof r)t.add(e.id,r);else if("ShapeOr"===r.type||"ShapeAnd"===r.type)r.shapeExprs.forEach((function(e){n(e,s)}));else if("ShapeNot"===r.type)n(r.shapeExpr,1^s);else if("Shape"===r.type)!function(r,s){function i(r,s){function a(e,t){e.forEach((function(e){i(e,t)}))}function o(r,s){if(r.valueExpr&&n(r.valueExpr,s),s&&-1!==t.inCycle.indexOf(e.id))throw Error("Structural error: "+e.id+" appears in negated cycle")}if("string"==typeof r)t.add(e.id,r);else if("id"in r&&t.addIn(r.id,e.id),"TripleConstraint"===r.type)o(r,s);else{if("OneOf"!==r.type&&"EachOf"!==r.type)throw Error("expected {TripleConstraint,OneOf,EachOf,Inclusion} in "+r);a(r.expressions)}}["extends","restricts"].forEach((n=>{r[n]&&r[n].length>0&&r[n].forEach((function(n){t.add(e.id,n)}))})),r.expression&&i(r.expression,s)}(r,s);else if("NodeConstraint"===r.type);else if("ShapeExternal"!==r.type)throw Error("expected Shape{And,Or,Ref,External} or NodeConstraint in "+JSON.stringify(r))}n(e.shapeExpr,0)})),t},partition:function(e,t,n,r){const s=e._index||this.index(e),i={shapeExprs:new Map,tripleExprs:new Map};t=t instanceof Array?t:[t],n=n||this.getDependencies(e),r=r||function(e,t){throw new Error("Error: can't find shape "+(t?t+" dependency "+e:e))};const a={};for(let t in e)a[t]="shapes"===t?[]:e[t];return t.forEach((function(e){if(e in i.shapeExprs);else if(e in s.shapeExprs){const t=s.shapeExprs[e];a.shapes.push(t),i.shapeExprs[t.id]=t,e in n.needs&&n.needs[e].forEach((function(t){if(t in n.foundIn&&(t=n.foundIn[t]),t in i.shapeExprs);else if(t in s.shapeExprs){const e=s.shapeExprs[t];a.shapes.push(e),i.shapeExprs[e.id]=e}else r(t,e)}))}else r(e,"supplied")})),a},flatten:function(e,t,n){return this.Visitor().visitSchema(e)},emptySchema:function(){return{type:"Schema"}},merge:function(e,t,n,r){const s=r?e:this.emptySchema();var i;"_base"in e&&(s._base=e._base),"_base"in t&&("_base"in e&&!n||(s._base=t._base)),i="_prefixes",Object.keys(e[i]||{}).forEach((function(t){i in s||(s[i]={}),s[i][t]=e[i][t]})),Object.keys(t[i]||{}).forEach((function(r){i in e&&r in e[i]&&!n||(i in s||(s[i]={}),s[i][r]=t[i][r])})),function(r){(e[r]||new Map).forEach((function(t,n,i){r in s||(s[r]=new Map),s[r].set(n,e[r].get(n))})),(t[r]||new Map).forEach((function(i,a,o){r in e&&e[r].has(a)&&!n||(r in s||(s[r]=new Map),s[r].set(a,t[r].get(a)))}))}("_sourceMap"),"imports"in t&&("imports"in e&&!n||(s.imports=t.imports)),"startActs"in e&&(s.startActs=e.startActs),"startActs"in t&&("startActs"in e&&!n||(s.startActs=t.startActs)),"start"in e&&(s.start=e.start),"start"in t&&("start"in e&&!n||(s.start=t.start));let a=e._index||this.index(e);return r||(e.shapes||[]).forEach((function(e){"shapes"in s||(s.shapes=[]),s.shapes.push(e)})),(t.shapes||[]).forEach((function(t){"shapes"in e&&t.id in a.shapeExprs&&!n||("shapes"in s||(s.shapes=[]),s.shapes.push(t))})),(e._index||t._index)&&(s._index=this.index(s)),s},absolutizeResults:function(e,n){function r(e,r){-1!==["shape","reference","node","subject","predicate","object"].indexOf(e)&&t.isIRI(r[e])&&(r[e]=t.resolveRelativeIRI(n,r[e]))}return function e(t){Object.keys(t).forEach((function(n){"object"==typeof t[n]&&e(t[n]),r&&r(n,t)}))}(e),e},getProofGraph:function(e,n,r){return function e(s){if("NodeConstraintTest"===s.type);else if("SolutionList"===s.type||"ShapeAndResults"===s.type||"ExtensionResults"===s.type)s.solutions.forEach((t=>{t.solution&&e(t.solution)}));else if("ShapeOrResults"===s.type)e(s.solution);else if("ShapeTest"===s.type)"solution"in s&&e(s.solution);else if("OneOfSolutions"===s.type||"EachOfSolutions"===s.type)s.solutions.forEach((t=>{e(t)}));else if("OneOfSolution"===s.type||"EachOfSolution"===s.type)s.expressions.forEach((t=>{e(t)}));else if("TripleConstraintSolutions"===s.type)s.solutions.map((s=>{if("TestedTriple"!==s.type)throw Error("unexpected result type: "+s.type);const i=s;"object"==typeof i.object&&(i.object='"'+i.object.value.replace(/"/g,'\\"')+'"'+(i.object.language?"@"+i.object.language:i.object.type?"^^"+i.object.type:"")),n.addQuad(t.externalTriple(i,r)),"referenced"in s&&e(s.referenced)}));else if("ExtendedResults"===s.type)e(s.extensions),"local"in s&&e(s.local);else if(-1===["ShapeNotResults","Recursion"].indexOf(s.type))throw Error("unexpected expr type "+s.type+" in "+JSON.stringify(s))}(e),n},validateSchema:function(e){const t=this.Visitor();let n=currentExtra=null,r=!1,i=!1;const a=t.visitShape,o=s.create(),u=s.create();let c=e.index||this.index(e);t.visitShape=function(e,n){const r=currentExtra;currentExtra=e.extra;const s=a.call(t,e,n);return currentExtra=r,s};const l=t.visitShapeNot;t.visitShapeNot=function(e,n){const s=r;r^=!0;const i=l.call(t,e,n);return r=s,i};const p=t.visitTripleConstraint;t.visitTripleConstraint=function(e){const n=r;currentExtra&&-1!==currentExtra.indexOf(e.predicate)&&(r^=!0),i=!0;const s=p.call(t,e);return i=!1,r=n,s};const f=t.visitShapeRef;t.visitShapeRef=function(e){if(!(e in c.shapeExprs))throw y(Error("Structural error: reference to "+JSON.stringify(e)+" not found in schema shape expressions:\n"+m(c.shapeExprs)+"."),e);if(!i&&e===n)throw y(Error("Structural error: circular reference to "+n+"."),e);return(r?o:u).add(n,e),f.call(t,e)};const h=t.visitInclusion;t.visitInclusion=function(e){let n;if(!(n=c.tripleExprs[e]))throw y(Error("Structural error: included shape "+e+" not found in schema triple expressions:\n"+m(c.tripleExprs)+"."),e);return h.call(t,e)},(e.shapes||[]).forEach((function(e){n=e.id,t.visitShapeDecl(e,e.id)}));let d=Object.keys(o.children).filter((e=>o.children[e].filter((t=>t in o.children&&-1!==o.children[t].indexOf(e)||t in u.children&&-1!==u.children[t].indexOf(e))).length>0));if(d.length)throw y(Error("Structural error: circular negative dependencies on "+d.join(",")+"."),d[0]);function m(e){return e?Object.keys(e).map((e=>"_:"===e.substr(0,2)?e:"<"+e+">")).join("\n "):"- none defined -"}function y(t,n){return"_sourceMap"in e&&(t.location=(e._sourceMap.get(n)||[void 0])[0]),t}},isWellDefined:function(e){return this.validateSchema(e),e},walkVal:function(e,t){const n=this;if("string"==typeof e)return null;if("SolutionList"===e.type)return e.solutions.reduce(((e,r)=>{const s=n.walkVal(r,t);return s&&Object.keys(s).forEach((t=>{e[t]=t in e?e[t].concat(s[t]):s[t]})),e}),{});if("NodeConstraintTest"===e.type)return n.walkVal(e.shapeExpr,t);if("NodeConstraint"===e.type)return null;if("ShapeTest"===e.type){const s=[];r(e,s);const i=s.length?{"http://shex.io/reflex":s}:{};return"solution"in e&&Object.assign(i,n.walkVal(e.solution,t)),Object.keys(i).length?i:null}if("Shape"===e.type)return null;if("ShapeNotTest"===e.type)return n.walkVal(e.shapeExpr,t);if("ShapeNotResults"===e.type)return n.walkVal(e.solution,t);if("Failure"===e.type)return null;if("ShapeNot"===e.type)return n.walkVal(e.shapeExpr,t);if("ShapeOrResults"===e.type)return n.walkVal(e.solution,t);if("ShapeOr"===e.type)return e.shapeExprs.reduce(((e,r)=>{const s=n.walkVal(r,t);return s&&Object.keys(s).forEach((t=>{e[t]=t in e?e[t].concat(s[t]):s[t]})),e}),{});if("ShapeAndResults"===e.type||"ExtensionResults"===e.type)return e.solutions.reduce(((e,r)=>{const s=n.walkVal(r,t);return s&&Object.keys(s).forEach((t=>{e[t]=t in e?e[t].concat(s[t]):s[t]})),e}),{});if("ShapeAnd"===e.type)return e.shapeExprs.reduce(((e,r)=>{const s=n.walkVal(r,t);return s&&Object.keys(s).forEach((t=>{e[t]=t in e?e[t].concat(s[t]):s[t]})),e}),{});if("ExtendedResults"===e.type)return["extensions","local"].reduce(((e,r)=>{const s=n.walkVal(r,t);return s&&Object.keys(s).forEach((t=>{e[t]=t in e?e[t].concat(s[t]):s[t]})),e}),{});if("EachOfSolutions"===e.type||"OneOfSolutions"===e.type)return e.solutions.reduce(((e,r)=>(r.expressions.forEach((r=>{const s=n.walkVal(r,t);s&&Object.keys(s).forEach((t=>{e[t]=t in e?e[t].concat(s[t]):s[t]}))})),e)),{});if("TripleConstraintSolutions"===e.type){if("solutions"in e){const t={},n=[];return t[e.predicate]=n,e.solutions.forEach((e=>r(e,n))),n.length?t:null}return null}if("Recursion"===e.type)return null;throw Error("unknown shapeExpression type in "+JSON.stringify(e));function r(e,r){const s=[];if(function e(s){if(!s)return!1;if(s.node===a.nil)return!0;if("solution"in s&&"solutions"in s.solution&&1===s.solution.solutions.length&&"expressions"in s.solution.solutions[0]&&2===s.solution.solutions[0].expressions.length&&"predicate"in s.solution.solutions[0].expressions[0]&&s.solution.solutions[0].expressions[0].predicate===a.first&&s.solution.solutions[0].expressions[1].predicate===a.rest){const i=s.solution.solutions[0].expressions,o=i[0],u=i[1].solutions[0],c=o.solutions[0];let l=t(c);if("referenced"in c){const e=n.walkVal(c.referenced,t);e&&(l?l.nested=e:l=e)}return l&&r.push(l),u.object===a.nil||e("ShapeOrResults"===u.referenced.type?u.referenced.solution:u.referenced)}}(e.referenced))[].push.apply(r,s);else{const s=t(e)||{};if("referenced"in e){const r=n.walkVal(e.referenced,t);r&&(s.nested=r)}Object.keys(s).length>0&&r.push(s)}}},valToValues:function(e){return this.walkVal(e,(function(e){return"object"in e?{ldterm:e.object}:null}))},valToExtension:function(e,t){return function e(n){const r=[];let s={};function i(e){if(null===s)return e;if(Array.isArray(e))return s=null,e;for(k in e){if(k in s)return s=null,e;s[k]=p(e[k])}return e}for(let s in n)if("extensions"===s)n[s]&&r.push(i(p(n[s][t])));else if("nested"===s){const t=e(n[s]);Array.isArray(t)?t.forEach(i):i(t),r.push(t)}else r.push(i(e(n[s])));return 1===r.length?r[0]:s||r}(this.walkVal(e,(function(e){return"extensions"in e?{extensions:e.extensions}:null})))},valuesToSchema:function(e){const t=e;if(e[a.type][0].ldterm===i.Schema){const n={"@context":"http://www.w3.org/ns/shex.jsonld",type:"Schema"};i.startActs in t&&(n.startActs=t[i.startActs].map((e=>{const t={type:"SemAct",name:e.nested[i.name][0].ldterm};return i.code in e.nested&&(t.code=e.nested[i.code][0].ldterm.value),t}))),i.imports in t&&(n.imports=t[i.imports].map((e=>e.ldterm))),e[i.start]&&(n.start=l({id:e[i.start][0].ldterm},r(e[i.start][0].nested)));const s=e[i.shapes];return s&&(n.shapes=s.map((e=>{var t=e.nested[a.type][0].ldterm;const n=t===i.ShapeExternal?{type:t}:Object.assign({},{type:i.ShapeDecl},i.abstract in e.nested?{abstract:!!e.nested[i.abstract]?.[0].ldterm.value}:{},{shapeExpr:r(e.nested[i.shapeExpr][0].nested)});return l({id:e.ldterm},n)}))),n}throw Error("unknown schema type in "+JSON.stringify(e));function n(e,t,n){const r=e[a.type][0].ldterm.substr(i._namespace.length),s=t[r];if(!s)return c;if(s.nary){const t={type:r};return t[s.prop]=e[i[s.prop]].map((e=>o(e))),t}{const t={type:r};return s.prop&&(t[s.prop]=o(e[i[s.prop]][0])),t}function o(e){return s.expr&&"nested"in e?l({id:e.ldterm},n(e.nested)):e.ldterm}}function r(e){let t=n(e,{ShapeAnd:{nary:!0,expr:!0,prop:"shapeExprs"},ShapeOr:{nary:!0,expr:!0,prop:"shapeExprs"},ShapeNot:{nary:!1,expr:!0,prop:"shapeExpr"},ShapeRef:{nary:!1,expr:!1,prop:"reference"},ShapeExternal:{nary:!1,expr:!1,prop:null}},r);if(t!==c)return t;const u=e[a.type][0].ldterm;if(u===i.ShapeDecl){const t={type:"ShapeDecl"};return["abstract"].forEach((n=>{i[n]in e&&(t[n]=!!e[i[n]][0].ldterm.value)})),i.shapeExpr in e&&(t.shapeExpr="nested"in e[i.shapeExpr][0]?l({id:e[i.shapeExpr][0].ldterm},r(e[i.shapeExpr][0].nested)):e[i.shapeExpr][0].ldterm),t}if(u===i.Shape)return t={type:"Shape"},["closed"].forEach((n=>{i[n]in e&&(t[n]=!!e[i[n]][0].ldterm.value)})),["extra","extends","restricts"].forEach((n=>{i[n]in e&&(t[n]=e[i[n]].map((e=>e.ldterm)))})),i.expression in e&&(t.expression="nested"in e[i.expression][0]?l({id:e[i.expression][0].ldterm},o(e[i.expression][0].nested)):e[i.expression][0].ldterm),i.annotation in e&&(t.annotations=e[i.annotation].map((e=>({type:"Annotation",predicate:e.nested[i.predicate][0].ldterm,object:e.nested[i.object][0].ldterm})))),i.semActs in e&&(t.semActs=e[i.semActs].map((e=>{const t={type:"SemAct",name:e.nested[i.name][0].ldterm};return i.code in e.nested&&(t.code=e.nested[i.code][0].ldterm.value),t}))),t;if(u===i.NodeConstraint){const t={type:"NodeConstraint"};return i.values in e&&(t.values=e[i.values].map((e=>s(e)))),i.nodeKind in e&&(t.nodeKind=e[i.nodeKind][0].ldterm.substr(i._namespace.length)),["length","minlength","maxlength","mininclusive","maxinclusive","minexclusive","maxexclusive","totaldigits","fractiondigits"].forEach((n=>{i[n]in e&&(t[n]=parseFloat(e[i[n]][0].ldterm.value))})),i.pattern in e&&(t.pattern=e[i.pattern][0].ldterm.value),i.flags in e&&(t.flags=e[i.flags][0].ldterm.value),i.datatype in e&&(t.datatype=e[i.datatype][0].ldterm),t}throw Error("unknown shapeExpr type in "+JSON.stringify(e))}function s(e,t){if("nested"in e){const t=e.nested[a.type][0].ldterm;if(-1!==[i.IriStem,i.LiteralStem,i.LanguageStem].indexOf(t)){const n=e.nested[i.stem][0].ldterm.value;return{type:t.substr(i._namespace.length),stem:n}}if(-1!==[i.Language].indexOf(t))return{type:"Language",languageTag:e.nested[i.languageTag][0].ldterm.value};if(-1!==[i.IriStemRange,i.LiteralStemRange,i.LanguageStemRange].indexOf(t)){const n=e.nested[i.stem][0];let r=n;"object"==typeof n&&("object"==typeof n.ldterm?r=n.ldterm:n.ldterm.startsWith("_:")&&(r={type:"Wildcard"}));const a={type:t.substr(i._namespace.length),stem:"Wildcard"!==r.type?r.value:r};return i.exclusion in e.nested&&(a.exclusions=e.nested[i.exclusion].map((e=>s(e,t!==i.IriStemRange)))),a}throw Error("unknown objectValue type in "+JSON.stringify(e))}return t?e.ldterm.value:e.ldterm}function o(e){const t=n(e,{EachOf:{nary:!0,expr:!0,prop:"expressions"},OneOf:{nary:!0,expr:!0,prop:"expressions"},Inclusion:{nary:!1,expr:!1,prop:"include"}},o);if(t!==c)return u(e,t),t;if(e[a.type][0].ldterm===i.TripleConstraint){const t={type:"TripleConstraint",predicate:e[i.predicate][0].ldterm};return["inverse"].forEach((n=>{i[n]in e&&(t[n]=!!e[i[n]][0].ldterm.value)})),i.valueExpr in e&&(t.valueExpr=l({id:e[i.valueExpr][0].ldterm},"nested"in e[i.valueExpr][0]?r(e[i.valueExpr][0].nested):{})),u(e,t),t}throw Error("unknown tripleExpr type in "+JSON.stringify(e))}function u(e,t){return i.min in e&&(t.min=parseInt(e[i.min][0].ldterm.value)),i.max in e&&(t.max=parseInt(e[i.max][0].ldterm.value),isNaN(t.max)&&(t.max=-1)),i.annotation in e&&(t.annotations=e[i.annotation].map((e=>({type:"Annotation",predicate:e.nested[i.predicate][0].ldterm,object:e.nested[i.object][0].ldterm})))),i.semActs in e&&(t.semActs=e[i.semActs].map((e=>{const t={type:"SemAct",name:e.nested[i.name][0].ldterm};return i.code in e.nested&&(t.code=e.nested[i.code][0].ldterm.value),t}))),t}},simpleToShapeMap:function(e){return Object.keys(e).reduce(((t,n)=>(e[n].forEach((e=>{t.push({node:n,shape:e})})),t)),[])},absolutizeShapeMap:function(e,n){return e.map((e=>Object.assign(e,{node:t.resolveRelativeIRI(n,e.node),shape:t.resolveRelativeIRI(n,e.shape)})))},errsToSimple:function(t){const n=this;if("FailureList"===t.type)return t.errors.reduce(((e,t)=>e.concat(n.errsToSimple(t))),[]);if("Failure"===t.type)return["validating "+t.node+" as "+t.shape+":"].concat(function e(t){return t.reduce((function(t,n){const r=Object.keys(n);return t.concat(1===r.length&&"errors"===r[0]?e(n.errors):n)}),[])}(t.errors).reduce(((e,t)=>{const r=n.errsToSimple(t).map((e=>" "+e));return e.length>0?e.concat([" OR"]).concat(r):r.map((e=>" "+e))}),[]));if("TypeMismatch"===t.type){const r=Array.isArray(t.errors)?t.errors.reduce(((e,t)=>e.concat(("string"==typeof t?[t]:n.errsToSimple(t)).map((e=>" "+e)))),[]):" "+("string"==typeof e?[t.errors]:n.errsToSimple(t.errors));return["validating "+h(t.triple.object)+":"].concat(r)}if("RestrictionError"===t.type){var s=t.errors.constructor===Array?t.errors.reduce(((e,t)=>e.concat(("string"==typeof t?[t]:n.errsToSimple(t)).map((e=>" "+e)))),[]):" "+("string"==typeof e?[t.errors]:n.errsToSimple(t.errors));return["validating restrictions on "+h(t.focus)+":"].concat(s)}if("ShapeAndFailure"===t.type)return Array.isArray(t.errors)?t.errors.reduce(((e,t)=>e.concat(("string"==typeof t?[t]:n.errsToSimple(t)).map((e=>" "+e)))),[]):" "+("string"==typeof e?[t.errors]:n.errsToSimple(t.errors));if("ShapeOrFailure"===t.type)return Array.isArray(t.errors)?t.errors.reduce(((e,t)=>e.concat(" OR "+("string"==typeof t?[t]:n.errsToSimple(t)))),[]):" OR "+("string"==typeof e?[t.errors]:n.errsToSimple(t.errors));if("ShapeNotFailure"===t.type)return["Node "+t.errors.node+" expected to NOT pass "+t.errors.shape];if("ExcessTripleViolation"===t.type)return["validating "+h(t.triple.object)+": exceeds cardinality"];if("ClosedShapeViolation"===t.type)return["Unexpected triple(s): {"].concat(t.unexpectedTriples.map((e=>" "+e.subject+" "+e.predicate+" "+h(e.object)+" ."))).concat(["}"]);if("NodeConstraintViolation"===t.type){const e=r(95)();let n;return e._write(e._writeNodeConstraint(t.shapeExpr).join("")),e.end(((e,t)=>{n=t})),["NodeConstraintError: expected to match "+n]}if("MissingProperty"===t.type)return["Missing property: "+t.property];if("NegatedProperty"===t.type)return["Unexpected property: "+t.property];if("AbstractShapeFailure"===t.type)return["Abstract Shape: "+t.shape];if(Array.isArray(t))return t.reduce(((e,t)=>{const r=n.errsToSimple(t).map((e=>" "+e));return e.length?e.concat(["AND"]).concat(r):r}),[]);if("SemActFailure"===t.type){const r=Array.isArray(t.errors)?t.errors.reduce(((e,t)=>e.concat(("string"==typeof t?[t]:n.errsToSimple(t)).map((e=>" "+e)))),[]):" "+("string"==typeof e?[t.errors]:n.errsToSimple(t.errors));return["rejected by semantic action:"].concat(r)}if("SemActViolation"===t.type)return[t.message];if("BooleanSemActFailure"===t.type)return["Failed evaluating "+t.code+" on context "+JSON.stringify(t.ctx)];throw Error('unknown shapeExpression type "'+t.type+'" in '+JSON.stringify(t))},resolveRelativeIRI:t.resolveRelativeIRI,resolvePrefixedIRI:function(e,t){const n=e.indexOf(":");if(-1===n)return null;const r=t[e.substr(0,n)];return void 0===r?null:r+e.substr(n+1)},parsePassedNode:function(e,n,r,s,i){if(void 0===e||0===e.length)return s&&s(n.base)?n.base:r?r():this.NotSupplied;if("_"===e[0]&&":"===e[1])return e;if('"'===e[0]){const r=e.match(/^"((?:[^"\\]|\\")*)"(?:@(.+)|\^\^(?:<(.*)>|([^:]*):(.*)))?$/);if(!r)throw Error("malformed literal: "+e);const s=r[1],i=r[2],a=r[3],o=r[4],u=r[5],c='"'+s+'"';if(void 0!==i)return c+"@"+i;if(void 0!==o){if(!(o in n.prefixes))throw Error("error parsing node "+e+' no prefix for "'+o+'"');return c+"^^"+n.prefixes[o]+u}return void 0!==a?c+"^^"+t.resolveRelativeIRI(n.base,a):c}if(!n)return s(e)?e:this.UnknownIRI;const a="<"===e[0]&&">"===e[e.length-1];a&&(e=e.substr(1,e.length-2));const o=t.resolveRelativeIRI(n.base||"",e);if(s(o))return o;if(!a){const t=this.resolvePrefixedIRI(e,n.prefixes);if(null!==t&&s(t))return t}return i?i(o):this.UnknownIRI},executeQueryPromise:function(e,t){const n=t+"?query="+encodeURIComponent(e);return fetch(n,{headers:{Accept:"application/sparql-results+json"}}).then((e=>e.json())).then((e=>this.parseSparqlJsonResults(e)))},executeQuery:function(e,t){const n=t+"?query="+encodeURIComponent(e),r=new XMLHttpRequest;r.open("GET",n,!1),r.setRequestHeader("Accept","application/sparql-results+json"),r.send();const s=JSON.parse(r.responseText);return this.parseSparqlJsonResults(s)},parseSparqlJsonResults:function(e){const t=e.head.vars;return e.results.bindings.map((e=>t.map((t=>{const n=e[t];switch(n.type){case"uri":return n.value;case"bnode":return"_:"+n.value;case"literal":return'"'+n.value.replace(/"/g,'\\""')+'"'+("xml:lang"in n?"@"+n["xml:lang"]:"")+("datatype"in n?"^^"+n.datatype:"");case"typed-literal":return'"'+n.value.replace(/"/g,'\\""')+'"^^'+n.datatype;default:throw"unknown XML results type: "+n.type}}))))},rdfjsDB:function(e,n){return{getNeighborhood:function(r,s){let i;n&&(i=new Date,n.start(!1,r,s));const a=e.getQuads(r,null,null,null).map(t.internalTriple);if(n){const e=new Date;n.end(a,e.valueOf()-i.valueOf()),i=e}n&&n.start(!0,r,s);const o=e.getQuads(null,null,r,null).map(t.internalTriple);return n&&n.end(o,(new Date).valueOf()-i.valueOf()),{outgoing:a,incoming:o}},getSubjects:function(){return e.getSubjects().map(t.internalTerm)},getPredicates:function(){return e.getPredicates().map(t.internalTerm)},getObjects:function(){return e.getObjects().map(t.internalTerm)},getQuads:function(){return e.getQuads.apply(e,arguments).map(t.internalTriple)},get size(){return e.size}}},makeTriplesDB:function(e){var t=[],n=[];return{getNeighborhood:function(e,r,s){return{outgoing:n,incoming:t}},getTriplesByIRI:function(e,r,s,i){return t.concat(n).filter((t=>!(e&&e!==t.subject||r&&r!==t.predicate||e&&e!==t.object)))},getSubjects:function(){return["!Triples DB can't index subjects"]},getPredicates:function(){return["!Triples DB can't index predicates"]},getObjects:function(){return["!Triples DB can't index objects"]},get size(){},addIncomingTriples:function(e){Array.prototype.push.apply(t,e)},addOutgoingTriples:function(e){Array.prototype.push.apply(n,e)}}},NotSupplied:"-- not supplied --",UnknownIRI:"-- not found --",unescapeText:function(e,t){const n=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\(.)/g;try{return e=e.replace(n,(function(e,n,r,s){let i;if(n){if(i=parseInt(n,16),isNaN(i))throw new Error;return String.fromCharCode(i)}if(r){if(i=parseInt(r,16),isNaN(i))throw new Error;return i<65535?String.fromCharCode(i):String.fromCharCode(55296+((i-=65536)>>10),56320+(1023&i))}{const e=t[s];if(!e)throw new Error("no replacement found for '"+s+"'");return e}}))}catch(e){return console.warn(e),""}}};function h(e){if("object"!=typeof e)return e;const t='"'+e.value+'"';return"language"in e?t+"@"+e.language:"type"in e?t+"^^"+e.type:t}function d(e,t){for(let n in f)t?e.prototype[n]=m(f[n]):e[n]=f[n];return e}function m(e){return function(t){return e(this,t)}}return d(d)}();t.exports=s},457:(e,t,n)=>{const r=function(){const e={term:"START"},t=n(118);let r=n(806),s=n(443);const i=n(515);function a(e){return t.isIRI(e)?e:t.isLiteral(e)?t.getLiteralValue(e):e.substr(2)}const o="http://www.w3.org/2001/XMLSchema#",u=[o+"integer",o+"nonPositiveInteger",o+"negativeInteger",o+"long",o+"int",o+"short",o+"byte",o+"nonNegativeInteger",o+"unsignedLong",o+"unsignedInt",o+"unsignedShort",o+"unsignedByte",o+"positiveInteger"],c=[o+"decimal"].concat(u),l=[o+"float",o+"double"].concat(c),p={"http://www.w3.org/2001/XMLSchema#integer":function(e,t){return e.match(/^[+-]?[0-9]+$/)||t("illegal integer value '"+e+"'"),parseInt(e)},"http://www.w3.org/2001/XMLSchema#decimal":function(e,t){return e.match(/^[+-]?(?:[0-9]*\.[0-9]+|[0-9]+)$/)||t("illegal decimal value '"+e+"'"),parseFloat(e)}},f=/^[+\-]?(?:[0-9]+(?:\.[0-9]*)?|\.[0-9]+)(?:[eE][+\-]?[0-9]+)?$/;p[o+"float"]=function(e,t){return"NaN"===e?NaN:"INF"===e?1/0:"-INF"===e?-1/0:(e.match(f)||t("illegal float value '"+e+"'"),parseFloat(e))},p[o+"double"]=function(e,t){return"NaN"===e?NaN:"INF"===e?1/0:"-INF"===e?-1/0:(e.match(f)||t("illegal double value '"+e+"'"),Number(e))};const h={length:function(e,t){return e.length===t},minlength:function(e,t){return e.length>=t},maxlength:function(e,t){return e.length<=t}},d={mininclusive:function(e,t){return e>=t},minexclusive:function(e,t){return e>t},maxinclusive:function(e,t){return e<=t},maxexclusive:function(e,t){return e!1===e?e:-1!==["value","type","language"].indexOf(t)),!0)}function g(e){return{byPredicate:e.reduce((function(e,t){const n=t.predicate;return n in e||(e[n]=[]),e[n].push(t),e}),{}),candidates:E(e.length).map((function(){return[]})),misses:[]}}function _(e,n){const[r,s]=[e,n].map((e=>t.isBlank(e)?1:t.isLiteral(e)?2:3));return r===s?e.localeCompare(n):r-s}function E(e){return Array.from(Array(e))}function b(e,t,n){t in e||v("expected "+JSON.stringify(e)+" to have a '"+t+"' attribute."),arguments.length>2&&e[t]!==n&&v("expected "+t+" attribute '"+e[t]+"' to equal '"+n+"'.")}function S(){}function v(){const e=Array.prototype.join.call(arguments,""),t=new Error(e);throw Error.captureStackTrace(t,v),t}function A(e){return E(e).map((()=>[]))}return{construct:function c(f,O,w){if(!(this instanceof c))return new c(f,O,w);let T=f._index||r.index(f);this.type="ShExValidator",w=w||{},this.options=w,this.options.coverage=this.options.coverage||"exhaustive","noCache"in w&&w.noCache||(this.known={});const I=this;this.schema=f,this._expect=this.options.lax?S:b,this._optimize={},this.reset=function(){};const N=this.options.regexModule||n(863);function k(e,t,n,r,s){const i=g(t.slice(0,n)),a=g(t.slice(n));return e.reduce((function(e,n,r){n.inverse,n.inverse;const o=(n.inverse?a:i).byPredicate[n.predicate]||[],u=I._triplesMatchingShapeExpr(o,n,s);return u.hits.forEach((function(n){const s=t.indexOf(n.triple);e.constraintList[s].push(r),e.results[r][s]=n.sub})),u.misses.forEach((function(n){const s=t.indexOf(n.triple);e.misses[s]={constraintNo:r,errors:n.errors}})),e}),{misses:{},results:A(e.length),constraintList:A(t.length)})}function F(e,t,n){return e.slice().reduce((function(e,t,r){return"NO_TRIPLE_CONSTRAINT"!==t&&e[t].push({tNo:r,res:n.results[t][r]}),e}),E(t.length).map((()=>[])))}function L(e,t,n,r){if(!("extends"in e))return null;const i=[],a=[];for(let o=0;oc.addOutgoingTriples([e])));const l=I.validate(t,u,r.tracker,r.seen,c);"errors"in l?a.push(l):i.push(l)}return a.length>0?{type:"ExtensionFailure",errors:a}:{type:"ExtensionResults",solutions:i}}function R(e){const t=[];return"extends"in e&&e.extends.forEach(((e,r)=>{const s={},i={};n(e,s,i),[s,i].forEach((e=>{Object.keys(e).forEach((n=>{let s=e[n];t.push({tripleConstraint:s,extendsNo:r})}))}))})),t;function n(e,t,r){const i=s.Visitor();let a=1,o=1;const u=i.visitOneOf;i.visitShapeRef=function(e){return i.visitShapeDecl(I._lookupShape(e))},i.visitShape=function(e,s){return"extends"in e&&e.extends.forEach((e=>n(e,t,r))),"expression"in e&&i.visitExpression(e.expression),{type:"Shape"}},i.visitOneOf=function(e){const t=a,n=o;a=0,u.call(i,e),a=t,o=n},i.visitTripleConstraint=function(e){const n=e.inverse?t:r;let s="min"in e?e.min:1;s*=a;let i="max"in e?e.max:1;return i*=o,n[e.predicate]={type:"TripleConstraint",predicate:e.predicate,min:e.predicate in n?Math.max(n[e.predicate].min,s):s,max:e.predicate in n?Math.min(n[e.predicate].max,i):i,seen:e.predicate in n?n[e.predicate].seen+1:1,tcs:e.predicate in n?n[e.predicate].tcs.concat([e]):[e]},e},i.visitShapeExpr(e)}}this.indexTripleConstraints=function(e){const t=[];return e&&function e(n){return"string"==typeof n?e(T.tripleExprs[n]):"TripleConstraint"===n.type?(t.push(n),[t.length-1]):"OneOf"===n.type||"EachOf"===n.type?n.expressions.reduce((function(t,n){return t.concat(e(n))}),[]):v("unexpected expr type: "+n.type)}(e),t},this.emptyTracker=function(){const e=e=>e;return{recurse:e,known:e,enter:function(e,t){++this.depth},exit:function(e,t,n){--this.depth},depth:0}},this.validate=function(n,r,s,i,a){if("object"==typeof n&&"termType"in n&&(n=t.internalTerm(n)),"object"==typeof n){const e=n;if("api"===this.options.results)return e.map((e=>{let t=new Date;const n=this.validate(e.node,e.shape,r,s);return t=new Date-t,{node:e.node,shape:e.shape,status:"errors"in n?"nonconformant":"conformant",appinfo:n,elapsed:t}}));const t=e.reduce(((e,t)=>{const n=this.validate(t.node,t.shape,r,s,a);return"errors"in n?{passes:e.passes,failures:e.failures.concat(n)}:{passes:e.passes.concat(n),failures:e.failures}}),{passes:[],failures:[]});return t.failures.length>0?1!==t.failures.length?{type:"FailureList",errors:t.failures}:t.failures[0]:1!==t.passes.length?{type:"SolutionList",solutions:t.passes}:t.passes[0]}const o=void 0===s;s||(s=this.emptyTracker()),r&&r!==e||f.start||v("start production not defined");let u=null;if(u=r==e?f.start:this._lookupShape(r),"string"!=typeof r)return this._validateShapeDecl(n,u,e,0,s,i);void 0===i&&(i={});const c=n+"@"+(r===e?"_: -start-":r);if(!a){if(c in i)return s.recurse({type:"Recursion",node:y(n),shape:r});if("known"in this&&c in this.known)return s.known(this.known[c]);i[c]={point:n,shape:r},s.enter(n,r)}const l=this._validateDescendants(n,r,0,s,i,a);return a||(s.exit(n,r,l),delete i[c],"known"in this&&(this.known[c]=l)),"startActs"in f&&o&&(l.startActs=f.startActs),l},this._validateDescendants=function(e,t,n,r,a,o,u){if(o)return this._validateShapeDecl(e,this._lookupShape(t),t,0,r,a,o);let c=[t];c=c.concat(function(e){const t={},n=i.create();return function(e){const r=s.Visitor();let i,a;const o=r.visitShapeDecl;r.visitShapeDecl=function(e){return i=e.id,a=e.abstract,t[e.id]=e.abstract,o.call(r,e,e.id)};r.visitShape;return r.visitShape=function(e){return"extends"in e&&e.extends.forEach((e=>{const t=s.Visitor();t.visitShapeRef=function(e){return n.add(e,i),"null"},t.visitShapeExpr(e)})),"null"},r}().visitSchema(e),n.children}(this.schema)[t]||[]);for(let e=c.length-1;e>=0;--e)c.indexOf(c[e])!this._lookupShape(e).abstract)));const l=c.reduce(((t,n)=>{const s=this._lookupShape(n),i=this._validateShapeDecl(e,s,n,0,r,a,o);return"errors"in i?{passes:t.passes,failures:t.failures.concat(i)}:{passes:t.passes.concat(i),failures:t.failures}}),{passes:[],failures:[]});let p;return p=l.passes.length>0?1!==l.passes.length?{type:"SolutionList",solutions:l.passes}:l.passes[0]:l.failures.length>0?1!==l.failures.length?{type:"FailureList",errors:l.failures}:l.failures[0]:{type:"AbstractShapeFailure",shape:t,errors:t+" has no non-abstract children"},p},this._validateShapeDecl=function(e,t,n,r,s,i,a){const o="ShapeDecl"===t.type?t.shapeExpr:t;return this._validateShapeExpr(e,o,n,r,s,i,a)},this._lookupShape=function(e){if("shapes"in this.schema&&0!==this.schema.shapes.length){if(e in T.shapeExprs)return T.shapeExprs[e];v("shape "+e+" not found in:\n"+Object.keys(T.shapeExprs||[]).map((e=>" "+e)).join("\n"))}else v("shape "+e+" not found; no shapes in schema")},this._validateShapeExpr=function(e,t,n,r,s,i,a){if(""===e)throw Error("validation needs a valid focus node");let o=null;if("string"==typeof t)o=this._validateDescendants(e,t,r,s,i,a,!0);else if("NodeConstraint"===t.type){const r=this._errorsMatchingNodeConstraint(e,t,null);o=r.errors&&r.errors.length?{type:"Failure",node:y(e),shape:n,errors:r.errors.map((function(e){return{type:"NodeConstraintViolation",shapeExpr:t,error:e}}))}:{type:"NodeConstraintTest",node:y(e),shape:n,shapeExpr:t}}else if("Shape"===t.type)o=this._validateShape(e,t,n,r,s,i,a);else if("ShapeExternal"===t.type)o=this.options.validateExtern(e,n,s,i);else if("ShapeOr"===t.type){const u=[];for(let o=0;o0?{type:"ShapeAndFailure",errors:c}:{type:"ShapeAndResults",solutions:u}}}if("string"!=typeof t&&"Shape"!==t.type&&!("errors"in o)&&"semActs"in t){const r=this.semActHandler.dispatchAll(t.semActs,Object.assign({node:e},o),o);if(r.length)return{type:"Failure",node:y(e),shape:n,errors:r}}return o},this._validateShape=function(e,t,n,r,s,i,a){const o={db:O,shapeLabel:n,depth:r,tracker:s,seen:i};let u=null;const c={};if("startActs"in f){const t=this.semActHandler.dispatchAll(f.startActs,null,c);if(t.length)return{type:"Failure",node:y(e),shape:n,errors:t}}const l=(a||O).getNeighborhood(e,n,t),p=l.outgoing.length,h=l.outgoing.sort(((e,t)=>e.predicate.localeCompare(t.predicate)||_(e.object,t.object))).concat(l.incoming.sort(((e,t)=>e.predicate.localeCompare(t.predicate)||_(e.object,t.object)))),d=this.indexTripleConstraints(t.expression),m=R(t),x=m.map((e=>e.tripleConstraint)).concat(d),g=k(x,h,p,e,o),{misses:b,extras:S}=function(e,t,n,r){const s=[],i=e.constraintList.reduce((function(i,a,o){return 0===a.length&&o0?e[i][0]:t}function a(){if(null!==s&&0===s.length)return!1;if(null===s)return i(),!0;let a=n-1;if(r[a]++,r[a]=e[a].length;){if(0==a)return!1;r[a]=0,s[a]=e[a].length>0?e[a][0]:t,r[--a]++}return s[a]=e[a][r[a]],!0}return{next:a,do:function(e,t){return e.apply(t,s)},get:function(){return s}}}(g.constraintList,"NO_TRIPLE_CONSTRAINT"),A=[],w=N.compile(f,t,T);for(;v.next()&&null===u;){const r=[],s=[],i=E(h.length).map((function(){return 0})),a=v.get(),c=[],l=[],f=E((t.extends||[]).length).map((()=>[]));if(a.forEach(((e,t)=>{if("NO_TRIPLE_CONSTRAINT"!==e&&e"NO_TRIPLE_CONSTRAINT"===c[t]&&"NO_EXTENDS"===l[t]&&-1===S.indexOf(t)));e.length>0&&r.push({type:"ClosedShapeViolation",unexpectedTriples:e})}c.forEach((function(e,t){"NO_TRIPLE_CONSTRAINT"!==e&&(s.push(h[t]),++i[e])}));const d=F(c,x,g);let _=L(t,e,f,o);if(null===_||!("errors"in _)){const t=w.match(O,e,x,d,c,h,this.semActHandler,null);!("errors"in t)&&_?(_={type:"ExtendedResults",extensions:_},Object.keys(t).length>0&&(_.local=t)):_=t}"errors"in _&&[].push.apply(r,_.errors);const b={type:"ShapeTest",node:y(e),shape:n};if(0===r.length&&Object.keys(_).length>0&&(b.solution=_),"semActs"in t){const n=this.semActHandler.dispatchAll(t.semActs,Object.assign({node:e},_),b);n.length&&[].push.apply(r,n)}A.push(r),0===r.length&&(u=b)}const I=b.map((function(e){const t=h[e.tripleNo];return{type:"TypeMismatch",triple:{type:"TestedTriple",subject:t.subject,predicate:t.predicate,object:y(t.object)},constraint:x[e.constraintNo],errors:e.errors}})),j=A[A.length-1];let C=I.concat(1===j.length?j[0]:j);return C.length>0&&(u={type:"Failure",node:y(e),shape:n,errors:C}),function(e,t){"annotations"in e&&(t.annotations=e.annotations);return t}(t,u)},this._triplesMatchingShapeExpr=function(e,t,n){const r=this,s=[],i=[];return e.forEach((function(e){const a=t.inverse?e.subject:e.object;let o;const u=JSON.parse(JSON.stringify(r.semActHandler.results));(void 0===t.valueExpr?void 0:(o=r._errorsMatchingShapeExpr(a,t.valueExpr,n)).errors)?-1===i.indexOf(e)&&(r.semActHandler.results=JSON.parse(JSON.stringify(u)),s.push({triple:e,errors:o})):i.push({triple:e,sub:o})})),{hits:i,misses:s}},this._errorsMatchingShapeExpr=function(e,t,n,r){const s=this;if("string"==typeof t)return s.validate(e,t,n.tracker,n.seen,r);if("NodeConstraint"===t.type)return this._errorsMatchingNodeConstraint(e,t,null);if("Shape"===t.type)return s._validateShapeExpr(e,t,n.shapeLabel,n.depth,n.tracker,n.seen,r);if("ShapeOr"===t.type){const i=[];for(let a=0;a is less than the min:",r.min):e>r.max&&n('"'+e+'"^^<'+t+"> is greater than the max:",r.min)}(p[f](i,g),n.datatype,g):n.datatype===o+"boolean"?"true"!==i&&"false"!==i&&"1"!==i&&"0"!==i&&g("illegal boolean value: "+i):n.datatype===o+"dateTime"&&(i.match(/^[+-]?\d{4}-[01]\d-[0-3]\dT[0-5]\d:[0-5]\d:[0-5]\d(\.\d+)?([+-][0-2]\d:[0-5]\d|Z)?$/)||g("illegal dateTime value: "+i)):g("mismatched datatype: "+e+" is not a literal with datatype "+n.datatype)),n.values&&(t.isLiteral(e)&&n.values.reduce(((t,n)=>{if(t)return!0;const r=y(e);return"Language"===n.type?n.languageTag===r.language:"object"==typeof n&&"value"in n&&(n.value===r.value&&n.type===r.type&&n.language===r.language)}),!1)||-1!==n.values.indexOf(e)||n.values.some((function(n){if("object"==typeof n&&!("value"in n)){"type"in n||v("expected "+JSON.stringify(n)+" to have a 'type' attribute.");const i=["Language","IriStem","LiteralStem","LanguageStem","IriStemRange","LiteralStemRange","LanguageStemRange"];function r(e,r,s){return t.isLiteral(e)?-1!==["LiteralStem","LiteralStemRange"].indexOf(n.type)?s(t.getLiteralValue(e),r):-1!==["LanguageStem","LanguageStemRange"].indexOf(n.type)?s(t.getLiteralLanguage(e)||null,r):g("literal "+e+" not comparable with non-literal "+r):-1===["IriStem","IriStemRange"].indexOf(n.type)?g("nonliteral "+e+" not comparable with literal "+JSON.stringify(r)):s(e,r)}function s(e,t){return r(e,t,((e,t)=>"LanguageStem"===n.type||"LanguageStemRange"===n.type?null!==e&&(e===t||""===t||"-"===e[t.length]):e.startsWith(t)))}if(-1===i.indexOf(n.type)&&v("expected type attribute '"+n.type+"' to be in '"+i+"'."),x(n.stem)){if(!s(e,n.stem))return!1}else b(n.stem,"type","Wildcard");return!n.exclusions||!n.exclusions.some((function(t){if(x(t))return r(e,t,((e,t)=>e===t));{"type"in t||v("expected "+JSON.stringify(t)+" to have a 'type' attribute.");const n=["IriStem","LiteralStem","LanguageStem"];return-1===n.indexOf(t.type)&&v("expected type attribute '"+t.type+"' to be in '"+n+"'."),s(e,t.stem)}}))}}))||g("value "+e+" not found in set "+JSON.stringify(n.values))),"pattern"in n){const t="flags"in n?new RegExp(n.pattern,n.flags):new RegExp(n.pattern);a(e).match(t)||g("value "+a(e)+" did not match pattern "+n.pattern)}Object.keys(h).forEach((function(t){t in n&&!h[t](i,n[t])&&g("facet violation: expected "+t+" of "+n[t]+" but got "+e)})),Object.keys(d).forEach((function(t){t in n&&(f?d[t](p[f](i,g),n[t])||g("facet violation: expected "+t+" of "+n[t]+" but got "+e):g("facet violation: numeric facet "+t+" can't apply to "+e))})),Object.keys(m).forEach((function(t){t in n&&(f===o+"integer"||f===o+"decimal"?m[t](""+p[f](i,g),n[t])||g("facet violation: expected "+t+" of "+n[t]+" but got "+e):g("facet violation: numeric facet "+t+" can't apply to "+e))}));const _={type:null,focus:e,shapeExpr:n};return s.length?(_.type="NodeConstraintViolation",_.errors=s):_.type="NodeConstraintTest",_},this.semActHandler={handlers:{},results:{},register:function(e,t){this.handlers[e]=t},dispatchAll:function(e,t,n){const r=this;return e.reduce((function(e,s){if(0===e.length&&s.name in r.handlers){const i="code"in s?s.code:I.options.semActs[s.name],a="extensions"in n&&s.name in n.extensions,o=a?n.extensions[s.name]:{},u=r.handlers[s.name].dispatch(i,t,o);if("boolean"==typeof u)u||e.push({type:"SemActFailure",errors:[{type:"BooleanSemActFailure",code:i,ctx:t}]});else{if("object"!=typeof u||!Array.isArray(u))throw Error("unsupported response from semantic action handler: "+JSON.stringify(u));u.length>0&&e.push({type:"SemActFailure",errors:u})}return!a&&Object.keys(o).length>0&&("extensions"in n||(n.extensions={}),n.extensions[s.name]=o),e}return e}),[])}}},start:e,options:{coverage:{firstError:"fail on first error (usually used with eval-simple-1err)",exhaustive:"find as many errors as possible (usually used with eval-threaded-nerr)"}}}}();e.exports=r},806:e=>{function t(){function e(e){return"object"!=typeof e||"value"in e&&Object.keys(e).reduce(((e,t)=>!1===e?e:-1!==["value","type","language"].indexOf(t)),!0)}function t(e){return"string"==typeof e}const n={runtimeError:function(e){throw e},visitSchema:function(e){const t={type:"Schema"};return this._expect(e,"type","Schema"),this._maybeSet(e,t,"Schema",["@context","prefixes","base","imports","startActs","start","shapes"],["_base","_prefixes","_index","_sourceMap"]),t},visitPrefixes:function(e){return void 0===e?void 0:function(e,t){const n={};return Object.keys(e).forEach((function(r){n[r]=t(e[r])})),n}(e,(function(e){return e}))},visitIRI:function(e){return e},visitImports:function(e){const t=this;return e.map((function(e){return t.visitIRI(e)}))},visitStartActs:function(e){const t=this;return void 0===e?void 0:e.map((function(e){return t.visitSemAct(e)}))},visitSemActs:function(e){const t=this;if(void 0===e)return;const n=[];return Object.keys(e).forEach((function(r){n.push(t.visitSemAct(e[r],r))})),n},visitSemAct:function(e,t){const n={type:"SemAct"};return this._expect(e,"type","SemAct"),this._maybeSet(e,n,"SemAct",["name","code"]),n},visitShapes:function(e){const t=this;if(void 0!==e)return e.map((e=>t.visitShapeDecl(e)))},visitProductions999:function(e){const t=this;if(void 0===e)return;const n={};return Object.keys(e).forEach((function(r){n[r]=t.visitExpression(e[r],r)})),n},visitShapeDecl:function(e,t){return"ShapeDecl"===e.type?this._maybeSet(e,{type:"ShapeDecl"},"ShapeDecl",["id","abstract","restricts","shapeExpr"]):this.visitShapeExpr(e,t)},visitShapeExpr:function(e,n){if(t(e))return this.visitShapeRef(e);const r="Shape"===e.type?this.visitShape(e,n):"NodeConstraint"===e.type?this.visitNodeConstraint(e,n):"ShapeAnd"===e.type?this.visitShapeAnd(e,n):"ShapeOr"===e.type?this.visitShapeOr(e,n):"ShapeNot"===e.type?this.visitShapeNot(e,n):"ShapeExternal"===e.type?this.visitShapeExternal(e):null;if(null===r)throw Error("unexpected shapeExpr type: "+e.type);return r},_visitShapeGroup:function(e,t){this._testUnknownAttributes(e,["id","shapeExprs"],e.type,this.visitShapeNot);const n=this,r={type:e.type};return"id"in e&&(r.id=e.id),r.shapeExprs=e.shapeExprs.map((function(e){return n.visitShapeExpr(e,t)})),r},visitShapeNot:function(e,t){this._testUnknownAttributes(e,["id","shapeExpr"],"ShapeNot",this.visitShapeNot);const n={type:e.type};return"id"in e&&(n.id=e.id),n.shapeExpr=this.visitShapeExpr(e.shapeExpr,t),n},visitShape:function(e,t){const n={type:"Shape"};return this._expect(e,"type","Shape"),this._maybeSet(e,n,"Shape",["id","abstract","extends","closed","expression","extra","semActs","annotations"]),n},_visitShapeExprList:function(e){const t=this;return e.map((function(e){return t.visitShapeExpr(e,void 0)}))},visitNodeConstraint:function(e,t){const n={type:"NodeConstraint"};return this._expect(e,"type","NodeConstraint"),this._maybeSet(e,n,"NodeConstraint",["id","nodeKind","datatype","pattern","flags","length","reference","minlength","maxlength","mininclusive","minexclusive","maxinclusive","maxexclusive","totaldigits","fractiondigits","values","annotations","semActs"]),n},visitShapeRef:function(e){if("string"!=typeof e){let t=Exception("visitShapeRef expected a string, not "+JSON.stringify(e));throw console.warn(t),t}return e},visitShapeExternal:function(e){return this._testUnknownAttributes(e,["id"],"ShapeExternal",this.visitShapeNot),Object.assign("id"in e?{id:e.id}:{},{type:"ShapeExternal"})},_visitGroup:function(e,t){const n=this,r=Object.assign("id"in e?{id:null}:{},{type:e.type});return r.expressions=e.expressions.map((function(e){return n.visitExpression(e)})),this._maybeSet(e,r,"expr",["id","min","max","annotations","semActs"],["expressions"])},visitTripleConstraint:function(e){return this._maybeSet(e,Object.assign("id"in e?{id:null}:{},{type:"TripleConstraint"}),"TripleConstraint",["id","inverse","predicate","valueExpr","min","max","annotations","semActs"])},visitExpression:function(e){if("string"==typeof e)return this.visitInclusion(e);const t="TripleConstraint"===e.type?this.visitTripleConstraint(e):"OneOf"===e.type?this.visitOneOf(e):"EachOf"===e.type?this.visitEachOf(e):null;if(null===t)throw Error("unexpected expression type: "+e.type);return t},visitValues:function(t){const n=this;return t.map((function(t){return e(t)||"Language"===t.type?t:n.visitStemRange(t)}))},visitStemRange:function(t){const n=this;"type"in t||n.runtimeError(Error("expected "+JSON.stringify(t)+" to have a 'type' attribute."));const r=["IriStem","LiteralStem","LanguageStem","IriStemRange","LiteralStemRange","LanguageStemRange"];let s;return-1===r.indexOf(t.type)&&n.runtimeError(Error("expected type attribute '"+t.type+"' to be in '"+r+"'.")),e(t)?(this._expect(t.stem,"type","Wildcard"),s={type:t.type,stem:{type:"Wildcard"}}):s={type:t.type,stem:t.stem},t.exclusions&&(s.exclusions=t.exclusions.map((function(e){return n.visitExclusion(e)}))),s},visitExclusion:function(t){if(e(t))return t;{"type"in t||_Visitor.runtimeError(Error("expected "+JSON.stringify(t)+" to have a 'type' attribute."));const e=["IriStem","LiteralStem","LanguageStem"];return-1===e.indexOf(t.type)&&_Visitor.runtimeError(Error("expected type attribute '"+t.type+"' to be in '"+e+"'.")),{type:t.type,stem:t.stem}}},visitInclusion:function(e){if("string"!=typeof e){let t=Exception("visitInclusion expected a string, not "+JSON.stringify(e));throw console.warn(t),t}return e},_maybeSet:function(e,t,n,r,s){const i=this;return this._testUnknownAttributes(e,s?r.concat(s):r,n,this._maybeSet),r.forEach((function(n){const r="visit"+n.charAt(0).toUpperCase()+n.slice(1);if(n in e){const s=i[r];if("function"!=typeof s)throw Error(r+" not found in Visitor");const a=s.call(i,e[n]);void 0!==a&&(t[n]=a)}})),t},_visitValue:function(e){return e},_visitList:function(e){return e.slice()},_testUnknownAttributes:function(e,t,n,r){const s=Object.keys(e).reduce((function(e,n){return"type"!==n&&-1===t.indexOf(n)?e.concat(n):e}),[]);if(s.length>0){const t=Error("unknown propert"+(s.length>1?"ies":"y")+": "+s.map((function(e){return'"'+e+'"'})).join(",")+" in "+n+": "+JSON.stringify(e));throw Error.captureStackTrace(t,r),t}},_expect:function(e,t,n){t in e||this.runtimeError(Error("expected "+JSON.stringify(e)+" to have a ."+t)),arguments.length>2&&e[t]!==n&&this.runtimeError(Error("expected "+e[t]+" to equal "+n))}};return n.visitBase=n.visitStart=n.visitClosed=n["visit@context"]=n._visitValue,n.visitRestricts=n.visitExtends=n._visitShapeExprList,n.visitExtra=n.visitAnnotations=n._visitList,n.visitAbstract=n.visitInverse=n.visitPredicate=n._visitValue,n.visitName=n.visitId=n.visitCode=n.visitMin=n.visitMax=n._visitValue,n.visitType=n.visitNodeKind=n.visitDatatype=n.visitPattern=n.visitFlags=n.visitLength=n.visitMinlength=n.visitMaxlength=n.visitMininclusive=n.visitMinexclusive=n.visitMaxinclusive=n.visitMaxexclusive=n.visitTotaldigits=n.visitFractiondigits=n._visitValue,n.visitOneOf=n.visitEachOf=n._visitGroup,n.visitShapeAnd=n.visitShapeOr=n._visitShapeGroup,n.visitInclude=n._visitValue,n.visitValueExpr=n.visitShapeExpr,n}t.index=function(e){let n={shapeExprs:{},tripleExprs:{}},r=t(),s=r.visitExpression;r.visitExpression=function(e){return"object"==typeof e&&"id"in e&&(n.tripleExprs[e.id]=e),s.call(r,e)};let i=r.visitShapeExpr;r.visitShapeExpr=r.visitValueExpr=function(e,t){return"object"==typeof e&&"id"in e&&(n.shapeExprs[e.id]=e),i.call(r,e,t)};let a=r.visitShapeDecl;return r.visitShapeDecl=r.visitValueExpr=function(e,t){return"object"==typeof e&&"id"in e&&(n.shapeExprs[e.id]=e),a.call(r,e,t)},r.visitSchema(e),n},e.exports=t},95:(e,t,n)=>{const r=function(){const e=n(755),t=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,r=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,s={"\\":"\\\\",'"':'\\"',"/":"\\/","\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"},i={iri:"IRI",bnode:"BNODE",literal:"LITERAL",nonliteral:"NONLITERAL"};function a(e,t){if(!(this instanceof a))return new a(e,t);if(e&&"function"!=typeof e.write&&(t=e,e=null),t=t||{},e)this._outputStream=e,this._endStream=void 0===t.end||!!t.end;else{let e="";this._outputStream={write:function(t,n,r){e+=t,r&&r()},end:function(t){t&&t(null,e)}},this._endStream=!0}this._prefixIRIs=Object.create(null),this._baseIRI=t.base||null,t.prefixes&&this.addPrefixes(t.prefixes),this._error=t.error||c,this.forceParens=!t.simplifyParentheses,this._expect=t.lax?p:l}function o(e){let t=s[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 u(e){return e.replace(/\\/g,"\\\\").replace(/%/g,"\\%")}function c(e,t){"function"!=typeof e&&(t=e,e=c);const n=new Error(t);throw Error.captureStackTrace(n,e),n}function l(e,t,n){t in e||this._error(l,"expected "+e+" to have a ."+t),arguments.length>2&&e[t]!==n&&this._error(l,"expected "+e[e]+" to equal ."+n)}function p(){}return a.prototype={_write:function(e,t){this._outputStream.write(e,"utf8",t)},_writeSchema:function(e,t){const n=this;this._expect(e,"type","Schema"),n.addPrefixes(e._prefixes),e._base&&(n._baseIRI=e._base),n._baseIRI&&n._write("BASE <"+n._baseIRI+">\n"),e.imports&&e.imports.forEach((function(e){n._write("IMPORT "+n._encodeIriOrBlankNode(e)+"\n")})),e.startActs&&e.startActs.forEach((function(e){n._expect(e,"type","SemAct"),n._write(" %"+n._encodePredicate(e.name)+("code"in e?"{"+u(e.code)+"%}":"%"))})),e.start&&n._write("start = "+n._writeShapeExpr(e.start,t,!0,0).join("")+"\n"),"shapes"in e&&e.shapes.forEach((function(e){let r=e.id,s="";"ShapeDecl"===e.type&&(e.abstract&&(s="abstract "),e=e.shapeExpr),n._write(s+n._encodeShapeName(r,!1)+" "+n._writeShapeExpr(e,t,!0,0).join("")+"\n",t)}))},_writeShapeExpr:function(e,t,n,r){const s=this,i=[];if("string"==typeof e)i.push("@",s._encodeShapeName(e));else if("ShapeDecl"===e.type)i.push(s._writeShapeExpr(e.shapeExpr,t,!1,3));else if("ShapeExternal"===e.type)i.push("EXTERNAL");else if("ShapeAnd"===e.type){r>=3&&i.push("(");let n=!1;e.shapeExprs.forEach((function(r,a){if(a>0){function o(t){let n=e.shapeExprs[t];return!("NodeConstraint"!==n.type||"nodeKind"in n&&"literal"===n.nodeKind||"datatype"in n||"values"in n)}let c=!n&&(o(a-1)&&function(t){let n=e.shapeExprs[t];return"Shape"===n.type||"ShapeRef"===n.type}(a)||(u=a-1,"Shape"===e.shapeExprs[u].type&&o(a)));i.push(" AND "),n=c}var u;[].push.apply(i,s._writeShapeExpr(r,t,!1,3))})),r>=3&&i.push(")")}else if("ShapeOr"===e.type)r>=2&&i.push("("),e.shapeExprs.forEach((function(e,r){r>0&&i.push(" OR "),[].push.apply(i,s._writeShapeExpr(e,t,n,2))})),r>=2&&i.push(")");else if("ShapeNot"===e.type)r>=4&&i.push("("),i.push("NOT "),[].push.apply(i,s._writeShapeExpr(e.shapeExpr,t,n,4)),r>=4&&i.push(")");else if("Shape"===e.type)[].push.apply(i,s._writeShape(e,t,n));else{if("NodeConstraint"!==e.type)throw Error("expected Shape{,And,Or,Ref} or NodeConstraint in "+JSON.stringify(e));[].push.apply(i,s._writeNodeConstraint(e,t,n))}return i},_writeShape:function(e,t,n){const r=this;try{const a=[];this._expect(e,"type","Shape"),e.closed&&a.push("CLOSED "),[{keyword:"extends",marker:"EXTENDS "}].forEach((n=>{e[n.keyword]&&e[n.keyword].length>0&&(e[n.keyword].forEach((function(e,s){s&&a.push(" "),a.push(n.marker),[].push.apply(a,r._writeShapeExpr(e,t,!0,0))})),a.push(" "))})),e.extra&&e.extra.length>0&&(a.push("EXTRA "),e.extra.forEach((function(e,t){a.push(r._encodeShapeName(e,!1)+" ")})),a.push(" "));function s(e,t){0===e&&1===t?a.push("?"):0===e&&-1===t?a.push("*"):void 0===e&&void 0===t||(1===e&&-1===t?a.push("+"):a.push("{",e,",",-1===t?"*":t,"}"))}return a.push("{\n"),e.expression&&function e(n,i,o){function c(e){e&&e.forEach((function(e){r._expect(e,"type","SemAct"),a.push("\n"+i+" %"),a.push(r._encodeValue(e.name)),"code"in e?a.push("{"+u(e.code)+"%}"):a.push("%")}))}function l(t,n,r,s){const u=r0&&e.push(" "),i(t))e.push(s._encodeValue(t));else{"type"in t||runtimeError("expected "+JSON.stringify(t)+" to have a 'type' attribute.");const o=["Language","IriStem","LiteralStem","LanguageStem","IriStemRange","LiteralStemRange","LanguageStemRange"];function a(e,t){return-1!==["LanguageStem","LanguageStemRange"].indexOf(e.type)?"@"+t:-1!==["LiteralStem","LiteralStemRange"].indexOf(e.type)?'"'+t.replace(r,t)+'"':s._encodeValue(t)}-1===o.indexOf(t.type)&&runtimeError("expected type attribute '"+t.type+"' to be in '"+o+"'."),"Language"===t.type?e.push("@"+t.languageTag):i(t.stem)?e.push(a(t,t.stem)+"~"):(l(t.stem,"type","Wildcard"),e.push(".")),t.exclusions&&t.exclusions.forEach((function(n){if(e.push(" - "),i(n))e.push(a(t,n));else{"type"in n||runtimeError("expected "+JSON.stringify(n)+" to have a 'type' attribute.");const r=["IriStem","LiteralStem","LanguageStem"];-1===r.indexOf(n.type)&&runtimeError("expected type attribute '"+n.type+"' to be in '"+r+"'."),e.push(a(t,n.stem)+"~")}}))}})),e.push("]")),"pattern"in t){const n=t.pattern.replace(/\//g,"\\/"),r="flags"in t?t.flags:"";e.push("/"+n+"/"+r+" ")}return["length","minlength","maxlength","mininclusive","minexclusive","maxinclusive","maxexclusive","totaldigits","fractiondigits"].forEach((function(n){t[n]&&e.push(" ",n," ",t[n])})),e;function i(e){return"object"!=typeof e||"value"in e&&Object.keys(e).reduce(((e,t)=>!1===e?e:-1!==["value","type","language"].indexOf(t)),!0)}},_encodeIriOrBlankNode:function(e,n){if(n=n?" ":"","_"===e[0]&&":"===e[1])return e;t.test(e)&&(e=e.replace(r,o));const s=this._prefixRegex.exec(e);return s?(s[1]?this._prefixIRIs[s[1]]+s[2]:e)+n:this._relateUrl(e)},_relateUrl:function(t){const n=this._baseIRI;try{n&&new URL(n).host===new URL(t).host&&(t=e.relate(n,t,{output:e.ROOT_PATH_RELATIVE}))}catch(e){}return"<"+t+">"},_encodeLiteral:function(e,n,s){return t.test(e)&&(e=e.replace(r,o)),s?'"'+e+'"@'+s:n?"http://www.w3.org/2001/XMLSchema#integer"===n&&e.match(/^[+-]?[0-9]+$/)||"http://www.w3.org/2001/XMLSchema#decimal"===n&&e.match(/^[+-]?[0-9]*\.[0-9]+$/)||"http://www.w3.org/2001/XMLSchema#double"===n&&e.match(/^[+-]?([0-9]+\.[0-9]*[eE][+-]?[0-9]+|\.?[0-9]+[eE][+-]?[0-9]+)$/)?e:'"'+e+'"^^'+this._encodeIriOrBlankNode(n):'"'+e+'"'},_encodeShapeName:function(e,t){if('"'===e[0])throw new Error("A literal as subject is not allowed: "+e);return this._encodeIriOrBlankNode(e,t)},_encodePredicate:function(e){if('"'===e[0])throw new Error("A literal as predicate is not allowed: "+e);return"http://www.w3.org/1999/02/22-rdf-syntax-ns#type"===e?"a":this._encodeIriOrBlankNode(e)},_encodeValue:function(e){return"object"!=typeof e?this._encodeIriOrBlankNode(e):this._encodeLiteral(e.value,e.type,e.language)},_blockedWrite:function(){throw new Error("Cannot write because the writer has been closed.")},writeSchema:function(e,t){this._writeSchema(e,t),this.end(t)},addShape:function(e,t,n){this._write(_ShExWriter._encodeShapeName(t,!1)+" "+_ShExWriter._writeShapeExpr(e,n,!0,0).join(""),n)},addShapes:function(e){for(let t=0;t\n"))}if(r){let e="",t="";for(let r in n)e+=e?"|"+r:r,t+=(t?"|":"")+n[r];e=e.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&"),this._prefixRegex=new RegExp("^(?:"+t+")[^/]*$|^("+e+")([a-zA-Z][\\-_a-zA-Z0-9]*)$")}this._write(r?"\n":"",t)},_prefixRegex:/$0^/,end:function(e){this._write=this._blockedWrite;let t=e&&function(n,r){t=null,e(n,r)};if(this._endStream)try{return this._outputStream.end(t)}catch(e){}t&&t()}},a}();e.exports=r}},n={};function r(e){var s=n[e];if(void 0!==s)return s.exports;var i=n[e]={id:e,loaded:!1,exports:{}};return t[e].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);r(709)})(); \ No newline at end of file diff --git a/packages/extension-map/lib/ShExMaterializer.js b/packages/extension-map/lib/ShExMaterializer.js index 8e799d92f..b16ba0251 100644 --- a/packages/extension-map/lib/ShExMaterializer.js +++ b/packages/extension-map/lib/ShExMaterializer.js @@ -287,11 +287,26 @@ function ShExMaterializer_constructor(schema, mapper, options) { shape: shapeLabel }; seen[seenKey] = { point: point, shapeLabel: shapeLabel }; - const ret = this._validateShapeExpr(db, point, schema._index.shapeExprs[shapeLabel], shapeLabel, depth, seen); + const ret = this._validateShapeDecl(db, point, schema._index.shapeExprs[shapeLabel], shapeLabel, depth, seen); delete seen[seenKey]; return ret; } + this._validateShapeDecl = function (db, point, shapeExpr, shapeLabel, depth, tracker, seen, subgraph) { + const expr = shapeExpr.type === "ShapeDecl" ? shapeExpr.shapeExpr : shapeExpr; + return this._validateShapeExpr(db, point, expr, shapeLabel, depth, tracker, seen, subgraph); + } + + this._lookupShape = function (label) { + if (!("shapes" in this.schema) || this.schema.shapes.length === 0) { + runtimeError("shape " + label + " not found; no shapes in schema"); + } else if (label in index.shapeExprs) { + return index.shapeExprs[label] + } else { + runtimeError("shape " + label + " not found in:\n" + Object.keys(index.shapeExprs || []).map(s => " " + s).join("\n")); + } + } + this._validateShapeExpr = function (db, point, shapeExpr, shapeLabel, depth, seen) { if ("known" in this && this.known.cached(point, shapeExpr)) return this.known.cached(point, shapeExpr); diff --git a/packages/extension-map/shex-extension-map.js b/packages/extension-map/shex-extension-map.js index 153480ea0..302a6ef86 100644 --- a/packages/extension-map/shex-extension-map.js +++ b/packages/extension-map/shex-extension-map.js @@ -187,7 +187,7 @@ function trivialMaterializer (schema, nextBNode) { const oldVisitShapeRef = v.visitShapeRef; v.visitShapeRef = function (shapeRef) { - this.visitShapeExpr(index.shapeExprs[shapeRef], shapeRef); + this.visitShapeDecl(index.shapeExprs[shapeRef], shapeRef); return oldVisitShapeRef.call(v, shapeRef); }; diff --git a/packages/shex-cli/test/Parser-Writer-test.js b/packages/shex-cli/test/Parser-Writer-test.js index dc9b90e7a..df23eac2e 100644 --- a/packages/shex-cli/test/Parser-Writer-test.js +++ b/packages/shex-cli/test/Parser-Writer-test.js @@ -298,7 +298,7 @@ describe("A ShEx parser", function () { it("should use those prefixes", function () { const schema = "a:a { b:b .+ }"; - expect(parser.parse(schema)._index.shapeExprs["http://a.example/abc#a"].expression.predicate) + expect(parser.parse(schema)._index.shapeExprs["http://a.example/abc#a"].shapeExpr.expression.predicate) .to.deep.equal("http://a.example/def#b"); }); @@ -314,15 +314,15 @@ describe("A ShEx parser", function () { it("should use those prefixes", function () { const schema = "a:a { b:b .+ }"; - expect(parser.parse(schema)._index.shapeExprs["http://a.example/abc#a"].expression.predicate) + expect(parser.parse(schema)._index.shapeExprs["http://a.example/abc#a"].shapeExpr.expression.predicate) .to.deep.equal("http://a.example/def#b"); }); it("should allow temporarily overriding prefixes", function () { const schema = "PREFIX a: a:a { b:b .+ }"; - expect(parser.parse(schema)._index.shapeExprs["http://a.example/xyz#a"].expression.predicate) + expect(parser.parse(schema)._index.shapeExprs["http://a.example/xyz#a"].shapeExpr.expression.predicate) .to.deep.equal("http://a.example/def#b"); - expect(parser.parse("a:a { b:b .+ }")._index.shapeExprs["http://a.example/abc#a"].expression.predicate) + expect(parser.parse("a:a { b:b .+ }")._index.shapeExprs["http://a.example/abc#a"].shapeExpr.expression.predicate) .to.deep.equal("http://a.example/def#b"); }); @@ -332,7 +332,7 @@ describe("A ShEx parser", function () { it("should not take over changes to the original prefixes", function () { prefixes.a = "http://a.example/xyz#"; - expect(parser.parse("a:a { b:b .+ }")._index.shapeExprs["http://a.example/abc#a"].expression.predicate) + expect(parser.parse("a:a { b:b .+ }")._index.shapeExprs["http://a.example/abc#a"].shapeExpr.expression.predicate) .to.deep.equal("http://a.example/def#b"); }); @@ -346,15 +346,15 @@ describe("A ShEx parser", function () { it("should use those prefixes", function () { const schema = "a: { b: .+ }"; - expect(parser.parse(schema)._index.shapeExprs["http://a.example/abc#"].expression.predicate) + expect(parser.parse(schema)._index.shapeExprs["http://a.example/abc#"].shapeExpr.expression.predicate) .to.deep.equal("http://a.example/def#"); }); it("should allow temporarily overriding prefixes", function () { const schema = "PREFIX a: a: { b: .+ }"; - expect(parser.parse(schema)._index.shapeExprs["http://a.example/xyz#"].expression.predicate) + expect(parser.parse(schema)._index.shapeExprs["http://a.example/xyz#"].shapeExpr.expression.predicate) .to.deep.equal("http://a.example/def#"); - expect(parser.parse("a: { b: .+ }")._index.shapeExprs["http://a.example/abc#"].expression.predicate) + expect(parser.parse("a: { b: .+ }")._index.shapeExprs["http://a.example/abc#"].shapeExpr.expression.predicate) .to.deep.equal("http://a.example/def#"); }); @@ -399,7 +399,7 @@ function loadGraphSchema () { // For testing, wrap TC.valueExprs in ShapeOr to allow references undefined shapes (i.e. no properties ergo empty shape). const valueExpr_tripleCnstrnt = ret._index.shapeExprs[nsPath + "TripleConstraint"]. - expression.expressions.find(e => { + shapeExpr.expression.expressions.find(e => { return e.predicate === nsPath + "valueExpr"; }); valueExpr_tripleCnstrnt.valueExpr = { type: "ShapeOr", diff --git a/packages/shex-parser/lib/ShExJison.jison b/packages/shex-parser/lib/ShExJison.jison index 350fbb9d3..bfea3bb5d 100644 --- a/packages/shex-parser/lib/ShExJison.jison +++ b/packages/shex-parser/lib/ShExJison.jison @@ -510,13 +510,9 @@ statement: shapeExprDecl: _QIT_ABSTRACT_E_Opt shapeExprLabel _Qrestriction_E_Star _O_QshapeExpression_E_Or_QIT_EXTERNAL_E_C { // t: 1dot 1val1vsMinusiri3?? - if ($1.abstract || $3.length) { // t: $1: 1dotAbstractShapeCode1 $2: @@ - yy.addShape($2, Object.assign({type: "ShapeDecl"}, $1, - $3.length > 0 ? { restricts: $3 } : { }, - {shapeExpr: $4})) // $5: t: @@ - } else { - yy.addShape($2, $4); - } + yy.addShape($2, Object.assign({type: "ShapeDecl"}, $1, + $3.length > 0 ? { restricts: $3 } : { }, + {shapeExpr: $4})) // $5: t: @@ } ; diff --git a/packages/shex-parser/lib/ShExJison.js b/packages/shex-parser/lib/ShExJison.js index 3d345fcbe..fbc670095 100644 --- a/packages/shex-parser/lib/ShExJison.js +++ b/packages/shex-parser/lib/ShExJison.js @@ -277,13 +277,9 @@ this.$ = appendTo($$[$0-1], $$[$0]) // t: startCode3; break; case 26: // t: 1dot 1val1vsMinusiri3?? - if ($$[$0-3].abstract || $$[$0-1].length) { // t: $$[$0-3]: 1dotAbstractShapeCode1 $$[$0-2]: @@ - yy.addShape($$[$0-2], Object.assign({type: "ShapeDecl"}, $$[$0-3], - $$[$0-1].length > 0 ? { restricts: $$[$0-1] } : { }, - {shapeExpr: $$[$0]})) // $$[$01]: t: @@ - } else { - yy.addShape($$[$0-2], $$[$0]); - } + yy.addShape($$[$0-2], Object.assign({type: "ShapeDecl"}, $$[$0-3], + $$[$0-1].length > 0 ? { restricts: $$[$0-1] } : { }, + {shapeExpr: $$[$0]})) // $$[$01]: t: @@ break; case 27: diff --git a/packages/shex-util/shex-util.js b/packages/shex-util/shex-util.js index 3c741279b..85c3adf36 100644 --- a/packages/shex-util/shex-util.js +++ b/packages/shex-util/shex-util.js @@ -95,7 +95,7 @@ const ShExUtil = { shapes: schema.shapes.reduce(function (ret, shape) { ret[shape.id] = { type: "ASTshape", - expression: _compileShapeToAST(shape.expression, [], schema) + expression: _compileShapeToAST(shape.shapeExpr.expression, [], schema) }; return ret; }, {}) @@ -424,7 +424,7 @@ const ShExUtil = { // Don't delete ret.productions as it's part of the AS. const v = ShExUtil.Visitor(); const knownExpressions = []; - const oldVisitInclusion = v.visitInclusion, oldVisitExpression = v.visitExpression; + const oldVisitInclusion = v.visitInclusion, oldVisitExpression = v.visitExpression, oldVisitExtra = v.visitExtra; v.visitInclusion = function (inclusion) { if (knownExpressions.indexOf(inclusion) === -1 && inclusion in index.tripleExprs) { @@ -443,6 +443,9 @@ const ShExUtil = { } return oldVisitExpression.call(v, expression); }; + v.visitExtra = function (l) { + return l.slice().sort(); + } if (trimIRI) { v.visitIRI = function (i) { return i.replace(trimIRI, ""); @@ -807,10 +810,10 @@ const ShExUtil = { */ getDependencies: function (schema, ret) { ret = ret || this.BiDiClosure(); - (schema.shapes || []).forEach(function (shape) { + (schema.shapes || []).forEach(function (shapeDecl) { function _walkShapeExpression (shapeExpr, negated) { if (typeof shapeExpr === "string") { // ShapeRef - ret.add(shape.id, shapeExpr); + ret.add(shapeDecl.id, shapeExpr); } else if (shapeExpr.type === "ShapeOr" || shapeExpr.type === "ShapeAnd") { shapeExpr.shapeExprs.forEach(function (expr) { _walkShapeExpression(expr, negated); @@ -837,15 +840,15 @@ const ShExUtil = { function _walkTripleConstraint (tc, negated) { if (tc.valueExpr) _walkShapeExpression(tc.valueExpr, negated); - if (negated && ret.inCycle.indexOf(shape.id) !== -1) // illDefined/negatedRefCycle.err - throw Error("Structural error: " + shape.id + " appears in negated cycle"); + if (negated && ret.inCycle.indexOf(shapeDecl.id) !== -1) // illDefined/negatedRefCycle.err + throw Error("Structural error: " + shapeDecl.id + " appears in negated cycle"); } if (typeof tripleExpr === "string") { // Inclusion - ret.add(shape.id, tripleExpr); + ret.add(shapeDecl.id, tripleExpr); } else { if ("id" in tripleExpr) - ret.addIn(tripleExpr.id, shape.id) + ret.addIn(tripleExpr.id, shapeDecl.id) if (tripleExpr.type === "TripleConstraint") { _walkTripleConstraint(tripleExpr, negated); } else if (tripleExpr.type === "OneOf" || tripleExpr.type === "EachOf") { @@ -859,15 +862,13 @@ const ShExUtil = { (["extends", "restricts"]).forEach(attr => { if (shape[attr] && shape[attr].length > 0) shape[attr].forEach(function (i) { - ret.add(shape.id, i); + ret.add(shapeDecl.id, i); }); }) if (shape.expression) _walkTripleExpression(shape.expression, negated); } - if (shape.type === "ShapeDecl") - shape = shape.shapeExpr; - _walkShapeExpression(shape, 0); // 0 means false for bitwise XOR + _walkShapeExpression(shapeDecl.shapeExpr, 0); // 0 means false for bitwise XOR }); return ret; }, diff --git a/packages/shex-validator/shex-validator.js b/packages/shex-validator/shex-validator.js index 04138462f..8ccba9e5e 100644 --- a/packages/shex-validator/shex-validator.js +++ b/packages/shex-validator/shex-validator.js @@ -831,7 +831,7 @@ function ShExValidator_constructor(schema, db, options) { // Override visitShapeRef to follow references. // tests: Extend3G-pass, vitals-RESTRICTS-pass_lie-Vital... visitor.visitShapeRef = function (inclusion) { - return visitor.visitShapeDecl(this._lookupShape(inclusion)); + return visitor.visitShapeDecl(_ShExValidator._lookupShape(inclusion)); }; // Visit shape's EXTENDS and expression. diff --git a/packages/shex-validator/test/Validation-test.js b/packages/shex-validator/test/Validation-test.js index 3b40111e5..6dc7a1d66 100644 --- a/packages/shex-validator/test/Validation-test.js +++ b/packages/shex-validator/test/Validation-test.js @@ -136,7 +136,7 @@ describe("A ShEx validator", function () { "greedy", semActs: semActs, validateExtern: function (point, shapeLabel, depth, seen) { - return validator._validateShapeExpr(point, shapeExterns[shapeLabel], + return validator._validateShapeDecl(point, shapeExterns[shapeLabel], shapeLabel, depth, seen); } }, params); diff --git a/packages/shex-webapp/doc/webpacks/shex-webapp.js b/packages/shex-webapp/doc/webpacks/shex-webapp.js index 7c7449132..b47a9cc3e 100644 --- a/packages/shex-webapp/doc/webpacks/shex-webapp.js +++ b/packages/shex-webapp/doc/webpacks/shex-webapp.js @@ -5946,13 +5946,9 @@ this.$ = appendTo($$[$0-1], $$[$0]) // t: startCode3; break; case 26: // t: 1dot 1val1vsMinusiri3?? - if ($$[$0-3].abstract || $$[$0-1].length) { // t: $$[$0-3]: 1dotAbstractShapeCode1 $$[$0-2]: @@ - yy.addShape($$[$0-2], Object.assign({type: "ShapeDecl"}, $$[$0-3], - $$[$0-1].length > 0 ? { restricts: $$[$0-1] } : { }, - {shapeExpr: $$[$0]})) // $$[$01]: t: @@ - } else { - yy.addShape($$[$0-2], $$[$0]); - } + yy.addShape($$[$0-2], Object.assign({type: "ShapeDecl"}, $$[$0-3], + $$[$0-1].length > 0 ? { restricts: $$[$0-1] } : { }, + {shapeExpr: $$[$0]})) // $$[$01]: t: @@ break; case 27: @@ -7467,7 +7463,7 @@ const ShExUtil = { shapes: schema.shapes.reduce(function (ret, shape) { ret[shape.id] = { type: "ASTshape", - expression: _compileShapeToAST(shape.expression, [], schema) + expression: _compileShapeToAST(shape.shapeExpr.expression, [], schema) }; return ret; }, {}) @@ -7697,14 +7693,19 @@ const ShExUtil = { schema.start = v.visitShapeExpr(schema.start); if ("shapes" in schema) schema.shapes = schema.shapes.map((sh, idx) => { - return sh.type === SX.ShapeDecl ? + return sh.type === SX.ShapeExternal + ? { - type: "ShapeDecl", + type: "ShapeExternal", id: sh.id, - abstract: sh.abstract, - shapeExpr: v.visitShapeExpr(sh.shapeExpr) - } : - knownShapeExprs.get(sh.id) ? knownShapeExprs.get(sh.id) : (() => {const n = v.keepShapeExpr(sh); knownShapeExprs.set(sh.id, n); return n;})(); + } + : + { + type: "ShapeDecl", + id: sh.id, + abstract: sh.abstract, + shapeExpr: v.visitShapeExpr(sh.shapeExpr) + }; }); // remove extraneous BNode IDs @@ -7791,7 +7792,7 @@ const ShExUtil = { // Don't delete ret.productions as it's part of the AS. const v = ShExUtil.Visitor(); const knownExpressions = []; - const oldVisitInclusion = v.visitInclusion, oldVisitExpression = v.visitExpression; + const oldVisitInclusion = v.visitInclusion, oldVisitExpression = v.visitExpression, oldVisitExtra = v.visitExtra; v.visitInclusion = function (inclusion) { if (knownExpressions.indexOf(inclusion) === -1 && inclusion in index.tripleExprs) { @@ -7810,6 +7811,9 @@ const ShExUtil = { } return oldVisitExpression.call(v, expression); }; + v.visitExtra = function (l) { + return l.slice().sort(); + } if (trimIRI) { v.visitIRI = function (i) { return i.replace(trimIRI, ""); @@ -8174,10 +8178,10 @@ const ShExUtil = { */ getDependencies: function (schema, ret) { ret = ret || this.BiDiClosure(); - (schema.shapes || []).forEach(function (shape) { + (schema.shapes || []).forEach(function (shapeDecl) { function _walkShapeExpression (shapeExpr, negated) { if (typeof shapeExpr === "string") { // ShapeRef - ret.add(shape.id, shapeExpr); + ret.add(shapeDecl.id, shapeExpr); } else if (shapeExpr.type === "ShapeOr" || shapeExpr.type === "ShapeAnd") { shapeExpr.shapeExprs.forEach(function (expr) { _walkShapeExpression(expr, negated); @@ -8204,15 +8208,15 @@ const ShExUtil = { function _walkTripleConstraint (tc, negated) { if (tc.valueExpr) _walkShapeExpression(tc.valueExpr, negated); - if (negated && ret.inCycle.indexOf(shape.id) !== -1) // illDefined/negatedRefCycle.err - throw Error("Structural error: " + shape.id + " appears in negated cycle"); + if (negated && ret.inCycle.indexOf(shapeDecl.id) !== -1) // illDefined/negatedRefCycle.err + throw Error("Structural error: " + shapeDecl.id + " appears in negated cycle"); } if (typeof tripleExpr === "string") { // Inclusion - ret.add(shape.id, tripleExpr); + ret.add(shapeDecl.id, tripleExpr); } else { if ("id" in tripleExpr) - ret.addIn(tripleExpr.id, shape.id) + ret.addIn(tripleExpr.id, shapeDecl.id) if (tripleExpr.type === "TripleConstraint") { _walkTripleConstraint(tripleExpr, negated); } else if (tripleExpr.type === "OneOf" || tripleExpr.type === "EachOf") { @@ -8226,15 +8230,13 @@ const ShExUtil = { (["extends", "restricts"]).forEach(attr => { if (shape[attr] && shape[attr].length > 0) shape[attr].forEach(function (i) { - ret.add(shape.id, i); + ret.add(shapeDecl.id, i); }); }) if (shape.expression) _walkTripleExpression(shape.expression, negated); } - if (shape.type === "ShapeDecl") - shape = shape.shapeExpr; - _walkShapeExpression(shape, 0); // 0 means false for bitwise XOR + _walkShapeExpression(shapeDecl.shapeExpr, 0); // 0 means false for bitwise XOR }); return ret; }, @@ -8829,14 +8831,17 @@ const ShExUtil = { const shapes = values[SX.shapes]; if (shapes) { ret.shapes = shapes.map(v => { // @@ console.log(v.nested); - var t = v.nested[RDF.type][0].ldterm; - var obj = t === SX.ShapeDecl ? - { - type: SX.ShapeDecl, - abstract: !!v.nested[SX["abstract"]][0].ldterm.value, - shapeExpr: shapeExpr(v.nested[SX.shapeExpr][0].nested) - } : - shapeExpr(v.nested); + var t = v.nested[RDF.type][0].ldterm;debugger; + const obj = t === SX.ShapeExternal + ? { type: t } + : Object.assign( + {}, + { type: SX.ShapeDecl }, + SX["abstract"] in v.nested + ? {abstract: !!v.nested[SX["abstract"]]?.[0].ldterm.value} + : {}, + {shapeExpr: shapeExpr(v.nested[SX.shapeExpr][0].nested)} + ); return extend({id: v.ldterm}, obj); }); } @@ -10423,7 +10428,7 @@ function ShExValidator_constructor(schema, db, options) { // Override visitShapeRef to follow references. // tests: Extend3G-pass, vitals-RESTRICTS-pass_lie-Vital... visitor.visitShapeRef = function (inclusion) { - return visitor.visitShapeDecl(this._lookupShape(inclusion)); + return visitor.visitShapeDecl(_ShExValidator._lookupShape(inclusion)); }; // Visit shape's EXTENDS and expression. diff --git a/packages/shex-webapp/doc/webpacks/shex-webapp.min.js b/packages/shex-webapp/doc/webpacks/shex-webapp.min.js index aac949dc3..8309da00f 100644 --- a/packages/shex-webapp/doc/webpacks/shex-webapp.min.js +++ b/packages/shex-webapp/doc/webpacks/shex-webapp.min.js @@ -1,2 +1,2 @@ /*! For license information please see shex-webapp.min.js.LICENSE.txt */ -(()=>{var t={752:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JisonLexer=void 0;var r=function(){function e(e){void 0===e&&(e={}),this.yy=e,this.EOF=1,this.options={},this.yyleng=0,this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0}}return e.prototype.parseError=function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},e.prototype.setInput=function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},e.prototype.input=function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},e.prototype.unput=function(e){var t=e.length,r=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var s=this.yylloc.range,i={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-t};return this.yylloc=i,this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},e.prototype.more=function(){return this._more=!0,this},e.prototype.reject=function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},e.prototype.less=function(e){this.unput(this.match.slice(e))},e.prototype.pastInput=function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},e.prototype.upcomingInput=function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},e.prototype.showPosition=function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},e.prototype.test_match=function(e,t){var r,n,s;if(this.options.backtrack_lexer&&(s={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.yylloc.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(s.yylloc.range=this.yylloc.range.slice(0))),(n=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],r=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var i in s)this[i]=s[i];return!1}return!1},e.prototype.next=function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,r,n=null;this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),i=0;in[0].length)){if(n=t,r=i,this.options.backtrack_lexer){if(!1!==(e=this.test_match(t,s[i])))return e;if(this._backtrack){n=null;continue}return!1}if(!this.options.flex)break}return n?!1!==(e=this.test_match(n,s[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},e.prototype.lex=function(){var e=this.next();return e||this.lex()},e.prototype.begin=function(e){this.conditionStack.push(e)},e.prototype.popState=function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},e.prototype._currentRules=function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},e.prototype.topState=function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},e.prototype.pushState=function(e){this.begin(e)},e.prototype.stateStackSize=function(){return this.conditionStack.length},e}();t.JisonLexer=r},41:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.o=t.JisonParser=void 0;var r=function(){function e(e,t){void 0===e&&(e={}),this.yy=e,this.lexer=t}return e.prototype.trace=function(e){},e.prototype.parseError=function(e,t){if(!t.recoverable){var r=new Error(e);throw r.hash=t,r}this.trace(e)},e.prototype.parse=function(e,t){void 0===t&&(t="function"==typeof this.yy&&"function"==typeof this.yy.constructor?new this.yy(this,this.lexer):Object.create(this.yy));var r=this,n=[0],s=[null],i=[],a=this.table,o="",u=0,c=0,p=0,l=2,f=1,h=i.slice.call(arguments,1),d=Object.create(this.lexer),m={yy:t};d.setInput(e,m.yy),m.yy.lexer=d,m.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var y=d.yylloc;i.push(y);var _=d.options&&d.options.ranges;function x(e){n.length=n.length-2*e,s.length=s.length-e,i.length=i.length-e}"function"==typeof m.yy.parseError&&(this.parseError=m.yy.parseError);for(var g,E,b,S,A,v,O,T,I,w=function(){var e;return"number"!=typeof(e=d.lex()||f)&&(e=r.symbols_[e]||e),e},F={};;){if(b=n[n.length-1],this.defaultActions[b]?S=this.defaultActions[b]:(null==g&&(g=w()),S=a[b]&&a[b][g]),void 0===S||!S.length||!S[0]){var N=null,k="";if(p)E!==f&&(N=R(b));else{for(var L in N=R(b),I=[],a[b])v=Number(L),this.terminals_[v]&&v>l&&I.push("'"+this.terminals_[v]+"'");k=d.showPosition?"Parse error on line "+(u+1)+":\n"+d.showPosition()+"\nExpecting "+I.join(", ")+", got '"+(this.terminals_[g]||g)+"'":"Parse error on line "+(u+1)+": Unexpected "+(g==f?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(k,{text:d.match,token:this.terminals_[g]||g,line:d.yylineno,loc:d.yylloc,expected:I,recoverable:null!==N})}if(3==p){if(g===f||E===f)throw new Error(k||"Parsing halted while starting to recover from another error.");c=d.yyleng,o=d.yytext,u=d.yylineno,y=d.yylloc,g=w()}if(null===N)throw new Error(k||"Parsing halted. No suitable error recovery rule available.");x(N||0),E=g==l?null:g,g=l,b=n[n.length-1],S=a[b]&&a[b][l],p=3}if(S[0]instanceof Array&&S.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+g);switch(S[0]){case 1:n.push(g),s.push(d.yytext),i.push(d.yylloc),n.push(S[1]),g=null,E?(g=E,E=null):(c=d.yyleng,o=d.yytext,u=d.yylineno,y=d.yylloc,p>0&&p--);break;case 2:if(O=this.productions_[S[1]][1],F.$=s[s.length-O],F._$={first_line:i[i.length-(O||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(O||1)].first_column,last_column:i[i.length-1].last_column},_&&(F._$.range=[i[i.length-(O||1)].range[0],i[i.length-1].range[1]]),void 0!==(A=this.performAction.apply(F,[o,c,u,m.yy,S[1],s,i].concat(h))))return A;O&&(n=n.slice(0,-1*O*2),s=s.slice(0,-1*O),i=i.slice(0,-1*O)),n.push(this.productions_[S[1]][0]),s.push(F.$),i.push(F._$),T=a[n[n.length-2]][n[n.length-1]],n.push(T);break;case 3:return!0}}return!0;function R(e){for(var t=n.length-1,r=0;;){if(l.toString()in a[e])return r;if(0===e||t<2)return null;e=n[t-=2],++r}}},e}();t.JisonParser=r,t.o=function(e,t,r){var n=e.length;for(r=r||{};n--;r[e[n]]=t);return r}},281:e=>{"use strict";function t(e,t,r){if(0===e.length)return;if(1===e.length)return e[0];const n={type:t};return n[r]=e,n}e.exports={DcTap:class{dontResolveIris=!1;prefixes={};shapes=[];curShape=null;conjuncts=null;headers=["shapeID","shapeLabel","propertyID","propertyLabel","mandatory","repeatable","valueNodeType","valueDataType","valueConstraint","valueConstraintType","valueShape","note"];constructor(e={}){Object.assign(this,e)}parseRows(e,t){return e.forEach((e=>{e[0].toLowerCase()===this.headers[0].toLowerCase()&&e[1].toLowerCase()===this.headers[1].toLowerCase()&&e[2].toLowerCase()===this.headers[2].toLowerCase()||"prefix"===e[0].toLowerCase()&&"namespace"===e[1].toLowerCase()||1===e.length||(2===e.length?this.prefixes[e[0]]=e[1]:this.parseRow(e,t))})),this}parseRow(e,t){if(Array.isArray(e)&&(e=this.headers.reduce(((t,r,n)=>(t[r]=e[n],t)),{})),e.valueNodeType=e.valueNodeType.toLowerCase(),e.valueConstraintType=e.valueConstraintType.toLowerCase(),e.shapeID)this.curShape={type:"Shape",shapeID:this.parseIri(e.shapeID,t),tripleConstraints:[]},this.shapes.push(this.curShape);else if(!this.curShape)throw new Error(`no current shape into which to add ${JSON.stringify(e)}`);return this.curShape.tripleConstraints.push(this.toTripleConstraint(e,t)),this}toTripleConstraint(e,t){return Object.assign({propertyID:this.parseIri(e.propertyID,t)},e.mandatory?{mandatory:!0}:{},e.repeatable?{repeatable:!0}:{},this.parseValueConstraint(e,t),e.valueShape?{valueShape:this.parseIri(e.valueShape,t)}:{})}parseValueConstraint(e,t){switch(e.valueConstraintType){case"iristem":case"literalstem":case"picklist":case"languagetag":return{values:e.valueConstraint.split(/\s+/).map((r=>this.coerseValue(r,e,t,e.valueConstraintType.endsWith("stem"))))};case"pattern":return{pattern:e.valueConstraint};case"":return e.valueDataType?{datatype:this.parseIri(e.valueDataType,t)}:{};default:throw Error(`Unknown valueConstraintType ${e.valueConstraintType} in ${JSON.stringify(e,null,2)}?`)}}coerseValue(e,t,r,n=!1){if("languagetag"===t.valueConstraintType)return{type:"Language",languageTag:e};switch(t.valueNodeType){case"literal":return n?{type:"LiteralStem",stem:e}:{value:e};case"iri":return n?{type:"IriStem",stem:this.parseIri(e,r)}:this.parseIri(e,r);case"":return{value:e};default:throw Error(`Unknown valueNodeType ${t.valueNodeType} in ${JSON.stringify(t,null,2)}?`)}}parseIri(e,t){if(this.dontResolveIris)return e;if("<"===e[0]){if(">"!==e[e.length-1])throw new Error(`Malformed URL: ${e}`);return new URL(e.substr(1,e.length-2),t).href}{const t=e.indexOf(":");if(-1===t)throw new Error(`Expected ':' in IRI ${e}`);const r=e.substr(0,t);if(!(r in this.prefixes))throw new Error(`Prefix ${r} not found in known prefixes: ${Object.keys(this.prefixes).join(" ,")}`);const n=e.substr(t+1);return this.prefixes[r]+n}}toJson(){return this.shapes}toShEx(){return{type:"Schema",shapes:this.shapes.map((e=>({type:"Shape",id:e.shapeID,expression:t(e.tripleConstraints.map((e=>Object.assign({type:"TripleConstraint",predicate:e.propertyID},e.mandatory?{min:1}:{},e.repeatable?{max:-1}:{},function(e){const r=[];e.values&&r.push({type:"NodeConstraint",values:e.values});e.pattern&&r.push({type:"NodeConstraint",pattern:e.pattern});e.datatype&&r.push({type:"NodeConstraint",datatype:e.datatype});e.valueShape&&r.push(e.valueShape);const n=t(r,"ShapeAnd","shapeExprs");return n?{valueExpr:n}:{}}(e)))),"EachOf","expressions")})))}}}}},515:e=>{var t={create:function(){let e={},t={},r={},n={};return{add:function(s,i){if(s in r&&-1!==r[s].indexOf(i))return;let a=s in n?c(s):e[s]=c(s),o=c(i);function u(e,t,r,n){e[n]=e[n].filter((t=>-1===e[r].indexOf(t))).concat(-1===e[r].indexOf(r)?[r]:[],e[r]),e[r].forEach((e=>t[e]=t[e].filter((e=>e!==n&&-1===t[n].indexOf(e))).concat(-1===t[n].indexOf(n)?[n]:[],t[n])))}function c(e){return e in n||(t[e]=[],r[e]=[],n[e]={}),n[e]}a[i]=o,delete e[i],u(r,t,i,s),u(t,r,s,i)},roots:e,parents:t,children:r}},depthFirst:function e(t,r,n){return Object.keys(t).reduce(((s,i)=>s.concat(e(t[i],r,i),n?r(i,n):[])),[])}};e.exports=t},808:e=>{"use strict";function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,r,n,s){r=r||"&",n=n||"=";var i={};if("string"!=typeof e||0===e.length)return i;var a=/\+/g;e=e.split(r);var o=1e3;s&&"number"==typeof s.maxKeys&&(o=s.maxKeys);var u=e.length;o>0&&u>o&&(u=o);for(var c=0;c=0?(p=d.substr(0,m),l=d.substr(m+1)):(p=d,l=""),f=decodeURIComponent(p),h=decodeURIComponent(l),t(i,f)?Array.isArray(i[f])?i[f].push(h):i[f]=[i[f],h]:i[f]=h}return i}},368:e=>{"use strict";var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,r,n,s){return r=r||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(s){var i=encodeURIComponent(t(s))+n;return Array.isArray(e[s])?e[s].map((function(e){return i+encodeURIComponent(t(e))})).join(r):i+encodeURIComponent(t(e[s]))})).join(r):s?encodeURIComponent(t(s))+n+encodeURIComponent(t(e)):""}},642:(e,t,r)=>{"use strict";t.decode=t.parse=r(808),t.encode=t.stringify=r(368)},362:e=>{"use strict";e.exports={ABSOLUTE:"absolute",PATH_RELATIVE:"pathRelative",ROOT_RELATIVE:"rootRelative",SHORTEST:"shortest"}},779:(e,t,r)=>{"use strict";var n=r(362);function s(e,t){var r=t.removeEmptyQueries&&e.extra.relation.minimumPort;return e.query.string[r?"stripped":"full"]}function i(e,t){return!e.extra.relation.minimumQuery||t.output===n.ABSOLUTE||t.output===n.ROOT_RELATIVE}function a(e,t){var r=t.removeDirectoryIndexes&&e.extra.resourceIsIndex,s=e.extra.relation.minimumResource&&t.output!==n.ABSOLUTE&&t.output!==n.ROOT_RELATIVE;return!!e.resource&&!s&&!r}e.exports=function(e,t){var r="";return r+=function(e,t){var r="";return(e.extra.relation.maximumHost||t.output===n.ABSOLUTE)&&(e.extra.relation.minimumScheme&&t.schemeRelative&&t.output!==n.ABSOLUTE?r+="//":r+=e.scheme+"://"),r}(e,t),r+=function(e,t){return!e.auth||t.removeAuth||!e.extra.relation.maximumHost&&t.output!==n.ABSOLUTE?"":e.auth+"@"}(e,t),r+=function(e,t){return e.host.full&&(e.extra.relation.maximumAuth||t.output===n.ABSOLUTE)?e.host.full:""}(e,t),r+=function(e,t){return e.port&&!e.extra.portIsDefault&&e.extra.relation.maximumHost?":"+e.port:""}(e),r+=function(e,t){var r="",o=e.path.absolute.string,u=e.path.relative.string,c=a(e,t);if(e.extra.relation.maximumHost||t.output===n.ABSOLUTE||t.output===n.ROOT_RELATIVE)r=o;else if(u.length<=o.length&&t.output===n.SHORTEST||t.output===n.PATH_RELATIVE){if(""===(r=u)){var p=i(e,t)&&!!s(e,t);e.extra.relation.maximumPath&&!c?r="./":!e.extra.relation.overridesQuery||c||p||(r="./")}}else r=o;return"/"!==r||c||!t.removeRootTrailingSlash||e.extra.relation.minimumPort&&t.output!==n.ABSOLUTE||(r=""),r}(e,t),r+=function(e,t){return a(e,t)?e.resource:""}(e,t),r+=function(e,t){return i(e,t)?s(e,t):""}(e,t),r+=function(e,t){return e.hash?e.hash:""}(e),r}},755:(e,t,r)=>{"use strict";var n=r(362),s=r(779),i=r(141),a=r(609),o=r(398),u=r(258);function c(e,t){this.options=i(t,{defaultPorts:{ftp:21,http:80,https:443},directoryIndexes:["index.html"],ignore_www:!1,output:c.SHORTEST,rejectedSchemes:["data","javascript","mailto"],removeAuth:!1,removeDirectoryIndexes:!0,removeEmptyQueries:!1,removeRootTrailingSlash:!0,schemeRelative:!0,site:void 0,slashesDenoteHost:!0}),this.from=o.from(e,this.options,null)}c.prototype.relate=function(e,t,r){if(a.isPlainObject(t)?(r=t,t=e,e=null):t||(t=e,e=null),r=i(r,this.options),e=e||r.site,!(e=o.from(e,r,this.from))||!e.href)throw new Error("from value not defined.");if(e.extra.hrefInfo.minimumPathOnly)throw new Error("from value supplied is not absolute: "+e.href);return!1===(t=o.to(t,r)).valid?t.href:(t=u(e,t,r),t=s(t,r))},c.relate=function(e,t,r){return(new c).relate(e,t,r)},a.shallowMerge(c,n),e.exports=c},141:(e,t,r)=>{"use strict";var n=r(609);function s(e,t){return t instanceof Object&&e instanceof Object?t instanceof Array&&e instanceof Array?t.concat(e):n.shallowMerge(e,t):e}e.exports=function(e,t){if(n.isPlainObject(e)){var r={};for(var i in t)t.hasOwnProperty(i)&&(void 0!==e[i]?r[i]=s(e[i],t[i]):r[i]=t[i]);return r}return t}},420:e=>{"use strict";e.exports=function(e,t){if(t.ignore_www){var r=e.host.full;if(r){var n=r;0===r.indexOf("www.")&&(n=r.substr(4)),e.host.stripped=n}}}},849:e=>{"use strict";e.exports=function(e){var t=!(e.scheme||e.auth||e.host.full||e.port),r=t&&!e.path.absolute.string,n=r&&!e.resource,s=n&&!e.query.string.full.length,i=s&&!e.hash;e.extra.hrefInfo.minimumPathOnly=t,e.extra.hrefInfo.minimumResourceOnly=r,e.extra.hrefInfo.minimumQueryOnly=n,e.extra.hrefInfo.minimumHashOnly=s,e.extra.hrefInfo.empty=i}},398:(e,t,r)=>{"use strict";var n=r(849),s=r(420),i=r(965),a=r(22),o=r(150),u=r(936),c=r(831);function p(e,t){var r=u(e,t);return!1===r.valid||(s(r,t),a(r,t),i(r,t),o(r,t),n(r)),r}e.exports={from:function(e,t,r){if(e){var n=p(e,t),s=c.resolveDotSegments(n.path.absolute.array);return n.path.absolute.array=s,n.path.absolute.string="/"+c.join(s),n}return r},to:p}},965:e=>{"use strict";function t(e){if("/"!==e){var t=[];return e.split("/").forEach((function(e){""!==e&&t.push(e)})),t}return[]}e.exports=function(e,r){var n=e.path.absolute.string;if(n){var s=n.lastIndexOf("/");if(s>-1){if(++s{"use strict";e.exports=function(e,t){var r=-1;for(var n in t.defaultPorts)if(n===e.scheme&&t.defaultPorts.hasOwnProperty(n)){r=t.defaultPorts[n];break}r>-1&&(r=r.toString(),null===e.port&&(e.port=r),e.extra.portIsDefault=e.port===r)}},150:e=>{"use strict";var t=Object.prototype.hasOwnProperty;function r(e,r){var n=0,s="";for(var i in e)if(""!==i&&!0===t.call(e,i)){var a=e[i];""===a&&r||(s+=1==++n?"?":"&",i=encodeURIComponent(i),s+=""!==a?i+"="+encodeURIComponent(a).replace(/%20/g,"+"):i)}return s}e.exports=function(e,t){e.query.string.full=r(e.query.object,!1),t.removeEmptyQueries&&(e.query.string.stripped=r(e.query.object,!0))}},936:(e,t,r)=>{"use strict";var n=r(883).Qc;e.exports=function(e,t){return function(e,t){var r=!0;return t.rejectedSchemes.every((function(t){return r=!(0===e.indexOf(t+":"))})),r}(e,t)?(r=n(e,!0,t.slashesDenoteHost),(s=r.protocol)&&s.indexOf(":")===s.length-1&&(s=s.substr(0,s.length-1)),r.host={full:r.hostname,stripped:null},r.path={absolute:{array:null,string:r.pathname},relative:{array:null,string:null}},r.query={object:r.query,string:{full:null,stripped:null}},r.extra={hrefInfo:{minimumPathOnly:null,minimumResourceOnly:null,minimumQueryOnly:null,minimumHashOnly:null,empty:null,separatorOnlyQuery:"?"===r.search},portIsDefault:null,relation:{maximumScheme:null,maximumAuth:null,maximumHost:null,maximumPort:null,maximumPath:null,maximumResource:null,maximumQuery:null,maximumHash:null,minimumScheme:null,minimumAuth:null,minimumHost:null,minimumPort:null,minimumPath:null,minimumResource:null,minimumQuery:null,minimumHash:null,overridesQuery:null},resourceIsIndex:null,slashes:r.slashes},r.resource=null,r.scheme=s,delete r.hostname,delete r.pathname,delete r.protocol,delete r.search,delete r.slashes,r):{href:e,valid:!1};var r,s}},799:(e,t,r)=>{"use strict";var n=r(19),s=r(609),i=r(831);e.exports=function(e,t,r){n.upToPath(e,t,r),e.extra.relation.minimumScheme&&(e.scheme=t.scheme),e.extra.relation.minimumAuth&&(e.auth=t.auth),e.extra.relation.minimumHost&&(e.host=s.clone(t.host)),e.extra.relation.minimumPort&&function(e,t){e.port=t.port,e.extra.portIsDefault=t.extra.portIsDefault}(e,t),e.extra.relation.minimumScheme&&function(e,t){if(e.extra.relation.maximumHost||!e.extra.hrefInfo.minimumResourceOnly){var r=e.path.absolute.array,n="/";r?(e.extra.hrefInfo.minimumPathOnly&&0!==e.path.absolute.string.indexOf("/")&&(r=t.path.absolute.array.concat(r)),r=i.resolveDotSegments(r),n+=i.join(r)):r=[],e.path.absolute.array=r,e.path.absolute.string=n}else e.path=s.clone(t.path)}(e,t),n.pathOn(e,t,r),e.extra.relation.minimumResource&&function(e,t){e.resource=t.resource,e.extra.resourceIsIndex=t.extra.resourceIsIndex}(e,t),e.extra.relation.minimumQuery&&(e.query=s.clone(t.query)),e.extra.relation.minimumHash&&(e.hash=t.hash)}},19:e=>{"use strict";e.exports={pathOn:function(e,t,r){var n=e.extra.hrefInfo.minimumQueryOnly,s=e.extra.hrefInfo.minimumHashOnly,i=e.extra.hrefInfo.empty,a=e.extra.relation.minimumPort,o=e.extra.relation.minimumScheme,u=a&&e.path.absolute.string===t.path.absolute.string,c=e.resource===t.resource||!e.resource&&t.extra.resourceIsIndex||r.removeDirectoryIndexes&&e.extra.resourceIsIndex&&!t.resource,p=u&&(c||n||s||i),l=r.removeEmptyQueries?"stripped":"full",f=e.query.string[l],h=t.query.string[l],d=p&&!!f&&f===h||(s||i)&&!e.extra.hrefInfo.separatorOnlyQuery,m=d&&e.hash===t.hash;e.extra.relation.minimumPath=u,e.extra.relation.minimumResource=p,e.extra.relation.minimumQuery=d,e.extra.relation.minimumHash=m,e.extra.relation.maximumPort=!o||o&&!u,e.extra.relation.maximumPath=!o||o&&!p,e.extra.relation.maximumResource=!o||o&&!d,e.extra.relation.maximumQuery=!o||o&&!m,e.extra.relation.maximumHash=!o||o&&!m,e.extra.relation.overridesQuery=u&&e.extra.relation.maximumResource&&!d&&!!h},upToPath:function(e,t,r){var n=e.extra.hrefInfo.minimumPathOnly,s=e.scheme===t.scheme||!e.scheme,i=s&&(e.auth===t.auth||r.removeAuth||n),a=r.ignore_www?"stripped":"full",o=i&&(e.host[a]===t.host[a]||n),u=o&&(e.port===t.port||n);e.extra.relation.minimumScheme=s,e.extra.relation.minimumAuth=i,e.extra.relation.minimumHost=o,e.extra.relation.minimumPort=u,e.extra.relation.maximumScheme=!s||s&&!i,e.extra.relation.maximumAuth=!s||s&&!o,e.extra.relation.maximumHost=!s||s&&!u}}},258:(e,t,r)=>{"use strict";var n=r(799),s=r(255);e.exports=function(e,t,r){return n(t,e,r),s(t,e,r),t}},255:(e,t,r)=>{"use strict";var n=r(831);e.exports=function(e,t,r){if(e.extra.relation.minimumScheme){var s=(i=e.path.absolute.array,a=t.path.absolute.array,o=[],u=!0,c=-1,a.forEach((function(e,t){u&&(i[t]!==e?u=!1:c=t),u||o.push("..")})),i.forEach((function(e,t){t>c&&o.push(e)})),o);e.path.relative.array=s,e.path.relative.string=n.join(s)}var i,a,o,u,c}},609:e=>{"use strict";e.exports={clone:function e(t){if(t instanceof Object){var r=t instanceof Array?[]:{};for(var n in t)t.hasOwnProperty(n)&&(r[n]=e(t[n]));return r}return t},isPlainObject:function(e){return!!e&&"object"==typeof e&&e.constructor===Object},shallowMerge:function(e,t){if(e instanceof Object&&t instanceof Object)for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}}},831:e=>{"use strict";e.exports={join:function(e){return e.length>0?e.join("/")+"/":""},resolveDotSegments:function(e){var t=[];return e.forEach((function(e){".."!==e?"."!==e&&t.push(e):t.length>0&&t.splice(t.length-1,1)})),t}}},639:function(e,t,r){var n;e=r.nmd(e),function(s){t&&t.nodeType,e&&e.nodeType;var i="object"==typeof r.g&&r.g;i.global!==i&&i.window!==i&&i.self;var a,o=2147483647,u=36,c=/^xn--/,p=/[^\x20-\x7E]/,l=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=Math.floor,d=String.fromCharCode;function m(e){throw RangeError(f[e])}function y(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function _(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+y((e=e.replace(l,".")).split("."),t).join(".")}function x(e){for(var t,r,n=[],s=0,i=e.length;s=55296&&t<=56319&&s65535&&(t+=d((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=d(e)})).join("")}function E(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function b(e,t,r){var n=0;for(e=r?h(e/700):e>>1,e+=h(e/t);e>455;n+=u)e=h(e/35);return h(n+36*e/(e+38))}function S(e){var t,r,n,s,i,a,c,p,l,f,d,y=[],_=e.length,x=0,E=128,S=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n=128&&m("not-basic"),y.push(e.charCodeAt(n));for(s=r>0?r+1:0;s<_;){for(i=x,a=1,c=u;s>=_&&m("invalid-input"),((p=(d=e.charCodeAt(s++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:u)>=u||p>h((o-x)/a))&&m("overflow"),x+=p*a,!(p<(l=c<=S?1:c>=S+26?26:c-S));c+=u)a>h(o/(f=u-l))&&m("overflow"),a*=f;S=b(x-i,t=y.length+1,0==i),h(x/t)>o-E&&m("overflow"),E+=h(x/t),x%=t,y.splice(x++,0,E)}return g(y)}function A(e){var t,r,n,s,i,a,c,p,l,f,y,_,g,S,A,v=[];for(_=(e=x(e)).length,t=128,r=0,i=72,a=0;a<_;++a)(y=e[a])<128&&v.push(d(y));for(n=s=v.length,s&&v.push("-");n<_;){for(c=o,a=0;a<_;++a)(y=e[a])>=t&&yh((o-r)/(g=n+1))&&m("overflow"),r+=(c-t)*g,t=c,a=0;a<_;++a)if((y=e[a])o&&m("overflow"),y==t){for(p=r,l=u;!(p<(f=l<=i?1:l>=i+26?26:l-i));l+=u)A=p-f,S=u-f,v.push(d(E(f+A%S,0))),p=h(A/S);v.push(d(E(p,0))),i=b(r,g,n==s),r=0,++n}++r,++t}return v.join("")}a={version:"1.3.2",ucs2:{decode:x,encode:g},decode:S,encode:A,toASCII:function(e){return _(e,(function(e){return p.test(e)?"xn--"+A(e):e}))},toUnicode:function(e){return _(e,(function(e){return c.test(e)?S(e.slice(4).toLowerCase()):e}))}},void 0===(n=function(){return a}.call(t,r,t,e))||(e.exports=n)}()},883:(e,t,r)=>{"use strict";var n=r(639),s=r(225);function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.Qc=g;var a=/^([a-z0-9.+-]+:)/i,o=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),p=["'"].concat(c),l=["%","/","?",";","#"].concat(p),f=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},x=r(642);function g(e,t,r){if(e&&s.isObject(e)&&e instanceof i)return e;var n=new i;return n.parse(e,t,r),n}i.prototype.parse=function(e,t,r){if(!s.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),o=-1!==i&&i127?R+="x":R+=L[C];if(!R.match(h)){var j=N.slice(0,I),$=N.slice(I+1),P=L.match(d);P&&(j.push(P[1]),$.unshift(P[2])),$.length&&(g="/"+$.join(".")+g),this.hostname=j.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),F||(this.hostname=n.toASCII(this.hostname));var Q=this.port?":"+this.port:"",M=this.hostname||"";this.host=M+Q,this.href+=this.host,F&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==g[0]&&(g="/"+g))}if(!m[S])for(I=0,k=p.length;I0)&&r.host.split("@"))&&(r.auth=F.shift(),r.host=r.hostname=F.shift());return r.search=e.search,r.query=e.query,s.isNull(r.pathname)&&s.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!A.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var O=A.slice(-1)[0],T=(r.host||e.host||A.length>1)&&("."===O||".."===O)||""===O,I=0,w=A.length;w>=0;w--)"."===(O=A[w])?A.splice(w,1):".."===O?(A.splice(w,1),I++):I&&(A.splice(w,1),I--);if(!b&&!S)for(;I--;I)A.unshift("..");!b||""===A[0]||A[0]&&"/"===A[0].charAt(0)||A.unshift(""),T&&"/"!==A.join("/").substr(-1)&&A.push("");var F,N=""===A[0]||A[0]&&"/"===A[0].charAt(0);v&&(r.hostname=r.host=N?"":A.length?A.shift():"",(F=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=F.shift(),r.host=r.hostname=F.shift()));return(b=b||r.host&&A.length)&&!N&&A.unshift(""),A.length?r.pathname=A.join("/"):(r.pathname=null,r.path=null),s.isNull(r.pathname)&&s.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},i.prototype.parseHost=function(){var e=this.host,t=o.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},225:e=>{"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},540:(e,t,r)=>{const n=function(){const e=r(118),t="|",n="×",s="";function i(e){e||(e={});for(let t,r=1,n=arguments.length;r{e[t].outs.push(r)}))}}();function c(t,n,s,a,o,u,c,d){const m=this;let y=[],_=[];if(1===m.states.length)return h([],s,a,u,c);let x=null;for(l(m,y,this.start,{repeats:{},avail:[],matched:[],stack:[],errors:[]});y.length;){_=[],d&&d.push({threads:[]});for(let e=0;ee.tNo)));const o=t.avail[e].splice(0,i);if(o.length>=n)do{p(m,_,t,o)}while(t.avail[e].length>0&&o.lengthf(e.state,e.repeats)))})}if(0===_.length&&null===x)return g(E(y,m.states));const e=y;y=_,_=e;const t=y.reduce(((e,t)=>{const r=t.matched.reduce(((e,t)=>e+t.triples.length),0)===o.reduce(((e,t)=>"NO_TRIPLE_CONSTRAINT"===t?e:e+1),0);return null!==e?e:t.state===m.end&&r?t:null}),null);t&&(x=t)}if(null===x)return g();function g(){return{type:"Failure",node:n,errors:E(y,m.states)}}function E(t,n){const s=n[n.length-1];return t.reduce(((t,n)=>{const a=m.states[n.state].c;let c=null;if("string"==typeof a.valueExpr?(c=a.valueExpr,e.isBlank(c)&&(c=r.shapes[c])):a.valueExpr&&(c=i({},a.valueExpr)),n.state!==m.end)return t.concat([i({type:"MissingProperty",property:s.c.predicate},c?{valueExpr:c}:{})]);{const e={};return Object.keys(o).forEach((t=>{"NO_TRIPLE_CONSTRAINT"!==o[t]&&(e[t]=o[t])})),n.matched.forEach((t=>{t.triples.forEach((t=>{delete e[t]}))})),t.concat(Object.keys(e).map((t=>i({type:"ExcessTripleViolation",property:s.c.predicate,triple:u[e[t]]},c?{valueExpr:c}:{}))))}}),[])}return"errors"in x.matched?x.matched:h(x.matched,s,a,u,c)}function p(e,t,r,s){const i=e.states[r.state],a=e.states.map((e=>e.c===n?e.expr:null)),o=i.stack.map((e=>{let t=r.repeats[a.indexOf(e.c)];return void 0===t?t=0:t-=1,{c:e.c,e:e.e,i:t}})),u={c:i.c,triples:s,stack:o};r.matched=r.matched.concat(u),i.outs.forEach((n=>{l(e,t,n,r)}))}function l(e,r,s,i,a){a=a||[];const o=f(s,i.repeats);if(-1!==a.indexOf(o))return;a.push(o);const u=e.states[s];if(u.c===t)return u.outs.reduce(((t,n,s)=>t.concat(l(e,r,n,i,a))),[]);if(u.c===n){const t=[];s in i.repeats||(i.repeats[s]=0);const n=i.repeats[s];return n(r[n]=parseInt(n)==t?e.repeats[n]+1:e.repeats[n],r)),{});return{state:e.state,repeats:r,matched:e.matched,avail:e.avail.slice(),stack:e.stack}}(i,s),a)),n>=u.min&&n<=u.max&&[].push.apply(t,l(e,r,u.outs[1],function(e,t){const r=Object.keys(e.repeats).reduce(((r,n)=>(parseInt(n)!==t&&(r[n]=e.repeats[n]),r)),{});return{state:e.state,repeats:r,matched:e.matched,avail:e.avail.slice(),stack:e.stack}}(i,s),a)),t}return[r.push({state:s,repeats:i.repeats,avail:i.avail.map((e=>e.slice())),stack:i.stack,matched:i.matched,errors:i.errors})-1]}function f(e,t){const r=Object.keys(t).map((e=>e+":"+t[e])).join(",");return r.length?e+"-"+r:""+e}function h(t,r,n,s,i){let o=[];const u=[],c=[],p=t.reduce(((t,a)=>{let p,l=0,f=t;for(;l=o.length&&o.push({}),a.stack[l].c!==o[l].c){if(p=[],f.type="EachOf"===a.stack[l].c.type?"EachOfSolutions":"OneOfSolutions",f.solutions=p,"min"in a.stack[l].c&&(f.min=a.stack[l].c.min),"max"in a.stack[l].c&&(f.max=a.stack[l].c.max),"annotations"in a.stack[l].c&&(f.annotations=a.stack[l].c.annotations),"semActs"in a.stack[l].c&&(f.semActs=a.stack[l].c.semActs),f=p,o[l].i=null,"semActs"in a.stack[l].c){const e=i.dispatchAll(a.stack[l].c.semActs,"???",f);if(e.length)throw e}}else f=f.solutions;if(a.stack[l].i!==o[l].i?(p=[],f[a.stack[l].i]={type:"EachOf"===a.stack[l].c.type?"EachOfSolution":"OneOfSolution",expressions:p},f=p,o[l].e=null):f=f[o[l].i].expressions,a.stack[l].e===o[l].e)throw"how'd we get here?";p={},f[a.stack[l].e]=p,a.stack[l].e>0&&void 0===f[a.stack[l].e-1]&&-1===c.indexOf(f)&&c.push(f),f=p,o.length=l+1,++l}return f.type="TripleConstraintSolutions","min"in a.c&&(f.min=a.c.min),"max"in a.c&&(f.max=a.c.max),f.predicate=a.c.predicate,"valueExpr"in a.c&&(f.valueExpr=a.c.valueExpr),"id"in a.c&&(f.productionLabel=a.c.id),f.solutions=a.triples.map((t=>{const o=s[t],c={type:"TestedTriple",subject:o.subject,predicate:o.predicate,object:function(t){if('"'!==t[0])return t;const r={value:e.getLiteralValue(t)},n=e.getLiteralType(t);n&&"http://www.w3.org/2001/XMLSchema#string"!==n&&"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"!==n&&(r.type=n);const s=e.getLiteralLanguage(t);s&&(r.language=s);return r}(o.object)};const p=r.indexOf(a.c),l=n[p].find((e=>e.tNo===t));return l.res&&Object.keys(l.res).length>0&&(c.referenced=l.res),0===u.length&&"semActs"in a.c&&[].push.apply(u,i.dispatchAll(a.c.semActs,o,c)),c})),"annotations"in a.c&&(f.annotations=a.c.annotations),"semActs"in a.c&&(f.semActs=a.c.semActs),o=a.stack.slice(),t}),{});return u.length?{type:"SemActFailure",errors:u}:(c.forEach((e=>{for(let t=0;t{const n=function(){const e=r(118);function t(e){e||(e={});for(let t,r=1,n=arguments.length;r0&&0===c[0].errors.length&&c.forEach((r=>{const n="expression"in u?u.expression.solutions.slice():[];"solution"in r&&n.push(r.solution),delete r.solution,r.expression=t({type:e,solutions:n},o)})),0===c.length||c[0].errors.length>0)return s0&&0===a[0].errors.length&&"semActs"in n){const e=[],t=[];a.forEach((r=>{const s=f.dispatchAll(n.semActs,"???",r);0===s.length?e.push(r):([].push.apply(r.errors,s),t.push(r))})),a=e.length>0?e:t}return a}if("TripleConstraint"===n.type){const _="negated"in n&&n.negated||0===h;_&&(p=h=1/0),void 0===i.avail[o]&&(i.avail[o]=c[o].map((e=>e.tNo)));const x={};("min"in n&&1!==n.min||"max"in n&&1!==n.max)&&(x.min=n.min,x.max=n.max),"semActs"in n&&(x.semActs=n.semActs),"annotations"in n&&(x.annotations=n.annotations);const g=i.avail[o].splice(0,p),E=_?0===g.length:g.length>=p,b=[],S=i.matched;if(E)do{const A=g.reduce(((e,t)=>{const r=l[t],s={type:"TestedTriple",subject:r.subject,predicate:r.predicate,object:a(r.object)},u=c[o].find((e=>e.tNo===t));u.res&&Object.keys(u.res).length>0&&(s.referenced=u.res);const p=i.errors.concat("semActs"in n?f.dispatchAll(n.semActs,s,s):[]);return p.length>0?e.fail.push({tripleNo:t,tested:s,semActErrors:p}):e.pass.push({tripleNo:t,tested:s,semActErrors:p}),e}),{pass:[],fail:[]});if(0===A.fail.length){const v=0===g.length?i.errors.slice():[],O=m(A.pass,v);b.push(O)}else A.fail.forEach((e=>b.push(m([e],e.semActErrors))));function m(e,r){return{avail:i.avail.map((e=>e.slice())),errors:r,matched:S.concat({tNos:e.map((e=>e.tripleNo))}),expression:t({type:"TripleConstraintSolutions",predicate:n.predicate},"valueExpr"in n?{valueExpr:n.valueExpr}:{},"id"in n?{productionLabel:n.id}:{},x,{solutions:e.map((e=>e.tested))})}}}while(i.avail[o].length>0&&g.length{const t=[],s=[];return n.expressions.forEach((n=>{const i={avail:e.avail.map((e=>e.slice())),errors:e.errors,matched:e.matched},a=r(n,i);0===a[0].errors.length?([].push.apply(t,a),a.forEach((e=>{const t="solution"in i?i.solution.expressions:[];"expression"in e&&t.push(e.expression),delete e.expression,e.solution={type:"OneOfSolution",expressions:t}}))):[].push.apply(s,a)})),t.length>0?t:s}));if("EachOf"===n.type)return y(d("EachOfSolutions",(e=>n.expressions.reduce(((e,t)=>y(e.reduce(((e,n)=>{const s=r(t,n);return s.forEach((e=>{if(0===e.errors.length){const t="solution"in n?n.solution.expressions.slice():[];"expression"in e&&t.push(e.expression),delete e.expression,e.solution={type:"EachOfSolution",expressions:t}}})),e.concat(s)}),[]))),[e]))));function y(e){return e.reduce(((e,t)=>0===t.errors.length?e.errors?{errors:!1,l:[t]}:{errors:!1,l:e.l.concat(t)}:e.errors?{errors:!0,l:e.l.concat(t)}:e),{errors:!0,l:[]}).l}runtimeError("unexpected expr type: "+n.type)}(i,{avail:[],matched:[],errors:[]}),m=d.reduce(((e,t)=>{if(t.errors.length>0)return e;const r={};return Object.keys(p).forEach((e=>{"NO_TRIPLE_CONSTRAINT"!==p[e]&&(r[e]=p[e])})),t.matched.forEach((e=>{e.tNos.forEach((e=>{delete r[e]}))})),Object.keys(r).forEach((e=>{t.errors.push({type:"ExcessTripleViolation",triple:l[e],constraint:u[r[e]]})})),null!==e?e:Object.keys(r).length>0?null:t}),null);return null!==m?function(t,r,s,i){function o(u){if("OneOfSolutions"===u.type||"EachOfSolutions"===u.type)u.solutions.forEach((e=>{e.expressions.forEach((e=>{o(e)}))}));else{if("TripleConstraintSolutions"!==u.type)throw Error("unexpected expr type in "+JSON.stringify(u));u.solutions=u.solutions.map((o=>{if("TestedTriple"===o.type)return o;const u=s[o.tripleNo],c=r[o.constraintNo],p={type:"TestedTriple",subject:u.subject,predicate:u.predicate,object:a(u.object)};function l(t,r,s){const i=s(t,r);if("errors"in i){const s={type:"ReferenceError",focus:t,shape:r};return"string"==typeof r&&e.isBlank(r)&&(s.referencedShape=n),s.errors=i,[s]}return(("solution"in i||"solutions"in i)&&0!==Object.keys(i.solution||i.solutions).length||"Recursion"===i.type)&&(p.referenced=i),[]}function f(e,t){return l(e,t,recurse)}function h(e,t){return l(e,t,direct)}const d="valueExpr"in c?checkValueExpr(c.inverse?u.subject:u.object,c.valueExpr,f,h):[];return 0===d.length&&"semActs"in c&&[].push.apply(d,i.dispatchAll(c.semActs,p,p)),d.length>0&&(t.errors=t.errors||[],t.errors=t.errors.concat(d)),p}))}}Object.keys(t).length>0&&o(t);"semActs"in n&&(t.semActs=n.semActs);return t}(m.expression,u,l,f):d.length>1?{type:"PossibleErrors",errors:d.reduce(((e,t)=>e.concat([t.errors])),[])}:d[0]}};function a(t){if('"'!==t[0])return t;const r={value:e.getLiteralValue(t)},n=e.getLiteralType(t);n&&"http://www.w3.org/2001/XMLSchema#string"!==n&&"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"!==n&&(r.type=n);const s=e.getLiteralLanguage(t);return s&&(r.language=s),r}}}}();e.exports=n},839:(e,t,r)=>{const n=r(14),s="http://www.w3.org/2001/XMLSchema#",i=s+"boolean",a=/^[a-z][a-z0-9+.-]*:/i;function o(e){e||(e={});for(let t,r=1,n=arguments.length;r>10),56320+(1023&i))}{const e=t[s];if(!e)throw new Error("no replacement found for '"+s+"'");return e}}))}catch(e){return console.warn(e),""}}const{JisonParser:y,o:_}=r(41),x=[1,7],g=[1,16],E=[1,11],b=[1,14],S=[1,25],A=[1,24],v=[1,21],O=[1,22],T=[1,23],I=[1,28],w=[1,26],F=[1,27],N=[1,29],k=[1,12],L=[1,13],R=[1,15],C=[4,9],D=[16,19,20,21],j=[2,25],$=[16,19,20,21,37],P=[16,19,20,21,31,34,37,39,46,48,50,53,54,55,56,76,77,78,79,80,81,82],Q=[4,9,16,19,20,21,37,43,74,75],M=[4,9,43],G=[29,46,80,81,82],B=[4,9,42,43],V=[1,59],U=[46,79,80,81,82],z=[31,34,39,46,48,50,53,54,55,56,76,77,78,80,81,82],J=[1,94],X=[1,85],Z=[1,86],H=[1,87],q=[1,90],K=[1,91],W=[1,92],Y=[1,93],ee=[1,95],te=[33,48,49,50,53,54,55,56,63],re=[4,9,37,65],ne=[1,99],se=[9,37],ie=[9,65];t.HW=class extends y{constructor(e={},t=new oe(e)){super(e,t),this.symbols_={error:2,shapeMap:3,EOF:4,pair:5,Q_O_QGT_COMMA_E_S_Qpair_E_C_E_Star:6,QGT_COMMA_E_Opt:7,O_QGT_COMMA_E_S_Qpair_E_C:8,GT_COMMA:9,nodeSelector:10,statusAndShape:11,Qreason_E_Opt:12,QjsonAttributes_E_Opt:13,reason:14,jsonAttributes:15,GT_AT:16,Qstatus_E_Opt:17,shapeSelector:18,ATSTART:19,ATPNAME_NS:20,ATPNAME_LN:21,status:22,objectTerm:23,triplePattern:24,IT_SPARQL:25,string:26,nodeIri:27,shapeIri:28,START:29,subjectTerm:30,BLANK_NODE_LABEL:31,literal:32,GT_LCURLEY:33,IT_FOCUS:34,nodePredicate:35,O_QobjectTerm_E_Or_QIT___E_C:36,GT_RCURLEY:37,O_QsubjectTerm_E_Or_QIT___E_C:38,IT__:39,GT_NOT:40,GT_OPT:41,GT_DIVIDE:42,GT_DOLLAR:43,O_QAPPINFO_COLON_E_Or_QAPPINFO_SPACE_COLON_E_C:44,jsonValue:45,APPINFO_COLON:46,APPINFO_SPACE_COLON:47,IT_false:48,IT_null:49,IT_true:50,jsonObject:51,jsonArray:52,INTEGER:53,DECIMAL:54,DOUBLE:55,STRING_LITERAL2:56,Q_O_QjsonMember_E_S_QGT_COMMA_E_S_QjsonMember_E_Star_C_E_Opt:57,O_QGT_COMMA_E_S_QjsonMember_E_C:58,jsonMember:59,Q_O_QGT_COMMA_E_S_QjsonMember_E_C_E_Star:60,O_QjsonMember_E_S_QGT_COMMA_E_S_QjsonMember_E_Star_C:61,STRING_LITERAL2_COLON:62,GT_LBRACKET:63,Q_O_QjsonValue_E_S_QGT_COMMA_E_S_QjsonValue_E_Star_C_E_Opt:64,GT_RBRACKET:65,O_QGT_COMMA_E_S_QjsonValue_E_C:66,Q_O_QGT_COMMA_E_S_QjsonValue_E_C_E_Star:67,O_QjsonValue_E_S_QGT_COMMA_E_S_QjsonValue_E_Star_C:68,rdfLiteral:69,numericLiteral:70,booleanLiteral:71,Q_O_QLANGTAG_E_Or_QGT_DTYPE_E_S_QnodeIri_E_C_E_Opt:72,O_QLANGTAG_E_Or_QGT_DTYPE_E_S_QnodeIri_E_C:73,LANGTAG:74,GT_DTYPE:75,STRING_LITERAL1:76,STRING_LITERAL_LONG1:77,STRING_LITERAL_LONG2:78,IT_a:79,IRIREF:80,PNAME_LN:81,PNAME_NS:82,$accept:0,$end:1},this.terminals_={2:"error",4:"EOF",9:"GT_COMMA",16:"GT_AT",19:"ATSTART",20:"ATPNAME_NS",21:"ATPNAME_LN",25:"IT_SPARQL",29:"START",31:"BLANK_NODE_LABEL",33:"GT_LCURLEY",34:"IT_FOCUS",37:"GT_RCURLEY",39:"IT__",40:"GT_NOT",41:"GT_OPT",42:"GT_DIVIDE",43:"GT_DOLLAR",46:"APPINFO_COLON",47:"APPINFO_SPACE_COLON",48:"IT_false",49:"IT_null",50:"IT_true",53:"INTEGER",54:"DECIMAL",55:"DOUBLE",56:"STRING_LITERAL2",62:"STRING_LITERAL2_COLON",63:"GT_LBRACKET",65:"GT_RBRACKET",74:"LANGTAG",75:"GT_DTYPE",76:"STRING_LITERAL1",77:"STRING_LITERAL_LONG1",78:"STRING_LITERAL_LONG2",79:"IT_a",80:"IRIREF",81:"PNAME_LN",82:"PNAME_NS"},this.productions_=[0,[3,1],[3,4],[8,2],[6,0],[6,2],[7,0],[7,1],[5,4],[12,0],[12,1],[13,0],[13,1],[11,3],[11,1],[11,1],[11,1],[17,0],[17,1],[10,1],[10,1],[10,2],[10,2],[18,1],[18,1],[30,1],[30,1],[23,1],[23,1],[24,5],[24,5],[36,1],[36,1],[38,1],[38,1],[22,1],[22,1],[14,2],[15,3],[44,1],[44,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[51,3],[58,2],[60,0],[60,2],[61,2],[57,0],[57,1],[59,2],[52,3],[66,2],[67,0],[67,2],[68,2],[64,0],[64,1],[32,1],[32,1],[32,1],[70,1],[70,1],[70,1],[69,2],[73,1],[73,2],[72,0],[72,1],[71,1],[71,1],[26,1],[26,1],[26,1],[26,1],[35,1],[35,1],[27,1],[27,1],[27,1],[27,1],[28,1],[28,1],[28,1],[28,1]],this.table=[{3:1,4:[1,2],5:3,10:4,23:5,24:6,25:x,26:20,27:8,30:9,31:g,32:10,33:E,46:b,48:S,50:A,53:v,54:O,55:T,56:I,69:17,70:18,71:19,76:w,77:F,78:N,80:k,81:L,82:R},{1:[3]},{1:[2,1]},_(C,[2,4],{6:30}),{11:31,16:[1,32],19:[1,33],20:[1,34],21:[1,35]},_(D,[2,19]),_(D,[2,20]),{26:36,56:I,76:w,77:F,78:N},_(D,j,{26:37,56:I,76:w,77:F,78:N}),_($,[2,27]),_($,[2,28]),{27:42,30:40,31:g,34:[1,38],38:39,39:[1,41],46:b,80:k,81:L,82:R},_(P,[2,84]),_(P,[2,85]),_(P,[2,86]),_(P,[2,87]),_([16,19,20,21,37,46,79,80,81,82],[2,26]),_($,[2,65]),_($,[2,66]),_($,[2,67]),_($,[2,74],{72:43,73:44,74:[1,45],75:[1,46]}),_($,[2,68]),_($,[2,69]),_($,[2,70]),_($,[2,76]),_($,[2,77]),_(Q,[2,78]),_(Q,[2,79]),_(Q,[2,80]),_(Q,[2,81]),{4:[2,6],7:47,8:48,9:[1,49]},_(M,[2,9],{12:50,14:51,42:[1,52]}),_(G,[2,17],{17:53,22:54,40:[1,55],41:[1,56]}),_(B,[2,14]),_(B,[2,15]),_(B,[2,16]),_(D,[2,21]),_(D,[2,22]),{27:58,35:57,46:b,79:V,80:k,81:L,82:R},{27:58,35:60,46:b,79:V,80:k,81:L,82:R},_(U,[2,33]),_(U,[2,34]),_([37,46,79,80,81,82],j),_($,[2,71]),_($,[2,75]),_($,[2,72]),{27:61,46:b,80:k,81:L,82:R},{4:[1,62]},_(C,[2,5]),{4:[2,7],5:63,10:4,23:5,24:6,25:x,26:20,27:8,30:9,31:g,32:10,33:E,46:b,48:S,50:A,53:v,54:O,55:T,56:I,69:17,70:18,71:19,76:w,77:F,78:N,80:k,81:L,82:R},_(C,[2,11],{13:64,15:65,43:[1,66]}),_(M,[2,10]),{26:67,56:I,76:w,77:F,78:N},{18:68,28:69,29:[1,70],46:[1,73],80:[1,71],81:[1,72],82:[1,74]},_(G,[2,18]),_(G,[2,35]),_(G,[2,36]),{23:76,26:20,27:42,30:9,31:g,32:10,36:75,39:[1,77],46:b,48:S,50:A,53:v,54:O,55:T,56:I,69:17,70:18,71:19,76:w,77:F,78:N,80:k,81:L,82:R},_(z,[2,82]),_(z,[2,83]),{34:[1,78]},_($,[2,73]),{1:[2,2]},_(C,[2,3]),_(C,[2,8]),_(C,[2,12]),{44:79,46:[1,80],47:[1,81]},_(M,[2,37]),_(B,[2,13]),_(B,[2,23]),_(B,[2,24]),_(B,[2,88]),_(B,[2,89]),_(B,[2,90]),_(B,[2,91]),{37:[1,82]},{37:[2,31]},{37:[2,32]},{37:[1,83]},{33:J,45:84,48:X,49:Z,50:H,51:88,52:89,53:q,54:K,55:W,56:Y,63:ee},_(te,[2,39]),_(te,[2,40]),_(D,[2,29]),_(D,[2,30]),_(C,[2,38]),_(re,[2,41]),_(re,[2,42]),_(re,[2,43]),_(re,[2,44]),_(re,[2,45]),_(re,[2,46]),_(re,[2,47]),_(re,[2,48]),_(re,[2,49]),{37:[2,55],57:96,59:98,61:97,62:ne},{33:J,45:102,48:X,49:Z,50:H,51:88,52:89,53:q,54:K,55:W,56:Y,63:ee,64:100,65:[2,63],68:101},{37:[1,103]},{37:[2,56]},_(se,[2,52],{60:104}),{33:J,45:105,48:X,49:Z,50:H,51:88,52:89,53:q,54:K,55:W,56:Y,63:ee},{65:[1,106]},{65:[2,64]},_(ie,[2,60],{67:107}),_(re,[2,50]),{9:[1,109],37:[2,54],58:108},_(se,[2,57]),_(re,[2,58]),{9:[1,111],65:[2,62],66:110},_(se,[2,53]),{59:112,62:ne},_(ie,[2,61]),{33:J,45:113,48:X,49:Z,50:H,51:88,52:89,53:q,54:K,55:W,56:Y,63:ee},_(se,[2,51]),_(ie,[2,59])],this.defaultActions={2:[2,1],62:[2,2],76:[2,31],77:[2,32],97:[2,56],101:[2,64]}}performAction(e,t,r,s,p,l,y){const _=l.length-1;switch(p){case 1:return[];case 2:return[l[_-3]].concat(l[_-2]);case 3:case 51:case 59:this.$=l[_];break;case 4:case 60:case 63:this.$=[];break;case 5:case 61:this.$=l[_-1].concat(l[_]);break;case 8:this.$=o({node:l[_-3]},l[_-2],l[_-1],l[_]);break;case 9:case 11:case 52:case 55:case 74:this.$={};break;case 13:this.$=o({shape:l[_]},l[_-1]);break;case 14:this.$={shape:n.start};break;case 15:l[_]=l[_].substr(1,l[_].length-1),this.$={shape:d(s.schemaMeta.prefixes,l[_].substr(0,l[_].length-1))};break;case 16:l[_]=l[_].substr(1,l[_].length-1);const e=l[_].indexOf(":");this.$={shape:d(s.schemaMeta.prefixes,l[_].substr(0,e))+l[_].substr(e+1)};break;case 17:this.$={status:"conformant"};break;case 18:this.$={status:l[_]};break;case 21:this.$={type:"Extension",language:"http://www.w3.org/ns/shex#Extensions-sparql",lexical:l[_]["@value"]};break;case 22:this.$={type:"Extension",language:l[_-1],lexical:l[_]["@value"]};break;case 24:this.$=n.start;break;case 29:this.$={type:"TriplePattern",subject:n.focus,predicate:l[_-2],object:l[_-1]};break;case 30:this.$={type:"TriplePattern",subject:l[_-3],predicate:l[_-2],object:n.focus};break;case 32:case 34:case 42:this.$=null;break;case 35:this.$="nonconformant";break;case 36:this.$="unknown";break;case 37:this.$={reason:l[_]};break;case 38:this.$={appinfo:l[_]};break;case 41:this.$=!1;break;case 43:this.$=!0;break;case 46:case 47:case 48:this.$=parseFloat(l[_]);break;case 49:this.$=f(l[_],1)["@value"];break;case 50:case 58:this.$=l[_-1];break;case 53:case 54:case 71:this.$=o(l[_-1],l[_]);break;case 57:this.$={};const t=l[_-1].substr(0,l[_-1].length-1).trim();this.$[f(t,1)["@value"]]=l[_];break;case 62:this.$=[l[_-1]].concat(l[_]);break;case 68:this.$=c(l[_],"http://www.w3.org/2001/XMLSchema#integer");break;case 69:this.$=c(l[_],"http://www.w3.org/2001/XMLSchema#decimal");break;case 70:this.$=c(l[_],"http://www.w3.org/2001/XMLSchema#double");break;case 72:this.$=u("@language",l[_].substr(1).toLowerCase());break;case 73:this.$=u("@type",l[_]);break;case 76:this.$=c("true",i);break;case 77:this.$=c("false",i);break;case 78:case 80:this.$=f(l[_],1);break;case 79:case 81:this.$=f(l[_],3);break;case 83:this.$="http://www.w3.org/1999/02/22-rdf-syntax-ns#type";break;case 84:const r=m(l[_].slice(1,-1),{});this.$=null===s.dataMeta.base||a.test(r)?r:s.dataMeta._resolveIRI(r);break;case 85:case 86:this.$=h(l[_],s.dataMeta.prefixes);break;case 87:this.$=d(s.dataMeta.prefixes,l[_].substr(0,l[_].length-1));break;case 88:const p=m(l[_].slice(1,-1),{});this.$=null===s.schemaMeta.base||a.test(p)?p:s.schemaMeta._resolveIRI(p);break;case 89:case 90:this.$=h(l[_],s.schemaMeta.prefixes);break;case 91:this.$=d(s.schemaMeta.prefixes,l[_].substr(0,l[_].length-1))}}};const{JisonLexer:ae}=r(752);class oe extends ae{constructor(e={}){super(e),this.options={moduleName:"ShapeMapJison"},this.rules=[/^(?:\s+|(#[^\u000a\u000d]*|\/\*([^*]|\*([^/]|\\\/))*\*\/))/,/^(?:(appinfo[\u0020\u000A\u0009]+:))/,/^(?:("([^\u0022\u005C\u000A\u000D]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*"[\u0020\u000A\u0009]*:))/,/^(?:([Ff][Oo][Cc][Uu][Ss]))/,/^(?:([Ss][Tt][Aa][Rr][Tt]))/,/^(?:(@[Ss][Tt][Aa][Rr][Tt]))/,/^(?:([Ss][Pp][Aa][Rr][Qq][Ll]))/,/^(?:(@(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?)?:)(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|:|[0-9]|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.|:|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))*))))/,/^(?:(@((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?)?:)))/,/^(?:(@([A-Za-z])+((-([0-9A-Za-z])+))*))/,/^(?:(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?)?:)(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|:|[0-9]|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.|:|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))*)))/,/^(?:(appinfo:))/,/^(?:((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?)?:))/,/^(?:(([+-])?((([0-9])+\.([0-9])*(([Ee]([+-])?([0-9])+)))|((\.)?([0-9])+(([Ee]([+-])?([0-9])+))))))/,/^(?:(([+-])?([0-9])*\.([0-9])+))/,/^(?:(([+-])?([0-9])+))/,/^(?:(<([^\u0000-\u0020<>\"{}|^`\\]|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*>))/,/^(?:(_:((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|[0-9])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?))/,/^(?:('''(('|'')?([^\'\\]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))))*'''))/,/^(?:("""(("|"")?([^\"\\]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))))*"""))/,/^(?:('([^\u0027\u005c\u000a\u000d]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*'))/,/^(?:("([^\u0022\u005c\u000a\u000d]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*"))/,/^(?:a\b)/,/^(?:,)/,/^(?:\{)/,/^(?:\})/,/^(?:@)/,/^(?:!)/,/^(?:\?)/,/^(?:\/)/,/^(?:\$)/,/^(?:\[)/,/^(?:\])/,/^(?:\^\^)/,/^(?:_\b)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:[a-zA-Z0-9_-]+)/,/^(?:.)/],this.conditions={INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40],inclusive:!0}}}performAction(e,t,r,n){switch(r){case 0:break;case 1:return 47;case 2:return 62;case 3:return 34;case 4:return 29;case 5:return 19;case 6:return 25;case 7:return 21;case 8:return 20;case 9:return 74;case 10:return 81;case 11:return 46;case 12:return 82;case 13:return 55;case 14:return 54;case 15:return 53;case 16:return 80;case 17:return 31;case 18:return 77;case 19:return 78;case 20:return 76;case 21:return 56;case 22:return 79;case 23:return 9;case 24:return 33;case 25:return 37;case 26:return 16;case 27:return 40;case 28:return 41;case 29:return 42;case 30:return 43;case 31:return 63;case 32:return 65;case 33:return 75;case 34:return 39;case 35:return 50;case 36:return 48;case 37:return 49;case 38:return 4;case 39:return'unexpected word "'+t.yytext+'"';case 40:return"invalid character "+t.yytext}}}},18:(e,t,r)=>{const n=function(){ShapeMapJison=r(839).HW;const e=/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i,t=/(?:^|\/)\.\.?(?:$|[\/#?])/;class n{constructor(){}reset(){this.prefixes=null,this.base=this._baseIRI=this._baseIRIPath=this._baseIRIRoot=null}_setBase(t){t||(t=null),(this.base=t)&&(this._basePath=t.replace(/[^\/?]*(?:\?.*)?$/,""),t=t.match(e),this._baseRoot=t[0],this._baseScheme=t[1])}_resolveIRI(e){switch(e[0]){case void 0:return this.base;case"#":return this.base+e;case"?":return this.base.replace(/(?:\?.*)?$/,e);case"/":return("/"===e[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!t.test(e))return e;const r=e.length;let n="",s=-1,i=-1,a="/",o=0;for(;s=i&&(n=n.substr(0,o)),"/"!==a)return n+"/"+e.substr(s+1);o=s+1}}}a=e[++s]}return n+e.substring(o)}expandPrefix(e){return e in this.prefixes||this.error(new Error('Parse error; unknown prefix "'+e+':"')),this.prefixes[e]}}class s{constructor(){this.schemaMeta=new n,this.dataMeta=new n,this._fileName=void 0}reset(){this.schemaMeta.reset(),this.dataMeta.reset()}_setFileName(e){this._fileName=e}error(e){const t={text:this.lexer.match,line:this.lexer.thislineno,loc:this.lexer.thislloc,pos:this.lexer.showPosition()};if(e.hash=t,!this.recoverable)throw e;this.recoverable(e)}}return{construct:function(e,t,r){const n=t.base,i={};for(const e in t.prefixes||{})i[e]=t.prefixes[e];const a=r.base,o={};for(const e in r.prefixes||{})o[e]=r.prefixes[e];const u=new ShapeMapJison,c=u.parse;return u.parse=function t(r,p=null){const l=globalThis.PS=new s;l.schemaMeta.prefixes=Object.create(i),l.schemaMeta._setBase(n),l.dataMeta.prefixes=Object.create(o),l.dataMeta._setBase(a),l._setFileName(e),l._fileName=p;try{return c.call(u,r,l)}catch(r){const n="lexer"in u.yy?u.yy.lexer.yylineno+1:1,s="lexer"in u.yy?u.yy.lexer.showPosition():"",i=Error(`${e}(${n}): ${r.message}\n${s}`);throw Error.captureStackTrace(i,t),l.reset(),i}},u}}}();e.exports=n},14:e=>{const t={focus:{term:"FOCUS"},start:{term:"START"},wildcard:{term:"WILDCARD"}};e.exports=t},261:(e,t,r)=>{const n=function(){const e=r(14);return e.Parser=r(18),e}();e.exports=n},410:(e,t,r)=>{e.exports=function(e={}){const t=r(443),n=r(931),s={load:async function(r,n,p,l,f={},h={}){const d={schema:t.emptySchema(),data:e.rdfjs?new e.rdfjs.Store:null,schemaMeta:[],dataMeta:[]},m=[],y=r.concat(n).map((e=>"object"==typeof e?e.url:e));let _=null;f&&"iriTransform"in f&&(_=f.iriTransform,delete f.iriTransform);const x=function(){const e=[],t=[];let r,n,s=0;const i=new Promise((function(e,t){r=e,n=t}));return i.all=function(t){return 0===t.length?r([]):t.forEach((function(t,r){e.push(t),a(t,r)})),i},i.add=function(t){return e.push(t),a(t,e.length-1),i},i;function a(i,a){i.then((function(n){t[a]=n,++s,s===e.length&&r(t)})).catch((function(e){n(e)}))}}();function g(e){if(!("imports"in e))return e;if(f.keepImports)return e;const t=Object.assign({},e);t.imports;return delete t.imports,e.imports.map((function(e){return _?_(e):e})).filter((function(e){return-1===y.indexOf(e)})).map((e=>{y.push(e),x.add(s.GET(e).then((function(e){const t={url:e.url,base:e.url,prefixes:{}};return a(e.text,"text/shex",e.url,d.schema,t,f,g)})))})),t}return[].push.apply(m,[i(r,d.schemaMeta,"text/shex",a,d.schema,f,g),i(n,d.schemaMeta,"text/json",o,d.schema,f,g),i(p,d.dataMeta,"text/turtle",u,d.data,h),i(l,d.dataMeta,"application/ld+json",c,d.data,h)].reduce(((e,t)=>e.concat(t)),[])),x.all(m).then((function(e){return d.schemaMeta.length>0&&t.isWellDefined(d.schema),d}))},loadExtensions:function(e){return[]},GET:async function(t,r){let n;return(n=t.match("^data:([^,]+),(.*)$"))?Promise.resolve({text:n[2],url:n[0]}):t.match("^(blob:)?[a-z]+://.")?async function(t,r){if("function"!=typeof e.fetch)throw Error(`Unable to fetch ${t} with fetch=${e.fetch}`);let n;try{n=await e.fetch(t,{headers:{Accept:"text/shex,text/turtle,*/*"}})}catch(e){throw Error(`GET <${t}> network failure: ${e.message}`)}if(!n.ok)throw Error(`GET <${t}> failed: ${n.status} ${n.statusText}`);return{text:await n.text(),url:t}}(t):(()=>{throw Error(`Don't know how to fetch ${t}`)})()},loadShExImports_NotUsed:function(e,r,n){const i=[e],a={type:"Schema"};return s.GET(e).then((function e(o){const u=r.parse(o.text),c=u.imports;if(delete u.imports,t.merge(a,u,!1,!0),c){const t=c.map((function(e){return n?n(e):e})).filter((function(e){return-1===i.indexOf(e)}));return Promise.all(t.map((t=>(i.push(t),s.GET(t).then(e))))).then((e=>null))}return null})).then((function(){return t.isWellDefined(a),a}))}};return s;function i(e,r,n,i,a,o,u){return e.map((async e=>"object"==typeof e?async function(e){const r=c(e.url,n);try{return t.merge(a,e.schema,!0,!0),r._prefixes=a._prefixes||{},r.base=a._base,u(e.schema),[n,e.url]}catch(t){const r=Error("error merging schema object "+e.schema+": "+t);throw r.stack=t.stack,r}}(e):await async function(e){return s.GET(e,n).then((function(e){return i(e.text,n,e.url,a,c(e.url,n),o,u)}))}(e)));function c(e,t){const n={mediaType:t,url:e,base:e,prefixes:{}};return r.push(n),n}}function a(e,r,s,i,a,o,u){const c=o&&"parser"in o?o.parser:n.construct(s,{},o);try{const n=c.parse(e,s);return n.base===s&&delete n.base,a.prefixes=n._prefixes||{},a.base=n._base||a.base,t.merge(i,u(n),!1,!0),Promise.resolve([r,s])}catch(e){return e.message="error parsing ShEx "+s+": "+e.message,Promise.reject(e)}}function o(e,r,n,s,i,a,o){try{const a=t.ShExJtoAS(JSON.parse(e));return t.merge(s,a,!0,!0),i.prefixes=s._prefixes,i.base=s.base,o(a),Promise.resolve([r,n])}catch(e){const t=Error("error parsing JSON "+n+": "+e);return Promise.reject(t)}}function u(t,r,n,s,i,a){return new Promise((function(a,o){new e.rdfjs.Parser({baseIRI:n,blankNodePrefix:"",format:"text/turtle"}).parse(t,(function(e,t,u){u&&(i.prefixes=u),e?o("error parsing "+n+": "+e):t?s.addQuad(t):(i.base=this._base,a([r,n]))}))}))}async function c(t,r,n,s,i,a){const o=JSON.parse(t);try{const t=await e.jsonld.toRDF(o,Object.assign({format:"application/nquads",base:n},e.jsonLdOptions||{}));return i.prefixes={},i.base=n,u(t,r,n,s,i)}catch(e){let t=e;throw"details"in t&&(t=t.details),"cause"in t&&(t=t.cause),Error("error parsing JSON-ld "+n+": "+t)}}}},509:(e,t,r)=>{const n=r(443),s="http://www.w3.org/2001/XMLSchema#",i=s+"decimal",a=s+"double",o=s+"boolean",u=[s+"integer",s+"decimal",s+"float",s+"double",s+"string",s+"boolean",s+"dateTime",s+"nonPositiveInteger",s+"negativeInteger",s+"long",s+"int",s+"short",s+"byte",s+"nonNegativeInteger",s+"unsignedLong",s+"unsignedInt",s+"unsignedShort",s+"unsignedByte",s+"positiveInteger"],c=/^[a-z][a-z0-9+.-]*:/i,p=["mininclusive","minexclusive","maxinclusive","maxexclusive"];function l(e){return e.toLowerCase()}function f(e,t){return e.push(t),e}function h(e){e||(e={});for(let t,r=1,n=arguments.length;r0?{restricts:y[O-1]}:{},{shapeExpr:y[O]})):s.addShape(y[O-2],y[O]);break;case 27:case 102:case 108:case 172:this.$={};break;case 28:this.$={abstract:!0};break;case 29:case 95:case 47:case 51:case 54:case 58:case 183:case 199:case 208:case 216:case 227:this.$=[];break;case 31:this.$=A(y[O]);break;case 32:this.$={type:"ShapeExternal"};break;case 33:y[O-2]&&(y[O-1]={type:"ShapeNot",shapeExpr:A(y[O-1])}),y[O]?(y[O].needsAtom.unshift(A(y[O-1])),delete y[O].needsAtom,this.$=y[O]):this.$=y[O-1];break;case 34:y[O-1]={type:"ShapeNot",shapeExpr:A(y[O-1])},y[O]?(y[O].needsAtom.unshift(A(y[O-1])),delete y[O].needsAtom,this.$=y[O]):this.$=y[O-1];break;case 35:y[O].needsAtom.unshift(A(y[O-1])),delete y[O].needsAtom,this.$=y[O];break;case 36:case 231:case 248:this.$=null;break;case 37:case 41:case 44:case 50:case 57:case 188:case 247:case 143:case 150:case 160:case 161:case 201:case 210:case 218:case 265:case 268:this.$=y[O];break;case 39:const w=y[O].map(A);this.$={type:"ShapeOr",shapeExprs:w,needsAtom:w};break;case 40:y[O-1].filter((e=>"ShapeAnd"===e.type)).length,y[O-1].length;const F={type:"ShapeAnd",shapeExprs:y[O-1].reduce(((e,t)=>e.concat("ShapeAnd"!==t.type||t.nested?A(t):t.shapeExprs)),[])};this.$=y[O].length>0?{type:"ShapeOr",shapeExprs:[F].concat(y[O].map(A))}:F,this.$.needsAtom=F.shapeExprs;break;case 43:case 46:case 48:case 52:case 55:case 59:this.$=y[O-1].concat(y[O]);break;case 49:this.$=S("ShapeOr",y[O-1],y[O]);break;case 53:case 56:this.$=S("ShapeAnd",y[O-1],y[O]);break;case 60:case 63:this.$=y[O-1]?{type:"ShapeNot",shapeExpr:A(y[O])}:y[O];break;case 61:this.$=!1;break;case 62:this.$=!0;break;case 64:case 73:case 78:case 80:this.$=y[O]?{type:"ShapeAnd",shapeExprs:[h({type:"NodeConstraint"},y[O-1]),y[O]]}:y[O-1];break;case 66:case 75:this.$=y[O]?S("ShapeAnd",y[O-1],[y[O]]):y[O-1];break;case 67:case 76:case 81:this.$=Object.assign(y[O-1],{nested:!0});break;case 68:case 77:case 82:this.$=s.EmptyShape;break;case 91:y[O]=y[O].substr(1,y[O].length-1);const N=y[O].indexOf(":");this.$=s.addSourceMap(s.expandPrefix(y[O].substr(0,N),s)+y[O].substr(N+1));break;case 92:y[O]=y[O].substr(1,y[O].length-1),this.$=s.addSourceMap(s.expandPrefix(y[O].substr(0,y[O].length-1),s));break;case 93:case 166:case 222:this.$=s.addSourceMap(y[O]);break;case 94:case 97:this.$=y[O-2],y[O-1].length&&(this.$.annotations=y[O-1]),y[O]&&(this.$.semActs=y[O].semActs);break;case 98:this.$=h({type:"NodeConstraint",nodeKind:"literal"},y[O]);break;case 99:-1===u.indexOf(y[O-1])&&p.forEach((function(e){e in y[O]&&s.error(new Error("Parse error: facet "+e+" not allowed for unknown datatype "+y[O-1]))})),this.$=h({type:"NodeConstraint",datatype:y[O-1]},y[O]);break;case 100:this.$={type:"NodeConstraint",values:y[O-1]};break;case 101:case 107:this.$=h({type:"NodeConstraint"},y[O]);break;case 103:case 105:case 111:case 109:-1!==Object.keys(y[O-1]).indexOf(Object.keys(y[O])[0])&&s.error(new Error("Parse error: facet "+Object.keys(y[O])[0]+" defined multiple times")),this.$=h(y[O-1],y[O]);break;case 106:this.$=h({type:"NodeConstraint"},y[O-1],y[O]?y[O]:{});break;case 112:this.$={nodeKind:"iri"};break;case 113:this.$={nodeKind:"bnode"};break;case 114:this.$={nodeKind:"nonliteral"};break;case 117:case 123:this.$=b(y[O-1],parseInt(y[O],10));break;case 118:this.$=function(e){const t=e.lastIndexOf("/");let r=e.substr(1,t-1);r=n.unescapeText(r,{".":"\\.","\\":"\\\\","?":"\\?","*":"\\*","+":"\\+","{":"\\{","}":"\\}","(":"\\(",")":"\\)","|":"\\|","^":"\\^",$:"\\$","[":"\\[","]":"\\]","/":"\\/",t:"\\t",n:"\\n",r:"\\r","-":"\\-","/":"/"});const s={pattern:r};return e.length>t+1&&(s.flags=e.substr(t+1)),s}(y[O]);break;case 119:this.$="length";break;case 120:this.$="minlength";break;case 121:this.$="maxlength";break;case 122:this.$=b(y[O-1],y[O]);break;case 124:this.$=parseInt(y[O],10);break;case 125:case 126:this.$=parseFloat(y[O]);break;case 127:y[O]===i||"http://www.w3.org/2001/XMLSchema#float"===y[O]||y[O]===a?this.$=parseFloat(y[O-2].value):-1!==u.indexOf(y[O])?this.$=parseInt(y[O-2].value):s.error(new Error("Parse error: numeric range facet expected numeric datatype instead of "+y[O]));break;case 128:this.$="mininclusive";break;case 129:this.$="minexclusive";break;case 130:this.$="maxinclusive";break;case 131:this.$="maxexclusive";break;case 132:this.$="totaldigits";break;case 133:this.$="fractiondigits";break;case 134:this.$=y[O-2]===s.EmptyShape?{type:"Shape"}:y[O-2],y[O-1].length&&(this.$.annotations=y[O-1]),y[O]&&(this.$.semActs=y[O].semActs);break;case 135:const k=y[O-1]?{expression:y[O-1]}:s.EmptyObject;this.$=k===s.EmptyObject&&y[O-3]===s.EmptyObject?s.EmptyShape:h({type:"Shape"},k,y[O-3]);break;case 136:this.$=["extends",[y[O]]];break;case 137:this.$=["extra",y[O]];break;case 138:this.$=["closed",!0];break;case 139:this.$=s.EmptyObject;break;case 140:y[O-1]===s.EmptyObject&&(y[O-1]={}),"closed"===y[O][0]?y[O-1].closed=!0:y[O][0]in y[O-1]?y[O-1][y[O][0]]=d(y[O-1][y[O][0]],y[O][1]):y[O-1][y[O][0]]=y[O][1],this.$=y[O-1];break;case 149:this.$={type:"OneOf",expressions:d([y[O-1]],y[O])};break;case 155:case 182:this.$=y[O-1];break;case 159:this.$={type:"EachOf",expressions:d([y[O-2]],y[O-1])};break;case 164:y[O-1]?(this.$=h({id:y[O-1]},y[O]),s.addProduction(y[O-1],this.$)):this.$=y[O];break;case 171:this.$=y[O-4],"min"in y[O-2]&&(this.$.min=y[O-2].min),"max"in y[O-2]&&(this.$.max=y[O-2].max),y[O-1].length&&(this.$.annotations=y[O-1]),y[O]&&(this.$.semActs="semActs"in y[O-4]?y[O-4].semActs.concat(y[O].semActs):y[O].semActs);break;case 174:y[O-3],s.EmptyShape,0,this.$=h({type:"TripleConstraint"},y[O-5],{predicate:y[O-4]},y[O-3]===s.EmptyShape?{}:{valueExpr:y[O-3]},y[O-2],y[O]),y[O-1].length&&(this.$.annotations=y[O-1]);break;case 177:this.$={min:0,max:-1};break;case 178:this.$={min:1,max:-1};break;case 179:this.$={min:0,max:1};break;case 180:y[O]=y[O].substr(1,y[O].length-2);const L=y[O].match(/(\d+)/g);this.$={min:parseInt(L[0],10)},2===L.length?this.$.max=parseInt(L[1],10):-1===y[O].indexOf(",")?this.$.max=parseInt(L[0],10):this.$.max=-1;break;case 181:this.$={inverse:!0};break;case 195:this.$={type:"IriStemRange",stem:{type:"Wildcard"},exclusions:y[O]};break;case 196:this.$={type:"LiteralStemRange",stem:{type:"Wildcard"},exclusions:y[O]};break;case 197:this.$={type:"LanguageStemRange",stem:{type:"Wildcard"},exclusions:y[O]};break;case 198:y[O]?(this.$={type:y[O].length?"IriStemRange":"IriStem",stem:y[O-1]},y[O].length&&(this.$.exclusions=y[O])):this.$=y[O-1];break;case 204:this.$=y[O]?{type:"IriStem",stem:y[O-1]}:y[O-1];break;case 207:y[O]?(this.$={type:y[O].length?"LiteralStemRange":"LiteralStem",stem:y[O-1].value},y[O].length&&(this.$.exclusions=y[O])):this.$=y[O-1];break;case 213:this.$=y[O]?{type:"LiteralStem",stem:y[O-1].value}:y[O-1].value;break;case 214:y[O]?(this.$={type:y[O].length?"LanguageStemRange":"LanguageStem",stem:y[O-1]},y[O].length&&(this.$.exclusions=y[O])):this.$={type:"Language",languageTag:y[O-1]};break;case 215:this.$={type:y[O].length?"LanguageStemRange":"LanguageStem",stem:""},y[O].length&&(this.$.exclusions=y[O]);break;case 221:this.$=y[O]?{type:"LanguageStem",stem:y[O-1]}:y[O-1];break;case 223:this.$={type:"Annotation",predicate:y[O-1],object:y[O]};break;case 226:this.$=y[O].length?{semActs:y[O]}:null;break;case 229:this.$=y[O]?(T=y[O-1],I=(I=y[O]).substring(1,I.length-2),{type:"SemAct",name:T,code:n.unescapeText(I,_)}):{type:"SemAct",name:y[O-1]};break;case 236:this.$="http://www.w3.org/1999/02/22-rdf-syntax-ns#type";break;case 242:this.$=m(y[O],"http://www.w3.org/2001/XMLSchema#integer");break;case 243:this.$=m(y[O],i);break;case 244:this.$=m(y[O],a);break;case 246:this.$=y[O]?h(y[O-1],{type:y[O]}):y[O-1];break;case 250:this.$={value:"true",type:o};break;case 251:this.$={value:"false",type:o};break;case 252:case 254:this.$=g(y[O],1);break;case 253:case 255:this.$=g(y[O],3);break;case 256:case 258:this.$=E(y[O],1);break;case 257:case 259:this.$=E(y[O],3);break;case 260:const R=n.unescapeText(y[O].slice(1,-1),{});this.$=null===s._base||c.test(R)?R:s._resolveIRI(R);break;case 262:const C=y[O].indexOf(":");this.$=s.expandPrefix(y[O].substr(0,C),s)+n.unescapeText(y[O].substr(C+1),x);break;case 263:this.$=s.expandPrefix(y[O].substr(0,y[O].length-1),s)}var T,I}};const{JisonLexer:Yp}=r(752);class el extends Yp{constructor(e={}){super(e),this.options={moduleName:"ShExJison"},this.rules=[/^(?:\s+|(#[^\u000a\u000d]*|\/\*([^*]|\*([^/]|\\\/))*\*\/))/,/^(?:(@(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?)?:)(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|:|[0-9]|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.|:|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))*))))/,/^(?:(@((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?)?:)))/,/^(?:(@([A-Za-z])+((-([0-9A-Za-z])+))*))/,/^(?:@)/,/^(?:(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?)?:)(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|:|[0-9]|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.|:|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))*)))/,/^(?:(\{((([+-])?([0-9])+))((,(((([+-])?([0-9])+))|\*)?))?\}))/,/^(?:(([+-])?((([0-9])+\.([0-9])*(([Ee]([+-])?([0-9])+)))|((\.)?([0-9])+(([Ee]([+-])?([0-9])+))))))/,/^(?:(([+-])?([0-9])*\.([0-9])+))/,/^(?:(([+-])?([0-9])+))/,/^(?:{ANON})/,/^(?:(<([^\u0000-\u0020<>\"{}|^`\\]|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*>))/,/^(?:((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?)?:))/,/^(?:a\b)/,/^(?:(\/([^\u002f\u005C\u000A\u000D]|\\[nrt\\|.?*+(){}$\u002D\u005B\u005D\u005E/]|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))+\/[smix]*))/,/^(?:(_:((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|[0-9])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?))/,/^(?:(\{([^%\\]|\\[%\\]|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*%\}))/,/^(?:('''(('|'')?([^\'\\]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))))*'''(@([A-Za-z])+((-([0-9A-Za-z])+))*)))/,/^(?:("""(("|"")?([^\"\\]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))))*"""(@([A-Za-z])+((-([0-9A-Za-z])+))*)))/,/^(?:('([^\u0027\u005c\u000a\u000d]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*'(@([A-Za-z])+((-([0-9A-Za-z])+))*)))/,/^(?:("([^\u0022\u005c\u000a\u000d]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*"(@([A-Za-z])+((-([0-9A-Za-z])+))*)))/,/^(?:('''(('|'')?([^\'\\]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))))*'''))/,/^(?:("""(("|"")?([^\"\\]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))))*"""))/,/^(?:('([^\u0027\u005c\u000a\u000d]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*'))/,/^(?:("([^\u0022\u005c\u000a\u000d]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*"))/,/^(?:([Bb][Aa][Ss][Ee]))/,/^(?:([Pp][Rr][Ee][Ff][Ii][Xx]))/,/^(?:([iI][mM][pP][oO][rR][tT]))/,/^(?:([sS][tT][aA][rR][tT]))/,/^(?:([eE][xX][tT][eE][rR][nN][aA][lL]))/,/^(?:([Aa][Bb][Ss][Tt][Rr][Aa][Cc][Tt]))/,/^(?:([Rr][Ee][Ss][Tt][Rr][Ii][Cc][Tt][Ss]))/,/^(?:([Ee][Xx][Tt][Ee][Nn][Dd][Ss]))/,/^(?:([Cc][Ll][Oo][Ss][Ee][Dd]))/,/^(?:([Ee][Xx][Tt][Rr][Aa]))/,/^(?:([Ll][Ii][Tt][Ee][Rr][Aa][Ll]))/,/^(?:([Bb][Nn][Oo][Dd][Ee]))/,/^(?:([Ii][Rr][Ii]))/,/^(?:([Nn][Oo][Nn][Ll][Ii][Tt][Ee][Rr][Aa][Ll]))/,/^(?:([Aa][Nn][Dd]))/,/^(?:([Oo][Rr]))/,/^(?:([No][Oo][Tt]))/,/^(?:([Mm][Ii][Nn][Ii][Nn][Cc][Ll][Uu][Ss][Ii][Vv][Ee]))/,/^(?:([Mm][Ii][Nn][Ee][Xx][Cc][Ll][Uu][Ss][Ii][Vv][Ee]))/,/^(?:([Mm][Aa][Xx][Ii][Nn][Cc][Ll][Uu][Ss][Ii][Vv][Ee]))/,/^(?:([Mm][Aa][Xx][Ee][Xx][Cc][Ll][Uu][Ss][Ii][Vv][Ee]))/,/^(?:([Ll][Ee][Nn][Gg][Tt][Hh]))/,/^(?:([Mm][Ii][Nn][Ll][Ee][Nn][Gg][Tt][Hh]))/,/^(?:([Mm][Aa][Xx][Ll][Ee][Nn][Gg][Tt][Hh]))/,/^(?:([Tt][Oo][Tt][Aa][Ll][Dd][Ii][Gg][Ii][Tt][Ss]))/,/^(?:([Ff][Rr][Aa][Cc][Tt][Ii][Oo][Nn][Dd][Ii][Gg][Ii][Tt][Ss]))/,/^(?:=)/,/^(?:\/\/)/,/^(?:\{)/,/^(?:\})/,/^(?:&)/,/^(?:\|\|)/,/^(?:\|)/,/^(?:,)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\$)/,/^(?:!)/,/^(?:\^\^)/,/^(?:\^)/,/^(?:\.)/,/^(?:~)/,/^(?:;)/,/^(?:\*)/,/^(?:\+)/,/^(?:\?)/,/^(?:-)/,/^(?:%)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:$)/,/^(?:[a-zA-Z0-9_-]+)/,/^(?:.)/],this.conditions={INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79],inclusive:!0}}}performAction(e,t,r,n){switch(r){case 0:break;case 1:return 79;case 2:return 80;case 3:return t.yytext=t.yytext.substr(1),185;case 4:return 81;case 5:return 215;case 6:return 159;case 7:return 109;case 8:return 108;case 9:return 100;case 10:return"ANON";case 11:return 19;case 12:return 21;case 13:return 199;case 14:return 101;case 15:return 216;case 16:return 195;case 17:return 211;case 18:return 213;case 19:return 210;case 20:return 212;case 21:return 207;case 22:return 209;case 23:return 206;case 24:return 208;case 25:return 18;case 26:return 20;case 27:return 23;case 28:return 26;case 29:return 39;case 30:return 36;case 31:return 220;case 32:return 218;case 33:return 125;case 34:return 127;case 35:return 85;case 36:return 97;case 37:return 96;case 38:return 98;case 39:return 53;case 40:return 51;case 41:return 43;case 42:return 112;case 43:return 113;case 44:return 114;case 45:return 115;case 46:return 102;case 47:return 103;case 48:return 104;case 49:return 116;case 50:return 117;case 51:return 27;case 52:return 190;case 53:return 119;case 54:return 121;case 55:return 189;case 56:return"||";case 57:return 135;case 58:return 140;case 59:return 69;case 60:return 70;case 61:return 161;case 62:return 163;case 63:return 148;case 64:return"!";case 65:return 111;case 66:return 160;case 67:return 71;case 68:return 178;case 69:return 141;case 70:return 156;case 71:return 157;case 72:return 158;case 73:return 179;case 74:return 193;case 75:return 204;case 76:return 205;case 77:return 7;case 78:return'unexpected word "'+t.yytext+'"';case 79:return"invalid character "+t.yytext}}}},931:(e,t,r)=>{const n=function(){const e=r(509).Fm,t=/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i,n=/(?:^|\/)\.\.?(?:$|[\/#?])/;class s{constructor(){this.blankId=0,this._fileName=void 0,this.EmptyObject={},this.EmptyShape={type:"Shape"}}reset(){this._prefixes=this._imports=this._sourceMap=this.shapes=this.productions=this.start=this.startActs=null,this._base=this._baseIRI=this._baseIRIPath=this._baseIRIRoot=null}_setFileName(e){this._fileName=e}blank(){return"_:b"+this.blankId++}_resetBlanks(e){this.blankId=void 0===e?0:e}_setBase(e){e||(e=null),(this._base=e)&&(this._basePath=e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(t),this._baseRoot=e[0],this._baseScheme=e[1])}_resolveIRI(e){switch(e[0]){case void 0:return this._base;case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return("/"===e[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!n.test(e))return e;const t=e.length;let r="",s=-1,i=-1,a="/",o=0;for(;s=i&&(r=r.substr(0,o)),"/"!==a)return r+"/"+e.substr(s+1);o=s+1}}}a=e[++s]}return r+e.substring(o)}error(e){const t={text:this.lexer.match,line:this.lexer.yylineno,loc:this.lexer.yylloc,pos:this.lexer.showPosition()};if(e.hash=t,!this.recoverable)throw e;this.recoverable(e)}expandPrefix(e){return e in this._prefixes||this.error(new Error('Parse error; unknown prefix "'+e+':"')),this._prefixes[e]}addShape(e,t){t===this.EmptyShape&&(t={type:"Shape"}),this.productions&&e in this.productions&&this.error(new Error("Structural error: "+e+" is a triple expression")),this.shapes||(this.shapes={}),e in this.shapes?"replace"===this.options.duplicateShape?this.shapes[e]=t:"ignore"!==this.options.duplicateShape&&this.error(new Error("Parse error: "+e+" already defined")):this.shapes[e]=Object.assign({id:e},t)}addProduction(e,t){this.shapes&&e in this.shapes&&this.error(new Error("Structural error: "+e+" is a shape expression")),this.productions||(this.productions={}),e in this.productions?"replace"===this.options.duplicateShape?this.productions[e]=t:"ignore"!==this.options.duplicateShape&&this.error(new Error("Parse error: "+e+" already defined")):this.productions[e]=t}addSourceMap(e){this._sourceMap||(this._sourceMap=new Map);let t=this._sourceMap.get(e);return t||this._sourceMap.set(e,t=[]),t.push(this.lexer.yylloc),e}}return{construct:function(t,r,n){n=n||{};const i={};for(const e in r||{})i[e]=r[e];const a=new e(s),o=a.parse;return a.parse=function(e,r=t,u=n,c=null){const p=globalThis.PS=new s;p._prefixes=Object.create(i),p._imports=[],p._setBase(r),p._setFileName(t),p.options=n;let l=[];p.recoverable=e=>l.push(e);let f=null;try{f=o.call(a,e,p)}catch(e){l.push(e)}if(p.reset(),l.forEach((e=>{if("hash"in e){const t=e.hash,r=t.loc;delete t.loc,Object.assign(e,t,{location:r})}return e})),1==l.length)throw l[0].parsed=f,l[0];if(l.length){const e=new Error(l.length+" parser errors:\n"+l.map((e=>function(e,r){const n=e.location.first_line,s=e.location.first_column+1,i="pos"in e.hash?"\n"+e.hash.pos:"";return`${t}\n line: ${n}, column: ${s}: ${e.message}${i}`}(e,a.yy.lexer))).join("\n"));throw e.errors=l,e.parsed=f,e}return f},a._setBase=function(e){t=e},a}}}();e.exports=n},118:e=>{const t=function(){const e=/^[a-z][a-z0-9+.-]*:/i,t=/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i,r=/(?:^|\/)\.\.?(?:$|[\/#?])/,n="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",s="http://www.w3.org/2001/XMLSchema#string";function i(e){if(!r.test(e))return e;const t=e.length;let n="",s=-1,i=-1,a=0,o="/";for(;s=i&&(n=n.substr(0,a)),"/"!==o)return n+"/"+e.substr(s+1);a=s+1}}}o=e[++s]}return n+e.substring(a)}function a(e){switch(e.termType){case"NamedNode":return e.value;case"BlankNode":return"_:"+e.value;case"Literal":return'"'+e.value.replace(/"/g,'\\"')+'"'+(e.datatypeString===n?"@"+e.language:e.datatypeString===s?"":"^^"+e.datatypeString);default:throw Error("unknown RDFJS node type: "+JSON.stringify(e))}}function o(e,t){if(u(e))return t.namedNode(e);if(p(e))return t.blankNode(e.substr(2));if(c(e)){let r=h(e)||(f(e)===s?null:t.namedNode(f(e)));return t.literal(l(e),r)}throw Error("Unknown internal term type: "+JSON.stringify(e))}function u(e){if("string"!=typeof e)return!1;if(0===e.length)return!0;{const t=e[0];return'"'!==t&&"_"!==t}}function c(e){return"string"==typeof e&&'"'===e[0]}function p(e){return"string"==typeof e&&"_:"===e.substr(0,2)}function l(e){const t=/^"([^]*)"/.exec(e);if(!t)throw new Error(e+" is not a literal");return t[1].replace(/\\"/g,'"')}function f(e){const t=/^"[^]*"(?:\^\^([^"]+)|(@)[^@"]+)?$/.exec(e);if(!t)throw new Error(e+" is not a literal");return t[1]||(t[2]?n:s)}function h(e){const t=/^"[^]*"(?:@([^@"]+)|\^\^[^"]+)?$/.exec(e);if(!t)throw new Error(e+" is not a literal");return t[1]?t[1].toLowerCase():""}const d=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,m=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,y={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};function _(e){let t=y[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}return{RdfLangString:n,XsdString:s,resolveRelativeIRI:function(r,n){if(e.test(n))return n;switch(n[0]){case void 0:return r;case"#":return r+n;case"?":return r.replace(/(?:\?.*)?$/,n);case"/":let e=r.match(t);return("/"===n[1]?e[1]:e[0])+i(n);default:return i(r.replace(/[^\/?]*(?:\?.*)?$/,"")+n)}},isIRI:u,isLiteral:c,isBlank:p,isDefaultGraph:function(e){return!e},inDefaultGraph:function(e){return!e.graph},getLiteralValue:l,getLiteralType:f,getLiteralLanguage:h,internalTerm:a,internalTriple:function(e){return{subject:a(e.subject),predicate:a(e.predicate),object:a(e.object)}},externalTerm:o,externalTriple:function(e,t){return t.quad(o(e.subject,t),o(e.predicate,t),o(e.object,t))},internalTermToTurtle:function(e,t,r){if(u(e)){d.test(e)&&(e=e.replace(m,_));const n=Object.keys(r).find((t=>e.startsWith(r[t])));if(n){const t=e.substr(r[n].length);if(-1===t.indexOf("\\"))return n+":"+t.replace(/([~!$&'()*+,;=/?#@%])/g,"\\$1")}return e.startsWith(t)?"<"+e.substr(t.length)+">":"<"+e+">"}if(p(e))return e;if(c(e)){let n=l(e);const s=f(e),i=h(e);return d.test(n)&&(n=n.replace(m,_)),i?'"'+n+'"@'+i:s&&"http://www.w3.org/2001/XMLSchema#string"!==s?'"'+n+'"^^'+this.internalTermToTurtle(s,t,r):'"'+n+'"'}throw Error("Unknown internal term type: "+JSON.stringify(e))}}}();e.exports=t},443:(t,r,n)=>{const s=function(){const t=n(118),r=n(806),s=n(515),i={_namespace:"http://www.w3.org/ns/shex#"};["Schema","@context","imports","startActs","start","shapes","ShapeDecl","ShapeOr","ShapeAnd","shapeExprs","nodeKind","NodeConstraint","iri","bnode","nonliteral","literal","datatype","length","minlength","maxlength","pattern","flags","mininclusive","minexclusive","maxinclusive","maxexclusive","totaldigits","fractiondigits","values","ShapeNot","shapeExpr","Shape","abstract","closed","extra","expression","extends","restricts","semActs","ShapeRef","reference","ShapeExternal","EachOf","OneOf","expressions","min","max","annotation","TripleConstraint","inverse","negated","predicate","valueExpr","Inclusion","include","Language","languageTag","IriStem","LiteralStem","LanguageStem","stem","IriStemRange","LiteralStemRange","LanguageStemRange","exclusion","Wildcard","SemAct","name","code","Annotation","object"].forEach((e=>{i[e]=i._namespace+e}));const a={_namespace:"http://www.w3.org/1999/02/22-rdf-syntax-ns#"};["type","first","rest","nil"].forEach((e=>{a[e]=a._namespace+e}));const o={_namespace:"http://www.w3.org/2001/XMLSchema#"};["anyURI"].forEach((e=>{o[e]=o._namespace+e}));const u={_namespace:"http://www.w3.org/2002/07/owl#"};["Thing"].forEach((e=>{u[e]=u._namespace+e}));const c={};function p(e){e||(e={});for(let t,r=1,n=arguments.length;rt.set(e.id,null)));const r=this.ShExRVisitor(t);return"start"in e&&(e.start=r.visitShapeExpr(e.start)),"shapes"in e&&(e.shapes=e.shapes.map(((e,n)=>e.type===i.ShapeDecl?{type:"ShapeDecl",id:e.id,abstract:e.abstract,shapeExpr:r.visitShapeExpr(e.shapeExpr)}:t.get(e.id)?t.get(e.id):(()=>{const n=r.keepShapeExpr(e);return t.set(e.id,n),n})()))),r.cleanIds(),e},valGrep:function(e,t,r){const n=this,s=[];for(let i in e){const a=e[i];"object"==typeof a&&("type"in a&&a.type===t&&s.push(r(a)),s.push.apply(s,n.valGrep(a,t,r)))}return s},n3jsToTurtle:function(e){return this.valGrep(e,"TestedTriple",(function(e){return["subject","predicate","object"].map((r=>{return"object"==typeof(n=e[r])?'"'+n.value+'"'+("type"in n?"^^<"+n.type+">":"language"in n?"@"+n.language:""):t.isIRI(n)?"<"+n+">":t.isBlank(n)?n:"???";var n})).join(" ")+" ."}))},valToN3js:function(e,r){return this.valGrep(e,"TestedTriple",(function(e){const n=JSON.parse(JSON.stringify(e));return"object"==typeof e.object&&(n.object='"'+e.object.value+'"'+("type"in e.object?"^^"+e.object.type:"language"in e.object?"@"+e.object.language:"")),t.externalTriple(n,r)}))},n3jsToTurtle:function(e){return e.map((function(e){return["subject","predicate","object"].map((r=>function(e){if(t.isIRI(e))return"<"+e+">";if(t.isBlank(e))return e;const r=t.getLiteralType(e);return r&&"http://www.w3.org/2001/XMLSchema#string"!==r?'"'+t.getLiteralValue(e)+'"^^<'+r+">":e}(e[r]))).join(" ")+" ."}))},canonicalize:function(e,t){const r=JSON.parse(JSON.stringify(e));r["@context"]=r["@context"]||"http://www.w3.org/ns/shex.jsonld",delete r._prefixes,delete r._base;let n=r._index||this.index(e);delete r._index;r._sourceMap;delete r._sourceMap;const s=f.Visitor(),i=[],a=s.visitInclusion,o=s.visitExpression;return s.visitInclusion=function(e){return-1===i.indexOf(e)&&e in n.tripleExprs?(i.push(e),o.call(s,n.tripleExprs[e])):a.call(s,e)},s.visitExpression=function(e){return"object"==typeof e&&"id"in e?-1===i.indexOf(e.id)?(i.push(e.id),o.call(s,n.tripleExprs[e.id])):e.id:o.call(s,e)},t&&(s.visitIRI=function(e){return e.replace(t,"")},"imports"in r&&(r.imports=s.visitImports(r.imports))),"shapes"in r&&(r.shapes=Object.keys(n.shapeExprs).map((e=>("extra"in n.shapeExprs[e]&&n.shapeExprs[e].extra.sort(),s.visitShapeDecl(n.shapeExprs[e]))))),r},BiDiClosure:function(){return{needs:{},neededBy:{},inCycle:[],test:function(){function e(e,t){const r=JSON.stringify(e),n=JSON.stringify(t);if(r!==n)throw Error(r+" !== "+n)}this.add(2,3),e(this.needs,{2:[3]}),e(this.neededBy,{3:[2]}),this.add(1,2),e(this.needs,{1:[2,3],2:[3]}),e(this.neededBy,{3:[2,1],2:[1]}),this.add(1,3),e(this.needs,{1:[2,3],2:[3]}),e(this.neededBy,{3:[2,1],2:[1]}),this.add(3,4),e(this.needs,{1:[2,3,4],2:[3,4],3:[4]}),e(this.neededBy,{3:[2,1],2:[1],4:[3,2,1]}),this.add(6,7),e(this.needs,{6:[7],1:[2,3,4],2:[3,4],3:[4]}),e(this.neededBy,{7:[6],3:[2,1],2:[1],4:[3,2,1]}),this.add(5,6),e(this.needs,{5:[6,7],6:[7],1:[2,3,4],2:[3,4],3:[4]}),e(this.neededBy,{7:[6,5],6:[5],3:[2,1],2:[1],4:[3,2,1]}),this.add(5,7),e(this.needs,{5:[6,7],6:[7],1:[2,3,4],2:[3,4],3:[4]}),e(this.neededBy,{7:[6,5],6:[5],3:[2,1],2:[1],4:[3,2,1]}),this.add(7,8),e(this.needs,{5:[6,7,8],6:[7,8],7:[8],1:[2,3,4],2:[3,4],3:[4]}),e(this.neededBy,{7:[6,5],6:[5],8:[7,6,5],3:[2,1],2:[1],4:[3,2,1]}),this.add(4,5),e(this.needs,{1:[2,3,4,5,6,7,8],2:[3,4,5,6,7,8],3:[4,5,6,7,8],4:[5,6,7,8],5:[6,7,8],6:[7,8],7:[8]}),e(this.neededBy,{2:[1],3:[2,1],4:[3,2,1],5:[4,3,2,1],6:[5,4,3,2,1],7:[6,5,4,3,2,1],8:[7,6,5,4,3,2,1]})},add:function(e,t,r){const n=this;e in n.needs||(n.needs[e]=[]),t in n.neededBy||(n.neededBy[t]=[]),n.needs[e]=n.needs[e].concat([t],n.needs[t]).filter((function(e,t,r){return void 0!==e&&r.indexOf(e)===t})),n.neededBy[t]=n.neededBy[t].concat([e],n.neededBy[e]).filter((function(e,t,r){return void 0!==e&&r.indexOf(e)===t})),e in this.neededBy&&this.neededBy[e].forEach((function(e){n.needs[e]=n.needs[e].concat([t],n.needs[t]).filter((function(e,t,r){return void 0!==e&&r.indexOf(e)===t}))})),t in this.needs&&this.needs[t].forEach((function(t){n.neededBy[t]=n.neededBy[t].concat([e],n.neededBy[e]).filter((function(e,t,r){return void 0!==e&&r.indexOf(e)===t}))})),-1!==n.needs[e].indexOf(e)&&(n.inCycle=n.inCycle.concat(n.needs[e]))},trim:function(){function e(e){for(let t=e.length-1;t>-1;--t)e.indexOf(e[t]){let t=n.shapeExprs[e];if(o(e,null),t=r.skipDecl(t),"Shape"===t.type)"extends"in t&&t.extends.forEach((e=>o(e,t))),"expression"in t&&(r.simpleTripleConstraints(t)||[]).forEach((t=>{o(r.getValueType(t.valueExpr,!0),{type:"tc",shapeLabel:e,tc:t})}));else if("NodeConstraint"!==t.type)throw Error("nestShapes currently only supports Shapes and NodeConstraints")}));let a=Object.keys(i).filter((e=>1===i[e].length&&"tc"===i[e][0].type&&e in n.shapeExprs&&"Shape"===r.skipDecl(n.shapeExprs[e]).type&&!n.shapeExprs[e].abstract)).filter((e=>!("noNestPattern"in t)||!e.match(RegExp(t.noNestPattern)))).reduce(((e,t)=>(e[t]={referrer:i[t][0].shapeLabel,predicate:i[t][0].tc.predicate},e)),{});if(!t.no){let o={};if(t.rename){"transform"in t||(t.transform=function(){let e=s.reduce(((e,t,r)=>(e[t]="_:renamed"+r,e)),{});return function(t,r){return e[t]}}()),Object.keys(a).forEach((e=>{let r=n.shapeExprs[e],u=t.transform(e,r);if(o[e]=r.id=u,s[s.indexOf(e)]=u,a[u]=a[e],a[u].was=e,delete a[e],n.shapeExprs[u]=n.shapeExprs[e],delete n.shapeExprs[e],1!==i[e].length)throw Error("assertion: "+e+" doesn't have one reference: ["+i[e]+"]");let c=i[e][0];if("tc"!==c.type)throw"Shape"===c.type?Error("assertion: rename not implemented for Shape: "+c):Error("assertion: "+c.type+" not TripleConstraint or Shape");if("string"!=typeof c.tc.valueExpr)throw Error("assertion: rename not implemented for TripleConstraint expr: "+c.tc.valueExpr);c.tc.valueExpr=u})),Object.keys(a).forEach((e=>{let t=a[e];t.referrer in o&&(t.newReferrer=o[t.referrer])}));let e={};s.forEach((t=>e[t]=n.shapeExprs[t])),n.shapeExprs=e}else{const t=[],s=e.shapes.map((e=>e.id));Object.keys(a).forEach((a=>{const o=n.shapeExprs[a];i[a][0].tc.valueExpr=r.skipDecl(o);const u=s.indexOf(a);if(e.shapes[u].id!==a)throw Error("assertion: found "+e.shapes[u].id+" instead of "+a);t.push(u),delete n.shapeExprs[a]})),t.sort(((e,t)=>t-e)).forEach((t=>{const r=e.shapes[t].id;if(!a[r])throw Error("deleting unexpected shape "+r);delete e.shapes[t].id,e.shapes.splice(t,1)}))}}return a;function o(e,t){e in i||(i[e]=[]),t&&i[e].push(t)}},getPredicateUsage:function(e,t={}){const r=this;let n=s.create();Object.keys(e.shapes).forEach((t=>{let s=r.skipDecl(e.shapes[t]);"Shape"===s.type&&(s.extends||[]).forEach((e=>n.add(e.reference,t)))})),Object.keys(e.shapes).forEach((e=>{e in n.parents||(n.parents[e]=[])}));let i={};return Object.keys(e.shapes).forEach((s=>{let a=r.skipDecl(e.shapes[s]);if("Shape"===a.type){(r.simpleTripleConstraints(a)||[]).forEach((e=>{let a=r.getValueType(e.valueExpr);if(e.predicate in i){i[e.predicate].uses.push(s);let r=i[e.predicate].commonType;if("object"==typeof r||null===r)t[e.predicate].references.push({shapeLabel:s,newType:a});else if("object"==typeof a)i[e.predicate].commonType=null,t[e.predicate]={shapeLabel:s,predicate:e.predicate,curType:r,newType:a,references:[]};else if(r===a);else if(n.parents[r]&&-1!==n.parents[r].indexOf(a))i[e.predicate].polymorphic=!0;else{let o=n.parents[a]?n.parents[a].indexOf(r):-1;if(-1===o){let o=n.parents[r]?n.parents[r].filter((e=>-1!==n.parents[a].indexOf(e))):[];0===o.length?(t[e.predicate]={shapeLabel:s,predicate:e.predicate,curType:r,newType:a,references:[]},i[e.predicate].commonType=null):(i[e.predicate].commonType=o[0],i[e.predicate].polymorphic=!0)}else i[e.predicate].commonType=n.parents[a][o],i[e.predicate].polymorphic=!0}}else i[e.predicate]={uses:[s],commonType:a,polymorphic:!1},"object"==typeof a&&(t[e.predicate]={shapeLabel:s,predicate:e.predicate,newType:a,references:[]})}))}})),i},simpleTripleConstraints:function(e){if(!("expression"in e))return[];if("TripleConstraint"===e.expression.type)return[e.expression];if("EachOf"===e.expression.type&&!e.expression.expressions.find((e=>"TripleConstraint"!==e.type)))return e.expression.expressions;throw Error("can't (yet) express "+JSON.stringify(e))},skipDecl:function(e){return"ShapeDecl"===e.type?e.shapeExpr:e},getValueType:function(e){return"string"==typeof e?e:e.reference?e.reference:"iri"===e.nodeKind?u.Thing:e.datatype?e.datatype:e},getDependencies:function(e,t){return t=t||this.BiDiClosure(),(e.shapes||[]).forEach((function(e){function r(n,s){if("string"==typeof n)t.add(e.id,n);else if("ShapeOr"===n.type||"ShapeAnd"===n.type)n.shapeExprs.forEach((function(e){r(e,s)}));else if("ShapeNot"===n.type)r(n.shapeExpr,1^s);else if("Shape"===n.type)!function(e,n){function s(n,i){function a(e,t){e.forEach((function(e){s(e,t)}))}function o(n,s){if(n.valueExpr&&r(n.valueExpr,s),s&&-1!==t.inCycle.indexOf(e.id))throw Error("Structural error: "+e.id+" appears in negated cycle")}if("string"==typeof n)t.add(e.id,n);else if("id"in n&&t.addIn(n.id,e.id),"TripleConstraint"===n.type)o(n,i);else{if("OneOf"!==n.type&&"EachOf"!==n.type)throw Error("expected {TripleConstraint,OneOf,EachOf,Inclusion} in "+n);a(n.expressions)}}["extends","restricts"].forEach((r=>{e[r]&&e[r].length>0&&e[r].forEach((function(r){t.add(e.id,r)}))})),e.expression&&s(e.expression,n)}(n,s);else if("NodeConstraint"===n.type);else if("ShapeExternal"!==n.type)throw Error("expected Shape{And,Or,Ref,External} or NodeConstraint in "+JSON.stringify(n))}"ShapeDecl"===e.type&&(e=e.shapeExpr),r(e,0)})),t},partition:function(e,t,r,n){const s=e._index||this.index(e),i={shapeExprs:new Map,tripleExprs:new Map};t=t instanceof Array?t:[t],r=r||this.getDependencies(e),n=n||function(e,t){throw new Error("Error: can't find shape "+(t?t+" dependency "+e:e))};const a={};for(let t in e)a[t]="shapes"===t?[]:e[t];return t.forEach((function(e){if(e in i.shapeExprs);else if(e in s.shapeExprs){const t=s.shapeExprs[e];a.shapes.push(t),i.shapeExprs[t.id]=t,e in r.needs&&r.needs[e].forEach((function(t){if(t in r.foundIn&&(t=r.foundIn[t]),t in i.shapeExprs);else if(t in s.shapeExprs){const e=s.shapeExprs[t];a.shapes.push(e),i.shapeExprs[e.id]=e}else n(t,e)}))}else n(e,"supplied")})),a},flatten:function(e,t,r){return this.Visitor().visitSchema(e)},emptySchema:function(){return{type:"Schema"}},merge:function(e,t,r,n){const s=n?e:this.emptySchema();var i;"_base"in e&&(s._base=e._base),"_base"in t&&("_base"in e&&!r||(s._base=t._base)),i="_prefixes",Object.keys(e[i]||{}).forEach((function(t){i in s||(s[i]={}),s[i][t]=e[i][t]})),Object.keys(t[i]||{}).forEach((function(n){i in e&&n in e[i]&&!r||(i in s||(s[i]={}),s[i][n]=t[i][n])})),function(n){(e[n]||new Map).forEach((function(t,r,i){n in s||(s[n]=new Map),s[n].set(r,e[n].get(r))})),(t[n]||new Map).forEach((function(i,a,o){n in e&&e[n].has(a)&&!r||(n in s||(s[n]=new Map),s[n].set(a,t[n].get(a)))}))}("_sourceMap"),"imports"in t&&("imports"in e&&!r||(s.imports=t.imports)),"startActs"in e&&(s.startActs=e.startActs),"startActs"in t&&("startActs"in e&&!r||(s.startActs=t.startActs)),"start"in e&&(s.start=e.start),"start"in t&&("start"in e&&!r||(s.start=t.start));let a=e._index||this.index(e);return n||(e.shapes||[]).forEach((function(e){"shapes"in s||(s.shapes=[]),s.shapes.push(e)})),(t.shapes||[]).forEach((function(t){"shapes"in e&&t.id in a.shapeExprs&&!r||("shapes"in s||(s.shapes=[]),s.shapes.push(t))})),(e._index||t._index)&&(s._index=this.index(s)),s},absolutizeResults:function(e,r){function n(e,n){-1!==["shape","reference","node","subject","predicate","object"].indexOf(e)&&t.isIRI(n[e])&&(n[e]=t.resolveRelativeIRI(r,n[e]))}return function e(t){Object.keys(t).forEach((function(r){"object"==typeof t[r]&&e(t[r]),n&&n(r,t)}))}(e),e},getProofGraph:function(e,r,n){return function e(s){if("NodeConstraintTest"===s.type);else if("SolutionList"===s.type||"ShapeAndResults"===s.type||"ExtensionResults"===s.type)s.solutions.forEach((t=>{t.solution&&e(t.solution)}));else if("ShapeOrResults"===s.type)e(s.solution);else if("ShapeTest"===s.type)"solution"in s&&e(s.solution);else if("OneOfSolutions"===s.type||"EachOfSolutions"===s.type)s.solutions.forEach((t=>{e(t)}));else if("OneOfSolution"===s.type||"EachOfSolution"===s.type)s.expressions.forEach((t=>{e(t)}));else if("TripleConstraintSolutions"===s.type)s.solutions.map((s=>{if("TestedTriple"!==s.type)throw Error("unexpected result type: "+s.type);const i=s;"object"==typeof i.object&&(i.object='"'+i.object.value.replace(/"/g,'\\"')+'"'+(i.object.language?"@"+i.object.language:i.object.type?"^^"+i.object.type:"")),r.addQuad(t.externalTriple(i,n)),"referenced"in s&&e(s.referenced)}));else if("ExtendedResults"===s.type)e(s.extensions),"local"in s&&e(s.local);else if(-1===["ShapeNotResults","Recursion"].indexOf(s.type))throw Error("unexpected expr type "+s.type+" in "+JSON.stringify(s))}(e),r},validateSchema:function(e){const t=this.Visitor();let r=currentExtra=null,n=!1,i=!1;const a=t.visitShape,o=s.create(),u=s.create();let c=e.index||this.index(e);t.visitShape=function(e,r){const n=currentExtra;currentExtra=e.extra;const s=a.call(t,e,r);return currentExtra=n,s};const p=t.visitShapeNot;t.visitShapeNot=function(e,r){const s=n;n^=!0;const i=p.call(t,e,r);return n=s,i};const l=t.visitTripleConstraint;t.visitTripleConstraint=function(e){const r=n;currentExtra&&-1!==currentExtra.indexOf(e.predicate)&&(n^=!0),i=!0;const s=l.call(t,e);return i=!1,n=r,s};const f=t.visitShapeRef;t.visitShapeRef=function(e){if(!(e in c.shapeExprs))throw y(Error("Structural error: reference to "+JSON.stringify(e)+" not found in schema shape expressions:\n"+m(c.shapeExprs)+"."),e);if(!i&&e===r)throw y(Error("Structural error: circular reference to "+r+"."),e);return(n?o:u).add(r,e),f.call(t,e)};const h=t.visitInclusion;t.visitInclusion=function(e){let r;if(!(r=c.tripleExprs[e]))throw y(Error("Structural error: included shape "+e+" not found in schema triple expressions:\n"+m(c.tripleExprs)+"."),e);return h.call(t,e)},(e.shapes||[]).forEach((function(e){r=e.id,t.visitShapeDecl(e,e.id)}));let d=Object.keys(o.children).filter((e=>o.children[e].filter((t=>t in o.children&&-1!==o.children[t].indexOf(e)||t in u.children&&-1!==u.children[t].indexOf(e))).length>0));if(d.length)throw y(Error("Structural error: circular negative dependencies on "+d.join(",")+"."),d[0]);function m(e){return e?Object.keys(e).map((e=>"_:"===e.substr(0,2)?e:"<"+e+">")).join("\n "):"- none defined -"}function y(t,r){return"_sourceMap"in e&&(t.location=(e._sourceMap.get(r)||[void 0])[0]),t}},isWellDefined:function(e){return this.validateSchema(e),e},walkVal:function(e,t){const r=this;if("string"==typeof e)return null;if("SolutionList"===e.type)return e.solutions.reduce(((e,n)=>{const s=r.walkVal(n,t);return s&&Object.keys(s).forEach((t=>{e[t]=t in e?e[t].concat(s[t]):s[t]})),e}),{});if("NodeConstraintTest"===e.type)return r.walkVal(e.shapeExpr,t);if("NodeConstraint"===e.type)return null;if("ShapeTest"===e.type){const s=[];n(e,s);const i=s.length?{"http://shex.io/reflex":s}:{};return"solution"in e&&Object.assign(i,r.walkVal(e.solution,t)),Object.keys(i).length?i:null}if("Shape"===e.type)return null;if("ShapeNotTest"===e.type)return r.walkVal(e.shapeExpr,t);if("ShapeNotResults"===e.type)return r.walkVal(e.solution,t);if("Failure"===e.type)return null;if("ShapeNot"===e.type)return r.walkVal(e.shapeExpr,t);if("ShapeOrResults"===e.type)return r.walkVal(e.solution,t);if("ShapeOr"===e.type)return e.shapeExprs.reduce(((e,n)=>{const s=r.walkVal(n,t);return s&&Object.keys(s).forEach((t=>{e[t]=t in e?e[t].concat(s[t]):s[t]})),e}),{});if("ShapeAndResults"===e.type||"ExtensionResults"===e.type)return e.solutions.reduce(((e,n)=>{const s=r.walkVal(n,t);return s&&Object.keys(s).forEach((t=>{e[t]=t in e?e[t].concat(s[t]):s[t]})),e}),{});if("ShapeAnd"===e.type)return e.shapeExprs.reduce(((e,n)=>{const s=r.walkVal(n,t);return s&&Object.keys(s).forEach((t=>{e[t]=t in e?e[t].concat(s[t]):s[t]})),e}),{});if("ExtendedResults"===e.type)return["extensions","local"].reduce(((e,n)=>{const s=r.walkVal(n,t);return s&&Object.keys(s).forEach((t=>{e[t]=t in e?e[t].concat(s[t]):s[t]})),e}),{});if("EachOfSolutions"===e.type||"OneOfSolutions"===e.type)return e.solutions.reduce(((e,n)=>(n.expressions.forEach((n=>{const s=r.walkVal(n,t);s&&Object.keys(s).forEach((t=>{e[t]=t in e?e[t].concat(s[t]):s[t]}))})),e)),{});if("TripleConstraintSolutions"===e.type){if("solutions"in e){const t={},r=[];return t[e.predicate]=r,e.solutions.forEach((e=>n(e,r))),r.length?t:null}return null}if("Recursion"===e.type)return null;throw Error("unknown shapeExpression type in "+JSON.stringify(e));function n(e,n){const s=[];if(function e(s){if(!s)return!1;if(s.node===a.nil)return!0;if("solution"in s&&"solutions"in s.solution&&1===s.solution.solutions.length&&"expressions"in s.solution.solutions[0]&&2===s.solution.solutions[0].expressions.length&&"predicate"in s.solution.solutions[0].expressions[0]&&s.solution.solutions[0].expressions[0].predicate===a.first&&s.solution.solutions[0].expressions[1].predicate===a.rest){const i=s.solution.solutions[0].expressions,o=i[0],u=i[1].solutions[0],c=o.solutions[0];let p=t(c);if("referenced"in c){const e=r.walkVal(c.referenced,t);e&&(p?p.nested=e:p=e)}return p&&n.push(p),u.object===a.nil||e("ShapeOrResults"===u.referenced.type?u.referenced.solution:u.referenced)}}(e.referenced))[].push.apply(n,s);else{const s=t(e)||{};if("referenced"in e){const n=r.walkVal(e.referenced,t);n&&(s.nested=n)}Object.keys(s).length>0&&n.push(s)}}},valToValues:function(e){return this.walkVal(e,(function(e){return"object"in e?{ldterm:e.object}:null}))},valToExtension:function(e,t){return function e(r){const n=[];let s={};function i(e){if(null===s)return e;if(Array.isArray(e))return s=null,e;for(k in e){if(k in s)return s=null,e;s[k]=l(e[k])}return e}for(let s in r)if("extensions"===s)r[s]&&n.push(i(l(r[s][t])));else if("nested"===s){const t=e(r[s]);Array.isArray(t)?t.forEach(i):i(t),n.push(t)}else n.push(i(e(r[s])));return 1===n.length?n[0]:s||n}(this.walkVal(e,(function(e){return"extensions"in e?{extensions:e.extensions}:null})))},valuesToSchema:function(e){const t=e;if(e[a.type][0].ldterm===i.Schema){const r={"@context":"http://www.w3.org/ns/shex.jsonld",type:"Schema"};i.startActs in t&&(r.startActs=t[i.startActs].map((e=>{const t={type:"SemAct",name:e.nested[i.name][0].ldterm};return i.code in e.nested&&(t.code=e.nested[i.code][0].ldterm.value),t}))),i.imports in t&&(r.imports=t[i.imports].map((e=>e.ldterm))),e[i.start]&&(r.start=p({id:e[i.start][0].ldterm},n(e[i.start][0].nested)));const s=e[i.shapes];return s&&(r.shapes=s.map((e=>{var t=e.nested[a.type][0].ldterm===i.ShapeDecl?{type:i.ShapeDecl,abstract:!!e.nested[i.abstract][0].ldterm.value,shapeExpr:n(e.nested[i.shapeExpr][0].nested)}:n(e.nested);return p({id:e.ldterm},t)}))),r}throw Error("unknown schema type in "+JSON.stringify(e));function r(e,t,r){const n=e[a.type][0].ldterm.substr(i._namespace.length),s=t[n];if(!s)return c;if(s.nary){const t={type:n};return t[s.prop]=e[i[s.prop]].map((e=>o(e))),t}{const t={type:n};return s.prop&&(t[s.prop]=o(e[i[s.prop]][0])),t}function o(e){return s.expr&&"nested"in e?p({id:e.ldterm},r(e.nested)):e.ldterm}}function n(e){let t=r(e,{ShapeAnd:{nary:!0,expr:!0,prop:"shapeExprs"},ShapeOr:{nary:!0,expr:!0,prop:"shapeExprs"},ShapeNot:{nary:!1,expr:!0,prop:"shapeExpr"},ShapeRef:{nary:!1,expr:!1,prop:"reference"},ShapeExternal:{nary:!1,expr:!1,prop:null}},n);if(t!==c)return t;const u=e[a.type][0].ldterm;if(u===i.ShapeDecl){const t={type:"ShapeDecl"};return["abstract"].forEach((r=>{i[r]in e&&(t[r]=!!e[i[r]][0].ldterm.value)})),i.shapeExpr in e&&(t.shapeExpr="nested"in e[i.shapeExpr][0]?p({id:e[i.shapeExpr][0].ldterm},n(e[i.shapeExpr][0].nested)):e[i.shapeExpr][0].ldterm),t}if(u===i.Shape)return t={type:"Shape"},["closed"].forEach((r=>{i[r]in e&&(t[r]=!!e[i[r]][0].ldterm.value)})),["extra","extends","restricts"].forEach((r=>{i[r]in e&&(t[r]=e[i[r]].map((e=>e.ldterm)))})),i.expression in e&&(t.expression="nested"in e[i.expression][0]?p({id:e[i.expression][0].ldterm},o(e[i.expression][0].nested)):e[i.expression][0].ldterm),i.annotation in e&&(t.annotations=e[i.annotation].map((e=>({type:"Annotation",predicate:e.nested[i.predicate][0].ldterm,object:e.nested[i.object][0].ldterm})))),i.semActs in e&&(t.semActs=e[i.semActs].map((e=>{const t={type:"SemAct",name:e.nested[i.name][0].ldterm};return i.code in e.nested&&(t.code=e.nested[i.code][0].ldterm.value),t}))),t;if(u===i.NodeConstraint){const t={type:"NodeConstraint"};return i.values in e&&(t.values=e[i.values].map((e=>s(e)))),i.nodeKind in e&&(t.nodeKind=e[i.nodeKind][0].ldterm.substr(i._namespace.length)),["length","minlength","maxlength","mininclusive","maxinclusive","minexclusive","maxexclusive","totaldigits","fractiondigits"].forEach((r=>{i[r]in e&&(t[r]=parseFloat(e[i[r]][0].ldterm.value))})),i.pattern in e&&(t.pattern=e[i.pattern][0].ldterm.value),i.flags in e&&(t.flags=e[i.flags][0].ldterm.value),i.datatype in e&&(t.datatype=e[i.datatype][0].ldterm),t}throw Error("unknown shapeExpr type in "+JSON.stringify(e))}function s(e,t){if("nested"in e){const t=e.nested[a.type][0].ldterm;if(-1!==[i.IriStem,i.LiteralStem,i.LanguageStem].indexOf(t)){const r=e.nested[i.stem][0].ldterm.value;return{type:t.substr(i._namespace.length),stem:r}}if(-1!==[i.Language].indexOf(t))return{type:"Language",languageTag:e.nested[i.languageTag][0].ldterm.value};if(-1!==[i.IriStemRange,i.LiteralStemRange,i.LanguageStemRange].indexOf(t)){const r=e.nested[i.stem][0];let n=r;"object"==typeof r&&("object"==typeof r.ldterm?n=r.ldterm:r.ldterm.startsWith("_:")&&(n={type:"Wildcard"}));const a={type:t.substr(i._namespace.length),stem:"Wildcard"!==n.type?n.value:n};return i.exclusion in e.nested&&(a.exclusions=e.nested[i.exclusion].map((e=>s(e,t!==i.IriStemRange)))),a}throw Error("unknown objectValue type in "+JSON.stringify(e))}return t?e.ldterm.value:e.ldterm}function o(e){const t=r(e,{EachOf:{nary:!0,expr:!0,prop:"expressions"},OneOf:{nary:!0,expr:!0,prop:"expressions"},Inclusion:{nary:!1,expr:!1,prop:"include"}},o);if(t!==c)return u(e,t),t;if(e[a.type][0].ldterm===i.TripleConstraint){const t={type:"TripleConstraint",predicate:e[i.predicate][0].ldterm};return["inverse"].forEach((r=>{i[r]in e&&(t[r]=!!e[i[r]][0].ldterm.value)})),i.valueExpr in e&&(t.valueExpr=p({id:e[i.valueExpr][0].ldterm},"nested"in e[i.valueExpr][0]?n(e[i.valueExpr][0].nested):{})),u(e,t),t}throw Error("unknown tripleExpr type in "+JSON.stringify(e))}function u(e,t){return i.min in e&&(t.min=parseInt(e[i.min][0].ldterm.value)),i.max in e&&(t.max=parseInt(e[i.max][0].ldterm.value),isNaN(t.max)&&(t.max=-1)),i.annotation in e&&(t.annotations=e[i.annotation].map((e=>({type:"Annotation",predicate:e.nested[i.predicate][0].ldterm,object:e.nested[i.object][0].ldterm})))),i.semActs in e&&(t.semActs=e[i.semActs].map((e=>{const t={type:"SemAct",name:e.nested[i.name][0].ldterm};return i.code in e.nested&&(t.code=e.nested[i.code][0].ldterm.value),t}))),t}},simpleToShapeMap:function(e){return Object.keys(e).reduce(((t,r)=>(e[r].forEach((e=>{t.push({node:r,shape:e})})),t)),[])},absolutizeShapeMap:function(e,r){return e.map((e=>Object.assign(e,{node:t.resolveRelativeIRI(r,e.node),shape:t.resolveRelativeIRI(r,e.shape)})))},errsToSimple:function(t){const r=this;if("FailureList"===t.type)return t.errors.reduce(((e,t)=>e.concat(r.errsToSimple(t))),[]);if("Failure"===t.type)return["validating "+t.node+" as "+t.shape+":"].concat(function e(t){return t.reduce((function(t,r){const n=Object.keys(r);return t.concat(1===n.length&&"errors"===n[0]?e(r.errors):r)}),[])}(t.errors).reduce(((e,t)=>{const n=r.errsToSimple(t).map((e=>" "+e));return e.length>0?e.concat([" OR"]).concat(n):n.map((e=>" "+e))}),[]));if("TypeMismatch"===t.type){const n=Array.isArray(t.errors)?t.errors.reduce(((e,t)=>e.concat(("string"==typeof t?[t]:r.errsToSimple(t)).map((e=>" "+e)))),[]):" "+("string"==typeof e?[t.errors]:r.errsToSimple(t.errors));return["validating "+h(t.triple.object)+":"].concat(n)}if("RestrictionError"===t.type){var s=t.errors.constructor===Array?t.errors.reduce(((e,t)=>e.concat(("string"==typeof t?[t]:r.errsToSimple(t)).map((e=>" "+e)))),[]):" "+("string"==typeof e?[t.errors]:r.errsToSimple(t.errors));return["validating restrictions on "+h(t.focus)+":"].concat(s)}if("ShapeAndFailure"===t.type)return Array.isArray(t.errors)?t.errors.reduce(((e,t)=>e.concat(("string"==typeof t?[t]:r.errsToSimple(t)).map((e=>" "+e)))),[]):" "+("string"==typeof e?[t.errors]:r.errsToSimple(t.errors));if("ShapeOrFailure"===t.type)return Array.isArray(t.errors)?t.errors.reduce(((e,t)=>e.concat(" OR "+("string"==typeof t?[t]:r.errsToSimple(t)))),[]):" OR "+("string"==typeof e?[t.errors]:r.errsToSimple(t.errors));if("ShapeNotFailure"===t.type)return["Node "+t.errors.node+" expected to NOT pass "+t.errors.shape];if("ExcessTripleViolation"===t.type)return["validating "+h(t.triple.object)+": exceeds cardinality"];if("ClosedShapeViolation"===t.type)return["Unexpected triple(s): {"].concat(t.unexpectedTriples.map((e=>" "+e.subject+" "+e.predicate+" "+h(e.object)+" ."))).concat(["}"]);if("NodeConstraintViolation"===t.type){const e=n(95)();let r;return e._write(e._writeNodeConstraint(t.shapeExpr).join("")),e.end(((e,t)=>{r=t})),["NodeConstraintError: expected to match "+r]}if("MissingProperty"===t.type)return["Missing property: "+t.property];if("NegatedProperty"===t.type)return["Unexpected property: "+t.property];if("AbstractShapeFailure"===t.type)return["Abstract Shape: "+t.shape];if(Array.isArray(t))return t.reduce(((e,t)=>{const n=r.errsToSimple(t).map((e=>" "+e));return e.length?e.concat(["AND"]).concat(n):n}),[]);if("SemActFailure"===t.type){const n=Array.isArray(t.errors)?t.errors.reduce(((e,t)=>e.concat(("string"==typeof t?[t]:r.errsToSimple(t)).map((e=>" "+e)))),[]):" "+("string"==typeof e?[t.errors]:r.errsToSimple(t.errors));return["rejected by semantic action:"].concat(n)}if("SemActViolation"===t.type)return[t.message];if("BooleanSemActFailure"===t.type)return["Failed evaluating "+t.code+" on context "+JSON.stringify(t.ctx)];throw Error('unknown shapeExpression type "'+t.type+'" in '+JSON.stringify(t))},resolveRelativeIRI:t.resolveRelativeIRI,resolvePrefixedIRI:function(e,t){const r=e.indexOf(":");if(-1===r)return null;const n=t[e.substr(0,r)];return void 0===n?null:n+e.substr(r+1)},parsePassedNode:function(e,r,n,s,i){if(void 0===e||0===e.length)return s&&s(r.base)?r.base:n?n():this.NotSupplied;if("_"===e[0]&&":"===e[1])return e;if('"'===e[0]){const n=e.match(/^"((?:[^"\\]|\\")*)"(?:@(.+)|\^\^(?:<(.*)>|([^:]*):(.*)))?$/);if(!n)throw Error("malformed literal: "+e);const s=n[1],i=n[2],a=n[3],o=n[4],u=n[5],c='"'+s+'"';if(void 0!==i)return c+"@"+i;if(void 0!==o){if(!(o in r.prefixes))throw Error("error parsing node "+e+' no prefix for "'+o+'"');return c+"^^"+r.prefixes[o]+u}return void 0!==a?c+"^^"+t.resolveRelativeIRI(r.base,a):c}if(!r)return s(e)?e:this.UnknownIRI;const a="<"===e[0]&&">"===e[e.length-1];a&&(e=e.substr(1,e.length-2));const o=t.resolveRelativeIRI(r.base||"",e);if(s(o))return o;if(!a){const t=this.resolvePrefixedIRI(e,r.prefixes);if(null!==t&&s(t))return t}return i?i(o):this.UnknownIRI},executeQueryPromise:function(e,t){const r=t+"?query="+encodeURIComponent(e);return fetch(r,{headers:{Accept:"application/sparql-results+json"}}).then((e=>e.json())).then((e=>this.parseSparqlJsonResults(e)))},executeQuery:function(e,t){const r=t+"?query="+encodeURIComponent(e),n=new XMLHttpRequest;n.open("GET",r,!1),n.setRequestHeader("Accept","application/sparql-results+json"),n.send();const s=JSON.parse(n.responseText);return this.parseSparqlJsonResults(s)},parseSparqlJsonResults:function(e){const t=e.head.vars;return e.results.bindings.map((e=>t.map((t=>{const r=e[t];switch(r.type){case"uri":return r.value;case"bnode":return"_:"+r.value;case"literal":return'"'+r.value.replace(/"/g,'\\""')+'"'+("xml:lang"in r?"@"+r["xml:lang"]:"")+("datatype"in r?"^^"+r.datatype:"");case"typed-literal":return'"'+r.value.replace(/"/g,'\\""')+'"^^'+r.datatype;default:throw"unknown XML results type: "+r.type}}))))},rdfjsDB:function(e,r){return{getNeighborhood:function(n,s){let i;r&&(i=new Date,r.start(!1,n,s));const a=e.getQuads(n,null,null,null).map(t.internalTriple);if(r){const e=new Date;r.end(a,e.valueOf()-i.valueOf()),i=e}r&&r.start(!0,n,s);const o=e.getQuads(null,null,n,null).map(t.internalTriple);return r&&r.end(o,(new Date).valueOf()-i.valueOf()),{outgoing:a,incoming:o}},getSubjects:function(){return e.getSubjects().map(t.internalTerm)},getPredicates:function(){return e.getPredicates().map(t.internalTerm)},getObjects:function(){return e.getObjects().map(t.internalTerm)},getQuads:function(){return e.getQuads.apply(e,arguments).map(t.internalTriple)},get size(){return e.size}}},makeTriplesDB:function(e){var t=[],r=[];return{getNeighborhood:function(e,n,s){return{outgoing:r,incoming:t}},getTriplesByIRI:function(e,n,s,i){return t.concat(r).filter((t=>!(e&&e!==t.subject||n&&n!==t.predicate||e&&e!==t.object)))},getSubjects:function(){return["!Triples DB can't index subjects"]},getPredicates:function(){return["!Triples DB can't index predicates"]},getObjects:function(){return["!Triples DB can't index objects"]},get size(){},addIncomingTriples:function(e){Array.prototype.push.apply(t,e)},addOutgoingTriples:function(e){Array.prototype.push.apply(r,e)}}},NotSupplied:"-- not supplied --",UnknownIRI:"-- not found --",unescapeText:function(e,t){const r=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\(.)/g;try{return e=e.replace(r,(function(e,r,n,s){let i;if(r){if(i=parseInt(r,16),isNaN(i))throw new Error;return String.fromCharCode(i)}if(n){if(i=parseInt(n,16),isNaN(i))throw new Error;return i<65535?String.fromCharCode(i):String.fromCharCode(55296+((i-=65536)>>10),56320+(1023&i))}{const e=t[s];if(!e)throw new Error("no replacement found for '"+s+"'");return e}}))}catch(e){return console.warn(e),""}}};function h(e){if("object"!=typeof e)return e;const t='"'+e.value+'"';return"language"in e?t+"@"+e.language:"type"in e?t+"^^"+e.type:t}function d(e,t){for(let r in f)t?e.prototype[r]=m(f[r]):e[r]=f[r];return e}function m(e){return function(t){return e(this,t)}}return d(d)}();t.exports=s},457:(e,t,r)=>{const n=function(){const e={term:"START"},t=r(118);let n=r(806),s=r(443);const i=r(515);function a(e){return t.isIRI(e)?e:t.isLiteral(e)?t.getLiteralValue(e):e.substr(2)}const o="http://www.w3.org/2001/XMLSchema#",u=[o+"integer",o+"nonPositiveInteger",o+"negativeInteger",o+"long",o+"int",o+"short",o+"byte",o+"nonNegativeInteger",o+"unsignedLong",o+"unsignedInt",o+"unsignedShort",o+"unsignedByte",o+"positiveInteger"],c=[o+"decimal"].concat(u),p=[o+"float",o+"double"].concat(c),l={"http://www.w3.org/2001/XMLSchema#integer":function(e,t){return e.match(/^[+-]?[0-9]+$/)||t("illegal integer value '"+e+"'"),parseInt(e)},"http://www.w3.org/2001/XMLSchema#decimal":function(e,t){return e.match(/^[+-]?(?:[0-9]*\.[0-9]+|[0-9]+)$/)||t("illegal decimal value '"+e+"'"),parseFloat(e)}},f=/^[+\-]?(?:[0-9]+(?:\.[0-9]*)?|\.[0-9]+)(?:[eE][+\-]?[0-9]+)?$/;l[o+"float"]=function(e,t){return"NaN"===e?NaN:"INF"===e?1/0:"-INF"===e?-1/0:(e.match(f)||t("illegal float value '"+e+"'"),parseFloat(e))},l[o+"double"]=function(e,t){return"NaN"===e?NaN:"INF"===e?1/0:"-INF"===e?-1/0:(e.match(f)||t("illegal double value '"+e+"'"),Number(e))};const h={length:function(e,t){return e.length===t},minlength:function(e,t){return e.length>=t},maxlength:function(e,t){return e.length<=t}},d={mininclusive:function(e,t){return e>=t},minexclusive:function(e,t){return e>t},maxinclusive:function(e,t){return e<=t},maxexclusive:function(e,t){return e!1===e?e:-1!==["value","type","language"].indexOf(t)),!0)}function x(e){return{byPredicate:e.reduce((function(e,t){const r=t.predicate;return r in e||(e[r]=[]),e[r].push(t),e}),{}),candidates:E(e.length).map((function(){return[]})),misses:[]}}function g(e,r){const[n,s]=[e,r].map((e=>t.isBlank(e)?1:t.isLiteral(e)?2:3));return n===s?e.localeCompare(r):n-s}function E(e){return Array.from(Array(e))}function b(e,t,r){t in e||A("expected "+JSON.stringify(e)+" to have a '"+t+"' attribute."),arguments.length>2&&e[t]!==r&&A("expected "+t+" attribute '"+e[t]+"' to equal '"+r+"'.")}function S(){}function A(){const e=Array.prototype.join.call(arguments,""),t=new Error(e);throw Error.captureStackTrace(t,A),t}function v(e){return E(e).map((()=>[]))}return{construct:function c(f,O,T){if(!(this instanceof c))return new c(f,O,T);let I=f._index||n.index(f);this.type="ShExValidator",T=T||{},this.options=T,this.options.coverage=this.options.coverage||"exhaustive","noCache"in T&&T.noCache||(this.known={});const w=this;this.schema=f,this._expect=this.options.lax?S:b,this._optimize={},this.reset=function(){};const F=this.options.regexModule||r(237);function N(e,t,r,n,s){const i=x(t.slice(0,r)),a=x(t.slice(r));return e.reduce((function(e,r,n){r.inverse,r.inverse;const o=(r.inverse?a:i).byPredicate[r.predicate]||[],u=w._triplesMatchingShapeExpr(o,r,s);return u.hits.forEach((function(r){const s=t.indexOf(r.triple);e.constraintList[s].push(n),e.results[n][s]=r.sub})),u.misses.forEach((function(r){const s=t.indexOf(r.triple);e.misses[s]={constraintNo:n,errors:r.errors}})),e}),{misses:{},results:v(e.length),constraintList:v(t.length)})}function k(e,t,r){return e.slice().reduce((function(e,t,n){return"NO_TRIPLE_CONSTRAINT"!==t&&e[t].push({tNo:n,res:r.results[t][n]}),e}),E(t.length).map((()=>[])))}function L(e,t,r,n){if(!("extends"in e))return null;const i=[],a=[];for(let o=0;oc.addOutgoingTriples([e])));const p=w.validate(t,u,n.tracker,n.seen,c);"errors"in p?a.push(p):i.push(p)}return a.length>0?{type:"ExtensionFailure",errors:a}:{type:"ExtensionResults",solutions:i}}this.indexTripleConstraints=function(e){const t=[];return e&&function e(r){return"string"==typeof r?e(I.tripleExprs[r]):"TripleConstraint"===r.type?(t.push(r),[t.length-1]):"OneOf"===r.type||"EachOf"===r.type?r.expressions.reduce((function(t,r){return t.concat(e(r))}),[]):A("unexpected expr type: "+r.type)}(e),t},this.emptyTracker=function(){const e=e=>e;return{recurse:e,known:e,enter:function(e,t){++this.depth},exit:function(e,t,r){--this.depth},depth:0}},this.validate=function(r,n,s,i,a){if("object"==typeof r&&"termType"in r&&(r=t.internalTerm(r)),"object"==typeof r){const e=r;if("api"===this.options.results)return e.map((e=>{let t=new Date;const r=this.validate(e.node,e.shape,n,s);return t=new Date-t,{node:e.node,shape:e.shape,status:"errors"in r?"nonconformant":"conformant",appinfo:r,elapsed:t}}));const t=e.reduce(((e,t)=>{const r=this.validate(t.node,t.shape,n,s,a);return"errors"in r?{passes:e.passes,failures:e.failures.concat(r)}:{passes:e.passes.concat(r),failures:e.failures}}),{passes:[],failures:[]});return t.failures.length>0?1!==t.failures.length?{type:"FailureList",errors:t.failures}:t.failures[0]:1!==t.passes.length?{type:"SolutionList",solutions:t.passes}:t.passes[0]}const o=void 0===s;s||(s=this.emptyTracker()),n&&n!==e||f.start||A("start production not defined");let u=null;if(u=n==e?f.start:this._lookupShape(n),"string"!=typeof n)return this._validateShapeDecl(r,u,e,0,s,i);void 0===i&&(i={});const c=r+"@"+(n===e?"_: -start-":n);if(!a){if(c in i)return s.recurse({type:"Recursion",node:y(r),shape:n});if("known"in this&&c in this.known)return s.known(this.known[c]);i[c]={point:r,shape:n},s.enter(r,n)}const p=this._validateDescendants(r,n,0,s,i,a);return a||(s.exit(r,n,p),delete i[c],"known"in this&&(this.known[c]=p)),"startActs"in f&&o&&(p.startActs=f.startActs),p},this._validateDescendants=function(e,t,r,n,a,o,u){if(o)return this._validateShapeDecl(e,this._lookupShape(t),t,0,n,a,o);let c=[t];c=c.concat(function(e){const t={},r=i.create();return function(e){const n=s.Visitor();let i,a;const o=n.visitShapeDecl;n.visitShapeDecl=function(e){return i=e.id,a=e.abstract,t[e.id]=e.abstract,o.call(n,e,e.id)};n.visitShape;return n.visitShape=function(e){return"extends"in e&&e.extends.forEach((e=>{const t=s.Visitor();t.visitShapeRef=function(e){return r.add(e,i),"null"},t.visitShapeExpr(e)})),"null"},n}().visitSchema(e),r.children}(this.schema)[t]||[]);for(let e=c.length-1;e>=0;--e)c.indexOf(c[e])!this._lookupShape(e).abstract)));const p=c.reduce(((t,r)=>{const s=this._lookupShape(r),i=this._validateShapeDecl(e,s,r,0,n,a,o);return"errors"in i?{passes:t.passes,failures:t.failures.concat(i)}:{passes:t.passes.concat(i),failures:t.failures}}),{passes:[],failures:[]});let l;return l=p.passes.length>0?1!==p.passes.length?{type:"SolutionList",solutions:p.passes}:p.passes[0]:p.failures.length>0?1!==p.failures.length?{type:"FailureList",errors:p.failures}:p.failures[0]:{type:"AbstractShapeFailure",shape:t,errors:t+" has no non-abstract children"},l},this._validateShapeDecl=function(e,t,r,n,s,i,a){const o="ShapeDecl"===t.type?t.shapeExpr:t;return this._validateShapeExpr(e,o,r,n,s,i,a)},this._lookupShape=function(e){if("shapes"in this.schema&&0!==this.schema.shapes.length){if(e in I.shapeExprs)return I.shapeExprs[e];A("shape "+e+" not found in:\n"+Object.keys(I.shapeExprs||[]).map((e=>" "+e)).join("\n"))}else A("shape "+e+" not found; no shapes in schema")},this._validateShapeExpr=function(e,t,r,n,s,i,a){if(""===e)throw Error("validation needs a valid focus node");let o=null;if("string"==typeof t)o=this._validateDescendants(e,t,n,s,i,a,!0);else if("NodeConstraint"===t.type){const n=this._errorsMatchingNodeConstraint(e,t,null);o=n.errors&&n.errors.length?{type:"Failure",node:y(e),shape:r,errors:n.errors.map((function(e){return{type:"NodeConstraintViolation",shapeExpr:t,error:e}}))}:{type:"NodeConstraintTest",node:y(e),shape:r,shapeExpr:t}}else if("Shape"===t.type)o=this._validateShape(e,t,r,n,s,i,a);else if("ShapeExternal"===t.type)o=this.options.validateExtern(e,r,s,i);else if("ShapeOr"===t.type){const u=[];for(let o=0;o0?{type:"ShapeAndFailure",errors:c}:{type:"ShapeAndResults",solutions:u}}}if("string"!=typeof t&&"Shape"!==t.type&&!("errors"in o)&&"semActs"in t){const n=this.semActHandler.dispatchAll(t.semActs,Object.assign({node:e},o),o);if(n.length)return{type:"Failure",node:y(e),shape:r,errors:n}}return o},this._validateShape=function(e,t,r,n,i,a,o){const u={db:O,shapeLabel:r,depth:n,tracker:i,seen:a};let c=null;const p={};if("startActs"in f){const t=this.semActHandler.dispatchAll(f.startActs,null,p);if(t.length)return{type:"Failure",node:y(e),shape:r,errors:t}}const l=(o||O).getNeighborhood(e,r,t),h=l.outgoing.length,d=l.outgoing.sort(((e,t)=>e.predicate.localeCompare(t.predicate)||g(e.object,t.object))).concat(l.incoming.sort(((e,t)=>e.predicate.localeCompare(t.predicate)||g(e.object,t.object)))),m=this.indexTripleConstraints(t.expression),_=function(e){const t=[];"extends"in e&&e.extends.forEach(((e,n)=>{const s={},i={};r(e,s,i),[s,i].forEach((e=>{Object.keys(e).forEach((r=>{let s=e[r];t.push({tripleConstraint:s,extendsNo:n})}))}))}));return t;function r(e,t,n){const i=s.Visitor();let a=1,o=1;const u=i.visitOneOf;i.visitShapeRef=function(e){return i.visitShapeDecl(this._lookupShape(e))},i.visitShape=function(e,s){return"extends"in e&&e.extends.forEach((e=>r(e,t,n))),"expression"in e&&i.visitExpression(e.expression),{type:"Shape"}},i.visitOneOf=function(e){const t=a,r=o;a=0,u.call(i,e),a=t,o=r},i.visitTripleConstraint=function(e){const r=e.inverse?t:n;let s="min"in e?e.min:1;s*=a;let i="max"in e?e.max:1;return i*=o,r[e.predicate]={type:"TripleConstraint",predicate:e.predicate,min:e.predicate in r?Math.max(r[e.predicate].min,s):s,max:e.predicate in r?Math.min(r[e.predicate].max,i):i,seen:e.predicate in r?r[e.predicate].seen+1:1,tcs:e.predicate in r?r[e.predicate].tcs.concat([e]):[e]},e},i.visitShapeExpr(e)}}(t),x=_.map((e=>e.tripleConstraint)).concat(m),b=N(x,d,h,e,u),{misses:S,extras:A}=function(e,t,r,n){const s=[],i=e.constraintList.reduce((function(i,a,o){return 0===a.length&&o0?e[i][0]:t}function a(){if(null!==s&&0===s.length)return!1;if(null===s)return i(),!0;let a=r-1;if(n[a]++,n[a]=e[a].length;){if(0==a)return!1;n[a]=0,s[a]=e[a].length>0?e[a][0]:t,n[--a]++}return s[a]=e[a][n[a]],!0}return{next:a,do:function(e,t){return e.apply(t,s)},get:function(){return s}}}(b.constraintList,"NO_TRIPLE_CONSTRAINT"),T=[],w=F.compile(f,t,I);for(;v.next()&&null===c;){const n=[],s=[],i=E(d.length).map((function(){return 0})),a=v.get(),o=[],p=[],l=E((t.extends||[]).length).map((()=>[]));if(a.forEach(((e,t)=>{if("NO_TRIPLE_CONSTRAINT"!==e&&e<_.length){const r=_[e].extendsNo;l[r].push(d[t]),p[t]=e,o[t]="NO_TRIPLE_CONSTRAINT"}else p[t]="NO_EXTENDS",o[t]=e})),t.closed){const e=d.slice(0,h).filter(((e,t)=>"NO_TRIPLE_CONSTRAINT"===o[t]&&"NO_EXTENDS"===p[t]&&-1===A.indexOf(t)));e.length>0&&n.push({type:"ClosedShapeViolation",unexpectedTriples:e})}o.forEach((function(e,t){"NO_TRIPLE_CONSTRAINT"!==e&&(s.push(d[t]),++i[e])}));const f=k(o,x,b);let m=L(t,e,l,u);if(null===m||!("errors"in m)){const t=w.match(O,e,x,f,o,d,this.semActHandler,null);!("errors"in t)&&m?(m={type:"ExtendedResults",extensions:m},Object.keys(t).length>0&&(m.local=t)):m=t}"errors"in m&&[].push.apply(n,m.errors);const g={type:"ShapeTest",node:y(e),shape:r};if(0===n.length&&Object.keys(m).length>0&&(g.solution=m),"semActs"in t){const r=this.semActHandler.dispatchAll(t.semActs,Object.assign({node:e},m),g);r.length&&[].push.apply(n,r)}T.push(n),0===n.length&&(c=g)}const R=S.map((function(e){const t=d[e.tripleNo];return{type:"TypeMismatch",triple:{type:"TestedTriple",subject:t.subject,predicate:t.predicate,object:y(t.object)},constraint:x[e.constraintNo],errors:e.errors}})),C=T[T.length-1];let D=R.concat(1===C.length?C[0]:C);return D.length>0&&(c={type:"Failure",node:y(e),shape:r,errors:D}),function(e,t){"annotations"in e&&(t.annotations=e.annotations);return t}(t,c)},this._triplesMatchingShapeExpr=function(e,t,r){const n=this,s=[],i=[];return e.forEach((function(e){const a=t.inverse?e.subject:e.object;let o;const u=JSON.parse(JSON.stringify(n.semActHandler.results));(void 0===t.valueExpr?void 0:(o=n._errorsMatchingShapeExpr(a,t.valueExpr,r)).errors)?-1===i.indexOf(e)&&(n.semActHandler.results=JSON.parse(JSON.stringify(u)),s.push({triple:e,errors:o})):i.push({triple:e,sub:o})})),{hits:i,misses:s}},this._errorsMatchingShapeExpr=function(e,t,r,n){const s=this;if("string"==typeof t)return s.validate(e,t,r.tracker,r.seen,n);if("NodeConstraint"===t.type)return this._errorsMatchingNodeConstraint(e,t,null);if("Shape"===t.type)return s._validateShapeExpr(e,t,r.shapeLabel,r.depth,r.tracker,r.seen,n);if("ShapeOr"===t.type){const i=[];for(let a=0;a is less than the min:",n.min):e>n.max&&r('"'+e+'"^^<'+t+"> is greater than the max:",n.min)}(l[f](i,x),r.datatype,x):r.datatype===o+"boolean"?"true"!==i&&"false"!==i&&"1"!==i&&"0"!==i&&x("illegal boolean value: "+i):r.datatype===o+"dateTime"&&(i.match(/^[+-]?\d{4}-[01]\d-[0-3]\dT[0-5]\d:[0-5]\d:[0-5]\d(\.\d+)?([+-][0-2]\d:[0-5]\d|Z)?$/)||x("illegal dateTime value: "+i)):x("mismatched datatype: "+e+" is not a literal with datatype "+r.datatype)),r.values&&(t.isLiteral(e)&&r.values.reduce(((t,r)=>{if(t)return!0;const n=y(e);return"Language"===r.type?r.languageTag===n.language:"object"==typeof r&&"value"in r&&(r.value===n.value&&r.type===n.type&&r.language===n.language)}),!1)||-1!==r.values.indexOf(e)||r.values.some((function(r){if("object"==typeof r&&!("value"in r)){"type"in r||A("expected "+JSON.stringify(r)+" to have a 'type' attribute.");const i=["Language","IriStem","LiteralStem","LanguageStem","IriStemRange","LiteralStemRange","LanguageStemRange"];function n(e,n,s){return t.isLiteral(e)?-1!==["LiteralStem","LiteralStemRange"].indexOf(r.type)?s(t.getLiteralValue(e),n):-1!==["LanguageStem","LanguageStemRange"].indexOf(r.type)?s(t.getLiteralLanguage(e)||null,n):x("literal "+e+" not comparable with non-literal "+n):-1===["IriStem","IriStemRange"].indexOf(r.type)?x("nonliteral "+e+" not comparable with literal "+JSON.stringify(n)):s(e,n)}function s(e,t){return n(e,t,((e,t)=>"LanguageStem"===r.type||"LanguageStemRange"===r.type?null!==e&&(e===t||""===t||"-"===e[t.length]):e.startsWith(t)))}if(-1===i.indexOf(r.type)&&A("expected type attribute '"+r.type+"' to be in '"+i+"'."),_(r.stem)){if(!s(e,r.stem))return!1}else b(r.stem,"type","Wildcard");return!r.exclusions||!r.exclusions.some((function(t){if(_(t))return n(e,t,((e,t)=>e===t));{"type"in t||A("expected "+JSON.stringify(t)+" to have a 'type' attribute.");const r=["IriStem","LiteralStem","LanguageStem"];return-1===r.indexOf(t.type)&&A("expected type attribute '"+t.type+"' to be in '"+r+"'."),s(e,t.stem)}}))}}))||x("value "+e+" not found in set "+JSON.stringify(r.values))),"pattern"in r){const t="flags"in r?new RegExp(r.pattern,r.flags):new RegExp(r.pattern);a(e).match(t)||x("value "+a(e)+" did not match pattern "+r.pattern)}Object.keys(h).forEach((function(t){t in r&&!h[t](i,r[t])&&x("facet violation: expected "+t+" of "+r[t]+" but got "+e)})),Object.keys(d).forEach((function(t){t in r&&(f?d[t](l[f](i,x),r[t])||x("facet violation: expected "+t+" of "+r[t]+" but got "+e):x("facet violation: numeric facet "+t+" can't apply to "+e))})),Object.keys(m).forEach((function(t){t in r&&(f===o+"integer"||f===o+"decimal"?m[t](""+l[f](i,x),r[t])||x("facet violation: expected "+t+" of "+r[t]+" but got "+e):x("facet violation: numeric facet "+t+" can't apply to "+e))}));const g={type:null,focus:e,shapeExpr:r};return s.length?(g.type="NodeConstraintViolation",g.errors=s):g.type="NodeConstraintTest",g},this.semActHandler={handlers:{},results:{},register:function(e,t){this.handlers[e]=t},dispatchAll:function(e,t,r){const n=this;return e.reduce((function(e,s){if(0===e.length&&s.name in n.handlers){const i="code"in s?s.code:w.options.semActs[s.name],a="extensions"in r&&s.name in r.extensions,o=a?r.extensions[s.name]:{},u=n.handlers[s.name].dispatch(i,t,o);if("boolean"==typeof u)u||e.push({type:"SemActFailure",errors:[{type:"BooleanSemActFailure",code:i,ctx:t}]});else{if("object"!=typeof u||!Array.isArray(u))throw Error("unsupported response from semantic action handler: "+JSON.stringify(u));u.length>0&&e.push({type:"SemActFailure",errors:u})}return!a&&Object.keys(o).length>0&&("extensions"in r||(r.extensions={}),r.extensions[s.name]=o),e}return e}),[])}}},start:e,options:{coverage:{firstError:"fail on first error (usually used with eval-simple-1err)",exhaustive:"find as many errors as possible (usually used with eval-threaded-nerr)"}}}}();e.exports=n},806:e=>{function t(){function e(e){return"object"!=typeof e||"value"in e&&Object.keys(e).reduce(((e,t)=>!1===e?e:-1!==["value","type","language"].indexOf(t)),!0)}function t(e){return"string"==typeof e}const r={runtimeError:function(e){throw e},visitSchema:function(e){const t={type:"Schema"};return this._expect(e,"type","Schema"),this._maybeSet(e,t,"Schema",["@context","prefixes","base","imports","startActs","start","shapes"],["_base","_prefixes","_index","_sourceMap"]),t},visitPrefixes:function(e){return void 0===e?void 0:function(e,t){const r={};return Object.keys(e).forEach((function(n){r[n]=t(e[n])})),r}(e,(function(e){return e}))},visitIRI:function(e){return e},visitImports:function(e){const t=this;return e.map((function(e){return t.visitIRI(e)}))},visitStartActs:function(e){const t=this;return void 0===e?void 0:e.map((function(e){return t.visitSemAct(e)}))},visitSemActs:function(e){const t=this;if(void 0===e)return;const r=[];return Object.keys(e).forEach((function(n){r.push(t.visitSemAct(e[n],n))})),r},visitSemAct:function(e,t){const r={type:"SemAct"};return this._expect(e,"type","SemAct"),this._maybeSet(e,r,"SemAct",["name","code"]),r},visitShapes:function(e){const t=this;if(void 0!==e)return e.map((e=>t.visitShapeDecl(e)))},visitProductions999:function(e){const t=this;if(void 0===e)return;const r={};return Object.keys(e).forEach((function(n){r[n]=t.visitExpression(e[n],n)})),r},visitShapeDecl:function(e,t){return"ShapeDecl"===e.type?this._maybeSet(e,{type:"ShapeDecl"},"ShapeDecl",["id","abstract","restricts","shapeExpr"]):this.visitShapeExpr(e,t)},visitShapeExpr:function(e,r){if(t(e))return this.visitShapeRef(e);const n="Shape"===e.type?this.visitShape(e,r):"NodeConstraint"===e.type?this.visitNodeConstraint(e,r):"ShapeAnd"===e.type?this.visitShapeAnd(e,r):"ShapeOr"===e.type?this.visitShapeOr(e,r):"ShapeNot"===e.type?this.visitShapeNot(e,r):"ShapeExternal"===e.type?this.visitShapeExternal(e):null;if(null===n)throw Error("unexpected shapeExpr type: "+e.type);return n},_visitShapeGroup:function(e,t){this._testUnknownAttributes(e,["id","shapeExprs"],e.type,this.visitShapeNot);const r=this,n={type:e.type};return"id"in e&&(n.id=e.id),n.shapeExprs=e.shapeExprs.map((function(e){return r.visitShapeExpr(e,t)})),n},visitShapeNot:function(e,t){this._testUnknownAttributes(e,["id","shapeExpr"],"ShapeNot",this.visitShapeNot);const r={type:e.type};return"id"in e&&(r.id=e.id),r.shapeExpr=this.visitShapeExpr(e.shapeExpr,t),r},visitShape:function(e,t){const r={type:"Shape"};return this._expect(e,"type","Shape"),this._maybeSet(e,r,"Shape",["id","abstract","extends","closed","expression","extra","semActs","annotations"]),r},_visitShapeExprList:function(e){const t=this;return e.map((function(e){return t.visitShapeExpr(e,void 0)}))},visitNodeConstraint:function(e,t){const r={type:"NodeConstraint"};return this._expect(e,"type","NodeConstraint"),this._maybeSet(e,r,"NodeConstraint",["id","nodeKind","datatype","pattern","flags","length","reference","minlength","maxlength","mininclusive","minexclusive","maxinclusive","maxexclusive","totaldigits","fractiondigits","values","annotations","semActs"]),r},visitShapeRef:function(e){if("string"!=typeof e){let t=Exception("visitShapeRef expected a string, not "+JSON.stringify(e));throw console.warn(t),t}return e},visitShapeExternal:function(e){return this._testUnknownAttributes(e,["id"],"ShapeExternal",this.visitShapeNot),Object.assign("id"in e?{id:e.id}:{},{type:"ShapeExternal"})},_visitGroup:function(e,t){const r=this,n=Object.assign("id"in e?{id:null}:{},{type:e.type});return n.expressions=e.expressions.map((function(e){return r.visitExpression(e)})),this._maybeSet(e,n,"expr",["id","min","max","annotations","semActs"],["expressions"])},visitTripleConstraint:function(e){return this._maybeSet(e,Object.assign("id"in e?{id:null}:{},{type:"TripleConstraint"}),"TripleConstraint",["id","inverse","predicate","valueExpr","min","max","annotations","semActs"])},visitExpression:function(e){if("string"==typeof e)return this.visitInclusion(e);const t="TripleConstraint"===e.type?this.visitTripleConstraint(e):"OneOf"===e.type?this.visitOneOf(e):"EachOf"===e.type?this.visitEachOf(e):null;if(null===t)throw Error("unexpected expression type: "+e.type);return t},visitValues:function(t){const r=this;return t.map((function(t){return e(t)||"Language"===t.type?t:r.visitStemRange(t)}))},visitStemRange:function(t){const r=this;"type"in t||r.runtimeError(Error("expected "+JSON.stringify(t)+" to have a 'type' attribute."));const n=["IriStem","LiteralStem","LanguageStem","IriStemRange","LiteralStemRange","LanguageStemRange"];let s;return-1===n.indexOf(t.type)&&r.runtimeError(Error("expected type attribute '"+t.type+"' to be in '"+n+"'.")),e(t)?(this._expect(t.stem,"type","Wildcard"),s={type:t.type,stem:{type:"Wildcard"}}):s={type:t.type,stem:t.stem},t.exclusions&&(s.exclusions=t.exclusions.map((function(e){return r.visitExclusion(e)}))),s},visitExclusion:function(t){if(e(t))return t;{"type"in t||_Visitor.runtimeError(Error("expected "+JSON.stringify(t)+" to have a 'type' attribute."));const e=["IriStem","LiteralStem","LanguageStem"];return-1===e.indexOf(t.type)&&_Visitor.runtimeError(Error("expected type attribute '"+t.type+"' to be in '"+e+"'.")),{type:t.type,stem:t.stem}}},visitInclusion:function(e){if("string"!=typeof e){let t=Exception("visitInclusion expected a string, not "+JSON.stringify(e));throw console.warn(t),t}return e},_maybeSet:function(e,t,r,n,s){const i=this;return this._testUnknownAttributes(e,s?n.concat(s):n,r,this._maybeSet),n.forEach((function(r){const n="visit"+r.charAt(0).toUpperCase()+r.slice(1);if(r in e){const s=i[n];if("function"!=typeof s)throw Error(n+" not found in Visitor");const a=s.call(i,e[r]);void 0!==a&&(t[r]=a)}})),t},_visitValue:function(e){return e},_visitList:function(e){return e.slice()},_testUnknownAttributes:function(e,t,r,n){const s=Object.keys(e).reduce((function(e,r){return"type"!==r&&-1===t.indexOf(r)?e.concat(r):e}),[]);if(s.length>0){const t=Error("unknown propert"+(s.length>1?"ies":"y")+": "+s.map((function(e){return'"'+e+'"'})).join(",")+" in "+r+": "+JSON.stringify(e));throw Error.captureStackTrace(t,n),t}},_expect:function(e,t,r){t in e||this.runtimeError(Error("expected "+JSON.stringify(e)+" to have a ."+t)),arguments.length>2&&e[t]!==r&&this.runtimeError(Error("expected "+e[t]+" to equal "+r))}};return r.visitBase=r.visitStart=r.visitClosed=r["visit@context"]=r._visitValue,r.visitRestricts=r.visitExtends=r._visitShapeExprList,r.visitExtra=r.visitAnnotations=r._visitList,r.visitAbstract=r.visitInverse=r.visitPredicate=r._visitValue,r.visitName=r.visitId=r.visitCode=r.visitMin=r.visitMax=r._visitValue,r.visitType=r.visitNodeKind=r.visitDatatype=r.visitPattern=r.visitFlags=r.visitLength=r.visitMinlength=r.visitMaxlength=r.visitMininclusive=r.visitMinexclusive=r.visitMaxinclusive=r.visitMaxexclusive=r.visitTotaldigits=r.visitFractiondigits=r._visitValue,r.visitOneOf=r.visitEachOf=r._visitGroup,r.visitShapeAnd=r.visitShapeOr=r._visitShapeGroup,r.visitInclude=r._visitValue,r.visitValueExpr=r.visitShapeExpr,r}t.index=function(e){let r={shapeExprs:{},tripleExprs:{}},n=t(),s=n.visitExpression;n.visitExpression=function(e){return"object"==typeof e&&"id"in e&&(r.tripleExprs[e.id]=e),s.call(n,e)};let i=n.visitShapeExpr;n.visitShapeExpr=n.visitValueExpr=function(e,t){return"object"==typeof e&&"id"in e&&(r.shapeExprs[e.id]=e),i.call(n,e,t)};let a=n.visitShapeDecl;return n.visitShapeDecl=n.visitValueExpr=function(e,t){return"object"==typeof e&&"id"in e&&(r.shapeExprs[e.id]=e),a.call(n,e,t)},n.visitSchema(e),r},e.exports=t},863:(e,t,r)=>{ShExWebApp=function(){let e=r(261);return Object.assign({},{ShExTerm:r(118),Util:r(443),Validator:r(457),Writer:r(95),Api:r(410),Parser:r(931),"eval-simple-1err":r(540),"eval-threaded-nerr":r(237),ShapeMap:e,ShapeMapParser:e.Parser,DcTap:r(281).DcTap})}(),e.exports=ShExWebApp},95:(e,t,r)=>{const n=function(){const e=r(755),t=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,n=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,s={"\\":"\\\\",'"':'\\"',"/":"\\/","\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"},i={iri:"IRI",bnode:"BNODE",literal:"LITERAL",nonliteral:"NONLITERAL"};function a(e,t){if(!(this instanceof a))return new a(e,t);if(e&&"function"!=typeof e.write&&(t=e,e=null),t=t||{},e)this._outputStream=e,this._endStream=void 0===t.end||!!t.end;else{let e="";this._outputStream={write:function(t,r,n){e+=t,n&&n()},end:function(t){t&&t(null,e)}},this._endStream=!0}this._prefixIRIs=Object.create(null),this._baseIRI=t.base||null,t.prefixes&&this.addPrefixes(t.prefixes),this._error=t.error||c,this.forceParens=!t.simplifyParentheses,this._expect=t.lax?l:p}function o(e){let t=s[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 u(e){return e.replace(/\\/g,"\\\\").replace(/%/g,"\\%")}function c(e,t){"function"!=typeof e&&(t=e,e=c);const r=new Error(t);throw Error.captureStackTrace(r,e),r}function p(e,t,r){t in e||this._error(p,"expected "+e+" to have a ."+t),arguments.length>2&&e[t]!==r&&this._error(p,"expected "+e[e]+" to equal ."+r)}function l(){}return a.prototype={_write:function(e,t){this._outputStream.write(e,"utf8",t)},_writeSchema:function(e,t){const r=this;this._expect(e,"type","Schema"),r.addPrefixes(e._prefixes),e._base&&(r._baseIRI=e._base),r._baseIRI&&r._write("BASE <"+r._baseIRI+">\n"),e.imports&&e.imports.forEach((function(e){r._write("IMPORT "+r._encodeIriOrBlankNode(e)+"\n")})),e.startActs&&e.startActs.forEach((function(e){r._expect(e,"type","SemAct"),r._write(" %"+r._encodePredicate(e.name)+("code"in e?"{"+u(e.code)+"%}":"%"))})),e.start&&r._write("start = "+r._writeShapeExpr(e.start,t,!0,0).join("")+"\n"),"shapes"in e&&e.shapes.forEach((function(e){let n=e.id,s="";"ShapeDecl"===e.type&&(e.abstract&&(s="abstract "),e=e.shapeExpr),r._write(s+r._encodeShapeName(n,!1)+" "+r._writeShapeExpr(e,t,!0,0).join("")+"\n",t)}))},_writeShapeExpr:function(e,t,r,n){const s=this,i=[];if("string"==typeof e)i.push("@",s._encodeShapeName(e));else if("ShapeDecl"===e.type)i.push(s._writeShapeExpr(e.shapeExpr,t,!1,3));else if("ShapeExternal"===e.type)i.push("EXTERNAL");else if("ShapeAnd"===e.type){n>=3&&i.push("(");let r=!1;e.shapeExprs.forEach((function(n,a){if(a>0){function o(t){let r=e.shapeExprs[t];return!("NodeConstraint"!==r.type||"nodeKind"in r&&"literal"===r.nodeKind||"datatype"in r||"values"in r)}let c=!r&&(o(a-1)&&function(t){let r=e.shapeExprs[t];return"Shape"===r.type||"ShapeRef"===r.type}(a)||(u=a-1,"Shape"===e.shapeExprs[u].type&&o(a)));i.push(" AND "),r=c}var u;[].push.apply(i,s._writeShapeExpr(n,t,!1,3))})),n>=3&&i.push(")")}else if("ShapeOr"===e.type)n>=2&&i.push("("),e.shapeExprs.forEach((function(e,n){n>0&&i.push(" OR "),[].push.apply(i,s._writeShapeExpr(e,t,r,2))})),n>=2&&i.push(")");else if("ShapeNot"===e.type)n>=4&&i.push("("),i.push("NOT "),[].push.apply(i,s._writeShapeExpr(e.shapeExpr,t,r,4)),n>=4&&i.push(")");else if("Shape"===e.type)[].push.apply(i,s._writeShape(e,t,r));else{if("NodeConstraint"!==e.type)throw Error("expected Shape{,And,Or,Ref} or NodeConstraint in "+JSON.stringify(e));[].push.apply(i,s._writeNodeConstraint(e,t,r))}return i},_writeShape:function(e,t,r){const n=this;try{const a=[];this._expect(e,"type","Shape"),e.closed&&a.push("CLOSED "),[{keyword:"extends",marker:"EXTENDS "}].forEach((r=>{e[r.keyword]&&e[r.keyword].length>0&&(e[r.keyword].forEach((function(e,s){s&&a.push(" "),a.push(r.marker),[].push.apply(a,n._writeShapeExpr(e,t,!0,0))})),a.push(" "))})),e.extra&&e.extra.length>0&&(a.push("EXTRA "),e.extra.forEach((function(e,t){a.push(n._encodeShapeName(e,!1)+" ")})),a.push(" "));function s(e,t){0===e&&1===t?a.push("?"):0===e&&-1===t?a.push("*"):void 0===e&&void 0===t||(1===e&&-1===t?a.push("+"):a.push("{",e,",",-1===t?"*":t,"}"))}return a.push("{\n"),e.expression&&function e(r,i,o){function c(e){e&&e.forEach((function(e){n._expect(e,"type","SemAct"),a.push("\n"+i+" %"),a.push(n._encodeValue(e.name)),"code"in e?a.push("{"+u(e.code)+"%}"):a.push("%")}))}function p(t,r,n,s){const u=n0&&e.push(" "),i(t))e.push(s._encodeValue(t));else{"type"in t||runtimeError("expected "+JSON.stringify(t)+" to have a 'type' attribute.");const o=["Language","IriStem","LiteralStem","LanguageStem","IriStemRange","LiteralStemRange","LanguageStemRange"];function a(e,t){return-1!==["LanguageStem","LanguageStemRange"].indexOf(e.type)?"@"+t:-1!==["LiteralStem","LiteralStemRange"].indexOf(e.type)?'"'+t.replace(n,t)+'"':s._encodeValue(t)}-1===o.indexOf(t.type)&&runtimeError("expected type attribute '"+t.type+"' to be in '"+o+"'."),"Language"===t.type?e.push("@"+t.languageTag):i(t.stem)?e.push(a(t,t.stem)+"~"):(p(t.stem,"type","Wildcard"),e.push(".")),t.exclusions&&t.exclusions.forEach((function(r){if(e.push(" - "),i(r))e.push(a(t,r));else{"type"in r||runtimeError("expected "+JSON.stringify(r)+" to have a 'type' attribute.");const n=["IriStem","LiteralStem","LanguageStem"];-1===n.indexOf(r.type)&&runtimeError("expected type attribute '"+r.type+"' to be in '"+n+"'."),e.push(a(t,r.stem)+"~")}}))}})),e.push("]")),"pattern"in t){const r=t.pattern.replace(/\//g,"\\/"),n="flags"in t?t.flags:"";e.push("/"+r+"/"+n+" ")}return["length","minlength","maxlength","mininclusive","minexclusive","maxinclusive","maxexclusive","totaldigits","fractiondigits"].forEach((function(r){t[r]&&e.push(" ",r," ",t[r])})),e;function i(e){return"object"!=typeof e||"value"in e&&Object.keys(e).reduce(((e,t)=>!1===e?e:-1!==["value","type","language"].indexOf(t)),!0)}},_encodeIriOrBlankNode:function(e,r){if(r=r?" ":"","_"===e[0]&&":"===e[1])return e;t.test(e)&&(e=e.replace(n,o));const s=this._prefixRegex.exec(e);return s?(s[1]?this._prefixIRIs[s[1]]+s[2]:e)+r:this._relateUrl(e)},_relateUrl:function(t){const r=this._baseIRI;try{r&&new URL(r).host===new URL(t).host&&(t=e.relate(r,t,{output:e.ROOT_PATH_RELATIVE}))}catch(e){}return"<"+t+">"},_encodeLiteral:function(e,r,s){return t.test(e)&&(e=e.replace(n,o)),s?'"'+e+'"@'+s:r?"http://www.w3.org/2001/XMLSchema#integer"===r&&e.match(/^[+-]?[0-9]+$/)||"http://www.w3.org/2001/XMLSchema#decimal"===r&&e.match(/^[+-]?[0-9]*\.[0-9]+$/)||"http://www.w3.org/2001/XMLSchema#double"===r&&e.match(/^[+-]?([0-9]+\.[0-9]*[eE][+-]?[0-9]+|\.?[0-9]+[eE][+-]?[0-9]+)$/)?e:'"'+e+'"^^'+this._encodeIriOrBlankNode(r):'"'+e+'"'},_encodeShapeName:function(e,t){if('"'===e[0])throw new Error("A literal as subject is not allowed: "+e);return this._encodeIriOrBlankNode(e,t)},_encodePredicate:function(e){if('"'===e[0])throw new Error("A literal as predicate is not allowed: "+e);return"http://www.w3.org/1999/02/22-rdf-syntax-ns#type"===e?"a":this._encodeIriOrBlankNode(e)},_encodeValue:function(e){return"object"!=typeof e?this._encodeIriOrBlankNode(e):this._encodeLiteral(e.value,e.type,e.language)},_blockedWrite:function(){throw new Error("Cannot write because the writer has been closed.")},writeSchema:function(e,t){this._writeSchema(e,t),this.end(t)},addShape:function(e,t,r){this._write(_ShExWriter._encodeShapeName(t,!1)+" "+_ShExWriter._writeShapeExpr(e,r,!0,0).join(""),r)},addShapes:function(e){for(let t=0;t\n"))}if(n){let e="",t="";for(let n in r)e+=e?"|"+n:n,t+=(t?"|":"")+r[n];e=e.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&"),this._prefixRegex=new RegExp("^(?:"+t+")[^/]*$|^("+e+")([a-zA-Z][\\-_a-zA-Z0-9]*)$")}this._write(n?"\n":"",t)},_prefixRegex:/$0^/,end:function(e){this._write=this._blockedWrite;let t=e&&function(r,n){t=null,e(r,n)};if(this._endStream)try{return this._outputStream.end(t)}catch(e){}t&&t()}},a}();e.exports=n}},r={};function n(e){var s=r[e];if(void 0!==s)return s.exports;var i=r[e]={id:e,loaded:!1,exports:{}};return t[e].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}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.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);n(863)})(); \ No newline at end of file +(()=>{var t={752:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JisonLexer=void 0;var r=function(){function e(e){void 0===e&&(e={}),this.yy=e,this.EOF=1,this.options={},this.yyleng=0,this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0}}return e.prototype.parseError=function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},e.prototype.setInput=function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},e.prototype.input=function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},e.prototype.unput=function(e){var t=e.length,r=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var s=this.yylloc.range,i={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-t};return this.yylloc=i,this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},e.prototype.more=function(){return this._more=!0,this},e.prototype.reject=function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},e.prototype.less=function(e){this.unput(this.match.slice(e))},e.prototype.pastInput=function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},e.prototype.upcomingInput=function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},e.prototype.showPosition=function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},e.prototype.test_match=function(e,t){var r,n,s;if(this.options.backtrack_lexer&&(s={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.yylloc.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(s.yylloc.range=this.yylloc.range.slice(0))),(n=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],r=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var i in s)this[i]=s[i];return!1}return!1},e.prototype.next=function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,r,n=null;this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),i=0;in[0].length)){if(n=t,r=i,this.options.backtrack_lexer){if(!1!==(e=this.test_match(t,s[i])))return e;if(this._backtrack){n=null;continue}return!1}if(!this.options.flex)break}return n?!1!==(e=this.test_match(n,s[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},e.prototype.lex=function(){var e=this.next();return e||this.lex()},e.prototype.begin=function(e){this.conditionStack.push(e)},e.prototype.popState=function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},e.prototype._currentRules=function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},e.prototype.topState=function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},e.prototype.pushState=function(e){this.begin(e)},e.prototype.stateStackSize=function(){return this.conditionStack.length},e}();t.JisonLexer=r},41:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.o=t.JisonParser=void 0;var r=function(){function e(e,t){void 0===e&&(e={}),this.yy=e,this.lexer=t}return e.prototype.trace=function(e){},e.prototype.parseError=function(e,t){if(!t.recoverable){var r=new Error(e);throw r.hash=t,r}this.trace(e)},e.prototype.parse=function(e,t){void 0===t&&(t="function"==typeof this.yy&&"function"==typeof this.yy.constructor?new this.yy(this,this.lexer):Object.create(this.yy));var r=this,n=[0],s=[null],i=[],a=this.table,o="",u=0,c=0,p=0,l=2,f=1,h=i.slice.call(arguments,1),d=Object.create(this.lexer),m={yy:t};d.setInput(e,m.yy),m.yy.lexer=d,m.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var y=d.yylloc;i.push(y);var _=d.options&&d.options.ranges;function x(e){n.length=n.length-2*e,s.length=s.length-e,i.length=i.length-e}"function"==typeof m.yy.parseError&&(this.parseError=m.yy.parseError);for(var g,E,b,S,A,v,O,T,I,w=function(){var e;return"number"!=typeof(e=d.lex()||f)&&(e=r.symbols_[e]||e),e},F={};;){if(b=n[n.length-1],this.defaultActions[b]?S=this.defaultActions[b]:(null==g&&(g=w()),S=a[b]&&a[b][g]),void 0===S||!S.length||!S[0]){var N=null,k="";if(p)E!==f&&(N=R(b));else{for(var L in N=R(b),I=[],a[b])v=Number(L),this.terminals_[v]&&v>l&&I.push("'"+this.terminals_[v]+"'");k=d.showPosition?"Parse error on line "+(u+1)+":\n"+d.showPosition()+"\nExpecting "+I.join(", ")+", got '"+(this.terminals_[g]||g)+"'":"Parse error on line "+(u+1)+": Unexpected "+(g==f?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(k,{text:d.match,token:this.terminals_[g]||g,line:d.yylineno,loc:d.yylloc,expected:I,recoverable:null!==N})}if(3==p){if(g===f||E===f)throw new Error(k||"Parsing halted while starting to recover from another error.");c=d.yyleng,o=d.yytext,u=d.yylineno,y=d.yylloc,g=w()}if(null===N)throw new Error(k||"Parsing halted. No suitable error recovery rule available.");x(N||0),E=g==l?null:g,g=l,b=n[n.length-1],S=a[b]&&a[b][l],p=3}if(S[0]instanceof Array&&S.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+g);switch(S[0]){case 1:n.push(g),s.push(d.yytext),i.push(d.yylloc),n.push(S[1]),g=null,E?(g=E,E=null):(c=d.yyleng,o=d.yytext,u=d.yylineno,y=d.yylloc,p>0&&p--);break;case 2:if(O=this.productions_[S[1]][1],F.$=s[s.length-O],F._$={first_line:i[i.length-(O||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(O||1)].first_column,last_column:i[i.length-1].last_column},_&&(F._$.range=[i[i.length-(O||1)].range[0],i[i.length-1].range[1]]),void 0!==(A=this.performAction.apply(F,[o,c,u,m.yy,S[1],s,i].concat(h))))return A;O&&(n=n.slice(0,-1*O*2),s=s.slice(0,-1*O),i=i.slice(0,-1*O)),n.push(this.productions_[S[1]][0]),s.push(F.$),i.push(F._$),T=a[n[n.length-2]][n[n.length-1]],n.push(T);break;case 3:return!0}}return!0;function R(e){for(var t=n.length-1,r=0;;){if(l.toString()in a[e])return r;if(0===e||t<2)return null;e=n[t-=2],++r}}},e}();t.JisonParser=r,t.o=function(e,t,r){var n=e.length;for(r=r||{};n--;r[e[n]]=t);return r}},281:e=>{"use strict";function t(e,t,r){if(0===e.length)return;if(1===e.length)return e[0];const n={type:t};return n[r]=e,n}e.exports={DcTap:class{dontResolveIris=!1;prefixes={};shapes=[];curShape=null;conjuncts=null;headers=["shapeID","shapeLabel","propertyID","propertyLabel","mandatory","repeatable","valueNodeType","valueDataType","valueConstraint","valueConstraintType","valueShape","note"];constructor(e={}){Object.assign(this,e)}parseRows(e,t){return e.forEach((e=>{e[0].toLowerCase()===this.headers[0].toLowerCase()&&e[1].toLowerCase()===this.headers[1].toLowerCase()&&e[2].toLowerCase()===this.headers[2].toLowerCase()||"prefix"===e[0].toLowerCase()&&"namespace"===e[1].toLowerCase()||1===e.length||(2===e.length?this.prefixes[e[0]]=e[1]:this.parseRow(e,t))})),this}parseRow(e,t){if(Array.isArray(e)&&(e=this.headers.reduce(((t,r,n)=>(t[r]=e[n],t)),{})),e.valueNodeType=e.valueNodeType.toLowerCase(),e.valueConstraintType=e.valueConstraintType.toLowerCase(),e.shapeID)this.curShape={type:"Shape",shapeID:this.parseIri(e.shapeID,t),tripleConstraints:[]},this.shapes.push(this.curShape);else if(!this.curShape)throw new Error(`no current shape into which to add ${JSON.stringify(e)}`);return this.curShape.tripleConstraints.push(this.toTripleConstraint(e,t)),this}toTripleConstraint(e,t){return Object.assign({propertyID:this.parseIri(e.propertyID,t)},e.mandatory?{mandatory:!0}:{},e.repeatable?{repeatable:!0}:{},this.parseValueConstraint(e,t),e.valueShape?{valueShape:this.parseIri(e.valueShape,t)}:{})}parseValueConstraint(e,t){switch(e.valueConstraintType){case"iristem":case"literalstem":case"picklist":case"languagetag":return{values:e.valueConstraint.split(/\s+/).map((r=>this.coerseValue(r,e,t,e.valueConstraintType.endsWith("stem"))))};case"pattern":return{pattern:e.valueConstraint};case"":return e.valueDataType?{datatype:this.parseIri(e.valueDataType,t)}:{};default:throw Error(`Unknown valueConstraintType ${e.valueConstraintType} in ${JSON.stringify(e,null,2)}?`)}}coerseValue(e,t,r,n=!1){if("languagetag"===t.valueConstraintType)return{type:"Language",languageTag:e};switch(t.valueNodeType){case"literal":return n?{type:"LiteralStem",stem:e}:{value:e};case"iri":return n?{type:"IriStem",stem:this.parseIri(e,r)}:this.parseIri(e,r);case"":return{value:e};default:throw Error(`Unknown valueNodeType ${t.valueNodeType} in ${JSON.stringify(t,null,2)}?`)}}parseIri(e,t){if(this.dontResolveIris)return e;if("<"===e[0]){if(">"!==e[e.length-1])throw new Error(`Malformed URL: ${e}`);return new URL(e.substr(1,e.length-2),t).href}{const t=e.indexOf(":");if(-1===t)throw new Error(`Expected ':' in IRI ${e}`);const r=e.substr(0,t);if(!(r in this.prefixes))throw new Error(`Prefix ${r} not found in known prefixes: ${Object.keys(this.prefixes).join(" ,")}`);const n=e.substr(t+1);return this.prefixes[r]+n}}toJson(){return this.shapes}toShEx(){return{type:"Schema",shapes:this.shapes.map((e=>({type:"Shape",id:e.shapeID,expression:t(e.tripleConstraints.map((e=>Object.assign({type:"TripleConstraint",predicate:e.propertyID},e.mandatory?{min:1}:{},e.repeatable?{max:-1}:{},function(e){const r=[];e.values&&r.push({type:"NodeConstraint",values:e.values});e.pattern&&r.push({type:"NodeConstraint",pattern:e.pattern});e.datatype&&r.push({type:"NodeConstraint",datatype:e.datatype});e.valueShape&&r.push(e.valueShape);const n=t(r,"ShapeAnd","shapeExprs");return n?{valueExpr:n}:{}}(e)))),"EachOf","expressions")})))}}}}},515:e=>{var t={create:function(){let e={},t={},r={},n={};return{add:function(s,i){if(s in r&&-1!==r[s].indexOf(i))return;let a=s in n?c(s):e[s]=c(s),o=c(i);function u(e,t,r,n){e[n]=e[n].filter((t=>-1===e[r].indexOf(t))).concat(-1===e[r].indexOf(r)?[r]:[],e[r]),e[r].forEach((e=>t[e]=t[e].filter((e=>e!==n&&-1===t[n].indexOf(e))).concat(-1===t[n].indexOf(n)?[n]:[],t[n])))}function c(e){return e in n||(t[e]=[],r[e]=[],n[e]={}),n[e]}a[i]=o,delete e[i],u(r,t,i,s),u(t,r,s,i)},roots:e,parents:t,children:r}},depthFirst:function e(t,r,n){return Object.keys(t).reduce(((s,i)=>s.concat(e(t[i],r,i),n?r(i,n):[])),[])}};e.exports=t},808:e=>{"use strict";function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,r,n,s){r=r||"&",n=n||"=";var i={};if("string"!=typeof e||0===e.length)return i;var a=/\+/g;e=e.split(r);var o=1e3;s&&"number"==typeof s.maxKeys&&(o=s.maxKeys);var u=e.length;o>0&&u>o&&(u=o);for(var c=0;c=0?(p=d.substr(0,m),l=d.substr(m+1)):(p=d,l=""),f=decodeURIComponent(p),h=decodeURIComponent(l),t(i,f)?Array.isArray(i[f])?i[f].push(h):i[f]=[i[f],h]:i[f]=h}return i}},368:e=>{"use strict";var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,r,n,s){return r=r||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(s){var i=encodeURIComponent(t(s))+n;return Array.isArray(e[s])?e[s].map((function(e){return i+encodeURIComponent(t(e))})).join(r):i+encodeURIComponent(t(e[s]))})).join(r):s?encodeURIComponent(t(s))+n+encodeURIComponent(t(e)):""}},642:(e,t,r)=>{"use strict";t.decode=t.parse=r(808),t.encode=t.stringify=r(368)},362:e=>{"use strict";e.exports={ABSOLUTE:"absolute",PATH_RELATIVE:"pathRelative",ROOT_RELATIVE:"rootRelative",SHORTEST:"shortest"}},779:(e,t,r)=>{"use strict";var n=r(362);function s(e,t){var r=t.removeEmptyQueries&&e.extra.relation.minimumPort;return e.query.string[r?"stripped":"full"]}function i(e,t){return!e.extra.relation.minimumQuery||t.output===n.ABSOLUTE||t.output===n.ROOT_RELATIVE}function a(e,t){var r=t.removeDirectoryIndexes&&e.extra.resourceIsIndex,s=e.extra.relation.minimumResource&&t.output!==n.ABSOLUTE&&t.output!==n.ROOT_RELATIVE;return!!e.resource&&!s&&!r}e.exports=function(e,t){var r="";return r+=function(e,t){var r="";return(e.extra.relation.maximumHost||t.output===n.ABSOLUTE)&&(e.extra.relation.minimumScheme&&t.schemeRelative&&t.output!==n.ABSOLUTE?r+="//":r+=e.scheme+"://"),r}(e,t),r+=function(e,t){return!e.auth||t.removeAuth||!e.extra.relation.maximumHost&&t.output!==n.ABSOLUTE?"":e.auth+"@"}(e,t),r+=function(e,t){return e.host.full&&(e.extra.relation.maximumAuth||t.output===n.ABSOLUTE)?e.host.full:""}(e,t),r+=function(e,t){return e.port&&!e.extra.portIsDefault&&e.extra.relation.maximumHost?":"+e.port:""}(e),r+=function(e,t){var r="",o=e.path.absolute.string,u=e.path.relative.string,c=a(e,t);if(e.extra.relation.maximumHost||t.output===n.ABSOLUTE||t.output===n.ROOT_RELATIVE)r=o;else if(u.length<=o.length&&t.output===n.SHORTEST||t.output===n.PATH_RELATIVE){if(""===(r=u)){var p=i(e,t)&&!!s(e,t);e.extra.relation.maximumPath&&!c?r="./":!e.extra.relation.overridesQuery||c||p||(r="./")}}else r=o;return"/"!==r||c||!t.removeRootTrailingSlash||e.extra.relation.minimumPort&&t.output!==n.ABSOLUTE||(r=""),r}(e,t),r+=function(e,t){return a(e,t)?e.resource:""}(e,t),r+=function(e,t){return i(e,t)?s(e,t):""}(e,t),r+=function(e,t){return e.hash?e.hash:""}(e),r}},755:(e,t,r)=>{"use strict";var n=r(362),s=r(779),i=r(141),a=r(609),o=r(398),u=r(258);function c(e,t){this.options=i(t,{defaultPorts:{ftp:21,http:80,https:443},directoryIndexes:["index.html"],ignore_www:!1,output:c.SHORTEST,rejectedSchemes:["data","javascript","mailto"],removeAuth:!1,removeDirectoryIndexes:!0,removeEmptyQueries:!1,removeRootTrailingSlash:!0,schemeRelative:!0,site:void 0,slashesDenoteHost:!0}),this.from=o.from(e,this.options,null)}c.prototype.relate=function(e,t,r){if(a.isPlainObject(t)?(r=t,t=e,e=null):t||(t=e,e=null),r=i(r,this.options),e=e||r.site,!(e=o.from(e,r,this.from))||!e.href)throw new Error("from value not defined.");if(e.extra.hrefInfo.minimumPathOnly)throw new Error("from value supplied is not absolute: "+e.href);return!1===(t=o.to(t,r)).valid?t.href:(t=u(e,t,r),t=s(t,r))},c.relate=function(e,t,r){return(new c).relate(e,t,r)},a.shallowMerge(c,n),e.exports=c},141:(e,t,r)=>{"use strict";var n=r(609);function s(e,t){return t instanceof Object&&e instanceof Object?t instanceof Array&&e instanceof Array?t.concat(e):n.shallowMerge(e,t):e}e.exports=function(e,t){if(n.isPlainObject(e)){var r={};for(var i in t)t.hasOwnProperty(i)&&(void 0!==e[i]?r[i]=s(e[i],t[i]):r[i]=t[i]);return r}return t}},420:e=>{"use strict";e.exports=function(e,t){if(t.ignore_www){var r=e.host.full;if(r){var n=r;0===r.indexOf("www.")&&(n=r.substr(4)),e.host.stripped=n}}}},849:e=>{"use strict";e.exports=function(e){var t=!(e.scheme||e.auth||e.host.full||e.port),r=t&&!e.path.absolute.string,n=r&&!e.resource,s=n&&!e.query.string.full.length,i=s&&!e.hash;e.extra.hrefInfo.minimumPathOnly=t,e.extra.hrefInfo.minimumResourceOnly=r,e.extra.hrefInfo.minimumQueryOnly=n,e.extra.hrefInfo.minimumHashOnly=s,e.extra.hrefInfo.empty=i}},398:(e,t,r)=>{"use strict";var n=r(849),s=r(420),i=r(965),a=r(22),o=r(150),u=r(936),c=r(831);function p(e,t){var r=u(e,t);return!1===r.valid||(s(r,t),a(r,t),i(r,t),o(r,t),n(r)),r}e.exports={from:function(e,t,r){if(e){var n=p(e,t),s=c.resolveDotSegments(n.path.absolute.array);return n.path.absolute.array=s,n.path.absolute.string="/"+c.join(s),n}return r},to:p}},965:e=>{"use strict";function t(e){if("/"!==e){var t=[];return e.split("/").forEach((function(e){""!==e&&t.push(e)})),t}return[]}e.exports=function(e,r){var n=e.path.absolute.string;if(n){var s=n.lastIndexOf("/");if(s>-1){if(++s{"use strict";e.exports=function(e,t){var r=-1;for(var n in t.defaultPorts)if(n===e.scheme&&t.defaultPorts.hasOwnProperty(n)){r=t.defaultPorts[n];break}r>-1&&(r=r.toString(),null===e.port&&(e.port=r),e.extra.portIsDefault=e.port===r)}},150:e=>{"use strict";var t=Object.prototype.hasOwnProperty;function r(e,r){var n=0,s="";for(var i in e)if(""!==i&&!0===t.call(e,i)){var a=e[i];""===a&&r||(s+=1==++n?"?":"&",i=encodeURIComponent(i),s+=""!==a?i+"="+encodeURIComponent(a).replace(/%20/g,"+"):i)}return s}e.exports=function(e,t){e.query.string.full=r(e.query.object,!1),t.removeEmptyQueries&&(e.query.string.stripped=r(e.query.object,!0))}},936:(e,t,r)=>{"use strict";var n=r(883).Qc;e.exports=function(e,t){return function(e,t){var r=!0;return t.rejectedSchemes.every((function(t){return r=!(0===e.indexOf(t+":"))})),r}(e,t)?(r=n(e,!0,t.slashesDenoteHost),(s=r.protocol)&&s.indexOf(":")===s.length-1&&(s=s.substr(0,s.length-1)),r.host={full:r.hostname,stripped:null},r.path={absolute:{array:null,string:r.pathname},relative:{array:null,string:null}},r.query={object:r.query,string:{full:null,stripped:null}},r.extra={hrefInfo:{minimumPathOnly:null,minimumResourceOnly:null,minimumQueryOnly:null,minimumHashOnly:null,empty:null,separatorOnlyQuery:"?"===r.search},portIsDefault:null,relation:{maximumScheme:null,maximumAuth:null,maximumHost:null,maximumPort:null,maximumPath:null,maximumResource:null,maximumQuery:null,maximumHash:null,minimumScheme:null,minimumAuth:null,minimumHost:null,minimumPort:null,minimumPath:null,minimumResource:null,minimumQuery:null,minimumHash:null,overridesQuery:null},resourceIsIndex:null,slashes:r.slashes},r.resource=null,r.scheme=s,delete r.hostname,delete r.pathname,delete r.protocol,delete r.search,delete r.slashes,r):{href:e,valid:!1};var r,s}},799:(e,t,r)=>{"use strict";var n=r(19),s=r(609),i=r(831);e.exports=function(e,t,r){n.upToPath(e,t,r),e.extra.relation.minimumScheme&&(e.scheme=t.scheme),e.extra.relation.minimumAuth&&(e.auth=t.auth),e.extra.relation.minimumHost&&(e.host=s.clone(t.host)),e.extra.relation.minimumPort&&function(e,t){e.port=t.port,e.extra.portIsDefault=t.extra.portIsDefault}(e,t),e.extra.relation.minimumScheme&&function(e,t){if(e.extra.relation.maximumHost||!e.extra.hrefInfo.minimumResourceOnly){var r=e.path.absolute.array,n="/";r?(e.extra.hrefInfo.minimumPathOnly&&0!==e.path.absolute.string.indexOf("/")&&(r=t.path.absolute.array.concat(r)),r=i.resolveDotSegments(r),n+=i.join(r)):r=[],e.path.absolute.array=r,e.path.absolute.string=n}else e.path=s.clone(t.path)}(e,t),n.pathOn(e,t,r),e.extra.relation.minimumResource&&function(e,t){e.resource=t.resource,e.extra.resourceIsIndex=t.extra.resourceIsIndex}(e,t),e.extra.relation.minimumQuery&&(e.query=s.clone(t.query)),e.extra.relation.minimumHash&&(e.hash=t.hash)}},19:e=>{"use strict";e.exports={pathOn:function(e,t,r){var n=e.extra.hrefInfo.minimumQueryOnly,s=e.extra.hrefInfo.minimumHashOnly,i=e.extra.hrefInfo.empty,a=e.extra.relation.minimumPort,o=e.extra.relation.minimumScheme,u=a&&e.path.absolute.string===t.path.absolute.string,c=e.resource===t.resource||!e.resource&&t.extra.resourceIsIndex||r.removeDirectoryIndexes&&e.extra.resourceIsIndex&&!t.resource,p=u&&(c||n||s||i),l=r.removeEmptyQueries?"stripped":"full",f=e.query.string[l],h=t.query.string[l],d=p&&!!f&&f===h||(s||i)&&!e.extra.hrefInfo.separatorOnlyQuery,m=d&&e.hash===t.hash;e.extra.relation.minimumPath=u,e.extra.relation.minimumResource=p,e.extra.relation.minimumQuery=d,e.extra.relation.minimumHash=m,e.extra.relation.maximumPort=!o||o&&!u,e.extra.relation.maximumPath=!o||o&&!p,e.extra.relation.maximumResource=!o||o&&!d,e.extra.relation.maximumQuery=!o||o&&!m,e.extra.relation.maximumHash=!o||o&&!m,e.extra.relation.overridesQuery=u&&e.extra.relation.maximumResource&&!d&&!!h},upToPath:function(e,t,r){var n=e.extra.hrefInfo.minimumPathOnly,s=e.scheme===t.scheme||!e.scheme,i=s&&(e.auth===t.auth||r.removeAuth||n),a=r.ignore_www?"stripped":"full",o=i&&(e.host[a]===t.host[a]||n),u=o&&(e.port===t.port||n);e.extra.relation.minimumScheme=s,e.extra.relation.minimumAuth=i,e.extra.relation.minimumHost=o,e.extra.relation.minimumPort=u,e.extra.relation.maximumScheme=!s||s&&!i,e.extra.relation.maximumAuth=!s||s&&!o,e.extra.relation.maximumHost=!s||s&&!u}}},258:(e,t,r)=>{"use strict";var n=r(799),s=r(255);e.exports=function(e,t,r){return n(t,e,r),s(t,e,r),t}},255:(e,t,r)=>{"use strict";var n=r(831);e.exports=function(e,t,r){if(e.extra.relation.minimumScheme){var s=(i=e.path.absolute.array,a=t.path.absolute.array,o=[],u=!0,c=-1,a.forEach((function(e,t){u&&(i[t]!==e?u=!1:c=t),u||o.push("..")})),i.forEach((function(e,t){t>c&&o.push(e)})),o);e.path.relative.array=s,e.path.relative.string=n.join(s)}var i,a,o,u,c}},609:e=>{"use strict";e.exports={clone:function e(t){if(t instanceof Object){var r=t instanceof Array?[]:{};for(var n in t)t.hasOwnProperty(n)&&(r[n]=e(t[n]));return r}return t},isPlainObject:function(e){return!!e&&"object"==typeof e&&e.constructor===Object},shallowMerge:function(e,t){if(e instanceof Object&&t instanceof Object)for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}}},831:e=>{"use strict";e.exports={join:function(e){return e.length>0?e.join("/")+"/":""},resolveDotSegments:function(e){var t=[];return e.forEach((function(e){".."!==e?"."!==e&&t.push(e):t.length>0&&t.splice(t.length-1,1)})),t}}},639:function(e,t,r){var n;e=r.nmd(e),function(s){t&&t.nodeType,e&&e.nodeType;var i="object"==typeof r.g&&r.g;i.global!==i&&i.window!==i&&i.self;var a,o=2147483647,u=36,c=/^xn--/,p=/[^\x20-\x7E]/,l=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=Math.floor,d=String.fromCharCode;function m(e){throw RangeError(f[e])}function y(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function _(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+y((e=e.replace(l,".")).split("."),t).join(".")}function x(e){for(var t,r,n=[],s=0,i=e.length;s=55296&&t<=56319&&s65535&&(t+=d((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=d(e)})).join("")}function E(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function b(e,t,r){var n=0;for(e=r?h(e/700):e>>1,e+=h(e/t);e>455;n+=u)e=h(e/35);return h(n+36*e/(e+38))}function S(e){var t,r,n,s,i,a,c,p,l,f,d,y=[],_=e.length,x=0,E=128,S=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n=128&&m("not-basic"),y.push(e.charCodeAt(n));for(s=r>0?r+1:0;s<_;){for(i=x,a=1,c=u;s>=_&&m("invalid-input"),((p=(d=e.charCodeAt(s++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:u)>=u||p>h((o-x)/a))&&m("overflow"),x+=p*a,!(p<(l=c<=S?1:c>=S+26?26:c-S));c+=u)a>h(o/(f=u-l))&&m("overflow"),a*=f;S=b(x-i,t=y.length+1,0==i),h(x/t)>o-E&&m("overflow"),E+=h(x/t),x%=t,y.splice(x++,0,E)}return g(y)}function A(e){var t,r,n,s,i,a,c,p,l,f,y,_,g,S,A,v=[];for(_=(e=x(e)).length,t=128,r=0,i=72,a=0;a<_;++a)(y=e[a])<128&&v.push(d(y));for(n=s=v.length,s&&v.push("-");n<_;){for(c=o,a=0;a<_;++a)(y=e[a])>=t&&yh((o-r)/(g=n+1))&&m("overflow"),r+=(c-t)*g,t=c,a=0;a<_;++a)if((y=e[a])o&&m("overflow"),y==t){for(p=r,l=u;!(p<(f=l<=i?1:l>=i+26?26:l-i));l+=u)A=p-f,S=u-f,v.push(d(E(f+A%S,0))),p=h(A/S);v.push(d(E(p,0))),i=b(r,g,n==s),r=0,++n}++r,++t}return v.join("")}a={version:"1.3.2",ucs2:{decode:x,encode:g},decode:S,encode:A,toASCII:function(e){return _(e,(function(e){return p.test(e)?"xn--"+A(e):e}))},toUnicode:function(e){return _(e,(function(e){return c.test(e)?S(e.slice(4).toLowerCase()):e}))}},void 0===(n=function(){return a}.call(t,r,t,e))||(e.exports=n)}()},883:(e,t,r)=>{"use strict";var n=r(639),s=r(225);function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.Qc=g;var a=/^([a-z0-9.+-]+:)/i,o=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),p=["'"].concat(c),l=["%","/","?",";","#"].concat(p),f=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},x=r(642);function g(e,t,r){if(e&&s.isObject(e)&&e instanceof i)return e;var n=new i;return n.parse(e,t,r),n}i.prototype.parse=function(e,t,r){if(!s.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),o=-1!==i&&i127?R+="x":R+=L[C];if(!R.match(h)){var j=N.slice(0,I),$=N.slice(I+1),P=L.match(d);P&&(j.push(P[1]),$.unshift(P[2])),$.length&&(g="/"+$.join(".")+g),this.hostname=j.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),F||(this.hostname=n.toASCII(this.hostname));var Q=this.port?":"+this.port:"",M=this.hostname||"";this.host=M+Q,this.href+=this.host,F&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==g[0]&&(g="/"+g))}if(!m[S])for(I=0,k=p.length;I0)&&r.host.split("@"))&&(r.auth=F.shift(),r.host=r.hostname=F.shift());return r.search=e.search,r.query=e.query,s.isNull(r.pathname)&&s.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!A.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var O=A.slice(-1)[0],T=(r.host||e.host||A.length>1)&&("."===O||".."===O)||""===O,I=0,w=A.length;w>=0;w--)"."===(O=A[w])?A.splice(w,1):".."===O?(A.splice(w,1),I++):I&&(A.splice(w,1),I--);if(!b&&!S)for(;I--;I)A.unshift("..");!b||""===A[0]||A[0]&&"/"===A[0].charAt(0)||A.unshift(""),T&&"/"!==A.join("/").substr(-1)&&A.push("");var F,N=""===A[0]||A[0]&&"/"===A[0].charAt(0);v&&(r.hostname=r.host=N?"":A.length?A.shift():"",(F=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=F.shift(),r.host=r.hostname=F.shift()));return(b=b||r.host&&A.length)&&!N&&A.unshift(""),A.length?r.pathname=A.join("/"):(r.pathname=null,r.path=null),s.isNull(r.pathname)&&s.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},i.prototype.parseHost=function(){var e=this.host,t=o.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},225:e=>{"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},540:(e,t,r)=>{const n=function(){const e=r(118),t="|",n="×",s="";function i(e){e||(e={});for(let t,r=1,n=arguments.length;r{e[t].outs.push(r)}))}}();function c(t,n,s,a,o,u,c,d){const m=this;let y=[],_=[];if(1===m.states.length)return h([],s,a,u,c);let x=null;for(l(m,y,this.start,{repeats:{},avail:[],matched:[],stack:[],errors:[]});y.length;){_=[],d&&d.push({threads:[]});for(let e=0;ee.tNo)));const o=t.avail[e].splice(0,i);if(o.length>=n)do{p(m,_,t,o)}while(t.avail[e].length>0&&o.lengthf(e.state,e.repeats)))})}if(0===_.length&&null===x)return g(E(y,m.states));const e=y;y=_,_=e;const t=y.reduce(((e,t)=>{const r=t.matched.reduce(((e,t)=>e+t.triples.length),0)===o.reduce(((e,t)=>"NO_TRIPLE_CONSTRAINT"===t?e:e+1),0);return null!==e?e:t.state===m.end&&r?t:null}),null);t&&(x=t)}if(null===x)return g();function g(){return{type:"Failure",node:n,errors:E(y,m.states)}}function E(t,n){const s=n[n.length-1];return t.reduce(((t,n)=>{const a=m.states[n.state].c;let c=null;if("string"==typeof a.valueExpr?(c=a.valueExpr,e.isBlank(c)&&(c=r.shapes[c])):a.valueExpr&&(c=i({},a.valueExpr)),n.state!==m.end)return t.concat([i({type:"MissingProperty",property:s.c.predicate},c?{valueExpr:c}:{})]);{const e={};return Object.keys(o).forEach((t=>{"NO_TRIPLE_CONSTRAINT"!==o[t]&&(e[t]=o[t])})),n.matched.forEach((t=>{t.triples.forEach((t=>{delete e[t]}))})),t.concat(Object.keys(e).map((t=>i({type:"ExcessTripleViolation",property:s.c.predicate,triple:u[e[t]]},c?{valueExpr:c}:{}))))}}),[])}return"errors"in x.matched?x.matched:h(x.matched,s,a,u,c)}function p(e,t,r,s){const i=e.states[r.state],a=e.states.map((e=>e.c===n?e.expr:null)),o=i.stack.map((e=>{let t=r.repeats[a.indexOf(e.c)];return void 0===t?t=0:t-=1,{c:e.c,e:e.e,i:t}})),u={c:i.c,triples:s,stack:o};r.matched=r.matched.concat(u),i.outs.forEach((n=>{l(e,t,n,r)}))}function l(e,r,s,i,a){a=a||[];const o=f(s,i.repeats);if(-1!==a.indexOf(o))return;a.push(o);const u=e.states[s];if(u.c===t)return u.outs.reduce(((t,n,s)=>t.concat(l(e,r,n,i,a))),[]);if(u.c===n){const t=[];s in i.repeats||(i.repeats[s]=0);const n=i.repeats[s];return n(r[n]=parseInt(n)==t?e.repeats[n]+1:e.repeats[n],r)),{});return{state:e.state,repeats:r,matched:e.matched,avail:e.avail.slice(),stack:e.stack}}(i,s),a)),n>=u.min&&n<=u.max&&[].push.apply(t,l(e,r,u.outs[1],function(e,t){const r=Object.keys(e.repeats).reduce(((r,n)=>(parseInt(n)!==t&&(r[n]=e.repeats[n]),r)),{});return{state:e.state,repeats:r,matched:e.matched,avail:e.avail.slice(),stack:e.stack}}(i,s),a)),t}return[r.push({state:s,repeats:i.repeats,avail:i.avail.map((e=>e.slice())),stack:i.stack,matched:i.matched,errors:i.errors})-1]}function f(e,t){const r=Object.keys(t).map((e=>e+":"+t[e])).join(",");return r.length?e+"-"+r:""+e}function h(t,r,n,s,i){let o=[];const u=[],c=[],p=t.reduce(((t,a)=>{let p,l=0,f=t;for(;l=o.length&&o.push({}),a.stack[l].c!==o[l].c){if(p=[],f.type="EachOf"===a.stack[l].c.type?"EachOfSolutions":"OneOfSolutions",f.solutions=p,"min"in a.stack[l].c&&(f.min=a.stack[l].c.min),"max"in a.stack[l].c&&(f.max=a.stack[l].c.max),"annotations"in a.stack[l].c&&(f.annotations=a.stack[l].c.annotations),"semActs"in a.stack[l].c&&(f.semActs=a.stack[l].c.semActs),f=p,o[l].i=null,"semActs"in a.stack[l].c){const e=i.dispatchAll(a.stack[l].c.semActs,"???",f);if(e.length)throw e}}else f=f.solutions;if(a.stack[l].i!==o[l].i?(p=[],f[a.stack[l].i]={type:"EachOf"===a.stack[l].c.type?"EachOfSolution":"OneOfSolution",expressions:p},f=p,o[l].e=null):f=f[o[l].i].expressions,a.stack[l].e===o[l].e)throw"how'd we get here?";p={},f[a.stack[l].e]=p,a.stack[l].e>0&&void 0===f[a.stack[l].e-1]&&-1===c.indexOf(f)&&c.push(f),f=p,o.length=l+1,++l}return f.type="TripleConstraintSolutions","min"in a.c&&(f.min=a.c.min),"max"in a.c&&(f.max=a.c.max),f.predicate=a.c.predicate,"valueExpr"in a.c&&(f.valueExpr=a.c.valueExpr),"id"in a.c&&(f.productionLabel=a.c.id),f.solutions=a.triples.map((t=>{const o=s[t],c={type:"TestedTriple",subject:o.subject,predicate:o.predicate,object:function(t){if('"'!==t[0])return t;const r={value:e.getLiteralValue(t)},n=e.getLiteralType(t);n&&"http://www.w3.org/2001/XMLSchema#string"!==n&&"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"!==n&&(r.type=n);const s=e.getLiteralLanguage(t);s&&(r.language=s);return r}(o.object)};const p=r.indexOf(a.c),l=n[p].find((e=>e.tNo===t));return l.res&&Object.keys(l.res).length>0&&(c.referenced=l.res),0===u.length&&"semActs"in a.c&&[].push.apply(u,i.dispatchAll(a.c.semActs,o,c)),c})),"annotations"in a.c&&(f.annotations=a.c.annotations),"semActs"in a.c&&(f.semActs=a.c.semActs),o=a.stack.slice(),t}),{});return u.length?{type:"SemActFailure",errors:u}:(c.forEach((e=>{for(let t=0;t{const n=function(){const e=r(118);function t(e){e||(e={});for(let t,r=1,n=arguments.length;r0&&0===c[0].errors.length&&c.forEach((r=>{const n="expression"in u?u.expression.solutions.slice():[];"solution"in r&&n.push(r.solution),delete r.solution,r.expression=t({type:e,solutions:n},o)})),0===c.length||c[0].errors.length>0)return s0&&0===a[0].errors.length&&"semActs"in n){const e=[],t=[];a.forEach((r=>{const s=f.dispatchAll(n.semActs,"???",r);0===s.length?e.push(r):([].push.apply(r.errors,s),t.push(r))})),a=e.length>0?e:t}return a}if("TripleConstraint"===n.type){const _="negated"in n&&n.negated||0===h;_&&(p=h=1/0),void 0===i.avail[o]&&(i.avail[o]=c[o].map((e=>e.tNo)));const x={};("min"in n&&1!==n.min||"max"in n&&1!==n.max)&&(x.min=n.min,x.max=n.max),"semActs"in n&&(x.semActs=n.semActs),"annotations"in n&&(x.annotations=n.annotations);const g=i.avail[o].splice(0,p),E=_?0===g.length:g.length>=p,b=[],S=i.matched;if(E)do{const A=g.reduce(((e,t)=>{const r=l[t],s={type:"TestedTriple",subject:r.subject,predicate:r.predicate,object:a(r.object)},u=c[o].find((e=>e.tNo===t));u.res&&Object.keys(u.res).length>0&&(s.referenced=u.res);const p=i.errors.concat("semActs"in n?f.dispatchAll(n.semActs,s,s):[]);return p.length>0?e.fail.push({tripleNo:t,tested:s,semActErrors:p}):e.pass.push({tripleNo:t,tested:s,semActErrors:p}),e}),{pass:[],fail:[]});if(0===A.fail.length){const v=0===g.length?i.errors.slice():[],O=m(A.pass,v);b.push(O)}else A.fail.forEach((e=>b.push(m([e],e.semActErrors))));function m(e,r){return{avail:i.avail.map((e=>e.slice())),errors:r,matched:S.concat({tNos:e.map((e=>e.tripleNo))}),expression:t({type:"TripleConstraintSolutions",predicate:n.predicate},"valueExpr"in n?{valueExpr:n.valueExpr}:{},"id"in n?{productionLabel:n.id}:{},x,{solutions:e.map((e=>e.tested))})}}}while(i.avail[o].length>0&&g.length{const t=[],s=[];return n.expressions.forEach((n=>{const i={avail:e.avail.map((e=>e.slice())),errors:e.errors,matched:e.matched},a=r(n,i);0===a[0].errors.length?([].push.apply(t,a),a.forEach((e=>{const t="solution"in i?i.solution.expressions:[];"expression"in e&&t.push(e.expression),delete e.expression,e.solution={type:"OneOfSolution",expressions:t}}))):[].push.apply(s,a)})),t.length>0?t:s}));if("EachOf"===n.type)return y(d("EachOfSolutions",(e=>n.expressions.reduce(((e,t)=>y(e.reduce(((e,n)=>{const s=r(t,n);return s.forEach((e=>{if(0===e.errors.length){const t="solution"in n?n.solution.expressions.slice():[];"expression"in e&&t.push(e.expression),delete e.expression,e.solution={type:"EachOfSolution",expressions:t}}})),e.concat(s)}),[]))),[e]))));function y(e){return e.reduce(((e,t)=>0===t.errors.length?e.errors?{errors:!1,l:[t]}:{errors:!1,l:e.l.concat(t)}:e.errors?{errors:!0,l:e.l.concat(t)}:e),{errors:!0,l:[]}).l}runtimeError("unexpected expr type: "+n.type)}(i,{avail:[],matched:[],errors:[]}),m=d.reduce(((e,t)=>{if(t.errors.length>0)return e;const r={};return Object.keys(p).forEach((e=>{"NO_TRIPLE_CONSTRAINT"!==p[e]&&(r[e]=p[e])})),t.matched.forEach((e=>{e.tNos.forEach((e=>{delete r[e]}))})),Object.keys(r).forEach((e=>{t.errors.push({type:"ExcessTripleViolation",triple:l[e],constraint:u[r[e]]})})),null!==e?e:Object.keys(r).length>0?null:t}),null);return null!==m?function(t,r,s,i){function o(u){if("OneOfSolutions"===u.type||"EachOfSolutions"===u.type)u.solutions.forEach((e=>{e.expressions.forEach((e=>{o(e)}))}));else{if("TripleConstraintSolutions"!==u.type)throw Error("unexpected expr type in "+JSON.stringify(u));u.solutions=u.solutions.map((o=>{if("TestedTriple"===o.type)return o;const u=s[o.tripleNo],c=r[o.constraintNo],p={type:"TestedTriple",subject:u.subject,predicate:u.predicate,object:a(u.object)};function l(t,r,s){const i=s(t,r);if("errors"in i){const s={type:"ReferenceError",focus:t,shape:r};return"string"==typeof r&&e.isBlank(r)&&(s.referencedShape=n),s.errors=i,[s]}return(("solution"in i||"solutions"in i)&&0!==Object.keys(i.solution||i.solutions).length||"Recursion"===i.type)&&(p.referenced=i),[]}function f(e,t){return l(e,t,recurse)}function h(e,t){return l(e,t,direct)}const d="valueExpr"in c?checkValueExpr(c.inverse?u.subject:u.object,c.valueExpr,f,h):[];return 0===d.length&&"semActs"in c&&[].push.apply(d,i.dispatchAll(c.semActs,p,p)),d.length>0&&(t.errors=t.errors||[],t.errors=t.errors.concat(d)),p}))}}Object.keys(t).length>0&&o(t);"semActs"in n&&(t.semActs=n.semActs);return t}(m.expression,u,l,f):d.length>1?{type:"PossibleErrors",errors:d.reduce(((e,t)=>e.concat([t.errors])),[])}:d[0]}};function a(t){if('"'!==t[0])return t;const r={value:e.getLiteralValue(t)},n=e.getLiteralType(t);n&&"http://www.w3.org/2001/XMLSchema#string"!==n&&"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"!==n&&(r.type=n);const s=e.getLiteralLanguage(t);return s&&(r.language=s),r}}}}();e.exports=n},839:(e,t,r)=>{const n=r(14),s="http://www.w3.org/2001/XMLSchema#",i=s+"boolean",a=/^[a-z][a-z0-9+.-]*:/i;function o(e){e||(e={});for(let t,r=1,n=arguments.length;r>10),56320+(1023&i))}{const e=t[s];if(!e)throw new Error("no replacement found for '"+s+"'");return e}}))}catch(e){return console.warn(e),""}}const{JisonParser:y,o:_}=r(41),x=[1,7],g=[1,16],E=[1,11],b=[1,14],S=[1,25],A=[1,24],v=[1,21],O=[1,22],T=[1,23],I=[1,28],w=[1,26],F=[1,27],N=[1,29],k=[1,12],L=[1,13],R=[1,15],C=[4,9],D=[16,19,20,21],j=[2,25],$=[16,19,20,21,37],P=[16,19,20,21,31,34,37,39,46,48,50,53,54,55,56,76,77,78,79,80,81,82],Q=[4,9,16,19,20,21,37,43,74,75],M=[4,9,43],G=[29,46,80,81,82],B=[4,9,42,43],V=[1,59],U=[46,79,80,81,82],z=[31,34,39,46,48,50,53,54,55,56,76,77,78,80,81,82],J=[1,94],X=[1,85],Z=[1,86],H=[1,87],q=[1,90],K=[1,91],W=[1,92],Y=[1,93],ee=[1,95],te=[33,48,49,50,53,54,55,56,63],re=[4,9,37,65],ne=[1,99],se=[9,37],ie=[9,65];t.HW=class extends y{constructor(e={},t=new oe(e)){super(e,t),this.symbols_={error:2,shapeMap:3,EOF:4,pair:5,Q_O_QGT_COMMA_E_S_Qpair_E_C_E_Star:6,QGT_COMMA_E_Opt:7,O_QGT_COMMA_E_S_Qpair_E_C:8,GT_COMMA:9,nodeSelector:10,statusAndShape:11,Qreason_E_Opt:12,QjsonAttributes_E_Opt:13,reason:14,jsonAttributes:15,GT_AT:16,Qstatus_E_Opt:17,shapeSelector:18,ATSTART:19,ATPNAME_NS:20,ATPNAME_LN:21,status:22,objectTerm:23,triplePattern:24,IT_SPARQL:25,string:26,nodeIri:27,shapeIri:28,START:29,subjectTerm:30,BLANK_NODE_LABEL:31,literal:32,GT_LCURLEY:33,IT_FOCUS:34,nodePredicate:35,O_QobjectTerm_E_Or_QIT___E_C:36,GT_RCURLEY:37,O_QsubjectTerm_E_Or_QIT___E_C:38,IT__:39,GT_NOT:40,GT_OPT:41,GT_DIVIDE:42,GT_DOLLAR:43,O_QAPPINFO_COLON_E_Or_QAPPINFO_SPACE_COLON_E_C:44,jsonValue:45,APPINFO_COLON:46,APPINFO_SPACE_COLON:47,IT_false:48,IT_null:49,IT_true:50,jsonObject:51,jsonArray:52,INTEGER:53,DECIMAL:54,DOUBLE:55,STRING_LITERAL2:56,Q_O_QjsonMember_E_S_QGT_COMMA_E_S_QjsonMember_E_Star_C_E_Opt:57,O_QGT_COMMA_E_S_QjsonMember_E_C:58,jsonMember:59,Q_O_QGT_COMMA_E_S_QjsonMember_E_C_E_Star:60,O_QjsonMember_E_S_QGT_COMMA_E_S_QjsonMember_E_Star_C:61,STRING_LITERAL2_COLON:62,GT_LBRACKET:63,Q_O_QjsonValue_E_S_QGT_COMMA_E_S_QjsonValue_E_Star_C_E_Opt:64,GT_RBRACKET:65,O_QGT_COMMA_E_S_QjsonValue_E_C:66,Q_O_QGT_COMMA_E_S_QjsonValue_E_C_E_Star:67,O_QjsonValue_E_S_QGT_COMMA_E_S_QjsonValue_E_Star_C:68,rdfLiteral:69,numericLiteral:70,booleanLiteral:71,Q_O_QLANGTAG_E_Or_QGT_DTYPE_E_S_QnodeIri_E_C_E_Opt:72,O_QLANGTAG_E_Or_QGT_DTYPE_E_S_QnodeIri_E_C:73,LANGTAG:74,GT_DTYPE:75,STRING_LITERAL1:76,STRING_LITERAL_LONG1:77,STRING_LITERAL_LONG2:78,IT_a:79,IRIREF:80,PNAME_LN:81,PNAME_NS:82,$accept:0,$end:1},this.terminals_={2:"error",4:"EOF",9:"GT_COMMA",16:"GT_AT",19:"ATSTART",20:"ATPNAME_NS",21:"ATPNAME_LN",25:"IT_SPARQL",29:"START",31:"BLANK_NODE_LABEL",33:"GT_LCURLEY",34:"IT_FOCUS",37:"GT_RCURLEY",39:"IT__",40:"GT_NOT",41:"GT_OPT",42:"GT_DIVIDE",43:"GT_DOLLAR",46:"APPINFO_COLON",47:"APPINFO_SPACE_COLON",48:"IT_false",49:"IT_null",50:"IT_true",53:"INTEGER",54:"DECIMAL",55:"DOUBLE",56:"STRING_LITERAL2",62:"STRING_LITERAL2_COLON",63:"GT_LBRACKET",65:"GT_RBRACKET",74:"LANGTAG",75:"GT_DTYPE",76:"STRING_LITERAL1",77:"STRING_LITERAL_LONG1",78:"STRING_LITERAL_LONG2",79:"IT_a",80:"IRIREF",81:"PNAME_LN",82:"PNAME_NS"},this.productions_=[0,[3,1],[3,4],[8,2],[6,0],[6,2],[7,0],[7,1],[5,4],[12,0],[12,1],[13,0],[13,1],[11,3],[11,1],[11,1],[11,1],[17,0],[17,1],[10,1],[10,1],[10,2],[10,2],[18,1],[18,1],[30,1],[30,1],[23,1],[23,1],[24,5],[24,5],[36,1],[36,1],[38,1],[38,1],[22,1],[22,1],[14,2],[15,3],[44,1],[44,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[51,3],[58,2],[60,0],[60,2],[61,2],[57,0],[57,1],[59,2],[52,3],[66,2],[67,0],[67,2],[68,2],[64,0],[64,1],[32,1],[32,1],[32,1],[70,1],[70,1],[70,1],[69,2],[73,1],[73,2],[72,0],[72,1],[71,1],[71,1],[26,1],[26,1],[26,1],[26,1],[35,1],[35,1],[27,1],[27,1],[27,1],[27,1],[28,1],[28,1],[28,1],[28,1]],this.table=[{3:1,4:[1,2],5:3,10:4,23:5,24:6,25:x,26:20,27:8,30:9,31:g,32:10,33:E,46:b,48:S,50:A,53:v,54:O,55:T,56:I,69:17,70:18,71:19,76:w,77:F,78:N,80:k,81:L,82:R},{1:[3]},{1:[2,1]},_(C,[2,4],{6:30}),{11:31,16:[1,32],19:[1,33],20:[1,34],21:[1,35]},_(D,[2,19]),_(D,[2,20]),{26:36,56:I,76:w,77:F,78:N},_(D,j,{26:37,56:I,76:w,77:F,78:N}),_($,[2,27]),_($,[2,28]),{27:42,30:40,31:g,34:[1,38],38:39,39:[1,41],46:b,80:k,81:L,82:R},_(P,[2,84]),_(P,[2,85]),_(P,[2,86]),_(P,[2,87]),_([16,19,20,21,37,46,79,80,81,82],[2,26]),_($,[2,65]),_($,[2,66]),_($,[2,67]),_($,[2,74],{72:43,73:44,74:[1,45],75:[1,46]}),_($,[2,68]),_($,[2,69]),_($,[2,70]),_($,[2,76]),_($,[2,77]),_(Q,[2,78]),_(Q,[2,79]),_(Q,[2,80]),_(Q,[2,81]),{4:[2,6],7:47,8:48,9:[1,49]},_(M,[2,9],{12:50,14:51,42:[1,52]}),_(G,[2,17],{17:53,22:54,40:[1,55],41:[1,56]}),_(B,[2,14]),_(B,[2,15]),_(B,[2,16]),_(D,[2,21]),_(D,[2,22]),{27:58,35:57,46:b,79:V,80:k,81:L,82:R},{27:58,35:60,46:b,79:V,80:k,81:L,82:R},_(U,[2,33]),_(U,[2,34]),_([37,46,79,80,81,82],j),_($,[2,71]),_($,[2,75]),_($,[2,72]),{27:61,46:b,80:k,81:L,82:R},{4:[1,62]},_(C,[2,5]),{4:[2,7],5:63,10:4,23:5,24:6,25:x,26:20,27:8,30:9,31:g,32:10,33:E,46:b,48:S,50:A,53:v,54:O,55:T,56:I,69:17,70:18,71:19,76:w,77:F,78:N,80:k,81:L,82:R},_(C,[2,11],{13:64,15:65,43:[1,66]}),_(M,[2,10]),{26:67,56:I,76:w,77:F,78:N},{18:68,28:69,29:[1,70],46:[1,73],80:[1,71],81:[1,72],82:[1,74]},_(G,[2,18]),_(G,[2,35]),_(G,[2,36]),{23:76,26:20,27:42,30:9,31:g,32:10,36:75,39:[1,77],46:b,48:S,50:A,53:v,54:O,55:T,56:I,69:17,70:18,71:19,76:w,77:F,78:N,80:k,81:L,82:R},_(z,[2,82]),_(z,[2,83]),{34:[1,78]},_($,[2,73]),{1:[2,2]},_(C,[2,3]),_(C,[2,8]),_(C,[2,12]),{44:79,46:[1,80],47:[1,81]},_(M,[2,37]),_(B,[2,13]),_(B,[2,23]),_(B,[2,24]),_(B,[2,88]),_(B,[2,89]),_(B,[2,90]),_(B,[2,91]),{37:[1,82]},{37:[2,31]},{37:[2,32]},{37:[1,83]},{33:J,45:84,48:X,49:Z,50:H,51:88,52:89,53:q,54:K,55:W,56:Y,63:ee},_(te,[2,39]),_(te,[2,40]),_(D,[2,29]),_(D,[2,30]),_(C,[2,38]),_(re,[2,41]),_(re,[2,42]),_(re,[2,43]),_(re,[2,44]),_(re,[2,45]),_(re,[2,46]),_(re,[2,47]),_(re,[2,48]),_(re,[2,49]),{37:[2,55],57:96,59:98,61:97,62:ne},{33:J,45:102,48:X,49:Z,50:H,51:88,52:89,53:q,54:K,55:W,56:Y,63:ee,64:100,65:[2,63],68:101},{37:[1,103]},{37:[2,56]},_(se,[2,52],{60:104}),{33:J,45:105,48:X,49:Z,50:H,51:88,52:89,53:q,54:K,55:W,56:Y,63:ee},{65:[1,106]},{65:[2,64]},_(ie,[2,60],{67:107}),_(re,[2,50]),{9:[1,109],37:[2,54],58:108},_(se,[2,57]),_(re,[2,58]),{9:[1,111],65:[2,62],66:110},_(se,[2,53]),{59:112,62:ne},_(ie,[2,61]),{33:J,45:113,48:X,49:Z,50:H,51:88,52:89,53:q,54:K,55:W,56:Y,63:ee},_(se,[2,51]),_(ie,[2,59])],this.defaultActions={2:[2,1],62:[2,2],76:[2,31],77:[2,32],97:[2,56],101:[2,64]}}performAction(e,t,r,s,p,l,y){const _=l.length-1;switch(p){case 1:return[];case 2:return[l[_-3]].concat(l[_-2]);case 3:case 51:case 59:this.$=l[_];break;case 4:case 60:case 63:this.$=[];break;case 5:case 61:this.$=l[_-1].concat(l[_]);break;case 8:this.$=o({node:l[_-3]},l[_-2],l[_-1],l[_]);break;case 9:case 11:case 52:case 55:case 74:this.$={};break;case 13:this.$=o({shape:l[_]},l[_-1]);break;case 14:this.$={shape:n.start};break;case 15:l[_]=l[_].substr(1,l[_].length-1),this.$={shape:d(s.schemaMeta.prefixes,l[_].substr(0,l[_].length-1))};break;case 16:l[_]=l[_].substr(1,l[_].length-1);const e=l[_].indexOf(":");this.$={shape:d(s.schemaMeta.prefixes,l[_].substr(0,e))+l[_].substr(e+1)};break;case 17:this.$={status:"conformant"};break;case 18:this.$={status:l[_]};break;case 21:this.$={type:"Extension",language:"http://www.w3.org/ns/shex#Extensions-sparql",lexical:l[_]["@value"]};break;case 22:this.$={type:"Extension",language:l[_-1],lexical:l[_]["@value"]};break;case 24:this.$=n.start;break;case 29:this.$={type:"TriplePattern",subject:n.focus,predicate:l[_-2],object:l[_-1]};break;case 30:this.$={type:"TriplePattern",subject:l[_-3],predicate:l[_-2],object:n.focus};break;case 32:case 34:case 42:this.$=null;break;case 35:this.$="nonconformant";break;case 36:this.$="unknown";break;case 37:this.$={reason:l[_]};break;case 38:this.$={appinfo:l[_]};break;case 41:this.$=!1;break;case 43:this.$=!0;break;case 46:case 47:case 48:this.$=parseFloat(l[_]);break;case 49:this.$=f(l[_],1)["@value"];break;case 50:case 58:this.$=l[_-1];break;case 53:case 54:case 71:this.$=o(l[_-1],l[_]);break;case 57:this.$={};const t=l[_-1].substr(0,l[_-1].length-1).trim();this.$[f(t,1)["@value"]]=l[_];break;case 62:this.$=[l[_-1]].concat(l[_]);break;case 68:this.$=c(l[_],"http://www.w3.org/2001/XMLSchema#integer");break;case 69:this.$=c(l[_],"http://www.w3.org/2001/XMLSchema#decimal");break;case 70:this.$=c(l[_],"http://www.w3.org/2001/XMLSchema#double");break;case 72:this.$=u("@language",l[_].substr(1).toLowerCase());break;case 73:this.$=u("@type",l[_]);break;case 76:this.$=c("true",i);break;case 77:this.$=c("false",i);break;case 78:case 80:this.$=f(l[_],1);break;case 79:case 81:this.$=f(l[_],3);break;case 83:this.$="http://www.w3.org/1999/02/22-rdf-syntax-ns#type";break;case 84:const r=m(l[_].slice(1,-1),{});this.$=null===s.dataMeta.base||a.test(r)?r:s.dataMeta._resolveIRI(r);break;case 85:case 86:this.$=h(l[_],s.dataMeta.prefixes);break;case 87:this.$=d(s.dataMeta.prefixes,l[_].substr(0,l[_].length-1));break;case 88:const p=m(l[_].slice(1,-1),{});this.$=null===s.schemaMeta.base||a.test(p)?p:s.schemaMeta._resolveIRI(p);break;case 89:case 90:this.$=h(l[_],s.schemaMeta.prefixes);break;case 91:this.$=d(s.schemaMeta.prefixes,l[_].substr(0,l[_].length-1))}}};const{JisonLexer:ae}=r(752);class oe extends ae{constructor(e={}){super(e),this.options={moduleName:"ShapeMapJison"},this.rules=[/^(?:\s+|(#[^\u000a\u000d]*|\/\*([^*]|\*([^/]|\\\/))*\*\/))/,/^(?:(appinfo[\u0020\u000A\u0009]+:))/,/^(?:("([^\u0022\u005C\u000A\u000D]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*"[\u0020\u000A\u0009]*:))/,/^(?:([Ff][Oo][Cc][Uu][Ss]))/,/^(?:([Ss][Tt][Aa][Rr][Tt]))/,/^(?:(@[Ss][Tt][Aa][Rr][Tt]))/,/^(?:([Ss][Pp][Aa][Rr][Qq][Ll]))/,/^(?:(@(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?)?:)(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|:|[0-9]|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.|:|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))*))))/,/^(?:(@((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?)?:)))/,/^(?:(@([A-Za-z])+((-([0-9A-Za-z])+))*))/,/^(?:(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?)?:)(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|:|[0-9]|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.|:|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))*)))/,/^(?:(appinfo:))/,/^(?:((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?)?:))/,/^(?:(([+-])?((([0-9])+\.([0-9])*(([Ee]([+-])?([0-9])+)))|((\.)?([0-9])+(([Ee]([+-])?([0-9])+))))))/,/^(?:(([+-])?([0-9])*\.([0-9])+))/,/^(?:(([+-])?([0-9])+))/,/^(?:(<([^\u0000-\u0020<>\"{}|^`\\]|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*>))/,/^(?:(_:((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|[0-9])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?))/,/^(?:('''(('|'')?([^\'\\]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))))*'''))/,/^(?:("""(("|"")?([^\"\\]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))))*"""))/,/^(?:('([^\u0027\u005c\u000a\u000d]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*'))/,/^(?:("([^\u0022\u005c\u000a\u000d]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*"))/,/^(?:a\b)/,/^(?:,)/,/^(?:\{)/,/^(?:\})/,/^(?:@)/,/^(?:!)/,/^(?:\?)/,/^(?:\/)/,/^(?:\$)/,/^(?:\[)/,/^(?:\])/,/^(?:\^\^)/,/^(?:_\b)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:[a-zA-Z0-9_-]+)/,/^(?:.)/],this.conditions={INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40],inclusive:!0}}}performAction(e,t,r,n){switch(r){case 0:break;case 1:return 47;case 2:return 62;case 3:return 34;case 4:return 29;case 5:return 19;case 6:return 25;case 7:return 21;case 8:return 20;case 9:return 74;case 10:return 81;case 11:return 46;case 12:return 82;case 13:return 55;case 14:return 54;case 15:return 53;case 16:return 80;case 17:return 31;case 18:return 77;case 19:return 78;case 20:return 76;case 21:return 56;case 22:return 79;case 23:return 9;case 24:return 33;case 25:return 37;case 26:return 16;case 27:return 40;case 28:return 41;case 29:return 42;case 30:return 43;case 31:return 63;case 32:return 65;case 33:return 75;case 34:return 39;case 35:return 50;case 36:return 48;case 37:return 49;case 38:return 4;case 39:return'unexpected word "'+t.yytext+'"';case 40:return"invalid character "+t.yytext}}}},18:(e,t,r)=>{const n=function(){ShapeMapJison=r(839).HW;const e=/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i,t=/(?:^|\/)\.\.?(?:$|[\/#?])/;class n{constructor(){}reset(){this.prefixes=null,this.base=this._baseIRI=this._baseIRIPath=this._baseIRIRoot=null}_setBase(t){t||(t=null),(this.base=t)&&(this._basePath=t.replace(/[^\/?]*(?:\?.*)?$/,""),t=t.match(e),this._baseRoot=t[0],this._baseScheme=t[1])}_resolveIRI(e){switch(e[0]){case void 0:return this.base;case"#":return this.base+e;case"?":return this.base.replace(/(?:\?.*)?$/,e);case"/":return("/"===e[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!t.test(e))return e;const r=e.length;let n="",s=-1,i=-1,a="/",o=0;for(;s=i&&(n=n.substr(0,o)),"/"!==a)return n+"/"+e.substr(s+1);o=s+1}}}a=e[++s]}return n+e.substring(o)}expandPrefix(e){return e in this.prefixes||this.error(new Error('Parse error; unknown prefix "'+e+':"')),this.prefixes[e]}}class s{constructor(){this.schemaMeta=new n,this.dataMeta=new n,this._fileName=void 0}reset(){this.schemaMeta.reset(),this.dataMeta.reset()}_setFileName(e){this._fileName=e}error(e){const t={text:this.lexer.match,line:this.lexer.thislineno,loc:this.lexer.thislloc,pos:this.lexer.showPosition()};if(e.hash=t,!this.recoverable)throw e;this.recoverable(e)}}return{construct:function(e,t,r){const n=t.base,i={};for(const e in t.prefixes||{})i[e]=t.prefixes[e];const a=r.base,o={};for(const e in r.prefixes||{})o[e]=r.prefixes[e];const u=new ShapeMapJison,c=u.parse;return u.parse=function t(r,p=null){const l=globalThis.PS=new s;l.schemaMeta.prefixes=Object.create(i),l.schemaMeta._setBase(n),l.dataMeta.prefixes=Object.create(o),l.dataMeta._setBase(a),l._setFileName(e),l._fileName=p;try{return c.call(u,r,l)}catch(r){const n="lexer"in u.yy?u.yy.lexer.yylineno+1:1,s="lexer"in u.yy?u.yy.lexer.showPosition():"",i=Error(`${e}(${n}): ${r.message}\n${s}`);throw Error.captureStackTrace(i,t),l.reset(),i}},u}}}();e.exports=n},14:e=>{const t={focus:{term:"FOCUS"},start:{term:"START"},wildcard:{term:"WILDCARD"}};e.exports=t},261:(e,t,r)=>{const n=function(){const e=r(14);return e.Parser=r(18),e}();e.exports=n},410:(e,t,r)=>{e.exports=function(e={}){const t=r(443),n=r(931),s={load:async function(r,n,p,l,f={},h={}){const d={schema:t.emptySchema(),data:e.rdfjs?new e.rdfjs.Store:null,schemaMeta:[],dataMeta:[]},m=[],y=r.concat(n).map((e=>"object"==typeof e?e.url:e));let _=null;f&&"iriTransform"in f&&(_=f.iriTransform,delete f.iriTransform);const x=function(){const e=[],t=[];let r,n,s=0;const i=new Promise((function(e,t){r=e,n=t}));return i.all=function(t){return 0===t.length?r([]):t.forEach((function(t,r){e.push(t),a(t,r)})),i},i.add=function(t){return e.push(t),a(t,e.length-1),i},i;function a(i,a){i.then((function(n){t[a]=n,++s,s===e.length&&r(t)})).catch((function(e){n(e)}))}}();function g(e){if(!("imports"in e))return e;if(f.keepImports)return e;const t=Object.assign({},e);t.imports;return delete t.imports,e.imports.map((function(e){return _?_(e):e})).filter((function(e){return-1===y.indexOf(e)})).map((e=>{y.push(e),x.add(s.GET(e).then((function(e){const t={url:e.url,base:e.url,prefixes:{}};return a(e.text,"text/shex",e.url,d.schema,t,f,g)})))})),t}return[].push.apply(m,[i(r,d.schemaMeta,"text/shex",a,d.schema,f,g),i(n,d.schemaMeta,"text/json",o,d.schema,f,g),i(p,d.dataMeta,"text/turtle",u,d.data,h),i(l,d.dataMeta,"application/ld+json",c,d.data,h)].reduce(((e,t)=>e.concat(t)),[])),x.all(m).then((function(e){return d.schemaMeta.length>0&&t.isWellDefined(d.schema),d}))},loadExtensions:function(e){return[]},GET:async function(t,r){let n;return(n=t.match("^data:([^,]+),(.*)$"))?Promise.resolve({text:n[2],url:n[0]}):t.match("^(blob:)?[a-z]+://.")?async function(t,r){if("function"!=typeof e.fetch)throw Error(`Unable to fetch ${t} with fetch=${e.fetch}`);let n;try{n=await e.fetch(t,{headers:{Accept:"text/shex,text/turtle,*/*"}})}catch(e){throw Error(`GET <${t}> network failure: ${e.message}`)}if(!n.ok)throw Error(`GET <${t}> failed: ${n.status} ${n.statusText}`);return{text:await n.text(),url:t}}(t):(()=>{throw Error(`Don't know how to fetch ${t}`)})()},loadShExImports_NotUsed:function(e,r,n){const i=[e],a={type:"Schema"};return s.GET(e).then((function e(o){const u=r.parse(o.text),c=u.imports;if(delete u.imports,t.merge(a,u,!1,!0),c){const t=c.map((function(e){return n?n(e):e})).filter((function(e){return-1===i.indexOf(e)}));return Promise.all(t.map((t=>(i.push(t),s.GET(t).then(e))))).then((e=>null))}return null})).then((function(){return t.isWellDefined(a),a}))}};return s;function i(e,r,n,i,a,o,u){return e.map((async e=>"object"==typeof e?async function(e){const r=c(e.url,n);try{return t.merge(a,e.schema,!0,!0),r._prefixes=a._prefixes||{},r.base=a._base,u(e.schema),[n,e.url]}catch(t){const r=Error("error merging schema object "+e.schema+": "+t);throw r.stack=t.stack,r}}(e):await async function(e){return s.GET(e,n).then((function(e){return i(e.text,n,e.url,a,c(e.url,n),o,u)}))}(e)));function c(e,t){const n={mediaType:t,url:e,base:e,prefixes:{}};return r.push(n),n}}function a(e,r,s,i,a,o,u){const c=o&&"parser"in o?o.parser:n.construct(s,{},o);try{const n=c.parse(e,s);return n.base===s&&delete n.base,a.prefixes=n._prefixes||{},a.base=n._base||a.base,t.merge(i,u(n),!1,!0),Promise.resolve([r,s])}catch(e){return e.message="error parsing ShEx "+s+": "+e.message,Promise.reject(e)}}function o(e,r,n,s,i,a,o){try{const a=t.ShExJtoAS(JSON.parse(e));return t.merge(s,a,!0,!0),i.prefixes=s._prefixes,i.base=s.base,o(a),Promise.resolve([r,n])}catch(e){const t=Error("error parsing JSON "+n+": "+e);return Promise.reject(t)}}function u(t,r,n,s,i,a){return new Promise((function(a,o){new e.rdfjs.Parser({baseIRI:n,blankNodePrefix:"",format:"text/turtle"}).parse(t,(function(e,t,u){u&&(i.prefixes=u),e?o("error parsing "+n+": "+e):t?s.addQuad(t):(i.base=this._base,a([r,n]))}))}))}async function c(t,r,n,s,i,a){const o=JSON.parse(t);try{const t=await e.jsonld.toRDF(o,Object.assign({format:"application/nquads",base:n},e.jsonLdOptions||{}));return i.prefixes={},i.base=n,u(t,r,n,s,i)}catch(e){let t=e;throw"details"in t&&(t=t.details),"cause"in t&&(t=t.cause),Error("error parsing JSON-ld "+n+": "+t)}}}},509:(e,t,r)=>{const n=r(443),s="http://www.w3.org/2001/XMLSchema#",i=s+"decimal",a=s+"double",o=s+"boolean",u=[s+"integer",s+"decimal",s+"float",s+"double",s+"string",s+"boolean",s+"dateTime",s+"nonPositiveInteger",s+"negativeInteger",s+"long",s+"int",s+"short",s+"byte",s+"nonNegativeInteger",s+"unsignedLong",s+"unsignedInt",s+"unsignedShort",s+"unsignedByte",s+"positiveInteger"],c=/^[a-z][a-z0-9+.-]*:/i,p=["mininclusive","minexclusive","maxinclusive","maxexclusive"];function l(e){return e.toLowerCase()}function f(e,t){return e.push(t),e}function h(e){e||(e={});for(let t,r=1,n=arguments.length;r0?{restricts:y[O-1]}:{},{shapeExpr:y[O]}));break;case 27:case 102:case 108:case 172:this.$={};break;case 28:this.$={abstract:!0};break;case 29:case 95:case 47:case 51:case 54:case 58:case 183:case 199:case 208:case 216:case 227:this.$=[];break;case 31:this.$=A(y[O]);break;case 32:this.$={type:"ShapeExternal"};break;case 33:y[O-2]&&(y[O-1]={type:"ShapeNot",shapeExpr:A(y[O-1])}),y[O]?(y[O].needsAtom.unshift(A(y[O-1])),delete y[O].needsAtom,this.$=y[O]):this.$=y[O-1];break;case 34:y[O-1]={type:"ShapeNot",shapeExpr:A(y[O-1])},y[O]?(y[O].needsAtom.unshift(A(y[O-1])),delete y[O].needsAtom,this.$=y[O]):this.$=y[O-1];break;case 35:y[O].needsAtom.unshift(A(y[O-1])),delete y[O].needsAtom,this.$=y[O];break;case 36:case 231:case 248:this.$=null;break;case 37:case 41:case 44:case 50:case 57:case 188:case 247:case 143:case 150:case 160:case 161:case 201:case 210:case 218:case 265:case 268:this.$=y[O];break;case 39:const w=y[O].map(A);this.$={type:"ShapeOr",shapeExprs:w,needsAtom:w};break;case 40:y[O-1].filter((e=>"ShapeAnd"===e.type)).length,y[O-1].length;const F={type:"ShapeAnd",shapeExprs:y[O-1].reduce(((e,t)=>e.concat("ShapeAnd"!==t.type||t.nested?A(t):t.shapeExprs)),[])};this.$=y[O].length>0?{type:"ShapeOr",shapeExprs:[F].concat(y[O].map(A))}:F,this.$.needsAtom=F.shapeExprs;break;case 43:case 46:case 48:case 52:case 55:case 59:this.$=y[O-1].concat(y[O]);break;case 49:this.$=S("ShapeOr",y[O-1],y[O]);break;case 53:case 56:this.$=S("ShapeAnd",y[O-1],y[O]);break;case 60:case 63:this.$=y[O-1]?{type:"ShapeNot",shapeExpr:A(y[O])}:y[O];break;case 61:this.$=!1;break;case 62:this.$=!0;break;case 64:case 73:case 78:case 80:this.$=y[O]?{type:"ShapeAnd",shapeExprs:[h({type:"NodeConstraint"},y[O-1]),y[O]]}:y[O-1];break;case 66:case 75:this.$=y[O]?S("ShapeAnd",y[O-1],[y[O]]):y[O-1];break;case 67:case 76:case 81:this.$=Object.assign(y[O-1],{nested:!0});break;case 68:case 77:case 82:this.$=s.EmptyShape;break;case 91:y[O]=y[O].substr(1,y[O].length-1);const N=y[O].indexOf(":");this.$=s.addSourceMap(s.expandPrefix(y[O].substr(0,N),s)+y[O].substr(N+1));break;case 92:y[O]=y[O].substr(1,y[O].length-1),this.$=s.addSourceMap(s.expandPrefix(y[O].substr(0,y[O].length-1),s));break;case 93:case 166:case 222:this.$=s.addSourceMap(y[O]);break;case 94:case 97:this.$=y[O-2],y[O-1].length&&(this.$.annotations=y[O-1]),y[O]&&(this.$.semActs=y[O].semActs);break;case 98:this.$=h({type:"NodeConstraint",nodeKind:"literal"},y[O]);break;case 99:-1===u.indexOf(y[O-1])&&p.forEach((function(e){e in y[O]&&s.error(new Error("Parse error: facet "+e+" not allowed for unknown datatype "+y[O-1]))})),this.$=h({type:"NodeConstraint",datatype:y[O-1]},y[O]);break;case 100:this.$={type:"NodeConstraint",values:y[O-1]};break;case 101:case 107:this.$=h({type:"NodeConstraint"},y[O]);break;case 103:case 105:case 111:case 109:-1!==Object.keys(y[O-1]).indexOf(Object.keys(y[O])[0])&&s.error(new Error("Parse error: facet "+Object.keys(y[O])[0]+" defined multiple times")),this.$=h(y[O-1],y[O]);break;case 106:this.$=h({type:"NodeConstraint"},y[O-1],y[O]?y[O]:{});break;case 112:this.$={nodeKind:"iri"};break;case 113:this.$={nodeKind:"bnode"};break;case 114:this.$={nodeKind:"nonliteral"};break;case 117:case 123:this.$=b(y[O-1],parseInt(y[O],10));break;case 118:this.$=function(e){const t=e.lastIndexOf("/");let r=e.substr(1,t-1);r=n.unescapeText(r,{".":"\\.","\\":"\\\\","?":"\\?","*":"\\*","+":"\\+","{":"\\{","}":"\\}","(":"\\(",")":"\\)","|":"\\|","^":"\\^",$:"\\$","[":"\\[","]":"\\]","/":"\\/",t:"\\t",n:"\\n",r:"\\r","-":"\\-","/":"/"});const s={pattern:r};return e.length>t+1&&(s.flags=e.substr(t+1)),s}(y[O]);break;case 119:this.$="length";break;case 120:this.$="minlength";break;case 121:this.$="maxlength";break;case 122:this.$=b(y[O-1],y[O]);break;case 124:this.$=parseInt(y[O],10);break;case 125:case 126:this.$=parseFloat(y[O]);break;case 127:y[O]===i||"http://www.w3.org/2001/XMLSchema#float"===y[O]||y[O]===a?this.$=parseFloat(y[O-2].value):-1!==u.indexOf(y[O])?this.$=parseInt(y[O-2].value):s.error(new Error("Parse error: numeric range facet expected numeric datatype instead of "+y[O]));break;case 128:this.$="mininclusive";break;case 129:this.$="minexclusive";break;case 130:this.$="maxinclusive";break;case 131:this.$="maxexclusive";break;case 132:this.$="totaldigits";break;case 133:this.$="fractiondigits";break;case 134:this.$=y[O-2]===s.EmptyShape?{type:"Shape"}:y[O-2],y[O-1].length&&(this.$.annotations=y[O-1]),y[O]&&(this.$.semActs=y[O].semActs);break;case 135:const k=y[O-1]?{expression:y[O-1]}:s.EmptyObject;this.$=k===s.EmptyObject&&y[O-3]===s.EmptyObject?s.EmptyShape:h({type:"Shape"},k,y[O-3]);break;case 136:this.$=["extends",[y[O]]];break;case 137:this.$=["extra",y[O]];break;case 138:this.$=["closed",!0];break;case 139:this.$=s.EmptyObject;break;case 140:y[O-1]===s.EmptyObject&&(y[O-1]={}),"closed"===y[O][0]?y[O-1].closed=!0:y[O][0]in y[O-1]?y[O-1][y[O][0]]=d(y[O-1][y[O][0]],y[O][1]):y[O-1][y[O][0]]=y[O][1],this.$=y[O-1];break;case 149:this.$={type:"OneOf",expressions:d([y[O-1]],y[O])};break;case 155:case 182:this.$=y[O-1];break;case 159:this.$={type:"EachOf",expressions:d([y[O-2]],y[O-1])};break;case 164:y[O-1]?(this.$=h({id:y[O-1]},y[O]),s.addProduction(y[O-1],this.$)):this.$=y[O];break;case 171:this.$=y[O-4],"min"in y[O-2]&&(this.$.min=y[O-2].min),"max"in y[O-2]&&(this.$.max=y[O-2].max),y[O-1].length&&(this.$.annotations=y[O-1]),y[O]&&(this.$.semActs="semActs"in y[O-4]?y[O-4].semActs.concat(y[O].semActs):y[O].semActs);break;case 174:y[O-3],s.EmptyShape,0,this.$=h({type:"TripleConstraint"},y[O-5],{predicate:y[O-4]},y[O-3]===s.EmptyShape?{}:{valueExpr:y[O-3]},y[O-2],y[O]),y[O-1].length&&(this.$.annotations=y[O-1]);break;case 177:this.$={min:0,max:-1};break;case 178:this.$={min:1,max:-1};break;case 179:this.$={min:0,max:1};break;case 180:y[O]=y[O].substr(1,y[O].length-2);const L=y[O].match(/(\d+)/g);this.$={min:parseInt(L[0],10)},2===L.length?this.$.max=parseInt(L[1],10):-1===y[O].indexOf(",")?this.$.max=parseInt(L[0],10):this.$.max=-1;break;case 181:this.$={inverse:!0};break;case 195:this.$={type:"IriStemRange",stem:{type:"Wildcard"},exclusions:y[O]};break;case 196:this.$={type:"LiteralStemRange",stem:{type:"Wildcard"},exclusions:y[O]};break;case 197:this.$={type:"LanguageStemRange",stem:{type:"Wildcard"},exclusions:y[O]};break;case 198:y[O]?(this.$={type:y[O].length?"IriStemRange":"IriStem",stem:y[O-1]},y[O].length&&(this.$.exclusions=y[O])):this.$=y[O-1];break;case 204:this.$=y[O]?{type:"IriStem",stem:y[O-1]}:y[O-1];break;case 207:y[O]?(this.$={type:y[O].length?"LiteralStemRange":"LiteralStem",stem:y[O-1].value},y[O].length&&(this.$.exclusions=y[O])):this.$=y[O-1];break;case 213:this.$=y[O]?{type:"LiteralStem",stem:y[O-1].value}:y[O-1].value;break;case 214:y[O]?(this.$={type:y[O].length?"LanguageStemRange":"LanguageStem",stem:y[O-1]},y[O].length&&(this.$.exclusions=y[O])):this.$={type:"Language",languageTag:y[O-1]};break;case 215:this.$={type:y[O].length?"LanguageStemRange":"LanguageStem",stem:""},y[O].length&&(this.$.exclusions=y[O]);break;case 221:this.$=y[O]?{type:"LanguageStem",stem:y[O-1]}:y[O-1];break;case 223:this.$={type:"Annotation",predicate:y[O-1],object:y[O]};break;case 226:this.$=y[O].length?{semActs:y[O]}:null;break;case 229:this.$=y[O]?(T=y[O-1],I=(I=y[O]).substring(1,I.length-2),{type:"SemAct",name:T,code:n.unescapeText(I,_)}):{type:"SemAct",name:y[O-1]};break;case 236:this.$="http://www.w3.org/1999/02/22-rdf-syntax-ns#type";break;case 242:this.$=m(y[O],"http://www.w3.org/2001/XMLSchema#integer");break;case 243:this.$=m(y[O],i);break;case 244:this.$=m(y[O],a);break;case 246:this.$=y[O]?h(y[O-1],{type:y[O]}):y[O-1];break;case 250:this.$={value:"true",type:o};break;case 251:this.$={value:"false",type:o};break;case 252:case 254:this.$=g(y[O],1);break;case 253:case 255:this.$=g(y[O],3);break;case 256:case 258:this.$=E(y[O],1);break;case 257:case 259:this.$=E(y[O],3);break;case 260:const R=n.unescapeText(y[O].slice(1,-1),{});this.$=null===s._base||c.test(R)?R:s._resolveIRI(R);break;case 262:const C=y[O].indexOf(":");this.$=s.expandPrefix(y[O].substr(0,C),s)+n.unescapeText(y[O].substr(C+1),x);break;case 263:this.$=s.expandPrefix(y[O].substr(0,y[O].length-1),s)}var T,I}};const{JisonLexer:Yp}=r(752);class el extends Yp{constructor(e={}){super(e),this.options={moduleName:"ShExJison"},this.rules=[/^(?:\s+|(#[^\u000a\u000d]*|\/\*([^*]|\*([^/]|\\\/))*\*\/))/,/^(?:(@(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?)?:)(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|:|[0-9]|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.|:|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))*))))/,/^(?:(@((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?)?:)))/,/^(?:(@([A-Za-z])+((-([0-9A-Za-z])+))*))/,/^(?:@)/,/^(?:(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?)?:)(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|:|[0-9]|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))(((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.|:|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))*)))/,/^(?:(\{((([+-])?([0-9])+))((,(((([+-])?([0-9])+))|\*)?))?\}))/,/^(?:(([+-])?((([0-9])+\.([0-9])*(([Ee]([+-])?([0-9])+)))|((\.)?([0-9])+(([Ee]([+-])?([0-9])+))))))/,/^(?:(([+-])?([0-9])*\.([0-9])+))/,/^(?:(([+-])?([0-9])+))/,/^(?:{ANON})/,/^(?:(<([^\u0000-\u0020<>\"{}|^`\\]|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*>))/,/^(?:((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?)?:))/,/^(?:a\b)/,/^(?:(\/([^\u002f\u005C\u000A\u000D]|\\[nrt\\|.?*+(){}$\u002D\u005B\u005D\u005E/]|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))+\/[smix]*))/,/^(?:(_:((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|[0-9])((((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040])|\.)*((([A-Z]|[a-z]|[\u00c0-\u00d6]|[\u00d8-\u00f6]|[\u00f8-\u02ff]|[\u0370-\u037d]|[\u037f-\u1fff]|[\u200c-\u200d]|[\u2070-\u218f]|[\u2c00-\u2fef]|[\u3001-\ud7ff]|[\uf900-\ufdcf]|[\ufdf0-\ufffd]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_|_\b)|-|[0-9]|[\u00b7]|[\u0300-\u036f]|[\u203f-\u2040]))?))/,/^(?:(\{([^%\\]|\\[%\\]|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*%\}))/,/^(?:('''(('|'')?([^\'\\]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))))*'''(@([A-Za-z])+((-([0-9A-Za-z])+))*)))/,/^(?:("""(("|"")?([^\"\\]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))))*"""(@([A-Za-z])+((-([0-9A-Za-z])+))*)))/,/^(?:('([^\u0027\u005c\u000a\u000d]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*'(@([A-Za-z])+((-([0-9A-Za-z])+))*)))/,/^(?:("([^\u0022\u005c\u000a\u000d]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*"(@([A-Za-z])+((-([0-9A-Za-z])+))*)))/,/^(?:('''(('|'')?([^\'\\]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))))*'''))/,/^(?:("""(("|"")?([^\"\\]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))))*"""))/,/^(?:('([^\u0027\u005c\u000a\u000d]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*'))/,/^(?:("([^\u0022\u005c\u000a\u000d]|(\\[\"\'\\bfnrt])|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*"))/,/^(?:([Bb][Aa][Ss][Ee]))/,/^(?:([Pp][Rr][Ee][Ff][Ii][Xx]))/,/^(?:([iI][mM][pP][oO][rR][tT]))/,/^(?:([sS][tT][aA][rR][tT]))/,/^(?:([eE][xX][tT][eE][rR][nN][aA][lL]))/,/^(?:([Aa][Bb][Ss][Tt][Rr][Aa][Cc][Tt]))/,/^(?:([Rr][Ee][Ss][Tt][Rr][Ii][Cc][Tt][Ss]))/,/^(?:([Ee][Xx][Tt][Ee][Nn][Dd][Ss]))/,/^(?:([Cc][Ll][Oo][Ss][Ee][Dd]))/,/^(?:([Ee][Xx][Tt][Rr][Aa]))/,/^(?:([Ll][Ii][Tt][Ee][Rr][Aa][Ll]))/,/^(?:([Bb][Nn][Oo][Dd][Ee]))/,/^(?:([Ii][Rr][Ii]))/,/^(?:([Nn][Oo][Nn][Ll][Ii][Tt][Ee][Rr][Aa][Ll]))/,/^(?:([Aa][Nn][Dd]))/,/^(?:([Oo][Rr]))/,/^(?:([No][Oo][Tt]))/,/^(?:([Mm][Ii][Nn][Ii][Nn][Cc][Ll][Uu][Ss][Ii][Vv][Ee]))/,/^(?:([Mm][Ii][Nn][Ee][Xx][Cc][Ll][Uu][Ss][Ii][Vv][Ee]))/,/^(?:([Mm][Aa][Xx][Ii][Nn][Cc][Ll][Uu][Ss][Ii][Vv][Ee]))/,/^(?:([Mm][Aa][Xx][Ee][Xx][Cc][Ll][Uu][Ss][Ii][Vv][Ee]))/,/^(?:([Ll][Ee][Nn][Gg][Tt][Hh]))/,/^(?:([Mm][Ii][Nn][Ll][Ee][Nn][Gg][Tt][Hh]))/,/^(?:([Mm][Aa][Xx][Ll][Ee][Nn][Gg][Tt][Hh]))/,/^(?:([Tt][Oo][Tt][Aa][Ll][Dd][Ii][Gg][Ii][Tt][Ss]))/,/^(?:([Ff][Rr][Aa][Cc][Tt][Ii][Oo][Nn][Dd][Ii][Gg][Ii][Tt][Ss]))/,/^(?:=)/,/^(?:\/\/)/,/^(?:\{)/,/^(?:\})/,/^(?:&)/,/^(?:\|\|)/,/^(?:\|)/,/^(?:,)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\$)/,/^(?:!)/,/^(?:\^\^)/,/^(?:\^)/,/^(?:\.)/,/^(?:~)/,/^(?:;)/,/^(?:\*)/,/^(?:\+)/,/^(?:\?)/,/^(?:-)/,/^(?:%)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:$)/,/^(?:[a-zA-Z0-9_-]+)/,/^(?:.)/],this.conditions={INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79],inclusive:!0}}}performAction(e,t,r,n){switch(r){case 0:break;case 1:return 79;case 2:return 80;case 3:return t.yytext=t.yytext.substr(1),185;case 4:return 81;case 5:return 215;case 6:return 159;case 7:return 109;case 8:return 108;case 9:return 100;case 10:return"ANON";case 11:return 19;case 12:return 21;case 13:return 199;case 14:return 101;case 15:return 216;case 16:return 195;case 17:return 211;case 18:return 213;case 19:return 210;case 20:return 212;case 21:return 207;case 22:return 209;case 23:return 206;case 24:return 208;case 25:return 18;case 26:return 20;case 27:return 23;case 28:return 26;case 29:return 39;case 30:return 36;case 31:return 220;case 32:return 218;case 33:return 125;case 34:return 127;case 35:return 85;case 36:return 97;case 37:return 96;case 38:return 98;case 39:return 53;case 40:return 51;case 41:return 43;case 42:return 112;case 43:return 113;case 44:return 114;case 45:return 115;case 46:return 102;case 47:return 103;case 48:return 104;case 49:return 116;case 50:return 117;case 51:return 27;case 52:return 190;case 53:return 119;case 54:return 121;case 55:return 189;case 56:return"||";case 57:return 135;case 58:return 140;case 59:return 69;case 60:return 70;case 61:return 161;case 62:return 163;case 63:return 148;case 64:return"!";case 65:return 111;case 66:return 160;case 67:return 71;case 68:return 178;case 69:return 141;case 70:return 156;case 71:return 157;case 72:return 158;case 73:return 179;case 74:return 193;case 75:return 204;case 76:return 205;case 77:return 7;case 78:return'unexpected word "'+t.yytext+'"';case 79:return"invalid character "+t.yytext}}}},931:(e,t,r)=>{const n=function(){const e=r(509).Fm,t=/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i,n=/(?:^|\/)\.\.?(?:$|[\/#?])/;class s{constructor(){this.blankId=0,this._fileName=void 0,this.EmptyObject={},this.EmptyShape={type:"Shape"}}reset(){this._prefixes=this._imports=this._sourceMap=this.shapes=this.productions=this.start=this.startActs=null,this._base=this._baseIRI=this._baseIRIPath=this._baseIRIRoot=null}_setFileName(e){this._fileName=e}blank(){return"_:b"+this.blankId++}_resetBlanks(e){this.blankId=void 0===e?0:e}_setBase(e){e||(e=null),(this._base=e)&&(this._basePath=e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(t),this._baseRoot=e[0],this._baseScheme=e[1])}_resolveIRI(e){switch(e[0]){case void 0:return this._base;case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return("/"===e[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!n.test(e))return e;const t=e.length;let r="",s=-1,i=-1,a="/",o=0;for(;s=i&&(r=r.substr(0,o)),"/"!==a)return r+"/"+e.substr(s+1);o=s+1}}}a=e[++s]}return r+e.substring(o)}error(e){const t={text:this.lexer.match,line:this.lexer.yylineno,loc:this.lexer.yylloc,pos:this.lexer.showPosition()};if(e.hash=t,!this.recoverable)throw e;this.recoverable(e)}expandPrefix(e){return e in this._prefixes||this.error(new Error('Parse error; unknown prefix "'+e+':"')),this._prefixes[e]}addShape(e,t){t===this.EmptyShape&&(t={type:"Shape"}),this.productions&&e in this.productions&&this.error(new Error("Structural error: "+e+" is a triple expression")),this.shapes||(this.shapes={}),e in this.shapes?"replace"===this.options.duplicateShape?this.shapes[e]=t:"ignore"!==this.options.duplicateShape&&this.error(new Error("Parse error: "+e+" already defined")):this.shapes[e]=Object.assign({id:e},t)}addProduction(e,t){this.shapes&&e in this.shapes&&this.error(new Error("Structural error: "+e+" is a shape expression")),this.productions||(this.productions={}),e in this.productions?"replace"===this.options.duplicateShape?this.productions[e]=t:"ignore"!==this.options.duplicateShape&&this.error(new Error("Parse error: "+e+" already defined")):this.productions[e]=t}addSourceMap(e){this._sourceMap||(this._sourceMap=new Map);let t=this._sourceMap.get(e);return t||this._sourceMap.set(e,t=[]),t.push(this.lexer.yylloc),e}}return{construct:function(t,r,n){n=n||{};const i={};for(const e in r||{})i[e]=r[e];const a=new e(s),o=a.parse;return a.parse=function(e,r=t,u=n,c=null){const p=globalThis.PS=new s;p._prefixes=Object.create(i),p._imports=[],p._setBase(r),p._setFileName(t),p.options=n;let l=[];p.recoverable=e=>l.push(e);let f=null;try{f=o.call(a,e,p)}catch(e){l.push(e)}if(p.reset(),l.forEach((e=>{if("hash"in e){const t=e.hash,r=t.loc;delete t.loc,Object.assign(e,t,{location:r})}return e})),1==l.length)throw l[0].parsed=f,l[0];if(l.length){const e=new Error(l.length+" parser errors:\n"+l.map((e=>function(e,r){const n=e.location.first_line,s=e.location.first_column+1,i="pos"in e.hash?"\n"+e.hash.pos:"";return`${t}\n line: ${n}, column: ${s}: ${e.message}${i}`}(e,a.yy.lexer))).join("\n"));throw e.errors=l,e.parsed=f,e}return f},a._setBase=function(e){t=e},a}}}();e.exports=n},118:e=>{const t=function(){const e=/^[a-z][a-z0-9+.-]*:/i,t=/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i,r=/(?:^|\/)\.\.?(?:$|[\/#?])/,n="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",s="http://www.w3.org/2001/XMLSchema#string";function i(e){if(!r.test(e))return e;const t=e.length;let n="",s=-1,i=-1,a=0,o="/";for(;s=i&&(n=n.substr(0,a)),"/"!==o)return n+"/"+e.substr(s+1);a=s+1}}}o=e[++s]}return n+e.substring(a)}function a(e){switch(e.termType){case"NamedNode":return e.value;case"BlankNode":return"_:"+e.value;case"Literal":return'"'+e.value.replace(/"/g,'\\"')+'"'+(e.datatypeString===n?"@"+e.language:e.datatypeString===s?"":"^^"+e.datatypeString);default:throw Error("unknown RDFJS node type: "+JSON.stringify(e))}}function o(e,t){if(u(e))return t.namedNode(e);if(p(e))return t.blankNode(e.substr(2));if(c(e)){let r=h(e)||(f(e)===s?null:t.namedNode(f(e)));return t.literal(l(e),r)}throw Error("Unknown internal term type: "+JSON.stringify(e))}function u(e){if("string"!=typeof e)return!1;if(0===e.length)return!0;{const t=e[0];return'"'!==t&&"_"!==t}}function c(e){return"string"==typeof e&&'"'===e[0]}function p(e){return"string"==typeof e&&"_:"===e.substr(0,2)}function l(e){const t=/^"([^]*)"/.exec(e);if(!t)throw new Error(e+" is not a literal");return t[1].replace(/\\"/g,'"')}function f(e){const t=/^"[^]*"(?:\^\^([^"]+)|(@)[^@"]+)?$/.exec(e);if(!t)throw new Error(e+" is not a literal");return t[1]||(t[2]?n:s)}function h(e){const t=/^"[^]*"(?:@([^@"]+)|\^\^[^"]+)?$/.exec(e);if(!t)throw new Error(e+" is not a literal");return t[1]?t[1].toLowerCase():""}const d=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,m=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,y={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};function _(e){let t=y[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}return{RdfLangString:n,XsdString:s,resolveRelativeIRI:function(r,n){if(e.test(n))return n;switch(n[0]){case void 0:return r;case"#":return r+n;case"?":return r.replace(/(?:\?.*)?$/,n);case"/":let e=r.match(t);return("/"===n[1]?e[1]:e[0])+i(n);default:return i(r.replace(/[^\/?]*(?:\?.*)?$/,"")+n)}},isIRI:u,isLiteral:c,isBlank:p,isDefaultGraph:function(e){return!e},inDefaultGraph:function(e){return!e.graph},getLiteralValue:l,getLiteralType:f,getLiteralLanguage:h,internalTerm:a,internalTriple:function(e){return{subject:a(e.subject),predicate:a(e.predicate),object:a(e.object)}},externalTerm:o,externalTriple:function(e,t){return t.quad(o(e.subject,t),o(e.predicate,t),o(e.object,t))},internalTermToTurtle:function(e,t,r){if(u(e)){d.test(e)&&(e=e.replace(m,_));const n=Object.keys(r).find((t=>e.startsWith(r[t])));if(n){const t=e.substr(r[n].length);if(-1===t.indexOf("\\"))return n+":"+t.replace(/([~!$&'()*+,;=/?#@%])/g,"\\$1")}return e.startsWith(t)?"<"+e.substr(t.length)+">":"<"+e+">"}if(p(e))return e;if(c(e)){let n=l(e);const s=f(e),i=h(e);return d.test(n)&&(n=n.replace(m,_)),i?'"'+n+'"@'+i:s&&"http://www.w3.org/2001/XMLSchema#string"!==s?'"'+n+'"^^'+this.internalTermToTurtle(s,t,r):'"'+n+'"'}throw Error("Unknown internal term type: "+JSON.stringify(e))}}}();e.exports=t},443:(t,r,n)=>{const s=function(){const t=n(118),r=n(806),s=n(515),i={_namespace:"http://www.w3.org/ns/shex#"};["Schema","@context","imports","startActs","start","shapes","ShapeDecl","ShapeOr","ShapeAnd","shapeExprs","nodeKind","NodeConstraint","iri","bnode","nonliteral","literal","datatype","length","minlength","maxlength","pattern","flags","mininclusive","minexclusive","maxinclusive","maxexclusive","totaldigits","fractiondigits","values","ShapeNot","shapeExpr","Shape","abstract","closed","extra","expression","extends","restricts","semActs","ShapeRef","reference","ShapeExternal","EachOf","OneOf","expressions","min","max","annotation","TripleConstraint","inverse","negated","predicate","valueExpr","Inclusion","include","Language","languageTag","IriStem","LiteralStem","LanguageStem","stem","IriStemRange","LiteralStemRange","LanguageStemRange","exclusion","Wildcard","SemAct","name","code","Annotation","object"].forEach((e=>{i[e]=i._namespace+e}));const a={_namespace:"http://www.w3.org/1999/02/22-rdf-syntax-ns#"};["type","first","rest","nil"].forEach((e=>{a[e]=a._namespace+e}));const o={_namespace:"http://www.w3.org/2001/XMLSchema#"};["anyURI"].forEach((e=>{o[e]=o._namespace+e}));const u={_namespace:"http://www.w3.org/2002/07/owl#"};["Thing"].forEach((e=>{u[e]=u._namespace+e}));const c={};function p(e){e||(e={});for(let t,r=1,n=arguments.length;rt.set(e.id,null)));const r=this.ShExRVisitor(t);return"start"in e&&(e.start=r.visitShapeExpr(e.start)),"shapes"in e&&(e.shapes=e.shapes.map(((e,t)=>e.type===i.ShapeExternal?{type:"ShapeExternal",id:e.id}:{type:"ShapeDecl",id:e.id,abstract:e.abstract,shapeExpr:r.visitShapeExpr(e.shapeExpr)}))),r.cleanIds(),e},valGrep:function(e,t,r){const n=this,s=[];for(let i in e){const a=e[i];"object"==typeof a&&("type"in a&&a.type===t&&s.push(r(a)),s.push.apply(s,n.valGrep(a,t,r)))}return s},n3jsToTurtle:function(e){return this.valGrep(e,"TestedTriple",(function(e){return["subject","predicate","object"].map((r=>{return"object"==typeof(n=e[r])?'"'+n.value+'"'+("type"in n?"^^<"+n.type+">":"language"in n?"@"+n.language:""):t.isIRI(n)?"<"+n+">":t.isBlank(n)?n:"???";var n})).join(" ")+" ."}))},valToN3js:function(e,r){return this.valGrep(e,"TestedTriple",(function(e){const n=JSON.parse(JSON.stringify(e));return"object"==typeof e.object&&(n.object='"'+e.object.value+'"'+("type"in e.object?"^^"+e.object.type:"language"in e.object?"@"+e.object.language:"")),t.externalTriple(n,r)}))},n3jsToTurtle:function(e){return e.map((function(e){return["subject","predicate","object"].map((r=>function(e){if(t.isIRI(e))return"<"+e+">";if(t.isBlank(e))return e;const r=t.getLiteralType(e);return r&&"http://www.w3.org/2001/XMLSchema#string"!==r?'"'+t.getLiteralValue(e)+'"^^<'+r+">":e}(e[r]))).join(" ")+" ."}))},canonicalize:function(e,t){const r=JSON.parse(JSON.stringify(e));r["@context"]=r["@context"]||"http://www.w3.org/ns/shex.jsonld",delete r._prefixes,delete r._base;let n=r._index||this.index(e);delete r._index;r._sourceMap;delete r._sourceMap;const s=f.Visitor(),i=[],a=s.visitInclusion,o=s.visitExpression;s.visitExtra;return s.visitInclusion=function(e){return-1===i.indexOf(e)&&e in n.tripleExprs?(i.push(e),o.call(s,n.tripleExprs[e])):a.call(s,e)},s.visitExpression=function(e){return"object"==typeof e&&"id"in e?-1===i.indexOf(e.id)?(i.push(e.id),o.call(s,n.tripleExprs[e.id])):e.id:o.call(s,e)},s.visitExtra=function(e){return e.slice().sort()},t&&(s.visitIRI=function(e){return e.replace(t,"")},"imports"in r&&(r.imports=s.visitImports(r.imports))),"shapes"in r&&(r.shapes=Object.keys(n.shapeExprs).map((e=>("extra"in n.shapeExprs[e]&&n.shapeExprs[e].extra.sort(),s.visitShapeDecl(n.shapeExprs[e]))))),r},BiDiClosure:function(){return{needs:{},neededBy:{},inCycle:[],test:function(){function e(e,t){const r=JSON.stringify(e),n=JSON.stringify(t);if(r!==n)throw Error(r+" !== "+n)}this.add(2,3),e(this.needs,{2:[3]}),e(this.neededBy,{3:[2]}),this.add(1,2),e(this.needs,{1:[2,3],2:[3]}),e(this.neededBy,{3:[2,1],2:[1]}),this.add(1,3),e(this.needs,{1:[2,3],2:[3]}),e(this.neededBy,{3:[2,1],2:[1]}),this.add(3,4),e(this.needs,{1:[2,3,4],2:[3,4],3:[4]}),e(this.neededBy,{3:[2,1],2:[1],4:[3,2,1]}),this.add(6,7),e(this.needs,{6:[7],1:[2,3,4],2:[3,4],3:[4]}),e(this.neededBy,{7:[6],3:[2,1],2:[1],4:[3,2,1]}),this.add(5,6),e(this.needs,{5:[6,7],6:[7],1:[2,3,4],2:[3,4],3:[4]}),e(this.neededBy,{7:[6,5],6:[5],3:[2,1],2:[1],4:[3,2,1]}),this.add(5,7),e(this.needs,{5:[6,7],6:[7],1:[2,3,4],2:[3,4],3:[4]}),e(this.neededBy,{7:[6,5],6:[5],3:[2,1],2:[1],4:[3,2,1]}),this.add(7,8),e(this.needs,{5:[6,7,8],6:[7,8],7:[8],1:[2,3,4],2:[3,4],3:[4]}),e(this.neededBy,{7:[6,5],6:[5],8:[7,6,5],3:[2,1],2:[1],4:[3,2,1]}),this.add(4,5),e(this.needs,{1:[2,3,4,5,6,7,8],2:[3,4,5,6,7,8],3:[4,5,6,7,8],4:[5,6,7,8],5:[6,7,8],6:[7,8],7:[8]}),e(this.neededBy,{2:[1],3:[2,1],4:[3,2,1],5:[4,3,2,1],6:[5,4,3,2,1],7:[6,5,4,3,2,1],8:[7,6,5,4,3,2,1]})},add:function(e,t,r){const n=this;e in n.needs||(n.needs[e]=[]),t in n.neededBy||(n.neededBy[t]=[]),n.needs[e]=n.needs[e].concat([t],n.needs[t]).filter((function(e,t,r){return void 0!==e&&r.indexOf(e)===t})),n.neededBy[t]=n.neededBy[t].concat([e],n.neededBy[e]).filter((function(e,t,r){return void 0!==e&&r.indexOf(e)===t})),e in this.neededBy&&this.neededBy[e].forEach((function(e){n.needs[e]=n.needs[e].concat([t],n.needs[t]).filter((function(e,t,r){return void 0!==e&&r.indexOf(e)===t}))})),t in this.needs&&this.needs[t].forEach((function(t){n.neededBy[t]=n.neededBy[t].concat([e],n.neededBy[e]).filter((function(e,t,r){return void 0!==e&&r.indexOf(e)===t}))})),-1!==n.needs[e].indexOf(e)&&(n.inCycle=n.inCycle.concat(n.needs[e]))},trim:function(){function e(e){for(let t=e.length-1;t>-1;--t)e.indexOf(e[t]){let t=n.shapeExprs[e];if(o(e,null),t=r.skipDecl(t),"Shape"===t.type)"extends"in t&&t.extends.forEach((e=>o(e,t))),"expression"in t&&(r.simpleTripleConstraints(t)||[]).forEach((t=>{o(r.getValueType(t.valueExpr,!0),{type:"tc",shapeLabel:e,tc:t})}));else if("NodeConstraint"!==t.type)throw Error("nestShapes currently only supports Shapes and NodeConstraints")}));let a=Object.keys(i).filter((e=>1===i[e].length&&"tc"===i[e][0].type&&e in n.shapeExprs&&"Shape"===r.skipDecl(n.shapeExprs[e]).type&&!n.shapeExprs[e].abstract)).filter((e=>!("noNestPattern"in t)||!e.match(RegExp(t.noNestPattern)))).reduce(((e,t)=>(e[t]={referrer:i[t][0].shapeLabel,predicate:i[t][0].tc.predicate},e)),{});if(!t.no){let o={};if(t.rename){"transform"in t||(t.transform=function(){let e=s.reduce(((e,t,r)=>(e[t]="_:renamed"+r,e)),{});return function(t,r){return e[t]}}()),Object.keys(a).forEach((e=>{let r=n.shapeExprs[e],u=t.transform(e,r);if(o[e]=r.id=u,s[s.indexOf(e)]=u,a[u]=a[e],a[u].was=e,delete a[e],n.shapeExprs[u]=n.shapeExprs[e],delete n.shapeExprs[e],1!==i[e].length)throw Error("assertion: "+e+" doesn't have one reference: ["+i[e]+"]");let c=i[e][0];if("tc"!==c.type)throw"Shape"===c.type?Error("assertion: rename not implemented for Shape: "+c):Error("assertion: "+c.type+" not TripleConstraint or Shape");if("string"!=typeof c.tc.valueExpr)throw Error("assertion: rename not implemented for TripleConstraint expr: "+c.tc.valueExpr);c.tc.valueExpr=u})),Object.keys(a).forEach((e=>{let t=a[e];t.referrer in o&&(t.newReferrer=o[t.referrer])}));let e={};s.forEach((t=>e[t]=n.shapeExprs[t])),n.shapeExprs=e}else{const t=[],s=e.shapes.map((e=>e.id));Object.keys(a).forEach((a=>{const o=n.shapeExprs[a];i[a][0].tc.valueExpr=r.skipDecl(o);const u=s.indexOf(a);if(e.shapes[u].id!==a)throw Error("assertion: found "+e.shapes[u].id+" instead of "+a);t.push(u),delete n.shapeExprs[a]})),t.sort(((e,t)=>t-e)).forEach((t=>{const r=e.shapes[t].id;if(!a[r])throw Error("deleting unexpected shape "+r);delete e.shapes[t].id,e.shapes.splice(t,1)}))}}return a;function o(e,t){e in i||(i[e]=[]),t&&i[e].push(t)}},getPredicateUsage:function(e,t={}){const r=this;let n=s.create();Object.keys(e.shapes).forEach((t=>{let s=r.skipDecl(e.shapes[t]);"Shape"===s.type&&(s.extends||[]).forEach((e=>n.add(e.reference,t)))})),Object.keys(e.shapes).forEach((e=>{e in n.parents||(n.parents[e]=[])}));let i={};return Object.keys(e.shapes).forEach((s=>{let a=r.skipDecl(e.shapes[s]);if("Shape"===a.type){(r.simpleTripleConstraints(a)||[]).forEach((e=>{let a=r.getValueType(e.valueExpr);if(e.predicate in i){i[e.predicate].uses.push(s);let r=i[e.predicate].commonType;if("object"==typeof r||null===r)t[e.predicate].references.push({shapeLabel:s,newType:a});else if("object"==typeof a)i[e.predicate].commonType=null,t[e.predicate]={shapeLabel:s,predicate:e.predicate,curType:r,newType:a,references:[]};else if(r===a);else if(n.parents[r]&&-1!==n.parents[r].indexOf(a))i[e.predicate].polymorphic=!0;else{let o=n.parents[a]?n.parents[a].indexOf(r):-1;if(-1===o){let o=n.parents[r]?n.parents[r].filter((e=>-1!==n.parents[a].indexOf(e))):[];0===o.length?(t[e.predicate]={shapeLabel:s,predicate:e.predicate,curType:r,newType:a,references:[]},i[e.predicate].commonType=null):(i[e.predicate].commonType=o[0],i[e.predicate].polymorphic=!0)}else i[e.predicate].commonType=n.parents[a][o],i[e.predicate].polymorphic=!0}}else i[e.predicate]={uses:[s],commonType:a,polymorphic:!1},"object"==typeof a&&(t[e.predicate]={shapeLabel:s,predicate:e.predicate,newType:a,references:[]})}))}})),i},simpleTripleConstraints:function(e){if(!("expression"in e))return[];if("TripleConstraint"===e.expression.type)return[e.expression];if("EachOf"===e.expression.type&&!e.expression.expressions.find((e=>"TripleConstraint"!==e.type)))return e.expression.expressions;throw Error("can't (yet) express "+JSON.stringify(e))},skipDecl:function(e){return"ShapeDecl"===e.type?e.shapeExpr:e},getValueType:function(e){return"string"==typeof e?e:e.reference?e.reference:"iri"===e.nodeKind?u.Thing:e.datatype?e.datatype:e},getDependencies:function(e,t){return t=t||this.BiDiClosure(),(e.shapes||[]).forEach((function(e){function r(n,s){if("string"==typeof n)t.add(e.id,n);else if("ShapeOr"===n.type||"ShapeAnd"===n.type)n.shapeExprs.forEach((function(e){r(e,s)}));else if("ShapeNot"===n.type)r(n.shapeExpr,1^s);else if("Shape"===n.type)!function(n,s){function i(n,s){function a(e,t){e.forEach((function(e){i(e,t)}))}function o(n,s){if(n.valueExpr&&r(n.valueExpr,s),s&&-1!==t.inCycle.indexOf(e.id))throw Error("Structural error: "+e.id+" appears in negated cycle")}if("string"==typeof n)t.add(e.id,n);else if("id"in n&&t.addIn(n.id,e.id),"TripleConstraint"===n.type)o(n,s);else{if("OneOf"!==n.type&&"EachOf"!==n.type)throw Error("expected {TripleConstraint,OneOf,EachOf,Inclusion} in "+n);a(n.expressions)}}["extends","restricts"].forEach((r=>{n[r]&&n[r].length>0&&n[r].forEach((function(r){t.add(e.id,r)}))})),n.expression&&i(n.expression,s)}(n,s);else if("NodeConstraint"===n.type);else if("ShapeExternal"!==n.type)throw Error("expected Shape{And,Or,Ref,External} or NodeConstraint in "+JSON.stringify(n))}r(e.shapeExpr,0)})),t},partition:function(e,t,r,n){const s=e._index||this.index(e),i={shapeExprs:new Map,tripleExprs:new Map};t=t instanceof Array?t:[t],r=r||this.getDependencies(e),n=n||function(e,t){throw new Error("Error: can't find shape "+(t?t+" dependency "+e:e))};const a={};for(let t in e)a[t]="shapes"===t?[]:e[t];return t.forEach((function(e){if(e in i.shapeExprs);else if(e in s.shapeExprs){const t=s.shapeExprs[e];a.shapes.push(t),i.shapeExprs[t.id]=t,e in r.needs&&r.needs[e].forEach((function(t){if(t in r.foundIn&&(t=r.foundIn[t]),t in i.shapeExprs);else if(t in s.shapeExprs){const e=s.shapeExprs[t];a.shapes.push(e),i.shapeExprs[e.id]=e}else n(t,e)}))}else n(e,"supplied")})),a},flatten:function(e,t,r){return this.Visitor().visitSchema(e)},emptySchema:function(){return{type:"Schema"}},merge:function(e,t,r,n){const s=n?e:this.emptySchema();var i;"_base"in e&&(s._base=e._base),"_base"in t&&("_base"in e&&!r||(s._base=t._base)),i="_prefixes",Object.keys(e[i]||{}).forEach((function(t){i in s||(s[i]={}),s[i][t]=e[i][t]})),Object.keys(t[i]||{}).forEach((function(n){i in e&&n in e[i]&&!r||(i in s||(s[i]={}),s[i][n]=t[i][n])})),function(n){(e[n]||new Map).forEach((function(t,r,i){n in s||(s[n]=new Map),s[n].set(r,e[n].get(r))})),(t[n]||new Map).forEach((function(i,a,o){n in e&&e[n].has(a)&&!r||(n in s||(s[n]=new Map),s[n].set(a,t[n].get(a)))}))}("_sourceMap"),"imports"in t&&("imports"in e&&!r||(s.imports=t.imports)),"startActs"in e&&(s.startActs=e.startActs),"startActs"in t&&("startActs"in e&&!r||(s.startActs=t.startActs)),"start"in e&&(s.start=e.start),"start"in t&&("start"in e&&!r||(s.start=t.start));let a=e._index||this.index(e);return n||(e.shapes||[]).forEach((function(e){"shapes"in s||(s.shapes=[]),s.shapes.push(e)})),(t.shapes||[]).forEach((function(t){"shapes"in e&&t.id in a.shapeExprs&&!r||("shapes"in s||(s.shapes=[]),s.shapes.push(t))})),(e._index||t._index)&&(s._index=this.index(s)),s},absolutizeResults:function(e,r){function n(e,n){-1!==["shape","reference","node","subject","predicate","object"].indexOf(e)&&t.isIRI(n[e])&&(n[e]=t.resolveRelativeIRI(r,n[e]))}return function e(t){Object.keys(t).forEach((function(r){"object"==typeof t[r]&&e(t[r]),n&&n(r,t)}))}(e),e},getProofGraph:function(e,r,n){return function e(s){if("NodeConstraintTest"===s.type);else if("SolutionList"===s.type||"ShapeAndResults"===s.type||"ExtensionResults"===s.type)s.solutions.forEach((t=>{t.solution&&e(t.solution)}));else if("ShapeOrResults"===s.type)e(s.solution);else if("ShapeTest"===s.type)"solution"in s&&e(s.solution);else if("OneOfSolutions"===s.type||"EachOfSolutions"===s.type)s.solutions.forEach((t=>{e(t)}));else if("OneOfSolution"===s.type||"EachOfSolution"===s.type)s.expressions.forEach((t=>{e(t)}));else if("TripleConstraintSolutions"===s.type)s.solutions.map((s=>{if("TestedTriple"!==s.type)throw Error("unexpected result type: "+s.type);const i=s;"object"==typeof i.object&&(i.object='"'+i.object.value.replace(/"/g,'\\"')+'"'+(i.object.language?"@"+i.object.language:i.object.type?"^^"+i.object.type:"")),r.addQuad(t.externalTriple(i,n)),"referenced"in s&&e(s.referenced)}));else if("ExtendedResults"===s.type)e(s.extensions),"local"in s&&e(s.local);else if(-1===["ShapeNotResults","Recursion"].indexOf(s.type))throw Error("unexpected expr type "+s.type+" in "+JSON.stringify(s))}(e),r},validateSchema:function(e){const t=this.Visitor();let r=currentExtra=null,n=!1,i=!1;const a=t.visitShape,o=s.create(),u=s.create();let c=e.index||this.index(e);t.visitShape=function(e,r){const n=currentExtra;currentExtra=e.extra;const s=a.call(t,e,r);return currentExtra=n,s};const p=t.visitShapeNot;t.visitShapeNot=function(e,r){const s=n;n^=!0;const i=p.call(t,e,r);return n=s,i};const l=t.visitTripleConstraint;t.visitTripleConstraint=function(e){const r=n;currentExtra&&-1!==currentExtra.indexOf(e.predicate)&&(n^=!0),i=!0;const s=l.call(t,e);return i=!1,n=r,s};const f=t.visitShapeRef;t.visitShapeRef=function(e){if(!(e in c.shapeExprs))throw y(Error("Structural error: reference to "+JSON.stringify(e)+" not found in schema shape expressions:\n"+m(c.shapeExprs)+"."),e);if(!i&&e===r)throw y(Error("Structural error: circular reference to "+r+"."),e);return(n?o:u).add(r,e),f.call(t,e)};const h=t.visitInclusion;t.visitInclusion=function(e){let r;if(!(r=c.tripleExprs[e]))throw y(Error("Structural error: included shape "+e+" not found in schema triple expressions:\n"+m(c.tripleExprs)+"."),e);return h.call(t,e)},(e.shapes||[]).forEach((function(e){r=e.id,t.visitShapeDecl(e,e.id)}));let d=Object.keys(o.children).filter((e=>o.children[e].filter((t=>t in o.children&&-1!==o.children[t].indexOf(e)||t in u.children&&-1!==u.children[t].indexOf(e))).length>0));if(d.length)throw y(Error("Structural error: circular negative dependencies on "+d.join(",")+"."),d[0]);function m(e){return e?Object.keys(e).map((e=>"_:"===e.substr(0,2)?e:"<"+e+">")).join("\n "):"- none defined -"}function y(t,r){return"_sourceMap"in e&&(t.location=(e._sourceMap.get(r)||[void 0])[0]),t}},isWellDefined:function(e){return this.validateSchema(e),e},walkVal:function(e,t){const r=this;if("string"==typeof e)return null;if("SolutionList"===e.type)return e.solutions.reduce(((e,n)=>{const s=r.walkVal(n,t);return s&&Object.keys(s).forEach((t=>{e[t]=t in e?e[t].concat(s[t]):s[t]})),e}),{});if("NodeConstraintTest"===e.type)return r.walkVal(e.shapeExpr,t);if("NodeConstraint"===e.type)return null;if("ShapeTest"===e.type){const s=[];n(e,s);const i=s.length?{"http://shex.io/reflex":s}:{};return"solution"in e&&Object.assign(i,r.walkVal(e.solution,t)),Object.keys(i).length?i:null}if("Shape"===e.type)return null;if("ShapeNotTest"===e.type)return r.walkVal(e.shapeExpr,t);if("ShapeNotResults"===e.type)return r.walkVal(e.solution,t);if("Failure"===e.type)return null;if("ShapeNot"===e.type)return r.walkVal(e.shapeExpr,t);if("ShapeOrResults"===e.type)return r.walkVal(e.solution,t);if("ShapeOr"===e.type)return e.shapeExprs.reduce(((e,n)=>{const s=r.walkVal(n,t);return s&&Object.keys(s).forEach((t=>{e[t]=t in e?e[t].concat(s[t]):s[t]})),e}),{});if("ShapeAndResults"===e.type||"ExtensionResults"===e.type)return e.solutions.reduce(((e,n)=>{const s=r.walkVal(n,t);return s&&Object.keys(s).forEach((t=>{e[t]=t in e?e[t].concat(s[t]):s[t]})),e}),{});if("ShapeAnd"===e.type)return e.shapeExprs.reduce(((e,n)=>{const s=r.walkVal(n,t);return s&&Object.keys(s).forEach((t=>{e[t]=t in e?e[t].concat(s[t]):s[t]})),e}),{});if("ExtendedResults"===e.type)return["extensions","local"].reduce(((e,n)=>{const s=r.walkVal(n,t);return s&&Object.keys(s).forEach((t=>{e[t]=t in e?e[t].concat(s[t]):s[t]})),e}),{});if("EachOfSolutions"===e.type||"OneOfSolutions"===e.type)return e.solutions.reduce(((e,n)=>(n.expressions.forEach((n=>{const s=r.walkVal(n,t);s&&Object.keys(s).forEach((t=>{e[t]=t in e?e[t].concat(s[t]):s[t]}))})),e)),{});if("TripleConstraintSolutions"===e.type){if("solutions"in e){const t={},r=[];return t[e.predicate]=r,e.solutions.forEach((e=>n(e,r))),r.length?t:null}return null}if("Recursion"===e.type)return null;throw Error("unknown shapeExpression type in "+JSON.stringify(e));function n(e,n){const s=[];if(function e(s){if(!s)return!1;if(s.node===a.nil)return!0;if("solution"in s&&"solutions"in s.solution&&1===s.solution.solutions.length&&"expressions"in s.solution.solutions[0]&&2===s.solution.solutions[0].expressions.length&&"predicate"in s.solution.solutions[0].expressions[0]&&s.solution.solutions[0].expressions[0].predicate===a.first&&s.solution.solutions[0].expressions[1].predicate===a.rest){const i=s.solution.solutions[0].expressions,o=i[0],u=i[1].solutions[0],c=o.solutions[0];let p=t(c);if("referenced"in c){const e=r.walkVal(c.referenced,t);e&&(p?p.nested=e:p=e)}return p&&n.push(p),u.object===a.nil||e("ShapeOrResults"===u.referenced.type?u.referenced.solution:u.referenced)}}(e.referenced))[].push.apply(n,s);else{const s=t(e)||{};if("referenced"in e){const n=r.walkVal(e.referenced,t);n&&(s.nested=n)}Object.keys(s).length>0&&n.push(s)}}},valToValues:function(e){return this.walkVal(e,(function(e){return"object"in e?{ldterm:e.object}:null}))},valToExtension:function(e,t){return function e(r){const n=[];let s={};function i(e){if(null===s)return e;if(Array.isArray(e))return s=null,e;for(k in e){if(k in s)return s=null,e;s[k]=l(e[k])}return e}for(let s in r)if("extensions"===s)r[s]&&n.push(i(l(r[s][t])));else if("nested"===s){const t=e(r[s]);Array.isArray(t)?t.forEach(i):i(t),n.push(t)}else n.push(i(e(r[s])));return 1===n.length?n[0]:s||n}(this.walkVal(e,(function(e){return"extensions"in e?{extensions:e.extensions}:null})))},valuesToSchema:function(e){const t=e;if(e[a.type][0].ldterm===i.Schema){const r={"@context":"http://www.w3.org/ns/shex.jsonld",type:"Schema"};i.startActs in t&&(r.startActs=t[i.startActs].map((e=>{const t={type:"SemAct",name:e.nested[i.name][0].ldterm};return i.code in e.nested&&(t.code=e.nested[i.code][0].ldterm.value),t}))),i.imports in t&&(r.imports=t[i.imports].map((e=>e.ldterm))),e[i.start]&&(r.start=p({id:e[i.start][0].ldterm},n(e[i.start][0].nested)));const s=e[i.shapes];return s&&(r.shapes=s.map((e=>{var t=e.nested[a.type][0].ldterm;const r=t===i.ShapeExternal?{type:t}:Object.assign({},{type:i.ShapeDecl},i.abstract in e.nested?{abstract:!!e.nested[i.abstract]?.[0].ldterm.value}:{},{shapeExpr:n(e.nested[i.shapeExpr][0].nested)});return p({id:e.ldterm},r)}))),r}throw Error("unknown schema type in "+JSON.stringify(e));function r(e,t,r){const n=e[a.type][0].ldterm.substr(i._namespace.length),s=t[n];if(!s)return c;if(s.nary){const t={type:n};return t[s.prop]=e[i[s.prop]].map((e=>o(e))),t}{const t={type:n};return s.prop&&(t[s.prop]=o(e[i[s.prop]][0])),t}function o(e){return s.expr&&"nested"in e?p({id:e.ldterm},r(e.nested)):e.ldterm}}function n(e){let t=r(e,{ShapeAnd:{nary:!0,expr:!0,prop:"shapeExprs"},ShapeOr:{nary:!0,expr:!0,prop:"shapeExprs"},ShapeNot:{nary:!1,expr:!0,prop:"shapeExpr"},ShapeRef:{nary:!1,expr:!1,prop:"reference"},ShapeExternal:{nary:!1,expr:!1,prop:null}},n);if(t!==c)return t;const u=e[a.type][0].ldterm;if(u===i.ShapeDecl){const t={type:"ShapeDecl"};return["abstract"].forEach((r=>{i[r]in e&&(t[r]=!!e[i[r]][0].ldterm.value)})),i.shapeExpr in e&&(t.shapeExpr="nested"in e[i.shapeExpr][0]?p({id:e[i.shapeExpr][0].ldterm},n(e[i.shapeExpr][0].nested)):e[i.shapeExpr][0].ldterm),t}if(u===i.Shape)return t={type:"Shape"},["closed"].forEach((r=>{i[r]in e&&(t[r]=!!e[i[r]][0].ldterm.value)})),["extra","extends","restricts"].forEach((r=>{i[r]in e&&(t[r]=e[i[r]].map((e=>e.ldterm)))})),i.expression in e&&(t.expression="nested"in e[i.expression][0]?p({id:e[i.expression][0].ldterm},o(e[i.expression][0].nested)):e[i.expression][0].ldterm),i.annotation in e&&(t.annotations=e[i.annotation].map((e=>({type:"Annotation",predicate:e.nested[i.predicate][0].ldterm,object:e.nested[i.object][0].ldterm})))),i.semActs in e&&(t.semActs=e[i.semActs].map((e=>{const t={type:"SemAct",name:e.nested[i.name][0].ldterm};return i.code in e.nested&&(t.code=e.nested[i.code][0].ldterm.value),t}))),t;if(u===i.NodeConstraint){const t={type:"NodeConstraint"};return i.values in e&&(t.values=e[i.values].map((e=>s(e)))),i.nodeKind in e&&(t.nodeKind=e[i.nodeKind][0].ldterm.substr(i._namespace.length)),["length","minlength","maxlength","mininclusive","maxinclusive","minexclusive","maxexclusive","totaldigits","fractiondigits"].forEach((r=>{i[r]in e&&(t[r]=parseFloat(e[i[r]][0].ldterm.value))})),i.pattern in e&&(t.pattern=e[i.pattern][0].ldterm.value),i.flags in e&&(t.flags=e[i.flags][0].ldterm.value),i.datatype in e&&(t.datatype=e[i.datatype][0].ldterm),t}throw Error("unknown shapeExpr type in "+JSON.stringify(e))}function s(e,t){if("nested"in e){const t=e.nested[a.type][0].ldterm;if(-1!==[i.IriStem,i.LiteralStem,i.LanguageStem].indexOf(t)){const r=e.nested[i.stem][0].ldterm.value;return{type:t.substr(i._namespace.length),stem:r}}if(-1!==[i.Language].indexOf(t))return{type:"Language",languageTag:e.nested[i.languageTag][0].ldterm.value};if(-1!==[i.IriStemRange,i.LiteralStemRange,i.LanguageStemRange].indexOf(t)){const r=e.nested[i.stem][0];let n=r;"object"==typeof r&&("object"==typeof r.ldterm?n=r.ldterm:r.ldterm.startsWith("_:")&&(n={type:"Wildcard"}));const a={type:t.substr(i._namespace.length),stem:"Wildcard"!==n.type?n.value:n};return i.exclusion in e.nested&&(a.exclusions=e.nested[i.exclusion].map((e=>s(e,t!==i.IriStemRange)))),a}throw Error("unknown objectValue type in "+JSON.stringify(e))}return t?e.ldterm.value:e.ldterm}function o(e){const t=r(e,{EachOf:{nary:!0,expr:!0,prop:"expressions"},OneOf:{nary:!0,expr:!0,prop:"expressions"},Inclusion:{nary:!1,expr:!1,prop:"include"}},o);if(t!==c)return u(e,t),t;if(e[a.type][0].ldterm===i.TripleConstraint){const t={type:"TripleConstraint",predicate:e[i.predicate][0].ldterm};return["inverse"].forEach((r=>{i[r]in e&&(t[r]=!!e[i[r]][0].ldterm.value)})),i.valueExpr in e&&(t.valueExpr=p({id:e[i.valueExpr][0].ldterm},"nested"in e[i.valueExpr][0]?n(e[i.valueExpr][0].nested):{})),u(e,t),t}throw Error("unknown tripleExpr type in "+JSON.stringify(e))}function u(e,t){return i.min in e&&(t.min=parseInt(e[i.min][0].ldterm.value)),i.max in e&&(t.max=parseInt(e[i.max][0].ldterm.value),isNaN(t.max)&&(t.max=-1)),i.annotation in e&&(t.annotations=e[i.annotation].map((e=>({type:"Annotation",predicate:e.nested[i.predicate][0].ldterm,object:e.nested[i.object][0].ldterm})))),i.semActs in e&&(t.semActs=e[i.semActs].map((e=>{const t={type:"SemAct",name:e.nested[i.name][0].ldterm};return i.code in e.nested&&(t.code=e.nested[i.code][0].ldterm.value),t}))),t}},simpleToShapeMap:function(e){return Object.keys(e).reduce(((t,r)=>(e[r].forEach((e=>{t.push({node:r,shape:e})})),t)),[])},absolutizeShapeMap:function(e,r){return e.map((e=>Object.assign(e,{node:t.resolveRelativeIRI(r,e.node),shape:t.resolveRelativeIRI(r,e.shape)})))},errsToSimple:function(t){const r=this;if("FailureList"===t.type)return t.errors.reduce(((e,t)=>e.concat(r.errsToSimple(t))),[]);if("Failure"===t.type)return["validating "+t.node+" as "+t.shape+":"].concat(function e(t){return t.reduce((function(t,r){const n=Object.keys(r);return t.concat(1===n.length&&"errors"===n[0]?e(r.errors):r)}),[])}(t.errors).reduce(((e,t)=>{const n=r.errsToSimple(t).map((e=>" "+e));return e.length>0?e.concat([" OR"]).concat(n):n.map((e=>" "+e))}),[]));if("TypeMismatch"===t.type){const n=Array.isArray(t.errors)?t.errors.reduce(((e,t)=>e.concat(("string"==typeof t?[t]:r.errsToSimple(t)).map((e=>" "+e)))),[]):" "+("string"==typeof e?[t.errors]:r.errsToSimple(t.errors));return["validating "+h(t.triple.object)+":"].concat(n)}if("RestrictionError"===t.type){var s=t.errors.constructor===Array?t.errors.reduce(((e,t)=>e.concat(("string"==typeof t?[t]:r.errsToSimple(t)).map((e=>" "+e)))),[]):" "+("string"==typeof e?[t.errors]:r.errsToSimple(t.errors));return["validating restrictions on "+h(t.focus)+":"].concat(s)}if("ShapeAndFailure"===t.type)return Array.isArray(t.errors)?t.errors.reduce(((e,t)=>e.concat(("string"==typeof t?[t]:r.errsToSimple(t)).map((e=>" "+e)))),[]):" "+("string"==typeof e?[t.errors]:r.errsToSimple(t.errors));if("ShapeOrFailure"===t.type)return Array.isArray(t.errors)?t.errors.reduce(((e,t)=>e.concat(" OR "+("string"==typeof t?[t]:r.errsToSimple(t)))),[]):" OR "+("string"==typeof e?[t.errors]:r.errsToSimple(t.errors));if("ShapeNotFailure"===t.type)return["Node "+t.errors.node+" expected to NOT pass "+t.errors.shape];if("ExcessTripleViolation"===t.type)return["validating "+h(t.triple.object)+": exceeds cardinality"];if("ClosedShapeViolation"===t.type)return["Unexpected triple(s): {"].concat(t.unexpectedTriples.map((e=>" "+e.subject+" "+e.predicate+" "+h(e.object)+" ."))).concat(["}"]);if("NodeConstraintViolation"===t.type){const e=n(95)();let r;return e._write(e._writeNodeConstraint(t.shapeExpr).join("")),e.end(((e,t)=>{r=t})),["NodeConstraintError: expected to match "+r]}if("MissingProperty"===t.type)return["Missing property: "+t.property];if("NegatedProperty"===t.type)return["Unexpected property: "+t.property];if("AbstractShapeFailure"===t.type)return["Abstract Shape: "+t.shape];if(Array.isArray(t))return t.reduce(((e,t)=>{const n=r.errsToSimple(t).map((e=>" "+e));return e.length?e.concat(["AND"]).concat(n):n}),[]);if("SemActFailure"===t.type){const n=Array.isArray(t.errors)?t.errors.reduce(((e,t)=>e.concat(("string"==typeof t?[t]:r.errsToSimple(t)).map((e=>" "+e)))),[]):" "+("string"==typeof e?[t.errors]:r.errsToSimple(t.errors));return["rejected by semantic action:"].concat(n)}if("SemActViolation"===t.type)return[t.message];if("BooleanSemActFailure"===t.type)return["Failed evaluating "+t.code+" on context "+JSON.stringify(t.ctx)];throw Error('unknown shapeExpression type "'+t.type+'" in '+JSON.stringify(t))},resolveRelativeIRI:t.resolveRelativeIRI,resolvePrefixedIRI:function(e,t){const r=e.indexOf(":");if(-1===r)return null;const n=t[e.substr(0,r)];return void 0===n?null:n+e.substr(r+1)},parsePassedNode:function(e,r,n,s,i){if(void 0===e||0===e.length)return s&&s(r.base)?r.base:n?n():this.NotSupplied;if("_"===e[0]&&":"===e[1])return e;if('"'===e[0]){const n=e.match(/^"((?:[^"\\]|\\")*)"(?:@(.+)|\^\^(?:<(.*)>|([^:]*):(.*)))?$/);if(!n)throw Error("malformed literal: "+e);const s=n[1],i=n[2],a=n[3],o=n[4],u=n[5],c='"'+s+'"';if(void 0!==i)return c+"@"+i;if(void 0!==o){if(!(o in r.prefixes))throw Error("error parsing node "+e+' no prefix for "'+o+'"');return c+"^^"+r.prefixes[o]+u}return void 0!==a?c+"^^"+t.resolveRelativeIRI(r.base,a):c}if(!r)return s(e)?e:this.UnknownIRI;const a="<"===e[0]&&">"===e[e.length-1];a&&(e=e.substr(1,e.length-2));const o=t.resolveRelativeIRI(r.base||"",e);if(s(o))return o;if(!a){const t=this.resolvePrefixedIRI(e,r.prefixes);if(null!==t&&s(t))return t}return i?i(o):this.UnknownIRI},executeQueryPromise:function(e,t){const r=t+"?query="+encodeURIComponent(e);return fetch(r,{headers:{Accept:"application/sparql-results+json"}}).then((e=>e.json())).then((e=>this.parseSparqlJsonResults(e)))},executeQuery:function(e,t){const r=t+"?query="+encodeURIComponent(e),n=new XMLHttpRequest;n.open("GET",r,!1),n.setRequestHeader("Accept","application/sparql-results+json"),n.send();const s=JSON.parse(n.responseText);return this.parseSparqlJsonResults(s)},parseSparqlJsonResults:function(e){const t=e.head.vars;return e.results.bindings.map((e=>t.map((t=>{const r=e[t];switch(r.type){case"uri":return r.value;case"bnode":return"_:"+r.value;case"literal":return'"'+r.value.replace(/"/g,'\\""')+'"'+("xml:lang"in r?"@"+r["xml:lang"]:"")+("datatype"in r?"^^"+r.datatype:"");case"typed-literal":return'"'+r.value.replace(/"/g,'\\""')+'"^^'+r.datatype;default:throw"unknown XML results type: "+r.type}}))))},rdfjsDB:function(e,r){return{getNeighborhood:function(n,s){let i;r&&(i=new Date,r.start(!1,n,s));const a=e.getQuads(n,null,null,null).map(t.internalTriple);if(r){const e=new Date;r.end(a,e.valueOf()-i.valueOf()),i=e}r&&r.start(!0,n,s);const o=e.getQuads(null,null,n,null).map(t.internalTriple);return r&&r.end(o,(new Date).valueOf()-i.valueOf()),{outgoing:a,incoming:o}},getSubjects:function(){return e.getSubjects().map(t.internalTerm)},getPredicates:function(){return e.getPredicates().map(t.internalTerm)},getObjects:function(){return e.getObjects().map(t.internalTerm)},getQuads:function(){return e.getQuads.apply(e,arguments).map(t.internalTriple)},get size(){return e.size}}},makeTriplesDB:function(e){var t=[],r=[];return{getNeighborhood:function(e,n,s){return{outgoing:r,incoming:t}},getTriplesByIRI:function(e,n,s,i){return t.concat(r).filter((t=>!(e&&e!==t.subject||n&&n!==t.predicate||e&&e!==t.object)))},getSubjects:function(){return["!Triples DB can't index subjects"]},getPredicates:function(){return["!Triples DB can't index predicates"]},getObjects:function(){return["!Triples DB can't index objects"]},get size(){},addIncomingTriples:function(e){Array.prototype.push.apply(t,e)},addOutgoingTriples:function(e){Array.prototype.push.apply(r,e)}}},NotSupplied:"-- not supplied --",UnknownIRI:"-- not found --",unescapeText:function(e,t){const r=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\(.)/g;try{return e=e.replace(r,(function(e,r,n,s){let i;if(r){if(i=parseInt(r,16),isNaN(i))throw new Error;return String.fromCharCode(i)}if(n){if(i=parseInt(n,16),isNaN(i))throw new Error;return i<65535?String.fromCharCode(i):String.fromCharCode(55296+((i-=65536)>>10),56320+(1023&i))}{const e=t[s];if(!e)throw new Error("no replacement found for '"+s+"'");return e}}))}catch(e){return console.warn(e),""}}};function h(e){if("object"!=typeof e)return e;const t='"'+e.value+'"';return"language"in e?t+"@"+e.language:"type"in e?t+"^^"+e.type:t}function d(e,t){for(let r in f)t?e.prototype[r]=m(f[r]):e[r]=f[r];return e}function m(e){return function(t){return e(this,t)}}return d(d)}();t.exports=s},457:(e,t,r)=>{const n=function(){const e={term:"START"},t=r(118);let n=r(806),s=r(443);const i=r(515);function a(e){return t.isIRI(e)?e:t.isLiteral(e)?t.getLiteralValue(e):e.substr(2)}const o="http://www.w3.org/2001/XMLSchema#",u=[o+"integer",o+"nonPositiveInteger",o+"negativeInteger",o+"long",o+"int",o+"short",o+"byte",o+"nonNegativeInteger",o+"unsignedLong",o+"unsignedInt",o+"unsignedShort",o+"unsignedByte",o+"positiveInteger"],c=[o+"decimal"].concat(u),p=[o+"float",o+"double"].concat(c),l={"http://www.w3.org/2001/XMLSchema#integer":function(e,t){return e.match(/^[+-]?[0-9]+$/)||t("illegal integer value '"+e+"'"),parseInt(e)},"http://www.w3.org/2001/XMLSchema#decimal":function(e,t){return e.match(/^[+-]?(?:[0-9]*\.[0-9]+|[0-9]+)$/)||t("illegal decimal value '"+e+"'"),parseFloat(e)}},f=/^[+\-]?(?:[0-9]+(?:\.[0-9]*)?|\.[0-9]+)(?:[eE][+\-]?[0-9]+)?$/;l[o+"float"]=function(e,t){return"NaN"===e?NaN:"INF"===e?1/0:"-INF"===e?-1/0:(e.match(f)||t("illegal float value '"+e+"'"),parseFloat(e))},l[o+"double"]=function(e,t){return"NaN"===e?NaN:"INF"===e?1/0:"-INF"===e?-1/0:(e.match(f)||t("illegal double value '"+e+"'"),Number(e))};const h={length:function(e,t){return e.length===t},minlength:function(e,t){return e.length>=t},maxlength:function(e,t){return e.length<=t}},d={mininclusive:function(e,t){return e>=t},minexclusive:function(e,t){return e>t},maxinclusive:function(e,t){return e<=t},maxexclusive:function(e,t){return e!1===e?e:-1!==["value","type","language"].indexOf(t)),!0)}function x(e){return{byPredicate:e.reduce((function(e,t){const r=t.predicate;return r in e||(e[r]=[]),e[r].push(t),e}),{}),candidates:E(e.length).map((function(){return[]})),misses:[]}}function g(e,r){const[n,s]=[e,r].map((e=>t.isBlank(e)?1:t.isLiteral(e)?2:3));return n===s?e.localeCompare(r):n-s}function E(e){return Array.from(Array(e))}function b(e,t,r){t in e||A("expected "+JSON.stringify(e)+" to have a '"+t+"' attribute."),arguments.length>2&&e[t]!==r&&A("expected "+t+" attribute '"+e[t]+"' to equal '"+r+"'.")}function S(){}function A(){const e=Array.prototype.join.call(arguments,""),t=new Error(e);throw Error.captureStackTrace(t,A),t}function v(e){return E(e).map((()=>[]))}return{construct:function c(f,O,T){if(!(this instanceof c))return new c(f,O,T);let I=f._index||n.index(f);this.type="ShExValidator",T=T||{},this.options=T,this.options.coverage=this.options.coverage||"exhaustive","noCache"in T&&T.noCache||(this.known={});const w=this;this.schema=f,this._expect=this.options.lax?S:b,this._optimize={},this.reset=function(){};const F=this.options.regexModule||r(237);function N(e,t,r,n,s){const i=x(t.slice(0,r)),a=x(t.slice(r));return e.reduce((function(e,r,n){r.inverse,r.inverse;const o=(r.inverse?a:i).byPredicate[r.predicate]||[],u=w._triplesMatchingShapeExpr(o,r,s);return u.hits.forEach((function(r){const s=t.indexOf(r.triple);e.constraintList[s].push(n),e.results[n][s]=r.sub})),u.misses.forEach((function(r){const s=t.indexOf(r.triple);e.misses[s]={constraintNo:n,errors:r.errors}})),e}),{misses:{},results:v(e.length),constraintList:v(t.length)})}function k(e,t,r){return e.slice().reduce((function(e,t,n){return"NO_TRIPLE_CONSTRAINT"!==t&&e[t].push({tNo:n,res:r.results[t][n]}),e}),E(t.length).map((()=>[])))}function L(e,t,r,n){if(!("extends"in e))return null;const i=[],a=[];for(let o=0;oc.addOutgoingTriples([e])));const p=w.validate(t,u,n.tracker,n.seen,c);"errors"in p?a.push(p):i.push(p)}return a.length>0?{type:"ExtensionFailure",errors:a}:{type:"ExtensionResults",solutions:i}}function R(e){const t=[];return"extends"in e&&e.extends.forEach(((e,n)=>{const s={},i={};r(e,s,i),[s,i].forEach((e=>{Object.keys(e).forEach((r=>{let s=e[r];t.push({tripleConstraint:s,extendsNo:n})}))}))})),t;function r(e,t,n){const i=s.Visitor();let a=1,o=1;const u=i.visitOneOf;i.visitShapeRef=function(e){return i.visitShapeDecl(w._lookupShape(e))},i.visitShape=function(e,s){return"extends"in e&&e.extends.forEach((e=>r(e,t,n))),"expression"in e&&i.visitExpression(e.expression),{type:"Shape"}},i.visitOneOf=function(e){const t=a,r=o;a=0,u.call(i,e),a=t,o=r},i.visitTripleConstraint=function(e){const r=e.inverse?t:n;let s="min"in e?e.min:1;s*=a;let i="max"in e?e.max:1;return i*=o,r[e.predicate]={type:"TripleConstraint",predicate:e.predicate,min:e.predicate in r?Math.max(r[e.predicate].min,s):s,max:e.predicate in r?Math.min(r[e.predicate].max,i):i,seen:e.predicate in r?r[e.predicate].seen+1:1,tcs:e.predicate in r?r[e.predicate].tcs.concat([e]):[e]},e},i.visitShapeExpr(e)}}this.indexTripleConstraints=function(e){const t=[];return e&&function e(r){return"string"==typeof r?e(I.tripleExprs[r]):"TripleConstraint"===r.type?(t.push(r),[t.length-1]):"OneOf"===r.type||"EachOf"===r.type?r.expressions.reduce((function(t,r){return t.concat(e(r))}),[]):A("unexpected expr type: "+r.type)}(e),t},this.emptyTracker=function(){const e=e=>e;return{recurse:e,known:e,enter:function(e,t){++this.depth},exit:function(e,t,r){--this.depth},depth:0}},this.validate=function(r,n,s,i,a){if("object"==typeof r&&"termType"in r&&(r=t.internalTerm(r)),"object"==typeof r){const e=r;if("api"===this.options.results)return e.map((e=>{let t=new Date;const r=this.validate(e.node,e.shape,n,s);return t=new Date-t,{node:e.node,shape:e.shape,status:"errors"in r?"nonconformant":"conformant",appinfo:r,elapsed:t}}));const t=e.reduce(((e,t)=>{const r=this.validate(t.node,t.shape,n,s,a);return"errors"in r?{passes:e.passes,failures:e.failures.concat(r)}:{passes:e.passes.concat(r),failures:e.failures}}),{passes:[],failures:[]});return t.failures.length>0?1!==t.failures.length?{type:"FailureList",errors:t.failures}:t.failures[0]:1!==t.passes.length?{type:"SolutionList",solutions:t.passes}:t.passes[0]}const o=void 0===s;s||(s=this.emptyTracker()),n&&n!==e||f.start||A("start production not defined");let u=null;if(u=n==e?f.start:this._lookupShape(n),"string"!=typeof n)return this._validateShapeDecl(r,u,e,0,s,i);void 0===i&&(i={});const c=r+"@"+(n===e?"_: -start-":n);if(!a){if(c in i)return s.recurse({type:"Recursion",node:y(r),shape:n});if("known"in this&&c in this.known)return s.known(this.known[c]);i[c]={point:r,shape:n},s.enter(r,n)}const p=this._validateDescendants(r,n,0,s,i,a);return a||(s.exit(r,n,p),delete i[c],"known"in this&&(this.known[c]=p)),"startActs"in f&&o&&(p.startActs=f.startActs),p},this._validateDescendants=function(e,t,r,n,a,o,u){if(o)return this._validateShapeDecl(e,this._lookupShape(t),t,0,n,a,o);let c=[t];c=c.concat(function(e){const t={},r=i.create();return function(e){const n=s.Visitor();let i,a;const o=n.visitShapeDecl;n.visitShapeDecl=function(e){return i=e.id,a=e.abstract,t[e.id]=e.abstract,o.call(n,e,e.id)};n.visitShape;return n.visitShape=function(e){return"extends"in e&&e.extends.forEach((e=>{const t=s.Visitor();t.visitShapeRef=function(e){return r.add(e,i),"null"},t.visitShapeExpr(e)})),"null"},n}().visitSchema(e),r.children}(this.schema)[t]||[]);for(let e=c.length-1;e>=0;--e)c.indexOf(c[e])!this._lookupShape(e).abstract)));const p=c.reduce(((t,r)=>{const s=this._lookupShape(r),i=this._validateShapeDecl(e,s,r,0,n,a,o);return"errors"in i?{passes:t.passes,failures:t.failures.concat(i)}:{passes:t.passes.concat(i),failures:t.failures}}),{passes:[],failures:[]});let l;return l=p.passes.length>0?1!==p.passes.length?{type:"SolutionList",solutions:p.passes}:p.passes[0]:p.failures.length>0?1!==p.failures.length?{type:"FailureList",errors:p.failures}:p.failures[0]:{type:"AbstractShapeFailure",shape:t,errors:t+" has no non-abstract children"},l},this._validateShapeDecl=function(e,t,r,n,s,i,a){const o="ShapeDecl"===t.type?t.shapeExpr:t;return this._validateShapeExpr(e,o,r,n,s,i,a)},this._lookupShape=function(e){if("shapes"in this.schema&&0!==this.schema.shapes.length){if(e in I.shapeExprs)return I.shapeExprs[e];A("shape "+e+" not found in:\n"+Object.keys(I.shapeExprs||[]).map((e=>" "+e)).join("\n"))}else A("shape "+e+" not found; no shapes in schema")},this._validateShapeExpr=function(e,t,r,n,s,i,a){if(""===e)throw Error("validation needs a valid focus node");let o=null;if("string"==typeof t)o=this._validateDescendants(e,t,n,s,i,a,!0);else if("NodeConstraint"===t.type){const n=this._errorsMatchingNodeConstraint(e,t,null);o=n.errors&&n.errors.length?{type:"Failure",node:y(e),shape:r,errors:n.errors.map((function(e){return{type:"NodeConstraintViolation",shapeExpr:t,error:e}}))}:{type:"NodeConstraintTest",node:y(e),shape:r,shapeExpr:t}}else if("Shape"===t.type)o=this._validateShape(e,t,r,n,s,i,a);else if("ShapeExternal"===t.type)o=this.options.validateExtern(e,r,s,i);else if("ShapeOr"===t.type){const u=[];for(let o=0;o0?{type:"ShapeAndFailure",errors:c}:{type:"ShapeAndResults",solutions:u}}}if("string"!=typeof t&&"Shape"!==t.type&&!("errors"in o)&&"semActs"in t){const n=this.semActHandler.dispatchAll(t.semActs,Object.assign({node:e},o),o);if(n.length)return{type:"Failure",node:y(e),shape:r,errors:n}}return o},this._validateShape=function(e,t,r,n,s,i,a){const o={db:O,shapeLabel:r,depth:n,tracker:s,seen:i};let u=null;const c={};if("startActs"in f){const t=this.semActHandler.dispatchAll(f.startActs,null,c);if(t.length)return{type:"Failure",node:y(e),shape:r,errors:t}}const p=(a||O).getNeighborhood(e,r,t),l=p.outgoing.length,h=p.outgoing.sort(((e,t)=>e.predicate.localeCompare(t.predicate)||g(e.object,t.object))).concat(p.incoming.sort(((e,t)=>e.predicate.localeCompare(t.predicate)||g(e.object,t.object)))),d=this.indexTripleConstraints(t.expression),m=R(t),_=m.map((e=>e.tripleConstraint)).concat(d),x=N(_,h,l,e,o),{misses:b,extras:S}=function(e,t,r,n){const s=[],i=e.constraintList.reduce((function(i,a,o){return 0===a.length&&o0?e[i][0]:t}function a(){if(null!==s&&0===s.length)return!1;if(null===s)return i(),!0;let a=r-1;if(n[a]++,n[a]=e[a].length;){if(0==a)return!1;n[a]=0,s[a]=e[a].length>0?e[a][0]:t,n[--a]++}return s[a]=e[a][n[a]],!0}return{next:a,do:function(e,t){return e.apply(t,s)},get:function(){return s}}}(x.constraintList,"NO_TRIPLE_CONSTRAINT"),v=[],T=F.compile(f,t,I);for(;A.next()&&null===u;){const n=[],s=[],i=E(h.length).map((function(){return 0})),a=A.get(),c=[],p=[],f=E((t.extends||[]).length).map((()=>[]));if(a.forEach(((e,t)=>{if("NO_TRIPLE_CONSTRAINT"!==e&&e"NO_TRIPLE_CONSTRAINT"===c[t]&&"NO_EXTENDS"===p[t]&&-1===S.indexOf(t)));e.length>0&&n.push({type:"ClosedShapeViolation",unexpectedTriples:e})}c.forEach((function(e,t){"NO_TRIPLE_CONSTRAINT"!==e&&(s.push(h[t]),++i[e])}));const d=k(c,_,x);let g=L(t,e,f,o);if(null===g||!("errors"in g)){const t=T.match(O,e,_,d,c,h,this.semActHandler,null);!("errors"in t)&&g?(g={type:"ExtendedResults",extensions:g},Object.keys(t).length>0&&(g.local=t)):g=t}"errors"in g&&[].push.apply(n,g.errors);const b={type:"ShapeTest",node:y(e),shape:r};if(0===n.length&&Object.keys(g).length>0&&(b.solution=g),"semActs"in t){const r=this.semActHandler.dispatchAll(t.semActs,Object.assign({node:e},g),b);r.length&&[].push.apply(n,r)}v.push(n),0===n.length&&(u=b)}const w=b.map((function(e){const t=h[e.tripleNo];return{type:"TypeMismatch",triple:{type:"TestedTriple",subject:t.subject,predicate:t.predicate,object:y(t.object)},constraint:_[e.constraintNo],errors:e.errors}})),C=v[v.length-1];let D=w.concat(1===C.length?C[0]:C);return D.length>0&&(u={type:"Failure",node:y(e),shape:r,errors:D}),function(e,t){"annotations"in e&&(t.annotations=e.annotations);return t}(t,u)},this._triplesMatchingShapeExpr=function(e,t,r){const n=this,s=[],i=[];return e.forEach((function(e){const a=t.inverse?e.subject:e.object;let o;const u=JSON.parse(JSON.stringify(n.semActHandler.results));(void 0===t.valueExpr?void 0:(o=n._errorsMatchingShapeExpr(a,t.valueExpr,r)).errors)?-1===i.indexOf(e)&&(n.semActHandler.results=JSON.parse(JSON.stringify(u)),s.push({triple:e,errors:o})):i.push({triple:e,sub:o})})),{hits:i,misses:s}},this._errorsMatchingShapeExpr=function(e,t,r,n){const s=this;if("string"==typeof t)return s.validate(e,t,r.tracker,r.seen,n);if("NodeConstraint"===t.type)return this._errorsMatchingNodeConstraint(e,t,null);if("Shape"===t.type)return s._validateShapeExpr(e,t,r.shapeLabel,r.depth,r.tracker,r.seen,n);if("ShapeOr"===t.type){const i=[];for(let a=0;a is less than the min:",n.min):e>n.max&&r('"'+e+'"^^<'+t+"> is greater than the max:",n.min)}(l[f](i,x),r.datatype,x):r.datatype===o+"boolean"?"true"!==i&&"false"!==i&&"1"!==i&&"0"!==i&&x("illegal boolean value: "+i):r.datatype===o+"dateTime"&&(i.match(/^[+-]?\d{4}-[01]\d-[0-3]\dT[0-5]\d:[0-5]\d:[0-5]\d(\.\d+)?([+-][0-2]\d:[0-5]\d|Z)?$/)||x("illegal dateTime value: "+i)):x("mismatched datatype: "+e+" is not a literal with datatype "+r.datatype)),r.values&&(t.isLiteral(e)&&r.values.reduce(((t,r)=>{if(t)return!0;const n=y(e);return"Language"===r.type?r.languageTag===n.language:"object"==typeof r&&"value"in r&&(r.value===n.value&&r.type===n.type&&r.language===n.language)}),!1)||-1!==r.values.indexOf(e)||r.values.some((function(r){if("object"==typeof r&&!("value"in r)){"type"in r||A("expected "+JSON.stringify(r)+" to have a 'type' attribute.");const i=["Language","IriStem","LiteralStem","LanguageStem","IriStemRange","LiteralStemRange","LanguageStemRange"];function n(e,n,s){return t.isLiteral(e)?-1!==["LiteralStem","LiteralStemRange"].indexOf(r.type)?s(t.getLiteralValue(e),n):-1!==["LanguageStem","LanguageStemRange"].indexOf(r.type)?s(t.getLiteralLanguage(e)||null,n):x("literal "+e+" not comparable with non-literal "+n):-1===["IriStem","IriStemRange"].indexOf(r.type)?x("nonliteral "+e+" not comparable with literal "+JSON.stringify(n)):s(e,n)}function s(e,t){return n(e,t,((e,t)=>"LanguageStem"===r.type||"LanguageStemRange"===r.type?null!==e&&(e===t||""===t||"-"===e[t.length]):e.startsWith(t)))}if(-1===i.indexOf(r.type)&&A("expected type attribute '"+r.type+"' to be in '"+i+"'."),_(r.stem)){if(!s(e,r.stem))return!1}else b(r.stem,"type","Wildcard");return!r.exclusions||!r.exclusions.some((function(t){if(_(t))return n(e,t,((e,t)=>e===t));{"type"in t||A("expected "+JSON.stringify(t)+" to have a 'type' attribute.");const r=["IriStem","LiteralStem","LanguageStem"];return-1===r.indexOf(t.type)&&A("expected type attribute '"+t.type+"' to be in '"+r+"'."),s(e,t.stem)}}))}}))||x("value "+e+" not found in set "+JSON.stringify(r.values))),"pattern"in r){const t="flags"in r?new RegExp(r.pattern,r.flags):new RegExp(r.pattern);a(e).match(t)||x("value "+a(e)+" did not match pattern "+r.pattern)}Object.keys(h).forEach((function(t){t in r&&!h[t](i,r[t])&&x("facet violation: expected "+t+" of "+r[t]+" but got "+e)})),Object.keys(d).forEach((function(t){t in r&&(f?d[t](l[f](i,x),r[t])||x("facet violation: expected "+t+" of "+r[t]+" but got "+e):x("facet violation: numeric facet "+t+" can't apply to "+e))})),Object.keys(m).forEach((function(t){t in r&&(f===o+"integer"||f===o+"decimal"?m[t](""+l[f](i,x),r[t])||x("facet violation: expected "+t+" of "+r[t]+" but got "+e):x("facet violation: numeric facet "+t+" can't apply to "+e))}));const g={type:null,focus:e,shapeExpr:r};return s.length?(g.type="NodeConstraintViolation",g.errors=s):g.type="NodeConstraintTest",g},this.semActHandler={handlers:{},results:{},register:function(e,t){this.handlers[e]=t},dispatchAll:function(e,t,r){const n=this;return e.reduce((function(e,s){if(0===e.length&&s.name in n.handlers){const i="code"in s?s.code:w.options.semActs[s.name],a="extensions"in r&&s.name in r.extensions,o=a?r.extensions[s.name]:{},u=n.handlers[s.name].dispatch(i,t,o);if("boolean"==typeof u)u||e.push({type:"SemActFailure",errors:[{type:"BooleanSemActFailure",code:i,ctx:t}]});else{if("object"!=typeof u||!Array.isArray(u))throw Error("unsupported response from semantic action handler: "+JSON.stringify(u));u.length>0&&e.push({type:"SemActFailure",errors:u})}return!a&&Object.keys(o).length>0&&("extensions"in r||(r.extensions={}),r.extensions[s.name]=o),e}return e}),[])}}},start:e,options:{coverage:{firstError:"fail on first error (usually used with eval-simple-1err)",exhaustive:"find as many errors as possible (usually used with eval-threaded-nerr)"}}}}();e.exports=n},806:e=>{function t(){function e(e){return"object"!=typeof e||"value"in e&&Object.keys(e).reduce(((e,t)=>!1===e?e:-1!==["value","type","language"].indexOf(t)),!0)}function t(e){return"string"==typeof e}const r={runtimeError:function(e){throw e},visitSchema:function(e){const t={type:"Schema"};return this._expect(e,"type","Schema"),this._maybeSet(e,t,"Schema",["@context","prefixes","base","imports","startActs","start","shapes"],["_base","_prefixes","_index","_sourceMap"]),t},visitPrefixes:function(e){return void 0===e?void 0:function(e,t){const r={};return Object.keys(e).forEach((function(n){r[n]=t(e[n])})),r}(e,(function(e){return e}))},visitIRI:function(e){return e},visitImports:function(e){const t=this;return e.map((function(e){return t.visitIRI(e)}))},visitStartActs:function(e){const t=this;return void 0===e?void 0:e.map((function(e){return t.visitSemAct(e)}))},visitSemActs:function(e){const t=this;if(void 0===e)return;const r=[];return Object.keys(e).forEach((function(n){r.push(t.visitSemAct(e[n],n))})),r},visitSemAct:function(e,t){const r={type:"SemAct"};return this._expect(e,"type","SemAct"),this._maybeSet(e,r,"SemAct",["name","code"]),r},visitShapes:function(e){const t=this;if(void 0!==e)return e.map((e=>t.visitShapeDecl(e)))},visitProductions999:function(e){const t=this;if(void 0===e)return;const r={};return Object.keys(e).forEach((function(n){r[n]=t.visitExpression(e[n],n)})),r},visitShapeDecl:function(e,t){return"ShapeDecl"===e.type?this._maybeSet(e,{type:"ShapeDecl"},"ShapeDecl",["id","abstract","restricts","shapeExpr"]):this.visitShapeExpr(e,t)},visitShapeExpr:function(e,r){if(t(e))return this.visitShapeRef(e);const n="Shape"===e.type?this.visitShape(e,r):"NodeConstraint"===e.type?this.visitNodeConstraint(e,r):"ShapeAnd"===e.type?this.visitShapeAnd(e,r):"ShapeOr"===e.type?this.visitShapeOr(e,r):"ShapeNot"===e.type?this.visitShapeNot(e,r):"ShapeExternal"===e.type?this.visitShapeExternal(e):null;if(null===n)throw Error("unexpected shapeExpr type: "+e.type);return n},_visitShapeGroup:function(e,t){this._testUnknownAttributes(e,["id","shapeExprs"],e.type,this.visitShapeNot);const r=this,n={type:e.type};return"id"in e&&(n.id=e.id),n.shapeExprs=e.shapeExprs.map((function(e){return r.visitShapeExpr(e,t)})),n},visitShapeNot:function(e,t){this._testUnknownAttributes(e,["id","shapeExpr"],"ShapeNot",this.visitShapeNot);const r={type:e.type};return"id"in e&&(r.id=e.id),r.shapeExpr=this.visitShapeExpr(e.shapeExpr,t),r},visitShape:function(e,t){const r={type:"Shape"};return this._expect(e,"type","Shape"),this._maybeSet(e,r,"Shape",["id","abstract","extends","closed","expression","extra","semActs","annotations"]),r},_visitShapeExprList:function(e){const t=this;return e.map((function(e){return t.visitShapeExpr(e,void 0)}))},visitNodeConstraint:function(e,t){const r={type:"NodeConstraint"};return this._expect(e,"type","NodeConstraint"),this._maybeSet(e,r,"NodeConstraint",["id","nodeKind","datatype","pattern","flags","length","reference","minlength","maxlength","mininclusive","minexclusive","maxinclusive","maxexclusive","totaldigits","fractiondigits","values","annotations","semActs"]),r},visitShapeRef:function(e){if("string"!=typeof e){let t=Exception("visitShapeRef expected a string, not "+JSON.stringify(e));throw console.warn(t),t}return e},visitShapeExternal:function(e){return this._testUnknownAttributes(e,["id"],"ShapeExternal",this.visitShapeNot),Object.assign("id"in e?{id:e.id}:{},{type:"ShapeExternal"})},_visitGroup:function(e,t){const r=this,n=Object.assign("id"in e?{id:null}:{},{type:e.type});return n.expressions=e.expressions.map((function(e){return r.visitExpression(e)})),this._maybeSet(e,n,"expr",["id","min","max","annotations","semActs"],["expressions"])},visitTripleConstraint:function(e){return this._maybeSet(e,Object.assign("id"in e?{id:null}:{},{type:"TripleConstraint"}),"TripleConstraint",["id","inverse","predicate","valueExpr","min","max","annotations","semActs"])},visitExpression:function(e){if("string"==typeof e)return this.visitInclusion(e);const t="TripleConstraint"===e.type?this.visitTripleConstraint(e):"OneOf"===e.type?this.visitOneOf(e):"EachOf"===e.type?this.visitEachOf(e):null;if(null===t)throw Error("unexpected expression type: "+e.type);return t},visitValues:function(t){const r=this;return t.map((function(t){return e(t)||"Language"===t.type?t:r.visitStemRange(t)}))},visitStemRange:function(t){const r=this;"type"in t||r.runtimeError(Error("expected "+JSON.stringify(t)+" to have a 'type' attribute."));const n=["IriStem","LiteralStem","LanguageStem","IriStemRange","LiteralStemRange","LanguageStemRange"];let s;return-1===n.indexOf(t.type)&&r.runtimeError(Error("expected type attribute '"+t.type+"' to be in '"+n+"'.")),e(t)?(this._expect(t.stem,"type","Wildcard"),s={type:t.type,stem:{type:"Wildcard"}}):s={type:t.type,stem:t.stem},t.exclusions&&(s.exclusions=t.exclusions.map((function(e){return r.visitExclusion(e)}))),s},visitExclusion:function(t){if(e(t))return t;{"type"in t||_Visitor.runtimeError(Error("expected "+JSON.stringify(t)+" to have a 'type' attribute."));const e=["IriStem","LiteralStem","LanguageStem"];return-1===e.indexOf(t.type)&&_Visitor.runtimeError(Error("expected type attribute '"+t.type+"' to be in '"+e+"'.")),{type:t.type,stem:t.stem}}},visitInclusion:function(e){if("string"!=typeof e){let t=Exception("visitInclusion expected a string, not "+JSON.stringify(e));throw console.warn(t),t}return e},_maybeSet:function(e,t,r,n,s){const i=this;return this._testUnknownAttributes(e,s?n.concat(s):n,r,this._maybeSet),n.forEach((function(r){const n="visit"+r.charAt(0).toUpperCase()+r.slice(1);if(r in e){const s=i[n];if("function"!=typeof s)throw Error(n+" not found in Visitor");const a=s.call(i,e[r]);void 0!==a&&(t[r]=a)}})),t},_visitValue:function(e){return e},_visitList:function(e){return e.slice()},_testUnknownAttributes:function(e,t,r,n){const s=Object.keys(e).reduce((function(e,r){return"type"!==r&&-1===t.indexOf(r)?e.concat(r):e}),[]);if(s.length>0){const t=Error("unknown propert"+(s.length>1?"ies":"y")+": "+s.map((function(e){return'"'+e+'"'})).join(",")+" in "+r+": "+JSON.stringify(e));throw Error.captureStackTrace(t,n),t}},_expect:function(e,t,r){t in e||this.runtimeError(Error("expected "+JSON.stringify(e)+" to have a ."+t)),arguments.length>2&&e[t]!==r&&this.runtimeError(Error("expected "+e[t]+" to equal "+r))}};return r.visitBase=r.visitStart=r.visitClosed=r["visit@context"]=r._visitValue,r.visitRestricts=r.visitExtends=r._visitShapeExprList,r.visitExtra=r.visitAnnotations=r._visitList,r.visitAbstract=r.visitInverse=r.visitPredicate=r._visitValue,r.visitName=r.visitId=r.visitCode=r.visitMin=r.visitMax=r._visitValue,r.visitType=r.visitNodeKind=r.visitDatatype=r.visitPattern=r.visitFlags=r.visitLength=r.visitMinlength=r.visitMaxlength=r.visitMininclusive=r.visitMinexclusive=r.visitMaxinclusive=r.visitMaxexclusive=r.visitTotaldigits=r.visitFractiondigits=r._visitValue,r.visitOneOf=r.visitEachOf=r._visitGroup,r.visitShapeAnd=r.visitShapeOr=r._visitShapeGroup,r.visitInclude=r._visitValue,r.visitValueExpr=r.visitShapeExpr,r}t.index=function(e){let r={shapeExprs:{},tripleExprs:{}},n=t(),s=n.visitExpression;n.visitExpression=function(e){return"object"==typeof e&&"id"in e&&(r.tripleExprs[e.id]=e),s.call(n,e)};let i=n.visitShapeExpr;n.visitShapeExpr=n.visitValueExpr=function(e,t){return"object"==typeof e&&"id"in e&&(r.shapeExprs[e.id]=e),i.call(n,e,t)};let a=n.visitShapeDecl;return n.visitShapeDecl=n.visitValueExpr=function(e,t){return"object"==typeof e&&"id"in e&&(r.shapeExprs[e.id]=e),a.call(n,e,t)},n.visitSchema(e),r},e.exports=t},863:(e,t,r)=>{ShExWebApp=function(){let e=r(261);return Object.assign({},{ShExTerm:r(118),Util:r(443),Validator:r(457),Writer:r(95),Api:r(410),Parser:r(931),"eval-simple-1err":r(540),"eval-threaded-nerr":r(237),ShapeMap:e,ShapeMapParser:e.Parser,DcTap:r(281).DcTap})}(),e.exports=ShExWebApp},95:(e,t,r)=>{const n=function(){const e=r(755),t=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,n=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,s={"\\":"\\\\",'"':'\\"',"/":"\\/","\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"},i={iri:"IRI",bnode:"BNODE",literal:"LITERAL",nonliteral:"NONLITERAL"};function a(e,t){if(!(this instanceof a))return new a(e,t);if(e&&"function"!=typeof e.write&&(t=e,e=null),t=t||{},e)this._outputStream=e,this._endStream=void 0===t.end||!!t.end;else{let e="";this._outputStream={write:function(t,r,n){e+=t,n&&n()},end:function(t){t&&t(null,e)}},this._endStream=!0}this._prefixIRIs=Object.create(null),this._baseIRI=t.base||null,t.prefixes&&this.addPrefixes(t.prefixes),this._error=t.error||c,this.forceParens=!t.simplifyParentheses,this._expect=t.lax?l:p}function o(e){let t=s[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 u(e){return e.replace(/\\/g,"\\\\").replace(/%/g,"\\%")}function c(e,t){"function"!=typeof e&&(t=e,e=c);const r=new Error(t);throw Error.captureStackTrace(r,e),r}function p(e,t,r){t in e||this._error(p,"expected "+e+" to have a ."+t),arguments.length>2&&e[t]!==r&&this._error(p,"expected "+e[e]+" to equal ."+r)}function l(){}return a.prototype={_write:function(e,t){this._outputStream.write(e,"utf8",t)},_writeSchema:function(e,t){const r=this;this._expect(e,"type","Schema"),r.addPrefixes(e._prefixes),e._base&&(r._baseIRI=e._base),r._baseIRI&&r._write("BASE <"+r._baseIRI+">\n"),e.imports&&e.imports.forEach((function(e){r._write("IMPORT "+r._encodeIriOrBlankNode(e)+"\n")})),e.startActs&&e.startActs.forEach((function(e){r._expect(e,"type","SemAct"),r._write(" %"+r._encodePredicate(e.name)+("code"in e?"{"+u(e.code)+"%}":"%"))})),e.start&&r._write("start = "+r._writeShapeExpr(e.start,t,!0,0).join("")+"\n"),"shapes"in e&&e.shapes.forEach((function(e){let n=e.id,s="";"ShapeDecl"===e.type&&(e.abstract&&(s="abstract "),e=e.shapeExpr),r._write(s+r._encodeShapeName(n,!1)+" "+r._writeShapeExpr(e,t,!0,0).join("")+"\n",t)}))},_writeShapeExpr:function(e,t,r,n){const s=this,i=[];if("string"==typeof e)i.push("@",s._encodeShapeName(e));else if("ShapeDecl"===e.type)i.push(s._writeShapeExpr(e.shapeExpr,t,!1,3));else if("ShapeExternal"===e.type)i.push("EXTERNAL");else if("ShapeAnd"===e.type){n>=3&&i.push("(");let r=!1;e.shapeExprs.forEach((function(n,a){if(a>0){function o(t){let r=e.shapeExprs[t];return!("NodeConstraint"!==r.type||"nodeKind"in r&&"literal"===r.nodeKind||"datatype"in r||"values"in r)}let c=!r&&(o(a-1)&&function(t){let r=e.shapeExprs[t];return"Shape"===r.type||"ShapeRef"===r.type}(a)||(u=a-1,"Shape"===e.shapeExprs[u].type&&o(a)));i.push(" AND "),r=c}var u;[].push.apply(i,s._writeShapeExpr(n,t,!1,3))})),n>=3&&i.push(")")}else if("ShapeOr"===e.type)n>=2&&i.push("("),e.shapeExprs.forEach((function(e,n){n>0&&i.push(" OR "),[].push.apply(i,s._writeShapeExpr(e,t,r,2))})),n>=2&&i.push(")");else if("ShapeNot"===e.type)n>=4&&i.push("("),i.push("NOT "),[].push.apply(i,s._writeShapeExpr(e.shapeExpr,t,r,4)),n>=4&&i.push(")");else if("Shape"===e.type)[].push.apply(i,s._writeShape(e,t,r));else{if("NodeConstraint"!==e.type)throw Error("expected Shape{,And,Or,Ref} or NodeConstraint in "+JSON.stringify(e));[].push.apply(i,s._writeNodeConstraint(e,t,r))}return i},_writeShape:function(e,t,r){const n=this;try{const a=[];this._expect(e,"type","Shape"),e.closed&&a.push("CLOSED "),[{keyword:"extends",marker:"EXTENDS "}].forEach((r=>{e[r.keyword]&&e[r.keyword].length>0&&(e[r.keyword].forEach((function(e,s){s&&a.push(" "),a.push(r.marker),[].push.apply(a,n._writeShapeExpr(e,t,!0,0))})),a.push(" "))})),e.extra&&e.extra.length>0&&(a.push("EXTRA "),e.extra.forEach((function(e,t){a.push(n._encodeShapeName(e,!1)+" ")})),a.push(" "));function s(e,t){0===e&&1===t?a.push("?"):0===e&&-1===t?a.push("*"):void 0===e&&void 0===t||(1===e&&-1===t?a.push("+"):a.push("{",e,",",-1===t?"*":t,"}"))}return a.push("{\n"),e.expression&&function e(r,i,o){function c(e){e&&e.forEach((function(e){n._expect(e,"type","SemAct"),a.push("\n"+i+" %"),a.push(n._encodeValue(e.name)),"code"in e?a.push("{"+u(e.code)+"%}"):a.push("%")}))}function p(t,r,n,s){const u=n0&&e.push(" "),i(t))e.push(s._encodeValue(t));else{"type"in t||runtimeError("expected "+JSON.stringify(t)+" to have a 'type' attribute.");const o=["Language","IriStem","LiteralStem","LanguageStem","IriStemRange","LiteralStemRange","LanguageStemRange"];function a(e,t){return-1!==["LanguageStem","LanguageStemRange"].indexOf(e.type)?"@"+t:-1!==["LiteralStem","LiteralStemRange"].indexOf(e.type)?'"'+t.replace(n,t)+'"':s._encodeValue(t)}-1===o.indexOf(t.type)&&runtimeError("expected type attribute '"+t.type+"' to be in '"+o+"'."),"Language"===t.type?e.push("@"+t.languageTag):i(t.stem)?e.push(a(t,t.stem)+"~"):(p(t.stem,"type","Wildcard"),e.push(".")),t.exclusions&&t.exclusions.forEach((function(r){if(e.push(" - "),i(r))e.push(a(t,r));else{"type"in r||runtimeError("expected "+JSON.stringify(r)+" to have a 'type' attribute.");const n=["IriStem","LiteralStem","LanguageStem"];-1===n.indexOf(r.type)&&runtimeError("expected type attribute '"+r.type+"' to be in '"+n+"'."),e.push(a(t,r.stem)+"~")}}))}})),e.push("]")),"pattern"in t){const r=t.pattern.replace(/\//g,"\\/"),n="flags"in t?t.flags:"";e.push("/"+r+"/"+n+" ")}return["length","minlength","maxlength","mininclusive","minexclusive","maxinclusive","maxexclusive","totaldigits","fractiondigits"].forEach((function(r){t[r]&&e.push(" ",r," ",t[r])})),e;function i(e){return"object"!=typeof e||"value"in e&&Object.keys(e).reduce(((e,t)=>!1===e?e:-1!==["value","type","language"].indexOf(t)),!0)}},_encodeIriOrBlankNode:function(e,r){if(r=r?" ":"","_"===e[0]&&":"===e[1])return e;t.test(e)&&(e=e.replace(n,o));const s=this._prefixRegex.exec(e);return s?(s[1]?this._prefixIRIs[s[1]]+s[2]:e)+r:this._relateUrl(e)},_relateUrl:function(t){const r=this._baseIRI;try{r&&new URL(r).host===new URL(t).host&&(t=e.relate(r,t,{output:e.ROOT_PATH_RELATIVE}))}catch(e){}return"<"+t+">"},_encodeLiteral:function(e,r,s){return t.test(e)&&(e=e.replace(n,o)),s?'"'+e+'"@'+s:r?"http://www.w3.org/2001/XMLSchema#integer"===r&&e.match(/^[+-]?[0-9]+$/)||"http://www.w3.org/2001/XMLSchema#decimal"===r&&e.match(/^[+-]?[0-9]*\.[0-9]+$/)||"http://www.w3.org/2001/XMLSchema#double"===r&&e.match(/^[+-]?([0-9]+\.[0-9]*[eE][+-]?[0-9]+|\.?[0-9]+[eE][+-]?[0-9]+)$/)?e:'"'+e+'"^^'+this._encodeIriOrBlankNode(r):'"'+e+'"'},_encodeShapeName:function(e,t){if('"'===e[0])throw new Error("A literal as subject is not allowed: "+e);return this._encodeIriOrBlankNode(e,t)},_encodePredicate:function(e){if('"'===e[0])throw new Error("A literal as predicate is not allowed: "+e);return"http://www.w3.org/1999/02/22-rdf-syntax-ns#type"===e?"a":this._encodeIriOrBlankNode(e)},_encodeValue:function(e){return"object"!=typeof e?this._encodeIriOrBlankNode(e):this._encodeLiteral(e.value,e.type,e.language)},_blockedWrite:function(){throw new Error("Cannot write because the writer has been closed.")},writeSchema:function(e,t){this._writeSchema(e,t),this.end(t)},addShape:function(e,t,r){this._write(_ShExWriter._encodeShapeName(t,!1)+" "+_ShExWriter._writeShapeExpr(e,r,!0,0).join(""),r)},addShapes:function(e){for(let t=0;t\n"))}if(n){let e="",t="";for(let n in r)e+=e?"|"+n:n,t+=(t?"|":"")+r[n];e=e.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&"),this._prefixRegex=new RegExp("^(?:"+t+")[^/]*$|^("+e+")([a-zA-Z][\\-_a-zA-Z0-9]*)$")}this._write(n?"\n":"",t)},_prefixRegex:/$0^/,end:function(e){this._write=this._blockedWrite;let t=e&&function(r,n){t=null,e(r,n)};if(this._endStream)try{return this._outputStream.end(t)}catch(e){}t&&t()}},a}();e.exports=n}},r={};function n(e){var s=r[e];if(void 0!==s)return s.exports;var i=r[e]={id:e,loaded:!1,exports:{}};return t[e].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}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.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);n(863)})(); \ No newline at end of file