xslt-processor 1.2.6 → 1.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -231,6 +231,7 @@ function xmlElementLogicTrivial(node, buffer, options) {
231
231
  }
232
232
  }
233
233
  var childNodes = node.transformedChildNodes.length > 0 ? node.transformedChildNodes : node.childNodes;
234
+ childNodes = childNodes.sort(function (a, b) { return a.siblingPosition - b.siblingPosition; });
234
235
  if (childNodes.length === 0) {
235
236
  if (options.selfClosingTags) {
236
237
  buffer.push('/>');
@@ -257,6 +258,7 @@ function xmlElementLogicTrivial(node, buffer, options) {
257
258
  */
258
259
  function xmlElementLogicMuted(node, buffer, options) {
259
260
  var childNodes = node.transformedChildNodes.length > 0 ? node.transformedChildNodes : node.childNodes;
261
+ childNodes = childNodes.sort(function (a, b) { return a.siblingPosition - b.siblingPosition; });
260
262
  for (var i = 0; i < childNodes.length; ++i) {
261
263
  xmlTransformedTextRecursive(childNodes[i], buffer, options);
262
264
  }
@@ -1 +1 @@
1
- {"version":3,"file":"xml-functions.js","sourceRoot":"","sources":["../../src/dom/xml-functions.ts"],"names":[],"mappings":";;;;;;AAAA,0CAAoB;AAEpB,0CAQsB;AACtB,yCAAmD;AAKnD,oEAAoE;AACpE,sEAAsE;AACtE,2EAA2E;AAC3E,8EAA8E;AAC9E,SAAgB,QAAQ,CAAC,IAAS,EAAE,mCAAoD;IAApD,oDAAA,EAAA,2CAAoD;IACpF,IAAI,CAAC,IAAI,EAAE;QACP,OAAO,EAAE,CAAC;KACb;IAED,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,IAAI,IAAI,CAAC,QAAQ,IAAI,yBAAa,IAAI,IAAI,CAAC,QAAQ,IAAI,kCAAsB,EAAE;QAC3E,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC;KACzB;SAAM,IAAI,IAAI,CAAC,QAAQ,IAAI,8BAAkB,EAAE;QAC5C,GAAG,IAAI,IAAI,CAAC,SAAS,CAA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AAC,CAAC;AACpD,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,eAAe,CAAC,IAAW,EAAE,IAAY;IACrD,kEAAkE;IAClE,oEAAoE;IACpE,eAAe;IACf,IAAM,KAAK,GAAG,IAAA,gCAAoB,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC/C,IAAI,KAAK,EAAE;QACP,OAAO,YAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;KAC3B;IAED,OAAO,KAAK,CAAC;AACjB,CAAC;AAVD,0CAUC;AAED;;;;;;;GAOG;AACH,SAAgB,gBAAgB,CAAC,IAAW;IACxC,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,EAAE;QACrC,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;KACxD;IAED,IAAI,IAAI,CAAC,QAAQ,KAAK,6BAAiB,EAAE;QACrC,OAAO,IAAiB,CAAC;KAC5B;IAED,OAAO,gBAAgB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AAChD,CAAC;AAVD,4CAUC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xslt-processor",
3
- "version": "1.2.6",
3
+ "version": "1.2.7",
4
4
  "description": "A JavaScript XSLT Processor",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -12,5 +12,5 @@
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */var g=function(e,r){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)r.hasOwnProperty(t)&&(e[t]=r[t])},g(e,r)};function f(e,r){function t(){this.constructor=e}g(e,r),e.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t)}var m=function(){function e(e,r,t,a,o){this.id=Math.random()*(Number.MAX_SAFE_INTEGER-1)+1,this.attributes=[],this.childNodes=[],this.transformedAttributes=[],this.transformedChildNodes=[],this.visited=!1,this.escape=!0,this.siblingPosition=-1,this.init(e,r,t,a,o)}return e.prototype.init=function(e,r,t,a,o){var n;this.nodeType=e-0,this.nodeName="".concat(r),this.nodeValue="".concat(t),this.ownerDocument=a,this.namespaceUri=o||null,n=this.qualifiedNameToParts("".concat(r)),this.prefix=n[0],this.localName=n[1],this.firstChild=null,this.lastChild=null,this.nextSibling=null,this.previousSibling=null,this.parentNode=null},e.prototype.qualifiedNameToParts=function(e){return e.includes(":")?e.split(":"):[null,e]},e.prototype.domTraverseElements=function(e,t,a){var o;if(t&&"boolean"==typeof(o=t.call(null,e))&&!o)return!1;for(var n=e.firstChild;n;n=n.nextSibling)if(n.nodeType==r&&"boolean"==typeof(o=this.domTraverseElements.call(this,n,t,a))&&!o)return!1;return!(a&&"boolean"==typeof(o=a.call(null,e))&&!o)&&void 0},e.recycle=function(e){if(e)if("XDocument"!==e.constructor.name){if(e.constructor==this){this._unusedXNodes.push(e);for(var r=0;r<e.attributes.length;++r)this.recycle(e.attributes[r]);for(var t=0;t<e.childNodes.length;++t)this.recycle(e.childNodes[t]);e.attributes.length=0,e.childNodes.length=0,e.init.call(0,"","",null)}}else this.recycle(e.documentElement)},e.create=function(r,t,a,o,n){if(this._unusedXNodes.length>0){var i=this._unusedXNodes.pop();return i.init(r,t,a,o,n),i}return new e(r,t,a,o,n)},e.clone=function(r,t){var a=new e(r.nodeType,r.nodeName,r.nodeValue,t,r.namespaceUri);a.id=r.id;for(var o=0,n=r.childNodes;o<n.length;o++){var i=n[o];a.appendChild(e.clone(i,a))}for(var s=0,l=r.attributes;s<l.length;s++){var u=l[s];a.setAttribute(u.nodeName,u.nodeValue)}return a},e.prototype.appendChild=function(e){0==this.childNodes.length&&(this.firstChild=e),e.previousSibling=this.lastChild,e.nextSibling=null,this.lastChild&&(this.lastChild.nextSibling=e),e.parentNode=this,this.lastChild=e,this.childNodes.push(e)},e.prototype.appendTransformedChild=function(e){0==this.transformedChildNodes.length&&(this.transformedFirstChild=e),e.transformedPreviousSibling=this.lastChild,e.transformedNextSibling=null,this.transformedLastChild&&(this.transformedLastChild.transformedNextSibling=e),e.transformedParentNode=this,this.transformedLastChild=e,this.transformedChildNodes.push(e)},e.prototype.replaceChild=function(e,r){if(r!=e)for(var t=0;t<this.childNodes.length;++t)if(this.childNodes[t]==r){this.childNodes[t]=e;var a=r.parentNode;r.parentNode=null,e.parentNode=a,a=r.previousSibling,r.previousSibling=null,e.previousSibling=a,e.previousSibling&&(e.previousSibling.nextSibling=e),a=r.nextSibling,r.nextSibling=null,e.nextSibling=a,e.nextSibling&&(e.nextSibling.previousSibling=e),this.firstChild==r&&(this.firstChild=e),this.lastChild==r&&(this.lastChild=e);break}},e.prototype.insertBefore=function(e,r){if(r!=e&&r.parentNode==this){e.parentNode&&e.parentNode.removeChild(e);for(var t=[],a=0,o=this.childNodes;a<o.length;a++){var n=o[a];n==r&&(t.push(e),e.parentNode=this,e.previousSibling=r.previousSibling,r.previousSibling=e,e.previousSibling&&(e.previousSibling.nextSibling=e),e.nextSibling=r,this.firstChild==r&&(this.firstChild=e)),t.push(n)}this.childNodes=t}},e.prototype.removeChild=function(e){for(var r=[],t=0,a=this.childNodes;t<a.length;t++){var o=a[t];o!=e?r.push(o):(o.previousSibling&&(o.previousSibling.nextSibling=o.nextSibling),o.nextSibling&&(o.nextSibling.previousSibling=o.previousSibling),this.firstChild==o&&(this.firstChild=o.nextSibling),this.lastChild==o&&(this.lastChild=o.previousSibling))}this.childNodes=r},e.prototype.hasAttributes=function(){return this.attributes.length>0},e.prototype.setAttribute=function(r,a){for(var o=0;o<this.attributes.length;++o)if(this.attributes[o].nodeName==r)return void(this.attributes[o].nodeValue="".concat(a));var n=e.create(t,r,a,this);n.parentNode=this,this.attributes.push(n)},e.prototype.setTransformedAttribute=function(r,a){for(var o=0;o<this.transformedAttributes.length;++o)if(this.transformedAttributes[o].nodeName===r)return this.transformedAttributes[o].transformedNodeName=r,void(this.transformedAttributes[o].transformedNodeValue="".concat(a));var n=e.create(t,r,a,this);n.transformedNodeName=r,n.transformedNodeValue=a,n.parentNode=this,this.transformedAttributes.push(n)},e.prototype.setAttributeNS=function(r,a,o){for(var n=0;n<this.attributes.length;++n)if(this.attributes[n].namespaceUri==r&&this.attributes[n].localName==this.qualifiedNameToParts("".concat(a))[1])return this.attributes[n].nodeValue="".concat(o),this.attributes[n].nodeName="".concat(a),void(this.attributes[n].prefix=this.qualifiedNameToParts("".concat(a))[0]);this.attributes.push(e.create(t,a,o,this,r))},e.prototype.getAttributeValue=function(e){for(var r=0;r<this.attributes.length;++r)if(this.attributes[r].nodeName==e)return this.attributes[r].nodeValue;return null},e.prototype.getAttributeNS=function(e,r){for(var t=0;t<this.attributes.length;++t)if(this.attributes[t].namespaceUri==e&&this.attributes[t].localName==r)return this.attributes[t].nodeValue;return null},e.prototype.hasAttribute=function(e){for(var r=0;r<this.attributes.length;++r)if(this.attributes[r].nodeName==e)return!0;return!1},e.prototype.hasAttributeNS=function(e,r){for(var t=0;t<this.attributes.length;++t)if(this.attributes[t].namespaceUri==e&&this.attributes[t].localName==r)return!0;return!1},e.prototype.removeAttribute=function(e){for(var r=[],t=0;t<this.attributes.length;++t)this.attributes[t].nodeName!=e&&r.push(this.attributes[t]);this.attributes=r},e.prototype.removeAttributeNS=function(e,r){for(var t=[],a=0;a<this.attributes.length;++a)this.attributes[a].localName==r&&this.attributes[a].namespaceUri==e||t.push(this.attributes[a]);this.attributes=t},e.prototype.getElementsByTagName=function(e){var r=[],t=this;return"*"==e?this.domTraverseElements(this,(function(e){t!=e&&r.push(e)}),null):this.domTraverseElements(this,(function(a){t!=a&&a.nodeName==e&&r.push(a)}),null),r},e.prototype.getElementsByTagNameNS=function(e,r){var t=[],a=this;return"*"==e&&"*"==r?this.domTraverseElements(this,(function(e){a!=e&&t.push(e)}),null):"*"==e?this.domTraverseElements(this,(function(e){a!=e&&e.localName==r&&t.push(e)}),null):"*"==r?this.domTraverseElements(this,(function(r){a!=r&&r.namespaceUri==e&&t.push(r)}),null):this.domTraverseElements(this,(function(o){a!=o&&o.localName==r&&o.namespaceUri==e&&t.push(o)}),null),t},e.prototype.getElementById=function(e){var r=null;return this.domTraverseElements(this,(function(t){if(t.getAttributeValue("id")==e)return r=t,!1}),null),r},e.prototype.getAncestorByLocalName=function(e){if(null!==this.parentNode&&void 0!==this.parentNode)return this.parentNode.localName===e?this.parentNode:this.parentNode.getAncestorByLocalName(e)},e.prototype.getAncestorById=function(e){if(null!==this.parentNode&&void 0!==this.parentNode)return this.parentNode.id===e?this.parentNode:this.parentNode.getAncestorById(e)},e._unusedXNodes=[],e}(),b=function(e){function l(){var r=e.call(this,i,"#document",null,null)||this;return r.documentElement=null,r}return f(l,e),l.prototype.clear=function(){m.recycle(this.documentElement),this.documentElement=null},l.prototype.appendChild=function(r){e.prototype.appendChild.call(this,r),this.documentElement=this.childNodes[0]},l.prototype.createElement=function(e){return m.create(r,e,null,this)},l.prototype.createElementNS=function(e,t){return m.create(r,t,null,this,e)},l.prototype.createDocumentFragment=function(){return m.create(s,"#document-fragment",null,this)},l.prototype.createTextNode=function(e){return m.create(a,"#text",e,this)},l.prototype.createTransformedTextNode=function(e){var r=m.create(a,"#text",e,this);return r.transformedNodeValue=e,r},l.prototype.createAttribute=function(e){return m.create(t,e,null,this)},l.prototype.createAttributeNS=function(e,r){return m.create(t,r,null,this,e)},l.prototype.createComment=function(e){return m.create(n,"#comment",e,this)},l.prototype.createCDATASection=function(e){return m.create(o,"#cdata-section",e,this)},l.prototype.createDTDSection=function(e){return m.create(10,"#dtd-section",e,this)},l}(m),v="[ \t\r\n]+",y="(".concat(v,")?=(").concat(v,")?"),x="&#[0-9]+;|&#x[0-9a-fA-F]+;",w="".concat(v,"version").concat(y,"(\"1\\.0\"|'1\\.0')"),E="̀-͠ͅ-҃͡-֑҆-֣֡-ֹֻ-ֽֿׁ-ׂًׄ-ْٰۖ-ۜ۝-۟۠-ۤۧ-۪ۨ-ۭँ-ः़ा-ौ्॑-॔ॢ-ॣঁ-ঃ়ািী-ৄে-ৈো-্ৗৢ-ৣਂ਼ਾਿੀ-ੂੇ-ੈੋ-੍ੰ-ੱઁ-ઃ઼ા-ૅે-ૉો-્ଁ-ଃ଼ା-ୃେ-ୈୋ-୍ୖ-ୗஂ-ஃா-ூெ-ைொ-்ௗఁ-ఃా-ౄె-ైొ-్ౕ-ౖಂ-ಃಾ-ೄೆ-ೈೊ-್ೕ-ೖം-ഃാ-ൃെ-ൈൊ-്ൗัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-༹༙༵༷༾༿ཱ-྄྆-ྋྐ-ྕྗྙ-ྭྱ-ྷྐྵ⃐-〪⃜⃡-゙゚〯",N="0-9٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩",D="·ːˑ·ـๆໆ々〱-〵ゝ-ゞー-ヾ",q="A-Za-zÀ-ÖØ-öø-ÿĀ-ıĴ-ľŁ-ňŊ-žƀ-ǃǍ-ǰǴ-ǵǺ-ȗɐ-ʨʻ-ˁΆΈ-ΊΌΎ-ΡΣ-ώϐ-ϖϚϜϞϠϢ-ϳЁ-ЌЎ-яё-ќў-ҁҐ-ӄӇ-ӈӋ-ӌӐ-ӫӮ-ӵӸ-ӹԱ-Ֆՙա-ֆא-תװ-ײء-غف-يٱ-ڷں-ھۀ-ێې-ۓەۥ-ۦअ-हऽक़-ॡঅ-ঌএ-ঐও-নপ-রলশ-হড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઋઍએ-ઑઓ-નપ-રલ-ળવ-હઽૠଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଶ-ହଽଡ଼-ଢ଼ୟ-ୡஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-வஷ-ஹఅ-ఌఎ-ఐఒ-నప-ళవ-హౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹൠ-ൡก-ฮะา-ำเ-ๅກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ຮະາ-ຳຽເ-ໄཀ-ཇཉ-ཀྵႠ-Ⴥა-ჶᄀᄂ-ᄃᄅ-ᄇᄉᄋ-ᄌᄎ-ᄒᄼᄾᅀᅌᅎᅐᅔ-ᅕᅙᅟ-ᅡᅣᅥᅧᅩᅭ-ᅮᅲ-ᅳᅵᆞᆨᆫᆮ-ᆯᆷ-ᆸᆺᆼ-ᇂᇫᇰᇹḀ-ẛẠ-ỹἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼΩK-Å℮ↀ-ↂぁ-ゔァ-ヺㄅ-ㄬ가-힣一-龥〇〡-〩",k="".concat(q+N,"\\._:").concat(E).concat(D,"-"),A="[".concat(q,"_:][").concat(k,"]*"),S="&".concat(A,";"),L="".concat(S,"|").concat(x),T='"(([^<&"]|'.concat(L,")*)\"|'(([^<&']|").concat(L,")*)'"),C="(".concat(A,")").concat(y,"(").concat(T,")"),V="".concat(v,"version").concat(y,"(\"1\\.1\"|'1\\.1')"),R=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�",P=R+"\\.0-9·̀-ͯ‿-⁀-",F="[".concat(R,"][").concat(P,"]*"),B="&".concat(F,";"),U="".concat(B,"|").concat(x),O='"(([^<&"]|'.concat(U,")*)\"|'(([^<&']|").concat(U,")*)'"),I="(".concat(F,")").concat(y,"(").concat(O,")"),G="".concat(q+N,"\\._").concat(E).concat(D,"-"),H="[".concat(q,"_][").concat(G,"]*"),M=new RegExp("^(".concat(A,")")),z=new RegExp(C,"g"),j=new RegExp("^(".concat(F,")")),_=new RegExp(I,"g");function X(e,r){return e.getAttributeValue(r)}function J(e,r,t){return e.setAttribute(r,t)}function Y(e,r,t){return e.setTransformedAttribute(r,t)}function Z(e,r){return e.appendChild(r)}function W(e,r){return e.appendTransformedChild(r)}function K(e,r){return e.createTextNode(r)}function Q(e,r){return e.createTransformedTextNode(r)}function $(e,r){return e.createElement(r)}function ee(e,r){return e.createCDATASection(r)}function re(e,r){return e.createComment(r)}function te(e){return e.createDocumentFragment()}function ae(e,n){if(void 0===n&&(n=!1),!e)return"";var l="";if(e.nodeType==a||e.nodeType==o)l+=e.nodeValue;else if(e.nodeType==t)l+=e.nodeValue;else if(e.nodeType==r||e.nodeType==i||e.nodeType==s){if(!n){var u=e.innerText;if(null!=u)return u;var c=e.textContent;if(null!=c)return c}if(e.transformedChildNodes.length>0)for(var p=0;p<e.transformedChildNodes.length;++p)l+=ae(e.transformedChildNodes[p]);else for(p=0;p<e.childNodes.length;++p)l+=ae(e.childNodes[p])}return l}function oe(e,t,l){if(!e.visited){var u=e.transformedNodeType||e.nodeType,c=e.transformedNodeValue||e.nodeValue;if(u==a){if(e.transformedNodeValue&&""!==e.transformedNodeValue.trim()){var p=e.escape&&l.escape?ie(e.transformedNodeValue):e.transformedNodeValue;t.push(p)}}else if(u==o)l.cData?t.push(c):t.push("<![CDATA[".concat(c,"]]>"));else if(u==n)t.push("\x3c!-- ".concat(c," --\x3e"));else if(u==r)null!==e.transformedNodeName&&void 0!==e.transformedNodeName?function(e,r,t){r.push("<".concat(ne(e)));for(var a=e.transformedAttributes||e.attributes,o=0;o<a.length;++o){var n=a[o];n&&(n.transformedNodeName&&n.transformedNodeValue&&r.push(" ".concat(ne(n),'="').concat(se(n.transformedNodeValue),'"')))}var i=e.transformedChildNodes.length>0?e.transformedChildNodes:e.childNodes;if(0===i.length)t.selfClosingTags?r.push("/>"):r.push("></".concat(ne(e),">"));else{r.push(">");for(o=0;o<i.length;++o)oe(i[o],r,t);r.push("</".concat(ne(e),">"))}}(e,t,l):function(e,r,t){for(var a=e.transformedChildNodes.length>0?e.transformedChildNodes:e.childNodes,o=0;o<a.length;++o)oe(a[o],r,t)}(e,t,l);else if(u==i||u==s){var h=e.transformedChildNodes.concat(e.childNodes);h.sort((function(e,r){return e.siblingPosition-r.siblingPosition}));for(var d=0;d<h.length;++d)oe(h[d],t,l)}e.visited=!0}}function ne(e){var r=e.transformedNodeName||e.nodeName;return e.transformedPrefix&&0!=r.indexOf("".concat(e.transformedPrefix,":"))?"".concat(e.transformedPrefix,":").concat(r):r}function ie(e){return"".concat(e).replace(/&/g,"&amp;").replace(/&amp;amp;/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function se(e){return ie(e).replace(/"/g,"&quot;")}function le(e,r){var t=X(e,r);return t?c.decode(t):t}var ue=function(){function e(e){this.value=e,this.type="node-set"}return e.prototype.stringValue=function(){return 0===this.value.length?"":ae(this.value[0])},e.prototype.booleanValue=function(){return this.value.length>0},e.prototype.numberValue=function(){return this.stringValue()-0},e.prototype.nodeSetValue=function(){return this.value},e}(),ce=function(){function e(e){this.value=e,this.type="number"}return e.prototype.stringValue=function(){return"".concat(this.value)},e.prototype.booleanValue=function(){return!!this.value},e.prototype.numberValue=function(){return this.value-0},e.prototype.nodeSetValue=function(){throw this},e}(),pe=function(){function e(e){this.value=e,this.type="string"}return e.prototype.stringValue=function(){return this.value},e.prototype.booleanValue=function(){return this.value.length>0},e.prototype.numberValue=function(){return this.value-0},e.prototype.nodeSetValue=function(){throw this},e}(),he={ANCESTOR_OR_SELF:"ancestor-or-self",ANCESTOR:"ancestor",ATTRIBUTE:"attribute",CHILD:"child",DESCENDANT_OR_SELF:"descendant-or-self",DESCENDANT:"descendant",FOLLOWING_SIBLING:"following-sibling",FOLLOWING:"following",NAMESPACE:"namespace",PARENT:"parent",PRECEDING_SIBLING:"preceding-sibling",PRECEDING:"preceding",SELF:"self",SELF_AND_SIBLINGS:"self-and-siblings"},de=[he.ANCESTOR_OR_SELF,he.ANCESTOR,he.ATTRIBUTE,he.CHILD,he.DESCENDANT_OR_SELF,he.DESCENDANT,he.FOLLOWING_SIBLING,he.FOLLOWING,he.NAMESPACE,he.PARENT,he.PRECEDING_SIBLING,he.PRECEDING,he.SELF].join("(?=::)|")+"(?=::)",ge={label:"|",prec:17,re:new RegExp("^\\|"),key:void 0},fe={label:"//",prec:19,re:new RegExp("^//"),key:void 0},me={label:"/",prec:30,re:new RegExp("^/"),key:void 0},be={label:"::",prec:20,re:new RegExp("^::"),key:void 0},ve={label:":",prec:1e3,re:new RegExp("^:"),key:void 0},ye={label:"[axis]",re:new RegExp("^(".concat(de,")")),key:void 0},xe={label:"(",prec:34,re:new RegExp("^\\("),key:void 0},we={label:")",re:new RegExp("^\\)"),key:void 0},Ee={label:"..",prec:34,re:new RegExp("^\\.\\."),key:void 0},Ne={label:".",prec:34,re:new RegExp("^\\."),key:void 0},De={label:"@",prec:34,re:new RegExp("^@"),key:void 0},qe={label:",",re:new RegExp("^,"),key:void 0},ke={label:"or",prec:10,re:new RegExp("^or\\b"),key:void 0},Ae={label:"and",prec:11,re:new RegExp("^and\\b"),key:void 0},Se={label:"=",prec:12,re:new RegExp("^="),key:void 0},Le={label:"!=",prec:12,re:new RegExp("^!="),key:void 0},Te={label:">=",prec:13,re:new RegExp("^>="),key:void 0},Ce={label:">",prec:13,re:new RegExp("^>"),key:void 0},Ve={label:"<=",prec:13,re:new RegExp("^<="),key:void 0},Re={label:"<",prec:13,re:new RegExp("^<"),key:void 0},Pe={label:"+",prec:14,re:new RegExp("^\\+"),left:!0,key:void 0},Fe={label:"-",prec:14,re:new RegExp("^\\-"),left:!0,key:void 0},Be={label:"div",prec:15,re:new RegExp("^div\\b"),left:!0,key:void 0},Ue={label:"mod",prec:15,re:new RegExp("^mod\\b"),left:!0,key:void 0},Oe={label:"[",prec:32,re:new RegExp("^\\["),key:void 0},Ie={label:"]",re:new RegExp("^\\]"),key:void 0},Ge={label:"$",re:new RegExp("^\\$"),key:void 0},He={label:"[ncname]",re:new RegExp("^".concat(H)),key:void 0},Me={label:"*",prec:15,re:new RegExp("^\\*"),left:!0,key:void 0},ze={label:"[litq]",prec:20,re:new RegExp("^'[^\\']*'"),key:void 0},je={label:"[litqq]",prec:20,re:new RegExp('^"[^\\"]*"'),key:void 0},_e={label:"[number]",prec:35,re:new RegExp("^\\d+(\\.\\d*)?"),key:void 0},Xe={label:"[qname]",re:new RegExp("^(".concat(H,":)?").concat(H)),key:void 0},Je={label:"[nodeTest-start]",re:new RegExp("^(processing-instruction|comment|text|node)\\("),key:void 0},Ye=[fe,me,Ee,Ne,be,ve,ye,Je,xe,we,Oe,Ie,De,qe,ke,Ae,Le,Se,Te,Ce,Ve,Re,Pe,Fe,Me,ge,Ue,Be,ze,je,_e,Xe,He,Ge],Ze={label:"?"},We={label:"*"},Ke={label:"+"},Qe=!0,$e=function(){function e(e,r,t,a,o,n,s,l,u,c,p,h,d){this.nodeList=e,this.outputNodeList=r,this.position=t||0,this.outputPosition=a||0,this.variables=s||{},this.knownNamespaces=l||{},this.parent=u||null,this.caseInsensitive=c||!1,this.ignoreAttributesWithoutValue=p||!1,this.returnOnFirstMatch=h||!1,this.ignoreNonElementNodesForNTA=d||!1,this.inApplyTemplates=!1,this.baseTemplateMatched=!1,this.outputDepth=o||0,this.decimalFormatSettings=n||{decimalSeparator:".",groupingSeparator:",",infinity:"Infinity",minusSign:"-",naN:"NaN",percent:"%",perMille:"‰",zeroDigit:"0",digit:"#",patternSeparator:";"},u?this.root=u.root:this.nodeList[this.position].nodeType==i?this.root=this.nodeList[this.position]:this.root=this.nodeList[this.position].ownerDocument}return e.prototype.clone=function(r,t,a,o){return new e(r||this.nodeList,t||this.outputNodeList,void 0!==a?a:this.position,void 0!==o?o:this.outputPosition,this.outputDepth,this.decimalFormatSettings,this.variables,this.knownNamespaces,this,this.caseInsensitive,this.ignoreAttributesWithoutValue,this.returnOnFirstMatch,this.ignoreNonElementNodesForNTA)},e.prototype.cloneByOutput=function(r,t,a){return new e(this.nodeList,r||this.outputNodeList,this.position,void 0!==t?t:this.outputPosition,void 0!==a?a:this.outputDepth,this.decimalFormatSettings,this.variables,this.knownNamespaces,this,this.caseInsensitive,this.ignoreAttributesWithoutValue,this.returnOnFirstMatch,this.ignoreNonElementNodesForNTA)},e.prototype.setVariable=function(e,r){r instanceof pe||r instanceof l||r instanceof ce||r instanceof ue?this.variables[e]=r:"true"===r?this.variables[e]=new l(!0):"false"===r?this.variables[e]=new l(!1):_e.re.test(r)?this.variables[e]=new ce(r):this.variables[e]=new pe(r)},e.prototype.getVariable=function(e){return void 0!==this.variables[e]?this.variables[e]:this.parent?this.parent.getVariable(e):null},e.prototype.setNode=function(e){this.position=e},e.prototype.contextSize=function(){return this.nodeList.length},e.prototype.isCaseInsensitive=function(){return this.caseInsensitive},e.prototype.setCaseInsensitive=function(e){return this.caseInsensitive=e},e.prototype.isIgnoreAttributesWithoutValue=function(){return this.ignoreAttributesWithoutValue},e.prototype.setIgnoreAttributesWithoutValue=function(e){return this.ignoreAttributesWithoutValue=e},e.prototype.isReturnOnFirstMatch=function(){return this.returnOnFirstMatch},e.prototype.setReturnOnFirstMatch=function(e){return this.returnOnFirstMatch=e},e.prototype.isIgnoreNonElementNodesForNTA=function(){return this.ignoreNonElementNodesForNTA},e.prototype.setIgnoreNonElementNodesForNTA=function(e){return this.ignoreNonElementNodesForNTA=e},e}();function er(e,r){if(r)for(var t=e.length,a=r.length-1;a>=0;--a)e[a+t]=r[a]}var rr=function(){},tr=function(e){function r(r,t,a){var o=e.call(this)||this;return o.expr1=r,o.expr2=a,o.op=t,o}return f(r,e),r.prototype.evaluate=function(e){var r;switch(this.op.value){case"or":r=new l(this.expr1.evaluate(e).booleanValue()||this.expr2.evaluate(e).booleanValue());break;case"and":r=new l(this.expr1.evaluate(e).booleanValue()&&this.expr2.evaluate(e).booleanValue());break;case"+":r=new ce(this.expr1.evaluate(e).numberValue()+this.expr2.evaluate(e).numberValue());break;case"-":r=new ce(this.expr1.evaluate(e).numberValue()-this.expr2.evaluate(e).numberValue());break;case"*":r=new ce(this.expr1.evaluate(e).numberValue()*this.expr2.evaluate(e).numberValue());break;case"mod":r=new ce(this.expr1.evaluate(e).numberValue()%this.expr2.evaluate(e).numberValue());break;case"div":r=new ce(this.expr1.evaluate(e).numberValue()/this.expr2.evaluate(e).numberValue());break;case"=":r=this.compare(e,(function(e,r){return e==r}));break;case"!=":r=this.compare(e,(function(e,r){return e!=r}));break;case"<":r=this.compare(e,(function(e,r){return e<r}));break;case"<=":r=this.compare(e,(function(e,r){return e<=r}));break;case">":r=this.compare(e,(function(e,r){return e>r}));break;case">=":r=this.compare(e,(function(e,r){return e>=r}));break;default:throw"BinaryExpr.evaluate: ".concat(this.op.value)}return r},r.prototype.compare=function(e,r){var t,a=this.expr1.evaluate(e),o=this.expr2.evaluate(e);if("node-set"==a.type&&"node-set"==o.type){var n=a.nodeSetValue(),i=o.nodeSetValue();t=!1;for(var s=0;s<n.length;++s)for(var u=0;u<i.length;++u)r(ae(n[s]),ae(i[u]))&&(t=!0,u=i.length,s=n.length)}else if("node-set"==a.type||"node-set"==o.type)if("number"==a.type){var c=a.numberValue(),p=o.nodeSetValue();t=!1;for(var h=0;h<p.length;++h){if(r(c,ae(p[h])-0)){t=!0;break}}}else if("number"==o.type){p=a.nodeSetValue(),c=o.numberValue();t=!1;for(h=0;h<p.length;++h){if(r(ae(p[h])-0,c)){t=!0;break}}}else if("string"==a.type){c=a.stringValue(),p=o.nodeSetValue();t=!1;for(h=0;h<p.length;++h){if(r(c,ae(p[h]))){t=!0;break}}}else if("string"==o.type){p=a.nodeSetValue(),c=o.stringValue();t=!1;for(h=0;h<p.length;++h){if(r(ae(p[h]),c)){t=!0;break}}}else t=r(a.booleanValue(),o.booleanValue());else t="boolean"==a.type||"boolean"==o.type?r(a.booleanValue(),o.booleanValue()):"number"==a.type||"number"==o.type?r(a.numberValue(),o.numberValue()):r(a.stringValue(),o.stringValue());return new l(t)},r}(rr),ar=function(e){function r(r,t){var a=e.call(this)||this;return a.expr=r,a.predicate=t,a}return f(r,e),r.prototype.evaluate=function(e){var r=e.returnOnFirstMatch;e.setReturnOnFirstMatch(!1);var t=this.expr.evaluate(e).nodeSetValue();e.setReturnOnFirstMatch(r);for(var a=0;a<this.predicate.length;++a){var o=t;t=[];for(var n=0;n<o.length;++n){var i=o[n];this.predicate[a].evaluate(e.clone(o,void 0,n)).booleanValue()&&t.push(i)}}return new ue(t)},r}(rr);function or(e){if(!e)throw new Error("Assertion failed")}var nr=new RegExp("(\\".concat(["/",".","*","+","?","|","^","$","(",")","[","]","{","}","\\"].join("|\\"),")"),"g");function ir(e){or(this.args.length>=1);for(var r=this.args[0].evaluate(e).numberValue(),t=[],a=0;a<r;++a)t.push(e.nodeList[e.position]);return new ue(t)}function sr(e){return or(3===this.args.length),this.args[0].evaluate(e).booleanValue()?this.args[1].evaluate(e):this.args[2].evaluate(e)}function lr(e){or(2===this.args.length);for(var r=this.args[0].evaluate(e).nodeSetValue(),t=this.args[1].evaluate(e).stringValue(),a="",o=0;o<r.length;++o)a&&(a+=t),a+=ae(r[o]);return new pe(a)}function ur(e){return or(1===this.args.length),new l(this.args[0].evaluate(e).booleanValue())}function cr(e){or(1===this.args.length);var r=this.args[0].evaluate(e).numberValue();return new ce(Math.ceil(r))}function pr(e){for(var r="",t=0;t<this.args.length;++t)r+=this.args[t].evaluate(e).stringValue();return new pe(r)}function hr(e){or(2===this.args.length);var r=this.args[0].evaluate(e).stringValue(),t=this.args[1].evaluate(e).stringValue();return new l(r.includes(t))}function dr(e){or(1===this.args.length);var r=this.args[0].evaluate(e);return new ce(r.nodeSetValue().length)}function gr(e){return or(0===this.args.length),new ue([e.nodeList[e.position]])}function fr(e){or(2===this.args.length);var r=this.args[0].evaluate(e).stringValue(),t=this.args[1].evaluate(e).stringValue(),a=new RegExp("".concat(t.replace(nr,"\\$1"),"$"));return new l(a.test(r))}function mr(){return or(0===this.args.length),new l(!1)}function br(e,r,t){for(var a="",o=e.length-1,n=r.length-1;n>=0;n--)switch(r[n]){case"#":case"0":a=e[o]+a,o--;break;case",":a=t.groupingSeparator+a}for(;o>=0;o--)a=e[o]+a;return a}function vr(e){or(this.args.length>=2&&this.args.length<4);var r=this.args[0].evaluate(e).stringValue(),t=this.args[1].evaluate(e).stringValue(),a=parseFloat(r);if(isNaN(a))return new pe(e.decimalFormatSettings.naN);var o=String(a).split("."),n=t.split(".");switch(o.length){case 1:return new pe(br(o[0],n[0],e.decimalFormatSettings));case 2:var i=function(e,r,t){var a="";if(null==r)return a;for(var o=0;o<r.length;o++)switch(r[o]){case"#":a+=e[o];break;case"0":o>=e.length?a+="0":a+=e[o]}return a}(o[1],2===n.length?n[1]:void 0,e.decimalFormatSettings);return 0===i.length?new pe(br(o[0],n[0],e.decimalFormatSettings)):new pe(br(o[0],n[0],e.decimalFormatSettings)+e.decimalFormatSettings.decimalSeparator+i)}}function yr(e){or(1===this.args.length);var r=this.args[0].evaluate(e).numberValue();return new ce(Math.floor(r))}function xr(e){return new pe("A"+function(e,r){void 0===r&&(r=0);for(var t=3735928559^r,a=1103547991^r,o=0,n=void 0;o<e.length;o++)n=e.charCodeAt(o),t=Math.imul(t^n,2654435761),a=Math.imul(a^n,1597334677);return t=Math.imul(t^t>>>16,2246822507),t^=Math.imul(a^a>>>13,3266489909),a=Math.imul(a^a>>>16,2246822507),4294967296*(2097151&(a^=Math.imul(t^t>>>13,3266489909)))+(t>>>0)}(JSON.stringify(e.nodeList[e.position].id)))}function wr(e){or(1===this.args.length);var r,t=this.args[0].evaluate(e),a=[];if("node-set"==t.type){r=[];for(var o=t.nodeSetValue(),n=0;n<o.length;++n)for(var i=ae(o[n]).split(/\s+/),s=0;s<i.length;++s)r.push(i[s])}else r=t.stringValue().split(/\s+/);var l=e.root;for(n=0;n<r.length;++n){var u=l.getElementById(r[n]);u&&a.push(u)}return new ue(a)}function Er(e){or(1===this.args.length);for(var r,t=this.args[0].evaluate(e).stringValue(),a=e.nodeList[e.position];a&&a!=a.parentNode&&!(r=a.getAttributeValue("xml:lang"));)a=a.parentNode;if(!r)return new l(!1);var o=new RegExp("^".concat(t,"$"),"i");return new l(r.match(o)||r.replace(/_.*$/,"").match(o))}function Nr(e){return or(0===this.args.length),new ce(e.contextSize())}function Dr(e){var r;return or(1===this.args.length||0===this.args.length),0===(r=0==this.args.length?[e.nodeList[e.position]]:this.args[0].evaluate(e).nodeSetValue()).length?new pe(""):new pe(r[0].localName)}function qr(e){or(this.args.length>=2);var r,t,a=this.args[0].evaluate(e).stringValue(),o=this.args[1].evaluate(e).stringValue();if(this.args.length>2&&(r=this.args[2].evaluate(e).stringValue(),/[^mi]/.test(r)))throw new Error("Invalid regular expression syntax: ".concat(r));try{t=new RegExp(o,r)}catch(e){throw new Error("Invalid matches argument: ".concat(o))}return new l(t.test(a))}function kr(e){var r;return or(1===this.args.length||0===this.args.length),0===(r=0===this.args.length?[e.nodeList[e.position]]:this.args[0].evaluate(e).nodeSetValue()).length?new pe(""):new pe(r[0].nodeName)}function Ar(e){var r;return or(1===this.args.length||0===this.args.length),0===(r=0===this.args.length?[e.nodeList[e.position]]:this.args[0].evaluate(e).nodeSetValue()).length?new pe(""):new pe(r[0].namespaceUri||"")}function Sr(e){var r;return r=(r=this.args.length>0?this.args[0].evaluate(e).stringValue():new ue([e.nodeList[e.position]]).stringValue()).replace(/^\s*/,"").replace(/\s*$/,"").replace(/\s+/g," "),new pe(r)}function Lr(e){or(1===this.args.length);var r=!this.args[0].evaluate(e).booleanValue();return new l(r)}function Tr(e){return or(1===this.args.length||0===this.args.length),1===this.args.length?new ce(this.args[0].evaluate(e).numberValue()):new ce(new ue([e.nodeList[e.position]]).numberValue())}function Cr(e){return or(0===this.args.length),new ce(e.position+1)}function Vr(e){or(1===this.args.length);var r=this.args[0].evaluate(e).numberValue();return new ce(Math.round(r))}function Rr(e){or(2==this.args.length);var r=this.args[0].evaluate(e).stringValue(),t=this.args[1].evaluate(e).stringValue();return new l(0===r.indexOf(t))}function Pr(e){return or(1===this.args.length||0===this.args.length),0===this.args.length?new pe(new ue([e.nodeList[e.position]]).stringValue()):new pe(this.args[0].evaluate(e).stringValue())}function Fr(e){var r;return r=this.args.length>0?this.args[0].evaluate(e).stringValue():new ue([e.nodeList[e.position]]).stringValue(),new ce(r.length)}function Br(e){or(2===this.args.length||3===this.args.length);var r,t=this.args[0].evaluate(e).stringValue(),a=this.args[1].evaluate(e).numberValue();if(2===this.args.length){var o=Math.max(0,Math.round(a)-1);r=t.substr(o)}else{var n=this.args[2].evaluate(e).numberValue(),i=Math.round(a)-1,s=(o=Math.max(0,i),Math.round(n)-Math.max(0,-i));r=t.substr(o,s)}return new pe(r)}function Ur(e){or(2===this.args.length);var r,t=this.args[0].evaluate(e).stringValue(),a=this.args[1].evaluate(e).stringValue(),o=t.indexOf(a);return r=-1===o?"":t.substr(o+a.length),new pe(r)}function Or(e){or(2===this.args.length);var r,t=this.args[0].evaluate(e).stringValue(),a=this.args[1].evaluate(e).stringValue(),o=t.indexOf(a);return r=-1===o?"":t.substr(0,o),new pe(r)}function Ir(e){or(1===this.args.length);for(var r=this.args[0].evaluate(e).nodeSetValue(),t=0,a=0;a<r.length;++a)t+=ae(r[a])-0;return new ce(t)}function Gr(e){or(3===this.args.length);for(var r=this.args[0].evaluate(e).stringValue(),t=this.args[1].evaluate(e).stringValue(),a=this.args[2].evaluate(e).stringValue(),o=0;o<t.length;++o)r=r.replace(new RegExp(t.charAt(o),"g"),a.charAt(o));return new pe(r)}function Hr(){return or(0===this.args.length),new l(!0)}function Mr(e){return or(this.args.length<2),new pe(JSON.stringify(this.args.length?ae(e.nodeList[e.position]):"null"))}var zr=function(e){function r(r){var t=e.call(this)||this;return t.xPathFunctions={boolean:ur,ceiling:cr,concat:pr,contains:hr,count:dr,current:gr,"ends-with":fr,false:mr,"format-number":vr,floor:yr,"generate-id":xr,id:wr,lang:Er,last:Nr,"local-name":Dr,matches:qr,name:kr,"namespace-uri":Ar,"normalize-space":Sr,not:Lr,number:Tr,position:Cr,round:Vr,"starts-with":Rr,string:Pr,"xml-to-json":Mr,substring:Br,"substring-before":Or,"substring-after":Ur,sum:Ir,"string-length":Fr,translate:Gr,true:Hr,"ext-join":lr,"ext-if":sr,"ext-cardinal":ir},t.name=r,t.args=[],t}return f(r,e),r.prototype.appendArg=function(e){this.args.push(e)},r.prototype.evaluate=function(e){var r="".concat(this.name.value),t=this.xPathFunctions[r];return t?t.call(this,e):new l(!1)},r}(rr),jr=function(e){function r(r){var t=e.call(this)||this;return t.value=r,t}return f(r,e),r.prototype.evaluate=function(){return new pe(this.value)},r}(rr),_r=function(){function e(){this.value=new l(!0)}return e.prototype.evaluate=function(){return this.value},e}(),Xr=function(e){function r(r){var t=e.call(this)||this;return t.absolute=!1,t.steps=[],t.xPath=r,t}return f(r,e),r.prototype.appendStep=function(e){var r=this._combineSteps(this.steps[this.steps.length-1],e);r?this.steps[this.steps.length-1]=r:this.steps.push(e)},r.prototype.prependStep=function(e){var r=this._combineSteps(e,this.steps[0]);r?this.steps[0]=r:this.steps.unshift(e)},r.prototype._combineSteps=function(e,r){if(!e)return null;if(!r)return null;var t=e.predicates&&e.predicates.length>0;if(e.nodeTest instanceof _r&&!t)if(e.axis==he.DESCENDANT_OR_SELF){if(r.axis==he.CHILD);else if(r.axis==he.SELF)return r.axis=he.DESCENDANT_OR_SELF,r}else if(e.axis==he.DESCENDANT&&r.axis==he.SELF)return r.axis=he.DESCENDANT,r;return null},r.prototype.evaluate=function(e){var r;r=this.absolute?e.root:e.nodeList[e.position];var t=[];return this.xPath.xPathStep(t,this.steps,0,r,e),new ue(t)},r}(rr),Jr=function(e){function r(r){var t=e.call(this)||this;return t.value=r,t}return f(r,e),r.prototype.evaluate=function(){return new ce(this.value)},r}(rr),Yr=function(e){function r(r,t){var a=e.call(this)||this;return a.filter=r,a.rel=t,a}return f(r,e),r.prototype.evaluate=function(e){var r=this.filter.evaluate(e).nodeSetValue(),t=[];if(e.returnOnFirstMatch){for(var a=0;a<r.length&&!((t=this.rel.evaluate(e.clone(r,void 0,a)).nodeSetValue()).length>0);++a);return new ue(t)}for(a=0;a<r.length;++a)for(var o=this.rel.evaluate(e.clone(r,void 0,a)).nodeSetValue(),n=0;n<o.length;++n)t.push(o[n]);return new ue(t)},r}(rr),Zr=function(e){function r(r){var t=e.call(this)||this;return t.expr=r,t}return f(r,e),r.prototype.evaluate=function(e){var r=this.expr.evaluate(e);return"number"==r.type?new l(e.position==r.numberValue()-1):new l(r.booleanValue())},r}(rr),Wr=function(e){function r(r){var t=e.call(this)||this;return t.expr=r,t}return f(r,e),r.prototype.evaluate=function(e){return new ce(-this.expr.evaluate(e).numberValue())},r}(rr),Kr=function(e){function r(r,t,a,o){var n=e.call(this)||this;n.axis=r,n.nodeTest=t,n.predicate=o||[],n.hasPositionalPredicate=!1,n.xPath=a;for(var i=0;i<n.predicate.length;++i)if(n.predicateExprHasPositionalSelector(n.predicate[i].expr)){n.hasPositionalPredicate=!0;break}return n}return f(r,e),r.prototype.predicateExprHasPositionalSelector=function(e,r){if(!e)return!1;if(!r&&this.exprReturnsNumberValue(e))return!0;if(e instanceof zr){var t=e.name.value;return"last"==t||"position"==t}return e instanceof tr&&(this.predicateExprHasPositionalSelector(e.expr1,!0)||this.predicateExprHasPositionalSelector(e.expr2,!0))},r.prototype.exprReturnsNumberValue=function(e){return e instanceof zr?{last:!0,position:!0,count:!0,"string-length":!0,number:!0,sum:!0,floor:!0,ceiling:!0,round:!0}[e.name.value]:e instanceof Wr||(e instanceof tr?{"+":!0,"-":!0,"*":!0,mod:!0,div:!0}[e.op.value]:e instanceof Jr)},r.prototype.appendPredicate=function(e){this.predicate.push(e),this.hasPositionalPredicate||(this.hasPositionalPredicate=this.predicateExprHasPositionalSelector(e.expr))},r.prototype.evaluate=function(e){var r=e.nodeList[e.position],a=[],o=!1;switch(this.nodeTest instanceof _r&&(o=!0),this.axis){case he.ANCESTOR_OR_SELF:a.push(r);for(var n=r.parentNode;n;n=n.parentNode)a.push(n);break;case he.ANCESTOR:for(n=r.parentNode;n;n=n.parentNode)a.push(n);break;case he.ATTRIBUTE:if(null!=this.nodeTest.name){if(r.attributes)if(r.attributes instanceof Array)er(a,r.attributes);else if("style"==this.nodeTest.name){var i=r.getAttributeValue("style");i&&"string"!=typeof i?a.push(m.create(t,"style",i.cssText,document)):a.push(r.attributes[this.nodeTest.name])}else a.push(r.attributes[this.nodeTest.name])}else e.ignoreAttributesWithoutValue?function(e,r){if(r)for(var t=r.length-1;t>=0;--t)r[t].nodeValue&&e.push(r[t])}(a,r.attributes):er(a,r.attributes);break;case he.CHILD:er(a,r.childNodes);break;case he.DESCENDANT_OR_SELF:this.nodeTest.evaluate(e).booleanValue()&&a.push(r);var s=this.xPath.xPathExtractTagNameFromNodeTest(this.nodeTest,e.ignoreNonElementNodesForNTA);this.xPath.xPathCollectDescendants(a,r,s),s&&(o=!0);break;case he.DESCENDANT:s=this.xPath.xPathExtractTagNameFromNodeTest(this.nodeTest,e.ignoreNonElementNodesForNTA);this.xPath.xPathCollectDescendants(a,r,s),s&&(o=!0);break;case he.FOLLOWING:for(n=r;n;n=n.parentNode)for(var l=n.nextSibling;l;l=l.nextSibling)a.push(l),this.xPath.xPathCollectDescendants(a,l);break;case he.FOLLOWING_SIBLING:for(n=r.nextSibling;n;n=n.nextSibling)a.push(n);break;case he.NAMESPACE:throw new Error("not implemented: axis namespace");case he.PARENT:r.parentNode&&a.push(r.parentNode);break;case he.PRECEDING:for(n=r;n;n=n.parentNode)for(l=n.previousSibling;l;l=l.previousSibling)a.push(l),this.xPath.xPathCollectDescendantsReverse(a,l);break;case he.PRECEDING_SIBLING:for(n=r.previousSibling;n;n=n.previousSibling)a.push(n);break;case he.SELF:a.push(r);break;case he.SELF_AND_SIBLINGS:for(var u=0,c=e.nodeList;u<c.length;u++){var p=c[u];a.push(p)}break;default:throw new Error("ERROR -- NO SUCH AXIS: ".concat(this.axis))}if(!o){var h=a;a=[];for(var d=0;d<h.length;++d)this.nodeTest.evaluate(e.clone(h,void 0,d)).booleanValue()&&a.push(h[d])}if(!e.returnOnFirstMatch)for(d=0;d<this.predicate.length;++d){h=a;a=[];for(var g=0;g<h.length;++g){n=h[g];this.predicate[d].evaluate(e.clone(h,void 0,g)).booleanValue()&&a.push(n)}}return new ue(a)},r}(rr),Qr=function(e){function r(r){var t=e.call(this)||this;return t.value=r,t}return f(r,e),r.prototype.evaluate=function(){return new pe(this.value)},r}(rr),$r=function(e){function r(r,t){var a=e.call(this)||this;return a.expr1=r,a.expr2=t,a}return f(r,e),r.prototype.evaluate=function(e){for(var r=this.expr1.evaluate(e).nodeSetValue(),t=this.expr2.evaluate(e).nodeSetValue(),a=r.length,o=0,n=t;o<n.length;o++){for(var i=n[o],s=!1,l=0;l<a;++l)r[l]==i&&(s=!0,l=a);s||r.push(i)}return new ue(r)},r}(rr),et=function(e){function r(r){var t=e.call(this)||this;return t.name=r,t}return f(r,e),r.prototype.evaluate=function(e){return e.getVariable(this.name)},r}(rr),rt={label:"LocationPath",key:void 0},tt={label:"RelativeLocationPath",key:void 0},at={label:"AbsoluteLocationPath",key:void 0},ot={label:"Step",key:void 0},nt={label:"NodeTest",key:void 0},it={label:"Predicate",key:void 0},st={label:"Literal",key:void 0},lt={label:"Expr",key:void 0},ut={label:"PrimaryExpr",key:void 0},ct={label:"Variablereference",key:void 0},pt={label:"Number",key:void 0},ht={label:"FunctionCall",key:void 0},dt={label:"ArgumentRemainder",key:void 0},gt={label:"PathExpr",key:void 0},ft={label:"UnionExpr",key:void 0},mt={label:"FilterExpr",key:void 0},bt={label:"Digits",key:void 0},vt=function(){function e(){}return e.prototype.evaluate=function(e){return new l(e.nodeList[e.position].nodeType==n)},e}(),yt=function(){function e(){}return e.prototype.evaluate=function(e){var a=e.nodeList[e.position];return new l(a.nodeType==r||a.nodeType==t)},e}(),xt=function(){function e(e){if(this.name=e,e.indexOf(":")>0){var r=e.split(":");this.namespacePrefix=r[0],this.name=r[1]}this.re=new RegExp("^".concat(e,"$"),"i")}return e.prototype.evaluate=function(e){var r=e.nodeList[e.position];return void 0!==this.namespacePrefix?e.knownNamespaces[this.namespacePrefix]!==r.namespaceUri?new l(!1):e.caseInsensitive?r.localName.length!==this.name.length?new l(!1):new l(this.re.test(r.localName)):new l(r.localName===this.name):e.caseInsensitive?r.nodeName.length!==this.name.length?new l(!1):new l(this.re.test(r.nodeName)):new l(r.nodeName===this.name)},e}(),wt=function(){function e(e){this.regex=new RegExp("^".concat(e,":")),this.nsprefix=e}return e.prototype.evaluate=function(e){var r=e.nodeList[e.position];return new l(r.nodeName.match(this.regex))},e}(),Et=function(){function e(e){this.target=e}return e.prototype.evaluate=function(e){var r=e.nodeList[e.position];return new l(7==r.nodeType&&(!this.target||r.nodeName==this.target))},e}(),Nt=function(){function e(){}return e.prototype.evaluate=function(e){return new l(e.nodeList[e.position].nodeType==a)},e}(),Dt=function(){function e(){this.xPathGrammarRules=[[rt,[tt],18,this.passExpr],[rt,[at],18,this.passExpr],[at,[me,tt],18,this.makeLocationExpr1],[at,[fe,tt],18,this.makeLocationExpr2],[at,[me],0,this.makeLocationExpr3],[at,[fe],0,this.makeLocationExpr4],[tt,[ot],31,this.makeLocationExpr5],[tt,[tt,me,ot],31,this.makeLocationExpr6],[tt,[tt,fe,ot],31,this.makeLocationExpr7],[ot,[Ne],33,this.makeStepExpr1],[ot,[Ee],33,this.makeStepExpr2],[ot,[ye,be,nt],33,this.makeStepExpr3],[ot,[De,nt],33,this.makeStepExpr4],[ot,[nt],33,this.makeStepExpr5],[ot,[ot,it],33,this.makeStepExpr6],[nt,[Me],33,this.makeNodeTestExpr1],[nt,[He,ve,Me],33,this.makeNodeTestExpr2],[nt,[Xe],33,this.makeNodeTestExpr3],[nt,[Je,we],33,this.makeNodeTestExpr4],[nt,[Je,st,we],33,this.makeNodeTestExpr5],[it,[Oe,lt,Ie],33,this.makePredicateExpr],[ut,[ct],33,this.passExpr],[ut,[xe,lt,we],33,this.makePrimaryExpr],[ut,[st],30,this.passExpr],[ut,[pt],30,this.passExpr],[ut,[ht],31,this.passExpr],[ht,[Xe,xe,we],-1,this.makeFunctionCallExpr1],[ht,[Xe,xe,lt,dt,We,we],-1,this.makeFunctionCallExpr2],[dt,[qe,lt],-1,this.makeArgumentExpr],[ft,[gt],20,this.passExpr],[ft,[ft,ge,gt],20,this.makeUnionExpr],[gt,[rt],20,this.passExpr],[gt,[mt],19,this.passExpr],[gt,[mt,me,tt],19,this.makePathExpr1],[gt,[mt,fe,tt],19,this.makePathExpr2],[mt,[ut,it,We],31,this.makeFilterExpr],[lt,[ut],16,this.passExpr],[lt,[ft],16,this.passExpr],[lt,[Fe,lt],-1,this.makeUnaryMinusExpr],[lt,[lt,ke,lt],-1,this.makeBinaryExpr],[lt,[lt,Ae,lt],-1,this.makeBinaryExpr],[lt,[lt,Se,lt],-1,this.makeBinaryExpr],[lt,[lt,Le,lt],-1,this.makeBinaryExpr],[lt,[lt,Re,lt],-1,this.makeBinaryExpr],[lt,[lt,Ve,lt],-1,this.makeBinaryExpr],[lt,[lt,Ce,lt],-1,this.makeBinaryExpr],[lt,[lt,Te,lt],-1,this.makeBinaryExpr],[lt,[lt,Pe,lt],-1,this.makeBinaryExpr,Qe],[lt,[lt,Fe,lt],-1,this.makeBinaryExpr,Qe],[lt,[lt,Me,lt],-1,this.makeBinaryExpr,Qe],[lt,[lt,Be,lt],-1,this.makeBinaryExpr,Qe],[lt,[lt,Ue,lt],-1,this.makeBinaryExpr,Qe],[st,[ze],-1,this.makeLiteralExpr],[st,[je],-1,this.makeLiteralExpr],[pt,[_e],-1,this.makeNumberExpr],[ct,[Ge,Xe],200,this.makeVariableReference]],this.xPathParseCache={},this.xPathRules=[],this.xPathLog=function(){},this.lexerCount=0,this.parseCount=0,this.reduceCount=0}return e.prototype.makeTokenExpr=function(e){return new Qr(e)},e.prototype.passExpr=function(e){return e},e.prototype.makeLocationExpr1=function(e,r){return r.absolute=!0,r},e.prototype.makeLocationExpr2=function(e,r){return r.absolute=!0,r.prependStep(this.makeAbbrevStep(e.value)),r},e.prototype.makeLocationExpr3=function(){var e=new Xr(this);return e.appendStep(this.makeAbbrevStep(".")),e.absolute=!0,e},e.prototype.makeLocationExpr4=function(e){var r=new Xr(this);return r.absolute=!0,r.appendStep(this.makeAbbrevStep(e.value)),r},e.prototype.makeLocationExpr5=function(e){var r=new Xr(this);return r.appendStep(e),r},e.prototype.makeLocationExpr6=function(e,r,t){return e.appendStep(t),e},e.prototype.makeLocationExpr7=function(e,r,t){return e.appendStep(this.makeAbbrevStep(r.value)),e.appendStep(t),e},e.prototype.makeStepExpr1=function(e){return this.makeAbbrevStep(e.value)},e.prototype.makeStepExpr2=function(e){return this.makeAbbrevStep(e.value)},e.prototype.makeStepExpr3=function(e,r,t){return new Kr(e.value,t,this)},e.prototype.makeStepExpr4=function(e,r){return new Kr("attribute",r,this)},e.prototype.makeStepExpr5=function(e,r){return new Kr(r||"child",e,this)},e.prototype.makeStepExpr6=function(e,r){return e.appendPredicate(r),e},e.prototype.makeAbbrevStep=function(e){switch(e){case"//":return new Kr("descendant-or-self",new _r,this);case".":return new Kr("self",new _r,this);case"..":return new Kr("parent",new _r,this)}},e.prototype.makeNodeTestExpr1=function(){return new yt},e.prototype.makeNodeTestExpr2=function(e){return new wt(e.value)},e.prototype.makeNodeTestExpr3=function(e){return new xt(e.value)},e.prototype.makeNodeTestExpr4=function(e){switch(e.value.replace(/\s*\($/,"")){case"node":return new _r;case"text":return new Nt;case"comment":return new vt;case"processing-instruction":return new Et("")}},e.prototype.makeNodeTestExpr5=function(e,r){var t=e.replace(/\s*\($/,"");if("processing-instruction"!=t)throw t;return new Et(r.value)},e.prototype.makePredicateExpr=function(e,r){return new Zr(r)},e.prototype.makePrimaryExpr=function(e,r){return r},e.prototype.makeFunctionCallExpr1=function(e){return new zr(e)},e.prototype.makeFunctionCallExpr2=function(e,r,t,a){var o=new zr(e);o.appendArg(t);for(var n=0;n<a.length;++n)o.appendArg(a[n]);return o},e.prototype.makeArgumentExpr=function(e,r){return r},e.prototype.makeUnionExpr=function(e,r,t){return new $r(e,t)},e.prototype.makePathExpr1=function(e,r,t){return new Yr(e,t)},e.prototype.makePathExpr2=function(e,r,t){return t.prependStep(this.makeAbbrevStep(r.value)),new Yr(e,t)},e.prototype.makeFilterExpr=function(e,r){return r.length>0?new ar(e,r):e},e.prototype.makeUnaryMinusExpr=function(e,r){return new Wr(r)},e.prototype.makeBinaryExpr=function(e,r,t){return new tr(e,r,t)},e.prototype.makeLiteralExpr=function(e){var r=e.value.substring(1,e.value.length-1);return new jr(r)},e.prototype.makeNumberExpr=function(e){return new Jr(e.value)},e.prototype.makeVariableReference=function(e,r){return new et(r.value)},e.prototype.makeSimpleExpr=function(e,r){if("$"==e.charAt(0))return new et(e.substr(1));if("@"==e.charAt(0)){var t=new xt(e.substr(1)),a=new Kr("attribute",t,this),o=new Xr(this);return o.appendStep(a),o}if(e.match(/^[0-9]+$/))return new Jr(e);var n=new xt(e),i=new Kr(r||he.CHILD,n,this),s=new Xr(this);return s.appendStep(i),s},e.prototype.makeSimpleExpr2=function(e){for(var r=e.split("/"),t=new Xr(this),a=0;a<r.length;++a){var o=new xt(r[a]),n=new Kr(he.CHILD,o,this);t.appendStep(n)}return t},e.prototype.stackToString=function(e){for(var r="",t=0;t<e.length;++t)r&&(r+="\n"),r+=e[t].tag.label;return r},e.prototype.xPathCacheLookup=function(e){return this.xPathParseCache[e]},e.prototype.xPathCollectDescendants=function(e,r,t){if(t&&r.getElementsByTagName)er(e,r.getElementsByTagName(t));else for(var a=r.firstChild;a;a=a.nextSibling)e.push(a),this.xPathCollectDescendants(e,a)},e.prototype.xPathCollectDescendantsReverse=function(e,r){for(var t=r.lastChild;t;t=t.previousSibling)e.push(t),this.xPathCollectDescendantsReverse(e,t)},e.prototype.xPathEval=function(e,r){return this.xPathParse(e).evaluate(r)},e.prototype.xPathExtractTagNameFromNodeTest=function(e,r){return e instanceof xt?e.name:r&&e instanceof _r||e instanceof yt?"*":void 0},e.prototype.xPathMatchStack=function(e,r){var t,a,o=e.length,n=r.length,i=[];i.matchlength=0;var s=0;for(t=n-1,a=o-1;t>=0&&a>=0;--t,a-=s){s=0;var l=[];if(r[t]==We)for(t-=1,i.push(l);a-s>=0&&e[a-s].tag==r[t];)l.push(e[a-s]),s+=1,i.matchlength+=1;else if(r[t]==Ze)for(t-=1,i.push(l);a-s>=0&&s<2&&e[a-s].tag==r[t];)l.push(e[a-s]),s+=1,i.matchlength+=1;else if(r[t]==Ke){if(t-=1,i.push(l),e[a].tag!=r[t])return[];for(;a-s>=0&&e[a-s].tag==r[t];)l.push(e[a-s]),s+=1,i.matchlength+=1}else{if(e[a].tag!=r[t])return[];i.push(e[a]),s+=1,i.matchlength+=1}h(l),l.expr=p(l,(function(e){return e.expr}))}return h(i),-1===t?i:[]},e.prototype.findXPathRuleForExpression=function(e,r){for(var t=null,a="",o=0;o<Ye.length;++o){var n=Ye[o].re.exec(e);if(this.lexerCount++,null!==n&&n.length>0&&n[0].length>0){t=Ye[o],a=n[0];break}}return!t||t!=Be&&t!=Ue&&t!=Ae&&t!=ke||r&&r.tag!=De&&r.tag!=fe&&r.tag!=me&&r.tag!=be&&r.tag!=Ge||(t=Xe),{rule:t,match:a}},e.prototype.xPathParseInit=function(){if(!this.xPathRules.length){var e=[rt,tt,at,ot,nt,it,st,lt,ut,ct,pt,ht,dt,gt,ft,mt,bt];this.xPathGrammarRules.sort((function(e,r){var t=e[1].length,a=r[1].length;return t<a?1:t>a?-1:0}));for(var r=1,t=0;t<e.length;++t)e[t].key=r++;for(t=0;t<Ye.length;++t)Ye[t].key=r++;this.xPathLog("XPath parse INIT: ".concat(r," rules"));for(t=0;t<this.xPathGrammarRules.length;++t)for(var a=this.xPathGrammarRules[t],o=a[1],n=o.length-1;n>=0;--n){if(o[n]==Ke){s(this.xPathRules,o[n-1].key,a);break}if(o[n]!=We&&o[n]!=Ze){s(this.xPathRules,o[n].key,a);break}s(this.xPathRules,o[n-1].key,a),--n}this.xPathLog("XPath parse INIT: ".concat(this.xPathRules.length," rule bins"));var i=0;!function(e,r){for(var t=0;t<e.length;++t)r.call(this,e[t],t)}(this.xPathRules,(function(e){e&&(i+=e.length)})),this.xPathLog("XPath parse INIT: ".concat(i/this.xPathRules.length," average bin size"))}function s(e,r,t){e[r]||(e[r]=[]),e[r].push(t)}},e.prototype.xPathParse=function(e,r){var t="".concat(e);if(this.xPathLog("parse ".concat(e)),this.xPathParseInit(),e.match(/^(\$|@)?\w+$/i)){var a=this.makeSimpleExpr(e,r);return this.xPathParseCache[e]=a,this.xPathLog(" ... simple"),a}if(e.match(/^\w+(\/\w+)*$/i)){a=this.makeSimpleExpr2(e);return this.xPathParseCache[e]=a,this.xPathLog(" ... simple 2"),a}var o=e,n=[],i=null,s=null,l=!1,u=0;this.lexerCount=0;for(var c=0;!l;){u++,e=e.replace(/^\s*/,""),s=i,i=null;var p=this.findXPathRuleForExpression(e,s),h=p.rule,d=p.match;for(h?(e=e.substr(d.length),this.xPathLog("token: ".concat(d," -- ").concat(h.label)),i={tag:h,match:d,prec:h.prec?h.prec:0,expr:this.makeTokenExpr(d)}):(this.xPathLog("DONE"),l=!0);this.xPathReduce(n,i);)c++,this.xPathLog("stack: ".concat(this.stackToString(n)))}if(this.xPathLog("stack: ".concat(this.stackToString(n))),1!==n.length)throw"XPath parse error ".concat(o,":\n").concat(this.stackToString(n));var g=n[0].expr;return void 0!==r&&!g.absolute&&!t.startsWith("*")&&g.steps&&Array.isArray(g.steps)&&(g.steps[0].axis=r),this.xPathParseCache[o]=g,this.xPathLog("XPath parse: ".concat(u," / ").concat(this.lexerCount," / ").concat(c)),g},e.prototype.findGrammarRuleCandidate=function(e,r){for(var t=0;t<e.length;++t){var a=e[t],o=this.xPathMatchStack(r,a[1]);if(o.length){var n={tag:a[0],rule:a,match:o,prec:void 0};return n.prec=this.xPathGrammarPrecedence(n),n}}return null},e.prototype.xPathReduce=function(e,r){var t,a=null;if(e.length>0){var o=e[e.length-1],n=this.xPathRules[o.tag.key];n&&(a=this.findGrammarRuleCandidate(n,e))}if(a&&(!r||a.prec>r.prec||r.tag.left&&a.prec>=r.prec)){for(var i=0;i<a.match.matchlength;++i)e.pop();this.xPathLog("reduce ".concat(a.tag.label," ").concat(a.prec," ahead ").concat(r?r.tag.label+" "+r.prec+(r.tag.left?" left":""):" none "));var s=p(a.match,(function(e){return e.expr}));this.xPathLog("going to apply ".concat(a.rule[3])),a.expr=a.rule[3].apply(this,s),e.push(a),t=!0}else r&&(this.xPathLog("shift ".concat(r.tag.label," ").concat(r.prec).concat(r.tag.left?" left":""," over ").concat(a?a.tag.label+" "+a.prec:" none")),e.push(r)),t=!1;return t},e.prototype.xPathSort=function(e,r){if(0!==r.length){for(var t=[],a=0;a<e.contextSize();++a){for(var o={node:h=e.nodeList[a],key:[]},n=e.clone([h],void 0,0,void 0),i=0,s=r;i<s.length;i++){var l=s[i],u=l.expr.evaluate(n),c=void 0;"text"===l.type?c=u.stringValue():"number"===l.type&&(c=u.numberValue()),o.key.push({value:c,order:l.order})}o.key.push({value:a,order:"ascending"}),t.push(o)}t.sort(this.xPathSortByKey);var p=[];for(a=0;a<t.length;++a){var h;(h=t[a].node).siblingPosition=a,p.push(h)}e.nodeList=p,e.setNode(0)}},e.prototype.xPathSortByKey=function(e,r){for(var t=0;t<e.key.length;++t){var a="descending"==e.key[t].order?-1:1;if(e.key[t].value>r.key[t].value)return 1*a;if(e.key[t].value<r.key[t].value)return-1*a}return 0},e.prototype.xPathStep=function(e,r,t,a,o){var n=r[t],i=o.clone([a],void 0,0,void 0);if(o.returnOnFirstMatch&&!n.hasPositionalPredicate){var s=(p=n.evaluate(i).nodeSetValue()).length,l=n.predicate.length;e:for(var u=0;u<s;++u){for(var c=0;c<l;++c)if(!n.predicate[c].evaluate(o.clone(p,void 0,u,void 0)).booleanValue())continue e;if(t==r.length-1?e.push(p[u]):this.xPathStep(e,r,t+1,p[u],o),e.length>0)break}}else{i.returnOnFirstMatch=!1;var p=n.evaluate(i).nodeSetValue();for(u=0;u<p.length;++u)t==r.length-1?e.push(p[u]):this.xPathStep(e,r,t+1,p[u],o)}},e.prototype.xPathGrammarPrecedence=function(e){var r=0;if(e.rule)if(e.rule.length>=3&&e.rule[2]>=0)r=e.rule[2];else for(var t=0;t<e.rule[1].length;++t){var a=this.xPathTokenPrecedence(e.rule[1][t]);r=Math.max(r,a)}else if(e.tag)r=this.xPathTokenPrecedence(e.tag);else if(e.length)for(var o=0;o<e.length;++o){a=this.xPathGrammarPrecedence(e[o]);r=Math.max(r,a)}return r},e.prototype.xPathTokenPrecedence=function(e){return e.prec||2},e}(),qt=function(){function e(){}return e.prototype.expressionMatch=function(e,r){return e instanceof Xr?this.locationExpressionMatch(e,r):e instanceof $r?this.unionExpressionMatch(e,r):[]},e.prototype.locationExpressionMatch=function(e,r){if(void 0===e||void 0===e.steps||e.steps.length<=0)throw new Error("Error resolving XSLT match: Location Expression should have steps.");return e.absolute?"self"===e.steps[0].axis?this.absoluteXsltMatchByDocumentNode(e,r):this.absoluteXsltMatch(e,r):this.relativeXsltMatch(e,r)},e.prototype.unionExpressionMatch=function(e,r){return this.expressionMatch(e.expr1,r).concat(this.expressionMatch(e.expr2,r))},e.prototype.absoluteXsltMatchByDocumentNode=function(e,r){for(var t=r.clone([r.root],void 0,0,void 0),a=[],o=0,n=e.evaluate(t).nodeSetValue();o<n.length;o++){var i=n[o];i.id!==r.nodeList[r.position].id||a.push(i)}return a},e.prototype.absoluteXsltMatch=function(e,r){var t,a=r.root.childNodes[0],o=r.clone([a],void 0,0,void 0),n=e.evaluate(o).nodeSetValue(),i=[];t=1===r.nodeList.length&&"#document"===r.nodeList[0].nodeName?[r.nodeList[0].childNodes[0]]:r.nodeList;for(var s=0,l=n;s<l.length;s++){var u=l[s];u.id!==t[r.position].id||i.push(u)}return i},e.prototype.relativeXsltMatch=function(e,r){var t=r.clone(),a=e.evaluate(t).nodeSetValue();return 1===a.length&&"#document"===a[0].nodeName?[a[0].childNodes[0]]:a},e}(),kt=function(){function e(e){void 0===e&&(e={escape:!0,selfClosingTags:!0,parameters:[]}),this.xPath=new Dt,this.matchResolver=new qt,this.options={escape:e.escape||!0,selfClosingTags:e.selfClosingTags||!0,parameters:e.parameters||[]},this.outputMethod="xml",this.outputOmitXmlDeclaration="no",this.decimalFormatSettings={decimalSeparator:".",groupingSeparator:",",infinity:"Infinity",minusSign:"-",naN:"NaN",percent:"%",perMille:"‰",zeroDigit:"0",digit:"#",patternSeparator:";"}}return e.prototype.xsltProcess=function(e,r){var t=new b;this.outputDocument=t;var a=new $e([e],[t]);if(this.options.parameters.length>0)for(var o=0,n=this.options.parameters;o<n.length;o++){var i=n[o];a.setVariable(i.name,new pe(i.value))}return this.xsltProcessContext(a,r),function(e,r){void 0===r&&(r={cData:!1,escape:!0,selfClosingTags:!0});var t=[];return oe(e,t,r),t.join("")}(t,{cData:!1,escape:this.options.escape,selfClosingTags:this.options.selfClosingTags})},e.prototype.xsltProcessContext=function(e,n,l){var u=this;if(this.isXsltElement(n)){var c,p,h,d=void 0,g=void 0,f=void 0,m=void 0,b=void 0,v=void 0,y=void 0,x=void 0,w=void 0,E=void 0,N=void 0,D=void 0;switch(n.localName){case"apply-imports":case"attribute-set":case"fallback":case"import":case"include":case"key":case"message":case"namespace-alias":case"number":case"preserve-space":case"processing-instruction":case"strip-space":throw new Error("not implemented: ".concat(n.localName));case"apply-templates":b=(f=le(n,"select"))?this.xPath.xPathEval(f,e).nodeSetValue():e.nodeList[e.position].childNodes,v=le(n,"mode"),y=[];for(var q=0,k=(p=n.ownerDocument.documentElement).childNodes.filter((function(e){return e.nodeType==r&&u.isXsltElement(e,"template")}));q<k.length;q++){var A=k[q],S=n.getAncestorByLocalName("template");void 0!==S&&(S.id!==A.id&&(v&&A.getAttributeValue("mode")!==v||y.push(A)))}for(var L=e.clone(b),T=0;T<y.length;++T)for(var C=0;C<L.contextSize();++C)if(L.nodeList[C].nodeType===a){var V=e.clone([L.nodeList[C]],void 0,0,void 0);this.commonLogicTextNode(V,L.nodeList[C])}else{var R=L.clone([L.nodeList[C]],void 0,0,void 0);R.inApplyTemplates=!0,R.outputDepth=0,this.xsltProcessContext(R,y[T],l)}break;case"attribute":d=le(n,"name"),c=this.xsltAttributeValue(d,e);var P=te(this.outputDocument);if(this.xsltChildNodes(e,n,P),m=function(e,n){if(void 0===n&&(n=!1),!e)return"";var l="";if(e.nodeType==a||e.nodeType==o)l+=e.nodeValue;else if(e.nodeType==t)l+=e.nodeValue;else if(e.nodeType==r||e.nodeType==i||e.nodeType==s){if(!n){var u=e.innerText;if(null!=u)return u;var c=e.textContent;if(null!=c)return c}for(var p=e.transformedChildNodes.length,h=0;h<p;++h)l+=ae(e.transformedChildNodes[h])}return l}(P),null!=l)Y(l,c,m);else{var F=e.outputNodeList[e.outputPosition];if("#document"===F.localName){var B=e.root.childNodes[0],U=$(this.outputDocument,B.nodeName);U.transformedNodeName=B.nodeName,U.transformedLocalName=B.localName,W(F,U),F=U}Y(F,c,m)}break;case"call-template":c=le(n,"name"),p=n.ownerDocument.documentElement,x=e.clone(),this.xsltWithParam(x,n);for(T=0;T<p.childNodes.length;++T){var O=p.childNodes[T];if(O.nodeType==r&&this.isXsltElement(O,"template")&&X(O,"name")==c){this.xsltChildNodes(x,O,l);break}}break;case"choose":this.xsltChoose(e,n,l);break;case"comment":g=te(this.outputDocument),this.xsltChildNodes(e,n,g),w=ae(g),E=re(this.outputDocument,w),l.appendChild(E);break;case"copy":var I=l||e.outputNodeList[e.outputPosition];(g=this.xsltCopy(I,e.nodeList[e.position]))&&this.xsltChildNodes(e,n,g);break;case"copy-of":f=le(n,"select"),m=this.xPath.xPathEval(f,e);var G=l||e.outputNodeList[e.outputPosition];if("node-set"===m.type){b=m.nodeSetValue();for(T=0;T<b.length;++T)this.xsltCopyOf(G,b[T])}else{Z(G,K(this.outputDocument,m.stringValue()))}break;case"decimal-format":c=le(n,"name");var H=le(n,"decimal-separator"),M=le(n,"grouping-separator"),z=le(n,"infinity"),j=le(n,"minus-sign"),_=le(n,"NaN"),J=le(n,"percent"),ee=le(n,"per-mille"),oe=le(n,"zero-digit"),ne=le(n,"digit"),ie=le(n,"pattern-separator");this.decimalFormatSettings={name:c||this.decimalFormatSettings.name,decimalSeparator:H||this.decimalFormatSettings.decimalSeparator,groupingSeparator:M||this.decimalFormatSettings.groupingSeparator,infinity:z||this.decimalFormatSettings.infinity,minusSign:j||this.decimalFormatSettings.minusSign,naN:_||this.decimalFormatSettings.naN,percent:J||this.decimalFormatSettings.percent,perMille:ee||this.decimalFormatSettings.perMille,zeroDigit:oe||this.decimalFormatSettings.zeroDigit,digit:ne||this.decimalFormatSettings.digit,patternSeparator:ie||this.decimalFormatSettings.patternSeparator},e.decimalFormatSettings=this.decimalFormatSettings;break;case"element":d=le(n,"name"),c=this.xsltAttributeValue(d,e),(g=$(this.outputDocument,c)).transformedNodeName=c,W(e.outputNodeList[e.outputPosition],g);var se=e.clone(void 0,[g],void 0,0);this.xsltChildNodes(se,n,g);break;case"for-each":this.xsltForEach(e,n,l);break;case"if":h=le(n,"test"),this.xPath.xPathEval(h,e).booleanValue()&&this.xsltChildNodes(e,n,l);break;case"otherwise":throw"error if here: ".concat(n.localName);case"output":this.outputMethod=le(n,"method"),this.outputOmitXmlDeclaration=le(n,"omit-xml-declaration");break;case"param":this.xsltVariable(e,n,!1);break;case"sort":this.xsltSort(e,n);break;case"stylesheet":case"transform":this.xsltTransformOrStylesheet(n,e,l);break;case"template":if(!e.inApplyTemplates&&e.baseTemplateMatched)break;if(!(N=le(n,"match")))break;(b=this.xsltMatch(N,e,"self-and-siblings")).length>0&&(e.inApplyTemplates||(e.baseTemplateMatched=!0),this.xsltChildNodes(e,n,l));break;case"text":D=ae(n),g=Q(this.outputDocument,D);var ue=n.attributes.filter((function(e){return"disable-output-escaping"===e.nodeName}));ue.length>0&&"yes"===ue[0].nodeValue&&(g.escape=!1),(l||e.outputNodeList[e.outputPosition]).appendTransformedChild(g);break;case"value-of":f=le(n,"select"),m=this.xPath.xPathEval(f,e).stringValue(),(g=Q(this.outputDocument,m)).siblingPosition=e.nodeList[e.position].siblingPosition,null!=l?l.appendTransformedChild(g):e.outputNodeList[e.outputPosition].appendTransformedChild(g);break;case"variable":this.xsltVariable(e,n,!0);break;default:throw new Error("error if here: ".concat(n.localName))}}else this.xsltPassThrough(e,n,l)},e.prototype.xsltChoose=function(e,t,a){for(var o=0,n=t.childNodes;o<n.length;o++){var i=n[o];if(i.nodeType===r)if(this.isXsltElement(i,"when")){var s=le(i,"test");if(this.xPath.xPathEval(s,e).booleanValue()){this.xsltChildNodes(e,i,a);break}}else if(this.isXsltElement(i,"otherwise")){this.xsltChildNodes(e,i,a);break}}},e.prototype.xsltCopy=function(e,i){if(i.nodeType==r)return(s=$(this.outputDocument,i.nodeName)).transformedNodeName=i.nodeName,null!==i.namespaceUri&&void 0!==i.namespaceUri&&Y(s,"xmlns",i.namespaceUri),W(e,s),s;if(i.nodeType==a)W(e,s=Q(this.outputDocument,i.nodeValue));else if(i.nodeType==o){W(e,s=ee(this.outputDocument,i.nodeValue))}else if(i.nodeType==n){var s;W(e,s=re(this.outputDocument,i.nodeValue))}else i.nodeType==t&&Y(e,i.nodeName,i.nodeValue);return null},e.prototype.xsltCopyOf=function(e,r){if(r.nodeType==s||r.nodeType==i)for(var t=0;t<r.childNodes.length;++t)this.xsltCopyOf(e,r.childNodes[t]);else{var a=this.xsltCopy(e,r);if(a){for(t=0;t<r.attributes.length;++t)this.xsltCopyOf(a,r.attributes[t]);for(t=0;t<r.childNodes.length;++t)this.xsltCopyOf(a,r.childNodes[t])}}},e.prototype.xsltForEach=function(e,r,t){var a=le(r,"select"),o=this.xPath.xPathEval(a,e).nodeSetValue(),n=e.clone(o);this.xsltSort(n,r);var i=n.nodeList.filter((function(e){return null!==e.parentNode&&void 0!==e.parentNode}));if(i.length<=0)throw new Error("Nodes with no parents defined.");i[0].parentNode.childNodes=n.nodeList;for(var s=0;s<n.contextSize();++s)this.xsltChildNodes(n.clone(n.nodeList,void 0,s),r,t)},e.prototype.xsltSort=function(e,t){for(var a=[],o=0,n=t.childNodes;o<n.length;o++){var i=n[o];if(i.nodeType==r&&this.isXsltElement(i,"sort")){var s=le(i,"select"),l=this.xPath.xPathParse(s),u=le(i,"data-type")||"text",c=le(i,"order")||"ascending";a.push({expr:l,type:u,order:c})}}this.xPath.xPathSort(e,a)},e.prototype.xsltTransformOrStylesheet=function(e,r,t){for(var a=0,o=e.attributes;a<o.length;a++){var n=o[a];if("version"===n.nodeName){if(this.version=n.nodeValue,!["1.0","2.0","3.0"].includes(this.version))throw new Error("XSLT version not defined or invalid. Actual resolved version: ".concat(this.version||"(none)","."))}else"xmlns"===n.prefix&&(r.knownNamespaces[n.localName]=n.nodeValue)}this.xsltChildNodes(r,e,t)},e.prototype.xsltVariable=function(e,r,t){var a,o=le(r,"name"),n=le(r,"select");if(r.childNodes.length>0){var i=te(r.ownerDocument);this.xsltChildNodes(e,r,i),a=new ue([i])}else if(n)a=this.xPath.xPathEval(n,e);else{var s="",l=this.options.parameters.filter((function(e){return e.name===o}));l.length>0&&(s=l[0].value),a=new pe(s)}!t&&e.getVariable(o)||e.setVariable(o,a)},e.prototype.xsltChildNodes=function(e,r,t){for(var a=e.clone(),o=0;o<r.childNodes.length;++o)this.xsltProcessContext(a,r.childNodes[o],t)},e.prototype.commonLogicTextNode=function(e,r){var t,o=e.outputNodeList[e.outputPosition].transformedChildNodes.filter((function(e){return e.nodeType===a}));o.length>0?(t=o[0]).transformedNodeValue=r.nodeValue:((t=Q(this.outputDocument,r.nodeValue)).transformedParentNode=e.outputNodeList[e.outputPosition],W(e.outputNodeList[e.outputPosition],t))},e.prototype.xsltPassThrough=function(e,t,o){if(t.nodeType==a)this.xsltPassText(t)&&this.commonLogicTextNode(e,t);else if(t.nodeType==r){var n=void 0,i=e;"#document"===e.nodeList[e.position].nodeName?(n=e.nodeList[e.position].firstChild,i=e.clone([n])):n=e.nodeList[e.position];var s=void 0;void 0===n.outputNode||null===n.outputNode||e.outputDepth>0?((s=$(this.outputDocument,t.nodeName)).siblingPosition=n.siblingPosition,n.outputNode=s):s=n.outputNode,s.transformedNodeName=t.nodeName,s.transformedLocalName=t.localName;var l=t.attributes.filter((function(e){return e}));if(0===l.length)s.transformedAttributes=[];else for(var u=0,c=l;u<c.length;u++){var p=c[u];Y(s,p.nodeName,this.xsltAttributeValue(p.nodeValue,i))}var h=e.outputNodeList[e.outputPosition];W(h,s);var d=i.cloneByOutput(h.transformedChildNodes,h.transformedChildNodes.length-1,++i.outputDepth);this.xsltChildNodes(d,t)}else this.xsltChildNodes(e,t,o)},e.prototype.xsltPassText=function(e){if(!e.nodeValue.match(/^\s*$/))return!0;var t=e.parentNode;if(this.isXsltElement(t,"text"))return!0;for(;t&&t.nodeType==r;){var a=X(t,"xml:space");if(a){if("default"==a)return!1;if("preserve"==a)return!0}t=t.parentNode}return!1},e.prototype.xsltAttributeValue=function(e,r){var t=e.split("{");if(1===t.length)return e;for(var a="",o=0;o<t.length;++o){var n=t[o].split("}");if(2==n.length)a+=this.xPath.xPathEval(n[0],r).stringValue()+n[1];else a+=t[o]}return a},e.prototype.xsltMatch=function(e,r,t){var a=this.xPath.xPathParse(e,t);return this.matchResolver.expressionMatch(a,r)},e.prototype.xsltWithParam=function(e,t){for(var a=0,o=t.childNodes;a<o.length;a++){var n=o[a];n.nodeType===r&&this.isXsltElement(n,"with-param")&&this.xsltVariable(e,n,!0)}},e.prototype.isXsltElement=function(e,r){return(!r||e.localName==r)&&(e.namespaceUri?"http://www.w3.org/1999/XSL/Transform"===e.namespaceUri:"xsl"===e.prefix)},e}();e.ExprContext=$e,e.XPath=Dt,e.Xslt=kt,e.xmlEscapeText=ie,e.xmlParse=function(e){var r,t,a=/\/$/;if(e.match(/^<\?xml/))if(5==e.search(new RegExp(w)))r=M,t=z;else{if(5!=e.search(new RegExp(V)))throw new Error("VersionInfo is missing, or unknown version number.");r=j,t=_}else r=M,t=z;var o=new b,n=o,i=[],s=n;i.push(s);for(var l,u=!1,p=!1,h=!1,g=0,f=0;f<e.length;++f){var m=e.charAt(f);if(u&&!h&&"'"===m)p=!p;else if(u&&!p&&'"'===m)h=!h;else if(!u||">"!==m||p||h){if(!u&&"<"===m){if((x=e.slice(g,f))&&s!==n&&Z(s,K(o,x)),"!--"===e.slice(f+1,f+4)){if(v=e.slice(f+4).indexOf("--\x3e"))Z(s,N=re(o,e.slice(f+4,f+v+4))),f+=v+6}else if("![CDATA["===e.slice(f+1,f+9)){if(v=e.slice(f+9).indexOf("]]>"))Z(s,N=ee(o,e.slice(f+9,f+v+9))),f+=v+11}else if("!DOCTYPE"===e.slice(f+1,f+9)){var v;if(v=e.slice(f+9).indexOf(">")){var y=e.slice(f+9,f+v+9).trimStart();N=void 0;"xsl:text"===s.nodeName?N=K(o,"<!DOCTYPE ".concat(y,">")):(l=y,N=o.createDTDSection(l)),Z(s,N),f+=v+y.length+5}}else u=!0;g=f+1}}else{var x;if("/"==(x=e.slice(g,f)).charAt(0))i.pop(),s=i[i.length-1];else if("?"===x.charAt(0));else if("!"===x.charAt(0));else{for(var E=x.match(a),N=$(o,r.exec(x)[1]),D=void 0;D=t.exec(x);){var q=c.decode(D[5]||D[7]||"");J(N,D[1],q)}N.siblingPosition=s.childNodes.length,Z(s,N),E||(s=N,i.push(N));var k=d(N);null!==N.prefix?N.prefix in k&&(N.namespaceUri=k[N.prefix]):""in k&&(N.namespaceUri=k[""]);for(var A=0;A<N.attributes.length;++A)null!==N.attributes[A].prefix&&N.attributes[A].prefix in k&&(N.attributes[A].namespaceUri=k[N.attributes[A].prefix])}g=f+1,u=!1,p=!1,h=!1}}return n},Object.defineProperty(e,"__esModule",{value:!0})}));
15
+ ***************************************************************************** */var g=function(e,r){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)r.hasOwnProperty(t)&&(e[t]=r[t])},g(e,r)};function f(e,r){function t(){this.constructor=e}g(e,r),e.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t)}var m=function(){function e(e,r,t,a,o){this.id=Math.random()*(Number.MAX_SAFE_INTEGER-1)+1,this.attributes=[],this.childNodes=[],this.transformedAttributes=[],this.transformedChildNodes=[],this.visited=!1,this.escape=!0,this.siblingPosition=-1,this.init(e,r,t,a,o)}return e.prototype.init=function(e,r,t,a,o){var n;this.nodeType=e-0,this.nodeName="".concat(r),this.nodeValue="".concat(t),this.ownerDocument=a,this.namespaceUri=o||null,n=this.qualifiedNameToParts("".concat(r)),this.prefix=n[0],this.localName=n[1],this.firstChild=null,this.lastChild=null,this.nextSibling=null,this.previousSibling=null,this.parentNode=null},e.prototype.qualifiedNameToParts=function(e){return e.includes(":")?e.split(":"):[null,e]},e.prototype.domTraverseElements=function(e,t,a){var o;if(t&&"boolean"==typeof(o=t.call(null,e))&&!o)return!1;for(var n=e.firstChild;n;n=n.nextSibling)if(n.nodeType==r&&"boolean"==typeof(o=this.domTraverseElements.call(this,n,t,a))&&!o)return!1;return!(a&&"boolean"==typeof(o=a.call(null,e))&&!o)&&void 0},e.recycle=function(e){if(e)if("XDocument"!==e.constructor.name){if(e.constructor==this){this._unusedXNodes.push(e);for(var r=0;r<e.attributes.length;++r)this.recycle(e.attributes[r]);for(var t=0;t<e.childNodes.length;++t)this.recycle(e.childNodes[t]);e.attributes.length=0,e.childNodes.length=0,e.init.call(0,"","",null)}}else this.recycle(e.documentElement)},e.create=function(r,t,a,o,n){if(this._unusedXNodes.length>0){var i=this._unusedXNodes.pop();return i.init(r,t,a,o,n),i}return new e(r,t,a,o,n)},e.clone=function(r,t){var a=new e(r.nodeType,r.nodeName,r.nodeValue,t,r.namespaceUri);a.id=r.id;for(var o=0,n=r.childNodes;o<n.length;o++){var i=n[o];a.appendChild(e.clone(i,a))}for(var s=0,l=r.attributes;s<l.length;s++){var u=l[s];a.setAttribute(u.nodeName,u.nodeValue)}return a},e.prototype.appendChild=function(e){0==this.childNodes.length&&(this.firstChild=e),e.previousSibling=this.lastChild,e.nextSibling=null,this.lastChild&&(this.lastChild.nextSibling=e),e.parentNode=this,this.lastChild=e,this.childNodes.push(e)},e.prototype.appendTransformedChild=function(e){0==this.transformedChildNodes.length&&(this.transformedFirstChild=e),e.transformedPreviousSibling=this.lastChild,e.transformedNextSibling=null,this.transformedLastChild&&(this.transformedLastChild.transformedNextSibling=e),e.transformedParentNode=this,this.transformedLastChild=e,this.transformedChildNodes.push(e)},e.prototype.replaceChild=function(e,r){if(r!=e)for(var t=0;t<this.childNodes.length;++t)if(this.childNodes[t]==r){this.childNodes[t]=e;var a=r.parentNode;r.parentNode=null,e.parentNode=a,a=r.previousSibling,r.previousSibling=null,e.previousSibling=a,e.previousSibling&&(e.previousSibling.nextSibling=e),a=r.nextSibling,r.nextSibling=null,e.nextSibling=a,e.nextSibling&&(e.nextSibling.previousSibling=e),this.firstChild==r&&(this.firstChild=e),this.lastChild==r&&(this.lastChild=e);break}},e.prototype.insertBefore=function(e,r){if(r!=e&&r.parentNode==this){e.parentNode&&e.parentNode.removeChild(e);for(var t=[],a=0,o=this.childNodes;a<o.length;a++){var n=o[a];n==r&&(t.push(e),e.parentNode=this,e.previousSibling=r.previousSibling,r.previousSibling=e,e.previousSibling&&(e.previousSibling.nextSibling=e),e.nextSibling=r,this.firstChild==r&&(this.firstChild=e)),t.push(n)}this.childNodes=t}},e.prototype.removeChild=function(e){for(var r=[],t=0,a=this.childNodes;t<a.length;t++){var o=a[t];o!=e?r.push(o):(o.previousSibling&&(o.previousSibling.nextSibling=o.nextSibling),o.nextSibling&&(o.nextSibling.previousSibling=o.previousSibling),this.firstChild==o&&(this.firstChild=o.nextSibling),this.lastChild==o&&(this.lastChild=o.previousSibling))}this.childNodes=r},e.prototype.hasAttributes=function(){return this.attributes.length>0},e.prototype.setAttribute=function(r,a){for(var o=0;o<this.attributes.length;++o)if(this.attributes[o].nodeName==r)return void(this.attributes[o].nodeValue="".concat(a));var n=e.create(t,r,a,this);n.parentNode=this,this.attributes.push(n)},e.prototype.setTransformedAttribute=function(r,a){for(var o=0;o<this.transformedAttributes.length;++o)if(this.transformedAttributes[o].nodeName===r)return this.transformedAttributes[o].transformedNodeName=r,void(this.transformedAttributes[o].transformedNodeValue="".concat(a));var n=e.create(t,r,a,this);n.transformedNodeName=r,n.transformedNodeValue=a,n.parentNode=this,this.transformedAttributes.push(n)},e.prototype.setAttributeNS=function(r,a,o){for(var n=0;n<this.attributes.length;++n)if(this.attributes[n].namespaceUri==r&&this.attributes[n].localName==this.qualifiedNameToParts("".concat(a))[1])return this.attributes[n].nodeValue="".concat(o),this.attributes[n].nodeName="".concat(a),void(this.attributes[n].prefix=this.qualifiedNameToParts("".concat(a))[0]);this.attributes.push(e.create(t,a,o,this,r))},e.prototype.getAttributeValue=function(e){for(var r=0;r<this.attributes.length;++r)if(this.attributes[r].nodeName==e)return this.attributes[r].nodeValue;return null},e.prototype.getAttributeNS=function(e,r){for(var t=0;t<this.attributes.length;++t)if(this.attributes[t].namespaceUri==e&&this.attributes[t].localName==r)return this.attributes[t].nodeValue;return null},e.prototype.hasAttribute=function(e){for(var r=0;r<this.attributes.length;++r)if(this.attributes[r].nodeName==e)return!0;return!1},e.prototype.hasAttributeNS=function(e,r){for(var t=0;t<this.attributes.length;++t)if(this.attributes[t].namespaceUri==e&&this.attributes[t].localName==r)return!0;return!1},e.prototype.removeAttribute=function(e){for(var r=[],t=0;t<this.attributes.length;++t)this.attributes[t].nodeName!=e&&r.push(this.attributes[t]);this.attributes=r},e.prototype.removeAttributeNS=function(e,r){for(var t=[],a=0;a<this.attributes.length;++a)this.attributes[a].localName==r&&this.attributes[a].namespaceUri==e||t.push(this.attributes[a]);this.attributes=t},e.prototype.getElementsByTagName=function(e){var r=[],t=this;return"*"==e?this.domTraverseElements(this,(function(e){t!=e&&r.push(e)}),null):this.domTraverseElements(this,(function(a){t!=a&&a.nodeName==e&&r.push(a)}),null),r},e.prototype.getElementsByTagNameNS=function(e,r){var t=[],a=this;return"*"==e&&"*"==r?this.domTraverseElements(this,(function(e){a!=e&&t.push(e)}),null):"*"==e?this.domTraverseElements(this,(function(e){a!=e&&e.localName==r&&t.push(e)}),null):"*"==r?this.domTraverseElements(this,(function(r){a!=r&&r.namespaceUri==e&&t.push(r)}),null):this.domTraverseElements(this,(function(o){a!=o&&o.localName==r&&o.namespaceUri==e&&t.push(o)}),null),t},e.prototype.getElementById=function(e){var r=null;return this.domTraverseElements(this,(function(t){if(t.getAttributeValue("id")==e)return r=t,!1}),null),r},e.prototype.getAncestorByLocalName=function(e){if(null!==this.parentNode&&void 0!==this.parentNode)return this.parentNode.localName===e?this.parentNode:this.parentNode.getAncestorByLocalName(e)},e.prototype.getAncestorById=function(e){if(null!==this.parentNode&&void 0!==this.parentNode)return this.parentNode.id===e?this.parentNode:this.parentNode.getAncestorById(e)},e._unusedXNodes=[],e}(),b=function(e){function l(){var r=e.call(this,i,"#document",null,null)||this;return r.documentElement=null,r}return f(l,e),l.prototype.clear=function(){m.recycle(this.documentElement),this.documentElement=null},l.prototype.appendChild=function(r){e.prototype.appendChild.call(this,r),this.documentElement=this.childNodes[0]},l.prototype.createElement=function(e){return m.create(r,e,null,this)},l.prototype.createElementNS=function(e,t){return m.create(r,t,null,this,e)},l.prototype.createDocumentFragment=function(){return m.create(s,"#document-fragment",null,this)},l.prototype.createTextNode=function(e){return m.create(a,"#text",e,this)},l.prototype.createTransformedTextNode=function(e){var r=m.create(a,"#text",e,this);return r.transformedNodeValue=e,r},l.prototype.createAttribute=function(e){return m.create(t,e,null,this)},l.prototype.createAttributeNS=function(e,r){return m.create(t,r,null,this,e)},l.prototype.createComment=function(e){return m.create(n,"#comment",e,this)},l.prototype.createCDATASection=function(e){return m.create(o,"#cdata-section",e,this)},l.prototype.createDTDSection=function(e){return m.create(10,"#dtd-section",e,this)},l}(m),v="[ \t\r\n]+",y="(".concat(v,")?=(").concat(v,")?"),x="&#[0-9]+;|&#x[0-9a-fA-F]+;",w="".concat(v,"version").concat(y,"(\"1\\.0\"|'1\\.0')"),E="̀-͠ͅ-҃͡-֑҆-֣֡-ֹֻ-ֽֿׁ-ׂًׄ-ْٰۖ-ۜ۝-۟۠-ۤۧ-۪ۨ-ۭँ-ः़ा-ौ्॑-॔ॢ-ॣঁ-ঃ়ািী-ৄে-ৈো-্ৗৢ-ৣਂ਼ਾਿੀ-ੂੇ-ੈੋ-੍ੰ-ੱઁ-ઃ઼ા-ૅે-ૉો-્ଁ-ଃ଼ା-ୃେ-ୈୋ-୍ୖ-ୗஂ-ஃா-ூெ-ைொ-்ௗఁ-ఃా-ౄె-ైొ-్ౕ-ౖಂ-ಃಾ-ೄೆ-ೈೊ-್ೕ-ೖം-ഃാ-ൃെ-ൈൊ-്ൗัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-༹༙༵༷༾༿ཱ-྄྆-ྋྐ-ྕྗྙ-ྭྱ-ྷྐྵ⃐-〪⃜⃡-゙゚〯",N="0-9٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩",D="·ːˑ·ـๆໆ々〱-〵ゝ-ゞー-ヾ",q="A-Za-zÀ-ÖØ-öø-ÿĀ-ıĴ-ľŁ-ňŊ-žƀ-ǃǍ-ǰǴ-ǵǺ-ȗɐ-ʨʻ-ˁΆΈ-ΊΌΎ-ΡΣ-ώϐ-ϖϚϜϞϠϢ-ϳЁ-ЌЎ-яё-ќў-ҁҐ-ӄӇ-ӈӋ-ӌӐ-ӫӮ-ӵӸ-ӹԱ-Ֆՙա-ֆא-תװ-ײء-غف-يٱ-ڷں-ھۀ-ێې-ۓەۥ-ۦअ-हऽक़-ॡঅ-ঌএ-ঐও-নপ-রলশ-হড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઋઍએ-ઑઓ-નપ-રલ-ળવ-હઽૠଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଶ-ହଽଡ଼-ଢ଼ୟ-ୡஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-வஷ-ஹఅ-ఌఎ-ఐఒ-నప-ళవ-హౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹൠ-ൡก-ฮะา-ำเ-ๅກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ຮະາ-ຳຽເ-ໄཀ-ཇཉ-ཀྵႠ-Ⴥა-ჶᄀᄂ-ᄃᄅ-ᄇᄉᄋ-ᄌᄎ-ᄒᄼᄾᅀᅌᅎᅐᅔ-ᅕᅙᅟ-ᅡᅣᅥᅧᅩᅭ-ᅮᅲ-ᅳᅵᆞᆨᆫᆮ-ᆯᆷ-ᆸᆺᆼ-ᇂᇫᇰᇹḀ-ẛẠ-ỹἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼΩK-Å℮ↀ-ↂぁ-ゔァ-ヺㄅ-ㄬ가-힣一-龥〇〡-〩",k="".concat(q+N,"\\._:").concat(E).concat(D,"-"),A="[".concat(q,"_:][").concat(k,"]*"),S="&".concat(A,";"),L="".concat(S,"|").concat(x),T='"(([^<&"]|'.concat(L,")*)\"|'(([^<&']|").concat(L,")*)'"),C="(".concat(A,")").concat(y,"(").concat(T,")"),V="".concat(v,"version").concat(y,"(\"1\\.1\"|'1\\.1')"),P=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�",R=P+"\\.0-9·̀-ͯ‿-⁀-",F="[".concat(P,"][").concat(R,"]*"),B="&".concat(F,";"),U="".concat(B,"|").concat(x),O='"(([^<&"]|'.concat(U,")*)\"|'(([^<&']|").concat(U,")*)'"),I="(".concat(F,")").concat(y,"(").concat(O,")"),G="".concat(q+N,"\\._").concat(E).concat(D,"-"),H="[".concat(q,"_][").concat(G,"]*"),M=new RegExp("^(".concat(A,")")),z=new RegExp(C,"g"),j=new RegExp("^(".concat(F,")")),_=new RegExp(I,"g");function X(e,r){return e.getAttributeValue(r)}function J(e,r,t){return e.setAttribute(r,t)}function Y(e,r,t){return e.setTransformedAttribute(r,t)}function Z(e,r){return e.appendChild(r)}function W(e,r){return e.appendTransformedChild(r)}function K(e,r){return e.createTextNode(r)}function Q(e,r){return e.createTransformedTextNode(r)}function $(e,r){return e.createElement(r)}function ee(e,r){return e.createCDATASection(r)}function re(e,r){return e.createComment(r)}function te(e){return e.createDocumentFragment()}function ae(e,n){if(void 0===n&&(n=!1),!e)return"";var l="";if(e.nodeType==a||e.nodeType==o)l+=e.nodeValue;else if(e.nodeType==t)l+=e.nodeValue;else if(e.nodeType==r||e.nodeType==i||e.nodeType==s){if(!n){var u=e.innerText;if(null!=u)return u;var c=e.textContent;if(null!=c)return c}if(e.transformedChildNodes.length>0)for(var p=0;p<e.transformedChildNodes.length;++p)l+=ae(e.transformedChildNodes[p]);else for(p=0;p<e.childNodes.length;++p)l+=ae(e.childNodes[p])}return l}function oe(e,t,l){if(!e.visited){var u=e.transformedNodeType||e.nodeType,c=e.transformedNodeValue||e.nodeValue;if(u==a){if(e.transformedNodeValue&&""!==e.transformedNodeValue.trim()){var p=e.escape&&l.escape?ie(e.transformedNodeValue):e.transformedNodeValue;t.push(p)}}else if(u==o)l.cData?t.push(c):t.push("<![CDATA[".concat(c,"]]>"));else if(u==n)t.push("\x3c!-- ".concat(c," --\x3e"));else if(u==r)null!==e.transformedNodeName&&void 0!==e.transformedNodeName?function(e,r,t){r.push("<".concat(ne(e)));for(var a=e.transformedAttributes||e.attributes,o=0;o<a.length;++o){var n=a[o];n&&(n.transformedNodeName&&n.transformedNodeValue&&r.push(" ".concat(ne(n),'="').concat(se(n.transformedNodeValue),'"')))}var i=e.transformedChildNodes.length>0?e.transformedChildNodes:e.childNodes;if(i=i.sort((function(e,r){return e.siblingPosition-r.siblingPosition})),0===i.length)t.selfClosingTags?r.push("/>"):r.push("></".concat(ne(e),">"));else{r.push(">");for(o=0;o<i.length;++o)oe(i[o],r,t);r.push("</".concat(ne(e),">"))}}(e,t,l):function(e,r,t){var a=e.transformedChildNodes.length>0?e.transformedChildNodes:e.childNodes;a=a.sort((function(e,r){return e.siblingPosition-r.siblingPosition}));for(var o=0;o<a.length;++o)oe(a[o],r,t)}(e,t,l);else if(u==i||u==s){var h=e.transformedChildNodes.concat(e.childNodes);h.sort((function(e,r){return e.siblingPosition-r.siblingPosition}));for(var d=0;d<h.length;++d)oe(h[d],t,l)}e.visited=!0}}function ne(e){var r=e.transformedNodeName||e.nodeName;return e.transformedPrefix&&0!=r.indexOf("".concat(e.transformedPrefix,":"))?"".concat(e.transformedPrefix,":").concat(r):r}function ie(e){return"".concat(e).replace(/&/g,"&amp;").replace(/&amp;amp;/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function se(e){return ie(e).replace(/"/g,"&quot;")}function le(e,r){var t=X(e,r);return t?c.decode(t):t}var ue=function(){function e(e){this.value=e,this.type="node-set"}return e.prototype.stringValue=function(){return 0===this.value.length?"":ae(this.value[0])},e.prototype.booleanValue=function(){return this.value.length>0},e.prototype.numberValue=function(){return this.stringValue()-0},e.prototype.nodeSetValue=function(){return this.value},e}(),ce=function(){function e(e){this.value=e,this.type="number"}return e.prototype.stringValue=function(){return"".concat(this.value)},e.prototype.booleanValue=function(){return!!this.value},e.prototype.numberValue=function(){return this.value-0},e.prototype.nodeSetValue=function(){throw this},e}(),pe=function(){function e(e){this.value=e,this.type="string"}return e.prototype.stringValue=function(){return this.value},e.prototype.booleanValue=function(){return this.value.length>0},e.prototype.numberValue=function(){return this.value-0},e.prototype.nodeSetValue=function(){throw this},e}(),he={ANCESTOR_OR_SELF:"ancestor-or-self",ANCESTOR:"ancestor",ATTRIBUTE:"attribute",CHILD:"child",DESCENDANT_OR_SELF:"descendant-or-self",DESCENDANT:"descendant",FOLLOWING_SIBLING:"following-sibling",FOLLOWING:"following",NAMESPACE:"namespace",PARENT:"parent",PRECEDING_SIBLING:"preceding-sibling",PRECEDING:"preceding",SELF:"self",SELF_AND_SIBLINGS:"self-and-siblings"},de=[he.ANCESTOR_OR_SELF,he.ANCESTOR,he.ATTRIBUTE,he.CHILD,he.DESCENDANT_OR_SELF,he.DESCENDANT,he.FOLLOWING_SIBLING,he.FOLLOWING,he.NAMESPACE,he.PARENT,he.PRECEDING_SIBLING,he.PRECEDING,he.SELF].join("(?=::)|")+"(?=::)",ge={label:"|",prec:17,re:new RegExp("^\\|"),key:void 0},fe={label:"//",prec:19,re:new RegExp("^//"),key:void 0},me={label:"/",prec:30,re:new RegExp("^/"),key:void 0},be={label:"::",prec:20,re:new RegExp("^::"),key:void 0},ve={label:":",prec:1e3,re:new RegExp("^:"),key:void 0},ye={label:"[axis]",re:new RegExp("^(".concat(de,")")),key:void 0},xe={label:"(",prec:34,re:new RegExp("^\\("),key:void 0},we={label:")",re:new RegExp("^\\)"),key:void 0},Ee={label:"..",prec:34,re:new RegExp("^\\.\\."),key:void 0},Ne={label:".",prec:34,re:new RegExp("^\\."),key:void 0},De={label:"@",prec:34,re:new RegExp("^@"),key:void 0},qe={label:",",re:new RegExp("^,"),key:void 0},ke={label:"or",prec:10,re:new RegExp("^or\\b"),key:void 0},Ae={label:"and",prec:11,re:new RegExp("^and\\b"),key:void 0},Se={label:"=",prec:12,re:new RegExp("^="),key:void 0},Le={label:"!=",prec:12,re:new RegExp("^!="),key:void 0},Te={label:">=",prec:13,re:new RegExp("^>="),key:void 0},Ce={label:">",prec:13,re:new RegExp("^>"),key:void 0},Ve={label:"<=",prec:13,re:new RegExp("^<="),key:void 0},Pe={label:"<",prec:13,re:new RegExp("^<"),key:void 0},Re={label:"+",prec:14,re:new RegExp("^\\+"),left:!0,key:void 0},Fe={label:"-",prec:14,re:new RegExp("^\\-"),left:!0,key:void 0},Be={label:"div",prec:15,re:new RegExp("^div\\b"),left:!0,key:void 0},Ue={label:"mod",prec:15,re:new RegExp("^mod\\b"),left:!0,key:void 0},Oe={label:"[",prec:32,re:new RegExp("^\\["),key:void 0},Ie={label:"]",re:new RegExp("^\\]"),key:void 0},Ge={label:"$",re:new RegExp("^\\$"),key:void 0},He={label:"[ncname]",re:new RegExp("^".concat(H)),key:void 0},Me={label:"*",prec:15,re:new RegExp("^\\*"),left:!0,key:void 0},ze={label:"[litq]",prec:20,re:new RegExp("^'[^\\']*'"),key:void 0},je={label:"[litqq]",prec:20,re:new RegExp('^"[^\\"]*"'),key:void 0},_e={label:"[number]",prec:35,re:new RegExp("^\\d+(\\.\\d*)?"),key:void 0},Xe={label:"[qname]",re:new RegExp("^(".concat(H,":)?").concat(H)),key:void 0},Je={label:"[nodeTest-start]",re:new RegExp("^(processing-instruction|comment|text|node)\\("),key:void 0},Ye=[fe,me,Ee,Ne,be,ve,ye,Je,xe,we,Oe,Ie,De,qe,ke,Ae,Le,Se,Te,Ce,Ve,Pe,Re,Fe,Me,ge,Ue,Be,ze,je,_e,Xe,He,Ge],Ze={label:"?"},We={label:"*"},Ke={label:"+"},Qe=!0,$e=function(){function e(e,r,t,a,o,n,s,l,u,c,p,h,d){this.nodeList=e,this.outputNodeList=r,this.position=t||0,this.outputPosition=a||0,this.variables=s||{},this.knownNamespaces=l||{},this.parent=u||null,this.caseInsensitive=c||!1,this.ignoreAttributesWithoutValue=p||!1,this.returnOnFirstMatch=h||!1,this.ignoreNonElementNodesForNTA=d||!1,this.inApplyTemplates=!1,this.baseTemplateMatched=!1,this.outputDepth=o||0,this.decimalFormatSettings=n||{decimalSeparator:".",groupingSeparator:",",infinity:"Infinity",minusSign:"-",naN:"NaN",percent:"%",perMille:"‰",zeroDigit:"0",digit:"#",patternSeparator:";"},u?this.root=u.root:this.nodeList[this.position].nodeType==i?this.root=this.nodeList[this.position]:this.root=this.nodeList[this.position].ownerDocument}return e.prototype.clone=function(r,t,a,o){return new e(r||this.nodeList,t||this.outputNodeList,void 0!==a?a:this.position,void 0!==o?o:this.outputPosition,this.outputDepth,this.decimalFormatSettings,this.variables,this.knownNamespaces,this,this.caseInsensitive,this.ignoreAttributesWithoutValue,this.returnOnFirstMatch,this.ignoreNonElementNodesForNTA)},e.prototype.cloneByOutput=function(r,t,a){return new e(this.nodeList,r||this.outputNodeList,this.position,void 0!==t?t:this.outputPosition,void 0!==a?a:this.outputDepth,this.decimalFormatSettings,this.variables,this.knownNamespaces,this,this.caseInsensitive,this.ignoreAttributesWithoutValue,this.returnOnFirstMatch,this.ignoreNonElementNodesForNTA)},e.prototype.setVariable=function(e,r){r instanceof pe||r instanceof l||r instanceof ce||r instanceof ue?this.variables[e]=r:"true"===r?this.variables[e]=new l(!0):"false"===r?this.variables[e]=new l(!1):_e.re.test(r)?this.variables[e]=new ce(r):this.variables[e]=new pe(r)},e.prototype.getVariable=function(e){return void 0!==this.variables[e]?this.variables[e]:this.parent?this.parent.getVariable(e):null},e.prototype.setNode=function(e){this.position=e},e.prototype.contextSize=function(){return this.nodeList.length},e.prototype.isCaseInsensitive=function(){return this.caseInsensitive},e.prototype.setCaseInsensitive=function(e){return this.caseInsensitive=e},e.prototype.isIgnoreAttributesWithoutValue=function(){return this.ignoreAttributesWithoutValue},e.prototype.setIgnoreAttributesWithoutValue=function(e){return this.ignoreAttributesWithoutValue=e},e.prototype.isReturnOnFirstMatch=function(){return this.returnOnFirstMatch},e.prototype.setReturnOnFirstMatch=function(e){return this.returnOnFirstMatch=e},e.prototype.isIgnoreNonElementNodesForNTA=function(){return this.ignoreNonElementNodesForNTA},e.prototype.setIgnoreNonElementNodesForNTA=function(e){return this.ignoreNonElementNodesForNTA=e},e}();function er(e,r){if(r)for(var t=e.length,a=r.length-1;a>=0;--a)e[a+t]=r[a]}var rr=function(){},tr=function(e){function r(r,t,a){var o=e.call(this)||this;return o.expr1=r,o.expr2=a,o.op=t,o}return f(r,e),r.prototype.evaluate=function(e){var r;switch(this.op.value){case"or":r=new l(this.expr1.evaluate(e).booleanValue()||this.expr2.evaluate(e).booleanValue());break;case"and":r=new l(this.expr1.evaluate(e).booleanValue()&&this.expr2.evaluate(e).booleanValue());break;case"+":r=new ce(this.expr1.evaluate(e).numberValue()+this.expr2.evaluate(e).numberValue());break;case"-":r=new ce(this.expr1.evaluate(e).numberValue()-this.expr2.evaluate(e).numberValue());break;case"*":r=new ce(this.expr1.evaluate(e).numberValue()*this.expr2.evaluate(e).numberValue());break;case"mod":r=new ce(this.expr1.evaluate(e).numberValue()%this.expr2.evaluate(e).numberValue());break;case"div":r=new ce(this.expr1.evaluate(e).numberValue()/this.expr2.evaluate(e).numberValue());break;case"=":r=this.compare(e,(function(e,r){return e==r}));break;case"!=":r=this.compare(e,(function(e,r){return e!=r}));break;case"<":r=this.compare(e,(function(e,r){return e<r}));break;case"<=":r=this.compare(e,(function(e,r){return e<=r}));break;case">":r=this.compare(e,(function(e,r){return e>r}));break;case">=":r=this.compare(e,(function(e,r){return e>=r}));break;default:throw"BinaryExpr.evaluate: ".concat(this.op.value)}return r},r.prototype.compare=function(e,r){var t,a=this.expr1.evaluate(e),o=this.expr2.evaluate(e);if("node-set"==a.type&&"node-set"==o.type){var n=a.nodeSetValue(),i=o.nodeSetValue();t=!1;for(var s=0;s<n.length;++s)for(var u=0;u<i.length;++u)r(ae(n[s]),ae(i[u]))&&(t=!0,u=i.length,s=n.length)}else if("node-set"==a.type||"node-set"==o.type)if("number"==a.type){var c=a.numberValue(),p=o.nodeSetValue();t=!1;for(var h=0;h<p.length;++h){if(r(c,ae(p[h])-0)){t=!0;break}}}else if("number"==o.type){p=a.nodeSetValue(),c=o.numberValue();t=!1;for(h=0;h<p.length;++h){if(r(ae(p[h])-0,c)){t=!0;break}}}else if("string"==a.type){c=a.stringValue(),p=o.nodeSetValue();t=!1;for(h=0;h<p.length;++h){if(r(c,ae(p[h]))){t=!0;break}}}else if("string"==o.type){p=a.nodeSetValue(),c=o.stringValue();t=!1;for(h=0;h<p.length;++h){if(r(ae(p[h]),c)){t=!0;break}}}else t=r(a.booleanValue(),o.booleanValue());else t="boolean"==a.type||"boolean"==o.type?r(a.booleanValue(),o.booleanValue()):"number"==a.type||"number"==o.type?r(a.numberValue(),o.numberValue()):r(a.stringValue(),o.stringValue());return new l(t)},r}(rr),ar=function(e){function r(r,t){var a=e.call(this)||this;return a.expr=r,a.predicate=t,a}return f(r,e),r.prototype.evaluate=function(e){var r=e.returnOnFirstMatch;e.setReturnOnFirstMatch(!1);var t=this.expr.evaluate(e).nodeSetValue();e.setReturnOnFirstMatch(r);for(var a=0;a<this.predicate.length;++a){var o=t;t=[];for(var n=0;n<o.length;++n){var i=o[n];this.predicate[a].evaluate(e.clone(o,void 0,n)).booleanValue()&&t.push(i)}}return new ue(t)},r}(rr);function or(e){if(!e)throw new Error("Assertion failed")}var nr=new RegExp("(\\".concat(["/",".","*","+","?","|","^","$","(",")","[","]","{","}","\\"].join("|\\"),")"),"g");function ir(e){or(this.args.length>=1);for(var r=this.args[0].evaluate(e).numberValue(),t=[],a=0;a<r;++a)t.push(e.nodeList[e.position]);return new ue(t)}function sr(e){return or(3===this.args.length),this.args[0].evaluate(e).booleanValue()?this.args[1].evaluate(e):this.args[2].evaluate(e)}function lr(e){or(2===this.args.length);for(var r=this.args[0].evaluate(e).nodeSetValue(),t=this.args[1].evaluate(e).stringValue(),a="",o=0;o<r.length;++o)a&&(a+=t),a+=ae(r[o]);return new pe(a)}function ur(e){return or(1===this.args.length),new l(this.args[0].evaluate(e).booleanValue())}function cr(e){or(1===this.args.length);var r=this.args[0].evaluate(e).numberValue();return new ce(Math.ceil(r))}function pr(e){for(var r="",t=0;t<this.args.length;++t)r+=this.args[t].evaluate(e).stringValue();return new pe(r)}function hr(e){or(2===this.args.length);var r=this.args[0].evaluate(e).stringValue(),t=this.args[1].evaluate(e).stringValue();return new l(r.includes(t))}function dr(e){or(1===this.args.length);var r=this.args[0].evaluate(e);return new ce(r.nodeSetValue().length)}function gr(e){return or(0===this.args.length),new ue([e.nodeList[e.position]])}function fr(e){or(2===this.args.length);var r=this.args[0].evaluate(e).stringValue(),t=this.args[1].evaluate(e).stringValue(),a=new RegExp("".concat(t.replace(nr,"\\$1"),"$"));return new l(a.test(r))}function mr(){return or(0===this.args.length),new l(!1)}function br(e,r,t){for(var a="",o=e.length-1,n=r.length-1;n>=0;n--)switch(r[n]){case"#":case"0":a=e[o]+a,o--;break;case",":a=t.groupingSeparator+a}for(;o>=0;o--)a=e[o]+a;return a}function vr(e){or(this.args.length>=2&&this.args.length<4);var r=this.args[0].evaluate(e).stringValue(),t=this.args[1].evaluate(e).stringValue(),a=parseFloat(r);if(isNaN(a))return new pe(e.decimalFormatSettings.naN);var o=String(a).split("."),n=t.split(".");switch(o.length){case 1:return new pe(br(o[0],n[0],e.decimalFormatSettings));case 2:var i=function(e,r,t){var a="";if(null==r)return a;for(var o=0;o<r.length;o++)switch(r[o]){case"#":a+=e[o];break;case"0":o>=e.length?a+="0":a+=e[o]}return a}(o[1],2===n.length?n[1]:void 0,e.decimalFormatSettings);return 0===i.length?new pe(br(o[0],n[0],e.decimalFormatSettings)):new pe(br(o[0],n[0],e.decimalFormatSettings)+e.decimalFormatSettings.decimalSeparator+i)}}function yr(e){or(1===this.args.length);var r=this.args[0].evaluate(e).numberValue();return new ce(Math.floor(r))}function xr(e){return new pe("A"+function(e,r){void 0===r&&(r=0);for(var t=3735928559^r,a=1103547991^r,o=0,n=void 0;o<e.length;o++)n=e.charCodeAt(o),t=Math.imul(t^n,2654435761),a=Math.imul(a^n,1597334677);return t=Math.imul(t^t>>>16,2246822507),t^=Math.imul(a^a>>>13,3266489909),a=Math.imul(a^a>>>16,2246822507),4294967296*(2097151&(a^=Math.imul(t^t>>>13,3266489909)))+(t>>>0)}(JSON.stringify(e.nodeList[e.position].id)))}function wr(e){or(1===this.args.length);var r,t=this.args[0].evaluate(e),a=[];if("node-set"==t.type){r=[];for(var o=t.nodeSetValue(),n=0;n<o.length;++n)for(var i=ae(o[n]).split(/\s+/),s=0;s<i.length;++s)r.push(i[s])}else r=t.stringValue().split(/\s+/);var l=e.root;for(n=0;n<r.length;++n){var u=l.getElementById(r[n]);u&&a.push(u)}return new ue(a)}function Er(e){or(1===this.args.length);for(var r,t=this.args[0].evaluate(e).stringValue(),a=e.nodeList[e.position];a&&a!=a.parentNode&&!(r=a.getAttributeValue("xml:lang"));)a=a.parentNode;if(!r)return new l(!1);var o=new RegExp("^".concat(t,"$"),"i");return new l(r.match(o)||r.replace(/_.*$/,"").match(o))}function Nr(e){return or(0===this.args.length),new ce(e.contextSize())}function Dr(e){var r;return or(1===this.args.length||0===this.args.length),0===(r=0==this.args.length?[e.nodeList[e.position]]:this.args[0].evaluate(e).nodeSetValue()).length?new pe(""):new pe(r[0].localName)}function qr(e){or(this.args.length>=2);var r,t,a=this.args[0].evaluate(e).stringValue(),o=this.args[1].evaluate(e).stringValue();if(this.args.length>2&&(r=this.args[2].evaluate(e).stringValue(),/[^mi]/.test(r)))throw new Error("Invalid regular expression syntax: ".concat(r));try{t=new RegExp(o,r)}catch(e){throw new Error("Invalid matches argument: ".concat(o))}return new l(t.test(a))}function kr(e){var r;return or(1===this.args.length||0===this.args.length),0===(r=0===this.args.length?[e.nodeList[e.position]]:this.args[0].evaluate(e).nodeSetValue()).length?new pe(""):new pe(r[0].nodeName)}function Ar(e){var r;return or(1===this.args.length||0===this.args.length),0===(r=0===this.args.length?[e.nodeList[e.position]]:this.args[0].evaluate(e).nodeSetValue()).length?new pe(""):new pe(r[0].namespaceUri||"")}function Sr(e){var r;return r=(r=this.args.length>0?this.args[0].evaluate(e).stringValue():new ue([e.nodeList[e.position]]).stringValue()).replace(/^\s*/,"").replace(/\s*$/,"").replace(/\s+/g," "),new pe(r)}function Lr(e){or(1===this.args.length);var r=!this.args[0].evaluate(e).booleanValue();return new l(r)}function Tr(e){return or(1===this.args.length||0===this.args.length),1===this.args.length?new ce(this.args[0].evaluate(e).numberValue()):new ce(new ue([e.nodeList[e.position]]).numberValue())}function Cr(e){return or(0===this.args.length),new ce(e.position+1)}function Vr(e){or(1===this.args.length);var r=this.args[0].evaluate(e).numberValue();return new ce(Math.round(r))}function Pr(e){or(2==this.args.length);var r=this.args[0].evaluate(e).stringValue(),t=this.args[1].evaluate(e).stringValue();return new l(0===r.indexOf(t))}function Rr(e){return or(1===this.args.length||0===this.args.length),0===this.args.length?new pe(new ue([e.nodeList[e.position]]).stringValue()):new pe(this.args[0].evaluate(e).stringValue())}function Fr(e){var r;return r=this.args.length>0?this.args[0].evaluate(e).stringValue():new ue([e.nodeList[e.position]]).stringValue(),new ce(r.length)}function Br(e){or(2===this.args.length||3===this.args.length);var r,t=this.args[0].evaluate(e).stringValue(),a=this.args[1].evaluate(e).numberValue();if(2===this.args.length){var o=Math.max(0,Math.round(a)-1);r=t.substr(o)}else{var n=this.args[2].evaluate(e).numberValue(),i=Math.round(a)-1,s=(o=Math.max(0,i),Math.round(n)-Math.max(0,-i));r=t.substr(o,s)}return new pe(r)}function Ur(e){or(2===this.args.length);var r,t=this.args[0].evaluate(e).stringValue(),a=this.args[1].evaluate(e).stringValue(),o=t.indexOf(a);return r=-1===o?"":t.substr(o+a.length),new pe(r)}function Or(e){or(2===this.args.length);var r,t=this.args[0].evaluate(e).stringValue(),a=this.args[1].evaluate(e).stringValue(),o=t.indexOf(a);return r=-1===o?"":t.substr(0,o),new pe(r)}function Ir(e){or(1===this.args.length);for(var r=this.args[0].evaluate(e).nodeSetValue(),t=0,a=0;a<r.length;++a)t+=ae(r[a])-0;return new ce(t)}function Gr(e){or(3===this.args.length);for(var r=this.args[0].evaluate(e).stringValue(),t=this.args[1].evaluate(e).stringValue(),a=this.args[2].evaluate(e).stringValue(),o=0;o<t.length;++o)r=r.replace(new RegExp(t.charAt(o),"g"),a.charAt(o));return new pe(r)}function Hr(){return or(0===this.args.length),new l(!0)}function Mr(e){return or(this.args.length<2),new pe(JSON.stringify(this.args.length?ae(e.nodeList[e.position]):"null"))}var zr=function(e){function r(r){var t=e.call(this)||this;return t.xPathFunctions={boolean:ur,ceiling:cr,concat:pr,contains:hr,count:dr,current:gr,"ends-with":fr,false:mr,"format-number":vr,floor:yr,"generate-id":xr,id:wr,lang:Er,last:Nr,"local-name":Dr,matches:qr,name:kr,"namespace-uri":Ar,"normalize-space":Sr,not:Lr,number:Tr,position:Cr,round:Vr,"starts-with":Pr,string:Rr,"xml-to-json":Mr,substring:Br,"substring-before":Or,"substring-after":Ur,sum:Ir,"string-length":Fr,translate:Gr,true:Hr,"ext-join":lr,"ext-if":sr,"ext-cardinal":ir},t.name=r,t.args=[],t}return f(r,e),r.prototype.appendArg=function(e){this.args.push(e)},r.prototype.evaluate=function(e){var r="".concat(this.name.value),t=this.xPathFunctions[r];return t?t.call(this,e):new l(!1)},r}(rr),jr=function(e){function r(r){var t=e.call(this)||this;return t.value=r,t}return f(r,e),r.prototype.evaluate=function(){return new pe(this.value)},r}(rr),_r=function(){function e(){this.value=new l(!0)}return e.prototype.evaluate=function(){return this.value},e}(),Xr=function(e){function r(r){var t=e.call(this)||this;return t.absolute=!1,t.steps=[],t.xPath=r,t}return f(r,e),r.prototype.appendStep=function(e){var r=this._combineSteps(this.steps[this.steps.length-1],e);r?this.steps[this.steps.length-1]=r:this.steps.push(e)},r.prototype.prependStep=function(e){var r=this._combineSteps(e,this.steps[0]);r?this.steps[0]=r:this.steps.unshift(e)},r.prototype._combineSteps=function(e,r){if(!e)return null;if(!r)return null;var t=e.predicates&&e.predicates.length>0;if(e.nodeTest instanceof _r&&!t)if(e.axis==he.DESCENDANT_OR_SELF){if(r.axis==he.CHILD);else if(r.axis==he.SELF)return r.axis=he.DESCENDANT_OR_SELF,r}else if(e.axis==he.DESCENDANT&&r.axis==he.SELF)return r.axis=he.DESCENDANT,r;return null},r.prototype.evaluate=function(e){var r;r=this.absolute?e.root:e.nodeList[e.position];var t=[];return this.xPath.xPathStep(t,this.steps,0,r,e),new ue(t)},r}(rr),Jr=function(e){function r(r){var t=e.call(this)||this;return t.value=r,t}return f(r,e),r.prototype.evaluate=function(){return new ce(this.value)},r}(rr),Yr=function(e){function r(r,t){var a=e.call(this)||this;return a.filter=r,a.rel=t,a}return f(r,e),r.prototype.evaluate=function(e){var r=this.filter.evaluate(e).nodeSetValue(),t=[];if(e.returnOnFirstMatch){for(var a=0;a<r.length&&!((t=this.rel.evaluate(e.clone(r,void 0,a)).nodeSetValue()).length>0);++a);return new ue(t)}for(a=0;a<r.length;++a)for(var o=this.rel.evaluate(e.clone(r,void 0,a)).nodeSetValue(),n=0;n<o.length;++n)t.push(o[n]);return new ue(t)},r}(rr),Zr=function(e){function r(r){var t=e.call(this)||this;return t.expr=r,t}return f(r,e),r.prototype.evaluate=function(e){var r=this.expr.evaluate(e);return"number"==r.type?new l(e.position==r.numberValue()-1):new l(r.booleanValue())},r}(rr),Wr=function(e){function r(r){var t=e.call(this)||this;return t.expr=r,t}return f(r,e),r.prototype.evaluate=function(e){return new ce(-this.expr.evaluate(e).numberValue())},r}(rr),Kr=function(e){function r(r,t,a,o){var n=e.call(this)||this;n.axis=r,n.nodeTest=t,n.predicate=o||[],n.hasPositionalPredicate=!1,n.xPath=a;for(var i=0;i<n.predicate.length;++i)if(n.predicateExprHasPositionalSelector(n.predicate[i].expr)){n.hasPositionalPredicate=!0;break}return n}return f(r,e),r.prototype.predicateExprHasPositionalSelector=function(e,r){if(!e)return!1;if(!r&&this.exprReturnsNumberValue(e))return!0;if(e instanceof zr){var t=e.name.value;return"last"==t||"position"==t}return e instanceof tr&&(this.predicateExprHasPositionalSelector(e.expr1,!0)||this.predicateExprHasPositionalSelector(e.expr2,!0))},r.prototype.exprReturnsNumberValue=function(e){return e instanceof zr?{last:!0,position:!0,count:!0,"string-length":!0,number:!0,sum:!0,floor:!0,ceiling:!0,round:!0}[e.name.value]:e instanceof Wr||(e instanceof tr?{"+":!0,"-":!0,"*":!0,mod:!0,div:!0}[e.op.value]:e instanceof Jr)},r.prototype.appendPredicate=function(e){this.predicate.push(e),this.hasPositionalPredicate||(this.hasPositionalPredicate=this.predicateExprHasPositionalSelector(e.expr))},r.prototype.evaluate=function(e){var r=e.nodeList[e.position],a=[],o=!1;switch(this.nodeTest instanceof _r&&(o=!0),this.axis){case he.ANCESTOR_OR_SELF:a.push(r);for(var n=r.parentNode;n;n=n.parentNode)a.push(n);break;case he.ANCESTOR:for(n=r.parentNode;n;n=n.parentNode)a.push(n);break;case he.ATTRIBUTE:if(null!=this.nodeTest.name){if(r.attributes)if(r.attributes instanceof Array)er(a,r.attributes);else if("style"==this.nodeTest.name){var i=r.getAttributeValue("style");i&&"string"!=typeof i?a.push(m.create(t,"style",i.cssText,document)):a.push(r.attributes[this.nodeTest.name])}else a.push(r.attributes[this.nodeTest.name])}else e.ignoreAttributesWithoutValue?function(e,r){if(r)for(var t=r.length-1;t>=0;--t)r[t].nodeValue&&e.push(r[t])}(a,r.attributes):er(a,r.attributes);break;case he.CHILD:er(a,r.childNodes);break;case he.DESCENDANT_OR_SELF:this.nodeTest.evaluate(e).booleanValue()&&a.push(r);var s=this.xPath.xPathExtractTagNameFromNodeTest(this.nodeTest,e.ignoreNonElementNodesForNTA);this.xPath.xPathCollectDescendants(a,r,s),s&&(o=!0);break;case he.DESCENDANT:s=this.xPath.xPathExtractTagNameFromNodeTest(this.nodeTest,e.ignoreNonElementNodesForNTA);this.xPath.xPathCollectDescendants(a,r,s),s&&(o=!0);break;case he.FOLLOWING:for(n=r;n;n=n.parentNode)for(var l=n.nextSibling;l;l=l.nextSibling)a.push(l),this.xPath.xPathCollectDescendants(a,l);break;case he.FOLLOWING_SIBLING:for(n=r.nextSibling;n;n=n.nextSibling)a.push(n);break;case he.NAMESPACE:throw new Error("not implemented: axis namespace");case he.PARENT:r.parentNode&&a.push(r.parentNode);break;case he.PRECEDING:for(n=r;n;n=n.parentNode)for(l=n.previousSibling;l;l=l.previousSibling)a.push(l),this.xPath.xPathCollectDescendantsReverse(a,l);break;case he.PRECEDING_SIBLING:for(n=r.previousSibling;n;n=n.previousSibling)a.push(n);break;case he.SELF:a.push(r);break;case he.SELF_AND_SIBLINGS:for(var u=0,c=e.nodeList;u<c.length;u++){var p=c[u];a.push(p)}break;default:throw new Error("ERROR -- NO SUCH AXIS: ".concat(this.axis))}if(!o){var h=a;a=[];for(var d=0;d<h.length;++d)this.nodeTest.evaluate(e.clone(h,void 0,d)).booleanValue()&&a.push(h[d])}if(!e.returnOnFirstMatch)for(d=0;d<this.predicate.length;++d){h=a;a=[];for(var g=0;g<h.length;++g){n=h[g];this.predicate[d].evaluate(e.clone(h,void 0,g)).booleanValue()&&a.push(n)}}return new ue(a)},r}(rr),Qr=function(e){function r(r){var t=e.call(this)||this;return t.value=r,t}return f(r,e),r.prototype.evaluate=function(){return new pe(this.value)},r}(rr),$r=function(e){function r(r,t){var a=e.call(this)||this;return a.expr1=r,a.expr2=t,a}return f(r,e),r.prototype.evaluate=function(e){for(var r=this.expr1.evaluate(e).nodeSetValue(),t=this.expr2.evaluate(e).nodeSetValue(),a=r.length,o=0,n=t;o<n.length;o++){for(var i=n[o],s=!1,l=0;l<a;++l)r[l]==i&&(s=!0,l=a);s||r.push(i)}return new ue(r)},r}(rr),et=function(e){function r(r){var t=e.call(this)||this;return t.name=r,t}return f(r,e),r.prototype.evaluate=function(e){return e.getVariable(this.name)},r}(rr),rt={label:"LocationPath",key:void 0},tt={label:"RelativeLocationPath",key:void 0},at={label:"AbsoluteLocationPath",key:void 0},ot={label:"Step",key:void 0},nt={label:"NodeTest",key:void 0},it={label:"Predicate",key:void 0},st={label:"Literal",key:void 0},lt={label:"Expr",key:void 0},ut={label:"PrimaryExpr",key:void 0},ct={label:"Variablereference",key:void 0},pt={label:"Number",key:void 0},ht={label:"FunctionCall",key:void 0},dt={label:"ArgumentRemainder",key:void 0},gt={label:"PathExpr",key:void 0},ft={label:"UnionExpr",key:void 0},mt={label:"FilterExpr",key:void 0},bt={label:"Digits",key:void 0},vt=function(){function e(){}return e.prototype.evaluate=function(e){return new l(e.nodeList[e.position].nodeType==n)},e}(),yt=function(){function e(){}return e.prototype.evaluate=function(e){var a=e.nodeList[e.position];return new l(a.nodeType==r||a.nodeType==t)},e}(),xt=function(){function e(e){if(this.name=e,e.indexOf(":")>0){var r=e.split(":");this.namespacePrefix=r[0],this.name=r[1]}this.re=new RegExp("^".concat(e,"$"),"i")}return e.prototype.evaluate=function(e){var r=e.nodeList[e.position];return void 0!==this.namespacePrefix?e.knownNamespaces[this.namespacePrefix]!==r.namespaceUri?new l(!1):e.caseInsensitive?r.localName.length!==this.name.length?new l(!1):new l(this.re.test(r.localName)):new l(r.localName===this.name):e.caseInsensitive?r.nodeName.length!==this.name.length?new l(!1):new l(this.re.test(r.nodeName)):new l(r.nodeName===this.name)},e}(),wt=function(){function e(e){this.regex=new RegExp("^".concat(e,":")),this.nsprefix=e}return e.prototype.evaluate=function(e){var r=e.nodeList[e.position];return new l(r.nodeName.match(this.regex))},e}(),Et=function(){function e(e){this.target=e}return e.prototype.evaluate=function(e){var r=e.nodeList[e.position];return new l(7==r.nodeType&&(!this.target||r.nodeName==this.target))},e}(),Nt=function(){function e(){}return e.prototype.evaluate=function(e){return new l(e.nodeList[e.position].nodeType==a)},e}(),Dt=function(){function e(){this.xPathGrammarRules=[[rt,[tt],18,this.passExpr],[rt,[at],18,this.passExpr],[at,[me,tt],18,this.makeLocationExpr1],[at,[fe,tt],18,this.makeLocationExpr2],[at,[me],0,this.makeLocationExpr3],[at,[fe],0,this.makeLocationExpr4],[tt,[ot],31,this.makeLocationExpr5],[tt,[tt,me,ot],31,this.makeLocationExpr6],[tt,[tt,fe,ot],31,this.makeLocationExpr7],[ot,[Ne],33,this.makeStepExpr1],[ot,[Ee],33,this.makeStepExpr2],[ot,[ye,be,nt],33,this.makeStepExpr3],[ot,[De,nt],33,this.makeStepExpr4],[ot,[nt],33,this.makeStepExpr5],[ot,[ot,it],33,this.makeStepExpr6],[nt,[Me],33,this.makeNodeTestExpr1],[nt,[He,ve,Me],33,this.makeNodeTestExpr2],[nt,[Xe],33,this.makeNodeTestExpr3],[nt,[Je,we],33,this.makeNodeTestExpr4],[nt,[Je,st,we],33,this.makeNodeTestExpr5],[it,[Oe,lt,Ie],33,this.makePredicateExpr],[ut,[ct],33,this.passExpr],[ut,[xe,lt,we],33,this.makePrimaryExpr],[ut,[st],30,this.passExpr],[ut,[pt],30,this.passExpr],[ut,[ht],31,this.passExpr],[ht,[Xe,xe,we],-1,this.makeFunctionCallExpr1],[ht,[Xe,xe,lt,dt,We,we],-1,this.makeFunctionCallExpr2],[dt,[qe,lt],-1,this.makeArgumentExpr],[ft,[gt],20,this.passExpr],[ft,[ft,ge,gt],20,this.makeUnionExpr],[gt,[rt],20,this.passExpr],[gt,[mt],19,this.passExpr],[gt,[mt,me,tt],19,this.makePathExpr1],[gt,[mt,fe,tt],19,this.makePathExpr2],[mt,[ut,it,We],31,this.makeFilterExpr],[lt,[ut],16,this.passExpr],[lt,[ft],16,this.passExpr],[lt,[Fe,lt],-1,this.makeUnaryMinusExpr],[lt,[lt,ke,lt],-1,this.makeBinaryExpr],[lt,[lt,Ae,lt],-1,this.makeBinaryExpr],[lt,[lt,Se,lt],-1,this.makeBinaryExpr],[lt,[lt,Le,lt],-1,this.makeBinaryExpr],[lt,[lt,Pe,lt],-1,this.makeBinaryExpr],[lt,[lt,Ve,lt],-1,this.makeBinaryExpr],[lt,[lt,Ce,lt],-1,this.makeBinaryExpr],[lt,[lt,Te,lt],-1,this.makeBinaryExpr],[lt,[lt,Re,lt],-1,this.makeBinaryExpr,Qe],[lt,[lt,Fe,lt],-1,this.makeBinaryExpr,Qe],[lt,[lt,Me,lt],-1,this.makeBinaryExpr,Qe],[lt,[lt,Be,lt],-1,this.makeBinaryExpr,Qe],[lt,[lt,Ue,lt],-1,this.makeBinaryExpr,Qe],[st,[ze],-1,this.makeLiteralExpr],[st,[je],-1,this.makeLiteralExpr],[pt,[_e],-1,this.makeNumberExpr],[ct,[Ge,Xe],200,this.makeVariableReference]],this.xPathParseCache={},this.xPathRules=[],this.xPathLog=function(){},this.lexerCount=0,this.parseCount=0,this.reduceCount=0}return e.prototype.makeTokenExpr=function(e){return new Qr(e)},e.prototype.passExpr=function(e){return e},e.prototype.makeLocationExpr1=function(e,r){return r.absolute=!0,r},e.prototype.makeLocationExpr2=function(e,r){return r.absolute=!0,r.prependStep(this.makeAbbrevStep(e.value)),r},e.prototype.makeLocationExpr3=function(){var e=new Xr(this);return e.appendStep(this.makeAbbrevStep(".")),e.absolute=!0,e},e.prototype.makeLocationExpr4=function(e){var r=new Xr(this);return r.absolute=!0,r.appendStep(this.makeAbbrevStep(e.value)),r},e.prototype.makeLocationExpr5=function(e){var r=new Xr(this);return r.appendStep(e),r},e.prototype.makeLocationExpr6=function(e,r,t){return e.appendStep(t),e},e.prototype.makeLocationExpr7=function(e,r,t){return e.appendStep(this.makeAbbrevStep(r.value)),e.appendStep(t),e},e.prototype.makeStepExpr1=function(e){return this.makeAbbrevStep(e.value)},e.prototype.makeStepExpr2=function(e){return this.makeAbbrevStep(e.value)},e.prototype.makeStepExpr3=function(e,r,t){return new Kr(e.value,t,this)},e.prototype.makeStepExpr4=function(e,r){return new Kr("attribute",r,this)},e.prototype.makeStepExpr5=function(e,r){return new Kr(r||"child",e,this)},e.prototype.makeStepExpr6=function(e,r){return e.appendPredicate(r),e},e.prototype.makeAbbrevStep=function(e){switch(e){case"//":return new Kr("descendant-or-self",new _r,this);case".":return new Kr("self",new _r,this);case"..":return new Kr("parent",new _r,this)}},e.prototype.makeNodeTestExpr1=function(){return new yt},e.prototype.makeNodeTestExpr2=function(e){return new wt(e.value)},e.prototype.makeNodeTestExpr3=function(e){return new xt(e.value)},e.prototype.makeNodeTestExpr4=function(e){switch(e.value.replace(/\s*\($/,"")){case"node":return new _r;case"text":return new Nt;case"comment":return new vt;case"processing-instruction":return new Et("")}},e.prototype.makeNodeTestExpr5=function(e,r){var t=e.replace(/\s*\($/,"");if("processing-instruction"!=t)throw t;return new Et(r.value)},e.prototype.makePredicateExpr=function(e,r){return new Zr(r)},e.prototype.makePrimaryExpr=function(e,r){return r},e.prototype.makeFunctionCallExpr1=function(e){return new zr(e)},e.prototype.makeFunctionCallExpr2=function(e,r,t,a){var o=new zr(e);o.appendArg(t);for(var n=0;n<a.length;++n)o.appendArg(a[n]);return o},e.prototype.makeArgumentExpr=function(e,r){return r},e.prototype.makeUnionExpr=function(e,r,t){return new $r(e,t)},e.prototype.makePathExpr1=function(e,r,t){return new Yr(e,t)},e.prototype.makePathExpr2=function(e,r,t){return t.prependStep(this.makeAbbrevStep(r.value)),new Yr(e,t)},e.prototype.makeFilterExpr=function(e,r){return r.length>0?new ar(e,r):e},e.prototype.makeUnaryMinusExpr=function(e,r){return new Wr(r)},e.prototype.makeBinaryExpr=function(e,r,t){return new tr(e,r,t)},e.prototype.makeLiteralExpr=function(e){var r=e.value.substring(1,e.value.length-1);return new jr(r)},e.prototype.makeNumberExpr=function(e){return new Jr(e.value)},e.prototype.makeVariableReference=function(e,r){return new et(r.value)},e.prototype.makeSimpleExpr=function(e,r){if("$"==e.charAt(0))return new et(e.substr(1));if("@"==e.charAt(0)){var t=new xt(e.substr(1)),a=new Kr("attribute",t,this),o=new Xr(this);return o.appendStep(a),o}if(e.match(/^[0-9]+$/))return new Jr(e);var n=new xt(e),i=new Kr(r||he.CHILD,n,this),s=new Xr(this);return s.appendStep(i),s},e.prototype.makeSimpleExpr2=function(e){for(var r=e.split("/"),t=new Xr(this),a=0;a<r.length;++a){var o=new xt(r[a]),n=new Kr(he.CHILD,o,this);t.appendStep(n)}return t},e.prototype.stackToString=function(e){for(var r="",t=0;t<e.length;++t)r&&(r+="\n"),r+=e[t].tag.label;return r},e.prototype.xPathCacheLookup=function(e){return this.xPathParseCache[e]},e.prototype.xPathCollectDescendants=function(e,r,t){if(t&&r.getElementsByTagName)er(e,r.getElementsByTagName(t));else for(var a=r.firstChild;a;a=a.nextSibling)e.push(a),this.xPathCollectDescendants(e,a)},e.prototype.xPathCollectDescendantsReverse=function(e,r){for(var t=r.lastChild;t;t=t.previousSibling)e.push(t),this.xPathCollectDescendantsReverse(e,t)},e.prototype.xPathEval=function(e,r){return this.xPathParse(e).evaluate(r)},e.prototype.xPathExtractTagNameFromNodeTest=function(e,r){return e instanceof xt?e.name:r&&e instanceof _r||e instanceof yt?"*":void 0},e.prototype.xPathMatchStack=function(e,r){var t,a,o=e.length,n=r.length,i=[];i.matchlength=0;var s=0;for(t=n-1,a=o-1;t>=0&&a>=0;--t,a-=s){s=0;var l=[];if(r[t]==We)for(t-=1,i.push(l);a-s>=0&&e[a-s].tag==r[t];)l.push(e[a-s]),s+=1,i.matchlength+=1;else if(r[t]==Ze)for(t-=1,i.push(l);a-s>=0&&s<2&&e[a-s].tag==r[t];)l.push(e[a-s]),s+=1,i.matchlength+=1;else if(r[t]==Ke){if(t-=1,i.push(l),e[a].tag!=r[t])return[];for(;a-s>=0&&e[a-s].tag==r[t];)l.push(e[a-s]),s+=1,i.matchlength+=1}else{if(e[a].tag!=r[t])return[];i.push(e[a]),s+=1,i.matchlength+=1}h(l),l.expr=p(l,(function(e){return e.expr}))}return h(i),-1===t?i:[]},e.prototype.findXPathRuleForExpression=function(e,r){for(var t=null,a="",o=0;o<Ye.length;++o){var n=Ye[o].re.exec(e);if(this.lexerCount++,null!==n&&n.length>0&&n[0].length>0){t=Ye[o],a=n[0];break}}return!t||t!=Be&&t!=Ue&&t!=Ae&&t!=ke||r&&r.tag!=De&&r.tag!=fe&&r.tag!=me&&r.tag!=be&&r.tag!=Ge||(t=Xe),{rule:t,match:a}},e.prototype.xPathParseInit=function(){if(!this.xPathRules.length){var e=[rt,tt,at,ot,nt,it,st,lt,ut,ct,pt,ht,dt,gt,ft,mt,bt];this.xPathGrammarRules.sort((function(e,r){var t=e[1].length,a=r[1].length;return t<a?1:t>a?-1:0}));for(var r=1,t=0;t<e.length;++t)e[t].key=r++;for(t=0;t<Ye.length;++t)Ye[t].key=r++;this.xPathLog("XPath parse INIT: ".concat(r," rules"));for(t=0;t<this.xPathGrammarRules.length;++t)for(var a=this.xPathGrammarRules[t],o=a[1],n=o.length-1;n>=0;--n){if(o[n]==Ke){s(this.xPathRules,o[n-1].key,a);break}if(o[n]!=We&&o[n]!=Ze){s(this.xPathRules,o[n].key,a);break}s(this.xPathRules,o[n-1].key,a),--n}this.xPathLog("XPath parse INIT: ".concat(this.xPathRules.length," rule bins"));var i=0;!function(e,r){for(var t=0;t<e.length;++t)r.call(this,e[t],t)}(this.xPathRules,(function(e){e&&(i+=e.length)})),this.xPathLog("XPath parse INIT: ".concat(i/this.xPathRules.length," average bin size"))}function s(e,r,t){e[r]||(e[r]=[]),e[r].push(t)}},e.prototype.xPathParse=function(e,r){var t="".concat(e);if(this.xPathLog("parse ".concat(e)),this.xPathParseInit(),e.match(/^(\$|@)?\w+$/i)){var a=this.makeSimpleExpr(e,r);return this.xPathParseCache[e]=a,this.xPathLog(" ... simple"),a}if(e.match(/^\w+(\/\w+)*$/i)){a=this.makeSimpleExpr2(e);return this.xPathParseCache[e]=a,this.xPathLog(" ... simple 2"),a}var o=e,n=[],i=null,s=null,l=!1,u=0;this.lexerCount=0;for(var c=0;!l;){u++,e=e.replace(/^\s*/,""),s=i,i=null;var p=this.findXPathRuleForExpression(e,s),h=p.rule,d=p.match;for(h?(e=e.substr(d.length),this.xPathLog("token: ".concat(d," -- ").concat(h.label)),i={tag:h,match:d,prec:h.prec?h.prec:0,expr:this.makeTokenExpr(d)}):(this.xPathLog("DONE"),l=!0);this.xPathReduce(n,i);)c++,this.xPathLog("stack: ".concat(this.stackToString(n)))}if(this.xPathLog("stack: ".concat(this.stackToString(n))),1!==n.length)throw"XPath parse error ".concat(o,":\n").concat(this.stackToString(n));var g=n[0].expr;return void 0!==r&&!g.absolute&&!t.startsWith("*")&&g.steps&&Array.isArray(g.steps)&&(g.steps[0].axis=r),this.xPathParseCache[o]=g,this.xPathLog("XPath parse: ".concat(u," / ").concat(this.lexerCount," / ").concat(c)),g},e.prototype.findGrammarRuleCandidate=function(e,r){for(var t=0;t<e.length;++t){var a=e[t],o=this.xPathMatchStack(r,a[1]);if(o.length){var n={tag:a[0],rule:a,match:o,prec:void 0};return n.prec=this.xPathGrammarPrecedence(n),n}}return null},e.prototype.xPathReduce=function(e,r){var t,a=null;if(e.length>0){var o=e[e.length-1],n=this.xPathRules[o.tag.key];n&&(a=this.findGrammarRuleCandidate(n,e))}if(a&&(!r||a.prec>r.prec||r.tag.left&&a.prec>=r.prec)){for(var i=0;i<a.match.matchlength;++i)e.pop();this.xPathLog("reduce ".concat(a.tag.label," ").concat(a.prec," ahead ").concat(r?r.tag.label+" "+r.prec+(r.tag.left?" left":""):" none "));var s=p(a.match,(function(e){return e.expr}));this.xPathLog("going to apply ".concat(a.rule[3])),a.expr=a.rule[3].apply(this,s),e.push(a),t=!0}else r&&(this.xPathLog("shift ".concat(r.tag.label," ").concat(r.prec).concat(r.tag.left?" left":""," over ").concat(a?a.tag.label+" "+a.prec:" none")),e.push(r)),t=!1;return t},e.prototype.xPathSort=function(e,r){if(0!==r.length){for(var t=[],a=0;a<e.contextSize();++a){for(var o={node:h=e.nodeList[a],key:[]},n=e.clone([h],void 0,0,void 0),i=0,s=r;i<s.length;i++){var l=s[i],u=l.expr.evaluate(n),c=void 0;"text"===l.type?c=u.stringValue():"number"===l.type&&(c=u.numberValue()),o.key.push({value:c,order:l.order})}o.key.push({value:a,order:"ascending"}),t.push(o)}t.sort(this.xPathSortByKey);var p=[];for(a=0;a<t.length;++a){var h;(h=t[a].node).siblingPosition=a,p.push(h)}e.nodeList=p,e.setNode(0)}},e.prototype.xPathSortByKey=function(e,r){for(var t=0;t<e.key.length;++t){var a="descending"==e.key[t].order?-1:1;if(e.key[t].value>r.key[t].value)return 1*a;if(e.key[t].value<r.key[t].value)return-1*a}return 0},e.prototype.xPathStep=function(e,r,t,a,o){var n=r[t],i=o.clone([a],void 0,0,void 0);if(o.returnOnFirstMatch&&!n.hasPositionalPredicate){var s=(p=n.evaluate(i).nodeSetValue()).length,l=n.predicate.length;e:for(var u=0;u<s;++u){for(var c=0;c<l;++c)if(!n.predicate[c].evaluate(o.clone(p,void 0,u,void 0)).booleanValue())continue e;if(t==r.length-1?e.push(p[u]):this.xPathStep(e,r,t+1,p[u],o),e.length>0)break}}else{i.returnOnFirstMatch=!1;var p=n.evaluate(i).nodeSetValue();for(u=0;u<p.length;++u)t==r.length-1?e.push(p[u]):this.xPathStep(e,r,t+1,p[u],o)}},e.prototype.xPathGrammarPrecedence=function(e){var r=0;if(e.rule)if(e.rule.length>=3&&e.rule[2]>=0)r=e.rule[2];else for(var t=0;t<e.rule[1].length;++t){var a=this.xPathTokenPrecedence(e.rule[1][t]);r=Math.max(r,a)}else if(e.tag)r=this.xPathTokenPrecedence(e.tag);else if(e.length)for(var o=0;o<e.length;++o){a=this.xPathGrammarPrecedence(e[o]);r=Math.max(r,a)}return r},e.prototype.xPathTokenPrecedence=function(e){return e.prec||2},e}(),qt=function(){function e(){}return e.prototype.expressionMatch=function(e,r){return e instanceof Xr?this.locationExpressionMatch(e,r):e instanceof $r?this.unionExpressionMatch(e,r):[]},e.prototype.locationExpressionMatch=function(e,r){if(void 0===e||void 0===e.steps||e.steps.length<=0)throw new Error("Error resolving XSLT match: Location Expression should have steps.");return e.absolute?"self"===e.steps[0].axis?this.absoluteXsltMatchByDocumentNode(e,r):this.absoluteXsltMatch(e,r):this.relativeXsltMatch(e,r)},e.prototype.unionExpressionMatch=function(e,r){return this.expressionMatch(e.expr1,r).concat(this.expressionMatch(e.expr2,r))},e.prototype.absoluteXsltMatchByDocumentNode=function(e,r){for(var t=r.clone([r.root],void 0,0,void 0),a=[],o=0,n=e.evaluate(t).nodeSetValue();o<n.length;o++){var i=n[o];i.id!==r.nodeList[r.position].id||a.push(i)}return a},e.prototype.absoluteXsltMatch=function(e,r){var t,a=r.root.childNodes[0],o=r.clone([a],void 0,0,void 0),n=e.evaluate(o).nodeSetValue(),i=[];t=1===r.nodeList.length&&"#document"===r.nodeList[0].nodeName?[r.nodeList[0].childNodes[0]]:r.nodeList;for(var s=0,l=n;s<l.length;s++){var u=l[s];u.id!==t[r.position].id||i.push(u)}return i},e.prototype.relativeXsltMatch=function(e,r){var t=r.clone(),a=e.evaluate(t).nodeSetValue();return 1===a.length&&"#document"===a[0].nodeName?[a[0].childNodes[0]]:a},e}(),kt=function(){function e(e){void 0===e&&(e={escape:!0,selfClosingTags:!0,parameters:[]}),this.xPath=new Dt,this.matchResolver=new qt,this.options={escape:!0===e.escape,selfClosingTags:!0===e.selfClosingTags,parameters:e.parameters||[]},this.outputMethod="xml",this.outputOmitXmlDeclaration="no",this.decimalFormatSettings={decimalSeparator:".",groupingSeparator:",",infinity:"Infinity",minusSign:"-",naN:"NaN",percent:"%",perMille:"‰",zeroDigit:"0",digit:"#",patternSeparator:";"}}return e.prototype.xsltProcess=function(e,r){var t=new b;this.outputDocument=t;var a=new $e([e],[t]);if(this.options.parameters.length>0)for(var o=0,n=this.options.parameters;o<n.length;o++){var i=n[o];a.setVariable(i.name,new pe(i.value))}return this.xsltProcessContext(a,r),function(e,r){void 0===r&&(r={cData:!1,escape:!0,selfClosingTags:!0});var t=[];return oe(e,t,r),t.join("")}(t,{cData:!1,escape:this.options.escape,selfClosingTags:this.options.selfClosingTags})},e.prototype.xsltProcessContext=function(e,n,l){var u=this;if(this.isXsltElement(n)){var c,p,h,d=void 0,g=void 0,f=void 0,m=void 0,b=void 0,v=void 0,y=void 0,x=void 0,w=void 0,E=void 0,N=void 0,D=void 0;switch(n.localName){case"apply-imports":case"attribute-set":case"fallback":case"import":case"include":case"key":case"message":case"namespace-alias":case"number":case"preserve-space":case"processing-instruction":case"strip-space":throw new Error("not implemented: ".concat(n.localName));case"apply-templates":b=(f=le(n,"select"))?this.xPath.xPathEval(f,e).nodeSetValue():e.nodeList[e.position].childNodes,v=le(n,"mode"),y=[];for(var q=0,k=(p=n.ownerDocument.documentElement).childNodes.filter((function(e){return e.nodeType==r&&u.isXsltElement(e,"template")}));q<k.length;q++){var A=k[q],S=n.getAncestorByLocalName("template");void 0!==S&&(S.id!==A.id&&(v&&A.getAttributeValue("mode")!==v||y.push(A)))}for(var L=e.clone(b),T=0;T<y.length;++T)for(var C=0;C<L.contextSize();++C)if(L.nodeList[C].nodeType===a){var V=e.clone([L.nodeList[C]],void 0,0,void 0);this.commonLogicTextNode(V,L.nodeList[C])}else{var P=L.clone([L.nodeList[C]],void 0,0,void 0);P.inApplyTemplates=!0,P.outputDepth=0,this.xsltProcessContext(P,y[T],l)}break;case"attribute":d=le(n,"name"),c=this.xsltAttributeValue(d,e);var R=te(this.outputDocument);if(this.xsltChildNodes(e,n,R),m=function(e,n){if(void 0===n&&(n=!1),!e)return"";var l="";if(e.nodeType==a||e.nodeType==o)l+=e.nodeValue;else if(e.nodeType==t)l+=e.nodeValue;else if(e.nodeType==r||e.nodeType==i||e.nodeType==s){if(!n){var u=e.innerText;if(null!=u)return u;var c=e.textContent;if(null!=c)return c}for(var p=e.transformedChildNodes.length,h=0;h<p;++h)l+=ae(e.transformedChildNodes[h])}return l}(R),null!=l)Y(l,c,m);else{var F=e.outputNodeList[e.outputPosition];if("#document"===F.localName){var B=e.root.childNodes[0],U=$(this.outputDocument,B.nodeName);U.transformedNodeName=B.nodeName,U.transformedLocalName=B.localName,W(F,U),F=U}Y(F,c,m)}break;case"call-template":c=le(n,"name"),p=n.ownerDocument.documentElement,x=e.clone(),this.xsltWithParam(x,n);for(T=0;T<p.childNodes.length;++T){var O=p.childNodes[T];if(O.nodeType==r&&this.isXsltElement(O,"template")&&X(O,"name")==c){this.xsltChildNodes(x,O,l);break}}break;case"choose":this.xsltChoose(e,n,l);break;case"comment":g=te(this.outputDocument),this.xsltChildNodes(e,n,g),w=ae(g),E=re(this.outputDocument,w),l.appendChild(E);break;case"copy":var I=l||e.outputNodeList[e.outputPosition];(g=this.xsltCopy(I,e.nodeList[e.position]))&&this.xsltChildNodes(e,n,g);break;case"copy-of":f=le(n,"select"),m=this.xPath.xPathEval(f,e);var G=l||e.outputNodeList[e.outputPosition];if("node-set"===m.type){b=m.nodeSetValue();for(T=0;T<b.length;++T)this.xsltCopyOf(G,b[T])}else{Z(G,K(this.outputDocument,m.stringValue()))}break;case"decimal-format":c=le(n,"name");var H=le(n,"decimal-separator"),M=le(n,"grouping-separator"),z=le(n,"infinity"),j=le(n,"minus-sign"),_=le(n,"NaN"),J=le(n,"percent"),ee=le(n,"per-mille"),oe=le(n,"zero-digit"),ne=le(n,"digit"),ie=le(n,"pattern-separator");this.decimalFormatSettings={name:c||this.decimalFormatSettings.name,decimalSeparator:H||this.decimalFormatSettings.decimalSeparator,groupingSeparator:M||this.decimalFormatSettings.groupingSeparator,infinity:z||this.decimalFormatSettings.infinity,minusSign:j||this.decimalFormatSettings.minusSign,naN:_||this.decimalFormatSettings.naN,percent:J||this.decimalFormatSettings.percent,perMille:ee||this.decimalFormatSettings.perMille,zeroDigit:oe||this.decimalFormatSettings.zeroDigit,digit:ne||this.decimalFormatSettings.digit,patternSeparator:ie||this.decimalFormatSettings.patternSeparator},e.decimalFormatSettings=this.decimalFormatSettings;break;case"element":d=le(n,"name"),c=this.xsltAttributeValue(d,e),(g=$(this.outputDocument,c)).transformedNodeName=c,W(e.outputNodeList[e.outputPosition],g);var se=e.clone(void 0,[g],void 0,0);this.xsltChildNodes(se,n,g);break;case"for-each":this.xsltForEach(e,n,l);break;case"if":h=le(n,"test"),this.xPath.xPathEval(h,e).booleanValue()&&this.xsltChildNodes(e,n,l);break;case"otherwise":throw"error if here: ".concat(n.localName);case"output":this.outputMethod=le(n,"method"),this.outputOmitXmlDeclaration=le(n,"omit-xml-declaration");break;case"param":this.xsltVariable(e,n,!1);break;case"sort":this.xsltSort(e,n);break;case"stylesheet":case"transform":this.xsltTransformOrStylesheet(n,e,l);break;case"template":if(!e.inApplyTemplates&&e.baseTemplateMatched)break;if(!(N=le(n,"match")))break;(b=this.xsltMatch(N,e,"self-and-siblings")).length>0&&(e.inApplyTemplates||(e.baseTemplateMatched=!0),this.xsltChildNodes(e,n,l));break;case"text":D=ae(n),g=Q(this.outputDocument,D);var ue=n.attributes.filter((function(e){return"disable-output-escaping"===e.nodeName}));ue.length>0&&"yes"===ue[0].nodeValue&&(g.escape=!1),(l||e.outputNodeList[e.outputPosition]).appendTransformedChild(g);break;case"value-of":f=le(n,"select"),m=this.xPath.xPathEval(f,e).stringValue(),(g=Q(this.outputDocument,m)).siblingPosition=e.nodeList[e.position].siblingPosition,null!=l?l.appendTransformedChild(g):e.outputNodeList[e.outputPosition].appendTransformedChild(g);break;case"variable":this.xsltVariable(e,n,!0);break;default:throw new Error("error if here: ".concat(n.localName))}}else this.xsltPassThrough(e,n,l)},e.prototype.xsltChoose=function(e,t,a){for(var o=0,n=t.childNodes;o<n.length;o++){var i=n[o];if(i.nodeType===r)if(this.isXsltElement(i,"when")){var s=le(i,"test");if(this.xPath.xPathEval(s,e).booleanValue()){this.xsltChildNodes(e,i,a);break}}else if(this.isXsltElement(i,"otherwise")){this.xsltChildNodes(e,i,a);break}}},e.prototype.xsltCopy=function(e,i){if(i.nodeType==r)return(s=$(this.outputDocument,i.nodeName)).transformedNodeName=i.nodeName,null!==i.namespaceUri&&void 0!==i.namespaceUri&&Y(s,"xmlns",i.namespaceUri),W(e,s),s;if(i.nodeType==a)W(e,s=Q(this.outputDocument,i.nodeValue));else if(i.nodeType==o){W(e,s=ee(this.outputDocument,i.nodeValue))}else if(i.nodeType==n){var s;W(e,s=re(this.outputDocument,i.nodeValue))}else i.nodeType==t&&Y(e,i.nodeName,i.nodeValue);return null},e.prototype.xsltCopyOf=function(e,r){if(r.nodeType==s||r.nodeType==i)for(var t=0;t<r.childNodes.length;++t)this.xsltCopyOf(e,r.childNodes[t]);else{var a=this.xsltCopy(e,r);if(a){for(t=0;t<r.attributes.length;++t)this.xsltCopyOf(a,r.attributes[t]);for(t=0;t<r.childNodes.length;++t)this.xsltCopyOf(a,r.childNodes[t])}}},e.prototype.xsltForEach=function(e,r,t){var a=le(r,"select"),o=this.xPath.xPathEval(a,e).nodeSetValue(),n=e.clone(o);this.xsltSort(n,r);var i=n.nodeList.filter((function(e){return null!==e.parentNode&&void 0!==e.parentNode}));if(i.length<=0)throw new Error("Nodes with no parents defined.");i[0].parentNode.childNodes=n.nodeList;for(var s=0;s<n.contextSize();++s)this.xsltChildNodes(n.clone(n.nodeList,void 0,s),r,t)},e.prototype.xsltSort=function(e,t){for(var a=[],o=0,n=t.childNodes;o<n.length;o++){var i=n[o];if(i.nodeType==r&&this.isXsltElement(i,"sort")){var s=le(i,"select"),l=this.xPath.xPathParse(s),u=le(i,"data-type")||"text",c=le(i,"order")||"ascending";a.push({expr:l,type:u,order:c})}}this.xPath.xPathSort(e,a)},e.prototype.xsltTransformOrStylesheet=function(e,r,t){for(var a=0,o=e.attributes;a<o.length;a++){var n=o[a];if("version"===n.nodeName){if(this.version=n.nodeValue,!["1.0","2.0","3.0"].includes(this.version))throw new Error("XSLT version not defined or invalid. Actual resolved version: ".concat(this.version||"(none)","."))}else"xmlns"===n.prefix&&(r.knownNamespaces[n.localName]=n.nodeValue)}this.xsltChildNodes(r,e,t)},e.prototype.xsltVariable=function(e,r,t){var a,o=le(r,"name"),n=le(r,"select");if(r.childNodes.length>0){var i=te(r.ownerDocument);this.xsltChildNodes(e,r,i),a=new ue([i])}else if(n)a=this.xPath.xPathEval(n,e);else{var s="",l=this.options.parameters.filter((function(e){return e.name===o}));l.length>0&&(s=l[0].value),a=new pe(s)}!t&&e.getVariable(o)||e.setVariable(o,a)},e.prototype.xsltChildNodes=function(e,r,t){for(var a=e.clone(),o=0;o<r.childNodes.length;++o)this.xsltProcessContext(a,r.childNodes[o],t)},e.prototype.commonLogicTextNode=function(e,r){var t,o=e.outputNodeList[e.outputPosition].transformedChildNodes.filter((function(e){return e.nodeType===a}));o.length>0?(t=o[0]).transformedNodeValue=r.nodeValue:((t=Q(this.outputDocument,r.nodeValue)).transformedParentNode=e.outputNodeList[e.outputPosition],W(e.outputNodeList[e.outputPosition],t))},e.prototype.xsltPassThrough=function(e,t,o){if(t.nodeType==a)this.xsltPassText(t)&&this.commonLogicTextNode(e,t);else if(t.nodeType==r){var n=void 0,i=e;"#document"===e.nodeList[e.position].nodeName?(n=e.nodeList[e.position].firstChild,i=e.clone([n])):n=e.nodeList[e.position];var s=void 0;void 0===n.outputNode||null===n.outputNode||e.outputDepth>0?((s=$(this.outputDocument,t.nodeName)).siblingPosition=n.siblingPosition,n.outputNode=s):s=n.outputNode,s.transformedNodeName=t.nodeName,s.transformedLocalName=t.localName;var l=t.attributes.filter((function(e){return e}));if(0===l.length)s.transformedAttributes=[];else for(var u=0,c=l;u<c.length;u++){var p=c[u];Y(s,p.nodeName,this.xsltAttributeValue(p.nodeValue,i))}var h=e.outputNodeList[e.outputPosition];W(h,s);var d=i.cloneByOutput(h.transformedChildNodes,h.transformedChildNodes.length-1,++i.outputDepth);this.xsltChildNodes(d,t)}else this.xsltChildNodes(e,t,o)},e.prototype.xsltPassText=function(e){if(!e.nodeValue.match(/^\s*$/))return!0;var t=e.parentNode;if(this.isXsltElement(t,"text"))return!0;for(;t&&t.nodeType==r;){var a=X(t,"xml:space");if(a){if("default"==a)return!1;if("preserve"==a)return!0}t=t.parentNode}return!1},e.prototype.xsltAttributeValue=function(e,r){var t=e.split("{");if(1===t.length)return e;for(var a="",o=0;o<t.length;++o){var n=t[o].split("}");if(2==n.length)a+=this.xPath.xPathEval(n[0],r).stringValue()+n[1];else a+=t[o]}return a},e.prototype.xsltMatch=function(e,r,t){var a=this.xPath.xPathParse(e,t);return this.matchResolver.expressionMatch(a,r)},e.prototype.xsltWithParam=function(e,t){for(var a=0,o=t.childNodes;a<o.length;a++){var n=o[a];n.nodeType===r&&this.isXsltElement(n,"with-param")&&this.xsltVariable(e,n,!0)}},e.prototype.isXsltElement=function(e,r){return(!r||e.localName==r)&&(e.namespaceUri?"http://www.w3.org/1999/XSL/Transform"===e.namespaceUri:"xsl"===e.prefix)},e}();e.ExprContext=$e,e.XPath=Dt,e.Xslt=kt,e.xmlEscapeText=ie,e.xmlParse=function(e){var r,t,a=/\/$/;if(e.match(/^<\?xml/))if(5==e.search(new RegExp(w)))r=M,t=z;else{if(5!=e.search(new RegExp(V)))throw new Error("VersionInfo is missing, or unknown version number.");r=j,t=_}else r=M,t=z;var o=new b,n=o,i=[],s=n;i.push(s);for(var l,u=!1,p=!1,h=!1,g=0,f=0;f<e.length;++f){var m=e.charAt(f);if(u&&!h&&"'"===m)p=!p;else if(u&&!p&&'"'===m)h=!h;else if(!u||">"!==m||p||h){if(!u&&"<"===m){if((x=e.slice(g,f))&&s!==n&&Z(s,K(o,x)),"!--"===e.slice(f+1,f+4)){if(v=e.slice(f+4).indexOf("--\x3e"))Z(s,N=re(o,e.slice(f+4,f+v+4))),f+=v+6}else if("![CDATA["===e.slice(f+1,f+9)){if(v=e.slice(f+9).indexOf("]]>"))Z(s,N=ee(o,e.slice(f+9,f+v+9))),f+=v+11}else if("!DOCTYPE"===e.slice(f+1,f+9)){var v;if(v=e.slice(f+9).indexOf(">")){var y=e.slice(f+9,f+v+9).trimStart();N=void 0;"xsl:text"===s.nodeName?N=K(o,"<!DOCTYPE ".concat(y,">")):(l=y,N=o.createDTDSection(l)),Z(s,N),f+=v+y.length+5}}else u=!0;g=f+1}}else{var x;if("/"==(x=e.slice(g,f)).charAt(0))i.pop(),s=i[i.length-1];else if("?"===x.charAt(0));else if("!"===x.charAt(0));else{for(var E=x.match(a),N=$(o,r.exec(x)[1]),D=void 0;D=t.exec(x);){var q=c.decode(D[5]||D[7]||"");J(N,D[1],q)}N.siblingPosition=s.childNodes.length,Z(s,N),E||(s=N,i.push(N));var k=d(N);null!==N.prefix?N.prefix in k&&(N.namespaceUri=k[N.prefix]):""in k&&(N.namespaceUri=k[""]);for(var A=0;A<N.attributes.length;++A)null!==N.attributes[A].prefix&&N.attributes[A].prefix in k&&(N.attributes[A].namespaceUri=k[N.attributes[A].prefix])}g=f+1,u=!1,p=!1,h=!1}}return n},Object.defineProperty(e,"__esModule",{value:!0})}));
16
16
  //# sourceMappingURL=xslt-processor.js.map