+M.Qd?1:z.Qd===M.Qd?0:-1});return Kb(aa.map(z=>z.item))}},wf:y,Th:function(E,A){switch(E){case "=":case "eq":return A;case "!=":case "ne":return!A;case "<":case "lt":case ">":case "gt":case ">=":case "ge":case "<=":case "le":throw new G("Operator "+E+" not allowed for unordered types","SXJS0003");default:throw new G("Unknown operator "+E,"SXJS0003");}},xf:function(E,A){function H(ia){return Ia(ia)?N(ia.matchKey()):ia.matchKey()}const S=new cc,N=E.collationKey;if(!N)throw new G("Collation is unsuitable for keys and grouping",
+"XTDE1110");const aa={Tc:function(ia,Y){return Fd(Kb(ia),Kb(Y),E.equals)},hash:function(ia){return ia.map(H).join()}},ma={Tc:function(ia,Y){return H(ia)===H(Y)},hash:function(ia){return H(ia)}};S.options=A?aa:ma;return S},Mj:"http://www.w3.org/2013/collation/UCA",Zh:"http://www.w3.org/xslts/collation/caseblind"}}();
+// Input 26
+var Jd=function(){var a={};return{register:function(c,n){a[c]=n},find:function(c){return a[c]},dl:a}}();
+// Input 27
+var Kd=function(){function a(c){const n=ac.Ja,F={"p.any":function(){return function(){return!0}},"p.never":function(){return function(){return!1}},"p.booleanExp":function(I){const m=cd.Sa(I);return function(g,e){e=e.ba();e.focus=Rb(g);return cd.Fd(m(e))}},"p.genNode":function(I){const m=cd.Sa(I);let g;if("slash"===I.C[0].N){I=cd.ti(I.C[0]);let e=I.C[0];for(;["filter","subscript"].includes(e.N);)e=e.C[0];"axis"===e.N&&"child"===e.name&&(e.name="self",g=cd.ib(I))}return function(e,k){if(!ac.X(e))return!1;
+const v=ac.Ja.Xa(e);let t;for(var D;;){t=v.next();if(null==t)return!ac.kf(D)&&g?(k=k.ba(!1),k.focus=Rb(D),k.Nb=[],g(k).some(l=>ac.isSameNode(l,e))):!1;D=k.ba(!1);D.focus=Rb(t);D.Nb=[];if(m(D).some(l=>ac.isSameNode(l,e)))return!0;D=t}}},"p.genPos":function(I){const m=fc(I.test).ia(),g=cd.Sa(I);return function(e,k){if(!m(e))return!1;const v=k.fixed.ka;k=k.ba(!1);var t=n.Ka(ac.$a(e)).filter(m);k.focus=Sb(t);for(k.Nb=[];null!=(t=k.focus.next());)if(t===e&&v.Fd(g(k)))return!0;return!1}},"p.nodeSet":function(I){const m=
+cd.Sa(I);return function(g,e){return m(e).some(k=>k===g)}},"p.nodeTest":function(I){return fc(I.test).ia()},"p.simPos":function(I){const m=fc(I.test).ia(),g=parseInt(I.pos,10);return function(e){return m(e)&&n.Qc(e).filter(m).count()===g-1}},"p.venn":function(I){var m=I.C,g=a(m[0]),e=a(m[1]);I=I.op;switch(I){case "union":return function(k,v){return g(k,v)||e(k,v)};case "intersect":return function(k,v){return g(k,v)&&e(k,v)};case "except":return function(k,v){return g(k,v)&&!e(k,v)};default:throw new G("unknown op "+
+I,"SXJS0003");}},"p.withCurrent":function(I){const m=a(I.C[0]);return function(g,e){e=e.ba(!0);e.oa[0]=[g];return m(g,e)}},"p.withPredicate":function(I){I=I.C;const m=a(I[0]),g=cd.ib(I[1]);return function(e,k){if(!m(e,k))return!1;k=k.ba(!1);k.focus=Rb(e);k.Nb=[];return cd.Fd(g(k))}},"p.withUpper":function(I){const m=I.C,g=a(m[0]),e=a(m[1]),k=I.axis;return"parent"===k?"true"===I.upFirst?function(v,t){const D=ac.$a(v);return D&&e(D,t)&&g(v,t)}:function(v,t){const D=ac.$a(v);return D&&g(v,t)&&e(D,t)}:
+function(v,t){if(!g(v,t))return!1;v=ac.Og[k](v);let D;for(;null!==(D=v.next());)if(e(D,t))return!0;return!1}}}[c.N];if(F)return F(c);throw new G("Unimplemented pattern "+c.N,"SXJS0002");}return{od:a,matches:function(c,n,F){F.ub.push(null);c=c(n,F);F.ub.pop();return c}}}();
+// Input 28
+var Ld=function(){function a(F,I,m,g){function e(q){for(var p=[],u=q.length-1;0<=u;u--)p.push({Rd:q[u],action:q[u].C[1],pattern:Kd.od(q[u].C[0])});return p}function k(q){q._saxonAccumulators||(q._saxonAccumulators={});q._saxonAccumulators[m]={};var p=v(L,q);p&&(d=D(p,q));q._saxonAccumulators[m].pre=d;n.Ka(q).forEachItem(k);(p=v(y,q))&&(d=D(p,q));q._saxonAccumulators[m].post=d}function v(q,p){for(var u=0,P=q.length;uB.indexOf(t[0].value))throw new G("Invalid value "+L+"="+t[0],"FOJS0005");return t[0].value}throw new G("Invalid option: "+D+": must be "+l,"XPTY0004");}return f}function c(t,
+D){function l(u){throw new G(u,"FOJS0001");}function f(){return p=B()}function B(){for(p="";;){if(q>=t.length)return["eof"];var u=t.charAt(q++);if(!/[ \n\r\t]/.test(u))break}switch(u){case "[":case "{":case "]":case "}":case ":":case ",":return[u];case '"':for(u=!1;;){const P=t.charAt(q++);if('"'!==P||u)p+=P,u="\\"===P&&!u;else return["string",p];q>=t.length&&l("Unclosed quotes in string literal")}case "-":case "0":case "1":case "2":case "3":case "4":case "5":case "6":case "7":case "8":case "9":for(p+=
+u;q=u){if(p+=u,++q>=t.length)break}else break;if(["true","false","null"].includes(p))return[p];l("Unknown constant "+p);break;default:return l("Unexpected character '"+u+"' ("+Da(u)+") at position "+q),-1}}function L(u){p[0]!==u&&l("Expected "+u+", found "+
+p[0])}function y(u){return p[0]===u?(f(),!0):!1}function b(u){return p[0]===u?(f(),!0):","===p[0]?(f(),!1):l("Expected ',' or '"+u+"', found '"+p[0]+"'")}function d(){switch(p[0]){case "[":f();D.Qh();if(!y("]")){do d();while(!b("]"))}D.bh();break;case "{":f();D.Rh();if(!y("}")){do L("string"),D.Yg(p[1]),f(),L(":"),f(),d();while(!b("}"))}D.dh();break;case "string":D.ah(p[1]);f();break;case "number":D.$g(p[1]);f();break;case "true":case "false":D.Xg(p[0]);f();break;case "null":D.Zg();f();break;default:l("Unexpected token "+
+p[0])}}t=t.replace(/^[\uFEFF]/,"");let q=0,p=null;p=f();d();L("eof");return D.result()}function n(t){try{return JSON.parse('"'+t+'"')}catch(D){throw new G(D.toString(),"FOJS0001");}}function F(t,D){const l=D.Ab,f=D.Cd;let B;B=f?L=>f.evaluate([[La.XS.string.fromString(I(L))]],l).next().toString():()=>"\ufffd";t=t.replace(/[\x00-\x08\x0B\x0C\x0E-\x0F\x80-\x9F\uFFFF]/g,B);return t=t.replace(/[\uD800-\uDFFF]+/g,L=>{let y="";for(let b=0;bd||b===
+L.length-1&&"\udc00">d?B(d):d}return y})}function I(t){for(t=t.charCodeAt(0).toString(16);4>t.length;)t="0"+t;return"\\u"+t.toUpperCase()}function m(t,D){this.g=[];this.I=[];this.Ab=D;a(t,"liberal","boolean",!1);this.Cd=a(t,"fallback","function",null);this.B=a(t,"escape","boolean",!1);this.K=a(t,"duplicates","string","use-first",["reject","use-first","use-last"]);if(this.B&&this.Cd)throw new G("parse-json: cannot use fallback with escape:true()","FOJS0005");}function g(t,D){this.g=[];this.K=[];this.I=
+[];this.Ab=D;a(t,"liberal","boolean",!1);if(a(t,"validate","boolean",!1))throw new G("json-to-xml: validate option not supported in a non-schema-aware processor","FOJS0004");this.Cd=a(t,"fallback","function",null);this.B=a(t,"escape","boolean",!1);this.aa=a(t,"duplicates","string","use-first",["reject","use-first","retain"]);if(this.B&&this.Cd)throw new G("json-to-xml: cannot use fallback with escape:true()","FOJS0005");}const e=Zb.Oa,k=La.XS,v=ac.Ja;m.prototype={g:[],I:[],Ab:null,B:!1,Cd:null,K:"use-first",
+aa:function(t){return this.B?JSON.stringify(t).replace(/^"|"$/g,"").replace(/\\"/g,'"').replace(/[\uD800-\uDFFF]/g,I):F(t,this)},ua:function(){return this.g[this.g.length-1]},j:function(t){if(0===this.g.length)this.g.push(t);else if(this.ua()instanceof $c)this.ua().value.push(t);else{const D=this.ua(),l=k.string.fromString(this.I.pop());if(D.containsKey(l))switch(this.K){case "reject":throw new G("json-to-xml: duplicate key '"+l.toString()+"'","FOJS0003");case "use-first":return}D.inSituPut(l,t)}},
+Zg:function(){this.j([])},Xg:function(t){this.j([k.boolean.fromString(t)])},$g:function(t){this.j([k.double.fromNumber(parseFloat(t))])},ah:function(t){this.j([k.string.fromString(this.aa(n(t)))])},Yg:function(t){this.I.push(this.aa(n(t)))},Qh:function(){this.g.push(new $c([]))},bh:function(){this.j([this.g.pop()])},Rh:function(){this.g.push(new cc)},dh:function(){this.j([this.g.pop()])},result:function(){return void 0!==this.ua()[0]?this.ua()[0]:null}};g.prototype={g:[],K:[{}],I:[],Ab:null,Cd:null,
+B:!1,aa:"use-first",V:function(t){return this.B?JSON.stringify(t).replace(/^"|"$/g,"").replace(/\\"/g,'"').replace(/[\uD800-\uDFFF]/g,I):F(t,this)},ua:function(){return this.g[this.g.length-1]},j:function(t){if(0===this.g.length)t.setAttribute("xmlns",e),this.g.push(t);else{const D=this.ua();if("map"===D.tagName){const l=this.K.pop(),f=this.I[this.I.length-1];if(l in f)switch(this.aa){case "reject":throw new G("parse-json: duplicate key '"+l.toString()+"'","FOJS0003");case "use-first":return}f[l]=
+t;t.setAttribute("key",l);this.B&&/\\/.test(l.toString())&&t.setAttribute("escaped-key","true")}D.appendChild(t)}},Zg:function(){const t=this.Ab.ja.createElementNS(e,"null");this.j(t)},Xg:function(t){const D=this.Ab.ja.createElementNS(e,"boolean");D.appendChild(this.Ab.ja.createTextNode(t.toString()));this.j(D)},$g:function(t){const D=this.Ab.ja.createElementNS(e,"number");D.appendChild(this.Ab.ja.createTextNode(t.toString()));this.j(D)},ah:function(t){const D=this.Ab.ja.createElementNS(e,"string");
+if(""!==t){t=this.V(n(t));const l=this.Ab.ja.createTextNode(t);this.B&&/\\/.test(t)&&D.setAttribute("escaped","true");D.appendChild(l)}this.j(D)},Yg:function(t){this.K.push(this.V(n(t)))},Qh:function(){const t=this.Ab.ja.createElementNS(e,"array");this.g.push(t)},bh:function(){this.j(this.g.pop())},Rh:function(){const t=this.Ab.ja.createElementNS(e,"map");this.g.push(t);this.I.push({})},dh:function(){this.I.pop();this.j(this.g.pop())},result:function(){return this.ua()}};return{ye:function(t,D,l){return c(t,
+new m(D,l))},wj:function(t,D,l){return c(t,new g(D,l))},Pj:function(t,D){function l(p){throw new G("Invalid input to xml-to-json(): "+p,"FOJS0006");}function f(p){0!==d.Fc(p).length&&l("node "+p.tagName+" must have no element children")}function B(p){v.Ka(p).filter(function(u){return(3===u.nodeType||4===u.nodeType)&&u.nodeValue&&""!==Ha.trim(u.nodeValue)}).next()&&l("node "+p.tagName+" must have no text content")}function L(p){try{return k.boolean.fromString(p).toBoolean()}catch(u){l("invalid boolean: '"+
+p+"'")}}function y(p){try{JSON.parse('"'+p+'"')}catch(u){throw new G("invalid escape sequence: "+u.toString(),"FOJS0007");}}function b(p,u=0){const P=0===u,la=q?" ".repeat(3*u):"";if(9===p.nodeType||11===p.nodeType){var oa=d.Fc(p);1!==oa.length&&l("document node has "+oa.length+" element children");return b(oa[0],u)}if(1===p.nodeType){let K=!1;if(p.namespaceURI===e){let ca=null!==d.$a(p)&&"map"===d.$a(p).localName;v.Ha(p).forEachItem(function(x){if(0>x.name.indexOf(":")||x.namespaceURI===e)"key"===
+x.name||"escaped-key"===x.name?"escaped-key"===x.name?(ca||P||l("@escaped-key is allowed only on children of map, or on root element"),L(x.value)&&y(p.getAttribute("key"))):ca||P||l("@key is allowed only on children of map, or on root element"):"escaped"===x.name?("string"!==p.localName&&l("@escaped is allowed only on string"),K=L(x.value)):l("invalid attribute "+x.name)});switch(p.localName){case "null":return v.Ka(p).filter(function(N){return 8!==N.nodeType&&7!==N.nodeType}).next()&&l("null element must have no content"),
+"null";case "string":f(p);oa=p.textContent;if(K)oa=oa.replace(/^"/g,'\\"').replace(/^[\b]/g,"\\b").replace(/^\f/g,"\\f").replace(/^\n/g,"\\n").replace(/^\r/g,"\\r").replace(/^\t/g,"\\t").replace(/^\//g,"\\/").replace(/([^\\])"/g,'$1\\"').replace(/([^\\])[\b]/g,"$1\\b").replace(/([^\\])\f/g,"$1\\f").replace(/([^\\])\n/g,"$1\\n").replace(/([^\\])\r/g,"$1\\r").replace(/([^\\])\t/g,"$1\\t").replace(/([^\\])\//g,"$1\\/").replace(/[\u0001-\u001F\u007F-\u009F]/g,I),y(oa);else return JSON.stringify(oa).replace(/\//g,
+"\\/");return'"'+oa+'"';case "number":f(p);try{oa=k.double.fromString(p.textContent)}catch(N){l("invalid number")}isFinite(oa.toNumber())||l("NaN and INF not allowed");return oa.toString();case "boolean":return f(p),L(p.textContent),k.boolean.fromString(p.textContent).toString();case "array":B(p);let x=q?"[\n":"[",E=q?la:"";d.Fc(p).forEach(function(N){x+=E+b(N,u+1);E=q?`,\n${la}`:","});return x+"]";case "map":B(p);let A=q?"{\n":"{",H=q?la:"";const S={};d.Fc(p).forEach(function(N){N.hasAttribute("key")||
+l("child element of map must have a key");const aa=d.getAttribute(N,"key");let ma=aa;const ia=d.getAttribute(N,"escaped-key");let Y=!1;ia&&L(ia)&&(Y=!0,ma=n(aa));S[ma]&&l("duplicate key '"+aa+"'");S[ma]=!0;A+=H+(Y?'"'+aa+'"':JSON.stringify(aa).replace(/\//g,"\\/"))+":"+b(N,u+1);H=q?`,\n${la}`:","});return q?(oa=0{I.setAttributeNS(g.uri,g.toString(),m.value)});for(let m in n)n.hasOwnProperty(m)&&(a=n[m],""===m?I.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns",a):I.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:"+m,a))}endElement(){0===--this.j?this.pc=null:this.pc=this.pc.parentNode;this.B=null}text(a){this.B?this.B.appendData(a):(a=this.gd.createTextNode(a),Rd(this,a),0Yd(a,n));else{if(c instanceof ad.XdmFunction)throw new G("Cannot add a function item to an XDM node tree","SENR0001");if(c instanceof cc)throw new G("Cannot add a map to an XDM node tree","SENR0001");Zd.Gh(c,a);a.j=!1}}
+class $d extends Qd{constructor(a){super();this.g=a;this.j=this.I=this.B=!1}Ea(a={}){Xd(this,a);this.B=!1}za(){this.j=!1;this.g.za()}na(a,c,n,F={}){Xd(this,F);this.g.na(a,c,n,F)}endElement(){this.g.endElement();this.j=!1}text(a,c={}){Xd(this,c);super.text(a,c);this.j=!1}wa(a,c={}){Xd(this,c);super.wa(a,c);this.j=!1}va(a,c,n={}){Xd(this,n);super.va(a,c,n);this.j=!1}append(a,c={}){Xd(this,c);Yd(this,a)}close(){this.B&&this.za();super.close()}}
+function ae(a,c={}){a.I||(a.g.Ea(c),a.I=!0,a.j=!0);a.B||a.g.append(a.K,{});a.B=!1}
+class be extends Qd{constructor(a,c){super();this.g=a;this.I=this.j=!1;this.B=!0;this.K=La.XS.string.fromString(c)}Ea(a={}){ae(this,a);this.j=!1}za(){this.g.za()}na(a,c,n,F={}){ae(this,F);this.g.na(a,c,n,F)}endElement(){this.g.endElement()}text(a,c={}){ae(this,c);super.text(a,c)}wa(a,c={}){ae(this,c);super.wa(a,c)}va(a,c,n={}){ae(this,n);super.va(a,c,n)}append(a,c={}){if(cd.isArray(a))a.flatten(n=>this.append(n,c));else{if(a instanceof ad.XdmFunction)throw new G("Cannot add a function item to an XDM node tree",
+"SENR0001");if(a instanceof cc)throw new G("Cannot add a map to an XDM node tree","SENR0001");La.pa(a)?(ae(this,c),this.g.append(a,c)):(ae(this,c),Zd.Gh(a,this))}}close(){this.j&&this.za();super.close()}}function ce(a,c){return a.g.findIndex(n=>n.equals(c))}class de{constructor(){this.g=[];this.j=[]}get(a){a=ce(this,a);return 0>a?void 0:this.j[a]}set(a,c){const n=ce(this,a);0<=n?this.j[n]=c:(this.g.push(a),this.j.push(c))}forEach(a){for(let c=0;cb.append(d))}}return B}}function c(f){let B=f.N;f.parentNode&&(B=c(f.parentNode)+"/"+B);return B}function n(f){if(f.C){const B=f.C.map(a);return function(L,y){B.forEach(b=>b(L,y))}}return()=>{}}function F(f,B,L,y,b,d){if(ac.X(f))switch(f.nodeType){case 9:case 11:L.pb=ac.baseURI(f);m(f,L,b,d);break;case 1:if(f.hasAttribute("xml:base")){const q=f.getAttribute("xml:base");
+L.pb=ac.ld(q)?q:qa.Fb(q.toString(),cd.Ia(y,B)).toString()}else L.pb=ac.baseURI(f);m(f,L,b,d);break;case 3:case 4:L.text(f.nodeValue);break;case 7:L.va(f.target,f.data);break;case 8:L.wa(f.textContent);break;default:L.append(f)}else L.append(f)}function I(f,B,L){switch(f.nodeType){case 9:case 11:B.Ea(L?{BASE_URI:L}:{});f=f.childNodes;for(L=0;Lq||L.index===q&&b)&&y.push({Nc:!1,string:d(f.substring(q,L.index))}),y.push({Nc:!0,groups:L,string:d(L[0])}),q=B.lastIndex,0===L[0].length&&B.lastIndex++,p++>10*f.length)throw new G("analyze-string looping???","SXJS0004");f.length>q&&y.push({Nc:!1,string:d(f.substring(q,f.length))});return y}function v(f){const B="compAtt"===f.N,L=cd.ib(cd.da(f,"name")),y=cd.ib(cd.da(f,"namespace"));return b=>{function d(){throw new G((B?"Attribute":"Element")+" name '"+q+"' is not a lexical QName",
+B?"XTDE0850":"XTDE0820",f);}let q=Ha.trim(L(b).next().toString());if(y){b=(b=y(b).next())?b.value:"";if(!cd.Oj(b))throw new G((B?"Attribute":"Element")+" namespace '"+b+"' is invalid",B?"XTDE0865":"XTDE0835",f);var p=La.XS.QName;if(""===b&&q.includes(":"))p=p.fromParts("","",q.replace(/^.*:/,""));else if(q.includes(":")){const u=q.split(":");""!==u[0]&&""!==u[1]||d();p=p.fromParts(u[0],b,u[1])}else p=""===b?p.fromParts("","",q):p.fromParts(B?"ns0":"",b,q)}else{if(B&&"xmlns"===q)throw new G("Attribute must not be named xmlns",
+"XTDE0855",f);try{p=cd.tg(f,q,!B)}catch(u){if(u instanceof G){if("XTDE0290"===u.code)throw new G((B?"Attribute":"Element")+" name '"+q+"' has an unbound prefix",B?"XTDE0860":"XTDE0830",f);"FORG0001"===u.code&&d()}throw u;}}if("http://www.w3.org/2000/xmlns/"===p.uri)throw new G("Disallowed namespace "+p.uri,B?"XTDE0865":"XTDE0835",f);return p}}class t{constructor(){}Ea(){}za(){}na(){}Ha(){}ob(){}endElement(){}text(){}wa(){}va(){}append(){}close(){}}class D extends t{constructor(f){super();this.j=f;
+this.V=[];this.zb=[];this.pb=null;this.g=0;this.eb=this.I=null;this.K={};this.Ca=null;this.B=this.ra=!1;this.xa={};this.Oc=null}ta(f,B,L){var y=this.K[f];if(y&&y!==B)if("ns"===L){if(this.xa[f])throw new G("Two conflicting bindings for prefix '"+f+"'","XTDE0430");if(this.I.prefix===f){for(y=f+"_9";this.K[y];)y+="9";this.I=La.XS.QName.fromParts(y,this.I.uri,this.I.local);this.K[y]=this.I.uri}this.K[f]=B}else return""===f&&(f="NULL"),this.ta(f+"0",B,L);"ns"===L&&(this.xa[f]=B);if("elem"===L&&""===B)for(y=
+this.V.length-1;0<=y;y--)if(""===this.V[y][0]){this.K[""]="";break}if(""!==f||""!==B){y=!1;for(let b=this.V.length-1;0<=b;b--){const d=this.V[b];if(d[0]===f){d[1]===B&&(y=!0);break}}if(!y){if(this.xa[f]&&this.xa[f]!==B)return this.ta(f+"0",B,L);this.K[f]=B}}return f}Ea(){0===this.g&&(this.j.Ea({BASE_URI:this.pb,ORIGINAL_NODE:this.Oc}),this.V=[]);this.aa();this.g++;this.B=this.ra=!1}za(){this.g--;0===this.g&&this.j.za();this.B=!1}na(f){this.aa();this.g++;this.ra=!0;this.I=f;this.eb=new de;this.K={};
+this.xa={};this.ta(f.prefix,f.uri,"elem");this.Ca=this.Oc;this.B=!1}Ha(f,B){if(0===this.g)this.j.append(new $b(f,B,null));else{if(!this.ra){if(this.I)throw new G("Cannot write attribute ("+f.toEQName()+"="+B+") after writing child nodes (level="+this.g+", start tag = "+this.I+")","XTDE0410");throw new G("Cannot attach an attribute ("+f.toEQName()+"="+B+") to a document node","XTDE0420");}if(""!==f.uri){["","xmlns"].includes(f.prefix)&&(f=f.withPrefix("ns_"));const L=this.ta(f.prefix,f.uri,"att");
+L!==f.prefix&&(f=f.withPrefix(L))}this.eb.set(f,{value:B,kb:0})}}ob(f,B){if(0===this.g)this.j.append(new bc(f,B));else{if(!this.ra)throw new G("Cannot write namespace after writing child nodes","XTDE0410");if(""===f&&""===this.I.uri)throw new G("Cannot add default namespace declaration to a no-namespace element","XTDE0440");this.ta(f,B,"ns")}}endElement(){this.aa();this.j.endElement();this.g--;let f=this.zb.pop();for(;0this.append(B));break;default:this.aa(),m(f,this,!0,!1)}this.B=!1}else if(0===this.g)this.j.append(f,{}),this.B=!1;else if(La.pa(f))this.aa(),this.text((this.B?" ":"")+f.toString(),
+{}),this.B=!0;else if(cd.isArray(f)){f=f.value;for(let B=0;B{try{let u=B(q).next();if(null===u)return Ob;u=u.toString();const P=L(q).next().toString(),la=y(q).next().toString(),oa=k(u,P,la,!0,!1),K=q.ba(!1),ca=oa.map(x=>x.string);K.focus=Sb(Kb(ca));K.focus.forEachItem(()=>{const x=oa[K.focus.position-1];x.Nc?b&&(K.Nb=x.groups,b(K,p)):d&&(K.Nb=[],d(K,
+p))})}catch(u){if(u instanceof G&&"FORX0002"===u.code)throw new G(u.message,"XTDE1140");if(u instanceof G&&"FORX0001"===u.code)throw new G(u.message,"XTDE1145");throw u;}}},applyImports:function(f){return function(B,L){const y=B.gb.mode;if(!y)throw new G("applyImports: no current mode","XTDE0560",f);fd(B,"XTDE0560","xsl:apply-imports",f);const b=B.ba(!0);b.sa=B.gb;cd.Ve(f,B,b);b.focus=B.focus;return y.ki(b,L)}},applyT:function(f){const B=cd.Sa(f),L=cd.ib(cd.da(f,"separator"));return function(y,b){let d;
+const q=y.ba(!0);if(cd.Db(f,"c"))d=y.gb.mode,["function","globalVariable","globalParam"].includes(y.sa.actor.N)&&(d=cd.me(f,y).Wh),q.sa=y.gb;else{var p=cd.ig(f,y,"mode");d=p.mode;if(d.Bh)throw new G("Mode "+d.Re.name+" only handles typed nodes","XTTE3100",f);q.sa=p}cd.Ve(f,y,q);p=L?L(y).next():null;q.focus=Sb(B(y));q.focus.Nb=y.focus?y.focus.Nb:null;d.Hb(q,b,p)}},att:function(f){const B=f.name,L=B.split(":");let y;y=f.nsuri?2===L.length?La.XS.QName.fromParts(L[0],f.nsuri,L[1]):La.XS.QName.fromParts("",
+f.nsuri,B):La.XS.QName.fromString(B,cd.Xd(f,!1));const b=cd.Sa(f);return function(d,q){d=g(b(d));q.Ha(y,d)}},"break":function(f){const B=n(f);return function(L,y){B(L,y);L.focus.position=-999}},callT:function(f){return function(B,L){const y=cd.ig(f,B,"template"),b=B.ba(!0);b.Bb=null;b.sa=y;cd.Tf(y.actor,b);cd.Ve(f,B,b);B=y.actor;B.C&&n(B)(b,L)}},choose:function(f){f=f.C;const B=[],L=[];for(let y=0;y
+B(L,y),y)}},copyOf:function(f){const B=cd.Db(f,"c"),L=cd.Db(f,"m"),y=cd.Sa(f);n(f);return function(b,d){y(b).forEachItem(q=>F(q,b,d,f,B,L))}},doc:function(f){const B=n(f);return function(L,y){y.pb=cd.Ia(f,L);y.Ea();B(L,y);y.za()}},elem:function(f){const B=f.name,L=B.split(":"),y=n(f);let b;b="undefined"!==typeof f.nsuri?2===L.length?La.XS.QName.fromParts(L[0],f.nsuri,L[1]):La.XS.QName.fromParts("",f.nsuri,B):La.XS.QName.fromString(B,cd.Xd(f,!0));return function(d,q){f.baseUri&&(q.pb=f.baseUri);q.na(b);
+if(f.namespaces){const u=f.namespaces.toString().split(" ");for(let P=0;P{p?p=!1:d.text(u.value,{});L(q,d)})}else q.focus.forEachItem(()=>L(q,d))}},forEachGroup:function(f){const B=cd.ib(cd.da(f,"select")),L=Zd.wi(cd.da(f,"content"));return(y,b)=>{function d(K){const ca=[];q.forEachItem(function(x){K(ca,x)});return ca}const q=Sb(B(y)),p=y.ba(!1);p.focus=q;var u={starting:function(){const K=Kd.od(cd.da(f,"match"));return d(function(ca,x){1===q.position||Kd.matches(K,x,p)?ca.push({group:[x]}):ca[ca.length-1].group.push(x)})},ending:function(){const K=
+Kd.od(cd.da(f,"match"));let ca=!1;return d(function(x,E){1===q.position||ca?x.push({group:[E]}):x[x.length-1].group.push(E);ca=Kd.matches(K,E,p)})},adjacent:function(){var K=cd.da(f,"collation");K=K?cd.evaluate(K,y).next().toString():Hd.ad;const ca=Hd.eg(K,y),x=cd.da(f,"key");let E=null;return d(function(A,H){var S=cd.evaluate(x,p).expand();1!==q.position&&Fd(Kb(S),Kb(E),ca.equals)?A[A.length-1].group.push(H):(A.push({group:[H],key:S}),E=S)})},by:function(){var K=cd.da(f,"collation");K=K?cd.evaluate(K,
+y).next().toString():Hd.ad;K=Hd.eg(K,y);const ca=Hd.xf(K,!1),x=cd.da(f,"key");return d(function(E,A){let H,S=[];cd.evaluate(x,p).forEachItem(function(N){ca.containsKey(N)?(H=ca.get(N),0>S.findIndex(function(aa){return aa===H})&&(E[H].group.push(A),S.push(H))):(H=E.length,E.push({group:[A],key:[N]}),ca.inSituPut(N,H),S.push(H))})})},by_c:function(){var K=cd.da(f,"collation");K=K?cd.evaluate(K,y).next().toString():Hd.ad;K=Hd.eg(K,y);const ca=cd.da(f,"key"),x=Hd.xf(K,!0);return d(function(E,A){let H,
+S=cd.evaluate(ca,p).expand();x.containsKey(S)?(H=x.get(S),E[H].group.push(A)):(H=E.length,E.push({group:[A],key:S}),x.inSituPut(S,H))})}};u.adjacent_c=u.adjacent;var P=f.algorithm+(cd.Db(f,"c")?"_c":"");let la;try{la=u[P]()}catch(K){if(K instanceof G&&"FOCH0002"===K.code)throw new G("Unknown collation:"+K.message,"XTDE1110");throw K;}const oa=cd.qb(f,"sortKey");if(0H)return-1;if(0P(d));var p=d.ba(!1);p.focus=Sb(L(d));p.ab=null;let u=!1;for(;null!==p.focus.next();)if(y(p,q),-999===p.focus.position){u=!0;break}!u&&b&&(p=d.ba(!1),p.focus=null,b(p,q))}},let:function(f){const B=cd.Sa(f),L=a(f.C[1]),y=parseInt(f.slot,10);return function(b,d){const q=b.qa;b.qa="variable";const p=B(b).expand();b.qa=q;b.oa[y]=p;L(b,d)}},nextIteration:function(f){const B=cd.qb(f,"withParam").map(L=>({select:cd.Sa(L),slot:parseInt(L.slot,10)}));return function(L){B.forEach(y=>
+y.value=y.select(L).expand());B.forEach(y=>L.oa[y.slot]=y.value)}},nextMatch:function(f){return function(B,L){const y=B.gb.mode;if(!y)throw new G("next-match: no current mode","XTDE0560",f);if(!B.ab)throw new G("next-match: no current template","XTDE0560",f);if(ee(B))throw new G("next-match: no context item","XTDE0560",f);const b=B.ba(!0);b.sa=B.gb;cd.Ve(f,B,b);return y.qj(b,L)}},procInst:function(f){const B=cd.Sa(f),L=cd.Wg(f);return function(y,b){const d=B(y).next().toString();if(!Ha.Mb(d))throw new G("The name of a processing-instruction must be a valid NCName; supplied value: "+
+d.toString(),"XTDE0890",f);if(/^[Xx][Mm][Ll]$/.test(d))throw new G("The name of a processing-instruction must not be 'xml'","XTDE0890",f);y=L(y);y=g(y).replace(/\?>/g,"? >").replace(/^\s+/,"");b.va(d,y)}},sequence:n,sourceDoc:function(f){const B=cd.ib(cd.da(f,"href")),L=a(f.C[1]);return function(y,b){const d=y.ba(!1);var q=null===B?"":B(y).next().toString();q=qa.Fb(q,cd.Ia(f,y));q=Nd.Ec(q,y);y=y.fixed.Ee;null!==y&&(q=y(q));d.focus=Rb(q);d.ab=null;L(d,b)}},useAS:function(f){return function(B,L){var y=
+cd.ig(f,B,"attributeSet");B=B.ba(!0);B.qa="attribute set";B.sa=y;y=y.actor;y.C&&n(y)(B,L)}},valueOf:function(f){const B=cd.Sa(f);let L={};cd.Db(f,"d")&&(L.DISABLE_ESCAPING=!0);return function(y,b){y=g(B(y));b.text(y,L)}}};return{Of:k,wi:a,Gc:function(f){return new D(f)},push:function(f,B,L){if("undefined"===typeof L)throw sa.Ma(Error().stack,1,B.fixed.Ta),new G("No output for "+c(f));if(l[f.N]){var y=a(f);try{y(B,L)}catch(b){throw b instanceof G&&!b.xsltLineNr&&ra(b,f),b;}}else{y=cd.ib(f);try{const b=
+y(B);let d;for(;null!=(d=b.next());)L.append(d)}catch(b){throw b instanceof G&&!b.xsltLineNr&&ra(b,f),b;}}},Gh:I,rf:F,sg:e}}();
+// Input 33
+const fe=function(){function a(K,ca,x,E,A){function H(V){return null===q.$a(V)}function S(V){return V.nodeType===N.nodeType&&(null===ma?!0:q.ca(V).equals(ma))}let N;const aa=A.fixed.ka;if(ca){if(N=aa.evaluate(ca,A).next(),!N||!q.X(N))throw new G("xsl:number/@select must yield a single node","XTTE1000");}else fd(A,"XTTE0990","xsl:number"),N=ed(A);const ma=q.ca(N);let ia=S;if(null!==x){const V=Kd.od(x);ia=function(ka){return Kd.matches(V,ka,A)}}if(null===E)ca=H;else{const V=Kd.od(E);ca=function(ka){return H(ka)||
+Kd.matches(V,ka,A)}}let Y;switch(K){case "simple":return K=p.Qc(N).filter(S),Ub(K.count()+1);case "single":K=p.Xa(N).filter(ia).next();Y=p.Xa(N).filter(ca).next();K=null===K?null:null!==p.Xa(K).filter(function(ka){return q.isSameNode(ka,Y)}).next()?K:null;if(null===K)return Ob;K=p.Qc(K).filter(ia);return Ub(K.count()+1);case "multi":K=Kb(p.Xa(N).filter(ia).expand().reverse());Y=p.Xa(N).filter(ca).next();K=K.filter(function(ka){return null!==p.Xa(ka).filter(function(z){return q.isSameNode(z,Y)}).next()});
+const V=u.integer.fromNumber;return K.mapOneToOne(ka=>V(p.Qc(ka).filter(ia).count()+1));case "any":return x=function(ka,z){return q.rb(z,ka)},K=new Eb(p.pg(N).filter(ia),p.Xa(N).filter(ia),x),Y=(new Eb(p.pg(N).filter(ca),p.Xa(N).filter(ca),x)).next(),null===Y&&sa.la("from pattern selected empty"),K=K.filter(function(ka){return 0<=q.rb(ka,Y)}),K=K.count(),0===K?Ob:Ub(K);default:return sa.la("unknown xsl:number/@level "+K),Ob}}function c(K,ca,x,E,A,H,S){function N(ma){let ia;""===ma&&(ma="1");if(/^[\x01-\x7f]*$/.test(ma))ma=
+ma.split(/\b/),ia=function(ka){return/\w+/.test(ka)};else{if(ma.length!==Da(ma).length)throw new G("Cannot handle non-BMP characters in format-number picture","SXJS0002");const ka=Zd.Of(ma,"[\\p{Nd}\\p{Nl}\\p{No}\\p{Lu}\\p{Ll}\\p{Lt}\\p{Lm}\\p{Lo}]+","",!0,!1);ia=function(z,M){return ka[M].Nc};ma=ka.map(function(z){return z.string.toString()})}const Y={prefix:"",fd:[],Yd:""};let V=".";for(let ka=0;ka=Y.fd.length?Y.fd[Y.fd.length-1]:Y.fd[z];0!==z&&(V+=M.Kh);z=M.Qg;A&&(z+=";o");ka=fe.bg(ka.toNumber(),z);null!==x&&null!==E&&(ka=fe.Mf(ka,
+x,E));V+=ka});V+=Y.Yd;return Tb(V)}(K.expand())}function n(K,ca,x,E,A){const H=A.fixed.ka;let S=[1];null!==x&&(S=H.evaluate(x,A).next().toString().split(/\s+/).map(function(N){if(!/^-?[0-9]+$/.test(N))throw new G("xsl:number/@start-at must be a sequence of integers. Offending value: "+N,"XTSE0020");return parseInt(N,10)}));if(ca&&E){K=K.next();if(null===K)return null;try{K=u.integer.R(K.round(0))}catch(N){return null}K=Kb([K])}return K.mapOneToOne(function(N,aa){N=N.isNumeric()?N.toDouble():u.double.df(N.toString());
+if(0>N.toNumber())throw new G(`xsl:number/@value is less than zero (${N.toString()})`,"XTDE0980");try{N=u.integer.R(N.round(0))}catch(ma){throw ma.code="XTDE0980",ma;}aa=aa>=S.length?S[S.length-1]:S[aa];1!==aa&&(N=u.integer.fromNumber(N.toNumber()+(aa-1)));return N})}function F(K){if(1>K||4999=E[A];)ca+=x[A],K-=E[A];return ca}function I(K,
+ca){function x(A){return(A>E?x(Math.floor((A-1)/E)):"")+ca.charAt((A-1)%E)}if(1>K)return K.toString();const E=ca.length;return x(K)}function m(K,ca){return Kx?x.toString():wa(x).toFixed();x.lengthK&&(x="-"+x);return x}function e(K,ca="FODF1310"){const x=Da(K),E={};let A=!0;var H=0;let S;const N=Ha.Be("\\p{Nd}",null);var aa=K.search(N);if(0>aa)A=!1;else{H=Ha.tj().Nd;for(let ia=0;iax[aa]||x[aa]>S+10)throw new G("Picture string mixes digits from different digit families: "+K,ca);}else if(Ha.Be("\\p{N}\\p{L}",null).test(H))throw new G("Picture string is invalid: "+K,ca);const ma=[];H=S-48;x.forEach(function(ia){S<=ia&&ia<=S+10?ma.push(48):ma.push(ia)});K=Ea(ma)}E.aj=A;E.format=K;E.Yf=H;E.Af=S;return E}function k(K,ca){const x=[];Da(K).forEach(function(E){48<=
+E&&57>=E?x.push(E+ca):x.push(E)});return Ea(x)}function v(K,ca,x,E="",A=!1){let H=0;for(let S=0;Sx[0]&&(S=!1);if(S)for(H=1;HK?ca[K]:
+100>K?x[Math.floor(K/10)]+(0===K%10?"":" "+ca[K%10]):1E3>K?D(Math.floor(K/100))+" Hundred"+(0===K%100?"":" and "+D(K%100)):1E6>K?D(Math.floor(K/1E3))+" Thousand"+(0===K%1E3?"":(100>K%1E3?" and ":" ")+D(K%1E3)):1E9>K?D(Math.floor(K/1E6))+" Million"+(0===K%1E3?"":(100>K%1E3?" and ":" ")+D(K%1E6)):K.toString()}function l(K){const ca="Zeroth First Second Third Fourth Fifth Sixth Seventh Eighth Ninth Tenth Eleventh Twelfth Thirteenth Fourteenth Fifteenth Sixteenth Seventeenth Eighteenth Nineteenth".split(" "),
+x=" Twent Thirt Fort Fift Sixt Sevent Eight Ninet".split(" ");return 20>K?ca[K]:100>K?x[Math.floor(K/10)]+(0===K%10?"ieth":"y "+ca[K%10]):1E3>K?D(Math.floor(K/100))+" Hundred"+(0===K%100?"th":" and "+l(K%100)):1E6>K?D(Math.floor(K/1E3))+" Thousand"+(0===K%1E3?"th":(100>K%1E3?" and ":" ")+l(K%1E3)):1E9>K?D(Math.floor(K/1E6))+" Million"+(0===K%1E3?"th":(100>K%1E3?" and ":" ")+l(K%1E6)):K.toString()}function f(K){return 1===K%10&&11!==K%100?"st":2===K%10&&12!==K%100?"nd":3===K%10&&13!==K%100?"rd":"th"}
+function B(K,ca,x="FODF1310"){function E(S,N){let aa="";for(let ma=S.charCodeAt(0),ia=0;iaK?"-":"";if("o"===H)switch(ca.toString()){case "a":case "A":case "i":case "I":break;
+case "Ww":return A+l(Math.abs(K));case "W":return A+l(Math.abs(K)).toUpperCase();case "w":return A+l(Math.abs(K)).toLowerCase();default:return t(K,ca,x)+f(Math.abs(K))}switch(ca.toString()){case "a":return I(K,E("a",26));case "A":return I(K,E("A",26));case "\u03b1":return I(K,E("\u03b1",25));case "\u0391":return I(K,E("\u0391",25));case "i":return F(K);case "I":return F(K).toUpperCase();case "Ww":return A+D(Math.abs(K));case "W":return A+D(Math.abs(K)).toUpperCase();case "w":return A+D(Math.abs(K)).toLowerCase();
+case "\u2460":return m(K,"\u24ea"+E("\u2460",20)+E("\u3251",15)+E("\u32b1",15));case "\u2474":return m(K,"0"+E("\u2474",20));case "\u2488":return 0===K?"\ud83c\udd00":m(K,"0"+E("\u2488",20));case "\u2776":return m(K,"\u24ff"+E("\u2776",10)+E("\u24eb",10));case "\u2780":return 0===K?"\ud83c\udd0b":m(K,"0"+E("\u2780",10));case "\u278a":return 0===K?"\ud83c\udd0c":m(K,"0"+E("\u278a",10));case "\u24f5":return m(K,"0"+E("\u24f5",10));case "\u3220":return m(K,"0"+E("\u3220",10));case "\u3280":return m(K,
+"0"+E("\u3280",10));default:return t(K,ca,x)}}function L(K,ca){return String.fromCharCode(parseInt(K[ca]?K[ca]:P[ca],10))}function y(K,ca){function x(T){[["$gs","grouping separator"],["$es","exponent separator"],["$ds","decimal separator"],["$pc","non-prefix passive character"],["$pp","percent|permille"],["$od","optional digit"],["$md","mandatory digit"],["$ip","integer part"],["$fp","fractional part"]].forEach(function(ha){T=T.replace(ha[0],ha[1])});throw new G("Invalid picture: "+T,"FODF1310");
+}const E={};var A=K.indexOf(ca.af),H=0<=A;const S=ca.Af.charCodeAt(0);let N=0,aa=0,ma=[];const ia=[],Y=[];let V=-1,ka=-1,z=!1,M=!1;var W=-1;let fa=0;var U=H?A:K.length;for(var w=0;w=S&&ZN&&0>V&&(V=w),N++,aa++)):Z===ca.Vg.charCodeAt(0)?(0V&&(V=w,M=!0),aa++):Z===ca.pe.charCodeAt(0)?(0V&&x("$pp before any digit"),0ka&&(ka=w),Z===ca.sd.charCodeAt(0)?E.sd=!0:E.ze=!0):!H&&0<=V&&Z===ca.Dc.charCodeAt(0)&&0>ka?z?(Y.push(Z),0ka&&(ka=w):(Y.push(Z),z=!1,W=-1,0>ka&&(ka=w-1))):(z=!0,W=w):0<=V&&H?x("$pc before $ds"):z&&0===fa?(z=!1,W=-1,Y.push(ca.Dc.charCodeAt(0)),Y.push(Z),0>ka&&(ka=w-1)):0<=V?(Y.push(Z),0>ka&&(ka=w)):ia.push(Z)}if(0=S&&haka?fa++:0<=H||0<=ka?x("$md follows $od or $pc in $fp"):(U++,w++):ha===ca.Vg.charCodeAt(0)?((0<=ka||z)&&x("$od follows $pc or $es"),0>H&&(H=T),w++):ha===ca.pe.charCodeAt(0)?((0<=ka||z)&&x("$gs follows $pc or $es"),
+Z.push(T-A+1)):ha===ca.af.charCodeAt(0)?x("more than one $ds"):ha===ca.sd.charCodeAt(0)||ha===ca.ze.charCodeAt(0)?((0<=ka||z)&&x("$pp follows $pc or $es"),Y.push(ha),ka=T,ha===ca.sd.charCodeAt(0)?E.sd=!0:E.ze=!0):ha===ca.Dc.charCodeAt(0)&&0>ka?z?(Y.push(ha),0ka&&(ka=T):(Y.push(ha),z=!1,W=-1,0>ka&&(ka=T-1))):(z=!0,W=T):z&&0===fa?(z=!1,W=-1,Y.push(ca.Dc.charCodeAt(0)),Y.push(ha),0>ka&&(ka=T-1)):(Y.push(ha),0>ka&&(ka=T))}}0>V&&0===w&&x("mantissa contains no digits");if(0!==Z.length)for(0===Z[0]&&
+x("$gs at beginning of $fp"),A=0;A=E+x?d(new Date(K.getTime()-864E5),ca):Math.floor((x+E-2)/7)+(5>E?1:0)}const q=ac,p=q.Ja,u=La.XS,P={"decimal-separator":"46","grouping-separator":"44",digit:"35","minus-sign":"45",percent:"37","per-mille":"8240","zero-digit":"48","exponent-separator":"101","pattern-separator":"59",infinity:"Infinity",NaN:"NaN"},la={Y:"getUTCFullYear",M:"getUTCMonth",D:"getUTCDate",F:"getUTCDay",H:"getUTCHours",m:"getUTCMinutes",s:"getUTCSeconds",f:"getUTCMilliseconds"},oa={d:b,W:function(K){return d(K,
+!0)},w:function(K){return d(K,!1)},h:function(K){return 13>K.getUTCHours()?0===K.getUTCHours()?12:K.getUTCHours():K.getUTCHours()-12},P:function(K){return 12>K.getUTCHours()?"Am":"Pm"},E:function(K){return 0>K.getUTCFullYear()?"BC":"AD"}};return{rj:function(K,ca){const x=ca.fixed.ka,E=K.level,A=x.da(K,"select"),H=x.da(K,"count");K=x.da(K,"from");return a(E,A,H,K,ca)},sj:function(K,ca){var x=ca.fixed.ka;const E=x.da(K,"value"),A=x.da(K,"format"),H=x.rc(x.da(K,"gpSep"),ca).next(),S=x.rc(x.da(K,"gpSize"),
+ca).next();var N=x.rc(x.da(K,"ordinal"),ca).next();const aa=x.rc(x.da(K,"lang"),ca).next();var ma=K.flags||"";K=x.da(K,"startAt");ma=/1/.test(ma);x=x.evaluate(E,ca);x=n(x,ma,K,!0,ca);N=N?cd.hj(N.toString()):!1;return null===x?Tb("NaN"):c(x,A,H,S,N,aa,ca)},bg:B,Mf:function(K,ca,x){let E="";for(let A=0;AK?!0:0===K?0>1/K:!1;x={af:L(x,"decimal-separator"),pe:L(x,"grouping-separator"),
+Vg:L(x,"digit"),oj:L(x,"minus-sign"),sd:L(x,"percent"),ze:L(x,"per-mille"),Af:L(x,"zero-digit"),Dc:L(x,"exponent-separator"),Eh:L(x,"pattern-separator"),Vi:x.infinity||P.infinity,pj:x.NaN||P.NaN};if(isNaN(K))return x.pj;ca=ca.includes(x.Eh)?ca.split(x.Eh):[ca];if(2K?ca[1]:ca[0],x);if(isFinite(K)){if(0Y&&(K=wa(K.toPrecision(Y)));(Y=V!==K.e)&&(H+=1);1H)||ma&&Y||(S+="."+ka.join("").slice(H))}else throw new G("Empty mantissa","SXJS0004");H=S+aa+g(K.e,ia)}else{N=Math.abs(K);A.sd&&(N=Math.abs(100*K));A.ze&&(N=Math.abs(1E3*K));"Infinity"===
+N+""?H=N+"":H=999999>N?N.toString():wa(N).toFixed();N=H.indexOf(".");0>N&&(N=H.length,0H.indexOf(".")&&(H+=".0")):H=wa(H).round(0,1).toString());aa=H.length-1-N;if(0aa;aa++)N+=String.fromCharCode(x.Af.charCodeAt(0)+aa);
+N+=x.af;aa="";for(ma=0;maK?aa+=ia:Kaa&&(aa=N.length);H=N.substring(0,aa);N=N.substring(aa);if(0A.Zb[0]&&(aa=!1);H=aa?fe.Mf(H,x.pe,A.Zb[0]):v(H,A.Zb,null,x.pe)}0ia||"*"!==ma&&1>ma||"*"!==ia&&"*"!==ma&&ia>ma)throw new G("Invalid width modifier in date/time formatting picture","FOFD1340");}var Y=null;1ma||12aa.length;)aa="0"+aa;Y=Da(aa);aa=parseInt(Ea(Y.reverse()),10);if(!S&&!N&&/^[0-9]$/.test(V))for(;Y.length>V.length;)V+="#";if(S&&"*"!==S){ka=/^([0-9]*)(#*)$/.exec(V);V=ka[1]?ka[1]:"";for(ka=ka[2]?ka[2]:"";S>V.length;)V+="0",ka=ka.slice(0,-1);V+=ka}if(N)for("*"===N&&(N=Y.length);V.lengthV.length;)aa=
+aa.slice(0,-1);S&&"*"!==S||0!==parseInt(aa,10)||(aa="0");ma||(aa=k(aa,ia));S=aa}else{if(/[nN]/.test(N))V="January February March April May June July August September October November December".split(" "),ia="Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),Y="M"===S?V[ka-1]:"F"===S?ia[ka-1]:ka,"F"===S&&ma&&"*"!==ma&&6>ma&&(Y=Y.replace(/(ur)?day$/,""),Y=Y.replace(/nes$/,"s")),"n"===N?Y=Y.toLowerCase():"N"===N&&(Y=Y.toUpperCase()),ma&&"*"!==ma&&(Y=Y.substring(0,ma));else{V=/;/.test(N)?
+N+";":N;Y&&(V+=(";"===V.charAt(V.length-1)?"":";")+Y);Y=B(ka,V,"FOFD1340");"Y"===S&&"-"===Y.charAt(0)&&(Y=Y.substring(1));if("Y"===S&&/[^iIwWnN]/.test(N.charAt(N.length-1))&&(!ia&&2===N.length||2==ma))for(;2ba[va]}const T={"<":"<",">":">","&":"&",'"':""","\n":"
","\r":"
","\t":" "},ha={"<":"<",">":">","&":"&"};return w?U.replace(/&|<|>|"|\n|\r|\t/g,Z(T)):U.replace(/&|<|>/g,Z(ha))}if(W){W="";z=z.split("\x00");for(let U=0;U=z:"US-ASCII"===M.toUpperCase()?127>=z:!0}function n(z,
+M){return function(W){var fa=!0;for(var U=0;U=z.min&&w<=z.max){fa=!1;break}}if(fa)return W;fa="";U=!1;for(w=0;w=T;ha&&(T=W.codePointAt(w));z.ya[T]?(M&&!U&&(fa+="\x00",U=!0),fa+=z.ya[T],ha&&w++):(M&&U&&(fa+="\x00",U=!1),fa+=Z)}return fa}}function F(z){return""===z.uri||"http://www.w3.org/1999/xhtml"===z.uri}function I(z){return["http://www.w3.org/1999/xhtml","http://www.w3.org/2000/svg",
+"http://www.w3.org/1998/Math/MathML"].includes(z)}function m(z,M){return(M={action:["form"],archive:["object"],background:["body"],cite:["blockquote","del","ins","q"],classid:["object"],codebase:["applet","object"],data:["object"],datasrc:"button div input object select span table textarea".split(" "),"for":["script"],formaction:["button","input"],href:["a","area","base","link"],icon:["command"],longdesc:["frame","iframe","img"],manifest:["html"],name:["a"],poster:["video"],profile:["head"],src:"audio embed frame iframe img input script source track video".split(" "),
+usemap:["img","input","object"]}[M.local])&&M.includes(z.local)}function g(z,M,W=null){switch(z.method){case "xml":M=new P(z,M);if(z.version&&"1.0"!==z.version)throw new G("Serializer does not support the requested XML version: "+z.version,"SESU0013");b(z);if(z["undeclare-prefixes"])throw new G("Cannot undeclare prefixes with XML 1.0 serializer","SEPM0010");z.indent&&(M=l(z,M));M=f(z,M);M=B(z,M);M=L(z,M);return D(z,M);case "html":return d(z,M);case "text":return b(z),M=new V(z,M),M=f(z,M),M=B(z,M),
+D(z,M);case "xhtml":return d(z,M);case "json":return b(z),z.indent?new ma(z,M,W):new aa(z,M,W);case "adaptive":return new ia(z,M,W);default:return new Y(z,M)}}function e(z,M,W){function fa(ba,va){va=va.trim();if(["yes","true","1"].includes(va))return!0;if(["no","false","0"].includes(va))return!1;throw new G("Value of "+ba+" must be yes(=true, 1) or no(=false, 0)","SEPM0016");}function U(ba){return function(va,pa){pa=pa.trim();return pa.split(/\s+/).map(function(h){/^Q\{/.test(h)||/:/.test(h)||(h=
+"Q{}"+h);return/^Q\{/.test(h)?h:p.QName.fromString(h,ba).toEQName()})}}function w(ba){return function(va,pa){pa=pa.trim();if(ba.includes(pa))return pa;throw new G("Value of "+va+"("+pa+"): must be one of "+ba.join("|"),"SEPM0016");}}function Z(ba){return function(va,pa){if(ba.test(pa))return pa;throw new G("Invalid value for "+va+": must match the pattern "+ba,"SEPM0016");}}function T(ba,va){return va}function ha(ba,va){va=va.trim();if(/[0-9]+/.test(va))return 1*va;throw new G("Value of "+ba+" must be an integer (Actual value is "+
+sa.showValue(va)+")","SEPM0016");}W={"allow-duplicate-names":fa,"build-tree":fa,"byte-order-mark":fa,"cdata-section-elements":U(W),"doctype-public":Z(/[\sa-zA-Z0-9\-'()+,.:=?;!*#@$_%\/]*/),"doctype-system":Z(/[^']*|[^"]*/),encoding:Z(/[\x21-\x7e]+/),"escape-uri-attributes":fa,"html-version":function(ba,va){if(/[0-9]+(\.[0-9]+)?/.test(va))return 1*va;throw new G("Value of "+ba+" must be a decimal number","SEPM0016");},"include-content-type":fa,indent:fa,"item-separator":T,"json-node-output-method":w(["xml",
+"xhtml","html","text"]),"media-type":T,method:function(ba,va){return function(pa,h){h=h.trim();!/^Q\{/.test(h)&&/:/.test(h)&&(h=p.QName.fromString(h,va).toEQName());if(ba.includes(h))return h;throw new G("Value of "+pa+"("+h+"): must be one of "+ba.join("|"),"SEPM0016");}}("xml xhtml html text json adaptive Q{http://saxonica.com/ns/interactiveXSLT}append-content Q{http://saxonica.com/ns/interactiveXSLT}replace-content".split(" "),W),"normalization-form":w("NFC NFD NFKC NFKD fully-normalized none".split(" ")),
+"omit-xml-declaration":fa,standalone:function(ba,va){return"omit"===va.trim()?null:fa(ba,va)},"suppress-indentation":U(W),"undeclare-prefixes":fa,"use-character-maps":U(W),version:T,"Q{http://saxon.sf.net/}indent-spaces":ha,"Q{http://saxon.sf.net/}line-length":ha,"Q{http://saxon.sf.net/}stylesheet-version":ha};/^\{/.test(z)&&(z="Q"+z);if("string"!==typeof M)throw new G("Value of "+z+" must be supplied as a string","SEPM0016");if(W[z])return W[z](z,M);if(!/^Q\{/.test(z))throw new G("Unknown serialization parameter "+
+z,"SEPM0017");}function k(z,M,W){function fa(T,ha,ba){if(!Array.isArray(ha))throw new G("Value of "+T+" must be an array","SEPM0016");return(ba||[]).concat(ha)}function U(T,ha){if("boolean"!==typeof ha)throw new G("Value of "+T+" must be boolean","SEPM0016");return ha}function w(T,ha){if("number"!==typeof ha)throw new G("Value of "+T+" must be an integer (actual value is "+sa.showValue(ha)+")","SEPM0016");return ha}const Z={"allow-duplicate-names":U,"build-tree":U,"byte-order-mark":U,"cdata-section-elements":fa,
+"escape-uri-attributes":U,"html-version":function(T,ha){if("number"!==typeof ha)throw new G("Value of "+T+" must be a decimal number","SEPM0016");return ha},"include-content-type":U,indent:U,"omit-xml-declaration":U,standalone:function(T,ha){return null===ha?null:U(T,ha)},"suppress-indentation":fa,"undeclare-prefixes":U,"use-character-maps":function(T,ha,ba){ba&&Array.isArray(ba)&&sa.la("Problem with existing character map supplied to overrideParam");if("object"!==typeof ha)throw new G("Value of "+
+T+" must be an object","SEPM0016");if(void 0===ha.ya)throw new G("Value of "+T+" must be a character map object","SEPM0016");(T=ba)?v(T,ha):T=ha;return T},"Q{http://saxon.sf.net/}indent-spaces":w,"Q{http://saxon.sf.net/}line-length":w,"Q{http://saxon.sf.net/}stylesheet-version":w};/^{/.test(z)&&(z="Q"+z);return Z[z]?Z[z](z,M,W):e(z,M.toString())}function v(z,M){M.minz.max&&(z.max=M.max);for(let W in M.ya)M.ya.hasOwnProperty(W)&&(z.ya[W]=M.ya[W])}function t(z,M){let W={};
+z.forEach(function(fa,U){let w=M.Pg[fa];if(!w)throw new G("Unknown character map "+fa,"SEPM0016");0===U?W=w:v(W,w)});return W}function D(z,M){return z["item-separator"]&&"#absent"!==z["item-separator"]?new be(M,z["item-separator"]):new $d(M)}function l(z,M){const W=z["Q{http://saxon.sf.net/}indent-spaces"],fa=z["suppress-indentation"];return Pd("xml"===z.method?new la(W,fa):new E(W,fa),M)}function f(z,M){z["normalization-form"]&&"none"!==z["normalization-form"]&&(M=Pd(new oa(z["normalization-form"]),
+M));return M}function B(z,M){z["use-character-maps"]&&(M=Pd(new K(z["use-character-maps"]),M));return M}function L(z,M){z["cdata-section-elements"]&&(M=Pd(new ca(z["cdata-section-elements"],z.encoding||"UTF-8",z["normalization-form"]&&"none"!==z["normalization-form"]?z["normalization-form"]:null),M));return M}function y(z,M){return void 0===z[M]||z[M]}function b(z){if(z.encoding&&!["UTF-8","UTF-16","ISO-646","ISO-8859-1","US-ASCII"].includes(z.encoding.toUpperCase()))throw new G("Serializer does not support the requested encoding: "+
+z.encoding,"SESU0007");}function d(z,M){var W="xhtml"===z.method;M=W?new H(z,M):new x(z,M);if(W&&z.version&&"1.0"!==z.version)throw new G("Serializer does not support the requested XML version: "+z.version,"SESU0013");if((W=W?z["html-version"]:z["html-version"]||z.version)&&5!==1*W)throw new G("Serializer does not support the requested HTML version: "+W,"SESU0013");b(z);y(z,"indent")&&(M=l(z,M));M=f(z,M);M=B(z,M);M=L(z,M);M=Pd(new A,M);y(z,"escape-uri-attributes")&&(M=Pd(new S,M));y(z,"include-content-type")&&
+(M=Pd(new N(z),M));return D(z,M)}function q(z,M,W,fa=null){function U(ha,ba){switch(ha.nodeType){case 9:case 11:ba.Ea(T);ha=ha.childNodes;for(var va=0;va{w(va,ba)}):ac.X(ha)?U(ha,ba):ba.append(ha,T)}let Z;W||(Z=
+"",W={write:function(ha){Z+=ha}});W.write||sa.la("writer supplied to Serialize.serialize() is not a writeable stream");M||={};M=g(M,W,fa);let T={};z&&w(z,M);M.close();return Z}const p=La.XS;class u extends Od{constructor(z,M){super();this.g=M||null;this.Pa=z}close(){this.g.end&&!this.g.isTTY&&this.g.end()}}class P extends u{constructor(z,M){super(z,M);this.B=this.I=this.xa=this.ra=this.zb=!1;this.eb=[];this.K=[];this.Zd=0;this.encoding=z.encoding||"UTF-8"}Ea(){}za(){}close(){this.I||this.aa();super.close()}na(z,
+M,W){function fa(w){throw new G("When "+w+" is specified, there must only be one top-level element node","SEPM0004");}this.I||(this.aa(),this.Ca(z),this.ra&&!this.xa&&!0===this.Pa.indent&&this.g.write("\n"),this.I=!0);0===this.K.length&&(0"),this.B=!1):this.g.write(""+z.toString()+">")}text(z,M={}){this.I||this.aa();this.B&&this.V();this.g.write(M.DISABLE_ESCAPING?this.j(z,!1):this.j(a(z,!1,!1),!0))}wa(z){this.I||this.aa();this.B&&this.V();this.g.write("\x3c!--"+this.j(z,!1)+"--\x3e")}va(z,M){this.I||this.aa();this.B&&this.V();this.g.write(""+this.j(z,!1)+(0")}append(z,
+M={}){this.text(z.toString(),M)}aa(){this.zb||this.vi()}V(){this.g.write(">");this.B=!1}Ei(z,M){let W=[];for(let fa in z)if(M[fa]!==z[fa]){let U="";"xml"!==fa&&(U=""===fa?' xmlns="'+a(z[fa],!0,!1)+'"':" xmlns:"+fa+'="'+a(z[fa],!0,!1)+'"');""!==U&&W.push(U)}W.sort();W.forEach(fa=>this.g.write(fa))}ie(z,M){if(M){const W=this;M.forEach((fa,U)=>{W.fe(U,fa)})}}fe(z,M){const W=!0===M.kb.USE_NULL_MARKERS;M=M.kb.DISABLE_ESCAPING?this.j(M.value,!1):this.j(a(M.value,!0,W),!0);this.g.write(" "+this.j(z.toString(),
+!1)+'="'+M+'"')}vi(){var z=this.encoding.toUpperCase();this.Pa["byte-order-mark"]&&"UTF-8"===z&&this.g.write("\ufeff");this.zb=!0;z=!0===this.Pa["omit-xml-declaration"]&&"UTF-8"===z;this.ra=!z;let M=this.Pa.standalone;if(z&&void 0!==M&&null!==M)throw new G("Serializer values of 'standalone' and 'omit-xml-declaration' conflict","SEPM0009");z||this.g.write('")}Ca(z){let M=this.Pa["doctype-system"]||
+null,W=this.Pa["doctype-public"]||null;null!==M&&(this.ra&&this.g.write("\n"),this.g.write("\n"):this.g.write(' PUBLIC "'+this.j(W,!1)+'" '+this.j(z,!1)+">\n"),this.xa=!0)}j(z,M){function W(U){if(M)return""+U+";";throw new G("Character "+String.fromCodePoint(U)+" (decimal "+U+") is not available in the chosen encoding","SERE0008");}const fa=this.encoding;return function(U){let w=
+"";var Z=0;const T=U.length;if(0===T)return"";for(;Zha)break;else if(127>ha)ba++;else if(160>ha||8232===ha||55296<=ha&&56320>=ha||!c(ha,fa))break;else ba++}if(ba>=T)return 0===Z?U:w+U.substring(Z,ba);ba>Z&&(w+=U.substring(Z,ba));ha=U.charCodeAt(ba);Z=U.charAt(ba);if(0===ha)throw new G("Null marker","ZZZZ9999");160>ha||8232===ha?w+=M?W(ha):Z:55296<=ha&&56320>=ha?(ha=U.codePointAt(ba++),w+=c(ha,fa)?Z+U.charAt(ba):W(ha)):
+c(ha,fa)||(w+=W(ha));Z=++ba;if(Z>=T)return w}}(z)}}class la extends Qd{constructor(z,M){super();this.I=0;this.fe=z||3;this.Ca="\n ";this.B=this.K=this.V=!1;this.eb=M||null;this.j=-1;this.xa=null;this.zb={}}na(z,M,W,fa={}){this.K||this.B?this.ra():this.aa();if(0>this.j){let U=M.get(p.QName.fromParts("","http://www.w3.org/XML/1998/namespace","space"));U&&"preserve"===U.value&&(this.j=this.I)}this.I++;this.eb&&-1===this.j&&0<=this.eb.indexOf(z.toEQName())&&(this.j=this.I);this.g.na(z,M,
+W,fa);this.K=this.V=!0;this.B=!1}endElement(){this.I--;this.B&&!this.V?this.ra():this.K&&!this.B?this.xa=null:this.aa();this.g.endElement();this.V=!1;this.B=!0;this.K=!1;this.I===this.j-1&&(this.j=-1)}text(z,M={}){const W=!this.V||0<=z.indexOf("\n");0>this.j&&""===Ha.trim(z)&&W?(this.xa=z,this.zb=M):(this.aa(),0<=z.indexOf("\n")&&(this.V=!1),this.g.text(z,M),this.B=this.K=!1)}wa(z,M={}){this.B?this.ra():this.aa();this.g.wa(z,M);this.B=this.K=!1}va(z,M,W={}){this.B?this.ra():this.aa();this.g.va(z,
+M,W);this.B=this.K=!1}ra(){0<=this.j?this.aa():this.Xe()}Xe(){this.xa=null;let z=this.I*this.fe;if(z+1>this.Ca.length){let M=5*this.fe;z+1>this.Ca.length+M&&(M+=z+1);for(let W=0;W=Z.min&&w<=Z.max){fa=!1;break}}if(fa)T=z;else for(fa=0;fa=w;ha&&(w=z.codePointAt(fa));Z.ya[w]?(W||(""!==T&&(this.g.text(T,M),T=""),W=!0),T+=Z.ya[w],ha&&fa++):(W&&(W=Object.assign({},M),W.DISABLE_ESCAPING=!0,W.NO_NORMALIZATION=!0,this.g.text(T,W),T="",W=!1),T+=U)}W?(z=Object.assign({},M),z.DISABLE_ESCAPING=!0,z.NO_NORMALIZATION=!0,this.g.text(T,z)):this.g.text(T,M)}}}class ca extends Qd{constructor(z,
+M,W){super();this.V=z||null;this.encoding=M;this.K=W;this.B=[];this.j="";this.I={};if("fully-normalized"===W)throw new G("Serializer does not support the requested normalization-form: fully-normalized","SESU0011");}na(z,M,W,fa={}){this.flush();this.B.push(z.toEQName());this.g.na(z,M,W,fa)}endElement(){this.flush();this.B.pop();this.g.endElement()}text(z,M={}){0<=this.V.indexOf(0===this.B.length?null:this.B[this.B.length-1])?M.DISABLE_ESCAPING?(this.flush(),this.g.text(z,M)):(this.j+=z,this.I=M):this.g.text(z,
+M)}wa(z,M={}){this.flush();this.g.wa(z,M)}va(z,M,W={}){this.flush();this.g.va(z,M,W)}flush(){if(""!==this.j){const M=this.K?this.j.normalize(this.K):this.j,W=M.length;for(var z=0;zz&&this.aa(M.substring(z,fa));fa"),this.B=!1);this.Xe.includes(z.local.toLowerCase())&&F(z)||this.g.write(""+z.toString()+">")}text(z,M={}){0"))throw new G("A processing instruction in HTML must not contain a > character","SERE0015");this.g.write(""+this.j(z,!1)+" "+this.j(M,!1)+">")}aa(){this.zb||(this.Pa["byte-order-mark"]&&"UTF-8"===this.Pa.encoding&&this.g.write("\ufeff"),this.zb=!0)}ie(z,M){if(M){const W=this;M.forEach((fa,U)=>{z.hasURI("")&&this.Wf(z,U,fa.value)?W.g.write(" "+U.toString()):W.fe(U,fa)})}}Ca(z){let M=this.Pa["doctype-system"]||null,W=this.Pa["doctype-public"]||null;null===M&&null===W?F(z)&&"html"===
+z.local.toLowerCase()&&(this.ra&&this.g.write("\n"),this.g.write("\n"),this.xa=!0):null===M?(z=F(z)&&"html"===z.local.toLowerCase()?z.toString():"html",this.ra&&this.g.write("\n"),this.g.write("\n'),this.xa=!0):super.Ca("html"===z.local.toLowerCase()?z:p.QName.fromParts("","","html"))}Wf(z,M,W){M=M.local.toLowerCase();z=z.local.toLowerCase();return M===W.toLowerCase()&&(this.Zc[z]&&this.Zc[z].includes(M)||this.Zc["*"].includes(M))}}
+class E extends la{constructor(z,M){super(z,M);this.Wf="pre script style textarea title xmp".split(" ");this.ie="a abbr acronym applet area audio b basefont bdi bdo big br button canvas cite code data datalist del dfn em embed font i iframe img input ins kbd label map mark math meter noscript object output picture progress q ruby s samp script select small span strike strong sub sup svg template textarea time tt u var video wbr".split(" ");this.ta=this.Zc=!1;this.Zd=[]}na(z,M,W,fa={}){this.Zc=this.ie.includes(z.local.toLowerCase())&&
+F(z);this.K||this.B?this.ra():this.aa();this.I++;0>this.j&&this.Wf.includes(z.local.toLowerCase())&&F(z)&&(this.j=this.I);this.eb&&-1===this.j&&0<=this.eb.indexOf(z.toEQName())&&(this.j=this.I);this.g.na(z,M,W,fa);this.K=this.V=!0;this.Zc=this.ta=this.B=!1;this.Zd.push(z)}endElement(){let z=this.Zd.pop();this.I--;this.B&&!this.V?this.ra():this.aa();this.g.endElement();this.V=!1;this.B=!0;this.K=!1;this.ta=this.ie.includes(z.local.toLowerCase())&&F(z);this.I===this.j-1&&(this.j=-1)}text(z,M={}){super.text(z,
+M);0>this.j&&""===Ha.trim(z)||(this.ta=!1)}wa(z,M={}){super.wa(z,M);this.ta=!1}va(z,M,W={}){super.va(z,M,W);this.ta=!1}ra(){0<=this.j||this.Zc||this.ta?this.aa():this.Xe()}}class A extends Qd{na(z,M,W,fa={}){for(let U in W)I(W[U])&&delete W[U];I(z.uri)&&(""!==z.prefix&&(z=p.QName.fromParts("",z.uri,z.local)),W[""]=z.uri);M.forEach((U,w)=>{I(w.uri)&&(W[w.prefix]=w.uri)});super.na(z,M,W,fa)}}class H extends P{constructor(z,M){super(z,M);this.ta="area base br col embed hr img input link meta param source track wbr".split(" ")}endElement(){this.K.pop();
+let z=this.eb.pop();this.B&&this.ta.includes(z.local)&&F(z)?(this.g.write(" />"),this.B=!1):(this.B&&super.V(),this.g.write(""+z.toString()+">"))}text(z,M={}){(this.I||""!==Ha.trim(z))&&super.text(z,M)}Ca(z){let M=this.Pa["doctype-system"]||null;null===M&&F(z)&&"html"===z.local.toLowerCase()?(this.ra&&this.g.write("\n"),this.g.write("\n"),this.xa=!0):null!==M&&super.Ca(z)}}class S extends Qd{na(z,M,W,fa){let U=!1;M.forEach((w,Z)=>U=U||m(z,Z));if(U){const w=new de;M.forEach((Z,
+T)=>{if(m(z,T)){const ha=cd.escape(Z.value.normalize("NFC"),ba=>32>ba||126=U||127<=U&&159>=U||!c(U,M)?W+("\\u"+("0000"+U.toString(16).toUpperCase()).slice(-4)):W+w}}return W}ta(z){let M='"';if(this.ya){const w=this.ya;let Z="",T=!1;var W=!0;for(var fa=0;fa=w.min&&U<=w.max){W=!1;break}}if(W)Z=z;else for(W=0;W=U;ha&&(U=z.codePointAt(W));w.ya[U]?(T||(""!==Z&&(M+=this.Ca(Z),Z=""),T=!0),Z+=w.ya[U],ha&&W++):(T&&
+(M+=Z,Z="",T=!1),Z+=fa)}M=T?M+Z:M+this.Ca(Z)}else M+=this.Ca(z);return M+'"'}zb(z){function M(U){switch(U.length){case 0:fa.g.write("null");break;case 1:W(U[0]);break;default:throw new G("Cannot output a sequence of length "+U.length+" as JSON","SERE0023");}}function W(U){var w=La.XS;if(La.pa(U))if(w.boolean.matches(U))fa.g.write(U.toString());else if(w.numeric.matches(U)){U=U.toString();if(["NaN","INF","-INF"].includes(U))throw new G("Cannot output INF or NaN as JSON","SERE0020");fa.g.write(U)}else fa.g.write(fa.ta(U.toString()));
+else if(ac.X(U)){w=Object.assign({},fa.I);w.method=w["json-node-output-method"]||"xml";w["item-separator"]=null;w["omit-xml-declaration"]=!0;w.encoding="UTF-8";const Z=new ka;q(U,w,Z,fa.ra);fa.g.write(fa.ta(Z.toString()))}else if(cd.isArray(U))if(U=U.value,0===U.length)fa.g.write("[]");else{fa.V("[");M(U[0]);for(w=1;w{Z?Z=!1:fa.aa();const ba=fa.ta(ha.k.toString());if(!fa.I["allow-duplicate-names"]){if(T[ba])throw new G("Duplicate key '"+
+ba+"' in serialized JSON map","SERE0022");T[ba]=!0}fa.g.write(ba);fa.eb();M(ha.v)});fa.K("}")}else throw new G("Cannot output "+sa.showValue(U)+" as JSON","SERE0021");}const fa=this;M(z)}V(z){this.g.write(z)}K(z){this.g.write(z)}aa(){this.g.write(",")}eb(){this.g.write(":")}}class ma extends aa{constructor(z,M,W){super(z,M,W);this.j=0;this.xa=z["Q{http://saxon.sf.net/}indent-spaces"]||3}V(z){super.V(z);this.j++;this.g.write("\n".padEnd(this.j*this.xa+1," "))}K(z){this.j--;this.g.write("\n".padEnd(this.j*
+this.xa+1," "));super.K(z)}aa(){super.aa();this.g.write("\n".padEnd(this.j*this.xa+1," "))}eb(){this.g.write(": ")}}class ia extends Sd{constructor(z,M,W){super(W);this.I=z;this.g=M;this.ra=W;this.ya=z["use-character-maps"]||null}close(){function z(T,ha){for(let ba in["fn","math","map","array","xs"])if(Zb.withPrefix[ba]===T)return ba+":"+ha;return"Q{"+T+"}"+ha}function M(T){return U.ya?n(U.ya,!1)(T):T}function W(T,ha){if(1===T.length)fa(T[0],ha);else{ha.write("(");let ba=!0;for(let va=0;va{pa?pa=!1:ha.write(",");fa(h.k,ha);ha.write(":");W(h.v,ha)});ha.write("}")}else T instanceof
+ad.XdmFunction?T.local?ha.write(z(T.uri,T.local)+"#"+T.arity):ha.write("(anonymous function)#"+T.arity):ha.write("JS: "+sa.showValue(T))}const U=this;let w=this.result(),Z=!0;for(let T=0;TZ(this.g));this.B=!0;this.pending=[]}super.na(z,M,W,fa)}text(z,M={}){this.B?super.text(z,M):this.pending.push(function(W){W.text(z,M)})}wa(z,M={}){this.B?super.wa(z,M):
+this.pending.push(function(W){W.wa(z,M)})}va(z,M,W={}){this.B?super.va(z,M,W):this.pending.push(function(fa){fa.va(z,M,W)})}append(z,M={}){this.B?super.append(z,M):this.pending.push(function(W){W.append(z,M)})}za(){this.B?super.za():this.pending.push(function(z){z.za()})}close(){this.B||(this.j.method="xml",this.g=g(this.j,this.I),this.pending.forEach(z=>z(this.g)));super.close()}}class V extends u{constructor(z,M){super(z,M);this.j=!1}text(z){this.j||this.B();this.g.write(z)}append(z){this.j||this.B();
+this.g.write(z.toString())}B(){this.Pa["byte-order-mark"]&&"UTF-8"===this.Pa.encoding&&this.g.write("\ufeff");this.j=!0}}class ka{constructor(){this.ma=""}write(z){this.ma+=z}toString(){return this.ma}}return{serialize:q,rh:g,StringWriter:ka,parseParamDoc:function(z,M,W=null){function fa(T,ha="SEPM0017"){throw new G("Serialization params: "+T,ha);}function U(T,ha=[]){const ba=ac.ca(T);ac.Ja.Ha(T).forEachItem(function(va){va=ac.ca(va);""!==va.uri||ha.includes(va.local)||fa("attribute @"+va.local+" must not appear on element "+
+ba.toString())})}function w(T,ha){let ba=ac.getAttribute(T,ha,null);null===ba&&fa("attribute @"+ha+" is missing on element "+ac.ca(T).toString());return ba}"serialization-parameters"!==ac.ca(z).local&&fa("root element name must be 'serialization-parameters'",W||"SEPM0017");"http://www.w3.org/2010/xslt-xquery-serialization"!==ac.ca(z).uri&&fa("root element namespace must be http://www.w3.org/2010/xslt-xquery-serialization",W||"SEPM0017");U(z);let Z=[];ac.Fc(z).forEach(function(T){if(ac.hasURI(T,"http://www.w3.org/2010/xslt-xquery-serialization")){var ha=
+ac.ca(T).local;let ba;Z.includes(ha)&&fa("duplicated parameter "+ha,"SEPM0019");Z.push(ha);"use-character-maps"===ha?(U(T),ba={min:0,max:0,ya:{}},ac.Fc(T).forEach(function(va){if(ac.hasURI(va,"http://www.w3.org/2010/xslt-xquery-serialization")&&"character-map"===ac.ca(va).local){U(va,["character","map-string"]);const pa=w(va,"character");1ba.max&&(ba.max=h))}else fa("invalid child of use-character-maps: "+ac.ca(va).toString())}),55296fa&&(fa=T);55296"0"+P.codePointAt(0))}const q=ac.Ja;b=q.Xa(b).expand().reverse();let p="";for(let u=0;up};return function(p,u,P){let la=p[0];u.fixed.ka.Db(P,"i")&&(la=la.filter(function(Y){return!Hd.uc(Y)}));p=Hd.Yb(P,p[1],"compare",u);const oa=Hd.oi(p),K=L.untypedAtomic.matches,
+ca=L.numeric.matches,x=L.double.matches,E=L.float.matches,A=L.anyURI.matches,H=L.string.matches;p=L.duration.matches;const S=L.yearMonthDuration.matches,N=L.dayTimeDuration.matches;u=L.QName.matches;const aa=L.double.R,ma=L.float.R,ia=L.string.R;la=la.mapOneToOne(function(Y){return K(Y)?aa(Y):Y});P=la.next();if(null===P)return Ob;u(P)&&d(b+"() not defined over QName");!p(P)||S(P)||N(P)||d(b+"() not defined over mixed durations");return Pb(m(la,P,function(Y,V){(H(Y)&&ca(V)||H(V)&&ca(Y))&&d("Cannot compare string with numeric");
+(S(Y)&&!S(V)||N(Y)&&!N(V))&&d("Cannot compare mixed durations");if(Hd.uc(V))return x(Y)?aa(V):V;if(Hd.uc(Y))return x(V)?aa(Y):Y;x(V)&&!H(Y)?Y=aa(Y):x(Y)&&!H(V)?V=aa(V):E(V)&&!H(Y)?Y=ma(Y):E(Y)&&!H(V)&&(V=ma(V));A(V)&&H(Y)?V=ia(V):A(Y)&&H(V)&&(Y=ia(Y));try{return q(oa(Y,V))?Y:V}catch(ka){throw ka instanceof G&&"XPTY0004"===ka.code&&(ka.code="FORG0006"),ka;}}))}}function e(b,d){if(2!==d.length&&5!==d.length)throw new G("Wrong number of arguments ("+d.length+") for "+b,"XPST0017");}function k(b,d){b=
+b[0].next();if(null===b)return Ob;if("timezone"===d)return null===b.Fa?Ob:Pb(L.dayTimeDuration.ih(b.Fa));if("seconds"===d)return d=b.proxy(),Wb(d.getUTCSeconds()+d.getUTCMilliseconds()/1E3);b=b.proxy()[d]();"getUTCMonth"===d&&b++;return Ub(b)}function v(b,d){b=b[0].next();return null===b?Ob:5!==d?Ub(jb(b)[d]*kb(b)):Wb(jb(b)[d]*kb(b))}function t(b,d,q){function p(la,oa){return Pb(La.codes[d].fromDate(la,oa))}const u=b[0].next();if(!u)return Ob;q=q.fixed.Jb.getTimezoneOffset();if(b[1]){var P=b[1].next();
+b=null!==P?P.Qa/6E4:null;if(null!==b&&(-840>b||840{u=P.evaluate(p?[u,[la]]:[[la],u],d,q).expand()});return Kb(u)}let l=null,f=null;const B=ac,L=La.XS,y=B.Ja;return{abs:function(b){b=b[0].next();return null===b?Ob:Pb(b.abs())},"accumulator-after":function(b,d,q){b=a(b[0],d,q,"XTDE3340");return Kb(Ld.ei(q,b,ed(d),d))},"accumulator-before":function(b,d,q){b=a(b[0],d,q,"XTDE3340");return Kb(Ld.fi(q,b,ed(d),d))},"adjust-date-to-timezone":function(b,d){return t(b,"AA",d)},"adjust-dateTime-to-timezone":function(b,d){return t(b,"AM",d)},"adjust-time-to-timezone":function(b,
+d){return t(b,"AT",d)},"analyze-string":function(b,d){const q=c(b[0]);var p=d.ja.createDocumentFragment();const u=Zb.Oa,P=d.ja.createElementNS(u,"analyze-string-result");p.appendChild(P);if(""===q)return Pb(P);p=b[1].next().toString();b=b[2]?b[2].next().toString():"";Zd.Of(q,p,b,!1,!1).forEach(function(la){let oa;if(la.Nc){let ca;la=la.groups;oa=d.ja.createElementNS(u,"match");var K=0;for(let x=1;xK&&(K=d.ja.createTextNode(la[0].substring(K,ca)),
+oa.appendChild(K)),K=d.ja.createElementNS(u,"group"),K.setAttribute("nr",x),K.appendChild(d.ja.createTextNode(la[x])),oa.appendChild(K),K=ca+la[x].length);KZd.rf(P,d,u,q,!0,!0));u.close();return Kb(p.Pb)},count:function(b){return Ub(b[0].count())},"current-date":function(b,d){return Pb(L.dd.fromDate(d.fixed.Jb,-d.fixed.Jb.getTimezoneOffset()))},"current-dateTime":function(b,d){return Pb(L.Ed.fromDate(d.fixed.Jb,-d.fixed.Jb.getTimezoneOffset()))},"current-group":function(){throw new G("The current-group() function cannot be invoked dynamicaly",
+"XTDE1061");},"current-grouping-key":function(){throw new G("The current-grouping-key() function cannot be invoked dynamicaly","XTDE1071");},"current-merge-group":function(b,d){if(null===d.Bb)throw new G("There is no current merge group","XTDE3480");if(b[0]){b=b[0].next().value;if(d=d.Bb.groups[b])return Kb(d);throw new G("Unknown merge source "+b,"XTDE3490");}return Kb(d.Bb.items)},"current-merge-key":function(b,d){if(null===d.Bb)throw new G("There is no current merge group","XTDE3510");return Kb(d.Bb.keys)},
+"current-output-uri":function(b,d){b=0===d.ub.length?null:d.ub[d.ub.length-1];return null==b||"function"===d.qa?Ob:Pb(b)},"current-time":function(b,d){return Pb(L.time.fromDate(d.fixed.Jb,-d.fixed.Jb.getTimezoneOffset()))},data:function(b,d){return b[0].mapOneToMany(d.fixed.ka.Tb)},dateTime:function(b){const d=b[0].next();b=b[1].next();if(null===d||null===b)return Ob;let q="";if(null!==d.Fa)if(null===b.Fa)q=db(d);else if(d.Fa!==b.Fa)throw new G("timezones are incompatible ","FORG0008");return Pb(L.dateTime.fromString(d.toString().substring(0,
+10)+"T"+b.toString()+q))},"day-from-date":function(b){return k(b,"getUTCDate")},"day-from-dateTime":function(b){return k(b,"getUTCDate")},"days-from-duration":function(b){return v(b,2)},"deep-equal":function(b,d,q){d=Hd.Yb(q,b[2],"equals",d);return Xb(Fd(b[0],b[1],d))},"default-collation":function(){return Tb(Hd.ad)},"default-language":function(){return Pb(L.language.fromString("en"))},"distinct-values":function(b,d,q){d=Hd.ef(q,b[1],d);const p=Hd.xf(d);return b[0].filter(function(u){if(p.containsKey(u))return!1;
+p.inSituPut(u,!0);return!0})},doc:function(b,d,q){b=Nd.Mg(b,d,q);if(null===b)return Pb(null);try{let p=Nd.Ec(b,d);const u=d.fixed.Ee;u&&(p=u(p));return Pb(p)}catch(p){throw p;}},"doc-available":function(b,d,q){const p=Nd.Mg(b,d,q);return null===p?Xb(!1):Nd.Ih(function(){Nd.Ec(p,d)})},document:function(b,d,q){const p=d.fixed.ka;let u,P;if(b[1]&&(u=B.baseURI(b[1].next()),!u))throw new G("No base URI available for second argument of document()","XTDE1162");u||(P=p.Ia(q,d));const la=d.fixed.Ee;return B.kd(b[0].mapOneToMany(function(oa){const K=
+u?u:B.X(oa)?B.baseURI(oa):P;return p.Tb(oa).mapOneToOne(function(ca){if(null===K)throw new G("No base URI for document('"+ca+"')","XTDE1162");ca=Nd.Ec(qa.Fb(ca.toString(),K),d);null!==la&&(ca=la(ca));return ca})}))},"document-uri":function(b){b=b[0].next();return null!==b&&9===b.nodeType&&b._saxonDocUri?Pb(L.anyURI.fromString(b._saxonDocUri)):Ob},"element-available":function(b,d,q){b=a(b[0],d,q,"XTDE1440","##local").split("}");if(d="http://www.w3.org/1999/XSL/Transform"===b[0].substring(2))null==
+f&&(f=qa.sf("elements")),f[b[1]]||(d=!1);return Xb(d)},"element-with-id":function(b,d){return F(b,d,"element-with-id")},empty:function(b){return Xb(null===b[0].next())},"encode-for-uri":function(b){b=encodeURIComponent(c(b[0])).replace(/[!'()*]/g,function(d){return"%"+d.charCodeAt(0).toString(16).toUpperCase()});return Tb(b)},"ends-with":function(b,d,q){const p=c(b[0]),u=c(b[1]);b=Hd.Yb(q,b[2],"endsWith",d);return Xb(b(p,u))},"environment-variable":function(){return Ob},error:function(b){if(void 0===
+b[0])throw new G("fn:error() invoked","FOER0000");var d=b[0].next();d=d?d.toEQName():"FOER0000";const q=b[1]?c(b[1]):"";d=new G(q,d);b[2]&&(d.errorObject=b[2].next());throw d;},"escape-html-uri":function(b){return Tb(cd.escape(c(b[0]),function(d){return 32>d||126Kb(u.get(p.Tb(P).next())));if(u instanceof $c)return b[0].mapOneToMany(function(P){P=p.Tb(P).next();P=L.numeric.matches(P)?P.toNumber():L.double.R(P).toNumber();return Kb(u.get(P))});sa.la("for-each() function object not instance of XdmFunction | XdmArray | XdmMap")},
+"for-each-pair":function(b,d,q){let p=b[2].expand();if(1!==p.length)throw new G("for-each-pair() must have exactly one function item as the third argument. Supplied length "+p.length,"XPTY0004",q);p=p[0];p instanceof ad.XdmFunction||sa.la("Function object not instance of XdmFunction");let u=[];const P=b[0];b=b[1];let la=P.next(),oa=b.next();for(;la&&oa;)u=u.concat(p.evaluate([[la],[oa]],d,q).expand()),la=P.next(),oa=b.next();return Kb(u)},"function-arity":function(b){b=b[0].next();return Pb(L.integer.fromNumber(b instanceof
+cc||b instanceof $c?1:b.arity))},"function-available":function(b,d,q){let p=!1;const u=a(b[0],d,q,"XTDE1400",Zb.Oa),P=b[1]?b[1].next().toNumber():-1,la=d.fixed.La;Object.keys(la).forEach(function(oa){oa=la[oa];oa.name===u&&oa.actor&&"function"===oa.actor.N&&(0>P?p=!0:(oa=cd.qb(oa.actor,"arg").length,P===oa&&(p=!0)))});p||(b=L.QName.fromEQName(u),null==l&&(l=qa.sf("functions")),p=(d=l[b.uri])&&d[b.local]?"concat"===b.local&&b.uri===Zb.Oa&&(-1===P||2<=P)?!0:0<=P?0<=d[b.local].indexOf(P):!0:!1);return Xb(p)},
+"function-lookup":function(b,d,q){const p=b[0].next();b=b[1].next().toNumber();var u=Jd.find("SaxonJS").XPath;const P=d.ba(!0);P.bb=!0;u=u.getFnSignature(p,b,P);if(!u)return Ob;d=u.isUserFunction?new ad.Ff(u,d):p.uri===Zb.mc?new ad.Bf(u,p,q):new ad.He(u,p,b,q,d);return Pb(d)},"function-name":function(b){b=b[0].next();if(!(b instanceof ad.XdmFunction))throw new G("Input to function-name() is not an XdmFunction ","XXXX9999");return b.jc()&&b.jc().uri!==Zb.zg?Pb(b.jc()):Ob},"generate-id":function(b){b=
+b[0].next();return Tb(b?n(b):"")},"has-children":function(b){return Xb(null!==y.Ka(b[0].next()).next())},head:function(b){return Pb(b[0].next())},"hours-from-dateTime":function(b){return k(b,"getUTCHours")},"hours-from-duration":function(b){return v(b,3)},"hours-from-time":function(b){return k(b,"getUTCHours")},id:function(b,d){return F(b,d,"id")},idref:function(){return Ob},"implicit-timezone":function(b,d){return Pb(L.dayTimeDuration.ih(-d.fixed.Jb.getTimezoneOffset()))},"index-of":function(b,d,
+q){const p=Sb(b[0]),u=b[1].next();b=Hd.Yb(q,b[2],"equals",d);const P=Hd.yi(b);return p.mapOneToOne(function(la){try{return P(la,u)?L.integer.fromNumber(p.position):null}catch(oa){return null}})},innermost:function(b,d,q){const p=d.fixed.ka.Db(q,"p")?b[0]:B.kd(b[0]);return new Mb(function*(){let u=null,P;for(;null!=(P=p.next());)if(u)if(y.$c(P).some(la=>la===u))u=P;else{const la=u;u=P;yield la}else u=P;u&&(yield u)}())},"in-scope-prefixes":function(b){b=b[0].next();return Kb(B.Jc(b).map(function(d){return L.string.fromString(d.prefix)}))},
+"insert-before":function(b){const d=b[1].next().value,q=b[2],p=Sb(b[0]);return 1>d?Qb([q,p]):d>p.last()?Qb([p,q]):p.mapOneToMany(function(u){return p.position===d?Qb([b[2],Pb(u)]):Pb(u)})},"iri-to-uri":function(b){return Tb(cd.escape(c(b[0]),function(d,q){return 32>=d||126"{}|\\^`]/.test(q)}))},"json-doc":function(b,d,q){q=Nd.Te(b,d,q);if(!q)return Ob;q=Nd.Fi(q,d);b=b[1]?b[1].next():null;return Pb(Md.ye(q,b,d))},"json-to-xml":function(b,d,q){const p=d.fixed.ka;var u=b[0].next();if(null===
+u)return Ob;b=b[1]?b[1].next():null;u=Md.wj(u.toString(),b,d);b=d.ja.createDocumentFragment();b.appendChild(u);b._saxonBaseUri=p.Ia(q,d);return Pb(b)},key:function(b,d,q){function p(V){V=N?L.string.R(V):V;return S.containsKey(V)?(V=Kb(S.get(V)),A===E?V:V.filter(function(ka){return null!==y.Xa(ka).filter(function(z){return z===E}).next()})):Ob}function u(V){return{visibility:"PRIVATE",Ya:V,Dh:oa,actor:V,We:V.binds.split(" ").map(function(ka){return parseInt(ka,10)})}}const P=d.fixed.ka;var la=a(b[0],
+d,q,"XTDE1260");const oa=P.me(q,d),K=oa.keys[la];if(!K)throw new G("Unknown key "+la,"XTDE1260");const ca=K.wg,x=P.Db(K.Ld[0],"c");let E,A;if(b[2])E=b[2].next(),B.X(E)&&(A=B.sc(E));else{var H=ed(d);B.X(H)&&(A=E=B.sc(H))}if(!A||9!==A.nodeType&&11!==A.nodeType)throw new G("No containing document for key()","XTDE1270",q);"_saxonIndexes"in A||(A._saxonIndexes={},A._saxonIndexesBC={});q=A._saxonIndexes;let S=q[ca];if("under construction"===S)throw new G("Definition of key "+la+" is circular","XTDE0640");
+let N=!1;if(S)N=A._saxonIndexesBC[ca];else{la=Hd.ef(K.Ld[0],null,d);S=Hd.xf(la,x);q[ca]="under construction";la=function(ka){return Qb([y.self(ka),y.ob(ka),y.Ha(ka)])};H=function(ka){return Qb([y.self(ka),y.Ha(ka)])};const V=function(ka){return Qb([y.self(ka),y.ob(ka)])};for(let ka=0;kaS.get(U).indexOf(w)&&(S.get(U).push(w),1b.length+1&&d.substring(0,b.length)===b&&"-"===d.charAt(b.length))},last:function(b,
+d){fd(d,"XPDY0002","last()");return Ub(d.focus.last())},"load-xquery-module":function(){throw new G("No XQuery processor available","FOQM0006");},"local-name":function(b){b=B.ca(b[0].next());return Tb(b?b.local:"")},"local-name-from-QName":function(b){b=b[0].next();return null===b?Ob:Pb(La.type.NCName.fromString(b.local))},"lower-case":function(b){return Tb(c(b[0]).toLowerCase())},matches:function(b){const d=c(b[0]);var q=b[1].next().toString();b=Ha.yg(b[2]?b[2].next().toString():"");q=Ha.Be(q,b,
+d);return Xb(0<=d.search(q))},max:g("max"),min:g("min"),"minutes-from-dateTime":function(b){return k(b,"getUTCMinutes")},"minutes-from-duration":function(b){return v(b,4)},"minutes-from-time":function(b){return k(b,"getUTCMinutes")},"month-from-date":function(b){return k(b,"getUTCMonth")},"month-from-dateTime":function(b){return k(b,"getUTCMonth")},"months-from-duration":function(b){return v(b,1)},name:function(b){b=B.ca(b[0].next());return Tb(b?b.toString():"")},"namespace-uri":function(b){b=B.ca(b[0].next());
+return Pb(L.anyURI.fromString(b?b.uri:""))},"namespace-uri-for-prefix":function(b){var d=c(b[0]);b=b[1].next();d="xml"===d?Zb.xml:b.lookupNamespaceURI(""===d?null:d);return null!==d?Pb(L.anyURI.fromString(d)):Ob},"namespace-uri-from-QName":function(b){b=b[0].next();return null===b?Ob:Pb(L.anyURI.fromString(b.uri))},nilled:function(b){return(b=b[0].next())&&1===b.nodeType?Xb(!1):Ob},"node-name":function(b){return Pb(B.ca(b[0].next()))},"normalize-space":function(b){b=c(b[0]);return Tb(xa(b))},"normalize-unicode":function(b){if(String.prototype.normalize){const d=
+c(b[0]);b=b[1]?b[1].next().toString().toUpperCase().trim():"NFC";if(["NFC","NFD","NFKC","NFKD"].includes(b))return Tb(d.normalize(b));if(""===b)return Tb(d)}throw new G("normalize-unicode(): not supported on this Javascript platform","FOCH0003");},not:function(b,d){return Xb(!d.fixed.ka.Fd(b[0]))},number:function(b){return Pb(La.XS.numeric.Od(b[0].next()))},"one-or-more":function(b){b=Fb(b[0]);if(null===b.ua())throw new G("Required length >= 1, actual length zero","FORG0004");return b},outermost:function(b,
+d,q){d=d.fixed.ka.Db(q,"p");b=b[0];d||(b=B.kd(b));let p=null;return b.filter(function(u){if(null===p)return p=u,!0;if(y.$c(u).some(P=>P===p))return!1;p=u;return!0})},"parse-ietf-date":function(b){return b[0].mapOneToOne(function(d){function q(E){return 1===E.length?"0"+E:E}function p(){throw new G("Invalid IETF date/time "+d.toString(),"FORG0010");}var u=d.toString().trim().toLowerCase();u=u.replace(/^(monday|tuesday|wednesday|thursday|friday|saturday|sunday|mon|tue|wed|thu|fri|sat|sun),?\s+/,"");
+let P;let la,oa;if(/^[a-z]/.test(u))if(P=/^([a-z]{3})(?:\s*-\s*|\s+)(\d\d\d?\d?)\s+([\d:.]+)\s*([a-z]+|[+\-]\d\d?:?(?:\d\d)?(?:\s*\(\s*[a-z]+\s*\))?)?\s+(\d+)$/,u=P.exec(u),null!==u){var K=u[1];var ca=u[2];oa=u[3];var x=u[4];la=u[5]}else p();else P=/^(\d+)(?:\s*-\s*|\s+)([a-z]{3})(?:\s*-\s*|\s+)(\d\d\d?\d?)\s+([\d:.]+)\s*([a-z]+|[+\-]\d\d?:?(?:\d\d)?(?:\s*\(\s*[a-z]+\s*\))?)?$/,u=P.exec(u),null!==u?(ca=u[1],K=u[2],la=u[3],oa=u[4],x=u[5]):p();2===la.length&&(la="19"+la);K="jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec".indexOf(K||
+"*");0>K&&p();u={ut:"Z",utc:"Z",gmt:"Z",est:"-05:00",edt:"-04:00",cst:"-06:00",cdt:"-05:00",mst:"-07:00",mdt:"-06:00",pst:"-08:00",pdt:"-07:00"};/^[0-9]:/.test(oa)&&(oa="0"+oa);5===oa.length&&(oa+=":00");x&&(x=/([a-z]+)|([+\-]\d\d?:?(?:\d\d)?)(?:\s*\(\s*([a-z]+)\s*\))?$/.exec(x),(!x[3]||x[3]in u)&&(!x[1]||x[1]in u)||p(),x=x[1]?x[1]:x[2],/^[+\-][0-9]((:|$)|[0-9]{2}$)/.test(x)&&(x=x.charAt(0)+"0"+x.substring(1)),x in u?x=u[x]:3===x.length?x+=":00":4===x.length?x+="00":5===x.length&&(x=x.substring(0,
+3)+":"+x.substring(3)));ca=la+"-"+q((K/4+1).toString())+"-"+q(ca)+"T"+oa+(x||"Z");try{return L.dateTime.fromString(ca)}catch(E){throw new G("''"+d.toString()+"'' is not a valid IETF date","FORG0010");}})},"parse-json":function(b,d){const q=b[0].next();if(null===q)return Ob;b=b[1]?b[1].next():null;return Pb(Md.ye(q.toString(),b,d))},"parse-xml":function(b,d,q){b=b[0].next();if(null===b)return Ob;const p=d.fixed.ka;try{const u=qa.parseXmlFromString(b.toString());u._saxonBaseUri=p.Ia(q,d);return Pb(u)}catch(u){throw new G(u.message,
+"FODC0006");}},"parse-xml-fragment":function(b,d,q){const p=d.fixed.ka;return b[0].mapOneToOne(function(u){const P=/^<\?xml(?:\s+version\s*=\s*(['"])1.[0-9]+['"])?\s+encoding\s*=\s*(['"][A-Za-z](?:[A-Za-z0-9._\-])*)['"]\s*\?>/;u=u.toString();if(/^<\?xml/.test(u)&&!P.test(u))throw new G("Invalid XML header for a text declaration","FODC0006");u=u.replace(P,"");let la;try{la=qa.parseXmlFromString(""+u+" ")}catch(K){throw new G(K.message,"FODC0006");}const oa=d.ja.createDocumentFragment();y.Ka(la.documentElement).forEachItem(function(K){oa.appendChild(K)});
+oa._saxonBaseUri=p.Ia(q,d);return oa})},path:function(b){return b[0].mapOneToOne(function(d){function q(p){return y.Qc(p).filter(function(u){return p.nodeType===u.nodeType})}return L.string.fromString(function(p){if([9,11].includes(p.nodeType))return"/";let u="",P=p;for(;P;){p=B.$a(P);if(!p)return[9,11].includes(P.nodeType)?u:"Q{http://www.w3.org/2005/xpath-functions}root()"+u;switch(P.nodeType){case 9:case 11:return u;case 1:const la=B.ca(P);u=`/${la.toEQName()}[${1+q(P).filter(oa=>B.ca(oa).equals(la)).count()}]${u}`;
+break;case 3:case 4:u=`/text()[${1+q(P).count()}]`;break;case 8:u=`/comment()[${1+q(P).count()}]`;break;case 7:u=`/processing-instruction(${P.target})[${1+q(P).filter(oa=>P.target===oa.target).count()}]`;break;case 2:u=`/@${0>P.name.indexOf(":")?P.name:B.ca(P).toEQName()}`;break;default:u=`/namespace::${""!==P.prefix?P.prefix:"*[Q{"+Zb.Oa+'}local-name()=""]'}`}P=p}}(d))})},"prefix-from-QName":function(b){return b[0].mapOneToOne(function(d){return""===d.prefix?null:L.Bg.fromString(d.prefix)})},position:function(b,
+d){fd(d,"XPDY0002","position()");return Ub(d.focus.position)},QName:function(b){var d=b[1].next().value;const q=d.split(":"),p=2===q.length?q[0]:"";b=c(b[0]);if(""!==p&&""===b)throw new G("Prefix but no URI for QName()","FOCA0002");if(2===q.length&&""===p||""!==p&&!Ha.Mb(p))throw new G(d+" not valid for QName()","FOCA0002");d=2===q.length?q[1]:q[0];if(!Ha.Mb(d))throw new G(d+" not valid local name for QName()","FOCA0002");return Pb(L.QName.fromParts(p,b,d))},"random-number-generator":function(b,d){b=
+new cc;b.inSituPut(L.string.fromString("number"),[L.double.fromNumber(Math.random())]);var q=L.QName.fromParts("fn",Zb.Oa,"random-number-generator"),p=Jd.find("SaxonJS").XPath,u=p.getFnSignature(q,0,d);q=new ad.He(u,q,0,{},d);b.inSituPut(L.string.fromString("next"),[q]);q=L.QName.fromParts("saxon",Zb.wb,"permute");u=d.ba();u.bb=!0;p=p.getFnSignature(q,1,u);d=new ad.He(p,q,1,{},d);b.inSituPut(L.string.fromString("permute"),[d]);return Pb(b)},"regex-group":function(b,d){b=b[0].next().toNumber();try{return Tb(d.Nb[b]||
+"")}catch(q){return Tb("")}},remove:function(b){const d=b[1].next().toNumber(),q=Sb(b[0]);return q.filter(function(){return q.position!==d})},replace:function(b){const d=c(b[0]),q=Ha.yg(b[3]?b[3].next().toString():"");let p=0;const u=Ha.Be(b[1].next().toString(),q+"g",null,P=>{p=P});if(u.test(""))throw new G("Regular expression matches zero-length string","FORX0003");b=Ha.si(b[2].next().toString(),q,p);return Tb(d.replace(u,b))},"resolve-QName":function(b){const d=b[1].next();return b[0].mapOneToOne(function(q){try{return B.Cj(d,
+q.toString(),!0)}catch(p){throw p instanceof G&&"FORG0001"===p.code&&(p.code=Ha.uh(q)?"FONS0004":"FOCA0002"),p;}})},"resolve-uri":function(b,d,q){const p=d.fixed.ka;if(b[1]){let u=b[1].next();d=u?u.toString():p.Ia(q,d)}else d=p.Ia(q,d);b=b[0].next();if(null===b)return Ob;b=b.toString();q=B.ld(b);if(null!==d&&(d=d.replace(/^file:\/(?!\/)/,"file:///"),/#/.test(d)))throw new G("Base URI "+d+" contains a fragment identifier","FORG0002");if(!q&&null!==d&&!B.ld(d))throw new G("resolve-uri: invalid URI (base="+
+d+", relative="+b+")","FORG0002");b=q?b:qa.Fb(b,d).toString();return Pb(L.anyURI.fromString(b))},reverse:function(b){return Kb(b[0].expand().slice().reverse())},root:function(b){return b[0].mapOneToMany(d=>y.Xa(d)).filter(d=>!B.$a(d))},round:function(b){return b[0].mapOneToOne(d=>d.round(b[1]?Math.min(b[1].next().value,1E4):0))},"round-half-to-even":function(b){return b[0].mapOneToOne(d=>d.tf(b[1]?Math.min(b[1].next().value,1E4):0))},"seconds-from-dateTime":function(b){return k(b,"seconds")},"seconds-from-duration":function(b){return v(b,
+5)},"seconds-from-time":function(b){return k(b,"seconds")},serialize:function(b,d){function q(P){P.method="xml";P.indent=!1;P["omit-xml-declaration"]=!0}const p=new ge.StringWriter,u={};if(b[1]){const P=b[1].next();if(null===P)q(u);else if(ac.X(P)){if(!ac.lg(P))throw new G("Second argument supplied to serialize() is wrong kind of node","XPTY0004");ge.parseParamDoc(P,u,"XPTY0004")}else{if(!(P instanceof cc))throw new G("Second argument supplied to serialize() does not match required type","XPTY0004");
+const la=function(oa,K,ca,x,E=!1){const A=La.XS.string.fromString(oa);if(P.containsKey(A)){let H=P.get(A);if(0S.push(N));H=S}else throw new G("fn:serialize(): supplied value of "+A+" is invalid","XPTY0004");if(1!==H.length&&!ca&&!E||!H.every(S=>"AZ"===S.code||K.matches(S)))throw new G("fn:serialize(): supplied value of "+A+" is invalid","XPTY0004");u[oa]=E&&0===H.length?null:x(ca?H:"AZ"===H[0].code?K.R(H[0]):H[0])}};"doctype-public doctype-system encoding item-separator json-node-output-method media-type method normalization-form version".split(" ").forEach(oa=>
+la(oa,La.XS.string,!1,K=>K.toString()));"allow-duplicate-names byte-order-mark escape-uri-attributes include-content-type indent omit-xml-declaration undeclare-prefixes".split(" ").forEach(oa=>la(oa,La.XS.boolean,!1,K=>K.toBoolean()));la("standalone",La.XS.boolean,!1,oa=>oa.toBoolean(),!0);la("html-version",La.XS.mb,!1,oa=>oa.toNumber());["cdata-section-elements","suppress-indentation"].forEach(oa=>la(oa,La.XS.QName,!0,K=>{let ca="";for(let x=0;xE instanceof cc))throw new G("fn:serialize(): supplied value of "+K+" is invalid","XPTY0004");ca=ca[0];var x=function(E){return L.string.matches(E)};if(!ca.conforms(x,x,function(E){return 1===E}))throw new G("fn:serialize(): supplied value of "+K+" is invalid","XPTY0004");K=cd.sb(ca,!0);ca={min:0,max:0,ya:{}};for(let E in K)if(K.hasOwnProperty(E)){if(1<
+E.length)throw new G("fn:serialize(): Keys in a character map must all be one-character strings. Found "+E,"SEPM0016");x=E.codePointAt(0);0===ca.min?ca.min=x:xca.max&&(ca.max=x);ca.ya[x]=K[E]}u[oa]=ca}})("use-character-maps")}}else q(u);ge.serialize(b[0].expand(),u,p,d);return Tb(p.toString())},snapshot:function(b,d,q){return b[0].mapOneToOne(function(p){function u(H){if(0la.append(N));0la.append(N));y.ob(ca).forEachItem(N=>la.append(N))},la):Zd.rf(p,d,la,q,!0,!0),E=P.pc.lastChild)},la)}}const P=Vd(d),la=Zd.Gc(P);if(!B.$a(p))return Zd.rf(p,d,la,q,!0,!0),la.close(),Kb(P.Pb).next();const oa=p.nodeType,K=B.ca(p);var ca=p,x=[2,13].includes(oa);x&&(ca=B.$a(ca));la.Ea();let E;const A=y.$c(ca).expand();0
+B.ca(H).equals(K)).next();case 13:return B.Ja.ob(E).filter(H=>B.ca(H).equals(K)).next();default:return E}})},sort:function(b,d,q){const p=Hd.ef(q,b[1],d);let u=cd.Tb;if(b[2]){const P=b[2].next();u=function(la){return P.evaluate([[la]],d,q)}}return Kb(b[0].expand().slice().sort(function(P,la){return b[1]?Id(u(P),u(la),p):Id(u(P),u(la))}))},"starts-with":function(b,d,q){const p=c(b[0]),u=c(b[1]);b=Hd.Yb(q,b[2],"startsWith",d);return Xb(b(p,u))},"static-base-uri":function(b,d,q){return(b=d.fixed.ka.Ia(q,
+d))?Pb(L.anyURI.fromString(b)):Ob},"stream-available":function(){return Xb(!1)},string:function(b,d){d=d.fixed.ka;b=b[0].next();if(!b)return Tb("");if(d.isArray(b)||d.isMap(b)||d.Jd(b))throw new G("Input to string() is a function item ","FOTY0014");return d.Tb(b).mapOneToOne(function(q){return L.string.R(q)})},"string-join":function(b){let d="";const q=b[1]?b[1].next().value:"";let p,u=!0;for(;null!==(p=b[0].next());)u||(d+=q),d+=p.toString(),u=!1;return Tb(d)},"string-length":function(b){return Ub(Da(c(b[0])).length)},
+"string-to-codepoints":function(b){return Kb(Da(c(b[0])).map(L.integer.fromNumber))},subsequence:function(b){const d=Math.round(b[1].next().toNumber()),q=b[2]?d+Math.round(b[2].next().toNumber()):Number.POSITIVE_INFINITY;return new Nb(b[0],d,q)},substring:function(b){var d=Math.round(b[1].next().toNumber());const q=b[2]?d+Math.round(b[2].next().toNumber()):Number.POSITIVE_INFINITY;b=new Mb(c(b[0])[Symbol.iterator]());d=new Nb(b,d,q);return Tb(d.expand().join(""))},"substring-after":function(b,d,q){let p=
+"";const u=c(b[0]),P=c(b[1]);let la;-1!==(la=Hd.Yb(q,b[2],"indexOf",d)(u,P))&&(p=u.substring(la+P.length));return Tb(p)},"substring-before":function(b,d,q){let p="";const u=c(b[0]),P=c(b[1]);let la;-1!==(la=Hd.Yb(q,b[2],"indexOf",d)(u,P))&&(p=u.substring(0,la));return Tb(p)},sum:function(b,d){d=b[0].mapOneToOne(d.fixed.ka.Xh);const q=d.next();if(null===q)return 1===b.length?Ub(0):b[1];try{return mb["a+a"](q,q),Pb(m(d,q,mb["a+a"]))}catch(p){throw p instanceof G&&"XPTY0004"===p.code&&(p.code="FORG0006"),
+p;}},"system-property":function(b,d,q){b=L.QName.fromEQName(a(b[0],d,q,"XTDE1390"));d="";b.uri===Zb.Xc&&(d={version:"3.0",vendor:"Saxonica","vendor-url":"http://www.saxonica.com/","product-name":"SaxonJS","product-version":"2.7","is-schema-aware":"no","supports-serialization":"yes","supports-backwards-compatibility":"yes","supports-namespace-axis":"yes","supports-streaming":"no","supports-dynamic-evaluation":"yes","supports-higher-order-functions":"yes","xpath-version":"3.1","xsd-version":"1.1"}[b.local]);
+b.uri===Zb.wb&&(d=qa.Di()[b.local]);d||="";return Tb(d)},tail:function(b){const d=Sb(b[0]);return d.filter(function(){return 1!==d.position})},"timezone-from-date":function(b){return k(b,"timezone")},"timezone-from-dateTime":function(b){return k(b,"timezone")},"timezone-from-time":function(b){return k(b,"timezone")},tokenize:function(b){var d=c(b[0]);b[1]||(d=xa(d));if(""===d)return Ob;var q=b[1]?b[1].next().toString():"[ \\n\\r\\t]+";q=Zd.Of(d,q,b[2]?b[2].next().toString():"",!1,!0);d=b[1]&&q[0].Nc;
+const p=q[q.length-1];b=b[1]&&p.Nc;q=q.filter(function(u){return!u.Nc}).map(function(u){return u.string});d&&q.unshift(L.string.fromString(""));b&&q.push(L.string.fromString(""));return Kb(q)},trace:function(b,d){const q=b[0].expand();sa.Ma("fn:trace: "+(2===b.length?b[1].next().toString()+": ":"")+sa.showValue(q),1,d.fixed.Ta);return Kb(q)},transform:function(b,d,q){function p(pa){pa=L.string.fromString(pa);return ma.get(pa)}function u(pa,h="FOXT0002"){throw new G(pa,h);}function P(pa,h,C=null){if("matches"in
+h&&"name"in h){if(h.matches(pa))return pa;throw new G(null!==C?`The required item type of ${C} is ${h.name}`:`The required item type is ${h.name}`,"XPTY0004");}return pa}function la(pa,h){if(Ia(pa))return pa;throw new G(`The required item type of ${h} is string|unTypedAtomic|anyURI`,"XPTY0004");}function oa(pa,h,C=Q=>Q){(pa=p(pa))&&(pa=Kb(pa).ua())&&(ia[h]=C(pa))}function K(pa){return function(h){h instanceof cc||u("The value of the option "+pa+" in fn:transform() must be of type map(xs:QName,item()*)",
+"XPTY0004");if(h.conforms(C=>{L.QName.matches(C)||u("The keys of the "+pa+" option in fn:transform() must be of type xs:QName. Supplied value:"+C.toString());return!0},()=>!0,()=>!0))return h}}function ca(pa,h){oa(pa,h,K(pa))}function x(pa){pa.C&&pa.C.forEach(function(h){h.parentNode=pa;x(h)})}function E(pa,h,C){if(!N.N)throw new G("No XSLT processor is available to support fn:transform(). If using SaxonJS2.rt.js, it does not contain an XSLT compiler ","FOXT0001",q);let Q={stylesheetParams:new cc,
+tunnelParams:{},functionParams:{},isDynamicStylesheet:!0,destination:"application",initialMode:"compile-complete",templateParams:{"Q{}options":{noXPath:!1}}};for(let r in h)"compiler.options"===r?Q.tunnelParams["Q{}compiler.options"]=h[r]:Q.templateParams["Q{}options"][r]=h[r];Q.stylesheetParams.inSituPut(La.XS.QName.fromParts("","","staticParameters"),[C]);Q.stylesheetInternal=N;Q.outputProperties={};x(N);"true"===N.relocatable&&(Q.isRelocatableStylesheet=!0);h=H.checkOptions(Q);H.internalTransform(N,
+pa,h);return h.principalResult}function A(pa){pa=S.Tb(pa).expand();if(1la(A(pa),"stylesheet-location").toString());oa("stylesheet-node","stylesheetNode");oa("stylesheet-text",
+"stylesheetText");oa("package-location","packageLocation",pa=>la(A(pa),"package-location").toString());oa("package-node","packageNode");oa("package-text","packageText");let ka=0;"stylesheetLocation stylesheetNode stylesheetText packageLocation packageNode packageText".split(" ").forEach(pa=>{ia[pa]&&ka++});1!==ka&&u("A stylesheet must be supplied as an option to fn:transform(), by exactly one of 'stylesheet-location', 'stylesheet-node', 'stylesheet-text', 'package-location', 'package-node' or 'package-text'");
+oa("source-node","sourceNode");oa("global-context-item","globalContextItem");(b=p("source-node")[0])&&!p("global-context-item")[0]&&B.$a(b)&&(ia.globalContextItem=b.ownerDocument);(b=p("initial-match-selection"))&&0P(pa,L.QName,"initial-template").toEQName());oa("initial-mode","initialMode",function(pa){return["#unnamed","#default"].includes(pa.toString())?pa.toString():P(pa,L.QName,"initial-mode").toEQName()});oa("initial-function",
+"initialFunction",pa=>P(pa,L.QName,"initial-function").toEQName());oa("static-params","staticParams");oa("base-output-uri","baseOutputURI");oa("stylesheet-base-uri","stylesheetBaseURI",pa=>pa.toString());oa("delivery-format","destination",pa=>pa.toString());let z=ia.destination;z&&!["raw","document","serialized"].includes(z)&&u("The value of the delivery-format option to fn:transform() must be one of 'raw', 'document' or 'serialized'. Supplied value is "+z);z||="document";b=(b=p("enable-messages"))&&
+1===b.length?b[0].toBoolean():!1;let M=p("enable-assertions");M=M&&1===M.length?M[0].toBoolean():!1;var W=null,fa=null;if(ia.stylesheetNode){var U=ia.stylesheetNode._saxonBaseUri||"NoStylesheetBaseURI";if(9==ia.stylesheetNode.nodeType)fa=ia.stylesheetNode.cloneNode(!0);else if(11==ia.stylesheetNode.nodeType){fa=qa.createDocument();var w=ia.stylesheetNode.childNodes;for(var Z=0;Z10*Y&&u("No suitable XSLT processor is available; requested XSLT version in fn:transform() is: "+(V/10).toString());ia.sourceNode&&ia.initialSelection&&
+u("Only one of 'source-node' or 'initial-match-selection' must be supplied to fn:transform() for apply-templates invocation");ia.initialTemplate&&ia.initialMode&&u("Only one of 'initial-template' or 'initial-mode' should be supplied to fn:transform()");if(ia.sourceNode){V=ia.sourceNode;var T=V.cloneNode(!0);T._saxonBaseUri=V._saxonBaseUri;T._saxonDocUri=V._saxonDocUri}ia.baseOutputURI||(ia.baseOutputURI="",aa=!0);ca("stylesheet-params","stylesheetParams");ca("template-params","templateParams");ca("tunnel-params",
+"tunnelParams");oa("function-params","functionParams",function(pa){sa.assert(pa instanceof $c);return pa.value});"serialized"===z&&oa("serialization-params","outputProperties",pa=>S.sb(pa,!0));ia.deliverResultDocument=function(){let pa=this;return new ie(z,function(h,C){pa.resultDocuments[h.toString()]="serialized"===z?[La.XS.string.fromString(C)]:ac.X(C)?[C]:null===C?[]:C})};ia.deliverMessage=function(pa){qa.ph()(pa);this.zh.push([pa])};let ha={};V=Kb(p("collections")).ua();null!==V&&(ha=S.sb(V,
+!0));ia.collectionFinder=function(pa){return"undefined"===typeof pa?null:ha[pa]};V=!["raw","serialized"].includes(z);let ba,va;try{x(W);"true"===W.relocatable&&(ia.isRelocatableStylesheet=!0);if(ia.stylesheetNode||ia.packageText||ia.packageNode)ia.stylesheetInternal=W;va=H.checkOptions(ia);H.internalTransform(W,T,va);ba=va.principalResult}catch(pa){if(pa instanceof G&&pa.Le)throw new G(pa.message,pa.code.toString());throw pa;}if(ba&&V){sa.assert(Array.isArray(ba));T=Vd(d);const pa=Zd.Gc(T);pa.Ea();
+ba.forEach(h=>pa.append(h));pa.za();pa.close();ba=T.Pb}Array.isArray(ba)&&1===ba.length&&Array.isArray(ba[0])&&(ba=ba[0]);T=va.resultDocuments[""];if(void 0!==T){if(Array.isArray(ba)?0=m.length){for(;D=g.length){for(;t=e(m[t],g[D])?k(m[t++]):k(g[D++]);return v}function n(m,g){return g.fixed.ka.qb(m,"sortKey").map(function(e){return Hd.Jj(e,g)})}function F(m){return function(g,e){for(let k=0;kk){t={items:[l.item],keys:l.keys,groups:{}};for(k=0;knew Mb(function*(){for(const r of C){const O=r(Q);let R;for(;null!==(R=O.next());)yield R}}())}function n(h){function C(ea){switch(ea){case 1:return"first";case 2:return"second";case 3:return"third";default:return ea+"th"}}h=h.split("|");const Q=h[0],r=h[1],O=""===h[2]?"XPTY0004":h[2],R=h[3];return{required:function(){switch(parseInt(Q,10)){case 0:return C(+r+1)+" argument of "+(""===R?"anonymous function":R+"()");
+case 1:return C(+r+1)+" operand of '"+R+"'";case 9:return"operand of '-'";case 2:return"value in '"+R+"' expression";case 3:return"saxon:context-item"===R?"context item":"value of variable $"+R;case 4:const ea=R.split("/");return"@"+ea[1]+" attribute of "+("LRE"===ea[0]?"a literal result element":ea[0]);case 5:return"result of call to "+(""===R?"anonymous function":"function "+R);case 7:return"result of template "+R;case 6:return C(+r+1)+" sort key";case 8:return"value of parameter $"+R;case 11:return"value of the grouping key";
+case 12:return"result of xsl:evaluate";case 13:return"the context item";case 14:return"the context item for the "+"ancestor ancestor-or-self attribute child descendant descendant-or-self following following-sibling namespace parent preceding preceding-sibling self preceding-or-ancestor".split(" ")[r]+" axis";case 15:return"the value of the "+R+" option";case 17:return"document-order sorter";default:return""}}(),code:O}}function F(h){h=h.trim();if(["true","yes","1"].includes(h))return!0;if(["false",
+"no","0"].includes(h))return!1;throw new G("Value must be yes|true|1 or no|false|0","XTDE0030");}function I(h){if(T.X(h))return Pb(m(h));if(ia(h))return Qb(h.value.map(C=>Kb(C))).mapOneToMany(I);if(V(h))throw new G("Cannot atomize a "+(Y(h)?"map":"function"),"FOTY0013");return Pb(h)}function m(h){const C=ba.string.fromString,Q=ba.untypedAtomic.fromString;switch(h.nodeType){case 9:return Q(h.documentElement.textContent);case 11:case 1:case 3:case 4:return Q(h.textContent||"");case 2:return Q(h.value);
+case 8:return C(h.textContent);case 7:return C(h.textContent);case 13:return C(h.uri);default:throw new G("Unknown node type "+h.nodeType,"SXJS0003");}}function g(h){return Kb(h).mapOneToMany(I).expand()}function e(h){function C(O){throw new G("Effective boolean value is not defined for "+O,"FORG0006");}function Q(){if(null!==h.next())C("an atomic sequence of length > 1");else return!0}var r=h.next();if(null===r)return!1;if(T.X(r))return!0;if(La.pa(r)){if("AB"===r.code)return Q()&&r.toBoolean();if(r.isNumeric())return r=
+r.toNumber(),Q()&&!isNaN(r)&&0!==r;if(Ia(r))return Q()&&0!==r.toString().length;C("type "+La.pd(r.code))}else Y(r)?C("maps"):ia(r)?C("arrays"):V(r)?C("functions"):C("value "+sa.showValue(r))}function k(h,C){const Q=mb["i+i"],r=ba.integer.fromNumber(1);return new Cb(h,O=>{O=Q(O,r);return 0Q.N===C):[]}function t(h,C,Q){h=v(h,"withParam");const r=[new cc,new cc];C.Rb.forAllPairs(R=>r[1].inSituPut(R.k,R.v));const O=C.qa;C.qa="template parameter";
+h.forEach(function(R){const ea=R.name,ua=P(R,"t")?1:0;r[ua].inSituPut(La.XS.QName.fromEQName(ea),d(R)(C).expand())});C.qa=O;Q.Lc=r[0];Q.Rb=r[1]}function D(h){return!/[ \t\r\n]/.test(h)}function l(h,C,Q){if(h){h=h.split(/\r?\n/);for(let O=0;O{try{const R=Q(O).next(),ea=r(O).next();return null===R||null===ea?null:C(R,ea)}catch(R){aa(R,h)}}}function B(h,C){if(C.fixed.staticBaseURI)return C.fixed.staticBaseURI;if(C.fixed.md)return null;for(;;){if(h.baseUri)return h.baseUri;h=h.parentNode;if(!h)return null}}function L(h,C,Q=!1){var r=T.Hc(C.ja).createDocumentFragment();r=T.xc(r);r._saxonBaseUri=B(h,C);const O=C.ba(!1);Q&&(O.ja=C.masterDocument);bd.kj(r,p(h)(O),O);return r}function y(h){const C=
+d(h),Q=q(h),r=h.op;return O=>{const R=C(O),ea=Q(O).expand();O=Hd.he(h.comp,O);return Hd.gc(R,ea,r,O,h)}}function b(h,C){throw new G("The "+h+" construct is not implemented in SaxonJS","SXJS0002",C);}function d(h){return p(h.C[0])}function q(h){return p(h.C[1])}function p(h){if(h){var C=h.ELAB;C||((C=pa[h.N])||sa.la("Unknown expr: "+h.N+" parent="+h.p),C=h.ELAB=C(h));return C}}function u(h,C){h=h.C||[];for(let Q=0;Q{const Q=Vd(C),r=Zd.Gc(Q);Zd.push(h,C,r);r.close();return Kb(Q.Pb)}}function aa(h,C){h instanceof G&&!h.xsltLineNr&&ra(h,C);throw h;}function ma(h,C){function Q(O){return"Context item for template "+
+h.name+" must be "+O}if(ee(C)&&-1===h.flags.indexOf("o"))throw new G(Q("supplied"),"XTTE3090",h);ee(C)||-1!==h.flags.indexOf("s")||(C.focus={});let r=h.cxt;if(r&&!ee(C)&&!fc(r).ia()(ed(C)))throw new G(Q("instance of "+fc(r).toString()),"XTTE0590",h);}function ia(h){return h instanceof $c}function Y(h){return h instanceof cc||h instanceof M}function V(h){return h instanceof ad.XdmFunction||ia(h)||Y(h)}function ka(h){var C=Object.assign(h);C.ELAB=void 0;h.C&&(C.C=h.C.map(Q=>ka(Q)));return C}function z(h,
+C,Q){sa.assert(Array.isArray(h));sa.assert(C instanceof gc);const r=C.$();let O=r.p;if(r.o&&!Ed(r.o)(h.length))throw new G("Supplied value "+sa.showValue(h)+" does not match required cardinality "+r.o+(Q?" in "+Q():""),"XPTY0004");if(0ea.isNumeric()?ea:R.matches(ea)?La.XS.double.R(ea):ea instanceof M?La.XS.double.fromString(ea.value.toString()):ea);else{const ea=La.codes[O],ua=ea.R;"A"!==O&&(h=h.map(Ba=>R.matches(Ba)?
+ua(Ba):Ba instanceof M?ea.fromString(Ba.value.toString()):Ba));["AO","AF"].includes(O)&&(h=h.map(Ba=>Ba.isNumeric()?ea.R(Ba):Ba));"AS"===O&&(h=h.map(Ba=>La.XS.anyURI.matches(Ba)?ea.R(Ba):Ba))}}else if(C.U.Jd())if(["FM","FA"].includes(O))h=U(h);else if(C.U instanceof dd){const R=C.U.ia();h.every(ea=>R(ea))||(h=h.map(ea=>{if(R(ea))return ea;if(ea instanceof ad.XdmFunction){var ua=C.U;const Ba=ua.j.length;ua={minArgs:Ba,maxArgs:Ba,sig:ua.ha(),alphaTree:ua.$()};return new ad.Ag(ua,ea)}return ea}))}if(!C.matches(h))throw new G("Supplied value "+
+sa.showValue(h)+" does not match required type "+C.toString()+(Q?" in "+Q():""),"XPTY0004");}return h}function M(h){this.value=h}function W(h){this.value=h}function fa(h){function C(r){switch(typeof r){case "undefined":return[];case "string":return ba.untypedAtomic.fromString(r);case "number":return ba.double.fromNumber(r);case "boolean":return ba.boolean.fromBoolean(r);case "function":return new M(r);case "object":if(ba.Qf.matches(r)||T.X(r))return r;if(r instanceof $c)return r;if(r instanceof ad.XdmFunction||
+r instanceof cc)return r;if(r instanceof M)return r;if(r instanceof Date)return ba.dateTime.fromString(r.toISOString());if(Array.isArray(r)){const O=[];r.forEach(function(R){O.push(fa(R))});return new $c(O)}return null===r?[]:r instanceof W?r.value:new M(r);default:return new M(r)}}function Q(r){const O=[];r.forEach(function(R){R=C(R);Array.isArray(R)&&0===R.length||O.push(R)});return O}if(Array.isArray(h))return Q(h);h=C(h);return Array.isArray(h)&&0===h.length?[]:[h]}function U(h){function C(r){if(r instanceof
+$c){const O=[];r.value.forEach(R=>O.push(Q(R)));return new $c(O)}if(r instanceof M){const O=r.value;if("object"===typeof O){r=new cc;for(const R in O)if(O.hasOwnProperty(R)){const ea=fa(R)[0],ua=fa(O[R]);r.inSituPut(ea,U(ua))}return r}}return r}function Q(r){const O=[];r.forEach(function(R){R=C(R);Array.isArray(R)&&0===R.length||O.push(R)});return O}sa.assert(Array.isArray(h));return Q(h)}function w(h,C=!1){function Q(O){if(Array.isArray(O))throw new G("convertItem() called for an array","SXJS0004");
+if(null===O)return null;if(ba.string.matches(O)||ba.anyURI.matches(O)||ba.duration.matches(O)||ba.hexBinary.matches(O)||ba.base64Binary.matches(O)||ba.untypedAtomic.matches(O))return O.toString();if(ba.numeric.matches(O))return O.toNumber();if(ba.boolean.matches(O))return O.toBoolean();if(ba.dateTime.matches(O)||ba.dd.matches(O)||ba.Ed.matches(O)||ba.time.matches(O)||ba.oh.matches(O)||ba.nh.matches(O)||ba.mh.matches(O)||ba.lh.matches(O)||ba.kh.matches(O))return O.toString();if(ba.QName.matches(O))return O.toEQName();
+if(T.X(O))return O;if(O instanceof $c){const R=[];0!==O.value.length&&O.value.forEach(function(ea){R.push(w(ea,C))});return R}if(O instanceof cc){if(C){const R={};O.forAllPairs(function(ea){R[ea.k.toString()]=w(ea.v,C)});return R}return new W(O)}return O instanceof W?O:O instanceof M?O.value:new W(O)}function r(O){const R=[];if(0===O.length)return null;if(1===O.length)return Q(O[0]);O.forEach(function(ea){R.push(Q(ea))});return R}return Array.isArray(h)?r(h):Q(h)}function Z(h){return h.mapOneToMany(function(C){return ia(C)?
+Qb(C.value.map(function(Q){return Z(Kb(Q))})):Pb(C)})}const T=ac,ha=T.Ja,ba=La.XS;let va;const pa={acFnRef:function(h){const C=ba.QName.fromEQName(h.name),Q=Jd.find("SaxonJS").XPath;return r=>{r=r.ba(!0);r.bb=!0;if(r=Q.getFnSignature(C,1,r))return r=new ad.Bf(r,C,h),Pb(r);throw new G("Reference to an unknown constructor function "+C+"#1","XPST0017",h);}},among:function(h){const C=d(h),Q=q(h);return r=>{const O=C(r).next();return Q(r).filter(R=>T.isSameNode(R,O))}},analyzeString:N,and:function(h){const C=
+d(h),Q=q(h);return r=>Xb(e(C(r))&&e(Q(r)))},applyImports:N,applyT:N,arith:function(h){const C=mb[h.calc];C||b("arithmetic ("+h.calc+")",h);const Q=f(h,C);return r=>Pb(Q(r))},arith10:function(h){function C(R){R=R.next();return null===R?ba.double.fromNumber(NaN):Ia(R)?ba.double.df(R.toString()):ba.double.R(R)}const Q=d(h),r=q(h),O=mb[h.calc];return R=>Pb(O(C(Q(R)),C(r(R))))},array:function(h){const C=(h.C||[]).map(p);return Q=>{const r=C.map(O=>O(Q).expand());return Pb(new $c(r))}},arrayBlock:function(h){const C=
+(h.C||[]).map(p);return Q=>{const r=C.map(O=>O(Q).expand());return Pb(new $c(r))}},atomic:function(h){const C=La.codes[h.type].fromString(h.val);return()=>Pb(C)},atomSing:function(h){const C=d(h);return h.card?Q=>C(Q).mapOneToMany(I):Q=>{Q=C(Q).mapOneToMany(I);Q=Fb(Q);if(null===Q.ua())throw Q=n(h.diag),new G("The "+Q.required+" is empty",Q.code,h);return Q}},att:N,attVal:function(h){const C=ba.QName.fromEQName(h.name);return Q=>{fd(Q,"XPDY0002","@"+C,h);Q=ed(Q);if(!T.X(Q))throw new G("Context item for 'attVal' must be a node",
+"XPTY0020",h);if(1!==Q.nodeType)return Ob;Q=""===C.uri?Q.hasAttribute(C.local)?Q.getAttribute(C.local):null:C.uri===Zb.xml?Q.hasAttribute("xml:"+C.local)?Q.getAttribute("xml:"+C.local):null:Q.hasAttributeNS(C.uri,C.local)?Q.getAttributeNS(C.uri,C.local):null;return null===Q?Ob:Pb(ba.untypedAtomic.fromString(Q))}},axis:function(h){const C=fc(h.nodeTest||"").ia(),Q=h.name;return r=>{fd(r,"XPDY0002",Q+" axis",h);r=ed(r);if(!T.X(r))throw new G("Context item for "+Q+" axis is not a node - supplied:"+sa.showValue(r),
+"XPTY0020",h);return T.Og[Q](r).filter(C)}},"break":N,callT:function(h){return C=>{const Q=E(h,C,"template"),r=C.ba(!0);r.Bb=null;r.sa=Q;ma(Q.actor,r);t(h,C,r);return d(Q.actor)(r)}},cast:function(h){const C=d(h),Q=P(h,"e"),r=O=>{O=C(O).next();if(null===O){if(Q)return null;throw new G("Empty sequence casting to "+fc(h.as).toString(),"XPTY0004",h);}return O};if(P(h,"a")){const O=rb(h.as),R="AQ"===O.p?K(h,!0):null,ea=La.codes[O.p].R;return ua=>{ua=r(ua);if(null===ua)return Ob;try{var Ba=ea(ua,R);return Pb(Ba)}catch(Fa){if("FORG0001"===
+Fa.code&&h.diag)throw Ba=n(h.diag),new G("Required item type of "+Ba.required+" is "+fc(h.as).toString()+"; supplied value is "+sa.Nh(ua),Ba.code,h);if(null!==Fa.code)throw Fa;throw new G("Failed to cast "+sa.Nh(ua)+" to type "+fc(h.as).toString(),"XPTY0004",h);}}}if(P(h,"l")){const O=La.XS.QName.fromEQName(h.as),R=Tc[O.local].fromString;sa.assert(O.uri===Zb.mc);sa.assert(R);return ea=>{ea=r(ea);if(null===ea)return Ob;ea=Ha.collapse(ea.toString()).split(" ").map(R);if(0===ea.length)throw new G("xs:"+
+O.local+" value must contain at least one token","FORG0001");return Kb(ea)}}if(P(h,"u"))return O=>{O=r(O);return null===O?Ob:La.XS.double.matches(O)||La.XS.mb.matches(O)||La.XS.float.matches(O)?Pb(O):Pb(La.XS.double.R(O))};throw new G("Unknown cast variety "+h.flags);},castable:function(h){const C=d(h),Q=P(h,"e");let r;if(P(h,"a")){const O=rb(h.as),R="AQ"===O.p?K(h,!0):null,ea=La.codes[O.p].R;r=ua=>{ea(ua,R);return!0}}else if(P(h,"l")){h=La.XS.QName.fromEQName(h.as);const O=Tc[h.local].fromString;
+r=R=>0{La.XS.double.R(O);return!0};else throw new G("Unknown castable variety "+h.flags);return O=>{O=C(O);const R=O.next();if(null===R)return Xb(Q);if(null!==O.next())return Xb(!1);O=I(R).next();try{return Xb(r(O))}catch(ea){return Xb(!1)}}},cfn:function(h){const C=h.name,Q=d(h);let r;if("_format-number_1"===C)return r=ke["format-number"],O=>{const R=[Q(O),Tb(h.pic)];h.hasAttribute("format")&&R.push(Tb(h.format));return r(R,
+O,h)};if("_translate_1"===C)return r=ke.translate,O=>{const R=[Q(O),Tb(h.a1),Tb(h.a2)];return r(R,O)};sa.la("Unimplemented: cfn "+C,h)},check:function(h){function C(R){const ea=n(h.diag);throw new G("Required cardinality of "+ea.required+" is "+r[Q]+"; supplied value "+R,ea.code,h);}const Q=h.card,r={"*":"zero or more","+":"one or more","?":"zero or one",0:"zero",1:"exactly one"},O=d(h);return R=>{R=O(R);if("*"===Q)return R;var ea=Fb(R);R=ea.ua();if(null===R){if("?"===Q||"0"===Q)return Ob;C("is empty")}else"0"===
+Q&&C("is not empty (first item "+sa.showValue(R)+")");if("+"===Q)return ea;ea.next();const ua=ea.next();null!==ua&&(ea=ea.count()+2,C("contains "+ea+" items ("+sa.showValue(R)+", "+sa.showValue(ua)+(2{for(let r=0;rC(Q)},comment:N,compareToInt:function(h){const C=h.op,Q=ba.integer.fromString(h.val),r=d(h);return O=>
+{O=r(O);const R=O.next();if(null===R)return Ob;if(Hd.uc(R))return Xb("ne"===C);if(null!==O.next())throw new G("Value comparison only applicable to single values","XPTY0004",h);return Xb(Hd.wf(C,R.compareTo(Q)))}},compareToString:function(h){const C=h.op,Q=d(h),r=ba.string.fromString(h.val);return O=>{const R=Q(O),ea=R.next();if(null===ea)return Ob;if(null!==R.next())throw new G("Value comparison only applicable to single values","XPTY0004",h);return h.comp?(O=Hd.he(h.comp,O),["=","eq","!=","ne"].includes(C)?
+Xb(Hd.Th(C,O.equals(ea,r))):Xb(Hd.wf(C,O.compare(ea,r)))):Xb(Hd.wf(C,ea.compareTo(r)))}},compAtt:N,compElem:N,condCont:function(h){const C=d(h);return Q=>{function r(O){if(T.X(O))switch(O.nodeType){case 9:case 11:case 1:return O.hasChildNodes();default:return""!==m(O).toString()}else return Y(O)?0r(ea)).length}).length:""!==ba.string.R(O).toString()}return C(Q).filter(r)}},condSeq:function(h){function C(r){if(T.X(r)){if([9,
+11].includes(r.nodeType))return!r.hasChildNodes();if(3===r.nodeType||4==r.nodeType)return""===r.nodeValue}else{if(La.pa(r))return""===ba.string.R(r).toString();if(ia(r))return!Z(Pb(r)).some(function(O){return!C(O)})}return!1}const Q=h.C.map(r=>({name:r.N,eval:p(r)}));return r=>{let O=[];const R=[];let ea=!0;Q.map(function(ua){if("onEmpty"===ua.name)ea&&(O=ua.eval(r).expand());else if("onNonEmpty"===ua.name){const Ba=O.length;R.unshift(function(){O.splice.apply(O,[Ba,0].concat(ua.eval(r).expand()))})}else ua.eval(r).forEachItem(function(Ba){C(Ba)||
+(ea=!1);O.push(Ba)})});ea||R.forEach(function(ua){ua()});return Kb(O)}},conditionalSort:function(h){const C=d(h),Q=q(h),r=d(h.C[1]);return O=>e(C(O))?Q(O):r(O)},consume:function(h){throw new G("Stylesheet uses 'consume' which requires streaming","SXJS0002",h);},convert:function(h){const C=h.to,Q=La.codes[C];Q||sa.la("Unknown to-type "+h.to);const r=d(h);return P(h,"p")?O=>r(O).mapOneToOne(R=>La.qg(R,C)):O=>r(O).mapOneToOne(Q.R)},copy:N,copyOf:N,currentGroup:function(h){return C=>{if(C&&C.bd)return Kb(C.bd);
+throw new G("There is no current group","XTDE1061",h);}},currentGroupingKey:function(h){return C=>{if(C&&C.cd)return Kb(C.cd);throw new G("There is no current grouping key","XTDE1071",h);}},cvUntyped:function(h){const C=d(h),Q=La.codes[h.to],r=Q.R,O="string"===Q.name;return R=>C(R).mapOneToOne(function(ea){if(ba.double.matches(ea)&&"float"===Q.name)throw new G("xs:double may not be promoted to xs:float","XTTE0570",h);if(ba.untypedAtomic.matches(ea)||O&&ba.anyURI.matches(ea))try{return r(ea)}catch(ua){if("FODT0001"===
+ua.code||!h.diag)throw ua;ea=n(h.diag);throw new G(ua.message,ea.code,h);}else return ea})},data:function(h){const C=d(h);return Q=>C(Q).mapOneToMany(I)},dbl:function(h){const C=ba.double.fromString(h.val);return()=>Pb(C)},dec:function(h){const C=wa(h.val);return()=>Wb(C)},doc:N,docOrder:function(h){const C=d(h);return Q=>T.kd(C(Q))},dot:function(h){return C=>{fd(C,"XPDY0002",". (dot)",h);return Pb(ed(C))}},elem:N,empty:function(){return()=>Ob},emptyTextNodeRemover:function(h){const C=d(h);return Q=>
+C(Q).filter(r=>!(T.X(r)&&(3===r.nodeType||4===r.nodeType)&&""===r.textContent))},error:function(h){return()=>{throw new G(h.message,h.code,h);}},evaluate:function(h){const C={language:"XSLT",contextType:{o:"1",p:"",code:"1"}},Q=p(u(h,"xpath")),r=p(u(h,"cxt")),O=p(u(h,"sa")),R=p(u(h,"nsCxt")),ea=v(h,"withParam").map(Ba=>({name:ba.string.fromString(Ba.name),eval:d(Ba)})),ua=p(u(h,"wp"));return Ba=>{const Fa=Q(Ba).next().toString();u(h,"cxt");const Pa=r?r(Ba):Ob;let Ua=new cc;ea.forEach(function(ta){Ua.inSituPut(ta.name,
+ta.eval(Ba).expand())});ua&&ua(Ba).next().forAllPairs(function(ta){if(!ba.QName.matches(ta.k))throw new G("Parameter names in xsl:evaluate/@with-params map must be QNames:"+ta.k.toString(),"XTTE3165",h);Ua.inSituPut(ta.k,ta.v)});Ua=Pb(Ua);if(O){var Na=O(Ba).next().toString();if(F(Na))throw new G("SaxonJS does not support schema-aware evaluation","XTDE1665",h);}(Na=h.as)&&(C.requiredType=Na.toString());(Na=h.dxns)&&"http://www.w3.org/1999/xhtml"!==Na.toString()&&(C.xpathDefaultNamespace=Na.toString());
+let Wa={};if(R){Na=R(Ba);var J=Na.next();if(null===J||null!==Na.next()||!T.X(J))throw new G("xsl:evaluate/@namespace-context must evaluate to a single node","XTTE3170",h);Wa[""]="";ac.Jc(J).forEach(ta=>Wa[ta.prefix]=ta.uri);C.xpathDefaultNamespace=Wa[""]}else Wa=la(h);const X={};J=Na=!1;const ja={};var da=u(h,"options");if(da){da=S(da,Ba).next();let ta=ba.string.fromString("var-slots");da.containsKey(ta)&&da.get(ta)[0].forAllPairs(function(Ca){X[Ca.k.toEQName()]=w(Ca.v)});ta=ba.string.fromString("allow-empty");
+da.containsKey(ta)&&(Na=da.get(ta)[0].toBoolean());ta=ba.string.fromString("isStatic");da.containsKey(ta)&&(J=da.get(ta)[0].toBoolean());ta=ba.string.fromString("staticContext");da.containsKey(ta)&&da.get(ta)[0].forAllPairs(function(Ca){ja[Ca.k.toString()]=w(Ca.v,!0)})}C.params=Ua;C.namespaces=Wa;C.slotMap=X;C.allowEmpty=Na;C.staticTyping=!0;C.isStatic=J;C.staticContext=ja;C.dynamicEval=!0;(Na=u(h,"baseUri"))&&(C.staticBaseURI=S(Na,Ba).next().toString());(Na=oa(h,"defaultCollation"))&&(C.defaultCollation=
+Na);return Jd.find("SaxonJS").XPath.evaluateXDM(Fa,Pa,Ba,C)}},every:function(h){const C=parseInt(h.slot,10),Q=d(h),r=q(h);return O=>{const R=Q(O);return Xb(!R.some(function(ea){O.oa[C]=[ea];return!e(r(O))}))}},except:function(h){const C=d(h),Q=q(h);return r=>new Hb(C(r),Q(r),T.rb)},"false":function(){return()=>Xb(!1)},filter:function(h){const C=d(h),Q=q(h);return P(h,"i")?r=>{const O=C(r);r=Q(r).expand();if(1===r.length&&ba.numeric.matches(r[0])){const R=r[0].toNumber();if(O instanceof Kb)return Pb(O.expand()[R-
+1]||null);const ea=Sb(O);return ea.filter(function(){return ea.position===R})}return e(Kb(r))?O:Ob}:r=>{const O=C(r),R=r.ba(!1);R.focus=Sb(O);r=P(h,"p")?function(){const ea=Q(R).expand();return 1===ea.length&&ba.numeric.matches(ea[0])?R.focus.position===ea[0].toNumber():e(Kb(ea))}:function(){return e(Q(R))};return R.focus.filter(r)}},first:function(h){const C=d(h);return Q=>Pb(C(Q).next())},flt:function(h){const C=ba.float.fromString(h.val);return()=>Pb(C)},fn:function(h){const C=ke[h.name];C||b(h.name+
+"()",h);const Q=(h.C||[]).map(p);return r=>{const O=Q.map(R=>R(r));return C(O,r,h)}},fnCoercer:function(h){const C=d(h),Q=ec(h.to),r=Q.U,O={alphaTree:Q.$()};return R=>C(R).mapOneToOne(function(ea){if(!(ea instanceof ad.XdmFunction||ea instanceof $c||ea instanceof cc)){var ua=n(h.diag);throw new G("Required item type of "+ua.required+" is "+Q.toString()+"; supplied value is "+sa.showValue(ea),ua.code,h);}if((r instanceof dd?r.j:[]).length!==(ea instanceof ad.XdmFunction?ea.arity:1))throw ua=n(h.diag),
+new G("Required item type of "+ua.required+" is "+Q.toString()+"; supplied value is "+sa.showValue(ea),ua.code,h);return new ad.Ag(O,ea)})},fnRef:function(h){let C=h.name;C=/^Q{/.test(C)?ba.QName.fromEQName(C):ba.QName.fromParts("",Zb.Oa,C);const Q=parseInt(h.arity,10),r=Jd.find("SaxonJS").XPath;return O=>{var R=O.ba(!0);R.bb=!0;if(R=r.getFnSignature(C,Q,R))return O=R.isUserFunction?new ad.Ff(R,O):C.uri===Zb.mc?new ad.Bf(R,C,h):new ad.He(R,C,Q,h,O),Pb(O);throw new G("Reference to an unknown function and/or arity "+
+C.toEQName()+"#"+Q,"XPST0017",h);}},follows:function(h){const C=f(h,function(Q,r){return ba.boolean.fromBoolean(0Pb(C(Q))},"for":function(h){const C=parseInt(h.slot,10),Q=d(h),r=q(h);return O=>Q(O).mapOneToMany(function(R){O.oa[C]=[R];return r(O)})},forEach:function(h){const C=d(h),Q=q(h);return u(h,"separator")?N(h):r=>{const O=r.ba(!1);O.focus=Sb(C(r));O.ab=null;return O.focus.mapOneToMany(function(){return Q(O)})}},forEachGroup:N,fork:c,functionCall:function(h){b(h.name+
+"()",h)},gc:y,gc10:function(h){let C=d(h),Q=q(h);return r=>{let O=C(r).expand(),R=Q(r).expand();1===O.length&&ba.boolean.matches(O[0])?R=[ba.boolean.fromBoolean(e(Kb(R)))]:1===R.length&&ba.boolean.matches(R[0])?O=[ba.boolean.fromBoolean(e(Kb(O)))]:(O=g(O),R=g(R));r=Hd.he(h.comp,r);const ea=h.op;"="!==ea&&"!="!==ea?(O=Kb(O).mapOneToOne(La.XS.numeric.Od).expand(),R=Kb(R).mapOneToOne(La.XS.numeric.Od).expand()):r=Hd.Ki(r);return Hd.gc(Kb(O),R,ea,r,h,!0)}},gcEE:y,gVarRef:function(h){return C=>{const Q=
+E(h,C),r=Q.actor,O=r.name;if(Q.value===a)throw C=new G("Circularity in global variable "+O,"XTDE0640"),C.Le=!0,C;if(null===Q.value||"undefined"===typeof Q.value){if("globalParam"===r.N){var R=C.fixed.options.Sh,ea=La.XS.QName.fromEQName(O);if(R.containsKey(ea))R=R.get(ea),sa.assert(Array.isArray(R)),ea=ec(r.as||"*"),R=z(R,ea,()=>"stylesheet parameter "+O),sa.assert(Array.isArray(R)),Q.value=R;else{if(P(r,"r"))throw new G("Parameter "+O+" is required","XTDE0050",r);if(P(r,"i"))throw new G("Parameter "+
+O+" cannot be empty","XTDE0700",r);r.C||(Q.value=[])}}if(null===Q.value||"undefined"===typeof Q.value){R=!r.parentNode.parentNode.parentNode;ea=C.ba(!0);ea.qa="variable";ea.ub.push(null);ea.gb={};ea.ab=null;ea.sa=Q;ea.focus=R?Rb(C.fixed.jd):null;try{const ua=d(r);Q.value=a;Q.value=ua(ea).expand()}catch(ua){throw ua instanceof G&&(Q.value=[],ba.QName.fromEQName(O).uri!==Zb.wb+"generated-variable"&&(ua.Le=!0)),ua;}ea.ub.pop()}}return Kb(Q.value)}},homCheck:function(h){const C=d(h);return Q=>{Q=Fb(C(Q));
+const r=Q.ua();if(null===r)return Ob;const O=T.X(r);Q=Q.filter(function(R){if(T.X(R)!==O)throw new G("Cannot mix nodes and atomic values in the result of a path expression","XPTY0018",h);return!0});return O?T.kd(Q):Q}},ifCall:function(h){const C=ba.QName.fromEQName(h.name);if("schedule-action"===C.local){const r=d(h),O=q(h),R=p(h.C[3]);return ea=>{var ua=4===h.C.length;if(4h.C.length||"empty"===h.C[2].N?Na=Wa=J=null:(Na=h.C[2],"bSlot"in Na?(Wa=E(Na,ea,"template"),J=Wa.actor):Wa=J=null);ee(ea)||(Ua.focus=Sb(Pb(ed(ea))),Ua.focus.next());Ua.Bb=null;Ua.sa=Wa;Ua.qa=!1;null===Pa&&null!==J&&ma(J,Ua);null!=Na&&t(Na,ea,Ua);let X,ja;null===J?(X=null,ja=function(){}):(X=d(J),ja=function(){X(Ua).expand()});if(null!==Pa)ua=qa.lj(Pa,function(da){Ua.focus=
+Sb(Pb(da[0]));Ua.focus.next();null!==J&&(ma(J,Ua),ja())},Ba,ea.fixed.Ta);else if(null!==Fa)Fa=Fa.toString().split(" "),Pa=Fa.map(function(da){return qa.Fb(da,cd.Ia(h,ea))}),qa.Kb()?(ua=qa.hi(Pa,ea.fixed.vd,ja,Ba,ea.fixed.Ta),ua=1===Fa.length?ua[Pa[0]]:ua):(Ba=Pa.map(da=>Jd.find("SaxonJS").getResource({location:da,type:"text"}).then(ta=>{try{return ea.fixed.vd[da]=ta,ja(),Promise.resolve(null)}catch(Ca){return ta=Promise.reject(Ca),ea.fixed.Bj.push(ta),ta}})),Ba=Promise.all(Ba),ea.fixed.zd.push(Ba));
+else if(0!==Ba)if(qa.Kb())setTimeout(ja,Ba);else throw new G("ixsl:schedule-action/@wait is not supported on Node.js","SXJS0002");return ua?Pb(ua):Ob}}const Q=(h.C||[]).map(p);return r=>{const O=Q.map(R=>R(r));return va(C.uri,C.local,O,r,h)}},indexedFilter2:function(h){const C=p(u(h,"base")),Q=p(u(h,"use")),r=p(u(h,"search"));return O=>{const R=Hd.he(h.comp,O),ea=O.ba(!1);ea.focus=Sb(C(O));const ua=r(O).expand();return ea.focus.filter(function(){const Ba=Q(ea);return Hd.gc(Ba,ua,"=",R,h).next().toBoolean()})}},
+inlineFn:function(h){const C={sig:h.sType,alphaTree:rb(h.sType)};return Q=>Pb(new ad.ai(C,h,Q))},instance:function(h){const C=d(h),Q=ec(h.of);return r=>{r=C(r).expand();return Xb(Q.matches(r))}},"int":function(h){const C=ba.integer.fromString(h.val);return()=>Pb(C)},intersect:function(h){const C=d(h),Q=q(h);return r=>new Gb(C(r),Q(r),T.rb)},intRangeTest:function(h){const C=d(h);h=h.C;const Q=p(h[1]),r=p(h[2]);return O=>{const R=Q(O).next(),ea=r(O).next();if(!R||!ea)return Xb(!1);const ua=R.toNumber(),
+Ba=ea.toNumber();O=C(O).some(function(Fa){Fa=Fa.value;return Fa>=ua&&Fa<=Ba});return Xb(O)}},is:function(h){const C=f(h,function(Q,r){return ba.boolean.fromBoolean(T.isSameNode(Q,r))});return Q=>Pb(C(Q))},isLast:function(h){const C="1"===h.test;return Q=>Xb(Q.focus.position===Q.focus.last()===C)},iterate:N,javaCall:function(h){const C=ba.QName.fromEQName(h.name),Q=(h.C||[]).map(p);return r=>{const O=Q.map(R=>R(r));return va(C.uri,C.local,O,r,h)}},lastOf:function(h){const C=d(h);return Q=>{const r=
+Fb(C(Q));return r.filter(function(){return null===r.ua()})}},let:function(h){const C=d(h),Q=q(h),r=parseInt(h.slot,10);return O=>{const R=O.qa;O.qa="variable";const ea=C(O).expand();O.qa=R;O.oa[r]=ea;return Q(O)}},literal:c,lookup:function(h){const C=d(h),Q=q(h);return r=>{function O(Na){Ba=Ba.concat(Fa[Na.toString()])}function R(Na){Ba=Ba.concat(Fa.get(Na))}function ea(Na){return function(Wa){if(!ba.integer.matches(Wa))throw new G("Array lookup key must be of type xs:integer; supplied value is "+
+sa.showValue(Wa),"XPTY0004",h);Wa=Wa.toNumber();if(1>Wa||Wa>Na.length)throw new G("Array index ("+Wa+") out of bounds (1 to "+Na.length+")","FOAY0001",h);Ba=Ba.concat(Na[Wa-1])}}const ua=C(r);let Ba=[],Fa;r=Q(r).expand();const Pa=h.tuple;if(null!=Pa){const Na=Pa.split(/\s+/);for(var Ua of r)if(-1===Na.indexOf(Ua.toString()))throw new G("Tuple lookup key must be one of "+Pa+". Supplied key is "+Ua.toString(),"XPTY0004",h);}for(;null!==(Fa=ua.next());)if(cd.isArray(Fa))Ua=ea(Fa.value),r.forEach(Ua);
+else if(cd.isMap(Fa))r.forEach(R);else if(null!=Pa&&cd.vh(Fa))r.forEach(O);else throw new G("The source for a lookup operator (?) must be of type array() or map(); supplied value is "+sa.showValue(Fa),"XPTY0004",h);return Kb(Ba)}},lookupAll:function(h){const C=d(h);return Q=>{function r(ua){R=R.concat(ua)}function O(ua){R=R.concat(ea.get(ua))}Q=C(Q);let R=[],ea;for(;null!==(ea=Q.next());)if(cd.isArray(ea))ea.value.forEach(r);else if(cd.isMap(ea))ea.keys().forEach(O);else throw new G("The source for a lookup operator ('?') must be of type array() or map(); supplied value is "+
+sa.showValue(ea),"XPTY0004",h);return Kb(R)}},lookupTuple:function(h){const C=d(h),Q=h.key;return r=>{r=C(r);let O=[],R;for(;null!==(R=r.next());)if(null!=Q&&cd.vh(R))O=O.concat(R[Q]);else throw new G("The source for a lookupTuple operator (?) must be of type tuple(); supplied value is "+sa.showValue(R),"XPTY0004",h);return Kb(O)}},map:function(h){const C=(h.C||[]).map(p);return Q=>{const r=new cc;let O=null;C.forEach(function(R){if(null===O)O=R(Q).next();else{if(r.containsKey(O))throw new G("Duplicate map constructor entries for key:"+
+sa.showValue(O),"XQDY0137",h);R=R(Q).expand();r.inSituPut(O,R);O=null}});return Pb(r)}},merge:function(h){return C=>le.mj(h,C)},mergeAdj:function(h){const C=d(h);return Q=>{const r=[],O=C(Q);let R=!1,ea;for(;null!==(ea=O.next());){var ua=T.X(ea)&&(3===ea.nodeType||4===ea.nodeType);ua&&""===ea.nodeValue||(R&&ua?(ua=T.Hc(Q.ja),r.push(ua.createTextNode(r.pop().nodeValue+ea.nodeValue))):(R=ua,r.push(ea)))}return Kb(r)}},message:function(h){const C=p(u(h,"terminate")),Q=p(u(h,"error"));return r=>{const O=
+r.qa;r.qa="variable";var R=C(r).next();let ea=Q(r).next().toString();try{ea=ca(h,ea,!0).toEQName()}catch(Pa){ea="Q{http://www.w3.org/2005/xqt-errors}XTMM9000"}let ua;try{ua=F(R.toString())}catch(Pa){throw new G("The terminate attribute of xsl:message must be yes|no|true|false|1|0","XTDE0030",h);}R=Vd(r);const Ba=new $d(R);try{var Fa=Zd.Gc(Ba);Fa.Ea();Zd.push(h.C[0],r,Fa);Fa.za()}catch(Pa){Ba.append(La.XS.string.fromString("xsl:message evaluation at "+sa.location(h)+" failed: "+Pa))}Fa=Kb(R.Pb).next();
+r.fixed.options.Xf||(r.fixed.options.Xf=qa.ph());try{R=ea,r.wc[R]||(r.wc[R]=0),r.wc[R]++,r.fixed.options.Xf(Fa,ea)}catch(Pa){}if(ua)throw sa.Ma(r.getStackTrace(),1,r.fixed.Ta),r=new G("Terminated with "+Fa,ea,h),r.errorObject=Fa,r;r.qa=O;return Ob}},minus:function(h){const C=d(h);return Q=>C(Q).mapOneToOne(r=>r.pf())},namespace:function(h){const C=d(h),Q=q(h);return r=>{const O=C(r).next().toString();r=Q(r).next().toString();if(""!==O&&!Ha.Mb(O))throw new G("Prefix "+O+" is not an NCName","XTDE0920",
+h);if(""===r)throw new G("Namespace is zero-length","XTDE0930",h);if("xmlns"===O)throw new G("Disallowed prefix xmlns","XTDE0920",h);if("http://www.w3.org/2000/xmlns/"===r)throw new G("Disallowed namespace "+r,"XTDE0905",h);if(!D(r))throw new G("Invalid namespace "+r,"XTDE0905",h);if("xml"===O!==(r===Zb.xml))throw new G("The xml namespace prefix and uri can only be used together","XTDE0925",h);return Pb(new bc(O,r))}},nextIteration:N,nextMatch:N,nodeNum:function(h){return C=>fe.rj(h,C)},"null":function(h){return()=>
+Pb(h)},numSeqFmt:function(h){return C=>fe.sj(h,C)},onEmpty:c,onNonEmpty:c,or:function(h){const C=d(h),Q=q(h);return r=>Xb(e(C(r))||e(Q(r)))},origFC:function(h){h.C||(h.C=[]);const C=h.C.map(p);return Q=>{if(!h._target){const R=h.pack,ea=ca(h,h.name,!1).toEQName(),ua=h.C.length,Ba=Q.fixed.La;Object.keys(Ba).forEach(function(Fa){Fa=Ba[Fa];Fa.Dh.name===R&&Fa.name===ea&&Fa.actor&&"function"===Fa.actor.N&&v(Fa.actor,"arg").length===ua&&(h._target=Fa.id)})}const r=Q.fixed.La[h._target],O=C.map(R=>R(Q).expand());
+return A(h,r,O,Q)}},param:function(h){const C=h.name,Q=parseInt(h.slot,10),r=P(h,"t"),O=p(u(h,"select")),R=p(u(h,"conversion"));return ea=>{var ua=r?ea.Rb:ea.Lc,Ba=La.XS.QName.fromEQName(C);if(ua.containsKey(Ba))ua=ua.get(Ba),""!==ec(h.as||"*").$().p&&(ua=U(ua));else if(O&&!P(h,"r"))Ba=ea.qa,ea.qa="xsl:param",ua=O(ea).expand(),ea.qa=Ba;else throw new G("Required parameter $"+C+" not supplied","XTDE0700",h);sa.assert(Array.isArray(ua));ea.oa[Q]=ua;if(R)try{ea.oa[Q]=R(ea).expand()}catch(Fa){throw new G("Supplied value for parameter $"+
+C+" could not be converted to required type","XTTE0590",h);}return Ob}},partialApply:function(h){const C=d(h),Q=[],r=[];let O=0;const R=h.C.length-1;for(let ea=1;ea{const ua=C(ea).next(),Ba=[];for(let Fa=0;FaT.rb(Q,r))});return Q=>Pb(C(Q))},procInst:N,qName:function(h){const C=ba.QName.fromParts(h.pre,h.uri,h.loc);return()=>Pb(C)},range:function(h){const C=ba.integer.fromString(h.from),Q=ba.integer.fromString(h.to);return()=>k(C,Q)},resultDoc:function(h){return C=>{try{if(C.qa)throw new G("Cannot call xsl:result-document while evaluating "+C.qa,"XTDE1480",h);var Q=H(h,C);const r={};let O=function(){};const R=u(h,"format");if(R){let ja=S(R,C).next().toString();
+ja=ca(h,ja,!0).toEQName();const da=Q.ng[ja];if(!da)throw new G("Unknown xsl:output format "+ja,"XTDE1460");let ta,Ca;for(const Ka of da.C){let Qa=Ka.name;"parameter-document"===Qa?ta=Ka.value:"Q{http://saxon.sf.net/}parameter-document-base-uri"===Qa?Ca=Ka.value:r[Qa]="use-character-maps"===Qa?ge.yf(Qa,Ka.value,Q):ge.zf(Qa,Ka.value)}if(ta){const Ka=qa.Fb(ta,Ca);let Qa=Nd.Ec(Ka,C);ge.parseParamDoc(Qa.documentElement,r)}}l(h.global,r,Q);l(h.local,r,Q);for(const ja of h.C){let da=ja.role.replace(/^Q{\}/,
+"");if(!["href","format","content","parameter-document"].includes(da)){"output-version"===da&&(da="version");let ta=S(ja,C).next().toString();ta="use-character-maps"===da?ge.yf(da,ta,Q):ge.zf(da,ta,K(h,!0));"undefined"!==typeof ta&&(r[da]=ge.qf(da,ta,r[da]))}}const ea=u(h,"Q{}parameter-document");if(null!==ea){const ja=S(ea,C).next().toString(),da=qa.Fb(ja,cd.Ia(h,C));let ta=Nd.Ec(da,C);ge.parseParamDoc(ta.documentElement,r)}const ua=C.fixed.Ib,Ba=u(h,"href"),Fa=null===Ba?"":S(Ba,C).next().toString();
+let Pa;Pa=ua?qa.newURL(Fa,ua):T.ld(Fa)?qa.newURL(Fa):Fa;const Ua=Pa.toString();if(C.fixed.Ib&&Ua===C.fixed.Ib.toString()&&1{fd(C,"XPDY0002","/",h);C=ed(C);if(!T.X(C))throw new G("Context item for '/' must be a node","XPTY0020",h);const Q=T.sc(C);if(9!==Q.nodeType&&11!==Q.nodeType)throw new G("Root node for '/' must be a document node",
+"XPDY0050",h);return Pb(T.sc(C))}},sequence:c,slash:function(h){const C=d(h),Q=q(h);return r=>{const O=r.ba(!1);O.focus=Sb(C(r));return O.focus.mapOneToMany(()=>Q(O))}},some:function(h){const C=parseInt(h.slot,10),Q=d(h),r=q(h);return O=>{const R=Q(O);return Xb(R.some(function(ea){O.oa[C]=[ea];return e(r(O))}))}},sort:function(h){const C=Hd.Kj(h);return Q=>{try{return C(Q)}catch(r){if(r instanceof G&&"FOCH0002"===r.code)throw new G(r.message,"XTDE1035",h);if(r instanceof G&&"XPTY0004"===r.code)throw new G(r.message,
+"XTDE1030",h);throw r;}}},sourceDoc:N,str:function(h){const C=h.val;return()=>Tb(C)},subscript:function(h){const C=d(h),Q=q(h);return r=>{var O=C(r);r=Q(r).next();if("ADI"===r.code)r=r.value;else if(r.equals(r.round(0)))r=La.XS.integer.R(r).value;else return Ob;return(O=O.lf(r))?Pb(O):Ob}},supplied:function(h){const C=parseInt(h.slot,10);return Q=>Kb(Q.oa[C])},tail:function(h){const C=parseInt(h.start,10)-1;let Q=d(h);return r=>{let O=C;return Q(r).filter(function(){return 0>=O--})}},tailCallLoop:c,
+to:function(h){const C=d(h),Q=q(h);return r=>{const O=C(r).next();r=Q(r).next();return null===O||null===r||0r(O).mapOneToOne(function(R){if(Q(R))return R;const ea=n(h.diag);throw new G("Required item type of "+ea.required+" is "+C.toString()+"; supplied value is "+sa.showValue(R),ea.code,h);})},"true":function(){return()=>Xb(!0)},"try":function(h){const C=d(h),Q=v(h,"catch");Q.forEach(r=>{const O=r.errors.split(" ").map(R=>
+{if("*"===R)return()=>!0;if(/^\*:/.test(R)){const ua=R.substring(2);return Ba=>Ba.local===ua}if(/}\*$/.test(R)){const ua=R.substring(2,R.length-2);return Ba=>Ba.uri===ua}const ea=ba.QName.fromEQName(R);return ua=>ua.equals(ea)});r.test=1===O.length?O[0]:R=>O.some(ea=>ea(R))});return r=>{try{return Kb(C(r).expand())}catch(O){if(O instanceof G&&!O.Le){r.$e=O;O.xsltLineNr||ra(O,h.C[0]);let R;R=O.code.match("^Q{")?ba.QName.fromEQName(O.code):ba.QName.fromParts("","http://www.w3.org/2005/xqt-errors",O.code);
+for(let ea=0;ea{const r=E(h,Q,"function"),O=C.map(R=>R(Q).expand());return A(h,r,O,Q)}},ufRef:function(h){let C=h.name;C=/^[a-z]+:/.test(C)?ca(h,C,!0):/^Q\{/.test(C)?ba.QName.fromEQName(C):ba.QName.fromParts("",Zb.Oa,C);const Q=parseInt(h.arity,10),r=Jd.find("SaxonJS").XPath;return O=>{const R=r.getFnSignature(C,Q,O);if(R&&
+R.isUserFunction)return O=new ad.Ff(R,O),Pb(O);sa.la("Named user function "+C+"#"+Q+" not found")}},union:function(h){const C=d(h),Q=q(h);return r=>new Eb(C(r),Q(r),T.rb)},useAS:N,valueOf:N,varRef:function(h){const C=parseInt(h.slot,10);return Q=>Kb(Q.oa[C])},vc:function(h){function C(ea){return null===ea?null:ba.untypedAtomic.matches(ea)?ba.string.R(ea):ea}const Q=h.op,r=h.onEmpty,O=d(h),R=q(h);return ea=>{const ua=O(ea),Ba=R(ea),Fa=C(ua.next()),Pa=C(Ba.next());if(null===Fa||null===Pa)return r?Xb("1"===
+r):Ob;if(null!==ua.next()||null!==Ba.next())throw new G("Value comparison only applicable to single values","XPTY0004",h);if(Fa.isNumeric()&&isNaN(Fa.value)||Pa.isNumeric()&&isNaN(Pa.value))return Xb("ne"===Q);ea=Hd.he(h.comp,ea);return["=","eq","!=","ne"].includes(Q)?Xb(Hd.Th(Q,ea.equals(Fa,Pa))):Xb(Hd.wf(Q,ea.compare(Fa,Pa)))}}};M.prototype={value:null,containsKey:function(h){return"undefined"!==typeof this.value[h]},get:function(h){return fa(this.value[h])},inSituPut:function(){throw new G("inSituPut() not allowed for JSValue",
+"SXJS0005");},put:function(){throw new G("put() not allowed for JSValue","SXJS0005");},remove:function(){throw new G("remove() not allowed for JSValue","SXJS0005");},keys:function(){throw new G("keys() not allowed for JSValue","SXJS0005");},forAllPairs:function(){throw new G("forEach() not allowed for JSValue","SXJS0005");},conforms:function(){throw new G("conforms() not allowed for JSValue","SXJS0005");},showValue:function(){return"JSValue "+sa.showValue(this.value)}};W.prototype={value:null,showValue:function(){return"XDMValue "+
+sa.showValue(this.value)}};return{da:u,Ve:t,Tb:I,li:g,Ik:function(){return"ancestor ancestor-or-self attribute child descendant descendant-or-self following following-sibling namespace parent preceding preceding-sibling self preceding-or-ancestor".split(" ")},Tf:ma,qb:v,ti:ka,Uf:z,sb:w,me:H,ig:E,Fd:e,Sa:d,Wg:q,ib:p,escape:function(h,C){let Q="";Da(h).forEach(function(r){const O=Ea([r]);Q+=C(r,O)?encodeURIComponent(O):O});return Q},evaluate:S,rc:function(h,C){return null===h?Ob:S(h,C)},Ai:function(h,
+C,Q,r){const O=ke[h.local];O||b(h.toString()+"()",r);return O(C.map(R=>Kb(R)),Q,r)},Bi:function(h,C,Q,r){return va(h.uri,h.local,C.map(O=>Kb(O)),Q,r)},flatten:Z,hg:oa,Rk:function(h){if("undefined"!==typeof h)return x(h,"module",20)+"#"+x(h,"line",10)},Db:P,Jc:la,isArray:ia,isMap:Y,Jd:V,vh:function(h){return h instanceof me},hj:F,Ef:M,fl:b,Ej:n,Aj:function(h){va=h},pl:aa,Ia:B,xd:U,tg:ca,Xd:K,Xh:function(h){return"AZ"===h.code?ba.double.R(h):h},Oj:D,Ra:fa,Hk:W}}();
+// Input 40
+abstractNode=Node;
+HostPlatform=function(){function a(){Math.trunc=Math.trunc||function(I){return 0>I?Math.ceil(I):Math.floor(I)};Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(I,m){if(null===this||"undefined"==typeof this)throw new TypeError("Array.prototype.findIndex called on null or undefined");if("function"!==typeof I)throw new TypeError("predicate must be a function");let g=Object(this),e=g.length>>>0,k;for(let v=0;vm===I)}});String.prototype.includes||(String.prototype.includes=function(I,m){"number"!==typeof m&&(m=0);return m+I.length>this.length?!1:-1!==this.indexOf(I,m)})}let c=Resources,n;const F={name:"Browser",init:function(){a()},
+inBrowser:function(){return!0},expose:function(I,m){window[m]=I;try{module.exports=I}catch(g){}},getPromise:function(I,m,g,e){return new Promise(function(k,v){let t=new XMLHttpRequest;if(g||e)g?("text"===g?g="text/plain":"json"===g?g="application/json":"xml"===g&&(g="application/xml"),e&&(g=g+";charset="+e),t.overrideMimeType(g)):console.log("Error: cannot specify encoding without a resource type");t.open("GET",I);for(let D in m)m.hasOwnProperty(D)&&t.setRequestHeader(D,m[D]);t.onload=function(){200<=
+this.status&&300>this.status?k({responseText:t.responseText,contentType:t.getResponseHeader("Content-Type")}):v(new G(t.statusText+": "+I,"SXJS0006"))};t.onerror=function(){v(new G("Document fetch failed: "+I,"SXJS0006"))};t.send(null)})},asyncGet:function(I,m,g){let e=new XMLHttpRequest;e.open("GET",I,!0);e.setRequestHeader("Accept","application/xml, text/xml;q=0.9, application/xhtml+xml;q=0.8, */*;q=0.7");0!==g&&(e.timeout=g);e.onload=function(){4===e.readyState&&(200===e.status?m({responseText:e.responseText,
+contentType:e.getResponseHeader("Content-Type")}):m(new G(e.statusText+": "+I,"SXJS0006")))};e.ontimeout=function(){m(new G("Document fetch timeout: "+I,"SXJS0008"))};e.onabort=function(){m(new G("Document fetch aborted: "+I,"SXJS0008"))};e.onerror=function(){m(new G("Document fetch failed: "+I,"SXJS0006"))};e.send(null);return e},addDoc:function(I,m,g,e,k){function v(t){sa.Ma("Add to response pool "+I,2,k);g[I]=t;m(g)}if(!g[I]||g[I]instanceof G)return F.asyncGet(I,v,e);sa.Ma("Doc already in pool "+
+I,2,k);m(g);return null},addMultipleDocs:function(I,m,g,e,k){function v(l){0>=--t&&g(l)}let t=I.length,D={};for(let l=0;lt.responseText)}return m.catch(e=>Promise.reject(new G("Failed to read "+g+"("+e.message+")","SXJS0006"))).then(e=>{65279===e.codePointAt(0)&&(e=e.substring(1));return Promise.resolve(e)})},resolveUri:function(I,m){try{return(m&&null!==m&&""!==m?I&&""!==I?new URL(I,m):new URL(m):new URL(I)).toString()}catch(g){throw new G("Failed URI resolution: href="+I+" base="+m+" -- "+g,"FODC0005");}},baseURL:function(){return window.document.baseURI},getDefaultDeliverMessage:function(){return function(I){let m=
+"";cd.Tb(I).expand().forEach(function(g){m+=(""===m?"":" ")+g.toString()});console.log("xsl:message: "+m)}},isHTMLElement:function(I){return"http://www.w3.org/1999/xhtml"===I.namespaceURI},saxonPrint:function(I){console.log(I)},createDocument:function(){return document.implementation.createDocument("","",null)},setDocURI:function(I,m){I._saxonBaseUri=m;return I},newURL:function(I,m=null){return null!==m?new URL(I,m):new URL(I)},extraProperties:{platform:"Browser"},toUTF8:function(I){return(new TextEncoder).encode(I)},
+fromUTF8:function(I){return(new TextDecoder).decode(I)},globalObject:window};return F}();
+// Input 41
+// Input 42
+function ed(a){return ee(a)?null:a.focus.current}function fd(a,c,n,F=null){if(ee(a))throw new G("Focus for "+n+" is absent",c,F);}function gd(a){a.bd=null;a.cd=null;a.Bb=null}function ee(a){return!a.focus||!a.focus.current}
+class ne{constructor(){this.depth=0;this.masterDocument=this.j=this.ja=this.sa=this.focus=null;this.qa=!1;this.ub=[];this.fixed={yd:null,zd:[],Ta:null};this.Lc=new cc;this.Rb=new cc;this.ab=null;this.gb={};this.Bb=this.cd=this.bd=this.je=this.$e=null;this.Nb=[];this.Ge=null;this.oa=[];this.wc={};this.g=null}toString(){let a="{";this.Lc.forAllPairs(c=>a+=c.k+":("+c.v+"),");a+="}";return"context: "+ed(this)+" localParams: "+a}ba(a){const c=new ne;c.depth=this.depth+1;c.focus=this.focus;c.sa=this.sa;
+c.ja=this.ja;c.masterDocument=this.masterDocument;c.gb=this.gb;c.ab=this.ab;c.$e=this.$e;c.bd=this.bd;c.Nb=this.Nb;c.cd=this.cd;c.fixed=this.fixed;c.qa=this.qa;c.ub=this.ub;c.je=this.je;c.Ge=this.Ge;c.wc=this.wc;c.g=this;a?(c.Lc=new cc,c.Rb=new cc,c.oa=[],c.Bb=null):(c.Lc=this.Lc,c.Rb=this.Rb,c.oa=this.oa,c.Bb=this.Bb);return c}createElement(a,c){const n=ac.Hc(this.ja),F=n.documentElement;""===a&&F&&qa.$b(F)?c=n.createElement(c):"http://www.w3.org/1999/xhtml"===a&&F&&qa.$b(F)?(a=c.indexOf(":"),c=
+n.createElement(-1===a?c:c.substring(a+1))):c=n.createElementNS(a,c);return c}getStackTrace(){let a="";ee(this)||(a=" Processing "+sa.showValue(this.focus.current)+"\n");try{let c=this.sa.actor,n;"mode"===c.N?(n="template rule",c=this.ab.action):n=c.N+" "+c.name;a+=" at "+n+" in "+cd.hg(c,"module")+"#"+cd.hg(c,"line")}catch(c){a=""}this.g&&(a+="\n"+this.g.getStackTrace());return a}};
+// Input 43
+var oe={},pe={};oe[0]="";oe[1]="|";oe[2]="/";oe[3]="@";oe[48]="~";oe[4]="[";oe[5]="(";oe[6]="=";oe[7]=",";oe[8]="//";oe[9]="or";oe[10]="and";oe[11]=">";oe[12]="<";oe[13]=">=";oe[14]="<=";oe[15]="+";oe[16]="-";oe[299]="-";oe[17]="*";oe[18]="div";oe[19]="mod";oe[20]="is";oe[21]="$";oe[22]="!=";oe[40]="!";oe[30]="||";oe[23]="intersect";oe[24]="except";oe[25]="return";oe[26]="then";oe[27]="else";oe[29]="to";oe[31]="in";oe[32]="some";oe[33]="every";oe[34]="satisfies";oe[35]="(";oe[36]="";
+oe[37]="if(";oe[38]="<<";oe[39]=">>";oe[41]="::";oe[42]=":*";oe[44]="#";oe[45]="instance of";oe[46]="cast as";oe[47]="treat as";oe[50]="eq";oe[51]="ne";oe[52]="gt";oe[54]="ge";oe[53]="lt";oe[55]="le";oe[56]="idiv";oe[57]="castable as";oe[58]=":=";oe[71]="as";oe[75]=":";oe[76]="=>";oe[79]="otherwise";oe[80]="andAlso";oe[81]="orElse";oe[201]="";oe[202]="";oe[203]="]";oe[204]=")";oe[205]=".";oe[206]="..";oe[207]="*";oe[208]="";oe[209]="";oe[69]="()";
+oe[211]="for";oe[70]="<*:local-name>";oe[213]="?";oe[59]="{";oe[60]=" {";oe[215]="}";oe[216]="let";oe[299]="-";function qe(a,c){pe[a]=c;oe[c]=a}qe("instance of",45);qe("cast as",46);qe("treat as",47);qe("castable as",57);
+// Input 44
+var re={Nk:function(){return null}};for(const a in Zb)re[a.toUpperCase()]=Zb[a];re.sk=Zb.mc;re.ci=Zb.Xc;function se(a){a=a.charCodeAt(0);return 65<=a&&90>=a||97<=a&&122>=a}var te=Ha.Mb;function ue(a){const c=a.charCodeAt(0);return se(a)||48<=c&&57>=c}function ve(a,c="XPST0003"){return new G(a,c)}function we(a="Illegal Argument"){return new G(a,"XPST0003")};
+// Input 45
+function xe(a,c){a.xa=c;0===c?(a.V=-1,a.ta="",a.J=-1):c===ye&&(a.V=204,a.ta=")",a.J=204)}
+function ze(a){a.V=a.j;a.ta=a.K;a.K=null;for(a.aa=a.g;;){if(a.g>=a.I){a.j=0;break}var c=a.B.charAt(a.g++);switch(c){case "/":if(a.g"===a.B.charAt(a.g)){a.g++;a.j=76;return}a.j=6;return;case "!":if(a.g":if(a.g"===a.B.charAt(a.g)){a.g++;a.j=39;return}a.j=11;return;case ".":if(a.ga.B.charAt(a.g)||"9"=c||127=a.I)break;c=a.B.charAt(a.g++)}a.K=a.B.substring(a.aa,a.g);a.j=209;return;case '"':case "'":for(a.K="";;){a.g=a.B.indexOf(c,a.g);if(0>a.g)throw a.g=a.aa+1,new ve("Unmatched quote in expression");a.K+=a.B.substring(a.aa+1,a.g++);
+if(a.gc.charCodeAt(0)&&!se(c))throw new ve("Invalid character '"+c+"' in expression");case "_":n=!1;a:for(;a.gc.charCodeAt(0)&&!ue(c))break a}a.K=a.B.substring(a.aa,a.g);a.j=201;return}}}
+function De(a,c){a.xa=0;a.j=0;a.K=null;a.aa=0;a.g=0;a.B=c;a.lineNumber=0;a.Ca=0;a.I=c.length;ze(a);a.next()}function Ce(a){a={or:9,is:20,to:29,"in":31,eq:50,ne:51,le:55,lt:53,gt:52,ge:54,as:71,and:10,div:18,mod:19,idiv:56,then:26,"else":27,"case":67,where:28,union:1,except:24,"return":25,otherwise:79,orElse:81,"default":212,andAlso:80,intersect:23,satisfies:34}[a];return[81,80].includes(a)?-1:a||-1}function Ae(a,c=-1){a.lineNumber++;a.Ca++;null===a.ra&&(a.ra=[]);a.ra.push(-1===c?a.g-1:c)}
+function Be(a,c=null){var n=c?c:a.g;return" at line:"+Ee(a,c)+" col:"+Fe(a,c)+" near '"+a.B.slice(5>n?0:n-5,n+5)+"'"}function Ge(a){a.g>a.I&&(a.g=a.I);return 34>a.g?a.B.substring(0,a.g):Ha.collapse("..."+a.B.substring(a.g-30,a.g)).toString()}function He(a,c){if(null===a.ra)return c;for(var n=a.ra.length-1;0<=n;n--){var F=a.ra[n];if(c>F)return n+1<<16|c-F}return c}function Ee(a,c=null){return c?He(a,c)>>16:a.lineNumber}function Fe(a,c=null){return He(a,c?c:a.ke)&32767}
+class Ie{constructor(){this.J=this.xa=0;this.T=null;this.j=this.ke=0;this.K=null;this.aa=0;this.B=null;this.I=this.g=0;this.Ca=this.lineNumber=1;this.ra=null;this.V=-1;this.ta=""}next(){this.V=this.J;this.ta=this.T;this.J=this.j;this.T=this.K;null===this.T&&(this.T="");this.ke=this.aa;this.lineNumber=this.Ca;switch(this.J){case 201:var a=Ce(this.T);-1===a||150>=this.V||213===this.V||(this.J=a);break;case 207:150>=this.V||213===this.V||(this.J=17)}if(215!==this.J&&(a=this.V,ze(this),201===this.J&&
+this.xa!==Je&&21!==a))switch(this.j){case 5:var c=Ce(this.T);-1===c||150>=a?(this.J=this.gg(this.T),ze(this)):this.J=c;break;case 59:this.xa!==Ke&&(this.J=60,ze(this));break;case 41:ze(this);this.J=36;break;case 44:ze(this);this.J=43;break;case 42:ze(this);this.J=208;break;case 21:"for"===this.T?this.J=211:"some"===this.T?this.J=32:"every"===this.T?this.J=33:"let"===this.T&&(this.J=216);break;case 201:a=this.T+" "+this.K,c=pe[a],null!=c&&(this.J=c,this.T=a,ze(this))}}gg(a){const c={"if":37,array:69,
+attribute:69,comment:69,"document-node":69,element:69,"empty-sequence":69,"function":69,map:69,item:69,"namespace-node":69,node:69,"processing-instruction":69,"schema-attribute":69,"schema-element":69,"switch":69,otherwise:79,text:69,tuple:69,typeswitch:69,union:69}[a];return c?["tuple","union"].includes(a)?35:c:35}}var Je=1,Ke=2,ye=3;
+// Input 46
+var Le=[!1,!1,!0,!0,!0,!0,!0,!0,!0,!0,!1,!1,!0,!1];function Me(a){return"ancestor ancestor-or-self attribute child descendant descendant-or-self following following-sibling namespace parent preceding preceding-sibling self preceding-or-ancestor".split(" ")[a]}var Ne=[1,1,2,1,1,1,1,1,13,1,1,1,1,1],Oe=[4,5,9,9,0,1,10,11,9,3,6,7,12];
+function Pe(a){switch(a){case "self":return 12;case "child":return 3;case "parent":return 9;case "ancestor":return 0;case "attribute":return 2;case "following":return 6;case "namespace":return 8;case "preceding":return 10;case "descendant":return 4;case "ancestor-or-self":return 1;case "following-sibling":return 7;case "preceding-sibling":return 11;case "descendant-or-self":return 5}throw new ve("Unknown axis name: "+a);};
+// Input 47
+function Qe(a,c,n,F="XPTY0004"){this.kind=a;this.j=c;this.g=n;this.errorCode=F}Qe.prototype={Id:function(){return this.errorCode},save:function(){let a=this.kind+"|"+this.g+"|";a+=("XPTY0004"===this.errorCode?"":this.errorCode)+"|";return a+=this.j}};
+// Input 48
+function Re(a,c,n={}){a.start(c,n);c.end()}class Se{constructor(){this.l=dc.Aa}start(a,c={}){a.start(this.O,c);this.role&&a.ud("role",this.role);this.ag&&a.ud("sType",this.l.ha())}ac(){return!Zc(this.l.fa)}G(a){Re(this,a)}}na=Se.prototype;na.O="Expression";na.kind=null;na.role=null;na.ag=null;na.Da=function(a,c="XPTY0004"){return new Qe(this.kind,this.O,a,c)};na.Ga=function(){throw new ve(sa.Ij(this)+" is not a valid pattern","XTSE0340");};na.Gd=function(){return this};
+class Te extends Se{constructor(a,c,n){super();this.Va=c;this.ea=a;this.ga=n;if(this.ea.Wa||this.ga.Wa)this.Wa=!0;this.ea.Lb&&this.ga.Lb&&(this.Lb=!0)}G(a){super.start(a,this.Va?{op:oe[this.Va]}:{});this.ea.G(a);this.ga.G(a);a.end()}}Te.prototype.kind=1;class Ue extends Se{constructor(a){super();this.g=a;this.g.Wa&&(this.Wa=!0);this.g.Lb&&(this.Lb=!0)}G(a){super.start(a);this.g.G(a);a.end()}}Ue.prototype.kind=9;
+// Input 49
+class Ve extends Se{constructor(){super();this.l=dc.nc}Ga(){return this}G(a){Re(this,a)}}class We extends Ve{}We.prototype.O="p.any";class Xe extends Ve{constructor(a){super();this.message=a;this.role="match";this.l=dc.nc}G(a){Re(this,a,{message:this.message})}}Xe.prototype.O="p.warning";class Ye extends Ve{constructor(a){super();this.g=a;this.l=dc.nc}G(a){super.start(a);this.g.G(a);a.end()}}Ye.prototype.O="p.booleanExp";
+class Ze extends Ve{constructor(a){super();sa.assert(a instanceof lc);this.test=a;this.l=new gc(a,2)}G(a){Re(this,a,{test:this.test.ha()})}}Ze.prototype.O="p.nodeTest";class $e extends Ve{constructor(a,c){super();this.pattern=a;this.g=c;this.l=a.l;a.code&&(this.code=a.code)}G(a){super.start(a);this.code&&a.ud("code",this.code);this.pattern.G(a);this.g.G(a);a.end()}}$e.prototype.O="p.withPredicate";
+class af extends Ve{constructor(a){super();this.g=a;this.l=Vc(a.l,2)}G(a){super.start(a);this.g.G(a);a.end()}}af.prototype.O="p.nodeSet";class bf extends Ve{constructor(a){super();this.g=a;this.l=Vc(a.l,2)}G(a){super.start(a);this.g.G(a);a.end()}}bf.prototype.O="p.genNode";class cf extends Ve{constructor(a,c){super();this.g=c;this.code=a.l.ha();this.l=Vc(a.l,2)}G(a){super.start(a,{test:this.code});this.g.G(a);a.end()}}cf.prototype.O="p.genPos";
+class df extends Ve{constructor(a,c){super();this.code=a.ha();this.Qd=c;this.l=Vc(a,2)}G(a){Re(this,a,{test:this.code,pos:this.Qd})}}df.prototype.O="p.simPos";class ef extends Ve{constructor(a,c,n){super();this.axis=Oe[a];this.lb=c;this.g=n;this.l=c.l}G(a){super.start(a,{axis:Me(this.axis)});this.lb.G(a);this.g.G(a);a.end()}}ef.prototype.O="p.withUpper";
+class ff extends Ve{constructor(a,c,n,F){super();this.Va=c;this.ea=a;this.ga=n;this.l=Vc(F,2)}G(a){super.start(a,{op:1===this.Va?"union":oe[this.Va]});this.ea.G(a);this.ga.G(a);a.end()}}ff.prototype.O="p.venn";function gf(a){var c=[];a.ea instanceof hf?c=gf(a.ea):c.push(a.ea);a.ga instanceof hf?c=c.concat(gf(a.ga)):c.push(a.ga);return c}class hf extends ff{constructor(a,c,n){super(a,1,c,n)}}
+class jf extends Ve{constructor(a){super();this.g=a;for(var c of this.g)c.ag=!0}G(a){super.start(a);for(var c of this.g)c.G(a);a.end()}}jf.prototype.O="UnionExprP";
+// Input 50
+function kf(a){return a instanceof lf&&1===a.value.length&&uc.ia()(a.value[0])}function mf(a,c){return new lf(a,c)}function nf(){return new lf([],dc.Ie)}
+class lf extends Se{constructor(a,c){super();Array.isArray(a)||sa.la("Literal value must be array");c instanceof gc&&c.U.ha||sa.la("Literal type must be a SequenceType");a&&(this.value=a,c&&(this.l=c));this.role=null}toString(){return this.value.toString()}G(a){function c(n,F){const I=n.code,m={};switch(I){case "AB":break;case "AQ":m.pre=n.prefix;m.uri=n.uri;m.loc=n.local;break;default:m.val=n.toString()}F&&(m.role=F);switch(I){case "AS":a.start("str",m);break;case "AO":a.start("dbl",m);break;case "AB":a.start(n.value?
+"true":"false",m);break;case "AD":a.start("dec",m);break;case "ADI":a.start("int",m);break;case "AQ":a.start("qName",m);break;default:m.type=I,a.start("atomic",m)}a.end()}if(0===this.value.length)a.start("empty",this.role?{role:this.role}:{}),a.end();else if(1===this.value.length)c(this.value[0],this.role);else{let n={count:this.value.length};this.role&&(n.role=this.role);a.start("atomic",n);for(const F of this.value)c(F);a.end()}}}lf.prototype.O="literal";lf.prototype.Lb=!0;
+class of extends lf{constructor(a){super([La.XS.string.fromString(a)],dc.fc);this.l=dc.fc}};
+// Input 51
+function pf(a,c,n,F,I){var m=qf(a,dc.ec,a.Da(0,"XPTY0004"));m=new rf(m);if(/[lu]/.test(c))m.td={flags:c+(I?"e":""),as:n.toEQName()};else{sa.assert("a"===c);try{if(a instanceof lf&&1===a.value.length&&La.pa(a.value[0])&&"AQ"!==F.$().p){const g=F.Wc.R(a.value[0]);return new lf([g],new gc(F,2))}}catch(g){}m.td={flags:I?"ae":"a",as:F.ha()}}return m}class rf extends Ue{constructor(a){super(a);this.O="cast";this.kind=2;this.td={}}G(a){super.start(a,this.td);this.g.G(a);a.end()}}
+function sf(a,c,n,F,I){var m=new tf(a);m=qf(m,dc.ec,m.Da(0,"XPTY0004"));if(/[lu]/.test(c))m.td={flags:c+(I?"e":""),as:n.toEQName()};else{sa.assert("a"===c);if(a instanceof lf&&1===a.value.length&&La.pa(a.value[0])&&"AQ"!==F.$().p)try{return F.Wc.R(a.value[0]),new lf([La.XS.boolean.Yc],dc.cb)}catch(g){return new lf([La.XS.boolean.be],dc.cb)}m.td={flags:I?"ae":"a",as:F.ha()}}return m}
+class tf extends Ue{constructor(a){super(a);this.l=dc.cb;this.O="castable";this.kind=2;this.td={}}G(a){super.start(a,this.td);this.g.G(a);a.end()}}class uf extends Ue{constructor(a,c){super(a);this.j=c;this.l=jd(a.l.U)?dc.Kg:dc.Ad}G(a){super.start(a,{diag:this.j});this.g.G(a);a.end()}}uf.prototype.O="data";class vf extends uf{constructor(a,c,n){super(a,c);this.B=n;jd(a.l.U)?this.l=n?dc.If:dc.Jg:this.l=n?dc.ec:dc.Oe}G(a){super.start(a,{diag:this.j});this.B&&a.ud("card","?");this.g.G(a);a.end()}}
+vf.prototype.O="atomSing";class wf extends Se{constructor(a){super();this.name=a.U.name.toEQName();this.l=dc.If}G(a){Re(this,a,{name:this.name})}}wf.prototype.O="attVal";class xf extends Ue{constructor(a,c,n){super(a);this.code=c;this.j=n;this.l=dc.Ad}G(a){super.start(a,{to:this.code,diag:this.j});this.g.G(a);a.end()}}xf.prototype.O="cvUntyped";
+class yf extends Ue{constructor(a,c){super(a);this.type=c;this.flags="";this.l=new gc(c.U,a.l.fa)}G(a){super.start(a,{to:this.type.ha().replace(/^[01?*+]/,""),flags:this.flags});this.g.G(a);a.end()}}yf.prototype.O="convert";class zf extends Ue{constructor(a,c,n){super(a);this.type=c;this.resultType=a.resultType;this.j=n;this.l=c}G(a){super.start(a,{to:this.type.ha().replace(/^[01?*+]/,""),diag:this.j});this.g.G(a);a.end()}}zf.prototype.O="fnCoercer";
+// Input 52
+const Af="array attribute comment document-node element empty-sequence function if item map namespace-node node processing-instruction schema-attribute schema-element switch text typeswitch".split(" ");class Bf{constructor(a,c){if(""===a.prefix&&Af.includes(a.local))throw new ve("The unprefixed function name '"+a.local+"' is reserved","XPST0003");this.name=a;this.arity=c}toEQName(){return this.name.toEQName()}toString(){return this.name.toEQName()+"#"+this.arity}};
+// Input 53
+class Cf extends Se{constructor(a,c,n){super();const F=a.name.local;if(a.name.uri===Zb.mc){if("NOTATION"===F)throw new G("No constructor function exists for xs:NOTATION","XPST0017");const m=c[0].l;if(2===m.fa&&m.U.pa()&&m.U.Wc&&F===m.U.Wc.name)a=c[0];else if(["NMTOKENS","ENTITIES","IDREFS"].includes(F))a=pf(c[0],"l",a.name,null,!0);else{var I;"numeric"===F?I=pf(c[0],"u",a.name,null,!0):I=pf(c[0],"a",null,n.U,!0);a=I}return a}this.name=a;this.g=c;this.l=n;switch(F){case "exactly-one":this.l=Vc(c[0].l,
+2);break;case "head":this.l=Vc(c[0].l,Xc(c[0].l.fa)?3:2);break;case "tail":case "subsequence":this.l=Vc(c[0].l,7);break;case "ceiling":case "floor":case "reverse":case "snapshot":this.l=c[0].l;break;case "last":case "position":this.Wa=!0;break;case "string-length":case "normalize-space":0===c.length&&this.g.push(Df("string",new Ef));break;case "fold-left":case "fold-right":this.l=c[2].resultType;break;case "for-each":this.l=Vc(c[1].l.U.gf(),7);break;case "filter":this.l=Vc(c[0].l,7);break;case "current":this.Lb=
+!0;break;case "boolean":if(c[0].l.equals(dc.cb))return c[0]}}Ga(){return new af(this)}ac(){if(this.name.uri===Zb.Oa)return"doc document element-with-id id innermost key outermost".split(" ").includes(this.name.local)?!0:"filter one-or-more subsequence remove tail trace unordered zero-or-more".split(" ").includes(this.name.local)?this.g[0].ac():!1}G(a){super.start(a,{name:this.name.name.local});for(const c of this.g)c.G(a);a.end()}}Cf.prototype.O="fn";
+class Ff extends Se{constructor(a,c,n){super();this.name=a;this.g=c;this.l=n}G(a){super.start(a,{name:this.name.toEQName()});for(const c of this.g)c.G(a);a.end()}}Ff.prototype.O="ifCall";class Gf extends Se{constructor(a,c,n){super();this.name=a;this.g=c;this.l=n;if(a="merge"===a.name.local)a=c[0],a=!(a instanceof lf&&0===a.value.length);a&&(this.l=Vc(c[0].l,2))}G(a){super.start(a,{name:this.name.toEQName()});for(const c of this.g)c.G(a);a.end()}}Gf.prototype.O="ifCall";
+class Hf extends Se{constructor(a,c,n){super();this.name=a;this.g=c;this.l=n}G(a){super.start(a,{name:this.name.toEQName()});for(const c of this.g)c.G(a);a.end()}}Hf.prototype.O="ifCall";class If extends Ff{}class Jf extends Se{constructor(a,c,n){super();this.name=a;this.g=c;this.l=n}G(a){super.start(a,{name:this.name.toEQName()});for(const c of this.g)c.G(a);a.end()}}Jf.prototype.O="ifCall";
+class Kf extends Se{constructor(a,c,n){super();this.name=a;this.g=c;this.l=n}G(a){super.start(a,{name:this.name.toEQName()});for(const c of this.g)c.G(a);a.end()}}Kf.prototype.O="ifCall";class Lf extends Kf{constructor(a,c,n){super(a,c,n);const F=new Bf(La.XS.QName.fromParts("ixsl",Zb.nd,"call"),3),I=new Bf(La.XS.QName.fromParts("ixsl",Zb.nd,"window"),0);this.name=F;this.g=[new Kf(I,[],dc.nc),new of(a.name.local),new Mf(c)];this.l=n}}
+class Nf extends Se{constructor(a,c,n,F){super();this.name=a;this.g=c;this.l=n;this.j=F}G(a){super.start(a,{name:this.name.toEQName(),coId:this.j});for(const c of this.g)c.G(a);a.end()}}Nf.prototype.O="ufCall";class Of extends Se{constructor(a){super();this.name=a.name.name;this.xb=a.xb;this.arity=a.name.arity;this.l=a.l;this.resultType=a.resultType}G(a){Re(this,a,{name:this.name.toEQName(),arity:this.arity,resultType:this.resultType.ha()})}}Of.prototype.O="fnRef";
+class Pf extends Of{constructor(a){super(a);this.g=0}G(a){Re(this,a,{name:this.name.toEQName(),arity:this.arity,resultType:this.resultType.ha(),bSlot:this.g})}}Pf.prototype.O="ufRef";class Qf extends Se{constructor(){super();this.l=dc.Aa}G(a){Re(this,a,{asCode:"*"})}}Qf.prototype.O="null";class Rf extends Se{}Rf.prototype.g={};Rf.prototype.B={};Rf.prototype.j={};
+class Sf extends Se{constructor(){super();this.l=dc.Aa;this.slot=this.Za=this.name=this.cc=null}hd(){return this.name}toString(){return"$"+this.name+" as "+this.l.toString()}G(a){Re(this,a,{name:this.name,asCode:this.l.ha(),slot:this.slot})}}Sf.prototype.O="arg";
+class Tf extends Se{constructor(a,c,n){super();this.params=a;this.resultType=c;const F=[];a.forEach(I=>{F.push(I.l)});n=qf(n,c,this.Da("body"));this.l=kc(new dd(F,c));this.arity=a.length;this.body=n;n.role="body"}G(a){super.start(a,{arity:this.arity,name:this.name,as:this.resultType.ha()});for(const c of this.params)c.G(a);this.body.G(a);a.end()}}na=Tf.prototype;na.O="inlineFn";na.kind=5;
+na.Da=function(a,c="XPTY0004"){return new Qe(this.kind,"("+this.params.map(n=>n.toString()).join(",")+")"+(this.resultType?" as "+this.resultType.toString():""),a,c)};na.name="inline";na.ag=!0;
+class Uf extends Se{constructor(a,c,n){super();if(a.l&&a.l.U instanceof dd&&a.l.$().a.length!==c.length)throw new G("Partially-applied function requires "+a.arity+" arguments, but "+(c.length{var v=g.a[I];v=m?m:ic(v);k instanceof Qf?k.l=v:k=qf(k,v,this.Da(I));this.g.push(k);e&&(m=v);I++})}else c.forEach(g=>{this.g.push(g)});a.l.U instanceof dd&&(this.l=kc(vd(a.l.U,n)))}G(a){super.start(a);this.j.G(a);this.g.forEach(c=>{c.G(a)});a.end()}}Uf.prototype.O="partialApply";Uf.prototype.kind=5;
+class Wf extends Se{constructor(a,c){super();this.key=a;this.value=c;this.l=ec("1FM")}toString(){return"map{"+this.key.toString+" : "+this.value.toString()+"}"}G(a){super.start(a);this.key.G(a);this.value.G(a);a.end()}}Wf.prototype.O="map";
+class Xf extends Se{constructor(a){super();this.entries=a;const c=sd.Md(a.map(I=>I[0].l.U)),n=sd.Md(a.map(I=>I[1].l.U));a=a.map(I=>I[1].l.fa);let F=2;a.some(I=>Xc(I))&&(F+=1);a.some(I=>Zc(I))&&(F+=4);this.l=kc(new td(c,new gc(n,F)))}toString(){let a="map{";this.entries.forEach(c=>{a+=c[0].toString+" : "+c[1].toString()});return a+"}"}G(a){super.start(a);this.entries.forEach(c=>{c[0].G(a);c[1].G(a)});a.end()}}Xf.prototype.O="map";
+// Input 54
+class Yf extends Se{constructor(a,c){super();sa.assert(!c||c instanceof lc);this.axis=a;this.O="axis";c=c||qc;2===a&&c instanceof rc?c=Hc:3===a&&c instanceof rc&&(c=sc);this.g=c;9===a&&c instanceof rc?this.l=dc.de:c?this.l=new gc(c,7):this.l=dc.ce}Cb(){return this.axis}ac(){return[2,3,4,5,6,7,9,12].includes(this.axis)}Ga(){return new Ze(this.g)}G(a){Re(this,a,{name:Me(this.axis),nodeTest:this.l.ha()})}}
+class Zf extends Te{constructor(a,c){super(a,2,c);this.ea=a=qf(a,dc.ce,this.Da(0,"XPTY0019"));this.l=Wc(c.l,a.l.fa)}ac(){return!0}Ga(){if(this.ga instanceof Cf||this.ga instanceof lf)throw new ve("Not an axis step for a pattern","XTSE0340");return this.Wa||!this.ga.Cb||this.ga instanceof $f?new bf(this):new ef(this.ga.Cb(),this.ga.Ga(),this.ea.Ga())}G(a){super.start(a,this.Va?{op:oe[this.Va]}:{});this.ea.G(a);this.ga.G(a);a.end()}}Zf.prototype.O="slash";
+class ag extends Se{constructor(){super();this.l=dc.de}Ga(){return new Ze(Ec)}}ag.prototype.O="root";
+// Input 55
+const bg={ADI:"i",ADIL:"c",ADILI:"i",ADILIS:"i",ADILISB:"i",ADIN:"c",ADINN:"c",ADIP:"c",ADIPP:"c",ADIPL:"c",ADIPLI:"i",ADIPLIS:"i",ADIPLISB:"i",AD:"c",AO:"d",AF:"f",A:"a",AZ:"a",AT:"t",AA:"t",AM:"t",AMP:"t",AH:"t",AI:"t",AJ:"t",AG:"t",AK:"t",ARD:"u",ARY:"u",E:"a"};var cg={19:"%",18:"/",56:"~",15:"+",16:"-",299:"-",17:"*"};function dg(a,c){c=new xf(a,"AO",c.save());c.l=2===a.l.fa?dc.ee:dc.Dg;return c}
+class eg extends Te{constructor(a,c,n,F){function I(b){return b instanceof nc&&b.Wc.lb?new nc(La.yj(b.Wc)):b}function m(){throw new ve("Cannot evaluate "+k.toString()+" "+oe[c]+" "+v.toString(),"XPTY0004");}super(a,c,n);const g=F.te(),e=a.Wa||n.Wa;g&&(a=fg(a),n=fg(n));a=qf(a,dc.ec,this.Da(0));n=qf(n,dc.ec,this.Da(1));let k=I(a.l.U),v=I(n.l.U);var t=k.$().p,D=v.$().p;g||!/^AS/.test(t)&&!/^AS/.test(D)||m();"AZ"!==t||g||(a=dg(a,this.Da(0,"FORG0001")),k=Mc,t="AO");"AZ"!==D||g||(n=dg(n,this.Da(1,"FORG0001")),
+v=Mc,D="AO");var l=bg[t];let f=bg[D];const B=k.isNumeric(),L=v.isNumeric();D=Sc;t=Xc(a.l.fa)||Xc(a.l.fa);l||="a";f||="a";var y;g?(l=f="d",D=Mc):B&&L&&("d"===l||"d"===f?(l=f="d",D=y=Mc):"f"===l||"f"===f?(l=f="f",D=y=Nc):"c"===l||"c"===f?(l=f="c",D=y=Pc):"i"===l&&"i"===f&&18===c?(l=f="c",D=Pc):"i"!==l||"i"!==f||15!==c&&16!==c&&17!==c&&19!==c?"i"===l&&"i"===f&&18===c&&(D=Pc):D=Qc);56===c&&(D=Qc);D.isNumeric()&&y&&(y=new gc(y,3),a=qf(a instanceof gg?a.g:a,y,this.Da(0)),n=qf(n instanceof gg?n.g:n,y,this.Da(1)));
+[l,f].includes("a")&&(l=f="a");(k.pa("ARY")&&v.pa("AT")||v.pa("ARY")&&k.pa("AT"))&&m();"t"===l&&"t"===f&&(16===c?D=Rc:m());"u"===l&&"t"===f&&(15===c?D=v:m());"u"===l&&"u"===f&&(17===c&&m(),18===c?D=Pc:D=k);B&&"u"===f&&18===c&&m();"t"!==l||"u"!==f||16!==c&&15!==c?"i"===l&&"u"===f&&17===c?(l="n",D=v):"u"!==l||"d"!==f&&"i"!==f&&"c"!==f?"u"!==f||"d"!==l&&"i"!==l&&"c"!==l||(l="n",D=v):(D=k,f="n"):D=k;l=l+cg[c]+f;if(!F.te()&&"AF"!==D.$().p&&!F.Kc&&(F.ni?0===F.ni:1)&&kf(a)&&kf(n)&&(F=a.value[0],y=n.value[0],
+18!==c||0!==y.toNumber()))return a=mb[l](F,y),mf([a],new gc(new nc(La.codes[a.code]),2));this.ea=a;this.ga=n;a.l.equals(n.l)&&(this.l=a.l);D&&(this.l=new gc(D,t?3:2));this.g=l;e&&(this.Wa=!0);g&&(this.O="arith10");this.l||(this.l=dc.Oe)}Ga(){throw new ve("The arithmetic expression "+oe[this.Va]+" is not a patternXTSE0340");}G(a){super.start(a,this.Va?{op:oe[this.Va],calc:this.g}:{});this.ea.G(a);this.ga.G(a);a.end()}}eg.prototype.O="arith";
+// Input 56
+const hg={6:50,22:51,11:52,12:53,13:54,14:55};function ig(a,c){a=a.$().p;c.$();if("AZ"===a&&c.isNumeric())return!1;if("A"===a&&c.pa())return!0;""===a&&c.pa();return!0}function jg(a){return/^A[BAMT2XQ]/.test(a)}class kg extends Te{constructor(a,c,n,F){super(a,c,n);a=F.Ni();c="GAC";switch(a){case Hd.jg:c="CAC"}a.startsWith(Hd.Mj)&&(c="CAC");n.l===dc.Ig&&(c="EQC");this.Dd=c+"|"+a;this.l=dc.cb}G(a){super.start(a,{op:oe[this.Va],comp:this.Dd});this.ea.G(a);this.ga.G(a);a.end()}}
+class lg extends kg{G(a){super.start(a,{op:oe[this.Va],comp:this.Dd,card:"1:1"});this.ea.G(a);this.ga.G(a);a.end()}}
+class mg extends lg{constructor(a,c,n,F){super(a,c,n,F);a=qf(a,dc.Ad,this.Da(0));n=qf(n,dc.Ad,this.Da(1));c=a.l.$();F=n.l.$();var I=c.p;var m=F.p;I===m||[I,m].includes("AZ")||[I,m].includes("A")?I=!0:(/^A[ODF]/.test(I)&&(I="AO"),/^A[ODF]/.test(m)&&(m="AO"),/^A[SU]/.test(I)&&(I="AS"),/^A[SU]/.test(m)&&(m="AS"),I="E"===I||"E"===m?!0:I===m);if(!I)if(I="Cannot compare items of types "+a.l.U.toString()+" and "+n.l.U.toString(),/[*?]/.test(c.o)||/[*?]/.test(F.o))sa.Ma(I+": the comparison can succeed only if one of the values is an empty sequence",
+1,null);else throw new ve(I,"XPTY0004");this.ea=a;this.ga=n}}mg.prototype.O="gc";class ng extends lg{}ng.prototype.O="gc10";
+class og extends kg{constructor(a,c,n,F,I=!0){super(a,c,n,F);var m=a.l.U,g=n.l.U;const e=m.$().p,k=g.$().p;if(!("A"===e&&g.pa()||"A"===k&&m.pa()||""===e||""===k||m.$().p.startsWith("AM")&&g.$().p.startsWith("AM")||(jg(e)||jg(k)?e===k:ig(m,g)||ig(g,m))))throw new ve("Cannot compare "+a.l.toString()+" "+oe[c]+" "+n.l.toString(),"XPTY0004");a=qf(a,dc.ec,this.Da(0));n=qf(n,dc.ec,this.Da(1));if(51!==c&&50!==c&&/^A[QGHIJK]/.test(a.l.U.$().p))throw new ve("Cannot order-compare "+a.l.toString()+" "+oe[c]+
+" "+n.l.toString(),"XPTY0004");if(I){if(kf(n)&&La.XS.integer.matches(n.value[0])&&"ADI"===a.l.$().p)return new pg(a,c,n,F);if(n instanceof of)return new qg(a,c,n,F)}this.ea=a;this.ga=n}}og.prototype.O="vc";class rg extends og{constructor(a,c,n,F){super(a,c,n,F,!1)}G(a){super.start(a,{op:oe[this.Va],val:this.ga.value[0]});this.ea.G(a);a.end()}}class pg extends rg{}pg.prototype.O="compareToInt";
+class qg extends rg{G(a){super.start(a,{op:oe[this.Va],val:this.ga.value[0].toString(),comp:this.Dd});this.ea.G(a);a.end()}}qg.prototype.O="compareToString";class sg extends kg{constructor(a,c,n,F){super(a,c,n,F);a=qf(a,dc.de,this.Da(0));n=qf(n,dc.de,this.Da(0));this.ea=a;this.ga=n;this.O=38===c?"precedes":39===c?"follows":"is"}G(a){super.start(a);this.ea.G(a);this.ga.G(a);a.end()}};
+// Input 57
+function tg(a,c){return a instanceof Cf&&a.name.name.uri===Zb.Oa&&a.name.name.local===c}function ug(a,c){return a instanceof og&&a.Va===c&&tg(a.ea,"position")&&tg(a.ga,"last")}
+class vg extends Se{constructor(a,c){super();if(c){let F=tg(c,"last")||ug(c,50);if(F)return new wg(a);F=F||ug(c,53);var n=c.Wa||c instanceof eg;const I=c.Lb;if(!n&&I&&c.l.equals(dc.Bd))return new xg(a,c);n||(n=c.l.U.$().p,n="AB"===n||n.startsWith("N")?!1:"A"===n||/^A[ODF]/.test(n));this.g=a;this.l=a.l;c instanceof yg?this.l=Vc(c.type,this.l.fa):c instanceof lf&&1===c.value.length&&uc.ia()(c.value[0])&&(this.l=Vc(this.l,3));n&&(this.Wa=!0);I&&(this.Lb=!0);this.j=F?new zg(50===c.Va?"1":"0"):c}}Cb(){return this.g.Cb()}ac(){return super.ac()||
+this.g.ac()}Ga(){if(!jd(this.l.U)){const a=Df("exists",this);return new Ye(a)}return this.Wa&&this.g instanceof Yf&&!(this.j instanceof zg)?new cf(this.g,this.j):this.Wa?new bf(this.Gd()):new $e(this.g.Ga(),this.j)}Gd(){if(this.g instanceof Ef)return this.j;this.g=this.g instanceof Yf?Ag(new Ef,this.g):this.g.Gd();return this}G(a){super.start(a);let c="";this.Lb&&(c+="i");this.Wa&&(c+="p");""!==c&&a.ud("flags",c);this.g.G(a);this.j.G(a);a.end()}}vg.prototype.O="filter";
+class xg extends vg{constructor(a,c){super(a,null);if(kf(c)&&La.XS.integer.matches(c.value[0])&&1===c.value[0].value)return new Bg(a);this.g=a;this.l=Vc(a.l,3);this.j=c;this.Wa=!0}Ga(){return this.g instanceof Ef?new Xe("Numeric predicates other than 1 in PredicatePatterns never match. Value provided:"+this.j.value.value):this.g instanceof Yf?new df(this.g.l,this.j.value[0].value):new bf(this.Gd())}}xg.prototype.O="subscript";
+class Bg extends xg{constructor(a){super(a,null);this.g=a;this.Wa=!0;this.l=Vc(a.l,3)}Ga(){return jd(this.l.U)?this.g instanceof Yf?new bf(new Bg(Ag(new Ef,this.g))):new bf(this.Gd()):new Ye(this)}G(a){super.start(a);this.g.G(a);a.end()}}Bg.prototype.O="first";
+class wg extends xg{constructor(a){super(a,null);this.g=a;this.Wa=!0;this.l=Vc(a.l,3)}Ga(){if(!(this.g instanceof Yf))return new bf(this.Gd());if(3===this.g.axis){var a=new Yf(7,this.g.g);return new $e(this.g.Ga(),Df("empty",[a]))}return new df(this.g.l,1)}G(a){super.start(a);this.g.G(a);a.end()}}wg.prototype.O="lastOf";class zg extends Se{constructor(a="1"){super();this.test=a;this.l=dc.cb}G(a){Re(this,a,{test:this.test})}}zg.prototype.O="isLast";
+// Input 58
+function Cg(a,c){if(a instanceof ag&&c instanceof Yf&&9===c.Cb())return nf();if(a instanceof Zf&&a.ea instanceof ag&&5===a.ga.axis&&c instanceof Yf&&3===c.axis)return Cg(a.ea,new Yf(4,c.g));if(c instanceof Zf||c instanceof Dg&&c.g instanceof Zf){const n=Eg(c);Fg(n.ea)instanceof Yf&&Fg(n.ga)instanceof Yf&&(a=Ag(a,n.ea),c=n.ga)}a=new Zf(a,c);return Gg(a)?a:jd(a.ga.l.U)?(a.ea=Hg(a.ea),a.ga=Hg(a.ga),new Dg(a)):a}
+function Gg(a){if(!Zc(a.ea.l.fa))return a.ga.ac();const c=Fg(a.ea);return c instanceof Yf&&3===c.axis&&(a=Fg(a.ga),a instanceof Dg&&(a=a.g),a instanceof Yf&&[3,2,4,5,8].includes(a.axis)||a instanceof Zf&&Gg(a))?!0:!1}function Eg(a){return a instanceof Dg?a.g:a}function Fg(a){return a instanceof vg?Fg(a.g):a instanceof Dg?Fg(a.g):a}var Ag=Cg;function Ig(a){return a.ac()?a:new Dg(a)}var Hg=Eg;
+// Input 59
+function Jg(a,c,n,F,I={}){sa.assert(c);sa.assert(c instanceof gc);sa.assert(a.l);sa.assert(a.l instanceof gc);var m=c.$(),g=a,e;const k=c.U,v=c.fa,t=Zc(v);var D=null,l=-1;let f=7===v;f||(l=a.l.fa,f=(v|l)===v);m=""===m.p;1===v&&(m=!0);m||(D=a.l.U,l=a.l.fa,m=sd.Ob(k,D),m===sd.dc&&(m=D===oc?sd.oc:k===oc?sd.Sb:m),m=m===sd.yb||m===sd.Sb);if(m&&f)return g;if(I.Ub&&!t&&(Zc(l)&&(g=e=new Bg(g),l=3,f=(v|l)===v),!m)){if(k.pa("AS")){try{e=Jg(g,dc.Hf,n,F)}catch(B){throw B;}g=Df("string",e);D=Oc;l=2;g.l=dc.fc;
+f=(v|l)===v;m=!0}if(kd(k)||k.pa("AO")){try{e=Jg(g,dc.Hf,n,F)}catch(B){throw B;}g=Df("number",e);D=Mc;l=2;g.l=dc.ee;f=(v|l)===v;m=!0}}if(!m)if(k.pa()){if(!D.pa()&&1!==l){if(!D.$i)throw c=new G("An atomic value is required for the "+n.getMessage()+", but the supplied value (type "+D.toString()+") cannot be atomized","error()"===D.name?"FOER0000":"FOTY0013",a),c;D=!Zc(l);l=!Zc(v);D?(e=Xc(v),g=g instanceof Yf&&2===g.axis&&g.l.U instanceof nd?new wf(g.l):new vf(g,F,e)):g=g instanceof Yf&&2===g.axis&&g.l.U instanceof
+nd?new wf(g.l):new uf(g,F);e=g;l&&!D&&(e=Kg(e,v,F));g=e;D=g.l.U;l=g.l.fa;f=(v|l)===v}D.pa("AZ")&&(kd(k)||!k.pa("AZ")&&"A"!==k.$().p)&&(g=e=Lg(g,k,F),m=!0,D=k);"A"!==D.ha()||["A","AZ"].includes(k.ha())||(g=e=Lg(g,k,F),D=g.l.U);k.pa()&&(k.pa("AO")&&sd.Ob(D,uc)!==sd.dc?(g=e=new yf(g,dc.ee),D=Mc,l=-1):k.pa("AF")&&sd.Ob(D,uc)!==sd.dc&&!sd.fj(D,Mc)&&(g=e=new yf(g,dc.Hg),D=Nc,l=-1),k.pa("AS")&&D.pa("AU")&&(m=!0,g=e=new yf(g,dc.fc),D=Oc))}else k.Jd()&&"F"===k.$().p&&(D.Jd()||(g=new Mg(g,wc,F),D=wc),k instanceof
+xc||(m=D.$(),("FM"===m.p||"FA"===m.p)&&1===k.j.length)||(g=new zf(g,kc(k),F)),m=!0);if(m&&f)return g;-1===l&&(l=g.l.fa,f||=(v|l)===v);if(f&&1===l)return g;if(1===l&&!Xc(v))throw c=new G("An empty sequence is not allowed as the "+n.getMessage(),n.Id()),c;m=m?sd.oc:sd.Ob(D,k);m===sd.dc&&(m=D===oc?sd.Sb:k===oc?sd.oc:m);1===v&&(m=sd.yb);if(m===sd.dc)if(Xc(l)&&Xc(v))1!==l&&(e=n.Vf(k,D),sa.Ma(e+". The expression can succeed only if the supplied value is an empty sequence.",1,null));else throw e=n.Vf(k,
+D),c=new G(e,"error()"===D.name?"FOER0000":n.Id()),c;if(m!==sd.yb&&m!==sd.oc){if(g.bj){F=La.XS.string.fromString(g.getAttribute("val"));if(k.pa()&&c.matches(F))return g;e=n.Vf(k,D);c=new G(e,n.Id());throw c;}g=e=Ng(g,new gc(k,v),F);f=!0}if(!f){if(g.bj)throw c=new G("Required cardinality of "+n.getMessage()+" is "+Yc(v)+"; supplied value has cardinality "+Yc(l),n.Id()),c;g=e=Kg(g,v,F)}return g}function Lg(a,c,n){c=kd(c)?"AO":c.$().p;return new xf(a,c,n)};
+// Input 60
+function Df(a,c){a=new La.XS.QName.fromParts("fn",Zb.Oa,a);c=Array.isArray(c)?c:[c];a=new Bf(a,c.length);return new Cf(a,c,dc.Aa)}function qf(a,c,n){const F=Og(n.errorCode?n.errorCode:"XPTY0004",n.save());return Jg(a,c,F,n.save())}function fg(a){return Zc(a.l.fa)?new Bg(a):a}
+class Pg extends Se{constructor(a){super();this.value=a;0===a.length?this.l=dc.Ie:this.l=new gc(sd.Md(a.map(n=>n.l.U)),7);let c=!0;a.forEach(n=>{c=c&&n instanceof lf});c&&(this.g=!0)}G(a){super.start(a);this.g&&a.ud("literal",!0);for(const c of this.value)c.G(a);a.end()}}Pg.prototype.O="sequence";
+class Mf extends Se{constructor(a){super();this.value=a;if(0===a.length)this.l=kc(Ac);else{const c=sd.Md(a.map(F=>F.l.U));let n=0;a.forEach(F=>n|=F.l.fa);this.l=kc(new ud(new gc(c,n)))}}G(a){super.start(a);for(const c of this.value)c.G(a);a.end()}}Mf.prototype.O="arrayBlock";
+class Qg extends Se{constructor(a,c){super();this.Va=a;this.O=oe[a];this.Za=c;this.action=this.Pb=void 0;this.slot=0;this.cc=this.value=null;this.l=dc.cb}hd(){return this.Za}G(a){super.start(a,{"var":this.Za.toEQName(),slot:this.slot});this.value.G(a);this.action.G(a);a.end()}}
+class $f extends Te{constructor(a,c,n,F=!1){super(a,c,n);this.O=1===c?"union":oe[c];F=F?"XTSE0340":"XPTY0004";a=qf(a,dc.ce,this.Da(0,F));n=qf(n,dc.ce,this.Da(1,F));a=Ig(a);n=Ig(n);this.ea=a;this.ga=n;sa.assert(a.l);sa.assert(n.l);switch(c){case 24:this.l=a.l;break;case 23:c=a.l.fa&n.l.fa|3;this.l=new gc(sd.Ui([a,n].map(I=>I.l.U)),c);break;case 1:this.l=new gc(sd.Md([a,n].map(I=>I.l.U)),Dd(a.l.fa,n.l.fa))}}ac(){return!0}Cb(){return this.ea.Cb&&this.ga.Cb&&this.ea.Cb()===this.ga.Cb()?this.ea.Cb():-1}Ga(){if(1===
+this.Va)return new hf(this.ea.Ga(),this.ga.Ga(),this.l);const a=this.Cb();return 3===a||2===a||this.ea.Lb||this.ga.Lb?new ff(this.ea.Ga(),this.Va,this.ga.Ga(),this.l):new bf(this)}}class Ef extends Se{constructor(a=dc.nc){super();this.l=a}G(a){Re(this,a)}Ga(){return new We}}Ef.prototype.O="dot";function Rg(a){return""===a.l.$().p?new Sg(a):a}class Sg extends Ue{constructor(a){super(a);this.l=a.l}}Sg.prototype.O="homCheck";function Tg(a){return a.global?new Ug(a):new Vg(a)}
+class Wg extends Se{constructor(){super();this.g=null;this.l=dc.Aa}}Wg.prototype.O="varRef";Wg.prototype.Lb=!0;class Vg extends Wg{constructor(a){super();this.g=a;this.l=a.cc||dc.Aa}hd(){return this.g.Za}G(a){Re(this,a,{name:this.g.Za.toEQName(),slot:this.g.slot})}}Vg.prototype.O="varRef";class Ug extends Wg{constructor(a){super();this.g=a;this.l=a.cc}hd(){return this.g.Za}Ga(){return new af(this)}G(a){Re(this,a,{name:this.g.Za.toEQName(),bSlot:"?"})}}Ug.prototype.O="gVarRef";
+class Xg extends Te{constructor(a,c){super(a,213,c);this.ea=a=qf(a,dc.Df,this.Da(0));a.l&&a.l.U&&a.l.U.resultType&&(this.l=a.l.U.resultType)}}Xg.prototype.O="lookup";class Yg extends Se{constructor(a){super();this.ea=a=qf(a,dc.Df,this.Da(0))}G(a){super.start(a);this.ea.G(a);a.end()}}Yg.prototype.O="lookupAll";class Zg extends Se{constructor(){super();this.l=dc.Aa}}Zg.prototype.O="currentGroup";class $g extends Se{constructor(){super();this.l=dc.Ad}}$g.prototype.O="currentGroupingKey";
+class Dg extends Ue{constructor(a){super(a);this.l=a.l}ac(){return!0}Ga(){return this.g.Ga()}}Dg.prototype.O="docOrder";class ah extends Ue{constructor(a){super(a);this.l=a.l}G(a){super.start(a,{flags:this.flags});this.g.G(a);a.end()}}ah.prototype.O="copyOf";ah.prototype.flags="cm";class yg extends Se{constructor(a,c){super();sa.assert(c instanceof gc);this.ea=a;this.type=c;this.l=dc.cb}G(a){super.start(a,{of:this.type.ha()});this.ea.G(a);a.end()}}yg.prototype.O="instance";
+function Ng(a,c,n=null){n||(n=new Qe(2,"treat as",0),n.errorCode="XPDY0050",n=n.save());return new Mg(Kg(a,c.fa,n),c.U,n)}class gg extends Ue{constructor(a,c,n){super(a);this.l=new gc(a.l.U,c);this.j=c;this.B=n}G(a){super.start(a,{card:2===this.j?"1":Yc(this.j),diag:this.B});this.g.G(a);a.end()}}gg.prototype.O="check";function Kg(a,c,n){return 7===c?a:a instanceof lf&&(c|2)===c?a:new gg(a,c,n)}
+class Mg extends Ue{constructor(a,c,n){super(a);this.l=a.l;this.B=c;this.j=n}G(a){super.start(a,{as:this.B.ha(),diag:this.j});this.g.G(a);a.end()}}Mg.prototype.O="treat";
+// Input 61
+function bh(a,c,n){a=[a,mf([La.XS.boolean.Yc],dc.cb)];return new ch(a,[c,n])}class ch extends Se{constructor(a,c){super();this.g=a;this.actions=c;this.Wa=c.some(n=>n.Wa);a=sd.Md(c.map(n=>n.l.U));c=Cd(c.map(n=>n.l.fa));this.l=new gc(a,c)}G(a){super.start(a);let c=0;for(const n of this.g)n.G(a),this.actions[c++].G(a);a.end()}}ch.prototype.O="choose";
+// Input 62
+class dh extends Se{constructor(){super();this.action=this.value=this.cc=this.Za=null;this.slot=0}hd(){return this.Za}g(a){this.action=a;this.l=a.l}j(a){this.value=a;this.cc=a.l}G(a){super.start(a,{name:this.Za.toEQName(),slot:this.slot});this.value.G(a);this.action.G(a);a.end()}}class eh extends dh{j(a){this.value=a;this.cc=Vc(a.l,2);this.action&&(this.l=Wc(this.action.l,a.l.fa))}g(a){this.action=a;this.value&&(this.l=Wc(a.l,this.value.l.fa))}}eh.prototype.O="for";class fh extends dh{}
+fh.prototype.O="let";
+// Input 63
+class gh extends Te{constructor(a,c){super(a,null,c);this.l=dc.cb}}class hh extends gh{}hh.prototype.O="and";class ih extends gh{}ih.prototype.O="or";
+// Input 64
+function jh(a){return kf(a)&&La.XS.integer.matches(a.value[0])&&1E7>a.value[0].value}class kh extends Te{constructor(a,c,n=!1){super(a,null,c);n&&(a=fg(a),c=fg(c));this.ea=qf(a,dc.Gf,this.Da(0));this.ga=qf(c,dc.Gf,this.Da(1));this.l=dc.Ke}}kh.prototype.O="to";class lh extends Se{constructor(a,c){super();this.g=a;this.j=c;this.l=dc.Ke}G(a){Re(this,a,{from:this.g.value,to:this.j.value})}}lh.prototype.O="range";
+class mh extends Se{constructor(a,c){super();this.g=a;this.next=c;this.l=Wc(c.l,a.l.fa)}G(a){super.start(a);this.g.G(a);this.next.G(a);a.end()}}mh.prototype.O="forEach";
+// Input 65
+// Input 66
+var nh={array:"http://www.w3.org/2005/xpath-functions/array",fn:"http://www.w3.org/2005/xpath-functions",ixsl:"http://saxonica.com/ns/interactiveXSLT",map:"http://www.w3.org/2005/xpath-functions/map",math:"http://www.w3.org/2005/xpath-functions/math",saxon:"http://saxon.sf.net/",xml:"http://www.w3.org/XML/1998/namespace",xs:"http://www.w3.org/2001/XMLSchema",xsl:"http://www.w3.org/1999/XSL/Transform"},oh={},ph;for(ph in nh)oh[nh[ph]]=ph;
+// Input 67
+function qh(a,c){var n=new Bf(a.name,a.arity),F=dc.Aa;switch(a.uri){case Zb.map:F=dc.Jf;switch(a.name.local){case "get":F=c[0].l.valueType;break;case "merge":F=dc.Jf;break;case "entry":F=kc(new td(c[0].l,c[1].l))}return new Gf(n,c,F);case Zb.Ue:switch(a.name.local){case "_from-sequence":F=kc(new ud(c[0].l))}return new Hf(n,c,F);case Zb.wb:switch(a.name.local){case "apply":a=c[0].l,a=a.U?a.U:a,F=a.resultType?a.resultType:dc.Aa}return new Jf(n,c,F)}}
+class rh extends Se{constructor(a,c,n){var F=dc.Aa;super();this.name=La.XS.QName.fromParts(oh[n],n,a);this.arity=c;this.uri=n;this.l=dc.Qe;this.resultType=F}}rh.prototype.O="function";class sh{}sh.prototype.uri=Zb.Oa;class th extends sh{constructor(){super()}}th.prototype.uri=Zb.map;var uh=new th;class vh extends sh{constructor(){super()}}vh.prototype.uri=Zb.Ue;var wh=new vh;class xh extends sh{constructor(){super()}}xh.prototype.uri=Zb.wb;class yh extends xh{}var zh=new yh;
+// Input 68
+const Ah={FUNCTION:0,Tj:1,Ak:2,Gk:3,gk:4,ak:5,nk:6,zk:7,rk:8,Dk:9,Ek:10,fk:11,EVALUATE_RESULT:12,Vj:13,Rj:14,mk:15,Uj:16,Wj:17},Bh=["doc","id","element-with-id","key","root"];function Ch(a,c,n,F){return Ah[a]+"|"+c+"|"+n+"|"+F}function Dh(a,c,n,F){return{getMessage:function(){return c},Vf:F,Id:function(){return a},save:function(){return n}}}function Og(a,c){const n=cd.Ej(c).required;return Dh(a,n,c,function(F,I){return"Required type of "+n+" is "+F.toString()+": actual type is "+I.toString()})}
+class Vf{constructor(a,c){var n=null;this.name=a;this.arity=a.arity;if(c){this.xb=c;n=c.alphaTree;const F=[];let I;c.variadic&&(I=ic(n.a[0]));for(c=0;c""){return La.XS.QName.fromString(J,da=>""===da?ja():X(da))}function F(){const J=oe[r.J];return 201===r.J?'name "'+r.T+'"':-1===r.J?"(unknown token)":r.T&&r.T!==oe[r.J]?`${J} ("${r.T}")`:/^[a-z]+$/.test(J)?`"${J}"`:J}function I(J,X="XPST0003"){Ge(r);throw new ve(J,X);}function m(J){const X=Ge(r);console.log((J.startsWith("...")?
+"near":"in")+" "+X+":\n "+J)}function g(){try{r.next()}catch(J){I(J.message)}}function e(J){r.J!==J&&I('expected "'+oe[J]+'", found '+F())}function k(J=!1){J=v(J);let X=null;for(;7===r.J;){null==X&&(X=[],X.push(J));g();const ja=v();X.push(ja)}null!=X&&(J=new Pg(X));return J}function v(J=!1){switch(r.J){case 0:if(J)return nf();I("Expected an expression, but reached the end of the input");break;case 211:case 216:J=0;var X=r.J,ja=null,da=null;do{g();e(21);g();e(201);var ta=r.T,Ca=void 0;211===X?Ca=
+new eh:Ca=new fh;J++;ta=pa(ta,"");Ca.Za=ta;g();e(216===X?58:31);g();ea.push(null);Ca.j(v());ea.pop();ha(Ca);null==da?ja=Ca:da.g(Ca);da=Ca}while(7===r.J);e(25);g();da.g(v());for(Ca=0;Ca=X;){const Qa=r.J;var ja=t();switch(Qa){case 45:case 47:g();var da=u();a:switch(Qa){case 45:J=new yg(J,da);break a;case 47:J=Ng(J,da);break a;default:throw new we(oe[Qa]);}t()>=ja&&I("Left operand of '"+oe[r.J]+"' needs parentheses");break;case 46:case 57:g();var ta=void 0;if(69===r.J&&"union"===r.T)throw new G("Saxon union types not supported");e(201);if(r.T)a:{try{var Ca=n(r.T,R.vb,
+R.ic);break a}catch(Xa){I(Xa.message,Xa.code)}Ca=void 0}else Ca=I("Parser tokenization error NAME");da=Ca;da.uri!==Zb.mc&&I("Unknown simple type "+r.T+" in cast (SaxonJS is not schema-aware)");g();var Ka=213===r.J;Ka&&(r.J=204,g());const ib={numeric:"u",ENTITIES:"l",NMTOKENS:"l",IDREFS:"l"}[da.local]||"a";if("a"===ib){["anyType","anyAtomicType","NOTATION"].includes(da.local)&&I("Casting to xs:"+da.local+" is not possible (it's an abstract type)","XPST0080");ta=La.type[da.local];if(!ta)throw new G("Cannot find type "+
+da.toEQName());ta=new nc(ta)}J=(57===Qa?sf:pf)(J,ib,da,ta,Ka);t()>=ja&&I("Left operand of '"+oe[r.J]+"' needs parentheses");break;case 76:J=K(J);break;default:Ka=40===Qa;g();Ka&&ua.push(Vc(J.l,2));da=B();for(Ka&&ua.pop();t()>ja;)da=l(da,t());if(!(ja=t()!==ja))a:switch(r.J){case 50:case 51:case 55:case 53:case 54:case 52:case 6:case 22:case 14:case 12:case 13:case 11:case 20:case 38:case 39:case 29:ja=!1;break a;default:ja=!0}ja||I("Left operand of '"+oe[r.J]+"' needs parentheses");J=f(J,Qa,da)}}return J}
+function f(J,X,ja){switch(X){case 9:return new ih(J,ja);case 10:return new hh(J,ja);case 50:case 51:case 55:case 53:case 54:case 52:return new og(J,X,ja,R);case 6:case 22:case 14:case 12:case 13:case 11:if(R.te())X=new ng(J,X,ja,R);else{var da=R;ja=new mg(J,X,ja,da);if(J=2===ja.ea.l.fa&&2===ja.ga.l.fa&&hg[X]){J=ja.ea.l.U;var ta=ja.ga.l.U;const Ca=J.$().p,Ka=ta.$().p;J=jg(Ca)||jg(Ka)?Ca===Ka:J.isNumeric()&&ta.isNumeric()?!0:/^A[SZU]/.test(Ca)&&/^A[SZU]/.test(Ka)}X=J?new og(ja.ea,hg[X],ja.ga,da):ja}return X;
+case 20:case 38:case 39:return new sg(J,X,ja,R);case 29:return da=new kh(J,ja,R.te()),jh(da.ea)&&jh(da.ga)?(X=da.ea.value[0],da=da.ga.value[0],X=X.value>da.value?nf():X.value===da.value?new lf([X],dc.Ke):new lh(X,da)):X=da,X;case 30:X=[];if(J instanceof Cf&&"concat"===J.name.name.local&&J.name.name.uri===Zb.Oa)for(da of J.g)X.push(da);else da=Ch("BINARY_OP",0,"","concat"),ta=Og("FOTY0013",da),J=Jg(J,dc.ec,ta,da,R),X.push(J);da=Ch("BINARY_OP",1,"","concat");ta=Og("FOTY0013",da);ja=Jg(ja,dc.ec,ta,da,
+R);X.push(ja);X=Df("concat",X);X.l=dc.fc;return X;case 15:case 16:case 17:case 18:case 56:case 19:return new eg(J,X,ja,R);case 79:return X=ja,ja=La.XS.QName.fromParts("vv",Zb.zg,"otherwise"),da=new fh,da.Za=ja,da.j(J),ha(da),ja=Tg(da),J=[Df("exists",[ja]),mf([La.XS.boolean.Yc],dc.cb)],da.g(new ch(J,[ja,X])),da;case 1:case 23:case 24:return new $f(J,X,ja,1===Ba);case 81:return ja=Df("boolean",ja),bh(J,mf([La.XS.boolean.Yc],dc.cb),ja);case 80:return ja=Df("boolean",ja),bh(J,ja,mf([La.XS.boolean.be],
+dc.cb));default:throw new we(oe[X]);}}function B(){switch(r.J){case 16:g();var J=B();J=L(299,J);break;case 15:g();J=B();J=L(15,J);break;default:for(J=b();40===r.J;){g();ua.push(Vc(J.l,2));const X=b();ua.pop();J=new mh(J,X)}}return J}function L(J,X){if(kf(X)){const ja=X.value[0];return 299===J?mf([ja.pf()],X.l):X}return new eg(mf([La.XS.integer.fromNumber(0)],dc.Bd),J,X,R)}function y(){switch(r.J){case 36:case 3:case 201:case 208:case 70:case 207:case 69:case 205:case 206:case 35:case 202:case 209:case 5:case 21:case 43:case 4:return!0;
+case 60:return["ordered","unordered","map","array"].includes(r.T);default:return!1}}function b(){var J=r.ke;switch(r.J){case 2:return g(),J=new ag,y()?d(J):J;case 8:g();J=new ag;var X=new Yf(5,null);J=Ag(J,X);return d(J);default:201===r.J&&["true","false"].includes(r.T)&&m("The expression is looking for a child element named '"+r.T+"' - perhaps "+r.T+"() was intended? To avoid this warning, use child::"+r.T+" or ./"+r.T+".");201===r.J&&-1!==Ce(r.T)&&1!==Ba&&(0'");return null}function ca(J){function X(da){return da instanceof Ef||da instanceof vg&&X(da.g)}switch(r.J){case 21:return S();case 5:var ja=x();J&&X(ja)&&I("Predicate pattern cannot be parenthesized","XTSE0340");return ja;case 4:return M();case 202:return H(!0);case 209:return E(!0);case 35:return ja=r.T,0===Pa&&1===Ba&&(R.og=!0,J?Bh.includes(ja)||ja.includes(":")||I("Function "+ja+"() is not permitted at first position in pattern","XTSE0340"):I("Function call not at first position in pattern",
+"XTSE0340")),ja=fa(null),R.og=!1,ja;case 213:return aa(new Ef);case 205:return g(),new Ef(ua[ua.length-1]);case 206:return g(),new Yf(9,null);case 69:if("function"===r.T)return ia();case 201:case 208:case 70:case 207:return ja=3,69===r.J&&["attribute","schema-attribute"].includes(r.T)?ja=2:69===r.J&&"namespace-node"===r.T?ja=8:J&&69===r.J&&"document-node"===r.T&&(ja=12),J=V(1),new Yf(ja,J);case 3:g();switch(r.J){case 201:case 208:case 70:case 207:case 69:return ja=V(2),new Yf(2,ja);default:I("@ must be followed by a NodeTest")}break;
+case 36:try{ja=Pe(r.T)}catch(da){I(da.message),ja=3}J=Ne[ja];g();switch(r.J){case 201:case 208:case 70:case 207:case 69:J=V(J);let da=null;if(2===ja){const ta=sd.Ob(J,new Fc(2));ta===sd.dc?da="attribute axis can never yield nodes of type "+J:ta===sd.Sb&&(J=new Fc(2))}3===ja&&9===J.kind&&(da=J.name+" nodes can never be children");2!==J.kind||[2,12].includes(ja)||(da="axis "+Me(ja)+" can never yield attribute nodes");if(da){if(1===Ba)return new Xe(da);m(da);return nf()}return new Yf(ja,J);default:I("Unexpected token "+
+F()+" after axis name")}break;case 60:switch(r.T){case "map":return z();case "array":return W();case ".":return Y();case "_":I("Underscore functions not yet implemented")}break;case 43:return T();default:I("Unexpected token "+F()+" at start of expression")}}function x(){g();if(204===r.J)return g(),nf();const J=k();e(204);g();return J}function E(){const J=r.T?A(r.T):I("Parser tokenization error NUMBER");isNaN(J)&&I("Invalid numeric literal ("+r.T+")");g();return mf([J],"AO"===J.code?dc.ee:"AD"===J.code?
+dc.Gg:dc.Bd)}function A(J){try{return 0<=J.indexOf("e")||0<=J.indexOf("E")?La.XS.double.fromString(J):0<=J.indexOf(".")?La.XS.mb.fromString(J):La.XS.integer.fromString(J)}catch(X){return NaN}}function H(){var J=new of(r.T);g();return J}function S(){g();e(201);var J=r.T;g();const X=pa(J,"");J=ba(X);if(null!=J)var ja=Tg(J);else if(X.uri===Zb.zi&&0""));if(7===r.J){g();e(201);ta=!1;const Ka=n(r.T,R.vb,R.ic);Ka.uri===Zb.mc?1===da?["untyped","anyType"].includes(Ka.local)||(["untypedAtomic","anyAtomicType"].includes(Ka.local)?ta=!0:I("Unsupported type annotation "+r.T+" (SaxonJS is not schema-aware, so all nodes are untyped)")):["untypedAtomic",
+"anyAtomicType"].includes(Ka.local)||I("Unsupported type annotation "+r.T+" (SaxonJS is not schema-aware, so all nodes are untyped)"):I("Unsupported type annotation "+r.T+" (SaxonJS is not schema-aware, so only built-in types are recognized)");g();213===r.J&&g();e(204);g();if(ta)return Cc;if("*"===Ca)return ld(da);Ca=n(Ca,R.vb,1===da?R.ic:()=>"");return new nd(da,Ca)}I("Expected ')' or ',' in SequenceType");return null;case "schema-attribute":case "schema-element":return I("Type "+X+"() not allowed: SaxonJS is not schema-aware"),
+null;default:return I("Unknown node kind "+X),null}}function z(){var J=[];g();var X=[];let ja=!0;if(215!==r.J)for(;;){var da=v();e(75);g();const ta=v(),Ca=Ch("FUNCTION",0,"","map:entry"),Ka=Og("XPTY0004",Ca);da=Jg(da,dc.Oe,Ka,Ca,R);!ja||da instanceof lf?-1===X.indexOf(da)?X.push(da):ja=!1:ja=!1;da=new Wf(da,ta);J.push(da);if(215===r.J)break;else e(7),g()}ze(r);g();if(0===J.length)return qh(new rh("_new",1,uh.uri),[]);if(1===J.length)return J[0];if(ja){const ta=[];J.forEach(Ca=>{ta.push([Ca.key,Ca.value])});
+return new Xf(ta)}J=new Pg(J);X=[];X=new Xf([[new of("duplicates"),new of("reject")],[new of("duplicates-error-code"),new of("XQDY0137")]]);return qh(new rh("merge",2,uh.uri),[J,X])}function M(){const J=[];g();if(203===r.J)return g(),new Mf(J);for(;;){const X=v();J.push(X);if(7===r.J)g();else{if(203===r.J){g();break}I("Expected ',' or ']', found "+oe[r.J])}}return new Mf(J)}function W(){g();const J=new rh("_from-sequence",1,wh.uri);if(215===r.J)return ze(r),g(),qh(J,[nf()]);const X=k();e(215);ze(r);
+g();return qh(J,[X])}function fa(J){function X(){if(209===r.J)return E(!0);if(202===r.J)return H(r.T);if(21===r.J)return S();I("The arguments to a function call in a pattern must be literals or variable references","XTSE0340")}var ja=r.T,da=r.ke;const ta=[];null!=J&&ta.push(J);J=w(ja);ja=null;1===Ba&&J.uri===Zb.Oa&&["current-group","current-grouping-key","current-merge-group","current-merge-key"].includes(J.local)&&I(J.local+"() is not permitted in a pattern","XTSE1060");g();if(204!==r.J){for(;;){var Ca=
+R.og?X():Z();if(null==Ca||Ca instanceof Qf)null==ja&&(ja=[]),ja.push(ta.length);ta.push(Ca);if(7===r.J)g();else break}e(204)}g();Ca=new Bf(J,ta.length);if(null!=ja)return da=R.ff().fg(Ca,R),null==da&&I("No function "+J.toString()+"#"+ta.length+" is known for partial application","XPST0017"),new Uf(da,ta,ja);ja=[];Ca=R.ff().bind(Ca,ta,R,ja);return null==Ca?U(R,da,J,ta,ja):Ca}function U(J,X,ja,da,ta){let Ca="Cannot find a "+da.length+"-argument function named "+ja.toEQName()+"()";for(var Ka of ta)Ca+=
+". "+Ka;ta=!1;for(Ka=0;KaJ.value||J.value>Number.MAX_SAFE_INTEGER)&&I("Number following '#' is out of range","FOAR0002");J=J.value;g();let ta=null;try{ta=n(X,da.vb,da.qh)}catch(Ka){I(Ka.message,Ka.code)}X=da.ff();const Ca=new Bf(ta,J);da=X.fg(Ca,da);null==da&&I("Function "+ta.toEQName()+"#"+J+" not found","XPST0017",ja);return da.xb.wh&&!ta.hasURI(re.ci)?new Pf(da):new Of(da)}function ha(J){J.slot=ea.length;ea.push(J)}function ba(J){for(let X=ea.length-1;0<=X;X--){const ja=ea[X];if(ja&&
+ja.hd().equals(J))return ja}}function va(J,X){return n(J,R.vb,()=>X)}function pa(J,X){try{return va(J,X)}catch(ja){I(ja.message,ja.code)}}function h(J,X){if(X.startsWith("Q{"))return new pd(J,X.substring(2,X.length-2));try{const ja=n(X+":dummy",R.vb,()=>"");return new pd(J,ja.getURI())}catch(ja){return I(ja.message,ja.code),null}}function C(J,X){te(X)||I("Local name ["+X+"] contains invalid characters");return new od(J,X)}function Q(J,X,ja,da=!1){this.global=da;this.Za=this.name=J;this.cc=X;this.slot=
+ja}let r,O,R={},ea=[],ua=[],Ba=0,Fa=0,Pa=0;const Ua=[],Na={fg:function(J,X){X=X.getContext();return(X=Eh.getFnSignature(J.name,J.arity,X))?new Vf(J,X):null},bind:function(J,X,ja){var da=ja.getContext(),ta=Eh.getFnSignature(J.name,J.arity,da);if(ta){if(J.name.uri===Zb.Oa)switch(J.name.local){case "false":return mf([La.XS.boolean.be],dc.cb);case "true":return mf([La.XS.boolean.Yc],dc.cb);case "normalize-unicode":1===X.length&&X.push(new of("NFC"));break;case "copy-of":return new ah(X[0]?X[0]:new Ef(ua[ua.length-
+1]));case "current-group":return new Zg;case "current-grouping-key":return new $g;default:ta.defaultToDot&&0===J.arity&&ta.arity.includes(0)&&(X.push(new Ef(ua[ua.length-1])),J.arity++)}else if(ta.isIdempotent&&1===X.length)return X[0];da=[];var Ca;const Qa=ta.alphaTree;Qa&&"F"===Qa.p&&!Qa.r&&(Qa.r={p:"",o:"*"});Qa&&"F"===Qa.p&&Qa.a&&Qa.r||sa.la("Bad function signature for "+J.name.local);ta.variadic&&(Ca=Qa.a[0]);const ib=ta.collation||-1;for(let Xa=0;XaX.length-1&&da.push(new of(ja.Vb));X=ic(Qa.r);if(ta.isUserFunction)return new Nf(J,da,X,ta.componentBinding);switch(J.name.uri){case Zb.Oa:case Zb.mc:switch(J.name.local){case "current":ua[0]&&(X=ua[0]);break;case "accumulator-before":case "accumulator-after":if(da[0]instanceof
+of){ta=n(da[0].value[0].value,ja.vb,()=>"").toEQName();ja=ja.Gb[ta];if(!ja)throw new G("Unknown accumulator "+ta,"XTDE3340");X=ec(ja);da[0]=new of(ta)}}return new Cf(J,da,X);case Zb.map:return new Gf(J,da,X);case Zb.Ue:return new Hf(J,da,X);case Zb.yh:return new If(J,da,X);case Zb.wb:return new Jf(J,da,X);case Zb.nd:return new Kf(J,da,X);case Zb.xh:return new Lf(J,da,X);default:return ta.wh?new Nf(J,da,X,ta.Jk):new Jf(J,da,X)}}else{if(ta=Eh.getFnSignature(J.name,null,da))if(ta&&!ta.alphaTree&&(ta.alphaTree=
+rb(ta.sig)),da=X.length,Ca=ta.alphaTree.a.length,da!==Ca&&(ta.variadic?X.length"",Vb:"http://www.w3.org/2005/xpath-functions/collation/codepoint",qe:!1,fb:{},Gb:{},bb:!1,Kc:!1,dg:!1,Ub:!1,
+Fj:function(){R.ic=()=>"";R.Vb="http://www.w3.org/2005/xpath-functions/collation/codepoint";R.fb={};R.Gb={};R.bb=!1;R.Kc=!1;R.dg=!1;R.Ub=!1},getContext:function(){return{bb:R.bb,Wk:1===Ba,fb:R.fb}},Ni:function(){return R.Vb},qh:function(){return Zb.Oa},ff:function(){return Na},Qk:function(){return null},Vk:function(){return!1},te:function(){return R.Ub},bl:function(){return null}};let Wa={};Q.prototype.hd=function(){return this.name};return{process:function(J,X,ja,da,ta=!1,Ca=!1,Ka=!1){a();O=J;Ba=
+X?1:0;J=[];Wa={};R.Fj();R.vb=c;X&&(R.bb=!0);Ka&&(R.dg=!0);if(da){Fa=da.jf?1:0;da.Kc&&(R.Kc=!0);for(var Qa in da.namespaces)Wa[Qa]=da.namespaces[Qa];for(var ib in da.Ic){Qa=n(ib,R.vb,()=>"");const qb=da.Ic[ib],Kh=ec(qb.getAttribute("sType"));J.push(new Q(Qa,Kh,qb,!0))}for(var Xa in da.bc)ib=n(Xa,R.vb,()=>""),J.push(new Q(ib,da.wd[Xa],da.bc[Xa]));ea=J;R.Gb=da.Gb;da.qe&&(R.qe=da.qe);da.Vb&&(R.Vb=da.Vb);da.fb&&(R.fb=da.fb);da.bb&&(R.bb=da.bb);da.Ub&&(R.Ub=da.Ub);da.xe&&(ua=[Vc(da.xe,2)]);da.xpathDefaultNamespace&&
+(R.ic=()=>da.xpathDefaultNamespace);R.Ia=da.Ia?da.Ia:null}Xa="";for(const qb in Wa)J=Wa[qb],J=J===Zb.withPrefix[qb]?"~":J,Xa+=qb+"="+J+" ";De(r,O);let pb;try{pb=k(Ca)}catch(qb){throw qb instanceof G&&da&&da.Lj&&(qb.code=da.Lj,qb.message="Invalid XPath expression supplied to xsl:evaluate {"+O+"}: "+qb.message),qb;}0!==r.J&&I("Found "+F()+" beyond end of expression");X?(pb=pb.Ga(),pb instanceof hf&&ja&&(pb=new jf(gf(pb)))):da&&da.Ce&&(X=Ch("EVALUATE_RESULT",0,"",null),ja=Og("XPTY0004",X),pb=Jg(pb,da.Ce,
+ja,X));X=ta?new Fh:new Gh;pb.G(X);X=X.current;ta?(X=X.documentElement,pb.l&&X.setAttribute("sType",pb.l.ha()),""!==Xa&&X.setAttribute("ns",Xa),da&&da.Ia&&X.setAttribute("baseUri",da.Ia)):(X=X.C[0],""!==Xa&&(X.gl=Xa),da&&da.Ia&&(X.pb=da.Ia),Ka&&0qb.Za.toEQName())));return X},parseSequenceType:function(J,X,ja){a();R.vb=X;R.ic=ja;Ba=0;Wa={};De(r,J);J=u();0!==r.J&&I("Unexpected "+F()+" after SequenceType");return J},getTokenizer:function(){return r}}}();
+function Gh(){this.g=[];this.current={C:[]}}Gh.prototype={start:function(a,c={}){a={N:a,C:[]};for(const n in c)a[n]=c[n];this.current.C.push(a);this.g.push(this.current);this.current=a},ud:function(a,c){this.current[a]=c},end:function(){this.current=this.g.pop()}};function Fh(){this.j=Jd.find("SaxonJS").getPlatform().createDocument();this.g=[];this.current=this.j}
+Fh.prototype={start:function(a,c={}){a=this.j.createElement(a);for(const n in c)a.setAttribute(n,c[n]);this.current.appendChild(a);this.g.push(this.current);this.current=a},ud:function(a,c){this.current.setAttribute(a,c)},end:function(){this.current=this.g.pop()}};
+// Input 69
+const Ih={ul:{QuantifiedExpr:"1AB",OrExpr:"1AB",AndExpr:"1AB",ComparisonExpr:"1AB",StringConcatExpr:"1AS",RangeExpr:"*ADI",AdditiveExpr:"?A",MultiplicativeExpr:"?A",IntersectExceptExpr:"*N",InstanceOfExpr:"1AB",CastableExpr:"1AB",UnaryExpr:"?A m[UO,UD,UF]",StringLiteral:"1AS",IntegerLiteral:"1ADI",DecimalLiteral:"1AD",DoubleLiteral:"1AO",NamedFunctionRef:"1F",InlineFunctionExpr:"1F",MapExpr:"1FM",Root:"1ND"},Qj:{"http://www.w3.org/2005/xpath-functions":{QName:{sig:"1F r[1AQ] a[?AS,1AS]"},abs:{sig:"1F r[?A m[AO,AD,AF]] a[?A m[AO,AD,AF]]"},
+"accumulator-after":{XSLTonly:!0,sig:"1F a[1AS] r[*]"},"accumulator-before":{XSLTonly:!0,sig:"1F a[1AS] r[*]"},"adjust-date-to-timezone":{arity:[1,2],sig:"1F r[?AA] a[?AA,?ARD]"},"adjust-dateTime-to-timezone":{arity:[1,2],sig:"1F r[?AM] a[?AM,?ARD]"},"adjust-time-to-timezone":{arity:[1,2],sig:"1F r[?AT] a[?AT,?ARD]"},"analyze-string":{arity:[2,3],sig:"1F r[1NE nQ{http://www.w3.org/2005/xpath-functions}analyze-string-result] a[?AS,1AS,1AS]"},apply:{sig:"1F a[1F,1FA] r[*]"},"available-environment-variables":{sig:"1F r[*AS] a[]"},
+"available-system-properties":{XSLTonly:!0,sig:"1F r[*AQ] a[]"},avg:{sig:"1F r[?A] a[*A]"},"base-uri":{defaultToDot:!0,arity:[0,1],sig:"1F r[?AU] a[?N]"},"boolean":{sig:"1F r[1AB] a[*]"},ceiling:{sig:"1F r[?A m[AO,AD,AF]] a[?A m[AO,AD,AF]]"},"codepoint-equal":{sig:"1F r[?AB] a[?AS,?AS]"},"codepoints-to-string":{sig:"1F r[1AS] a[*ADI]"},"collation-key":{arity:[1,2],collation:1,sig:"1F r[1A2] a[1AS,1AS]"},collection:{arity:[0,1],sig:"1F a[?AS] r[*]"},compare:{arity:[2,3],collation:2,sig:"1F r[?ADI] a[?AS,?AS,1AS]"},
+concat:{arity:[2,Infinity],sig:"1F r[1AS] a[?A,?A]",variadic:!0},contains:{arity:[2,3],collation:2,sig:"1F r[1AB] a[?AS,?AS,1AS]"},"contains-token":{arity:[2,3],collation:2,sig:"1F r[1AB] a[*AS,1AS,1AS]"},"copy-of":{XSLTonly:!0,defaultToDot:!0,arity:[0,1],sig:"1F a[*] r[*]"},count:{sig:"1F r[1ADI] a[*]"},current:{XSLTonly:!0,sig:"1F r[1] a[]"},"current-date":{sig:"1F r[1AA] a[]"},"current-dateTime":{sig:"1F r[1AMP] a[]"},"current-group":{XSLTonly:!0,sig:"1F a[] r[*]"},"current-grouping-key":{XSLTonly:!0,
+sig:"1F r[*A] a[]"},"current-merge-group":{XSLTonly:!0,arity:[0,1],sig:"1F a[1AS] r[*]"},"current-merge-key":{XSLTonly:!0,sig:"1F r[*A] a[]"},"current-output-uri":{XSLTonly:!0,sig:"1F r[?AU] a[]"},"current-time":{sig:"1F r[1AT] a[]"},data:{defaultToDot:!0,arity:[0,1],sig:"1F r[*A] a[*]"},dateTime:{sig:"1F r[?AM] a[?AA,?AT]"},"day-from-date":{sig:"1F r[?ADI] a[?AA]"},"day-from-dateTime":{sig:"1F r[?ADI] a[?AM]"},"days-from-duration":{sig:"1F r[?ADI] a[?AR]"},"deep-equal":{arity:[2,3],collation:2,sig:"1F r[1AB] a[*,*,1AS]"},
+"default-collation":{sig:"1F r[1AS] a[]"},"default-language":{sig:"1F r[1ASNTL] a[]"},"distinct-values":{arity:[1,2],collation:1,sig:"1F r[*A] a[*A,1AS]"},doc:{sig:"1F r[?ND] a[?AS]"},"doc-available":{sig:"1F r[1AB] a[?AS]"},document:{XSLTonly:!0,arity:[1,2],sig:"1F r[*N] a[*,1N]"},"document-uri":{defaultToDot:!0,arity:[0,1],sig:"1F r[?AU] a[?N]"},"element-available":{XSLTonly:!0,sig:"1F r[1AB] a[1AS]"},"element-with-id":{defaultToDot:!0,arity:[1,2],sig:"1F r[*NE] a[*AS,1N]"},empty:{sig:"1F r[1AB] a[*]"},
+"encode-for-uri":{sig:"1F r[1AS] a[?AS]"},"ends-with":{arity:[2,3],collation:2,sig:"1F r[1AB] a[?AS,?AS,1AS]"},"environment-variable":{sig:"1F r[?AS] a[1AS]"},error:{arity:[0,1,2,3],sig:"1F r[0E] a[?AQ,1AS,*]"},"escape-html-uri":{sig:"1F r[1AS] a[?AS]"},"exactly-one":{sig:"1F r[1] a[*]"},exists:{sig:"1F r[1AB] a[*]"},"false":{sig:"1F r[1AB] a[]"},filter:{sig:"1F r[*] a[*,1F r[1AB] a[1]]"},floor:{sig:"1F r[?A m[AO,AD,AF]] a[?A m[AO,AD,AF]]"},"fold-left":{sig:"1F a[*,*,1F a[*,1] r[*]] r[*]"},"fold-right":{sig:"1F a[*,*,1F a[1,*] r[*]] r[*]"},
+"for-each":{sig:"1F a[*,1F a[1] r[*]] r[*]"},"for-each-pair":{sig:"1F a[*,*,1F a[1,1] r[*]] r[*]"},"format-date":{arity:[2,5],sig:"1F r[?AS] a[?AA,1AS,?AS,?AS,?AS]"},"format-dateTime":{arity:[2,5],sig:"1F r[?AS] a[?AM,1AS,?AS,?AS,?AS]"},"format-integer":{arity:[2,3],sig:"1F r[1AS] a[?ADI,1AS,?AS]"},"format-number":{arity:[2,3],sig:"1F r[1AS] a[?A m[AO,AD,AF],1AS,?AS]"},"format-time":{arity:[2,5],sig:"1F r[?AS] a[?AT,1AS,?AS,?AS,?AS]"},"function-arity":{sig:"1F r[1ADI] a[1F]"},"function-available":{XSLTonly:!0,
+arity:[1,2],sig:"1F r[1AB] a[1AS,1ADI]"},"function-lookup":{sig:"1F r[?F] a[1AQ,1ADI]"},"function-name":{sig:"1F r[?AQ] a[1F]"},"generate-id":{defaultToDot:!0,arity:[0,1],sig:"1F r[1AS] a[?N]"},"has-children":{defaultToDot:!0,arity:[0,1],sig:"1F r[1AB] a[?N]"},head:{sig:"1F r[?] a[*]"},"hours-from-dateTime":{sig:"1F r[?ADI] a[?AM]"},"hours-from-duration":{sig:"1F r[?ADI] a[?AR]"},"hours-from-time":{sig:"1F r[?ADI] a[?AT]"},id:{defaultToDot:!0,arity:[1,2],sig:"1F r[*NE] a[*AS,1N]"},idref:{defaultToDot:!0,
+arity:[1,2],sig:"1F r[*N] a[*AS,1N]"},"implicit-timezone":{sig:"1F r[1ARD] a[]"},"in-scope-prefixes":{sig:"1F r[*AS] a[1NE]"},"index-of":{arity:[2,3],collation:2,sig:"1F r[*ADI] a[*A,1A,1AS]"},innermost:{sig:"1F r[*N] a[*N]"},"insert-before":{sig:"1F a[*,1ADI,*] r[*]"},"iri-to-uri":{sig:"1F r[1AS] a[?AS]"},"json-doc":{arity:[1,2],sig:"1F r[?] a[?AS,1FM]"},"json-to-xml":{arity:[1,2],sig:"1F r[?ND] a[?AS,1FM]"},key:{XSLTonly:!0,arity:[2,3],sig:"1F r[*N] a[1AS,*A,1N]"},lang:{defaultToDot:!0,arity:[1,
+2],sig:"1F r[1AB] a[?AS,1N]"},last:{sig:"1F r[1ADI] a[]"},"load-xquery-module":{arity:[1,2],sig:"1F r[1FM] a[1AS,1FM]"},"local-name":{defaultToDot:!0,arity:[0,1],sig:"1F r[1AS] a[?N]"},"local-name-from-QName":{sig:"1F r[?ASNTNC] a[?AQ]"},"lower-case":{sig:"1F r[1AS] a[?AS]"},matches:{arity:[2,3],sig:"1F r[1AB] a[?AS,1AS,1AS]"},max:{arity:[1,2],collation:1,sig:"1F r[?A] a[*A,1AS]"},min:{arity:[1,2],collation:1,sig:"1F r[?A] a[*A,1AS]"},"minutes-from-dateTime":{sig:"1F r[?ADI] a[?AM]"},"minutes-from-duration":{sig:"1F r[?ADI] a[?AR]"},
+"minutes-from-time":{sig:"1F r[?ADI] a[?AT]"},"month-from-date":{sig:"1F r[?ADI] a[?AA]"},"month-from-dateTime":{sig:"1F r[?ADI] a[?AM]"},"months-from-duration":{sig:"1F r[?ADI] a[?AR]"},name:{defaultToDot:!0,arity:[0,1],sig:"1F r[1AS] a[?N]"},"namespace-uri":{defaultToDot:!0,arity:[0,1],sig:"1F r[1AU] a[?N]"},"namespace-uri-for-prefix":{sig:"1F r[?AU] a[?AS,1NE]"},"namespace-uri-from-QName":{sig:"1F r[?AU] a[?AQ]"},nilled:{defaultToDot:!0,arity:[0,1],sig:"1F r[?AB] a[?N]"},"node-name":{defaultToDot:!0,
+arity:[0,1],sig:"1F r[?AQ] a[?N]"},"normalize-space":{arity:[0,1],sig:"1F r[1AS] a[?AS]"},"normalize-unicode":{arity:[1,2],sig:"1F r[1AS] a[?AS,1AS]"},not:{sig:"1F r[1AB] a[*]"},number:{defaultToDot:!0,arity:[0,1],sig:"1F r[1AO] a[?A]"},"one-or-more":{sig:"1F r[+] a[*]"},outermost:{sig:"1F r[*N] a[*N]"},"parse-ietf-date":{sig:"1F r[?AM] a[?AS]"},"parse-json":{arity:[1,2],sig:"1F r[?] a[?AS,1FM]"},"parse-xml":{sig:"1F r[?ND e[NE]] a[?AS]"},"parse-xml-fragment":{sig:"1F r[?ND] a[?AS]"},path:{defaultToDot:!0,
+arity:[0,1],sig:"1F r[?AS] a[?N]"},position:{sig:"1F r[1ADI] a[]"},"prefix-from-QName":{sig:"1F r[?ASNTNC] a[?AQ]"},"random-number-generator":{arity:[0,1],sig:"1F r[1FM k[AS] v[1]] a[?A]"},"regex-group":{XSLTonly:!0,sig:"1F r[1AS] a[1ADI]"},remove:{sig:"1F r[*] a[*,1ADI]"},replace:{arity:[3,4],sig:"1F r[1AS] a[?AS,1AS,1AS,1AS]"},"resolve-QName":{sig:"1F r[?AQ] a[?AS,1NE]"},"resolve-uri":{arity:[1,2],sig:"1F r[?AU] a[?AS,1AS]"},reverse:{sig:"1F a[*] r[*]"},root:{defaultToDot:!0,arity:[0,1],sig:"1F r[?N] a[?N]"},
+round:{arity:[1,2],sig:"1F r[?A m[AO,AD,AF]] a[?A m[AO,AD,AF],1ADI]"},"round-half-to-even":{arity:[1,2],sig:"1F r[?A m[AO,AD,AF]] a[?A m[AO,AD,AF],1ADI]"},"seconds-from-dateTime":{sig:"1F r[?AD] a[?AM]"},"seconds-from-duration":{sig:"1F r[?AD] a[?AR]"},"seconds-from-time":{sig:"1F r[?AD] a[?AT]"},serialize:{arity:[1,2],sig:"1F r[1AS] a[*,?]"},snapshot:{XSLTonly:!0,defaultToDot:!0,arity:[0,1],sig:"1F a[*] r[*]"},sort:{arity:[1,2,3],collation:1,sig:"1F r[*] a[*,?AS,1F r[*A] a[1]]"},"starts-with":{arity:[2,
+3],collation:2,sig:"1F r[1AB] a[?AS,?AS,1AS]"},"static-base-uri":{sig:"1F r[?AU] a[]"},"stream-available":{XSLTonly:!0,sig:"1F r[1AB] a[?AS]"},string:{defaultToDot:!0,arity:[0,1],sig:"1F r[1AS] a[?]"},"string-join":{arity:[1,2],sig:"1F r[1AS] a[*A,1AS]"},"string-length":{arity:[0,1],sig:"1F r[1ADI] a[?AS]"},"string-to-codepoints":{sig:"1F r[*ADI] a[?AS]"},subsequence:{arity:[2,3],sig:"1F a[*,1AO,1AO] r[*]"},substring:{arity:[2,3],sig:"1F r[1AS] a[?AS,1AO,1AO]"},"substring-after":{arity:[2,3],collation:2,
+sig:"1F r[1AS] a[?AS,?AS,1AS]"},"substring-before":{arity:[2,3],collation:2,sig:"1F r[1AS] a[?AS,?AS,1AS]"},sum:{arity:[1,2],sig:"1F r[?A] a[*A,?A]"},"system-property":{XSLTonly:!0,sig:"1F r[1AS] a[1AS]"},tail:{sig:"1F a[*] r[*]"},"timezone-from-date":{sig:"1F r[?ARD] a[?AA]"},"timezone-from-dateTime":{sig:"1F r[?ARD] a[?AM]"},"timezone-from-time":{sig:"1F r[?ARD] a[?AT]"},tokenize:{arity:[1,2,3],sig:"1F r[*AS] a[?AS,1AS,1AS]"},trace:{arity:[1,2],sig:"1F a[*,1AS] r[*]"},transform:{sig:"1F r[1FM] a[1FM]"},
+translate:{sig:"1F r[1AS] a[?AS,1AS,1AS]"},"true":{sig:"1F r[1AB] a[]"},"type-available":{XSLTonly:!0,sig:"1F r[1AB] a[1AS]"},unordered:{sig:"1F r[*] a[*]"},"unparsed-entity-public-id":{XSLTonly:!0,arity:[1,2],sig:"1F r[1AS] a[1AS,1N]"},"unparsed-entity-uri":{XSLTonly:!0,arity:[1,2],sig:"1F r[1AU] a[1AS,1N]"},"unparsed-text":{arity:[1,2],sig:"1F r[?AS] a[?AS,1AS]"},"unparsed-text-available":{arity:[1,2],sig:"1F r[1AB] a[?AS,1AS]"},"unparsed-text-lines":{arity:[1,2],sig:"1F r[*AS] a[?AS,1AS]"},"upper-case":{sig:"1F r[1AS] a[?AS]"},
+"uri-collection":{arity:[0,1],sig:"1F r[*AU] a[?AS]"},"xml-to-json":{arity:[1,2],sig:"1F r[?AS] a[?N,1FM]"},"year-from-date":{sig:"1F r[?ADI] a[?AA]"},"year-from-dateTime":{sig:"1F r[?ADI] a[?AM]"},"years-from-duration":{sig:"1F r[?ADI] a[?AR]"},"zero-or-one":{sig:"1F r[?] a[*]"}},"http://www.w3.org/2005/xpath-functions/array":{append:{sig:"1F r[1FA] a[1FA,*]"},filter:{sig:"1F r[1FA] a[1FA,1F r[1AB] a[*]]"},flatten:{sig:"1F a[*] r[*]"},"fold-left":{sig:"1F a[1FA,*,1F a[*,*]] r[*]"},"fold-right":{sig:"1F a[1FA,*,1F a[*,*]] r[*]"},
+"for-each":{sig:"1F r[1FA] a[1FA,1F a[*]]"},"for-each-pair":{sig:"1F r[1FA] a[1FA,1FA,1F a[*,*]]"},get:{sig:"1F a[1FA,1ADI] r[*]"},head:{sig:"1F a[1FA] r[*]"},"insert-before":{sig:"1F r[1FA] a[1FA,1ADI,*]"},join:{sig:"1F r[1FA] a[*FA]"},put:{sig:"1F r[1FA] a[1FA,1ADI,*]"},remove:{sig:"1F r[1FA] a[1FA,*ADI]"},reverse:{sig:"1F r[1FA] a[1FA]"},size:{sig:"1F r[1ADI] a[1FA]"},sort:{arity:[1,2,3],collation:1,sig:"1F r[1FA] a[1FA,?AS,1F r[*A] a[*]]"},subarray:{arity:[2,3],sig:"1F r[1FA] a[1FA,1ADI,1ADI]"},
+tail:{sig:"1F r[1FA] a[1FA]"}},"http://www.w3.org/2005/xpath-functions/map":{contains:{sig:"1F r[1AB] a[1FM,1A]"},entry:{sig:"1F r[1FM] a[1A,*]"},find:{sig:"1F r[1FA] a[*,1A]"},"for-each":{sig:"1F r[*] a[1FM,1F a[1A,*]]"},get:{sig:"1F a[1FM,1A] r[*]"},keys:{sig:"1F r[*A] a[1FM]"},merge:{arity:[1,2],sig:"1F r[1FM] a[*FM,1FM]"},put:{sig:"1F r[1FM] a[1FM,1A,*]"},remove:{sig:"1F r[1FM] a[1FM,*A]"},size:{sig:"1F r[1ADI] a[1FM]"}},"http://www.w3.org/2005/xpath-functions/math":{acos:{sig:"1F r[?AO] a[?AO]"},
+asin:{sig:"1F r[?AO] a[?AO]"},atan:{sig:"1F r[?AO] a[?AO]"},atan2:{sig:"1F r[1AO] a[1AO,1AO]"},cos:{sig:"1F r[?AO] a[?AO]"},exp:{sig:"1F r[?AO] a[?AO]"},exp10:{sig:"1F r[?AO] a[?AO]"},log:{sig:"1F r[?AO] a[?AO]"},log10:{sig:"1F r[?AO] a[?AO]"},pi:{sig:"1F r[1AO] a[]"},pow:{sig:"1F r[?AO] a[?AO,1A m[AO,AD,AF]]"},sin:{sig:"1F r[?AO] a[?AO]"},sqrt:{sig:"1F r[?AO] a[?AO]"},tan:{sig:"1F r[?AO] a[?AO]"}}}};
+// Input 70
+var Jh=function(){const a={};a[Zb.wb]={apply:{sig:"1F r[*] a[1F,1FA]"},"column-number":{arity:[0,1],sig:"1F r[1ADI] a[1N]"},"compile-XPath":{arity:[1,2,3],sig:"1F r[1ND] a[1AS,?,?]"},"compile-GlobalContext":{sig:"1F r[1] a[1FM,1FM,1FM]"},"discard-document":{sig:"1F r[1ND] a[1ND]"},"has-uniform-namespaces":{sig:"1F r[1AB] a[1N]"},"line-number":{arity:[0,1],sig:"1F r[1ADI] a[1N]"},"marshal-type":{sig:"1F r[1FM] a[1AS]"},"message-count":{sig:"1F r[1ADI] a[?AQ]"},"parse-sequence-type":{arity:[2,3],sig:"1F r[1FM] a[1AS,1NE,?AS]"},
+"parse-XPath":{arity:[1,2,3],sig:"1F r[1ND] a[1AS,?AS,?]"},permute:{sig:"1F r[*] a[*]"},"system-id":{sig:"1F r[*AU] a[]"},timestamp:{sig:"1F r[1AMP] a[]"}};a[Zb.nd]={apply:{sig:"1F r[*] a[1F,1FA]"},call:{sig:"1F r[*] a[1,1AS,1FA]"},contains:{sig:"1F r[1AB] a[1,1AS]"},eval:{sig:"1F r[*] a[1AS]"},event:{sig:"1F r[?] a[]"},get:{sig:"1F r[*] a[1,1AS]"},location:{sig:"1F r[1AS] a[]"},page:{sig:"1F r[1N] a[]"},"query-params":{sig:"1F r[1FM] a[]"},source:{sig:"1F r[?N] a[]"},style:{sig:"1F r[1FM] a[?N]"},
+window:{sig:"1F r[1] a[]"}};a["http://exslt.org/common"]={"node-set":{sig:"1F r[?N] a[?N]",isIdempotent:!0}};return{Ri:function(c){return a[c]},Nf:function(c){const n=c.namespace;c=c.signatures;let F=a[n];F||(F={},a[n]=F);Object.entries(c).forEach(I=>{F[I[0]]=I[1]})}}}();
+// Input 71
+var Lh=function(){function a(y){var b;var d={};for(b in y){var q=y[b];d[b]=q}return d}function c(){}function n(y){const b={};if(y){y=y.split(" ");for(let q=0;qu?oa:u;q.qd=u+1}q.Gj(y);if(y=b.slotTypes)for(P in y)q.wd[P]=ic(y[P]);for(la in d)q.namespaces[la]=d[la];q.namespaces[""]="";if(d=b.staticTyping)q.vf=d;if(d=b.xpathDefaultNamespace)q.xpathDefaultNamespace=
+d;if(d=b.defaultCollation)q.Vb=d;if(d=b.staticBaseURI)q.staticBaseURI=d;(d=b.contextType)?q.type=new gc(jc(d),2):q.type=q.bb?null:dc.nc;q.xe=q.type;if(b=b.requiredType)q.Ce=ec(b);return q}function m(y){const b=new c;b.type=dc.nc;b.aa(y.params,y.inputConvert);"fn xs map array math saxon ixsl".split(" ").forEach(p=>b.namespaces[p]=nh[p]);for(var d in y.namespaceContext)b.namespaces[d]=y.namespaceContext[d];y.xpathDefaultNamespace&&(b.xpathDefaultNamespace=y.xpathDefaultNamespace);let q;if(y=y.slotMap){d=
+-1;let p;for(q in y)p=y[q],b.bc[q]=p,d=p>d?p:d;b.qd=d+1}return b}function g(y,b,d){y=Hh.process(y,"pattern"===b.type,b.splitPattern,d,"XSLT"===b.language,b.allowEmpty,b.freeVariables);return Pb(y)}function e(y,b=!1){const d={"function":{},globalVariable:{},globalParam:{}};for(const p in y){if("PRIVATE"===y[p].visibility)continue;var q=y[p].actor;const u=ac.X(q)?q.nodeName:q.N,P=ac.X(q)?q.getAttribute("name"):q.name;switch(u){case "function":if(b&&"PUBLIC"!==y[p].visibility&&"FINAL"!==y[p].visibility)break;
+q=(ac.X(q)?ac.Fc(q,"arg"):F(q)).length;d[u][P+"#"+q]=y[p];break;case "globalVariable":case "globalParam":d[u][P]=y[p]}}return d}function k(y,b=!0){const d={N:y.nodeName};var q=y.attributes,p;for(p=0;pparseInt(q,10)),actor:b,C:[b]};return b.parentNode=y}function D(y){if(!ac.X(y))return[];let b=[];y.childNodes.forEach(d=>b=b.concat(D(d)));return b}function l(y,b){"ufRef"===y.nodeName?y.setAttribute("bSlot",b[y.getAttribute("name")]):y.hasChildNodes()&&y.childNodes.forEach(d=>l(d,b))}function f(y,b,d){var q=Jd.find("SaxonJS");const p=q.XError,u=q.convertResult;var P=q.getPlatform(),la=P.inBrowser();d||={};d.params||(d.params={});if(y.freeV){const A=
+d.params;let H={};y.freeV.forEach(S=>{const N=S.startsWith("Q{}")?A[S.substring(3)]:A[S];if(!N)throw new p("A value for parameter "+S+" is required","SXJS9999");H[S]=N});d.params=H}q=d.inputConvert||"strong";const oa=m(d);let K=y.C[0];K.parentNode=y;const ca={name:"evaluate",Ya:y,hb:{}};y=new ne;y.ja=P.createDocument();y.fixed={Sd:{},tb:{},lc:{},vd:{},Lf:0,Jb:new Date,hb:{"Q{}":y.ja.createElement("decimal-format")},rd:{evaluate:ca},staticBaseURI:la?window.location.href:null,ka:cd};d.staticBaseURI&&
+(y.fixed.staticBaseURI=d.staticBaseURI);let x,E;if(d.namedDecimalFormats)for(const A in d.namedDecimalFormats){P=d.namedDecimalFormats[A];la=y.ja.createElement("decimal-format");for(x in P)E=P[x],la.setAttribute(x,["infinity","NaN"].includes(x)?E:Da(E)[0]);ca.hb[/^Q\{/.test(A)?A:"Q{}"+A]=k(la)}if(d.defaultDecimalFormat){P=d.defaultDecimalFormat;la=y.ja.createElement("decimal-format");for(x in P)E=P[x],la.setAttribute(x,["infinity","NaN"].includes(x)?E:Da(E)[0]);ca.hb["Q{}"]=k(la)}y.oa=oa.yc;if(b)if(b instanceof
+vb)y.focus=b;else{if(Array.isArray(b)&&1{P.params[la]="dummy"});b=m(P);p=g(y,P,b).next()}const u={N:"package",name:"evaluate",C:[p]};q&&(u.freeV=q);return d?u:function(P,la={}){return f(u,P,{params:la})}},evaluateOnly:f,compileGlobalContext:function(y,b,d){var q=new c;q.j();q.Ic=y;q.V=b;q.Gb=d;y={};d=0;for(let u in b){var p=
+b[u];const P=ac.X(p);p=P?p.parentNode:p.parent;const la=P?p.parentNode:p.parent;y[d++]={actor:p,Ya:la,id:parseInt(P?la.getAttribute("id"):la.id,10)}}q.fb=e(y);return Pb(q)},evaluateXDM:function(y,b,d,q){function p(ma=""){return la[ma]}var u;const P=Jd.find("SaxonJS").getPlatform();let la;const oa=I(q.params,q,q.namespaces);oa.La=d.fixed.La;oa.staticBaseURI||(oa.staticBaseURI=d.fixed.staticBaseURI);const K=d.fixed.La;oa.fb=e(d.fixed.La,q.dynamicEval);y=g(y,q,oa).next();const ca={N:"package",name:"evaluate"};
+var x={name:"evaluate",Ya:ca,hb:{}};y.parentNode=ca;let E=!1;var A=D(y);if(0{const ka=t(ma,k(V),"");V=V.getAttribute("name")+"#"+V.getAttribute("arity");ka.parentNode=ca;oa.fb["function"][V]={actor:ka,Ya:null,id:ma};Y[V]=N++;K[ma]=ka;ma++;ia.push(ka)});l(y,Y);y=k(y);H=t(1E3,y,H.join(" "));H.parentNode=ca;K[1E3]=H;ia.unshift(H);ca.C=ia}else ac.X(y)?y=k(y):v(y),ca.C=[t(1E3,y,"")],y.parentNode=
+ca;S=cd.me(d.sa.actor,d);for(u in S.hb)x.hb[u]=S.hb[u];A=new ne;A.fixed={Sd:{},tb:{},vd:{},lc:{},Lf:0,Jb:new Date,hb:{},La:d.fixed.La,ka:cd,options:d.fixed.options,Ib:d.fixed.Ib,staticBaseURI:d.fixed.staticBaseURI,Ee:null,rd:{evaluate:x}};A.fixed.rd[S.name]=S;q.staticBaseURI&&(A.fixed.staticBaseURI=q.staticBaseURI);if(S=q.staticContext){var aa=S.decimalFormats;if(aa)for(u in aa)x.hb[u]=k(aa[u]);if(x=S.resources)for(u in x)if(aa=x[u],aa.hasOwnProperty("err")){let ma=aa.err;ma=ma.replace(/Q{http:\/\/www\.w3\.org\/2005\/xqt-errors\}/,
+"");A.fixed.lc[u]=new G(ma+" "+aa.description,ma)}else A.fixed.lc[u]=aa;if(x=S.sources)for(u in x)if("."!==u)try{const ma=x[u];let ia;if("string"==typeof ma){let Y=P.readFile(ma);Y=Nd.Sg(Nd.Rg(Y));ia=ac.xc(P.parseXmlFromString(Y));ia._saxonBaseUri=ma;ia._saxonDocUri=ma}else ia=ma;A.fixed.tb[u]=ia}catch(ma){A.fixed.tb[u]=ma}if(u=S.collectionFinder)la=u,A.fixed.options.Ug=p;u=S.staticBaseURI;"undefined"!=typeof u&&(A.fixed.staticBaseURI="#UNDEFINED"===u?null:u)}q.staticBaseURI&&(A.fixed.staticBaseURI=
+q.staticBaseURI);A.masterDocument=d.masterDocument;A.ja=P.createDocument();if(null!=b){q=b.next();if(null!=b.next())throw new G("Context item is a sequence of more than one item","XTTE3210");A.oa=[];for(b=0;boa.as).join(",")+"] r["+la.as+"]");return la.sig}var p=null,u=Ih.Qj[y.uri];u&&(p=u[y.local]);if(p&&!d.bb&&p.XSLTonly)return null;p||y.uri!==Zb.mc||(La.type[y.local]?p={sig:"1F a[?A] r[?"+
+La.type[y.local].code+"]"}:Bd[y.local]&&(p={sig:"1F a[1AS] r[*"+Bd[y.local]+"]"}));if(!p&&d.fb&&d.fb["function"]){var P=y.toEQName();if(d=d.fb["function"][P+"#"+b])y=P,p=d.actor,ac.X(p)?(ac.Fc(p,"arg"),p={sig:p.getAttribute("sig")}):(F(p),p={sig:q(p)}),p.isUserFunction=!0,p.componentBinding=d.id}else if(!p&&d.fixed&&d.fixed.La)if(u=`{${y.uri}}${y.local}#${b}`,u in d.fixed.Sd)p=d.fixed.Sd[u];else{const la=y.toEQName();for(P in d.fixed.La){const oa=d.fixed.La[P].actor;if("function"===oa.N&&oa.name===
+la&&F(oa).length===b){p={sig:q(oa),isUserFunction:!0,componentBinding:P};d.fixed.Sd[u]=p;break}}}if(!p&&((d=Jh.Ri(y.uri))&&(p=d[y.local]),y.uri===Zb.xh)){y=0b.indexOf("`"))return b.split(".");let d=[""],q=0,p=0,u=!0;for(;py||y>b)throw new G("Array index ("+y+") out of bounds (1 to "+b+")","FOAY0001",t);}function l(y){return y[0].next().value}function f(y){return Pb(new $c(y))}function B(y,b,d,q){const p=b.fixed.ka;let u=
+y[1].expand();const P=y[2].expand()[0],la=Object.keys(b.oa).length;if(P instanceof ad.XdmFunction)y=l(y),q||(y=y.reverse()),y.forEach(oa=>{u=P.evaluate(q?[u,oa]:[oa,u],b,d).expand()});else{let oa;"function"!==P.N&&(oa=P);y[0].forEachItem(function(K){const ca=b.ba(!0);oa&&(ca.sa=oa);gd(ca);ca.qa="function";ca.gb={};ca.ab=null;ca.focus=null;q?(ca.oa[la]=u,ca.oa[la+1]=[K]):(ca.oa[la]=[K],ca.oa[la+1]=u);u=p.evaluate(void 0,ca).expand()})}return Kb(u)}const L={append:function(y){return f(l(y).concat([y[1].expand()]))},
+filter:function(y,b,d){const q=y[1].expand()[0];Object.keys(b.oa);y=l(y);if(q.evaluate){const p=[];y.forEach(function(u){const P=q.evaluate([u],b,d).expand();if(Array.isArray(P)&&1!==P.length||!m.boolean.matches(P[0]))throw new G("Wrong type for function result in filter(). Expecting xs:boolean, supplied value is "+sa.showValue(P),"XPTY0004",d);P[0].toBoolean()&&p.push(u)});return f(p)}throw new G("Argument supplied to array:filter is not a function","XPTY0004",d);},flatten:function(y){return cd.flatten(y[0])},
+"fold-left":function(y,b,d){return B(y,b,d,!0)},"fold-right":function(y,b,d){return B(y,b,d,!1)},"for-each":function(y,b,d){const q=y[1].expand()[0];y=l(y);Object.keys(b.oa);if(q.evaluate){const p=[];y.forEach(function(u){p.push(q.evaluate([u],b,d).expand())});return f(p)}},"for-each-pair":function(y,b,d){let q=y[2].expand();if(1!==q.length)throw new G("for-each-pair() must have exactly one function item as the third argument. Supplied length "+q.length,"XPTY0004",d);q=q[0];Object.keys(b.oa);const p=
+[],u=y[0].next().value[Symbol.iterator]();y=y[1].next().value[Symbol.iterator]();let P=u.next().value,la=y.next().value;if(q instanceof ad.XdmFunction)for(;P&&la;)p.push(q.evaluate([P,la],b,d).expand()),P=u.next().value,la=y.next().value;return f(p)},"_from-sequence":function(y){const b=[];y[0].forEachItem(function(d){b.push([d])});return f(b)},get:function(y){const b=l(y);y=y[1].next().toNumber();D(y,b.length);return Kb(b[y-1])},head:function(y){y=l(y);D(1,y.length);return Kb(y[0])},"insert-before":function(y){const b=
+l(y),d=y[1].next().toNumber();D(d,b.length+1);y=y[2].expand();return f(b.slice(0,d-1).concat([y]).concat(b.slice(d-1)))},join:function(y){const b=[];y[0].forEachItem(function(d){d.value.forEach(function(q){b.push(q)})});return f(b)},put:function(y){const b=l(y),d=y[1].next().toNumber();D(d,b.length);y=y[2].expand();return f(b.slice(0,d-1).concat([y]).concat(b.slice(d)))},remove:function(y){const b=l(y),d=[];y[1].forEachItem(function(q){q=q.toNumber();D(q,b.length);d.push(q-1)});return f(b.filter(function(q,
+p){return 0>d.indexOf(p)}))},reverse:function(y){return f(l(y).slice().reverse())},size:function(y){return Ub(y[0].next().size())},sort:function(y,b,d){const q=Hd.ef(d,y[1],b);let p=cd.Tb;if(y[2]){const u=y[2].next();p=function(P){return u.evaluate([[P]],b,d)}}return f(l(y).slice().sort(function(u,P){return y[1]?Id(Kb(u).mapOneToMany(p),Kb(P).mapOneToMany(p),q):Id(Kb(u).mapOneToMany(p),Kb(P).mapOneToMany(p))}))},subarray:function(y){const b=l(y),d=y[1].next().toNumber();D(d,b.length+1);y=y[2]?y[2].next().toNumber():
+b.length-d+1;if(0>y)throw new G("Length is negative","FOAY0002");D(d+y,b.length+1);return f(b.slice(d-1,d+y-1))},tail:function(y){y=l(y);D(1,y.length);return f(y.slice(1))},"_to-sequence":function(y){const b=[];l(y).forEach(function(d){d.forEach(function(q){b.push(q)})});return Kb(b)}};if(!L[e])throw new G("Unknown array function: "+e,"SXJS0003",t);return L[e](k,v,t)}function F(e,k,v,t){const D={contains:function(l){const f=l[0].next();l=l[1].next();return Xb(f.containsKey(l))},create:function(l){const f=
+new cc;l[0].forEachItem(function(B){B.forAllPairs(function(L){f.inSituPut(L.k,L.v)})});return Pb(f)},entry:function(l){const f=new cc;f.inSituPut(l[0].next(),l[1].expand());return Pb(f)},find:function(l){function f(b){cd.isArray(b)?b.value.forEach(B):cd.isMap(b)&&(b.containsKey(y)&&L.push(b.get(y)),b.keys().forEach(function(d){B(b.get(d))}))}function B(b){b.forEach(f)}const L=[],y=l[1].next();B(l[0].expand());return Pb(new $c(L))},"for-each":function(l,f,B){const L=l[0].next(),y=L.keys(),b=l[1].expand()[0];
+if(b.evaluate){let d=[];y.forEach(function(q){d=d.concat(b.evaluate([[q],L.get(q)],f,B).expand())});return Kb(d)}throw new G("Argument to map:for-each is not a function","XPTY0004",B);},get:function(l){const f=l[0].next();l=l[1].next();return Kb(f.get(l))},keys:function(l){l=l[0].next();return Kb(l.keys())},merge:function(l){const f=new cc,B=l[1]?l[1].next():null,L=m.string.fromString("duplicates"),y=B&&B.containsKey(L)?B.get(L).toString():"use-first";l[0].forEachItem(function(b){b.forAllPairs(function(d){if(!f.containsKey(d.k)||
+["use-last","unspecified","use-any"].includes(y))f.inSituPut(d.k,d.v);else{if("reject"===y){var q=m.string.fromString("duplicates-error-code");q=B.containsKey(q)?B.get(q).toString():"FOJS0003";throw new G("Duplicate key value '"+d.k.toString()+"'",q,t);}if("combine"===y){let p=[];f.get(d.k).forEach(function(u){p.push(u)});d.v.forEach(function(u){p.push(u)});f.inSituPut(d.k,p)}}})});return Pb(f)},_new:function(l){const f=new cc;l[0]&&l[0].forEachItem(function(B){B.forAllPairs(function(L){if(f.containsKey(L.k))throw new G("Duplicate key value '"+
+L.k.toString()+"'","XSLT"===v.fixed.options.language?"XTDE3365":"XQDY0137",t);f.inSituPut(L.k,L.v)})});return Pb(f)},put:function(l){const f=l[0].next(),B=l[1].next();l=l[2].expand();return Pb(f.put(B,l))},remove:function(l){let f=l[0].next();l[1].forEachItem(function(B){f=f.remove(B)});return Pb(f)},size:function(l){let f=0;l[0].next().forAllPairs(function(){f++});return Ub(f)},"untyped-contains":function(l){const f=l[0].next();l=l[1].next();return Xb(f.containsKey(l))}};if(!D[e])throw new G("Unknown map function: "+
+e,"SXJS0003",t);return D[e](k,v,t)}function I(e,k,v,t){function D(y){return null===y?(B=!0,Number.NaN):y.toNumber()}function l(){const y=k[0].next();return D(y?y:cd.Sa(t)(v).next())}function f(){const y=k[1].next();return D(y?y:cd.Wg(t)(v).next())}let B=!1;const L=function(){switch(e){case "pi":return Math.PI;case "exp":return Math.exp(l());case "exp10":return Math.pow(10,l());case "log":return Math.log(l());case "log10":return Math.log(l())/Math.LN10;case "pow":const y=l(),b=f();return-1===y&&(Infinity===
+b||-Infinity===b)||1===y?1:Math.pow(y,b);case "sqrt":return Math.sqrt(l());case "sin":return Math.sin(l());case "cos":return Math.cos(l());case "tan":return Math.tan(l());case "asin":return Math.asin(l());case "acos":return Math.acos(l());case "atan":return Math.atan(l());case "atan2":return Math.atan2(l(),f());default:throw new G("Unknown math function "+t.name,"XPST0017",t);}}();return B?Ob:Vb(L)}const m=La.XS,g={};g[Zb.wb]={apply:ke.apply,"compile-XPath":function(e,k,v){const t=e[0].next().toString();
+let D,l;1t[D]}else e=t=>v.lookupNamespaceURI(t);k=Hh.parseSequenceType(k,e,()=>{let t=v;for(;t&&1===t.nodeType;){if(ac.ca(t).uri===Zb.Xc&&t.hasAttributeNS("","xpath-default-namespace"))return t.getAttributeNS("","xpath-default-namespace");if(t.hasAttributeNS(Zb.Xc,"xpath-default-namespace"))return t.getAttributeNS(Zb.Xc,"xpath-default-namespace");t=ac.$a(t)}});return Pb(cd.xd(cd.Ra(k.$()))[0])},"parse-XPath":function(e){const k=
+e[0].next().toString();let v="parse";1k.push({key:Math.random(),Nj:v}));k=k.sort(function(v,t){return v.key-t.key});e=k.map(v=>v.Nj);return Kb(e)},"system-id":function(e,k){e=ed(k);e=ac.X(e)?ac.baseURI(e):null;return Pb(null===e?null:m.anyURI.fromString(e))},timestamp:function(e,k){return Pb(m.Ed.fromDate(new Date,-k.fixed.Jb.getTimezoneOffset()))}};
+g["http://exslt.org/common"]={"node-set":function(e){return e[0]}};cd.Aj(a);return{evaluate:a,Nf:function(e){const k=e.namespace;e=e.signatures;let v=g[k];v||=g[k]={};Object.entries(e).forEach(t=>{v[t[0]]=t[1].impl})}}}();
+// Input 76
+var Nh={forceBaseURI:Lh.forceBaseURI};
+// Input 77
+const Oh=function(){function a(e,k){return e.Eb===k.Eb?e.Rc===k.Rc?e.Td===k.Td?k.Hh-e.Hh:e.Td-k.Td:e.Rc-k.Rc:e.Eb-k.Eb}function c(e,k){return e.Eb===k.Eb?e.Rc===k.Rc?0:e.Rc-k.Rc:e.Eb-k.Eb}function n(e,k){function v(t){return t.n?[t.n.replace(/^(\*:|Q\{.*\})/,"")]:t.u?v(t.u[0]).concat(v(t.u[1])):[]}this.Re=e;this.Ch=e.onNo;this.Bh=k.Db(e,"t");k.Db(e,"F")&&(this.Zf=!0);this.Lg=(e.C||[]).map(function(t){return{Rd:t,Eb:parseInt(t.prec,10),Rc:parseFloat(t.prio),Td:parseInt(t.seq,10),nj:parseInt(t.minImp,
+10),Hh:parseInt(t.rank,10),pattern:Kd.od(k.da(t,"match")),matches:fc(t.matches||"1"),action:k.da(t,"action")}}).sort(a).reverse();this.hc={};this.Lg.forEach(t=>{const D=t.matches.$();let l,f=[];/^N[EAP]/.test(D.p)?(l=D.p,D.n&&!/}\*$/.test(D.n)?(l+=" "+D.n.replace(/^(\*:|Q\{.*\})/,""),f=[l]):f=D.u?[...(new Set(v(D)))].map(B=>l+" "+B):[l]):f=["."];f.forEach(B=>{let L=this.hc[B];L||(this.hc[B]=L=[]);L.push(t)})})}const F=La.XS,I=ac.Ja,m={TC:function(e,k,v,t){if(ac.X(e))switch(e.nodeType){case 9:case 11:case 1:v=
+v.ba(!1);v.focus=Sb(I.Ka(e));k.Hb(v,t);break;case 3:case 4:t.append(e);break;case 2:t.text(e.value)}else if(F.Qf.matches(e))t.text(e.toString());else if(cd.isArray(e)){let D=[];e.value.forEach(l=>{D=D.concat(l)});e=v.ba(!1);e.focus=Sb(Kb(D));k.Hb(e,t)}},SC:function(e,k,v,t){return Zd.sg(e,v,"c",function(){const D=v.ba(!1);D.focus=Sb(I.Ha(e));k.Hb(D,t);D.focus=Sb(I.Ka(e));k.Hb(D,t)},t)},DC:function(e,k,v,t){ac.X(e)&&(t.pb=ac.baseURI(e));t.append(e)},DS:function(e,k,v,t){if(ac.X(e))switch(e.nodeType){case 9:case 11:v=
+v.ba(!1),v.focus=Sb(I.Ka(e)),k.Hb(v,t)}},SS:function(e,k,v,t){if(ac.X(e))switch(e.nodeType){case 9:case 11:case 1:v=v.ba(!1),v.focus=Sb(I.Ha(e)),k.Hb(v,t),v.focus=Sb(I.Ka(e)),k.Hb(v,t)}else if(cd.isArray(e)){let D=[];e.value.forEach(l=>{D=D.concat(l)});e=v.ba(!1);e.focus=Sb(Kb(D));k.Hb(e,t)}},bubble:function(e,k,v,t){ac.X(e)?1===e.nodeType&&(v=v.ba(!1),v.focus=Sb(I.parent(e)),k.Hb(v,t)):t.append(e)}};m.TO=m.TC;const g={1:"NE",2:"NA",3:"NT",7:"NP",8:"NC",9:"ND",11:"ND",13:"NN"};n.prototype={Re:null,
+Lg:null,Ch:"TC",Bh:!1,Zf:!1,Hb:function(e,k,v){if(v){let t=!0;e.focus.forEachItem(D=>{t?t=!1:k.text(v.value,{});this.Se(D,e,k)})}else e.focus.forEachItem(t=>this.Se(t,e,k))},ki:function(e,k){const v=e.ab;if(!v)throw new G("No current template rule","XTDE0560");return this.Se(ed(e),e,k,function(t){return t.Eb>=v.nj&&t.Eba(t,v)})},Gi:function(e,k,v){let t=null,
+D=null;const l=this.Zf;var f=[];if(ac.X(e)){const L=g[e.nodeType];var B=ac.ca(e);if(B=B?B.local:null)B=L+" "+B,this.hc[B]&&f.push(this.hc[B]);this.hc[L]&&f.push(this.hc[L]);this.hc.N&&f.push(this.hc.N)}this.hc["."]&&f.push(this.hc["."]);(function(L){L.forEach(y=>{y.forEach(function(b){if(!v||v(b))if(!t||0!0;else if("strip.none"===x.N)A=()=>!1;else{let H={},S={},N={},aa={},ma={},ia=function(V,ka,z){V[ka]?parseInt(z.Eb,10)>parseInt(V[ka].Eb,10)&&(V[ka]=z):V[ka]=z};(x.C||[]).forEach(V=>{const ka=fc(V.test);ka instanceof nd?(V.PREC=parseInt(V.prec,10),V.PRIO=2,ia(H,ka.name.toEQName(),V)):ka instanceof pd?(V.PREC=parseInt(V.prec,10),V.PRIO=1,ia(S,ka.uri,V)):ka instanceof od?(V.PREC=parseInt(V.prec,10),V.PRIO=1,ia(N,ka.localName,V)):ka instanceof Fc?
+(V.PREC=parseInt(V.prec,10),V.PRIO=0,ia(aa,"*",V)):sa.la("Unrecognised strip-space "+V.test)});const Y=(V,ka)=>{const z=[],M=H["Q{"+V+"}"+ka];M&&z.push(M);(V=S[V])&&z.push(V);(ka=N[ka])&&z.push(ka);aa["*"]&&z.push(aa["*"]);z.sort((W,fa)=>{const U=W.PREC,w=fa.PREC;return U===w?fa.PRIO-W.PRIO:w-U});return 0{const z="Q{"+V+"}"+ka,M=ma[z];if(M)return"s"===M;V=Y(V,ka);ma[z]=V?"s":"p";return V}}else A=()=>!1;return function(H){E(H);return H}}function n(x,E,A){function H(T){T=
+new Ud(T);Y.fixed.Ji=T;return new Zd.Gc(T)}function S(){}function N(){P&&!A.mg&&l(Y)}var aa=cd.qb(x,"strip")[0]||cd.qb(x,"strip.all")[0];let ma=null;if(aa||P)ma=c(aa),E&&ma&&(E=ma(E));A.Vh&&A.Vh(x);A.ql=null;const ia=A.async,Y=B(x,E,A);Y.fixed.wl=Y.fixed.yd.Ya.version;L(Y,function(T){return"globalParam"===T.N&&T.flags&&-1!==T.flags.indexOf("r")}).map(function(T){return T.name}).map(function(T){if("undefined"===typeof Y.fixed.options.Sh.get(La.XS.QName.fromEQName(T)))throw new G("No value has been provided for required stylesheet parameter '"+
+T+"'","XTDE0050");});Y.fixed.Ee=ma;E&&(ac.xc(E),Y.fixed.tb[E._saxonBaseUri]=E);const V=A.destination||"application",ka=A.resultForm||"default";if(A.ed){let T=A.ed("testURI");["document","serialized","raw"].includes(T.destination)&&!T.save&&(A.ed=function(){return new je(T.destination,A.resultDocuments)})}A.ed||(A.ed=P?function(){return new ie("html-page",function(T,ha){A.resultDocuments[T.toString()]=ha})}:ia?function(){return new ie("file",function(T,ha,ba){ha=u.writeFileAsync(T,ha,ba);sa.Ma("Promising to write to "+
+T,2,Y.fixed.Ta);Y.fixed.zd.push(ha)})}:function(){return new ie("file",function(T,ha,ba){sa.Ma("Writing to "+T,2,Y.fixed.Ta);u.writeFileSync(T,ha,ba)})});let z;const M={};aa=Y.fixed.yd;var W=aa.ng["#unnamed"];if(W){W=W.C;var fa,U;for(var w=0;wW.indexOf("Q{")&&(W="Q{}"+W);aa=b(Y,W);if(!aa)throw new G("Unknown initial mode "+W,"XTDE0045");w="Q{"+Zb.Xc+"}initial-template";
+E||fa||U||d(Y,w)&&(U=w);let Z=A.Wi;if(Z){E=A.jh?A.jh:[];fa=E.length;U=q(Y,Z.toString(),fa);if(!U)throw new G("Unknown initial function "+Z+"#"+fa,"XTDE0041");if("PUBLIC"!==U.Ya.vis&&"FINAL"!==U.Ya.vis)throw new G("Uninvocable initial function "+Z+"#"+fa+" with visibility "+U.Ya.vis,"XTDE0041");const T=U.Ya.C[0];Y.focus={};Y.sa=U;gd(Y);Y.qa="function";Y.gb=aa;Y.ab=null;let ha=0;Y.oa=E.map(function(ba){var va=T.C[ha++].as;va=ec(va||"*");return cd.Uf(cd.Ra(ba),va,()=>"function parameter for "+Z)});E=
+S();Zd.push(cd.da(T,"body"),Y,E);E.close()}else if(U){fa=d(Y,U);if(!fa)throw new G("Unknown initial template "+U,"XTDE0040");U=fa.actor;Y.fixed.jd?Y.focus=Rb(E):(Y.focus=Sb(Ob),Y.focus.next());cd.Tf(U,Y);Y.sa=fa;Y.gb=aa;F(A,Y);E=S();Zd.push(U.C[0],Y,E);E.close()}else{Array.isArray(fa)&&ma&&fa.filter(ac.X).map(function(T){return ac.kf(T)?T:T.ownerDocument}).map(function(T){return ma(T)});if("PRIVATE"===aa.visibility&&W!==x.defaultMode&&""!==W)throw new G("Uninvokable initial mode "+W+" with visibility "+
+aa.Ya.vis,"XTDE0045");if(!E&&!fa)throw new G("No source input supplied for apply-templates invocation","XTDE0044");U=aa.mode;Y.sa=aa;Y.focus=Sb(fa?Kb(Array.isArray(fa)?fa:[fa]):Pb(E));E=U.Re.useAcc;null!=E&&"#all"!==E&&(Y.Ge=E.split(/\s+/));F(A,Y);E=S();U.Hb(Y,E);E.close()}N();if(ia){function T(){const ha=Y.fixed.zd;Y.fixed.zd=[];return Promise.all(ha).then(()=>{if(0{throw ba;}).then(()=>Promise.resolve(new he(A.principalResult,A.resultDocuments,x,A.masterDocument)))}
+A.Dj=T()}}function F(x,E){x.Fe&&(sa.assert(x.Fe instanceof cc,"options?templateParams must be an instance of HashTrie. Supplied:"+x.Fe),E.Lc=x.Fe);x.Rb&&(sa.assert(x.Fe instanceof cc,"options?tunnelParams must be an instance of HashTrie. Supplied:"+x.Rb),E.Rb=x.Rb)}function I(x){let E="";for(const A in x)x.hasOwnProperty(A)&&x[A]&&(E+=A+"="+x[A].toString().substring(0,30)+"("+typeof A+"), ");return E}function m(x){let E=x.stylesheetInternal||null;if(!E){if(x.Qb)var A=u.readFile(x.Qb);else if(x.ug)A=
+x.ug;else if(x.kc){if(P)throw new G("Cannot supply stylesheetFileName in browser","SXJS0006");A=u.readFile(x.kc)}else throw new G("No stylesheet supplied","SXJS0006");try{E=JSON.parse(A)}catch(S){throw new G("Supplied SEF is not in JSON format","SXJS0006");}}t(E,x);E.PRIMED||(D(E),g(E),E.PRIMED=!0);"true"===E.relocatable&&(x.md=!0);A=x.uf||null;let H;A&&(H=x.uf.baseURI||x.Vd)&&(A._saxonBaseUri=H);if(!A){let S;if(x.Vc)H=x.Vc,S=u.readFile(H);else if(x.De)H=x.Vd,S=x.De;else if(x.Uc){if(P)throw new G("Cannot supply sourceFileName in browser",
+"SXJS0006");H=x.Uc;S=u.readFile(H)}if(S)if("json"===x.Ph)A=Md.ye(S,null);else{if("string"!==typeof S)throw new G("Supplied sourceText is not a string","SXJS0006");A=u.parseXmlFromString(S);H&&(A._saxonBaseUri=A._saxonDocUri=H)}}n(E,A,x);return new he(x.principalResult,x.resultDocuments,E,x.masterDocument)}function g(x){x.C&&x.C.forEach(function(E){E.parentNode=x;g(E)})}function e(x){if(x instanceof cc)return x;const E=new cc;x&&Object.keys(x).forEach(A=>E.inSituPut(La.XS.QName.fromEQName(A),cd.Ra(x[A])));
+return E}function k(x){const E={};for(let [A,H]of Object.entries(x))E[A]="use-character-maps"===A?H:ge.qf(A,H,null);return E}function v(x){const E=(A,H)=>{let S=null;for(let N of H)if(A[N]){if(S)throw new G("The following transform options are mutually exclusive: "+H.toString(),"SXJS0006");S=N}return S};E(x,["stylesheetText","stylesheetInternal","stylesheetLocation","stylesheetFileName"]);E(x,["sourceNode","sourceText","sourceLocation","sourceFileName"]);return{ug:x.stylesheetText,stylesheetInternal:x.stylesheetInternal,
+Qb:x.stylesheetLocation,kc:x.stylesheetFileName,Wd:x.stylesheetBaseURI,Sh:e(x.stylesheetParams),uf:x.sourceNode,De:x.sourceText,Vc:x.sourceLocation,Uc:x.sourceFileName,Ph:x.sourceType||"xml",Vd:x.sourceBaseURI,masterDocument:x.masterDocument,Zi:x.initialTemplate,Wi:x.initialFunction,jh:x.functionParams,Fe:e(x.templateParams),Rb:e(x.tunnelParams),Xi:x.initialMode,tb:x.documentPool,lc:x.textResourcePool,destination:x.destination,Ib:x.baseOutputURI||(x.masterDocument?x.masterDocument._saxonBaseUri:void 0),
+Pa:x.outputProperties,principalResult:void 0,Xf:x.deliverMessage,ed:x.deliverResultDocument,Bc:x.collations,Ug:x.collectionFinder,Ta:x.logLevel,Vh:x.traceInjector,jd:x.globalContextItem,Yi:x.initialSelection,se:x.isDynamicStylesheet,md:x.isRelocatableStylesheet,language:x.language,zh:x.messages,resultDocuments:{},resultForm:x.resultForm,Mk:x.extraOptions,mg:x.nonInteractive,mi:x.attachEventsTo,async:x.async}}function t(x,E){if("package"===x.N){const A=x.target||"not specified",H=x.targetVersion||
+"",S=x.saxonProduct;let N=x.saxonVersion||"9.8.0.5";S&&!/Saxon/.test(N)&&(N=S+" "+N);sa.Ma("SEF generated by "+N+" at "+(x.buildDateTime||"2000-01-01"),2,E.Ta);if("JS"!==A||"2"!==H)throw new G("Supplied SEF is not customized for use with SaxonJS. The option -target:JS should be set when generating the export. target is: "+A,"SXJS0006");if("9"===N.charAt(0))throw new G("For use with SaxonJS 2.x, SEF must be generated by SaxonJ-EE 10.0 or later. Supplied SEF is generated by SaxonJ-EE version "+N,"SXJS0006");
+if(x.expiry&&0>la.dd.fromString(x.expiry).compareTo(la.dd.fromDate(new Date,0)))throw new G("Development license for supplied stylesheet has expired","SXJS0006");}else throw new G("Supplied SEF does not have correct format","SXJS0006");}function D(x){function E(ma,ia){ia<<=8;for(let Y=0;YS?4294967295+S+1:S).toString(16);if(aa!==x){if("unspecified"===x)throw new G("No checksum found in SEF","SXJS0006");throw new G("Invalid checksum in SEF "+x+" != "+aa,"SXJS0006");}}function l(x,E=null){function A(S,N){function aa(ia){const Y=
+ia.target;var V=x.ba(!0);V.qa=!1;V.je=ia;V.focus=Sb(Pb(cd.Ra(Y)[0]));V.sa=S;ia=Vd(x);ia=new Zd.Gc(ia);(V=ma.Hb(V,ia))&&V.expand()}const ma=S.mode;-1==="httpabort afterprint beforeprint beforeunload hashchange languagechange message offline online pagehide pageshow popstate storage unhandledrejection unload resize".split(" ").indexOf(N)?E?E.addEventListener(N,aa,!1):window.document.addEventListener(N,aa,!1):window.addEventListener(N,aa,!1)}const H=x.fixed.La;Object.keys(H).forEach(function(S){S=H[S];
+S.mode&&S.mode.th()&&(S.name.split("}on")[1]?A(S,S.name.split("}on")[1]):console.log("Invalid event handler name:",S.name))})}function f(x,E){return x.C?x.C.filter(function(A){return A.N===E}):[]}function B(x,E,A){function H(Y,V){S(x,Y,V)}function S(Y,V,ka){Y.N===V&&ka(Y);Y.C&&Y.C.forEach(function(z){S(z,V,ka)})}function N(Y){return(Y=Y.name)?/^Q\{/.test(Y)?Y:"Q{}"+Y:null}function aa(Y,V){function ka(z){z=f(z,"co");for(let M=0;M{const ka=Y[V];if(ac.kf(ka))ia.fixed.tb[V]=ka;else throw new G("Supplied value for "+V+" is not a document node");
+})}if(A.lc){const Y=A.lc;Object.keys(Y).forEach(V=>{ia.fixed.lc[V]=Y[V].toString()})}A.Bc||(A.Bc={});A.Bc[Hd.ad]=Hd.Tg();A.Bc[Hd.hh]=Hd.Ze();A.Bc[Hd.jg]=Hd.Ng();A.Bc[Hd.Zh]=Hd.Ze();H("package",function(Y){const V={name:Y.name,Ya:Y,Gb:{},Pg:{},hb:{},ng:{},keys:{},Wh:null};ia.fixed.rd[V.name]=V;ia.fixed.yd||(ia.fixed.yd=V);aa(Y,function(ka){const z=parseInt(ka.id,10);ia.fixed.La[z]={id:z,visibility:ka.vis,Ya:ka,Dh:V,actor:null,We:ka.binds.split(" ").map(function(M){return parseInt(M,10)})}})});H("package",
+function(Y){const V=ia.fixed.rd[Y.name];aa(Y,function(U){const w=ia.fixed.La[parseInt(U.id,10)];U=w.actor=ma(U,ia);null!==U&&(w.name=N(U),"globalVariable"===U.N||"globalParam"===U.N?w.value=null:"mode"===U.N&&(w.mode=new Oh(U,cd),null===N(U)&&(V.Wh=w.mode)),"ABSTRACT"===U.parentNode.vis&&(w.visibility="ABSTRACT"))});if(0U.max&&(U.max=Z);U.ya[Z]=w.s}),55296{ma=JSON.parse(V)}).catch(V=>Promise.reject(new G("Failed to read JSON input "+H.kc+": "+V,"SXJS0006"))),
+x.push(N)):H.Qb?(N=u.resourcePromise({location:H.Qb,encoding:"utf-8",type:"json"}).then(V=>{ma=JSON.parse(V)}).catch(V=>Promise.reject(new G("Failed to read JSON input "+H.Qb+": "+V,"SXJS0006"))),x.push(N)):x.push(Promise.reject(new G("No stylesheet supplied","SXJS0006")));ia=H.uf||null;Y=H.Ph||"xml";ia&&(N=H.uf.baseURI||H.Vd)&&(ia._saxonBaseUri=N);if(!ia){N=(ka,z)=>{ka=Nd.Sg(Nd.Rg(ka));ka=u.parseXmlFromString(ka);z&&(ka._saxonBaseUri=ka._saxonDocUri=z);return ka};aa=ka=>Md.ye(ka,null);const V="xml"===
+Y?N:aa;H.De?"string"!==typeof H.De?x.push(Promise.reject(new G("Supplied sourceText is not a string","SXJS0006"))):ia=V(H.De,H.Vd):H.Uc?(N=u.resourcePromise({file:H.Uc}).then(ka=>ia=V(ka,H.Uc)).catch(ka=>Promise.reject(new G(`Failed to read ${Y.toUpperCase()} source input (${ka.message})`,"SXJS0006"))),x.push(N)):H.Vc&&(N=u.resourcePromise({location:H.Vc}).then(ka=>{ia=V(ka,H.Vc)}).catch(ka=>Promise.reject(new G(`Failed to read ${Y.toUpperCase()} source input (${ka.message})`,"SXJS0006"))),x.push(N))}return Promise.all(x).then(()=>
+{var V=ma,ka=ia,z=H;if(!V)throw new G("No stylesheet supplied","SXJS0006");try{t(V,z);V.PRIMED||(D(V),g(V),V.PRIMED=!0);"true"===V.relocatable&&(z.md=!0);n(V,ka,z);var M=z.Dj}catch(W){throw console.log("Transformation failure: "+(W.getMessage?W.getMessage():W)),W;}return M})},Serializer:ge,serialize:function(x,E){const A={"iso-8859-1":"latin1","iso-646":"ascii"};x=ge.serialize(x,E);return E&&E.encoding?(E=E.encoding,E=A[E]||E,qa.makeBuffer(x,E)):x},StringWriter:ge.StringWriter,getProcessorInfo:function(){return{version:3,
+vendor:"Saxonica",vendorURL:"https://www.saxonica.com/",productName:"SaxonJS",productVersion:"2.7",isSchemaAware:!1,supportsSerialization:!0,supportsBackwardsCompatibility:!0,supportsNamespaceAxis:!0,supportsStreaming:!1,supportsDynamicEvaluation:!0,supportsHigherOrderFunctions:!0,xPathVersion:3.1,xsdVersion:1.1,releaseDate:"2024-10-17"}},getResource:function(x){const E=x.type||"text";let A;if(x.file){var H=u.resourcePromise(x);A=u.fileURL(x.file)}else if(x.location)if(H=x.location,
+H instanceof URL||(H=u.newURL(H,u.baseURL()),x.location=H.toString()),A=H.href,"file:"===H.protocol)H=u.resourcePromise(x);else if(["http:","https:"].includes(H.protocol))H=u.resourcePromise(x);else return Promise.reject(new G("Unsupported URL protocol "+H.protocol,"SXJS0006"));else if(x.text)H=Promise.resolve(x.text),x.baseURI&&(A=x.baseURI);else return Promise.reject(new G("No resource supplied","SXJS0006"));"xml"===E?H=H.then(S=>{try{const N=ac.xc(u.parseXmlFromString(S));N._saxonBaseUri=N._saxonDocUri=
+A;return Promise.resolve(N)}catch(N){return Promise.reject(new G("Failed parsing XML in "+A+": "+N.message,N.code))}}):"json"===E&&(H=H.then(S=>{try{return Promise.resolve(Md.ye(S,new cc,new ne))}catch(N){return Promise.reject(new G("Failed parsing JSON in "+A+": "+N.message,N.code))}}));return H},setLogLevel:sa.setLogLevel,getLogLevel:sa.getLogLevel,setPlatform:a,getPlatform:function(){return u},getNavigator:function(){return window.navigator.userAgent},timeStamp:P&&window.performance&&window.performance.now?
+window.performance.now:function(){return Date.now().valueOf()},internalTransform:n,checkOptions:v,convertResult:p,makeAtomicValue:function(x,E){return La.type[x].fromString(E)},registerExtensionFunctions:function(x){Jh.Nf(x);Mh.Nf(x)},getItemDetails:function(x){if(La.pa(x)){const E={variety:"atomic",type:x.type,value:x.toString()};"AQ"===x.code&&(E.prefix=x.prefix,E.uri=x.uri,E.local=x.local);return E}return ac.X(x)?{variety:"node",type:x.nodeType()}:{variety:x instanceof $c?"array":"map"}},getConfigurationProperties:function(){const x=
+{};Object.keys(K).forEach(E=>{x[E]=K[E]});return x},getConfigurationProperty:function(x){if(x in K)return K[x]},setConfigurationProperties:function(x){const E={};Object.keys(K).forEach(A=>{E[A]=K[A]});Object.keys(x).forEach(A=>{"autoResetIndexes"==A||"nativeGetElementById"==A?K[A]=!!x[A]:sa.Ma("The configuration property "+A+" is unrecognized")});return E},setConfigurationProperty:function(x,E){if("autoResetIndexes"==x||"nativeGetElementById"==x){let A=K[x];K[x]=!!E;return A}sa.Ma("The configuration property "+
+x+" is unrecognized")},resetIndexes:function(x){P&&!x&&(x=window.document);return x&&"_saxonIndexes"in x?(delete x._saxonIndexes,delete x._saxonIndexesBC,delete x._saxonXmlIdIndex,!0):!1},XdmArray:$c,XdmAtomicValue:Ja,XdmAttributeNode:$b,XdmFunction:ad,XdmMap:cc,XError:G,XPath:Eh,XS:la};P||"undefined"!==typeof HostPlatform?(HostPlatform.entryPoint=ca,a(HostPlatform),u.expose(ca,"SaxonJS")):console.log("Platform binding delayed");ca.Developer=Nh;La.Kf();Ha.Kf();mc();Jd.register("SaxonJS",ca);return ca})();}).call(this);
+
diff --git a/src/App.tsx b/src/App.tsx
new file mode 100644
index 0000000..07c13f3
--- /dev/null
+++ b/src/App.tsx
@@ -0,0 +1,622 @@
+import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
+import Layout from './components/Layout';
+import Toolbar from './components/Toolbar';
+import EditorPanel from './components/EditorPanel';
+import ActionDialog, {
+ type ActionDialogAction,
+} from './components/ActionDialog';
+import HelpDialog from './components/HelpDialog';
+import SnippetToolbox from './components/SnippetToolbox';
+import { useWorkbenchState } from './workspace/useWorkbenchState';
+import type { WorkbenchDocumentKind } from './workspace/workspaceTypes';
+import type { CodeMirrorEditorHandle } from './editor/editorTypes';
+import { openTextFile, saveTextFile } from './file/fileService';
+import { validateXml, formatXml } from './validation/xmlValidation';
+import { validateXslt } from './validation/xsltValidation';
+import {
+ hasErrors,
+ type DiagnosticMessage,
+} from './validation/validationTypes';
+import { runTransformation } from './transform/transformService';
+import { createTransformationRun } from './transform/nativeXsltEngine';
+import type { TransformEngineId } from './transform/transformTypes';
+import { createApproximateTrace } from './transform/traceAnalyzer';
+
+interface DialogState {
+ title: string;
+ content: React.ReactNode;
+ actions: ActionDialogAction[];
+ onCancel?: () => void;
+}
+
+const App: React.FC = () => {
+ const {
+ state,
+ setState,
+ updateDocumentText,
+ replaceDocument,
+ markDocumentSaved,
+ setLastTransformation,
+ resetWorkspace,
+ } = useWorkbenchState();
+
+ const xmlInputEditorRef = useRef(null);
+ const xsltEditorRef = useRef(null);
+ const outputEditorRef = useRef(null);
+
+ const [dialog, setDialog] = useState(null);
+ const [helpOpen, setHelpOpen] = useState(false);
+ const [busy, setBusy] = useState(false);
+ const [statusMessage, setStatusMessage] = useState(null);
+ const [runtimeDiagnostics, setRuntimeDiagnostics] = useState<
+ DiagnosticMessage[]
+ >([]);
+ const [validationTouched, setValidationTouched] = useState(false);
+
+ const xmlDiagnostics = useMemo(
+ () => validateXml(state.xmlInput.text, 'XML input'),
+ [state.xmlInput.text]
+ );
+
+ const xsltDiagnostics = useMemo(
+ () => validateXslt(state.xsltCode.text, state.selectedEngine),
+ [state.xsltCode.text, state.selectedEngine]
+ );
+
+ const outputDiagnostics = useMemo(() => {
+ if (!state.xmlOutput.text.trim()) return [];
+ return validateXml(state.xmlOutput.text, 'XML output');
+ }, [state.xmlOutput.text]);
+
+ const closeDialog = useCallback(() => {
+ dialog?.onCancel?.();
+ setDialog(null);
+ }, [dialog]);
+
+ const askForConfirmation = useCallback(
+ (options: {
+ title: string;
+ content: React.ReactNode;
+ proceedLabel?: string;
+ danger?: boolean;
+ }): Promise => {
+ return new Promise((resolve) => {
+ const finish = (confirmed: boolean) => {
+ setDialog(null);
+ resolve(confirmed);
+ };
+
+ setDialog({
+ title: options.title,
+ content: options.content,
+ onCancel: () => resolve(false),
+ actions: [
+ {
+ label: 'Cancel',
+ variant: 'secondary',
+ autoFocus: true,
+ onClick: () => finish(false),
+ },
+ {
+ label: options.proceedLabel ?? 'Proceed',
+ variant: options.danger ? 'danger' : 'primary',
+ onClick: () => finish(true),
+ },
+ ],
+ });
+ });
+ },
+ []
+ );
+
+ const confirmOverwrite = useCallback(
+ async (kind: WorkbenchDocumentKind, reason: string): Promise => {
+ const documentState = state[kind];
+ if (!documentState.text.trim() && !documentState.dirty) return true;
+
+ return askForConfirmation({
+ title: `Overwrite ${documentState.label}?`,
+ content: (
+
+ {reason} This will replace the current contents of{' '}
+ {documentState.label} .
+
+ ),
+ proceedLabel: 'Overwrite',
+ danger: true,
+ });
+ },
+ [askForConfirmation, state]
+ );
+
+ const handleOpenHelp = useCallback(() => {
+ setHelpOpen(true);
+ }, []);
+
+ const handleCloseHelp = useCallback(() => {
+ setHelpOpen(false);
+ }, []);
+
+ const handleOpenFile = async (kind: WorkbenchDocumentKind) => {
+ try {
+ const opened = await openTextFile(kind);
+ if (!opened) return;
+
+ const documentState = state[kind];
+
+ if (documentState.dirty) {
+ const mayProceed = await askForConfirmation({
+ title: `Overwrite ${documentState.label}?`,
+ content: (
+
+ Opening {opened.name} will replace the current
+ unsaved contents of {documentState.label} .
+
+ ),
+ proceedLabel: 'Overwrite',
+ danger: true,
+ });
+
+ if (!mayProceed) return;
+ }
+
+ replaceDocument(kind, opened.text, opened.name, false);
+ setStatusMessage(`Loaded ${opened.name}.`);
+ } catch (error) {
+ if (isAbortError(error)) return;
+ setStatusMessage(
+ error instanceof Error ? error.message : 'Failed to open file.'
+ );
+ }
+ };
+
+ const handleSaveFile = async (kind: WorkbenchDocumentKind) => {
+ try {
+ const documentState = state[kind];
+ const suggestedName = documentState.fileName ?? defaultFileName(kind);
+ const savedName = await saveTextFile({
+ suggestedName,
+ text: documentState.text,
+ kind,
+ });
+
+ if (savedName) {
+ markDocumentSaved(kind, savedName);
+ setStatusMessage(`Saved ${savedName}.`);
+ }
+ } catch (error) {
+ if (isAbortError(error)) return;
+ setStatusMessage(
+ error instanceof Error ? error.message : 'Failed to save file.'
+ );
+ }
+ };
+
+ const handleApplyTransformation = async () => {
+ setValidationTouched(true);
+ setRuntimeDiagnostics([]);
+
+ const diagnostics = [...xmlDiagnostics, ...xsltDiagnostics];
+ if (hasErrors(diagnostics)) {
+ setRuntimeDiagnostics(diagnostics);
+ setStatusMessage('Please fix validation errors before transforming.');
+ return;
+ }
+
+ if (state.options.askBeforeOverwritingOutput) {
+ const mayOverwriteOutput = await confirmOverwrite(
+ 'xmlOutput',
+ 'Applying the transformation writes a new result.'
+ );
+ if (!mayOverwriteOutput) return;
+ }
+
+ setBusy(true);
+ try {
+ const request = {
+ xmlText: state.xmlInput.text,
+ xsltText: state.xsltCode.text,
+ engine: state.selectedEngine,
+ };
+
+ const result = await runTransformation(request);
+ setRuntimeDiagnostics(result.diagnostics);
+
+ if (hasErrors(result.diagnostics)) {
+ setStatusMessage(
+ 'Transformation failed because the input or stylesheet is invalid.'
+ );
+ return;
+ }
+
+ const output = state.options.prettifyOutputAfterTransform
+ ? tryFormatXml(result.output)
+ : result.output;
+
+ replaceDocument('xmlOutput', output, state.xmlOutput.fileName, true);
+ const run = await createTransformationRun(request, output);
+
+ setLastTransformation(run);
+ setStatusMessage(`Transformation completed with ${result.engine}.`);
+ } catch (error) {
+ setRuntimeDiagnostics([
+ {
+ severity: 'error',
+ source: 'Transformation engine',
+ message:
+ error instanceof Error ? error.message : 'Transformation failed.',
+ },
+ ]);
+ setStatusMessage('Transformation failed.');
+ } finally {
+ setBusy(false);
+ }
+ };
+
+ const handleMoveOutputToInput = async () => {
+ if (!state.xmlOutput.text.trim()) {
+ setStatusMessage('The output editor is empty. Nothing to move.');
+ return;
+ }
+
+ const mayProceed = await confirmOverwrite(
+ 'xmlInput',
+ 'Moving output to input is useful for chained transformations.'
+ );
+ if (!mayProceed) return;
+
+ replaceDocument('xmlInput', state.xmlOutput.text, 'from-output.xml', true);
+ setStatusMessage('Moved output to XML input.');
+ };
+
+ const handleFormat = async (kind: WorkbenchDocumentKind) => {
+ const documentState = state[kind];
+
+ try {
+ const formatted = formatXml(documentState.text);
+ if (formatted === documentState.text) {
+ setStatusMessage(`${documentState.label} is already formatted.`);
+ return;
+ }
+
+ const mayProceed = await askForConfirmation({
+ title: `Format ${documentState.label}?`,
+ content: (
+
+ Formatting rewrites whitespace in{' '}
+ {documentState.label} .
+
+ ),
+ proceedLabel: 'Format',
+ });
+
+ if (!mayProceed) return;
+ replaceDocument(kind, formatted, documentState.fileName, true);
+ setStatusMessage(`Formatted ${documentState.label}.`);
+ } catch (error) {
+ setStatusMessage(
+ error instanceof Error ? error.message : 'Could not format XML.'
+ );
+ }
+ };
+
+ const handleValidate = () => {
+ setValidationTouched(true);
+ const allDiagnostics = [
+ ...xmlDiagnostics,
+ ...xsltDiagnostics,
+ ...outputDiagnostics,
+ ];
+ setRuntimeDiagnostics(allDiagnostics);
+
+ if (allDiagnostics.length === 0) {
+ setStatusMessage('All current documents are well-formed.');
+ return;
+ }
+
+ setStatusMessage(
+ hasErrors(allDiagnostics)
+ ? 'Validation found errors.'
+ : 'Validation completed with warnings.'
+ );
+ };
+
+ const handleReset = async () => {
+ const mayProceed = await askForConfirmation({
+ title: 'Reset workspace?',
+ content: (
+
+ This restores the example XML and XSLT, clears the output, and removes
+ the saved LocalStorage workspace.
+
+ ),
+ proceedLabel: 'Reset workspace',
+ danger: true,
+ });
+
+ if (!mayProceed) return;
+ resetWorkspace();
+ setRuntimeDiagnostics([]);
+ setValidationTouched(false);
+ setStatusMessage('Workspace reset.');
+ };
+
+ const handleEngineChange = (engine: TransformEngineId) => {
+ setState((current) => ({ ...current, selectedEngine: engine }));
+ };
+
+ const handlePrettifyOutputAfterTransformChange = (enabled: boolean) => {
+ setState((current) => ({
+ ...current,
+ options: {
+ ...current.options,
+ prettifyOutputAfterTransform: enabled,
+ },
+ }));
+ };
+
+ const handleAskBeforeOverwritingOutputChange = (enabled: boolean) => {
+ setState((current) => ({
+ ...current,
+ options: {
+ ...current.options,
+ askBeforeOverwritingOutput: enabled,
+ },
+ }));
+ };
+ const traceItems = useMemo(() => {
+ if (!state.xmlOutput.text.trim()) return [];
+ return createApproximateTrace(
+ state.xmlInput.text,
+ state.xsltCode.text,
+ state.xmlOutput.text
+ );
+ }, [state.xmlInput.text, state.xsltCode.text, state.xmlOutput.text]);
+
+ const displayedRuntimeDiagnostics = validationTouched
+ ? runtimeDiagnostics
+ : [];
+
+ useEffect(() => {
+ const handleGlobalKeyDown = (event: KeyboardEvent) => {
+ if (event.defaultPrevented || event.repeat || event.isComposing) {
+ return;
+ }
+
+ if (event.key === 'F1') {
+ event.preventDefault();
+ event.stopPropagation();
+ handleOpenHelp();
+ return;
+ }
+
+ const isApplyShortcut =
+ event.key === 'Enter' &&
+ event.ctrlKey &&
+ !event.altKey &&
+ !event.shiftKey &&
+ !event.metaKey;
+
+ if (isApplyShortcut) {
+ event.preventDefault();
+ event.stopPropagation();
+
+ if (!busy) {
+ void handleApplyTransformation();
+ }
+ }
+ };
+
+ window.addEventListener('keydown', handleGlobalKeyDown, true);
+
+ return () => {
+ window.removeEventListener('keydown', handleGlobalKeyDown, true);
+ };
+ }, [busy, handleApplyTransformation, handleOpenHelp]);
+
+ return (
+ handleOpenHelp()}>
+
+ updateDocumentText('xmlInput', value)}
+ onOpen={() => void handleOpenFile('xmlInput')}
+ onSave={() => void handleSaveFile('xmlInput')}
+ onUndo={() => xmlInputEditorRef.current?.undo()}
+ onRedo={() => xmlInputEditorRef.current?.redo()}
+ onCopy={() => void xmlInputEditorRef.current?.copySelection()}
+ onCut={() => void xmlInputEditorRef.current?.cutSelection()}
+ onPaste={() => void xmlInputEditorRef.current?.pasteText()}
+ onPrettify={() => void handleFormat('xmlInput')}
+ placeholderText="Paste or open XML here."
+ />
+
+ updateDocumentText('xsltCode', value)}
+ onOpen={() => void handleOpenFile('xsltCode')}
+ onSave={() => void handleSaveFile('xsltCode')}
+ onUndo={() => xsltEditorRef.current?.undo()}
+ onRedo={() => xsltEditorRef.current?.redo()}
+ onCopy={() => void xsltEditorRef.current?.copySelection()}
+ onCut={() => void xsltEditorRef.current?.cutSelection()}
+ onPaste={() => void xsltEditorRef.current?.pasteText()}
+ onPrettify={() => void handleFormat('xsltCode')}
+ placeholderText="Write or open XSLT here."
+ actions={
+
+ xsltEditorRef.current?.insertText(snippet)
+ }
+ />
+ }
+ />
+
+ updateDocumentText('xmlOutput', value)}
+ onOpen={null}
+ onSave={() => void handleSaveFile('xmlOutput')}
+ onUndo={() => outputEditorRef.current?.undo()}
+ onRedo={() => outputEditorRef.current?.redo()}
+ onCopy={() => void outputEditorRef.current?.copySelection()}
+ onCut={() => void outputEditorRef.current?.cutSelection()}
+ onPaste={() => void outputEditorRef.current?.pasteText()}
+ onPrettify={() => void handleFormat('xmlOutput')}
+ placeholderText="Transformation output appears here."
+ />
+
+
+ void handleApplyTransformation()}
+ onMoveOutputToInput={() => void handleMoveOutputToInput()}
+ onValidate={handleValidate}
+ onReset={() => void handleReset()}
+ prettifyOutputAfterTransform={state.options.prettifyOutputAfterTransform}
+ onPrettifyOutputAfterTransformChange={
+ handlePrettifyOutputAfterTransformChange
+ }
+ askBeforeOverwritingOutput={state.options.askBeforeOverwritingOutput}
+ onAskBeforeOverwritingOutputChange={
+ handleAskBeforeOverwritingOutputChange
+ }
+ busy={busy}
+ />
+
+ {statusMessage && {statusMessage}
}
+
+ {displayedRuntimeDiagnostics.length > 0 && (
+
+ Validation / runtime messages
+
+ {displayedRuntimeDiagnostics.map((diagnostic, index) => (
+
+ {diagnostic.source}
+ {diagnostic.message}
+
+ ))}
+
+
+ )}
+
+
+
+
+
+
Explain transformation
+
+ MVP approximation: result nodes are compared with simple
+ stylesheet template matches. Full execution tracing requires an
+ instrumented engine later.
+
+
+ {state.lastTransformation && (
+
+ Last run:{' '}
+ {new Date(
+ state.lastTransformation.transformedAt
+ ).toLocaleString()}
+
+ )}
+
+
+ {traceItems.length === 0 ? (
+
+ Run a transformation to see approximate result explanations.
+
+ ) : (
+
+
+
+
+ Result
+ Likely source
+ Likely template
+ Confidence
+
+
+
+ {traceItems.map((item) => (
+
+
+ {item.resultPath}
+
+
+ {item.likelySourcePath ?? '—'}
+
+
+ {item.likelyTemplate ?? '—'}
+
+ {item.confidence}
+
+ ))}
+
+
+
+ )}
+
+
+
+ {dialog?.content}
+
+
+ {helpOpen && (
+
+ )}
+
+ );
+};
+
+function tryFormatXml(text: string): string {
+ try {
+ return text.trim() ? formatXml(text) : text;
+ } catch {
+ return text;
+ }
+}
+
+function defaultFileName(kind: WorkbenchDocumentKind): string {
+ switch (kind) {
+ case 'xmlInput':
+ return 'input.xml';
+ case 'xsltCode':
+ return 'transform.xsl';
+ case 'xmlOutput':
+ return 'output.xml';
+ }
+}
+
+function isAbortError(error: unknown): boolean {
+ return error instanceof DOMException && error.name === 'AbortError';
+}
+
+export default App;
diff --git a/src/components/ActionDialog.tsx b/src/components/ActionDialog.tsx
new file mode 100644
index 0000000..5f34ebf
--- /dev/null
+++ b/src/components/ActionDialog.tsx
@@ -0,0 +1,88 @@
+import React, { useEffect } from 'react';
+
+export interface ActionDialogAction {
+ label: string;
+ onClick: () => void | Promise;
+ variant?: 'primary' | 'secondary' | 'danger';
+ disabled?: boolean;
+ autoFocus?: boolean;
+ title?: string;
+}
+
+interface ActionDialogProps {
+ open: boolean;
+ title: string;
+ children: React.ReactNode;
+ actions: ActionDialogAction[];
+ onClose: () => void;
+}
+
+const ActionDialog: React.FC = ({
+ open,
+ title,
+ children,
+ actions,
+ onClose,
+}) => {
+ useEffect(() => {
+ if (!open) return;
+
+ const handleKeyDown = (event: KeyboardEvent) => {
+ if (event.key === 'Escape') {
+ event.preventDefault();
+ onClose();
+ }
+ };
+
+ window.addEventListener('keydown', handleKeyDown);
+ return () => window.removeEventListener('keydown', handleKeyDown);
+ }, [open, onClose]);
+
+ if (!open) return null;
+
+ return (
+ {
+ if (event.target === event.currentTarget) onClose();
+ }}
+ >
+
+
+
{title}
+
+ ×
+
+
+
+
{children}
+
+
+ {actions.map((action) => (
+ void action.onClick()}
+ disabled={action.disabled}
+ autoFocus={action.autoFocus}
+ title={action.title}
+ >
+ {action.label}
+
+ ))}
+
+
+
+ );
+};
+
+export default ActionDialog;
diff --git a/src/components/DiagnosticsPanel.tsx b/src/components/DiagnosticsPanel.tsx
new file mode 100644
index 0000000..95d72dd
--- /dev/null
+++ b/src/components/DiagnosticsPanel.tsx
@@ -0,0 +1,28 @@
+import React from 'react';
+import type { DiagnosticMessage } from '../validation/validationTypes';
+
+interface DiagnosticsPanelProps {
+ diagnostics: DiagnosticMessage[];
+}
+
+const DiagnosticsPanel: React.FC = ({ diagnostics }) => {
+ if (diagnostics.length === 0) {
+ return No diagnostics.
;
+ }
+
+ return (
+
+ {diagnostics.map((diagnostic, index) => (
+
+ {diagnostic.severity.toUpperCase()}
+ {diagnostic.message}
+
+ ))}
+
+ );
+};
+
+export default DiagnosticsPanel;
diff --git a/src/components/EditorPanel.tsx b/src/components/EditorPanel.tsx
new file mode 100644
index 0000000..1ff0a65
--- /dev/null
+++ b/src/components/EditorPanel.tsx
@@ -0,0 +1,189 @@
+import React, { forwardRef } from 'react';
+import CodeMirrorEditor from '../editor/CodeMirrorEditor';
+import type { CodeMirrorEditorHandle } from '../editor/editorTypes';
+import { summarizeDiagnostics } from '../editor/diagnostics';
+import type { DiagnosticMessage } from '../validation/validationTypes';
+import DiagnosticsPanel from './DiagnosticsPanel';
+
+interface EditorPanelProps {
+ title: string;
+ value: string;
+ fileName?: string;
+ dirty?: boolean;
+ readOnly?: boolean;
+ diagnostics: DiagnosticMessage[];
+ onChange: (value: string) => void;
+ onOpen?: (() => void) | null;
+ onSave?: (() => void) | null;
+ onPrettify?: (() => void) | null;
+ onUndo?: () => void;
+ onRedo?: () => void;
+ onCopy?: () => void;
+ onCut?: () => void;
+ onPaste?: () => void;
+ actions?: React.ReactNode;
+ placeholderText?: string;
+}
+
+const EditorPanel = forwardRef(
+ (
+ {
+ title,
+ value,
+ fileName,
+ dirty = false,
+ readOnly = false,
+ diagnostics,
+ onChange,
+ onOpen,
+ onSave,
+ onUndo,
+ onRedo,
+ onCopy,
+ onCut,
+ onPaste,
+ onPrettify,
+ actions,
+ placeholderText,
+ },
+ ref
+ ) => {
+ return (
+
+
+
+
{title}
+
+ {fileName ?? 'No file'} {dirty ? '• unsaved changes' : ''}
+
+
+
+ {summarizeDiagnostics(diagnostics)}
+
+
+
+
+ {onOpen && (
+
+
+
+ )}
+
+ {onSave && (
+
+
+
+ )}
+
+ {(onOpen || onSave) && (
+
+ )}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {onPrettify && (
+ <>
+
+
+
+
+ >
+ )}
+
+ {actions && (
+
+ )}
+ {actions}
+
+
+
+
+
+
+ );
+ }
+);
+
+EditorPanel.displayName = 'EditorPanel';
+
+export default EditorPanel;
diff --git a/src/components/HelpDialog.tsx b/src/components/HelpDialog.tsx
new file mode 100644
index 0000000..b0136a9
--- /dev/null
+++ b/src/components/HelpDialog.tsx
@@ -0,0 +1,72 @@
+import React from 'react';
+
+interface HelpDialogProps {
+ open: boolean;
+ onClose: () => void;
+}
+
+const HelpDialog: React.FC = ({ open, onClose }) => {
+ if (!open) return null;
+
+ return (
+
+
+
+
+
XSLT tools help
+
Local-only XML/XSLT transformation workbench.
+
+
+ ×
+
+
+
+
+
What this tool does
+
+ The app keeps XML input, XSLT code, and XML output in three editor
+ panels. The current workspace is saved to LocalStorage and files are
+ opened/saved directly through the browser.
+
+
+
Transformation engine
+
+ The first version used the browser-native XSLTProcessor
+ , which is suitable for XSLT 1.0. This engine likely is to be retired
+ in late 2026. For XSLT 3.0, a SaxonJS engine was added that fully runs
+ in the browser (JS-only).
+
+
+
Keyboard shortcuts
+
+
+ Ctrl /Cmd + Z : undo
+
+
+ Ctrl /Cmd + Shift + Z or Ctrl /Cmd + Y :
+ redo
+
+
+ Ctrl /Cmd + F : find in the active
+ editor
+
+
+ Tab : indent selection
+
+
+ Shift + Tab : outdent selection
+
+
+
+
Privacy
+
+ No upload code is included. Files are read locally by the browser
+ and the workspace is stored in your browser storage.
+
+
+
+
+ );
+};
+
+export default HelpDialog;
diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx
new file mode 100644
index 0000000..696e0ba
--- /dev/null
+++ b/src/components/Layout.tsx
@@ -0,0 +1,50 @@
+import React from 'react';
+import { APP_VERSION } from '../version';
+
+interface LayoutProps {
+ children: React.ReactNode;
+ onOpenHelp?: () => void;
+}
+
+const Layout: React.FC = ({ children, onOpenHelp }) => {
+ return (
+
+
+
+
+
+ ⚙️
+
+
+
XSLT tools
+ All transformations stay in your browser
+
+
+
+
+ {onOpenHelp && (
+
+ Help
+
+ )}
+
+
+ v{APP_VERSION}
+
+
+
+
+
+
{children}
+
+ );
+};
+
+export default Layout;
diff --git a/src/components/SnippetToolbox.tsx b/src/components/SnippetToolbox.tsx
new file mode 100644
index 0000000..ee4efe4
--- /dev/null
+++ b/src/components/SnippetToolbox.tsx
@@ -0,0 +1,32 @@
+import React from 'react';
+import { xsltSnippets } from '../editor/xsltSnippets';
+
+interface SnippetToolboxProps {
+ onInsertSnippet: (snippet: string) => void;
+}
+
+const SnippetToolbox: React.FC = ({ onInsertSnippet }) => {
+ return (
+
+
+
+ Snippets
+
+
+ {xsltSnippets.map((snippet) => (
+ onInsertSnippet(snippet.text)}
+ title={snippet.description}
+ >
+ {snippet.label}
+
+ ))}
+
+
+ );
+};
+
+export default SnippetToolbox;
diff --git a/src/components/Toolbar.tsx b/src/components/Toolbar.tsx
new file mode 100644
index 0000000..4937020
--- /dev/null
+++ b/src/components/Toolbar.tsx
@@ -0,0 +1,115 @@
+import React from 'react';
+import type { TransformEngineId } from '../transform/transformTypes';
+import { availableTransformEngines } from '../transform/transformService';
+
+interface ToolbarProps {
+ selectedEngine: TransformEngineId;
+ onEngineChange: (engine: TransformEngineId) => void;
+ onApplyTransformation: () => void;
+ onMoveOutputToInput: () => void;
+ onValidate: () => void;
+ onReset: () => void;
+ prettifyOutputAfterTransform: boolean;
+ onPrettifyOutputAfterTransformChange: (enabled: boolean) => void;
+ askBeforeOverwritingOutput: boolean;
+ onAskBeforeOverwritingOutputChange: (enabled: boolean) => void;
+ busy?: boolean;
+}
+
+const Toolbar: React.FC = ({
+ selectedEngine,
+ onEngineChange,
+ onApplyTransformation,
+ onMoveOutputToInput,
+ onValidate,
+ onReset,
+ prettifyOutputAfterTransform = false,
+ onPrettifyOutputAfterTransformChange,
+ askBeforeOverwritingOutput = true,
+ onAskBeforeOverwritingOutputChange,
+ busy = false,
+}) => {
+ return (
+
+ );
+};
+
+export default Toolbar;
diff --git a/src/editor/CodeMirrorEditor.tsx b/src/editor/CodeMirrorEditor.tsx
new file mode 100644
index 0000000..701ec80
--- /dev/null
+++ b/src/editor/CodeMirrorEditor.tsx
@@ -0,0 +1,205 @@
+import React, {
+ forwardRef,
+ useEffect,
+ useImperativeHandle,
+ useRef,
+} from 'react';
+import { basicSetup } from 'codemirror';
+import { EditorState } from '@codemirror/state';
+import { EditorView, keymap, placeholder } from '@codemirror/view';
+import {
+ defaultKeymap,
+ history,
+ historyKeymap,
+ indentWithTab,
+ redo as cmRedo,
+ undo as cmUndo,
+} from '@codemirror/commands';
+import { xml } from '@codemirror/lang-xml';
+import { searchKeymap } from '@codemirror/search';
+import type { CodeMirrorEditorHandle } from './editorTypes';
+
+interface CodeMirrorEditorProps {
+ value: string;
+ onChange: (nextValue: string) => void;
+ readOnly?: boolean;
+ ariaLabel: string;
+ minHeight?: string;
+ placeholderText?: string;
+}
+
+const editorTheme = EditorView.theme({
+ '&': {
+ minHeight: '100%',
+ height: '100%',
+ fontSize: '0.9rem',
+ },
+ '.cm-scroller': {
+ fontFamily:
+ 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace',
+ },
+ '.cm-content': {
+ minHeight: '100%',
+ },
+ '.cm-gutters': {
+ borderRight: '1px solid #e5e7eb',
+ },
+});
+
+const CodeMirrorEditor = forwardRef<
+ CodeMirrorEditorHandle,
+ CodeMirrorEditorProps
+>(
+ (
+ {
+ value,
+ onChange,
+ readOnly = false,
+ ariaLabel,
+ minHeight = '28rem',
+ placeholderText,
+ },
+ ref
+ ) => {
+ const containerRef = useRef(null);
+ const viewRef = useRef(null);
+ const onChangeRef = useRef(onChange);
+ const syncingExternalValueRef = useRef(false);
+
+ useEffect(() => {
+ onChangeRef.current = onChange;
+ }, [onChange]);
+
+ useEffect(() => {
+ if (!containerRef.current) return;
+
+ const state = EditorState.create({
+ doc: value,
+ extensions: [
+ basicSetup,
+ history(),
+ xml(),
+ keymap.of([
+ indentWithTab,
+ ...defaultKeymap,
+ ...historyKeymap,
+ ...searchKeymap,
+ ]),
+ EditorState.readOnly.of(readOnly),
+ EditorView.lineWrapping,
+ editorTheme,
+ placeholder(placeholderText ?? ''),
+ EditorView.updateListener.of((update) => {
+ if (update.docChanged && !syncingExternalValueRef.current) {
+ onChangeRef.current(update.state.doc.toString());
+ }
+ }),
+ EditorView.contentAttributes.of({
+ 'aria-label': ariaLabel,
+ spellcheck: 'false',
+ }),
+ ],
+ });
+
+ const view = new EditorView({ state, parent: containerRef.current });
+ viewRef.current = view;
+
+ return () => {
+ view.destroy();
+ viewRef.current = null;
+ };
+ // The editor is created once. External value changes are synchronized below.
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, []);
+
+ useEffect(() => {
+ const view = viewRef.current;
+ if (!view) return;
+
+ const currentValue = view.state.doc.toString();
+ if (currentValue === value) return;
+
+ syncingExternalValueRef.current = true;
+ view.dispatch({
+ changes: {
+ from: 0,
+ to: currentValue.length,
+ insert: value,
+ },
+ });
+ syncingExternalValueRef.current = false;
+ }, [value]);
+
+ useImperativeHandle(ref, () => ({
+ focus: () => viewRef.current?.focus(),
+ undo: () => {
+ const view = viewRef.current;
+ return view
+ ? cmUndo({ state: view.state, dispatch: view.dispatch })
+ : false;
+ },
+ redo: () => {
+ const view = viewRef.current;
+ return view
+ ? cmRedo({ state: view.state, dispatch: view.dispatch })
+ : false;
+ },
+ insertText: (text: string) => {
+ const view = viewRef.current;
+ if (!view || readOnly) return;
+
+ view.dispatch(view.state.replaceSelection(text), {
+ scrollIntoView: true,
+ });
+ view.focus();
+ },
+ copySelection: async () => {
+ const view = viewRef.current;
+ if (!view) return false;
+
+ const selectedText = getSelectedText(view);
+ if (!selectedText) return false;
+
+ await navigator.clipboard.writeText(selectedText);
+ return true;
+ },
+ cutSelection: async () => {
+ const view = viewRef.current;
+ if (!view || readOnly) return false;
+
+ const selectedText = getSelectedText(view);
+ if (!selectedText) return false;
+
+ await navigator.clipboard.writeText(selectedText);
+ view.dispatch(view.state.replaceSelection(''));
+ return true;
+ },
+ pasteText: async () => {
+ const view = viewRef.current;
+ if (!view || readOnly) return false;
+
+ const clipboardText = await navigator.clipboard.readText();
+ if (!clipboardText) return false;
+
+ view.dispatch(view.state.replaceSelection(clipboardText));
+ view.focus();
+ return true;
+ },
+ }));
+
+ return (
+
+ );
+ }
+);
+
+function getSelectedText(view: EditorView): string {
+ return view.state.selection.ranges
+ .map((range) => view.state.sliceDoc(range.from, range.to))
+ .filter(Boolean)
+ .join('\n');
+}
+
+CodeMirrorEditor.displayName = 'CodeMirrorEditor';
+
+export default CodeMirrorEditor;
diff --git a/src/editor/diagnostics.ts b/src/editor/diagnostics.ts
new file mode 100644
index 0000000..8b12bf6
--- /dev/null
+++ b/src/editor/diagnostics.ts
@@ -0,0 +1,14 @@
+import type { DiagnosticMessage } from '../validation/validationTypes';
+
+export function summarizeDiagnostics(diagnostics: DiagnosticMessage[]): string {
+ const errors = diagnostics.filter((item) => item.severity === 'error').length;
+ const warnings = diagnostics.filter(
+ (item) => item.severity === 'warning'
+ ).length;
+
+ if (errors === 0 && warnings === 0) return 'No diagnostics';
+ if (errors > 0 && warnings > 0)
+ return `${errors} error(s), ${warnings} warning(s)`;
+ if (errors > 0) return `${errors} error(s)`;
+ return `${warnings} warning(s)`;
+}
diff --git a/src/editor/editorTypes.ts b/src/editor/editorTypes.ts
new file mode 100644
index 0000000..78e7fff
--- /dev/null
+++ b/src/editor/editorTypes.ts
@@ -0,0 +1,9 @@
+export interface CodeMirrorEditorHandle {
+ focus: () => void;
+ undo: () => boolean;
+ redo: () => boolean;
+ insertText: (text: string) => void;
+ copySelection: () => Promise;
+ cutSelection: () => Promise;
+ pasteText: () => Promise;
+}
diff --git a/src/editor/xsltSnippets.ts b/src/editor/xsltSnippets.ts
new file mode 100644
index 0000000..5c367fc
--- /dev/null
+++ b/src/editor/xsltSnippets.ts
@@ -0,0 +1,96 @@
+export interface XsltSnippet {
+ id: string;
+ label: string;
+ description: string;
+ text: string;
+}
+
+export const xsltSnippets: XsltSnippet[] = [
+ {
+ id: 'stylesheet',
+ label: 'Stylesheet',
+ description: 'Basic XSLT 1.0 stylesheet skeleton.',
+ text: `
+
+
+
+
+
+
+
+ `,
+ },
+ {
+ id: 'identity',
+ label: 'Identity transform',
+ description:
+ 'Copy all nodes and attributes unless a more specific template overrides them.',
+ text: `
+
+
+
+ `,
+ },
+ {
+ id: 'template-match',
+ label: 'Template match',
+ description: 'Template matching an element name.',
+ text: `
+
+ `,
+ },
+ {
+ id: 'value-of',
+ label: 'Value-of',
+ description: 'Insert the string value of a selected node.',
+ text: ` `,
+ },
+ {
+ id: 'apply-templates',
+ label: 'Apply templates',
+ description: 'Continue processing selected child nodes.',
+ text: ` `,
+ },
+ {
+ id: 'for-each',
+ label: 'For each',
+ description: 'Loop over a selected node set.',
+ text: `
+
+ `,
+ },
+ {
+ id: 'choose',
+ label: 'Choose/when',
+ description: 'Conditional branching.',
+ text: `
+
+
+
+
+
+
+ `,
+ },
+ {
+ id: 'attribute',
+ label: 'Attribute',
+ description: 'Create an output attribute.',
+ text: `
+
+ `,
+ },
+ {
+ id: 'param',
+ label: 'Parameter',
+ description: 'Declare a stylesheet parameter.',
+ text: ` `,
+ },
+ {
+ id: 'variable',
+ label: 'Variable',
+ description: 'Declare a local or global variable.',
+ text: ` `,
+ },
+];
diff --git a/src/file/fileService.ts b/src/file/fileService.ts
new file mode 100644
index 0000000..3362cbc
--- /dev/null
+++ b/src/file/fileService.ts
@@ -0,0 +1,135 @@
+import type { OpenedTextFile, SaveTextFileOptions } from './fileTypes';
+import type { WorkbenchDocumentKind } from '../workspace/workspaceTypes';
+
+type FilePickerAcceptType = {
+ description?: string;
+ accept: Record;
+};
+
+type WritableFileHandle = {
+ write(data: Blob): Promise | void;
+ close(): Promise | void;
+};
+
+type LocalFileSystemFileHandle = {
+ name: string;
+ getFile(): Promise;
+ createWritable(): Promise;
+};
+
+type WindowWithFilePicker = Window & {
+ showOpenFilePicker?: (options?: {
+ multiple?: boolean;
+ types?: FilePickerAcceptType[];
+ excludeAcceptAllOption?: boolean;
+ }) => Promise;
+ showSaveFilePicker?: (options?: {
+ suggestedName?: string;
+ types?: FilePickerAcceptType[];
+ excludeAcceptAllOption?: boolean;
+ }) => Promise;
+};
+
+const XML_TYPES: FilePickerAcceptType[] = [
+ {
+ description: 'XML and XSLT files',
+ accept: {
+ 'application/xml': ['.xml', '.xsl', '.xslt'],
+ 'text/xml': ['.xml', '.xsl', '.xslt'],
+ 'text/plain': ['.txt'],
+ },
+ },
+];
+
+export async function openTextFile(
+ kind?: WorkbenchDocumentKind
+): Promise {
+ const pickerWindow = window as WindowWithFilePicker;
+
+ if (pickerWindow.showOpenFilePicker) {
+ const [handle] = await pickerWindow.showOpenFilePicker({
+ multiple: false,
+ types: XML_TYPES,
+ excludeAcceptAllOption: false,
+ });
+
+ if (!handle) return null;
+
+ const file = await handle.getFile();
+ return { name: file.name, text: await file.text() };
+ }
+
+ return openWithInputFallback(kind);
+}
+
+export async function saveTextFile({
+ suggestedName,
+ text,
+ mimeType = 'application/xml;charset=utf-8',
+}: SaveTextFileOptions): Promise {
+ const pickerWindow = window as WindowWithFilePicker;
+
+ if (pickerWindow.showSaveFilePicker) {
+ const handle = await pickerWindow.showSaveFilePicker({
+ suggestedName,
+ types: XML_TYPES,
+ excludeAcceptAllOption: false,
+ });
+
+ const writable = await handle.createWritable();
+ await writable.write(new Blob([text], { type: mimeType }));
+ await writable.close();
+ return handle.name;
+ }
+
+ saveViaDownloadFallback(suggestedName, text, mimeType);
+ return suggestedName;
+}
+
+function openWithInputFallback(
+ kind?: WorkbenchDocumentKind
+): Promise {
+ return new Promise((resolve) => {
+ const input = document.createElement('input');
+ input.type = 'file';
+ input.accept = kind === 'xsltCode' ? '.xsl,.xslt,.xml,.txt' : '.xml,.txt';
+ input.style.display = 'none';
+
+ input.addEventListener(
+ 'change',
+ async () => {
+ const file = input.files?.[0];
+ input.remove();
+
+ if (!file) {
+ resolve(null);
+ return;
+ }
+
+ resolve({ name: file.name, text: await file.text() });
+ },
+ { once: true }
+ );
+
+ document.body.appendChild(input);
+ input.click();
+ });
+}
+
+function saveViaDownloadFallback(
+ suggestedName: string,
+ text: string,
+ mimeType: string
+): void {
+ const blob = new Blob([text], { type: mimeType });
+ const url = URL.createObjectURL(blob);
+ const link = document.createElement('a');
+ link.href = url;
+ link.download = suggestedName;
+ link.style.display = 'none';
+
+ document.body.appendChild(link);
+ link.click();
+ link.remove();
+ window.setTimeout(() => URL.revokeObjectURL(url), 500);
+}
diff --git a/src/file/fileTypes.ts b/src/file/fileTypes.ts
new file mode 100644
index 0000000..cc91ad3
--- /dev/null
+++ b/src/file/fileTypes.ts
@@ -0,0 +1,13 @@
+import type { WorkbenchDocumentKind } from '../workspace/workspaceTypes';
+
+export interface OpenedTextFile {
+ name: string;
+ text: string;
+}
+
+export interface SaveTextFileOptions {
+ suggestedName: string;
+ text: string;
+ mimeType?: string;
+ kind?: WorkbenchDocumentKind;
+}
diff --git a/src/main.tsx b/src/main.tsx
new file mode 100644
index 0000000..bdfd1f3
--- /dev/null
+++ b/src/main.tsx
@@ -0,0 +1,11 @@
+import React from 'react';
+import ReactDOM from 'react-dom/client';
+import App from './App';
+import 'bootstrap-icons/font/bootstrap-icons.css';
+import './styles.css';
+
+ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
+
+
+
+);
diff --git a/src/styles.css b/src/styles.css
new file mode 100644
index 0000000..452c41b
--- /dev/null
+++ b/src/styles.css
@@ -0,0 +1,670 @@
+*,
+*::before,
+*::after {
+ box-sizing: border-box;
+}
+
+:root {
+ color-scheme: light;
+ font-family:
+ system-ui,
+ -apple-system,
+ BlinkMacSystemFont,
+ 'Segoe UI',
+ sans-serif;
+ background: #f3f4f6;
+ color: #111827;
+}
+
+body {
+ margin: 0;
+ min-width: 1180px;
+ background: #f3f4f6;
+}
+
+button,
+select,
+input {
+ font: inherit;
+}
+
+code,
+kbd {
+ font-family:
+ ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono',
+ monospace;
+}
+
+.app-root {
+ min-height: 100vh;
+}
+
+.app-header {
+ position: sticky;
+ top: 0;
+ z-index: 10;
+ background: #111827;
+ color: #e5e7eb;
+ padding: 0.65rem 1rem;
+ box-shadow: 0 1px 3px rgba(15, 23, 42, 0.4);
+}
+
+.app-header-content {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 1rem;
+}
+
+.app-header-title {
+ display: flex;
+ align-items: center;
+ gap: 0.65rem;
+}
+
+.app-logo {
+ font-size: 1.35rem;
+}
+
+.app-header h1 {
+ font-size: 1.05rem;
+ margin: 0;
+}
+
+.app-header small {
+ color: #9ca3af;
+ font-size: 0.8rem;
+}
+
+.app-header-actions {
+ display: flex;
+ align-items: center;
+ gap: 0.5rem;
+}
+
+.app-version {
+ border-radius: 999px;
+ background: #374151;
+ color: #d1d5db;
+ padding: 0.4rem 0.7rem;
+ font-size: 0.85rem;
+ font-weight: 600;
+ line-height: 1;
+ white-space: nowrap;
+}
+
+.app-help-button {
+ border: 1px solid #4b5563;
+ border-radius: 999px;
+ background: transparent;
+ color: #e5e7eb;
+ padding: 0.35rem 0.65rem;
+ font-size: 0.85rem;
+ font-weight: 600;
+ cursor: pointer;
+ line-height: 1;
+}
+
+.app-help-button:hover,
+.app-help-button:focus-visible {
+ background: #374151;
+ outline: none;
+}
+
+.app-main {
+ padding: 0.75rem;
+ display: flex;
+ flex-direction: column;
+ gap: 0.75rem;
+}
+
+.card {
+ width: 100%;
+ background: #ffffff;
+ border-radius: 0.75rem;
+ box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
+}
+
+.button,
+.mini-button,
+.snippet-button,
+.icon-button,
+.editor-tool-button {
+ border: none;
+ cursor: pointer;
+}
+
+.button:disabled,
+.mini-button:disabled,
+.snippet-button:disabled,
+.editor-tool-button:disabled {
+ opacity: 0.55;
+ cursor: default;
+}
+
+.button {
+ border-radius: 0.5rem;
+ padding: 0.45rem 0.85rem;
+ font-size: 0.9rem;
+ font-weight: 600;
+}
+
+.button.primary {
+ background: #2563eb;
+ color: #ffffff;
+}
+
+.button.secondary {
+ background: #e5e7eb;
+ color: #111827;
+}
+
+.button.danger {
+ background: #dc2626;
+ color: #ffffff;
+}
+
+.button.danger-outline {
+ border: 1px solid #fecaca;
+ background: #fff1f2;
+ color: #991b1b;
+}
+
+.icon-button {
+ width: 1.9rem;
+ height: 1.9rem;
+ border-radius: 999px;
+ background: #e5e7eb;
+ color: #111827;
+ font-size: 1.2rem;
+ line-height: 1;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.toolbar {
+ padding: 0.8rem;
+ display: flex;
+ flex-direction: column;
+ gap: 0.6rem;
+}
+
+.toolbar-row {
+ display: flex;
+ align-items: center;
+ gap: 0.5rem;
+ flex-wrap: wrap;
+}
+
+.toolbar-row-main {
+ padding-top: 0;
+}
+
+.toolbar-options {
+ align-items: center;
+ color: #374151;
+ font-size: 0.85rem;
+}
+
+.toggle-option {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.5rem;
+ font-weight: 600;
+ cursor: pointer;
+ user-select: none;
+}
+
+.toggle-option input {
+ position: absolute;
+ opacity: 0;
+ pointer-events: none;
+}
+
+.toggle-slider {
+ position: relative;
+ width: 2.35rem;
+ height: 1.25rem;
+ border-radius: 999px;
+ background: #d1d5db;
+ transition:
+ background 0.15s ease,
+ box-shadow 0.15s ease;
+}
+
+.toggle-slider::before {
+ content: '';
+ position: absolute;
+ top: 0.17rem;
+ left: 0.17rem;
+ width: 0.91rem;
+ height: 0.91rem;
+ border-radius: 999px;
+ background: #ffffff;
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
+ transition: transform 0.15s ease;
+}
+
+.toggle-option input:checked + .toggle-slider {
+ background: #2563eb;
+}
+
+.toggle-option input:checked + .toggle-slider::before {
+ transform: translateX(1.1rem);
+}
+
+.toggle-option input:focus-visible + .toggle-slider {
+ box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22);
+}
+
+.toolbar-meta {
+ justify-content: space-between;
+ color: #6b7280;
+ font-size: 0.85rem;
+}
+
+.toolbar-meta label {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.5rem;
+ font-weight: 600;
+ color: #374151;
+}
+
+.toolbar-meta select {
+ min-width: 18rem;
+ padding: 0.35rem 0.5rem;
+ border: 1px solid #d1d5db;
+ border-radius: 0.5rem;
+ background: #ffffff;
+}
+
+.status-banner {
+ border-left: 4px solid #2563eb;
+ border-radius: 0.65rem;
+ background: #eff6ff;
+ color: #1e3a8a;
+ padding: 0.65rem 0.8rem;
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
+}
+
+.runtime-diagnostics {
+ padding: 0.85rem;
+}
+
+.runtime-diagnostics h2 {
+ margin: 0 0 0.5rem;
+ font-size: 0.95rem;
+}
+
+.workspace-grid {
+ display: grid;
+ grid-template-columns: repeat(3, minmax(0, 1fr));
+ gap: 0.75rem;
+ align-items: stretch;
+}
+
+.editor-panel {
+ min-width: 0;
+ padding: 0.75rem;
+ display: flex;
+ flex-direction: column;
+ gap: 0.55rem;
+}
+
+.editor-panel-header {
+ display: flex;
+ align-items: flex-start;
+ justify-content: space-between;
+ gap: 0.5rem;
+}
+
+.editor-panel h2 {
+ margin: 0;
+ font-size: 0.98rem;
+}
+
+.editor-panel small {
+ color: #6b7280;
+ font-size: 0.78rem;
+}
+
+.diagnostics-badge {
+ flex: 0 0 auto;
+ border-radius: 999px;
+ background: #f3f4f6;
+ color: #4b5563;
+ padding: 0.3rem 0.55rem;
+ font-size: 0.75rem;
+ font-weight: 700;
+}
+
+.editor-panel-actions {
+ display: flex;
+ gap: 0.25rem;
+ flex-wrap: wrap;
+ align-items: center;
+ padding: 0.25rem;
+ border: 1px solid #e5e7eb;
+ border-radius: 0.55rem;
+ background: #f9fafb;
+}
+
+.editor-tool-button {
+ width: 1.9rem;
+ height: 1.9rem;
+ border-radius: 0.4rem;
+ background: transparent;
+ color: #374151;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 0.95rem;
+ line-height: 1;
+}
+
+.editor-tool-button i {
+ pointer-events: none;
+}
+
+.editor-tool-button:hover:not(:disabled),
+.editor-tool-button:focus-visible {
+ background: #e5e7eb;
+ outline: none;
+}
+
+.editor-toolbar-separator {
+ width: 1px;
+ align-self: stretch;
+ min-height: 1.45rem;
+ margin: 0 0.2rem;
+ background: #d1d5db;
+}
+
+.mini-button,
+.snippet-button {
+ border-radius: 0.4rem;
+ background: #f3f4f6;
+ color: #374151;
+ padding: 0.28rem 0.48rem;
+ font-size: 0.78rem;
+ font-weight: 600;
+}
+
+.mini-button:hover,
+.snippet-button:hover {
+ background: #e5e7eb;
+}
+
+.editor-host {
+ overflow: hidden;
+ border: 1px solid #d1d5db;
+ border-radius: 0.65rem;
+ background: #ffffff;
+}
+
+.editor-host .cm-editor {
+ min-height: 28rem;
+ height: 28rem;
+}
+
+.editor-host .cm-focused {
+ outline: 2px solid #bfdbfe;
+ outline-offset: -2px;
+}
+
+.snippet-toolbox {
+ position: relative;
+}
+
+.snippet-toolbox summary {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.35rem;
+}
+
+.snippet-toolbox summary::-webkit-details-marker {
+ display: none;
+}
+
+.snippet-grid {
+ position: absolute;
+ z-index: 5;
+ right: 0;
+ top: 1.8rem;
+ width: 18rem;
+ max-height: 18rem;
+ overflow: auto;
+ display: grid;
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ gap: 0.35rem;
+ padding: 0.55rem;
+ border: 1px solid #c7d2fe;
+ border-radius: 0.65rem;
+ background: #ffffff;
+ box-shadow: 0 12px 30px rgba(15, 23, 42, 0.22);
+}
+
+.diagnostics-empty {
+ margin: 0;
+ color: #6b7280;
+ font-size: 0.82rem;
+}
+
+.diagnostics-list {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+ display: flex;
+ flex-direction: column;
+ gap: 0.35rem;
+}
+
+.diagnostic {
+ display: grid;
+ grid-template-columns: auto 1fr;
+ gap: 0.45rem;
+ align-items: start;
+ border-radius: 0.5rem;
+ padding: 0.45rem 0.55rem;
+ font-size: 0.8rem;
+}
+
+.diagnostic strong {
+ font-size: 0.72rem;
+}
+
+.diagnostic-error {
+ background: #fef2f2;
+ color: #991b1b;
+}
+
+.diagnostic-warning {
+ background: #fffbeb;
+ color: #92400e;
+}
+
+.diagnostic-info {
+ background: #eff6ff;
+ color: #1e40af;
+}
+
+.trace-panel {
+ padding: 0.85rem;
+}
+
+.trace-header {
+ display: flex;
+ justify-content: space-between;
+ gap: 1rem;
+ align-items: flex-start;
+ margin-bottom: 0.75rem;
+}
+
+.trace-header h2 {
+ margin: 0;
+ font-size: 0.98rem;
+}
+
+.trace-header p {
+ margin: 0.2rem 0 0;
+ color: #6b7280;
+ font-size: 0.86rem;
+}
+
+.trace-header small {
+ color: #6b7280;
+ white-space: nowrap;
+}
+
+.trace-table-wrap {
+ overflow: auto;
+ border: 1px solid #e5e7eb;
+ border-radius: 0.65rem;
+}
+
+.trace-table {
+ width: 100%;
+ border-collapse: collapse;
+ font-size: 0.84rem;
+}
+
+.trace-table th,
+.trace-table td {
+ padding: 0.5rem;
+ border-bottom: 1px solid #e5e7eb;
+ text-align: left;
+ vertical-align: top;
+}
+
+.trace-table th {
+ background: #f9fafb;
+ color: #374151;
+ font-size: 0.78rem;
+ text-transform: uppercase;
+ letter-spacing: 0.04em;
+}
+
+.action-dialog-backdrop,
+.help-dialog-backdrop {
+ position: fixed;
+ inset: 0;
+ z-index: 70;
+ background: rgba(15, 23, 42, 0.6);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding: 1rem;
+}
+
+.action-dialog-panel {
+ width: min(440px, 100%);
+ background: #ffffff;
+ border-radius: 0.75rem;
+ box-shadow: 0 20px 40px rgba(15, 23, 42, 0.35);
+ padding: 1rem;
+ display: flex;
+ flex-direction: column;
+ gap: 0.75rem;
+}
+
+.action-dialog-header,
+.help-dialog-header {
+ display: flex;
+ align-items: flex-start;
+ justify-content: space-between;
+ gap: 0.75rem;
+}
+
+.action-dialog-header h2,
+.help-dialog-header h2 {
+ margin: 0;
+ font-size: 1rem;
+}
+
+.action-dialog-body {
+ color: #4b5563;
+ font-size: 0.9rem;
+ line-height: 1.45;
+}
+
+.action-dialog-body p {
+ margin: 0;
+}
+
+.action-dialog-actions {
+ display: flex;
+ justify-content: flex-end;
+ gap: 0.5rem;
+ flex-wrap: wrap;
+}
+
+.help-dialog-backdrop {
+ z-index: 80;
+}
+
+.help-dialog-panel {
+ width: min(900px, 100%);
+ max-height: min(88vh, 760px);
+ overflow: auto;
+ background: #ffffff;
+ border-radius: 0.9rem;
+ box-shadow: 0 24px 60px rgba(15, 23, 42, 0.4);
+}
+
+.help-dialog-header {
+ position: sticky;
+ top: 0;
+ z-index: 1;
+ padding: 1rem;
+ background: #ffffff;
+ border-bottom: 1px solid #e5e7eb;
+}
+
+.help-dialog-header p {
+ margin: 0.2rem 0 0;
+ color: #6b7280;
+}
+
+.help-dialog-content {
+ padding: 1rem;
+ color: #374151;
+ line-height: 1.5;
+}
+
+.help-dialog-content h3 {
+ margin: 1rem 0 0.35rem;
+}
+
+.help-dialog-content h3:first-child {
+ margin-top: 0;
+}
+
+kbd {
+ border: 1px solid #d1d5db;
+ border-bottom-width: 2px;
+ border-radius: 0.3rem;
+ background: #f9fafb;
+ padding: 0.05rem 0.25rem;
+ font-size: 0.82em;
+}
+
+@media (max-width: 1280px) {
+ body {
+ min-width: 0;
+ }
+
+ .workspace-grid {
+ grid-template-columns: 1fr;
+ }
+
+ .editor-host .cm-editor {
+ height: 24rem;
+ }
+
+ .toolbar-meta {
+ align-items: flex-start;
+ flex-direction: column;
+ }
+}
diff --git a/src/transform/hash.ts b/src/transform/hash.ts
new file mode 100644
index 0000000..2f45f41
--- /dev/null
+++ b/src/transform/hash.ts
@@ -0,0 +1,20 @@
+export async function createSha256Hash(text: string): Promise {
+ if (!window.crypto?.subtle) {
+ return createFallbackHash(text);
+ }
+
+ const data = new TextEncoder().encode(text);
+ const digest = await window.crypto.subtle.digest('SHA-256', data);
+ const bytes = Array.from(new Uint8Array(digest));
+ return bytes.map((byte) => byte.toString(16).padStart(2, '0')).join('');
+}
+
+function createFallbackHash(text: string): string {
+ let hash = 0;
+ for (let index = 0; index < text.length; index += 1) {
+ hash = (hash << 5) - hash + text.charCodeAt(index);
+ hash |= 0;
+ }
+
+ return `fallback-${Math.abs(hash).toString(16)}`;
+}
diff --git a/src/transform/nativeXsltEngine.ts b/src/transform/nativeXsltEngine.ts
new file mode 100644
index 0000000..d3ee39a
--- /dev/null
+++ b/src/transform/nativeXsltEngine.ts
@@ -0,0 +1,69 @@
+import { createSha256Hash } from './hash';
+import { serializeResultDocument } from './serialization';
+import type {
+ TransformEngine,
+ TransformRequest,
+ TransformResult,
+ TransformationRun,
+} from './transformTypes';
+import { parseXmlDocument } from '../validation/xmlValidation';
+import { validateXslt } from '../validation/xsltValidation';
+import { hasErrors } from '../validation/validationTypes';
+
+export const nativeXsltEngine: TransformEngine = {
+ id: 'native-xsltprocessor',
+ label: 'Native browser XSLTProcessor',
+ supportsXsltVersions: ['1.0'],
+ async transform(request: TransformRequest): Promise {
+ const xmlParse = parseXmlDocument(request.xmlText, 'XML input');
+ const xsltDiagnostics = validateXslt(request.xsltText, request.engine);
+
+ const diagnostics = [...xmlParse.diagnostics, ...xsltDiagnostics];
+ if (hasErrors(diagnostics)) {
+ return {
+ output: '',
+ diagnostics,
+ engine: request.engine,
+ transformedAt: new Date().toISOString(),
+ };
+ }
+
+ const stylesheetParse = parseXmlDocument(
+ request.xsltText,
+ 'XSLT stylesheet'
+ );
+
+ const processor = new XSLTProcessor();
+ processor.importStylesheet(stylesheetParse.document);
+
+ const resultDocument = processor.transformToDocument(xmlParse.document);
+ const output = serializeResultDocument(resultDocument);
+
+ return {
+ output,
+ diagnostics,
+ engine: request.engine,
+ transformedAt: new Date().toISOString(),
+ };
+ },
+};
+
+export async function createTransformationRun(
+ request: TransformRequest,
+ output: string
+): Promise {
+ const [xmlInputHash, xsltHash, outputHash] = await Promise.all([
+ createSha256Hash(request.xmlText),
+ createSha256Hash(request.xsltText),
+ createSha256Hash(output),
+ ]);
+
+ return {
+ engine: request.engine,
+ transformedAt: new Date().toISOString(),
+ xmlInputHash,
+ xsltHash,
+ outputHash,
+ outputLength: output.length,
+ };
+}
diff --git a/src/transform/saxonJsDynamicCompiler.ts b/src/transform/saxonJsDynamicCompiler.ts
new file mode 100644
index 0000000..2ee8ecc
--- /dev/null
+++ b/src/transform/saxonJsDynamicCompiler.ts
@@ -0,0 +1,309 @@
+type SefNode = Record & {
+ N?: string;
+ C?: SefNode[];
+ firstChild?: unknown;
+ parentNode?: SefNode;
+};
+
+type SaxonXdmMap = {
+ inSituPut: (key: unknown, value: unknown[]) => void;
+};
+
+const SAXON_SCRIPT_URL = '/vendor/saxon/SaxonJS2.js';
+
+let saxonLoadPromise: Promise | null = null;
+
+type SaxonPrivateRuntime = {
+ getPlatform?: () => {
+ resource?: (name: string) => unknown;
+ parseXmlFromString?: (text: string) => unknown;
+ };
+ checkOptions?: (options: Record) => Record;
+ internalTransform?: (
+ stylesheetInternal: unknown,
+ source: unknown,
+ checkedOptions: Record
+ ) => void;
+ getResource?: (options: {
+ file?: string;
+ location?: string;
+ text?: string;
+ type?: 'xml' | 'json' | string;
+ }) => Promise;
+ XPath?: {
+ sefToJSON?: (node: unknown, keepDebug: boolean) => unknown;
+ };
+ XS?: {
+ QName?: {
+ fromParts: (prefix: string, uri: string, local: string) => unknown;
+ };
+ };
+ XdmMap?: new () => SaxonXdmMap;
+ transform?: (
+ options: Record,
+ execution?: 'sync' | 'async'
+ ) => Promise<{ principalResult?: unknown }>;
+};
+
+async function getSaxon(): Promise {
+ await ensureSaxonLoaded();
+
+ const saxon = window.SaxonJS as SaxonPrivateRuntime | undefined;
+ if (!saxon) {
+ throw new Error('window.SaxonJS is not loaded.');
+ }
+
+ return saxon;
+}
+
+async function ensureSaxonLoaded(): Promise {
+ if (window.SaxonJS) return;
+
+ saxonLoadPromise ??= new Promise