xml-explorer 0.1.0 → 0.1.1

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.

Potentially problematic release.


This version of xml-explorer might be problematic. Click here for more details.

package/dist/index.js CHANGED
@@ -1,150 +1,150 @@
1
- import Pe, { useRef as D, useState as M, useEffect as j, useMemo as le, useCallback as ue } from "react";
2
- import De from "@monaco-editor/react";
3
- import * as Ee from "monaco-editor";
1
+ import De, { useRef as w, useState as U, useEffect as F, useMemo as le, useCallback as me } from "react";
2
+ import Be from "@monaco-editor/react";
3
+ import * as Re from "monaco-editor";
4
4
  var pe = { exports: {} }, ce = {};
5
- var he;
6
- function Re() {
7
- if (he) return ce;
8
- he = 1;
9
- var r = /* @__PURE__ */ Symbol.for("react.transitional.element"), a = /* @__PURE__ */ Symbol.for("react.fragment");
10
- function d(t, s, c) {
5
+ var Te;
6
+ function Oe() {
7
+ if (Te) return ce;
8
+ Te = 1;
9
+ var t = /* @__PURE__ */ Symbol.for("react.transitional.element"), r = /* @__PURE__ */ Symbol.for("react.fragment");
10
+ function a(n, o, c) {
11
11
  var l = null;
12
- if (c !== void 0 && (l = "" + c), s.key !== void 0 && (l = "" + s.key), "key" in s) {
12
+ if (c !== void 0 && (l = "" + c), o.key !== void 0 && (l = "" + o.key), "key" in o) {
13
13
  c = {};
14
- for (var p in s)
15
- p !== "key" && (c[p] = s[p]);
16
- } else c = s;
17
- return s = c.ref, {
18
- $$typeof: r,
19
- type: t,
14
+ for (var p in o)
15
+ p !== "key" && (c[p] = o[p]);
16
+ } else c = o;
17
+ return o = c.ref, {
18
+ $$typeof: t,
19
+ type: n,
20
20
  key: l,
21
- ref: s !== void 0 ? s : null,
21
+ ref: o !== void 0 ? o : null,
22
22
  props: c
23
23
  };
24
24
  }
25
- return ce.Fragment = a, ce.jsx = d, ce.jsxs = d, ce;
25
+ return ce.Fragment = r, ce.jsx = a, ce.jsxs = a, ce;
26
26
  }
27
- var oe = {};
28
- var Ie;
29
- function Le() {
30
- return Ie || (Ie = 1, process.env.NODE_ENV !== "production" && (function() {
31
- function r(e) {
27
+ var ue = {};
28
+ var ye;
29
+ function Pe() {
30
+ return ye || (ye = 1, process.env.NODE_ENV !== "production" && (function() {
31
+ function t(e) {
32
32
  if (e == null) return null;
33
33
  if (typeof e == "function")
34
- return e.$$typeof === F ? null : e.displayName || e.name || null;
34
+ return e.$$typeof === q ? null : e.displayName || e.name || null;
35
35
  if (typeof e == "string") return e;
36
36
  switch (e) {
37
- case q:
37
+ case Y:
38
38
  return "Fragment";
39
- case W:
39
+ case K:
40
40
  return "Profiler";
41
41
  case ee:
42
42
  return "StrictMode";
43
- case ae:
43
+ case re:
44
44
  return "Suspense";
45
- case _:
45
+ case H:
46
46
  return "SuspenseList";
47
- case z:
47
+ case Q:
48
48
  return "Activity";
49
49
  }
50
50
  if (typeof e == "object")
51
51
  switch (typeof e.tag == "number" && console.error(
52
52
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
53
53
  ), e.$$typeof) {
54
- case $:
54
+ case G:
55
55
  return "Portal";
56
- case re:
56
+ case te:
57
57
  return e.displayName || "Context";
58
- case N:
58
+ case L:
59
59
  return (e._context.displayName || "Context") + ".Consumer";
60
- case U:
61
- var m = e.render;
62
- return e = e.displayName, e || (e = m.displayName || m.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
60
+ case j:
61
+ var d = e.render;
62
+ return e = e.displayName, e || (e = d.displayName || d.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
63
63
  case se:
64
- return m = e.displayName || null, m !== null ? m : r(e.type) || "Memo";
65
- case O:
66
- m = e._payload, e = e._init;
64
+ return d = e.displayName || null, d !== null ? d : t(e.type) || "Memo";
65
+ case M:
66
+ d = e._payload, e = e._init;
67
67
  try {
68
- return r(e(m));
68
+ return t(e(d));
69
69
  } catch {
70
70
  }
71
71
  }
72
72
  return null;
73
73
  }
74
- function a(e) {
74
+ function r(e) {
75
75
  return "" + e;
76
76
  }
77
- function d(e) {
77
+ function a(e) {
78
78
  try {
79
- a(e);
80
- var m = !1;
79
+ r(e);
80
+ var d = !1;
81
81
  } catch {
82
- m = !0;
82
+ d = !0;
83
83
  }
84
- if (m) {
85
- m = console;
86
- var I = m.error, A = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
87
- return I.call(
88
- m,
84
+ if (d) {
85
+ d = console;
86
+ var y = d.error, C = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
87
+ return y.call(
88
+ d,
89
89
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
90
- A
91
- ), a(e);
90
+ C
91
+ ), r(e);
92
92
  }
93
93
  }
94
- function t(e) {
95
- if (e === q) return "<>";
96
- if (typeof e == "object" && e !== null && e.$$typeof === O)
94
+ function n(e) {
95
+ if (e === Y) return "<>";
96
+ if (typeof e == "object" && e !== null && e.$$typeof === M)
97
97
  return "<...>";
98
98
  try {
99
- var m = r(e);
100
- return m ? "<" + m + ">" : "<...>";
99
+ var d = t(e);
100
+ return d ? "<" + d + ">" : "<...>";
101
101
  } catch {
102
102
  return "<...>";
103
103
  }
104
104
  }
105
- function s() {
106
- var e = C.A;
105
+ function o() {
106
+ var e = g.A;
107
107
  return e === null ? null : e.getOwner();
108
108
  }
109
109
  function c() {
110
110
  return Error("react-stack-top-frame");
111
111
  }
112
112
  function l(e) {
113
- if (y.call(e, "key")) {
114
- var m = Object.getOwnPropertyDescriptor(e, "key").get;
115
- if (m && m.isReactWarning) return !1;
113
+ if (f.call(e, "key")) {
114
+ var d = Object.getOwnPropertyDescriptor(e, "key").get;
115
+ if (d && d.isReactWarning) return !1;
116
116
  }
117
117
  return e.key !== void 0;
118
118
  }
119
- function p(e, m) {
120
- function I() {
119
+ function p(e, d) {
120
+ function y() {
121
121
  b || (b = !0, console.error(
122
122
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
123
- m
123
+ d
124
124
  ));
125
125
  }
126
- I.isReactWarning = !0, Object.defineProperty(e, "key", {
127
- get: I,
126
+ y.isReactWarning = !0, Object.defineProperty(e, "key", {
127
+ get: y,
128
128
  configurable: !0
129
129
  });
130
130
  }
131
- function T() {
132
- var e = r(this.type);
133
- return L[e] || (L[e] = !0, console.error(
131
+ function h() {
132
+ var e = t(this.type);
133
+ return R[e] || (R[e] = !0, console.error(
134
134
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
135
135
  )), e = this.props.ref, e !== void 0 ? e : null;
136
136
  }
137
- function g(e, m, I, A, te, i) {
138
- var n = I.ref;
137
+ function N(e, d, y, C, ne, i) {
138
+ var s = y.ref;
139
139
  return e = {
140
140
  $$typeof: V,
141
141
  type: e,
142
- key: m,
143
- props: I,
144
- _owner: A
145
- }, (n !== void 0 ? n : null) !== null ? Object.defineProperty(e, "ref", {
142
+ key: d,
143
+ props: y,
144
+ _owner: C
145
+ }, (s !== void 0 ? s : null) !== null ? Object.defineProperty(e, "ref", {
146
146
  enumerable: !1,
147
- get: T
147
+ get: h
148
148
  }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
149
149
  configurable: !1,
150
150
  enumerable: !1,
@@ -159,7 +159,7 @@ function Le() {
159
159
  configurable: !1,
160
160
  enumerable: !1,
161
161
  writable: !0,
162
- value: te
162
+ value: ne
163
163
  }), Object.defineProperty(e, "_debugTask", {
164
164
  configurable: !1,
165
165
  enumerable: !1,
@@ -167,101 +167,101 @@ function Le() {
167
167
  value: i
168
168
  }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
169
169
  }
170
- function E(e, m, I, A, te, i) {
171
- var n = m.children;
172
- if (n !== void 0)
173
- if (A)
174
- if (o(n)) {
175
- for (A = 0; A < n.length; A++)
176
- k(n[A]);
177
- Object.freeze && Object.freeze(n);
170
+ function D(e, d, y, C, ne, i) {
171
+ var s = d.children;
172
+ if (s !== void 0)
173
+ if (C)
174
+ if (u(s)) {
175
+ for (C = 0; C < s.length; C++)
176
+ _(s[C]);
177
+ Object.freeze && Object.freeze(s);
178
178
  } else
179
179
  console.error(
180
180
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
181
181
  );
182
- else k(n);
183
- if (y.call(m, "key")) {
184
- n = r(e);
185
- var B = Object.keys(m).filter(function(P) {
186
- return P !== "key";
182
+ else _(s);
183
+ if (f.call(d, "key")) {
184
+ s = t(e);
185
+ var E = Object.keys(d).filter(function(x) {
186
+ return x !== "key";
187
187
  });
188
- A = 0 < B.length ? "{key: someKey, " + B.join(": ..., ") + ": ...}" : "{key: someKey}", de[n + A] || (B = 0 < B.length ? "{" + B.join(": ..., ") + ": ...}" : "{}", console.error(
188
+ C = 0 < E.length ? "{key: someKey, " + E.join(": ..., ") + ": ...}" : "{key: someKey}", oe[s + C] || (E = 0 < E.length ? "{" + E.join(": ..., ") + ": ...}" : "{}", console.error(
189
189
  `A props object containing a "key" prop is being spread into JSX:
190
190
  let props = %s;
191
191
  <%s {...props} />
192
192
  React keys must be passed directly to JSX without using spread:
193
193
  let props = %s;
194
194
  <%s key={someKey} {...props} />`,
195
- A,
196
- n,
197
- B,
198
- n
199
- ), de[n + A] = !0);
195
+ C,
196
+ s,
197
+ E,
198
+ s
199
+ ), oe[s + C] = !0);
200
200
  }
201
- if (n = null, I !== void 0 && (d(I), n = "" + I), l(m) && (d(m.key), n = "" + m.key), "key" in m) {
202
- I = {};
203
- for (var S in m)
204
- S !== "key" && (I[S] = m[S]);
205
- } else I = m;
206
- return n && p(
207
- I,
201
+ if (s = null, y !== void 0 && (a(y), s = "" + y), l(d) && (a(d.key), s = "" + d.key), "key" in d) {
202
+ y = {};
203
+ for (var S in d)
204
+ S !== "key" && (y[S] = d[S]);
205
+ } else y = d;
206
+ return s && p(
207
+ y,
208
208
  typeof e == "function" ? e.displayName || e.name || "Unknown" : e
209
- ), g(
209
+ ), N(
210
210
  e,
211
- n,
212
- I,
213
- s(),
214
- te,
211
+ s,
212
+ y,
213
+ o(),
214
+ ne,
215
215
  i
216
216
  );
217
217
  }
218
- function k(e) {
219
- f(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === O && (e._payload.status === "fulfilled" ? f(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
218
+ function _(e) {
219
+ I(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === M && (e._payload.status === "fulfilled" ? I(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
220
220
  }
221
- function f(e) {
221
+ function I(e) {
222
222
  return typeof e == "object" && e !== null && e.$$typeof === V;
223
223
  }
224
- var x = Pe, V = /* @__PURE__ */ Symbol.for("react.transitional.element"), $ = /* @__PURE__ */ Symbol.for("react.portal"), q = /* @__PURE__ */ Symbol.for("react.fragment"), ee = /* @__PURE__ */ Symbol.for("react.strict_mode"), W = /* @__PURE__ */ Symbol.for("react.profiler"), N = /* @__PURE__ */ Symbol.for("react.consumer"), re = /* @__PURE__ */ Symbol.for("react.context"), U = /* @__PURE__ */ Symbol.for("react.forward_ref"), ae = /* @__PURE__ */ Symbol.for("react.suspense"), _ = /* @__PURE__ */ Symbol.for("react.suspense_list"), se = /* @__PURE__ */ Symbol.for("react.memo"), O = /* @__PURE__ */ Symbol.for("react.lazy"), z = /* @__PURE__ */ Symbol.for("react.activity"), F = /* @__PURE__ */ Symbol.for("react.client.reference"), C = x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, y = Object.prototype.hasOwnProperty, o = Array.isArray, h = console.createTask ? console.createTask : function() {
224
+ var v = De, V = /* @__PURE__ */ Symbol.for("react.transitional.element"), G = /* @__PURE__ */ Symbol.for("react.portal"), Y = /* @__PURE__ */ Symbol.for("react.fragment"), ee = /* @__PURE__ */ Symbol.for("react.strict_mode"), K = /* @__PURE__ */ Symbol.for("react.profiler"), L = /* @__PURE__ */ Symbol.for("react.consumer"), te = /* @__PURE__ */ Symbol.for("react.context"), j = /* @__PURE__ */ Symbol.for("react.forward_ref"), re = /* @__PURE__ */ Symbol.for("react.suspense"), H = /* @__PURE__ */ Symbol.for("react.suspense_list"), se = /* @__PURE__ */ Symbol.for("react.memo"), M = /* @__PURE__ */ Symbol.for("react.lazy"), Q = /* @__PURE__ */ Symbol.for("react.activity"), q = /* @__PURE__ */ Symbol.for("react.client.reference"), g = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, f = Object.prototype.hasOwnProperty, u = Array.isArray, T = console.createTask ? console.createTask : function() {
225
225
  return null;
226
226
  };
227
- x = {
227
+ v = {
228
228
  react_stack_bottom_frame: function(e) {
229
229
  return e();
230
230
  }
231
231
  };
232
- var b, L = {}, K = x.react_stack_bottom_frame.bind(
233
- x,
232
+ var b, R = {}, X = v.react_stack_bottom_frame.bind(
233
+ v,
234
234
  c
235
- )(), G = h(t(c)), de = {};
236
- oe.Fragment = q, oe.jsx = function(e, m, I) {
237
- var A = 1e4 > C.recentlyCreatedOwnerStacks++;
238
- return E(
235
+ )(), k = T(n(c)), oe = {};
236
+ ue.Fragment = Y, ue.jsx = function(e, d, y) {
237
+ var C = 1e4 > g.recentlyCreatedOwnerStacks++;
238
+ return D(
239
239
  e,
240
- m,
241
- I,
240
+ d,
241
+ y,
242
242
  !1,
243
- A ? Error("react-stack-top-frame") : K,
244
- A ? h(t(e)) : G
243
+ C ? Error("react-stack-top-frame") : X,
244
+ C ? T(n(e)) : k
245
245
  );
246
- }, oe.jsxs = function(e, m, I) {
247
- var A = 1e4 > C.recentlyCreatedOwnerStacks++;
248
- return E(
246
+ }, ue.jsxs = function(e, d, y) {
247
+ var C = 1e4 > g.recentlyCreatedOwnerStacks++;
248
+ return D(
249
249
  e,
250
- m,
251
- I,
250
+ d,
251
+ y,
252
252
  !0,
253
- A ? Error("react-stack-top-frame") : K,
254
- A ? h(t(e)) : G
253
+ C ? Error("react-stack-top-frame") : X,
254
+ C ? T(n(e)) : k
255
255
  );
256
256
  };
257
- })()), oe;
257
+ })()), ue;
258
258
  }
259
- var Ce;
260
- function He() {
261
- return Ce || (Ce = 1, process.env.NODE_ENV === "production" ? pe.exports = Re() : pe.exports = Le()), pe.exports;
259
+ var ge;
260
+ function _e() {
261
+ return ge || (ge = 1, process.env.NODE_ENV === "production" ? pe.exports = Oe() : pe.exports = Pe()), pe.exports;
262
262
  }
263
- var u = He();
264
- const we = {
263
+ var m = _e();
264
+ const Le = {
265
265
  id: "EN16931",
266
266
  title: "EN16931 Business Terms",
267
267
  xpaths: {
@@ -1752,478 +1752,495 @@ const we = {
1752
1752
  }
1753
1753
  ]
1754
1754
  };
1755
- function ke(r) {
1756
- return r.replace(/\/@[^/]+$/, "");
1755
+ function Me(t) {
1756
+ return t.replace(/\/@[^/]+$/, "");
1757
1757
  }
1758
- function Ne(r = we) {
1759
- const a = (d, t) => {
1760
- const s = {
1761
- key: t,
1762
- id: d.id,
1763
- title: d.title,
1764
- xpaths: d.xpaths
1758
+ function Ue(t = Le) {
1759
+ const r = (a, n) => {
1760
+ const o = {
1761
+ key: n,
1762
+ id: a.id,
1763
+ title: a.title,
1764
+ xpaths: a.xpaths
1765
1765
  };
1766
- return d.children?.length && (s.children = d.children.map(
1767
- (c, l) => a(c, `${t}.${c.id}:${l}`)
1768
- )), s;
1766
+ return a.children?.length && (o.children = a.children.map(
1767
+ (c, l) => r(c, `${n}.${c.id}:${l}`)
1768
+ )), o;
1769
1769
  };
1770
- return a(r, "EN16931:0");
1770
+ return r(t, "EN16931:0");
1771
1771
  }
1772
- function Oe(r, a) {
1773
- const d = [], t = (s) => {
1774
- const c = s.xpaths?.[a];
1775
- c && d.push({
1776
- key: s.key,
1777
- id: s.id,
1772
+ function He(t, r) {
1773
+ const a = [], n = (o) => {
1774
+ const c = o.xpaths?.[r];
1775
+ c && a.push({
1776
+ key: o.key,
1777
+ id: o.id,
1778
1778
  xpath: c,
1779
- cursorXpath: ke(c)
1780
- }), s.children?.forEach(t);
1779
+ cursorXpath: Me(c)
1780
+ }), o.children?.forEach(n);
1781
1781
  };
1782
- return t(r), d;
1782
+ return n(t), a;
1783
1783
  }
1784
- function Me(r) {
1785
- const { root: a } = r;
1786
- return /* @__PURE__ */ u.jsx("div", { children: /* @__PURE__ */ u.jsx(Ae, { node: a, depth: 0, ...r }) });
1784
+ function ke(t) {
1785
+ const { root: r } = t;
1786
+ return /* @__PURE__ */ m.jsx("div", { children: /* @__PURE__ */ m.jsx(ve, { node: r, depth: 0, ...t }) });
1787
1787
  }
1788
- function Ae(r) {
1788
+ function ve(t) {
1789
1789
  const {
1790
- node: a,
1791
- depth: d,
1792
- expanded: t,
1793
- selectedKey: s,
1790
+ node: r,
1791
+ depth: a,
1792
+ expanded: n,
1793
+ selectedKey: o,
1794
1794
  onClickNode: c,
1795
1795
  getNodeXpath: l,
1796
1796
  getMatchCount: p
1797
- } = r, T = !!a.children?.length, g = t[a.key] ?? !1, E = s === a.key, k = l(a), f = p(a);
1798
- return /* @__PURE__ */ u.jsxs("div", { children: [
1799
- /* @__PURE__ */ u.jsxs(
1797
+ } = t, h = !!r.children?.length, N = n[r.key] ?? !1, D = o === r.key, _ = l(r), I = p(r);
1798
+ return /* @__PURE__ */ m.jsxs("div", { children: [
1799
+ /* @__PURE__ */ m.jsxs(
1800
1800
  "div",
1801
1801
  {
1802
1802
  role: "button",
1803
1803
  tabIndex: 0,
1804
- "data-tree-key": a.key,
1805
- onClick: () => c(a),
1806
- onKeyDown: (x) => x.key === "Enter" && c(a),
1804
+ "data-tree-key": r.key,
1805
+ onClick: () => c(r),
1806
+ onKeyDown: (v) => v.key === "Enter" && c(r),
1807
1807
  style: {
1808
1808
  color: "black",
1809
1809
  display: "flex",
1810
1810
  alignItems: "center",
1811
1811
  gap: 8,
1812
1812
  padding: "6px 8px",
1813
- paddingLeft: d * 12 + 8,
1813
+ paddingLeft: a * 12 + 8,
1814
1814
  borderRadius: 6,
1815
1815
  cursor: "pointer",
1816
- background: E ? "rgba(0,0,0,0.06)" : "transparent",
1816
+ background: D ? "rgba(0,0,0,0.06)" : "transparent",
1817
1817
  userSelect: "none"
1818
1818
  },
1819
- title: k || a.key,
1819
+ title: _ || r.key,
1820
1820
  children: [
1821
- /* @__PURE__ */ u.jsx(
1821
+ /* @__PURE__ */ m.jsx(
1822
1822
  "span",
1823
1823
  {
1824
1824
  style: { width: 16, display: "inline-block", textAlign: "center" },
1825
- children: T ? g ? "▾" : "▸" : "•"
1825
+ children: h ? N ? "▾" : "▸" : "•"
1826
1826
  }
1827
1827
  ),
1828
- /* @__PURE__ */ u.jsx("span", { style: { fontFamily: "monospace", fontSize: 12, opacity: 0.85 }, children: a.id }),
1829
- /* @__PURE__ */ u.jsx("span", { style: { fontSize: 13 }, children: a.title }),
1830
- k && /* @__PURE__ */ u.jsx(u.Fragment, { children: typeof f == "number" && /* @__PURE__ */ u.jsx(
1828
+ /* @__PURE__ */ m.jsx("span", { style: { fontFamily: "monospace", fontSize: 12, opacity: 0.85 }, children: r.id }),
1829
+ /* @__PURE__ */ m.jsx("span", { style: { fontSize: 13 }, children: r.title }),
1830
+ _ && /* @__PURE__ */ m.jsx(m.Fragment, { children: typeof I == "number" && /* @__PURE__ */ m.jsx(
1831
1831
  "span",
1832
1832
  {
1833
1833
  style: {
1834
1834
  marginLeft: "auto",
1835
1835
  fontSize: 11,
1836
1836
  fontFamily: "monospace",
1837
- color: f === 0 ? "#b91c1c" : "#1f2937",
1838
- background: f === 0 ? "#fee2e2" : "#e5e7eb",
1837
+ color: I === 0 ? "#b91c1c" : "#1f2937",
1838
+ background: I === 0 ? "#fee2e2" : "#e5e7eb",
1839
1839
  borderRadius: 999,
1840
1840
  padding: "1px 7px"
1841
1841
  },
1842
- children: f
1842
+ children: I
1843
1843
  }
1844
1844
  ) })
1845
1845
  ]
1846
1846
  }
1847
1847
  ),
1848
- T && g && /* @__PURE__ */ u.jsx("div", { children: a.children.map((x) => /* @__PURE__ */ u.jsx(Ae, { ...r, node: x, depth: d + 1 }, x.key)) })
1848
+ h && N && /* @__PURE__ */ m.jsx("div", { children: r.children.map((v) => /* @__PURE__ */ m.jsx(ve, { ...t, node: v, depth: a + 1 }, v.key)) })
1849
1849
  ] });
1850
1850
  }
1851
- function _e() {
1851
+ const Ae = `(function(){"use strict";var Gt={},zt={},te;function Ee(){return te||(te=1,zt.entityMap={lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",times:"×",divide:"÷",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",euro:"€",trade:"™",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}),zt}var Jt={},ee;function me(){if(ee)return Jt;ee=1;var h=/[A-Z_a-z\\xC0-\\xD6\\xD8-\\xF6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]/,d=new RegExp("[\\\\-\\\\.0-9"+h.source.slice(1,-1)+"\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040]"),A=new RegExp("^"+h.source+d.source+"*(?::"+h.source+d.source+"*)?$"),O=0,F=1,V=2,W=3,it=4,pt=5,mt=6,at=7;function St(f,x){this.message=f,this.locator=x,Error.captureStackTrace&&Error.captureStackTrace(this,St)}St.prototype=new Error,St.prototype.name=St.name;function y(){}y.prototype={parse:function(f,x,N){var U=this.domBuilder;U.startDocument(),ft(x,x={}),$(f,x,N,U,this.errorHandler),U.endDocument()}};function $(f,x,N,U,L){function C(G){if(G>65535){G-=65536;var v=55296+(G>>10),R=56320+(G&1023);return String.fromCharCode(v,R)}else return String.fromCharCode(G)}function _(G){var v=G.slice(1,-1);return v in N?N[v]:v.charAt(0)==="#"?C(parseInt(v.substr(1).replace("x","0x"))):(L.error("entity not found:"+G),G)}function H(G){if(G>lt){var v=f.substring(lt,G).replace(/&#?\\w+;/g,_);Q&&P(lt),U.characters(v,0,G-lt),lt=G}}function P(G,v){for(;G>=k&&(v=nt.exec(f));)M=v.index,k=M+v[0].length,Q.lineNumber++;Q.columnNumber=G-M+1}for(var M=0,k=0,nt=/.*(?:\\r\\n?|\\n)|.*$/g,Q=U.locator,ut=[{currentNSMap:x}],wt={},lt=0;;){try{var z=f.indexOf("<",lt);if(z<0){if(!f.substr(lt).match(/^\\s*$/)){var vt=U.doc,xt=vt.createTextNode(f.substr(lt));vt.appendChild(xt),U.currentElement=xt}return}switch(z>lt&&H(z),f.charAt(z+1)){case"/":var c=f.indexOf(">",z+3),ot=f.substring(z+2,c),q=ut.pop();c<0?(ot=f.substring(z+2).replace(/[\\s<].*/,""),L.error("end tag name: "+ot+" is not complete:"+q.tagName),c=z+1+ot.length):ot.match(/\\s</)&&(ot=ot.replace(/[\\s<].*/,""),L.error("end tag name: "+ot+" maybe not complete"),c=z+1+ot.length);var Mt=q.localNSMap,Ft=q.tagName==ot,Ht=Ft||q.tagName&&q.tagName.toLowerCase()==ot.toLowerCase();if(Ht){if(U.endElement(q.uri,q.localName,ot),Mt)for(var Yt in Mt)U.endPrefixMapping(Yt);Ft||L.fatalError("end tag name: "+ot+" is not match the current start tagName:"+q.tagName)}else ut.push(q);c++;break;case"?":Q&&P(z),c=ht(f,z,U);break;case"!":Q&&P(z),c=Ct(f,z,U,L);break;default:Q&&P(z);var Nt=new b,At=ut[ut.length-1].currentNSMap,c=J(f,z,Nt,At,_,L),Vt=Nt.length;if(!Nt.closed&&bt(f,c,Nt.tagName,wt)&&(Nt.closed=!0,N.nbsp||L.warning("unclosed xml attribute")),Q&&Vt){for(var g=X(Q,{}),Ot=0;Ot<Vt;Ot++){var dt=Nt[Ot];P(dt.offset),dt.locator=X(Q,{})}U.locator=g,j(Nt,U,At)&&ut.push(Nt),U.locator=Q}else j(Nt,U,At)&&ut.push(Nt);Nt.uri==="http://www.w3.org/1999/xhtml"&&!Nt.closed?c=rt(f,c,Nt.tagName,_,U):c++}}catch(G){if(G instanceof St)throw G;L.error("element parse error: "+G),c=-1}c>lt?lt=c:H(Math.max(z,lt)+1)}}function X(f,x){return x.lineNumber=f.lineNumber,x.columnNumber=f.columnNumber,x}function J(f,x,N,U,L,C){function _(Q,ut,wt){Q in N.attributeNames&&C.fatalError("Attribute "+Q+" redefined"),N.addValue(Q,ut,wt)}for(var H,P,M=++x,k=O;;){var nt=f.charAt(M);switch(nt){case"=":if(k===F)H=f.slice(x,M),k=W;else if(k===V)k=W;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(k===W||k===F)if(k===F&&(C.warning('attribute value must after "="'),H=f.slice(x,M)),x=M+1,M=f.indexOf(nt,x),M>0)P=f.slice(x,M).replace(/&#?\\w+;/g,L),_(H,P,x-1),k=pt;else throw new Error("attribute value no end '"+nt+"' match");else if(k==it)P=f.slice(x,M).replace(/&#?\\w+;/g,L),_(H,P,x),C.warning('attribute "'+H+'" missed start quot('+nt+")!!"),x=M+1,k=pt;else throw new Error('attribute value must after "="');break;case"/":switch(k){case O:N.setTagName(f.slice(x,M));case pt:case mt:case at:k=at,N.closed=!0;case it:case F:case V:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return C.error("unexpected end of input"),k==O&&N.setTagName(f.slice(x,M)),M;case">":switch(k){case O:N.setTagName(f.slice(x,M));case pt:case mt:case at:break;case it:case F:P=f.slice(x,M),P.slice(-1)==="/"&&(N.closed=!0,P=P.slice(0,-1));case V:k===V&&(P=H),k==it?(C.warning('attribute "'+P+'" missed quot(")!'),_(H,P.replace(/&#?\\w+;/g,L),x)):((U[""]!=="http://www.w3.org/1999/xhtml"||!P.match(/^(?:disabled|checked|selected)$/i))&&C.warning('attribute "'+P+'" missed value!! "'+P+'" instead!!'),_(P,P,x));break;case W:throw new Error("attribute value missed!!")}return M;case"€":nt=" ";default:if(nt<=" ")switch(k){case O:N.setTagName(f.slice(x,M)),k=mt;break;case F:H=f.slice(x,M),k=V;break;case it:var P=f.slice(x,M).replace(/&#?\\w+;/g,L);C.warning('attribute "'+P+'" missed quot(")!!'),_(H,P,x);case pt:k=mt;break}else switch(k){case V:N.tagName,(U[""]!=="http://www.w3.org/1999/xhtml"||!H.match(/^(?:disabled|checked|selected)$/i))&&C.warning('attribute "'+H+'" missed value!! "'+H+'" instead2!!'),_(H,H,x),x=M,k=F;break;case pt:C.warning('attribute space is required"'+H+'"!!');case mt:k=F,x=M;break;case W:k=it,x=M;break;case at:throw new Error("elements closed character '/' and '>' must be connected to")}}M++}}function j(f,x,N){for(var U=f.tagName,L=null,nt=f.length;nt--;){var C=f[nt],_=C.qName,H=C.value,Q=_.indexOf(":");if(Q>0)var P=C.prefix=_.slice(0,Q),M=_.slice(Q+1),k=P==="xmlns"&&M;else M=_,P=null,k=_==="xmlns"&&"";C.localName=M,k!==!1&&(L==null&&(L={},ft(N,N={})),N[k]=L[k]=H,C.uri="http://www.w3.org/2000/xmlns/",x.startPrefixMapping(k,H))}for(var nt=f.length;nt--;){C=f[nt];var P=C.prefix;P&&(P==="xml"&&(C.uri="http://www.w3.org/XML/1998/namespace"),P!=="xmlns"&&(C.uri=N[P||""]))}var Q=U.indexOf(":");Q>0?(P=f.prefix=U.slice(0,Q),M=f.localName=U.slice(Q+1)):(P=null,M=f.localName=U);var ut=f.uri=N[P||""];if(x.startElement(ut,M,U,f),f.closed){if(x.endElement(ut,M,U),L)for(P in L)x.endPrefixMapping(P)}else return f.currentNSMap=N,f.localNSMap=L,!0}function rt(f,x,N,U,L){if(/^(?:script|textarea)$/i.test(N)){var C=f.indexOf("</"+N+">",x),_=f.substring(x+1,C);if(/[&<]/.test(_))return/^script$/i.test(N)?(L.characters(_,0,_.length),C):(_=_.replace(/&#?\\w+;/g,U),L.characters(_,0,_.length),C)}return x+1}function bt(f,x,N,U){var L=U[N];return L==null&&(L=f.lastIndexOf("</"+N+">"),L<x&&(L=f.lastIndexOf("</"+N)),U[N]=L),L<x}function ft(f,x){for(var N in f)x[N]=f[N]}function Ct(f,x,N,U){var L=f.charAt(x+2);switch(L){case"-":if(f.charAt(x+3)==="-"){var C=f.indexOf("-->",x+4);return C>x?(N.comment(f,x+4,C-x-4),C+3):(U.error("Unclosed comment"),-1)}else return-1;default:if(f.substr(x+3,6)=="CDATA["){var C=f.indexOf("]]>",x+9);return N.startCDATA(),N.characters(f,x+9,C-x-9),N.endCDATA(),C+3}var _=l(f,x),H=_.length;if(H>1&&/!doctype/i.test(_[0][0])){var P=_[1][0],M=!1,k=!1;H>3&&(/^public$/i.test(_[2][0])?(M=_[3][0],k=H>4&&_[4][0]):/^system$/i.test(_[2][0])&&(k=_[3][0]));var nt=_[H-1];return N.startDTD(P,M,k),N.endDTD(),nt.index+nt[0].length}}return-1}function ht(f,x,N){var U=f.indexOf("?>",x);if(U){var L=f.substring(x,U).match(/^<\\?(\\S*)\\s*([\\s\\S]*?)\\s*$/);return L?(L[0].length,N.processingInstruction(L[1],L[2]),U+2):-1}return-1}function b(){this.attributeNames={}}b.prototype={setTagName:function(f){if(!A.test(f))throw new Error("invalid tagName:"+f);this.tagName=f},addValue:function(f,x,N){if(!A.test(f))throw new Error("invalid attribute:"+f);this.attributeNames[f]=this.length,this[this.length++]={qName:f,value:x,offset:N}},length:0,getLocalName:function(f){return this[f].localName},getLocator:function(f){return this[f].locator},getQName:function(f){return this[f].qName},getURI:function(f){return this[f].uri},getValue:function(f){return this[f].value}};function l(f,x){var N,U=[],L=/'[^']+'|"[^"]+"|[^\\s<>\\/=]+=?|(\\/?\\s*>|<)/g;for(L.lastIndex=x,L.exec(f);N=L.exec(f);)if(U.push(N),N[1])return U}return Jt.XMLReader=y,Jt.ParseError=St,Jt}var Xt={},re;function ne(){if(re)return Xt;re=1;function h(n,i){for(var s in n)i[s]=n[s]}function d(n,i){var s=n.prototype;if(!(s instanceof i)){let p=function(){};p.prototype=i.prototype,p=new p,h(s,p),n.prototype=s=p}s.constructor!=n&&(typeof n!="function"&&console.error("unknow Class:"+n),s.constructor=n)}var A="http://www.w3.org/1999/xhtml",O={},F=O.ELEMENT_NODE=1,V=O.ATTRIBUTE_NODE=2,W=O.TEXT_NODE=3,it=O.CDATA_SECTION_NODE=4,pt=O.ENTITY_REFERENCE_NODE=5,mt=O.ENTITY_NODE=6,at=O.PROCESSING_INSTRUCTION_NODE=7,St=O.COMMENT_NODE=8,y=O.DOCUMENT_NODE=9,$=O.DOCUMENT_TYPE_NODE=10,X=O.DOCUMENT_FRAGMENT_NODE=11,J=O.NOTATION_NODE=12,j={},rt={};j.INDEX_SIZE_ERR=(rt[1]="Index size error",1),j.DOMSTRING_SIZE_ERR=(rt[2]="DOMString size error",2);var bt=j.HIERARCHY_REQUEST_ERR=(rt[3]="Hierarchy request error",3);j.WRONG_DOCUMENT_ERR=(rt[4]="Wrong document",4),j.INVALID_CHARACTER_ERR=(rt[5]="Invalid character",5),j.NO_DATA_ALLOWED_ERR=(rt[6]="No data allowed",6),j.NO_MODIFICATION_ALLOWED_ERR=(rt[7]="No modification allowed",7);var ft=j.NOT_FOUND_ERR=(rt[8]="Not found",8);j.NOT_SUPPORTED_ERR=(rt[9]="Not supported",9);var Ct=j.INUSE_ATTRIBUTE_ERR=(rt[10]="Attribute in use",10);j.INVALID_STATE_ERR=(rt[11]="Invalid state",11),j.SYNTAX_ERR=(rt[12]="Syntax error",12),j.INVALID_MODIFICATION_ERR=(rt[13]="Invalid modification",13),j.NAMESPACE_ERR=(rt[14]="Invalid namespace",14),j.INVALID_ACCESS_ERR=(rt[15]="Invalid access",15);function ht(n,i){if(i instanceof Error)var s=i;else s=this,Error.call(this,rt[n]),this.message=rt[n],Error.captureStackTrace&&Error.captureStackTrace(this,ht);return s.code=n,i&&(this.message=this.message+": "+i),s}ht.prototype=Error.prototype,h(j,ht);function b(){}b.prototype={length:0,item:function(n){return this[n]||null},toString:function(n,i){for(var s=[],p=0;p<this.length;p++)dt(this[p],s,n,i);return s.join("")}};function l(n,i){this._node=n,this._refresh=i,f(this)}function f(n){var i=n._node._inc||n._node.ownerDocument._inc;if(n._inc!=i){var s=n._refresh(n._node);R(n,"length",s.length),h(s,n),n._inc=i}}l.prototype.item=function(n){return f(this),this[n]},d(l,b);function x(){}function N(n,i){for(var s=n.length;s--;)if(n[s]===i)return s}function U(n,i,s,p){if(p?i[N(i,p)]=s:i[i.length++]=s,n){s.ownerElement=n;var T=n.ownerDocument;T&&(p&&nt(T,n,p),k(T,n,s))}}function L(n,i,s){var p=N(i,s);if(p>=0){for(var T=i.length-1;p<T;)i[p]=i[++p];if(i.length=T,n){var E=n.ownerDocument;E&&(nt(E,n,s),s.ownerElement=null)}}else throw ht(ft,new Error(n.tagName+"@"+s))}x.prototype={length:0,item:b.prototype.item,getNamedItem:function(n){for(var i=this.length;i--;){var s=this[i];if(s.nodeName==n)return s}},setNamedItem:function(n){var i=n.ownerElement;if(i&&i!=this._ownerElement)throw new ht(Ct);var s=this.getNamedItem(n.nodeName);return U(this._ownerElement,this,n,s),s},setNamedItemNS:function(n){var i=n.ownerElement,s;if(i&&i!=this._ownerElement)throw new ht(Ct);return s=this.getNamedItemNS(n.namespaceURI,n.localName),U(this._ownerElement,this,n,s),s},removeNamedItem:function(n){var i=this.getNamedItem(n);return L(this._ownerElement,this,i),i},removeNamedItemNS:function(n,i){var s=this.getNamedItemNS(n,i);return L(this._ownerElement,this,s),s},getNamedItemNS:function(n,i){for(var s=this.length;s--;){var p=this[s];if(p.localName==i&&p.namespaceURI==n)return p}return null}};function C(n){if(this._features={},n)for(var i in n)this._features=n[i]}C.prototype={hasFeature:function(n,i){var s=this._features[n.toLowerCase()];return!!(s&&(!i||i in s))},createDocument:function(n,i,s){var p=new M;if(p.implementation=this,p.childNodes=new b,p.doctype=s,s&&p.appendChild(s),i){var T=p.createElementNS(n,i);p.appendChild(T)}return p},createDocumentType:function(n,i,s){var p=new Ft;return p.name=n,p.nodeName=n,p.publicId=i,p.systemId=s,p}};function _(){}_.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(n,i){return wt(this,n,i)},replaceChild:function(n,i){this.insertBefore(n,i),i&&this.removeChild(i)},removeChild:function(n){return ut(this,n)},appendChild:function(n){return this.insertBefore(n,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(n){return v(this.ownerDocument||this,this,n)},normalize:function(){for(var n=this.firstChild;n;){var i=n.nextSibling;i&&i.nodeType==W&&n.nodeType==W?(this.removeChild(i),n.appendData(i.data)):(n.normalize(),n=i)}},isSupported:function(n,i){return this.ownerDocument.implementation.hasFeature(n,i)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(n){for(var i=this;i;){var s=i._nsMap;if(s){for(var p in s)if(s[p]==n)return p}i=i.nodeType==V?i.ownerDocument:i.parentNode}return null},lookupNamespaceURI:function(n){for(var i=this;i;){var s=i._nsMap;if(s&&n in s)return s[n];i=i.nodeType==V?i.ownerDocument:i.parentNode}return null},isDefaultNamespace:function(n){var i=this.lookupPrefix(n);return i==null}};function H(n){return n=="<"&&"&lt;"||n==">"&&"&gt;"||n=="&"&&"&amp;"||n=='"'&&"&quot;"||"&#"+n.charCodeAt()+";"}h(O,_),h(O,_.prototype);function P(n,i){if(i(n))return!0;if(n=n.firstChild)do if(P(n,i))return!0;while(n=n.nextSibling)}function M(){}function k(n,i,s){n&&n._inc++;var p=s.namespaceURI;p=="http://www.w3.org/2000/xmlns/"&&(i._nsMap[s.prefix?s.localName:""]=s.value)}function nt(n,i,s,p){n&&n._inc++;var T=s.namespaceURI;T=="http://www.w3.org/2000/xmlns/"&&delete i._nsMap[s.prefix?s.localName:""]}function Q(n,i,s){if(n&&n._inc){n._inc++;var p=i.childNodes;if(s)p[p.length++]=s;else{for(var T=i.firstChild,E=0;T;)p[E++]=T,T=T.nextSibling;p.length=E}}}function ut(n,i){var s=i.previousSibling,p=i.nextSibling;return s?s.nextSibling=p:n.firstChild=p,p?p.previousSibling=s:n.lastChild=s,Q(n.ownerDocument,n),i}function wt(n,i,s){var p=i.parentNode;if(p&&p.removeChild(i),i.nodeType===X){var T=i.firstChild;if(T==null)return i;var E=i.lastChild}else T=E=i;var ct=s?s.previousSibling:n.lastChild;T.previousSibling=ct,E.nextSibling=s,ct?ct.nextSibling=T:n.firstChild=T,s==null?n.lastChild=E:s.previousSibling=E;do T.parentNode=n;while(T!==E&&(T=T.nextSibling));return Q(n.ownerDocument||n,n),i.nodeType==X&&(i.firstChild=i.lastChild=null),i}function lt(n,i){var s=i.parentNode;if(s){var p=n.lastChild;s.removeChild(i);var p=n.lastChild}var p=n.lastChild;return i.parentNode=n,i.previousSibling=p,i.nextSibling=null,p?p.nextSibling=i:n.firstChild=i,n.lastChild=i,Q(n.ownerDocument,n,i),i}M.prototype={nodeName:"#document",nodeType:y,doctype:null,documentElement:null,_inc:1,insertBefore:function(n,i){if(n.nodeType==X){for(var s=n.firstChild;s;){var p=s.nextSibling;this.insertBefore(s,i),s=p}return n}return this.documentElement==null&&n.nodeType==F&&(this.documentElement=n),wt(this,n,i),n.ownerDocument=this,n},removeChild:function(n){return this.documentElement==n&&(this.documentElement=null),ut(this,n)},importNode:function(n,i){return G(this,n,i)},getElementById:function(n){var i=null;return P(this.documentElement,function(s){if(s.nodeType==F&&s.getAttribute("id")==n)return i=s,!0}),i},getElementsByClassName:function(n){var i=new RegExp("(^|\\\\s)"+n+"(\\\\s|$)");return new l(this,function(s){var p=[];return P(s.documentElement,function(T){T!==s&&T.nodeType==F&&i.test(T.getAttribute("class"))&&p.push(T)}),p})},createElement:function(n){var i=new z;i.ownerDocument=this,i.nodeName=n,i.tagName=n,i.childNodes=new b;var s=i.attributes=new x;return s._ownerElement=i,i},createDocumentFragment:function(){var n=new At;return n.ownerDocument=this,n.childNodes=new b,n},createTextNode:function(n){var i=new ot;return i.ownerDocument=this,i.appendData(n),i},createComment:function(n){var i=new q;return i.ownerDocument=this,i.appendData(n),i},createCDATASection:function(n){var i=new Mt;return i.ownerDocument=this,i.appendData(n),i},createProcessingInstruction:function(n,i){var s=new c;return s.ownerDocument=this,s.tagName=s.target=n,s.nodeValue=s.data=i,s},createAttribute:function(n){var i=new vt;return i.ownerDocument=this,i.name=n,i.nodeName=n,i.localName=n,i.specified=!0,i},createEntityReference:function(n){var i=new Nt;return i.ownerDocument=this,i.nodeName=n,i},createElementNS:function(n,i){var s=new z,p=i.split(":"),T=s.attributes=new x;return s.childNodes=new b,s.ownerDocument=this,s.nodeName=i,s.tagName=i,s.namespaceURI=n,p.length==2?(s.prefix=p[0],s.localName=p[1]):s.localName=i,T._ownerElement=s,s},createAttributeNS:function(n,i){var s=new vt,p=i.split(":");return s.ownerDocument=this,s.nodeName=i,s.name=i,s.namespaceURI=n,s.specified=!0,p.length==2?(s.prefix=p[0],s.localName=p[1]):s.localName=i,s}},d(M,_);function z(){this._nsMap={}}z.prototype={nodeType:F,hasAttribute:function(n){return this.getAttributeNode(n)!=null},getAttribute:function(n){var i=this.getAttributeNode(n);return i&&i.value||""},getAttributeNode:function(n){return this.attributes.getNamedItem(n)},setAttribute:function(n,i){var s=this.ownerDocument.createAttribute(n);s.value=s.nodeValue=""+i,this.setAttributeNode(s)},removeAttribute:function(n){var i=this.getAttributeNode(n);i&&this.removeAttributeNode(i)},appendChild:function(n){return n.nodeType===X?this.insertBefore(n,null):lt(this,n)},setAttributeNode:function(n){return this.attributes.setNamedItem(n)},setAttributeNodeNS:function(n){return this.attributes.setNamedItemNS(n)},removeAttributeNode:function(n){return this.attributes.removeNamedItem(n.nodeName)},removeAttributeNS:function(n,i){var s=this.getAttributeNodeNS(n,i);s&&this.removeAttributeNode(s)},hasAttributeNS:function(n,i){return this.getAttributeNodeNS(n,i)!=null},getAttributeNS:function(n,i){var s=this.getAttributeNodeNS(n,i);return s&&s.value||""},setAttributeNS:function(n,i,s){var p=this.ownerDocument.createAttributeNS(n,i);p.value=p.nodeValue=""+s,this.setAttributeNode(p)},getAttributeNodeNS:function(n,i){return this.attributes.getNamedItemNS(n,i)},getElementsByTagName:function(n){return new l(this,function(i){var s=[];return P(i,function(p){p!==i&&p.nodeType==F&&(n==="*"||p.tagName==n)&&s.push(p)}),s})},getElementsByTagNameNS:function(n,i){return new l(this,function(s){var p=[];return P(s,function(T){T!==s&&T.nodeType===F&&(n==="*"||T.namespaceURI===n)&&(i==="*"||T.localName==i)&&p.push(T)}),p})}},M.prototype.getElementsByTagName=z.prototype.getElementsByTagName,M.prototype.getElementsByTagNameNS=z.prototype.getElementsByTagNameNS,d(z,_);function vt(){}vt.prototype.nodeType=V,d(vt,_);function xt(){}xt.prototype={data:"",substringData:function(n,i){return this.data.substring(n,n+i)},appendData:function(n){n=this.data+n,this.nodeValue=this.data=n,this.length=n.length},insertData:function(n,i){this.replaceData(n,0,i)},appendChild:function(n){throw new Error(rt[bt])},deleteData:function(n,i){this.replaceData(n,i,"")},replaceData:function(n,i,s){var p=this.data.substring(0,n),T=this.data.substring(n+i);s=p+s+T,this.nodeValue=this.data=s,this.length=s.length}},d(xt,_);function ot(){}ot.prototype={nodeName:"#text",nodeType:W,splitText:function(n){var i=this.data,s=i.substring(n);i=i.substring(0,n),this.data=this.nodeValue=i,this.length=i.length;var p=this.ownerDocument.createTextNode(s);return this.parentNode&&this.parentNode.insertBefore(p,this.nextSibling),p}},d(ot,xt);function q(){}q.prototype={nodeName:"#comment",nodeType:St},d(q,xt);function Mt(){}Mt.prototype={nodeName:"#cdata-section",nodeType:it},d(Mt,xt);function Ft(){}Ft.prototype.nodeType=$,d(Ft,_);function Ht(){}Ht.prototype.nodeType=J,d(Ht,_);function Yt(){}Yt.prototype.nodeType=mt,d(Yt,_);function Nt(){}Nt.prototype.nodeType=pt,d(Nt,_);function At(){}At.prototype.nodeName="#document-fragment",At.prototype.nodeType=X,d(At,_);function c(){}c.prototype.nodeType=at,d(c,_);function Vt(){}Vt.prototype.serializeToString=function(n,i,s){return g.call(n,i,s)},_.prototype.toString=g;function g(n,i){var s=[],p=this.nodeType==9&&this.documentElement||this,T=p.prefix,E=p.namespaceURI;if(E&&T==null){var T=p.lookupPrefix(E);if(T==null)var ct=[{namespace:E,prefix:null}]}return dt(this,s,n,i,ct),s.join("")}function Ot(n,i,s){var p=n.prefix||"",T=n.namespaceURI;if(!p&&!T||p==="xml"&&T==="http://www.w3.org/XML/1998/namespace"||T=="http://www.w3.org/2000/xmlns/")return!1;for(var E=s.length;E--;){var ct=s[E];if(ct.prefix==p)return ct.namespace!=T}return!0}function dt(n,i,s,p,T){if(p)if(n=p(n),n){if(typeof n=="string"){i.push(n);return}}else return;switch(n.nodeType){case F:T||(T=[]),T.length;var E=n.attributes,ct=E.length,gt=n.firstChild,Dt=n.tagName;s=A===n.namespaceURI||s,i.push("<",Dt);for(var Tt=0;Tt<ct;Tt++){var st=E.item(Tt);st.prefix=="xmlns"?T.push({prefix:st.localName,namespace:st.value}):st.nodeName=="xmlns"&&T.push({prefix:"",namespace:st.value})}for(var Tt=0;Tt<ct;Tt++){var st=E.item(Tt);if(Ot(st,s,T)){var Et=st.prefix||"",I=st.namespaceURI,S=Et?" xmlns:"+Et:" xmlns";i.push(S,'="',I,'"'),T.push({prefix:Et,namespace:I})}dt(st,i,s,p,T)}if(Ot(n,s,T)){var Et=n.prefix||"",I=n.namespaceURI;if(I){var S=Et?" xmlns:"+Et:" xmlns";i.push(S,'="',I,'"'),T.push({prefix:Et,namespace:I})}}if(gt||s&&!/^(?:meta|link|img|br|hr|input)$/i.test(Dt)){if(i.push(">"),s&&/^script$/i.test(Dt))for(;gt;)gt.data?i.push(gt.data):dt(gt,i,s,p,T),gt=gt.nextSibling;else for(;gt;)dt(gt,i,s,p,T),gt=gt.nextSibling;i.push("</",Dt,">")}else i.push("/>");return;case y:case X:for(var gt=n.firstChild;gt;)dt(gt,i,s,p,T),gt=gt.nextSibling;return;case V:return i.push(" ",n.name,'="',n.value.replace(/[<&"]/g,H),'"');case W:return i.push(n.data.replace(/[<&]/g,H).replace(/]]>/g,"]]&gt;"));case it:return i.push("<![CDATA[",n.data,"]]>");case St:return i.push("<!--",n.data,"-->");case $:var _t=n.publicId,yt=n.systemId;if(i.push("<!DOCTYPE ",n.name),_t)i.push(" PUBLIC ",_t),yt&&yt!="."&&i.push(" ",yt),i.push(">");else if(yt&&yt!=".")i.push(" SYSTEM ",yt,">");else{var Bt=n.internalSubset;Bt&&i.push(" [",Bt,"]"),i.push(">")}return;case at:return i.push("<?",n.target," ",n.data,"?>");case pt:return i.push("&",n.nodeName,";");default:i.push("??",n.nodeName)}}function G(n,i,s){var p;switch(i.nodeType){case F:p=i.cloneNode(!1),p.ownerDocument=n;case X:break;case V:s=!0;break}if(p||(p=i.cloneNode(!1)),p.ownerDocument=n,p.parentNode=null,s)for(var T=i.firstChild;T;)p.appendChild(G(n,T,s)),T=T.nextSibling;return p}function v(n,i,s){var p=new i.constructor;for(var T in i){var E=i[T];typeof E!="object"&&E!=p[T]&&(p[T]=E)}switch(i.childNodes&&(p.childNodes=new b),p.ownerDocument=n,p.nodeType){case F:var ct=i.attributes,Dt=p.attributes=new x,Tt=ct.length;Dt._ownerElement=p;for(var st=0;st<Tt;st++)p.setAttributeNode(v(n,ct.item(st),!0));break;case V:s=!0}if(s)for(var Et=i.firstChild;Et;)p.appendChild(v(n,Et,s)),Et=Et.nextSibling;return p}function R(n,i,s){n[i]=s}try{if(Object.defineProperty){let n=function(i){switch(i.nodeType){case F:case X:var s=[];for(i=i.firstChild;i;)i.nodeType!==7&&i.nodeType!==8&&s.push(n(i)),i=i.nextSibling;return s.join("");default:return i.nodeValue}};Object.defineProperty(l.prototype,"length",{get:function(){return f(this),this.$$length}}),Object.defineProperty(_.prototype,"textContent",{get:function(){return n(this)},set:function(i){switch(this.nodeType){case F:case X:for(;this.firstChild;)this.removeChild(this.firstChild);(i||String(i))&&this.appendChild(this.ownerDocument.createTextNode(i));break;default:this.data=i,this.value=i,this.nodeValue=i}}}),R=function(i,s,p){i["$$"+s]=p}}}catch{}return Xt.Node=_,Xt.DOMException=ht,Xt.DOMImplementation=C,Xt.XMLSerializer=Vt,Xt}var ie;function de(){if(ie)return Gt;ie=1;function h(y){this.options=y||{locator:{}}}h.prototype.parseFromString=function(y,$){var X=this.options,J=new mt,j=X.domBuilder||new A,rt=X.errorHandler,bt=X.locator,ft=X.xmlns||{},Ct=/\\/x?html?$/.test($),ht=Ct?it.entityMap:{lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return bt&&j.setDocumentLocator(bt),J.errorHandler=d(rt,j,bt),J.domBuilder=X.domBuilder||j,Ct&&(ft[""]="http://www.w3.org/1999/xhtml"),ft.xml=ft.xml||"http://www.w3.org/XML/1998/namespace",y&&typeof y=="string"?J.parse(y,ft,ht):J.errorHandler.error("invalid doc source"),j.doc};function d(y,$,X){if(!y){if($ instanceof A)return $;y=$}var J={},j=y instanceof Function;X=X||{};function rt(bt){var ft=y[bt];!ft&&j&&(ft=y.length==2?function(Ct){y(bt,Ct)}:y),J[bt]=ft&&function(Ct){ft("[xmldom "+bt+"] "+Ct+F(X))}||function(){}}return rt("warning"),rt("error"),rt("fatalError"),J}function A(){this.cdata=!1}function O(y,$){$.lineNumber=y.lineNumber,$.columnNumber=y.columnNumber}A.prototype={startDocument:function(){this.doc=new St().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(y,$,X,J){var j=this.doc,rt=j.createElementNS(y,X||$),bt=J.length;W(this,rt),this.currentElement=rt,this.locator&&O(this.locator,rt);for(var ft=0;ft<bt;ft++){var y=J.getURI(ft),Ct=J.getValue(ft),X=J.getQName(ft),ht=j.createAttributeNS(y,X);this.locator&&O(J.getLocator(ft),ht),ht.value=ht.nodeValue=Ct,rt.setAttributeNode(ht)}},endElement:function(y,$,X){var J=this.currentElement;J.tagName,this.currentElement=J.parentNode},startPrefixMapping:function(y,$){},endPrefixMapping:function(y){},processingInstruction:function(y,$){var X=this.doc.createProcessingInstruction(y,$);this.locator&&O(this.locator,X),W(this,X)},ignorableWhitespace:function(y,$,X){},characters:function(y,$,X){if(y=V.apply(this,arguments),y){if(this.cdata)var J=this.doc.createCDATASection(y);else var J=this.doc.createTextNode(y);this.currentElement?this.currentElement.appendChild(J):/^\\s*$/.test(y)&&this.doc.appendChild(J),this.locator&&O(this.locator,J)}},skippedEntity:function(y){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(y){(this.locator=y)&&(y.lineNumber=0)},comment:function(y,$,X){y=V.apply(this,arguments);var J=this.doc.createComment(y);this.locator&&O(this.locator,J),W(this,J)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(y,$,X){var J=this.doc.implementation;if(J&&J.createDocumentType){var j=J.createDocumentType(y,$,X);this.locator&&O(this.locator,j),W(this,j)}},warning:function(y){console.warn("[xmldom warning] "+y,F(this.locator))},error:function(y){console.error("[xmldom error] "+y,F(this.locator))},fatalError:function(y){throw new at(y,this.locator)}};function F(y){if(y)return\`
1852
+ @\`+(y.systemId||"")+"#[line:"+y.lineNumber+",col:"+y.columnNumber+"]"}function V(y,$,X){return typeof y=="string"?y.substr($,X):y.length>=$+X||$?new java.lang.String(y,$,X)+"":y}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\\w+/g,function(y){A.prototype[y]=function(){return null}});function W(y,$){y.currentElement?y.currentElement.appendChild($):y.doc.appendChild($)}var it=Ee(),pt=me(),mt=pt.XMLReader,at=pt.ParseError,St=Gt.DOMImplementation=ne().DOMImplementation;return Gt.XMLSerializer=ne().XMLSerializer,Gt.DOMParser=h,Gt.__DOMHandler=A,Gt}var xe=de(),Zt={},oe;function Ne(){return oe||(oe=1,(function(h){var d=h;(function(A){var O="__namespace",F=function(t){return t==null},V=function(t){return t===O||Number.isInteger(t)&&t>=1&&t<=11},W=function(t){return t&&V(t.nodeType)&&typeof t.nodeName=="string"};function it(t){var e=Array.prototype.slice,r=t.length,a=function(u,D){return function(){return D.apply(this,u.concat(e.call(arguments)))}},o=function(){var u=e.call(arguments);return u.length<r?a(u,o):t.apply(this,e.apply(arguments,[0,r]))};return o}var pt=function(t,e){for(var r=0;r<e.length;r+=1)t(e[r],r,e)},mt=function(t,e,r){var a=e;return pt(function(o,u){a=t(a,o,u)},r),a},at=function(t,e){var r=new Array(e.length);return pt(function(a,o){r[o]=t(a)},e),r},St=function(t,e){var r=[];return pt(function(a,o){t(a,o)&&r.push(a)},e),r},y=function(t,e){for(var r=0;r<t.length;r+=1)if(t[r]===e)return!0;return!1};function $(t){return function(){return t}}function X(t){return t.toString()}var J=function(t,e){return e.join(t)},j=function(t,e,r){return t+r+e},rt=Array.prototype.concat,bt=function(t,e){var r=new E;r.addArray(t);var a=r.toArray();return e?a.reverse():a},ft=32767;function Ct(t){for(var e=[],r=0;r<t.length;r+=ft){var a=t.slice(r,r+ft);e=rt.apply(e,a)}return e}function ht(t,e){for(var r=Object(t),a=1;a<arguments.length;a++){var o=arguments[a];if(o!=null)for(var u in o)Object.prototype.hasOwnProperty.call(o,u)&&(r[u]=o[u])}return r}var b={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NAMESPACE_NODE:O};l.prototype=new Object,l.prototype.constructor=l,l.superclass=Object.prototype;function l(){this.init()}l.prototype.init=function(){this.reduceActions=[],this.reduceActions[3]=function(t){return new _(t[0],t[2])},this.reduceActions[5]=function(t){return new H(t[0],t[2])},this.reduceActions[7]=function(t){return new P(t[0],t[2])},this.reduceActions[8]=function(t){return new M(t[0],t[2])},this.reduceActions[10]=function(t){return new k(t[0],t[2])},this.reduceActions[11]=function(t){return new nt(t[0],t[2])},this.reduceActions[12]=function(t){return new Q(t[0],t[2])},this.reduceActions[13]=function(t){return new ut(t[0],t[2])},this.reduceActions[15]=function(t){return new wt(t[0],t[2])},this.reduceActions[16]=function(t){return new lt(t[0],t[2])},this.reduceActions[18]=function(t){return new z(t[0],t[2])},this.reduceActions[19]=function(t){return new vt(t[0],t[2])},this.reduceActions[20]=function(t){return new xt(t[0],t[2])},this.reduceActions[22]=function(t){return new L(t[1])},this.reduceActions[24]=function(t){return new ot(t[0],t[2])},this.reduceActions[25]=function(t){return new q(void 0,void 0,t[0])},this.reduceActions[27]=function(t){return t[0].locationPath=t[2],t[0]},this.reduceActions[28]=function(t){return t[0].locationPath=t[2],t[0].locationPath.steps.unshift(new c(c.DESCENDANTORSELF,g.nodeTest,[])),t[0]},this.reduceActions[29]=function(t){return new q(t[0],[],void 0)},this.reduceActions[30]=function(t){return S.instance_of(t[0],q)?(t[0].filterPredicates==null&&(t[0].filterPredicates=[]),t[0].filterPredicates.push(t[1]),t[0]):new q(t[0],[t[1]],void 0)},this.reduceActions[32]=function(t){return t[1]},this.reduceActions[33]=function(t){return new v(t[0])},this.reduceActions[34]=function(t){return new R(t[0])},this.reduceActions[36]=function(t){return new dt(t[0],[])},this.reduceActions[37]=function(t){return new dt(t[0],t[2])},this.reduceActions[38]=function(t){return[t[0]]},this.reduceActions[39]=function(t){return t[2].unshift(t[0]),t[2]},this.reduceActions[43]=function(t){return new At(!0,[])},this.reduceActions[44]=function(t){return t[1].absolute=!0,t[1]},this.reduceActions[46]=function(t){return new At(!1,[t[0]])},this.reduceActions[47]=function(t){return t[0].steps.push(t[2]),t[0]},this.reduceActions[49]=function(t){return new c(t[0],t[1],[])},this.reduceActions[50]=function(t){return new c(c.CHILD,t[0],[])},this.reduceActions[51]=function(t){return new c(t[0],t[1],t[2])},this.reduceActions[52]=function(t){return new c(c.CHILD,t[0],t[1])},this.reduceActions[54]=function(t){return[t[0]]},this.reduceActions[55]=function(t){return t[1].unshift(t[0]),t[1]},this.reduceActions[56]=function(t){return t[0]=="ancestor"?c.ANCESTOR:t[0]=="ancestor-or-self"?c.ANCESTORORSELF:t[0]=="attribute"?c.ATTRIBUTE:t[0]=="child"?c.CHILD:t[0]=="descendant"?c.DESCENDANT:t[0]=="descendant-or-self"?c.DESCENDANTORSELF:t[0]=="following"?c.FOLLOWING:t[0]=="following-sibling"?c.FOLLOWINGSIBLING:t[0]=="namespace"?c.NAMESPACE:t[0]=="parent"?c.PARENT:t[0]=="preceding"?c.PRECEDING:t[0]=="preceding-sibling"?c.PRECEDINGSIBLING:t[0]=="self"?c.SELF:-1},this.reduceActions[57]=function(t){return c.ATTRIBUTE},this.reduceActions[59]=function(t){return t[0]=="comment"?g.commentTest:t[0]=="text"?g.textTest:t[0]=="processing-instruction"?g.anyPiTest:t[0]=="node"?g.nodeTest:new g(-1,void 0)},this.reduceActions[60]=function(t){return new g.PITest(t[2])},this.reduceActions[61]=function(t){return t[1]},this.reduceActions[63]=function(t){return t[1].absolute=!0,t[1].steps.unshift(new c(c.DESCENDANTORSELF,g.nodeTest,[])),t[1]},this.reduceActions[64]=function(t){return t[0].steps.push(new c(c.DESCENDANTORSELF,g.nodeTest,[])),t[0].steps.push(t[2]),t[0]},this.reduceActions[65]=function(t){return new c(c.SELF,g.nodeTest,[])},this.reduceActions[66]=function(t){return new c(c.PARENT,g.nodeTest,[])},this.reduceActions[67]=function(t){return new Ot(t[1])},this.reduceActions[68]=function(t){return g.nameTestAny},this.reduceActions[69]=function(t){return new g.NameTestPrefixAny(t[0].split(":")[0])},this.reduceActions[70]=function(t){return new g.NameTestQName(t[0])}},l.actionTable=[" s s sssssssss s ss s ss"," s ","r rrrrrrrrr rrrrrrr rr r "," rrrrr "," s s sssssssss s ss s ss","rs rrrrrrrr s sssssrrrrrr rrs rs "," s s sssssssss s ss s ss"," s "," s ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr "," s "," s "," s s sssss s s ","r rrrrrrrrr rrrrrrr rr r ","a ","r s rr r ","r sr rr r ","r s rr s rr r ","r rssrr rss rr r ","r rrrrr rrrss rr r ","r rrrrrsss rrrrr rr r ","r rrrrrrrr rrrrr rr r ","r rrrrrrrr rrrrrs rr r ","r rrrrrrrr rrrrrr rr r ","r rrrrrrrr rrrrrr rr r ","r srrrrrrrr rrrrrrs rr sr ","r srrrrrrrr rrrrrrs rr r ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrr rrrrrr rr r ","r rrrrrrrr rrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r "," sssss ","r rrrrrrrrr rrrrrrr rr sr ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr "," s ","r srrrrrrrr rrrrrrs rr r ","r rrrrrrrr rrrrr rr r "," s "," s "," rrrrr "," s s sssssssss s sss s ss","r srrrrrrrr rrrrrrs rr r "," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss ss s ss"," s s sssssssss s ss s ss"," s s sssss s s "," s s sssss s s ","r rrrrrrrrr rrrrrrr rr rr "," s s sssss s s "," s s sssss s s ","r rrrrrrrrr rrrrrrr rr sr ","r rrrrrrrrr rrrrrrr rr sr ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr rr "," s ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr "," rr "," s "," rs ","r sr rr r ","r s rr s rr r ","r rssrr rss rr r ","r rssrr rss rr r ","r rrrrr rrrss rr r ","r rrrrr rrrss rr r ","r rrrrr rrrss rr r ","r rrrrr rrrss rr r ","r rrrrrsss rrrrr rr r ","r rrrrrsss rrrrr rr r ","r rrrrrrrr rrrrr rr r ","r rrrrrrrr rrrrr rr r ","r rrrrrrrr rrrrr rr r ","r rrrrrrrr rrrrrr rr r "," r "," s ","r srrrrrrrr rrrrrrs rr r ","r srrrrrrrr rrrrrrs rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr "," s s sssssssss s ss s ss","r rrrrrrrrr rrrrrrr rr rr "," r "],l.actionTableNumber=[\` 1 0 /.-,+*)(' & %$ # "!\`," J ","a aaaaaaaaa aaaaaaa aa a "," YYYYY ",\` 1 0 /.-,+*)(' & %$ # "!\`,\`K1 KKKKKKKK . +*)('KKKKKK KK# K" \`,\` 1 0 /.-,+*)(' & %$ # "!\`," N "," O ","e eeeeeeeee eeeeeee ee ee ","f fffffffff fffffff ff ff ","d ddddddddd ddddddd dd dd ","B BBBBBBBBB BBBBBBB BB BB ","A AAAAAAAAA AAAAAAA AA AA "," P "," Q ",\` 1 . +*)(' # " \`,"b bbbbbbbbb bbbbbbb bb b "," ","! S !! ! ",'" T" "" " ',"$ V $$ U $$ $ ","& &ZY&& &XW && & ",") ))))) )))\\\\[ )) ) ",". ....._^] ..... .. . ","1 11111111 11111 11 1 ","5 55555555 55555\` 55 5 ","7 77777777 777777 77 7 ","9 99999999 999999 99 9 ",": c:::::::: ::::::b :: a: ","I fIIIIIIII IIIIIIe II I ","= ========= ======= == == ","? ????????? ??????? ?? ?? ","C CCCCCCCCC CCCCCCC CC CC ","J JJJJJJJJ JJJJJJ JJ J ","M MMMMMMMM MMMMMM MM M ","N NNNNNNNNN NNNNNNN NN N ","P PPPPPPPPP PPPPPPP PP P "," +*)(' ","R RRRRRRRRR RRRRRRR RR aR ","U UUUUUUUUU UUUUUUU UU U ","Z ZZZZZZZZZ ZZZZZZZ ZZ ZZ ","c ccccccccc ccccccc cc cc "," j ","L fLLLLLLLL LLLLLLe LL L ","6 66666666 66666 66 6 "," k "," l "," XXXXX ",\` 1 0 /.-,+*)(' & %$m # "!\`,"_ f________ ______e __ _ ",\` 1 0 /.-,+*)(' & %$ # "!\`,\` 1 0 /.-,+*)(' & %$ # "!\`,\` 1 0 /.-,+*)(' & %$ # "!\`,\` 1 0 /.-,+*)(' & %$ # "!\`,\` 1 0 /.-,+*)(' & %$ # "!\`,\` 1 0 /.-,+*)(' & %$ # "!\`,\` 1 0 /.-,+*)(' & %$ # "!\`,\` 1 0 /.-,+*)(' & %$ # "!\`,\` 1 0 /.-,+*)(' & %$ # "!\`,\` 1 0 /.-,+*)(' & %$ # "!\`,\` 1 0 /.-,+*)(' & %$ # "!\`,\` 1 0 /.-,+*)(' & %$ # "!\`,\` 1 0 /.-,+*)(' & %$ # "!\`,\` 1 0 /.-,+*)(' %$ # "!\`,\` 1 0 /.-,+*)(' & %$ # "!\`,\` 1 . +*)(' # " \`,\` 1 . +*)(' # " \`,"> >>>>>>>>> >>>>>>> >> >> ",\` 1 . +*)(' # " \`,\` 1 . +*)(' # " \`,"Q QQQQQQQQQ QQQQQQQ QQ aQ ","V VVVVVVVVV VVVVVVV VV aV ","T TTTTTTTTT TTTTTTT TT T ","@ @@@@@@@@@ @@@@@@@ @@ @@ "," ‡ ","[ [[[[[[[[[ [[[[[[[ [[ [[ ","D DDDDDDDDD DDDDDDD DD DD "," HH "," ˆ "," F‰ ","# T# ## # ","% V %% U %% % ","' 'ZY'' 'XW '' ' ","( (ZY(( (XW (( ( ","+ +++++ +++\\\\[ ++ + ","* ***** ***\\\\[ ** * ","- ----- ---\\\\[ -- - ",", ,,,,, ,,,\\\\[ ,, , ","0 00000_^] 00000 00 0 ","/ /////_^] ///// // / ","2 22222222 22222 22 2 ","3 33333333 33333 33 3 ","4 44444444 44444 44 4 ","8 88888888 888888 88 8 "," ^ "," Š ","; f;;;;;;;; ;;;;;;e ;; ; ","< f<<<<<<<< <<<<<<e << < ","O OOOOOOOOO OOOOOOO OO O ","\` \`\`\`\`\`\`\`\`\` \`\`\`\`\`\`\` \`\` \` ","S SSSSSSSSS SSSSSSS SS S ","W WWWWWWWWW WWWWWWW WW W ","\\\\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\\\\\ \\\\\\\\ ","E EEEEEEEEE EEEEEEE EE EE ",\` 1 0 /.-,+*)(' & %$ # "!\`,"] ]]]]]]]]] ]]]]]]] ]] ]] "," G "],l.gotoTable=["3456789:;<=>?@ AB CDEFGH IJ "," "," "," ","L456789:;<=>?@ AB CDEFGH IJ "," M EFGH IJ "," N;<=>?@ AB CDEFGH IJ "," "," "," "," "," "," "," "," "," "," S EFGH IJ "," "," "," "," "," "," "," "," "," "," "," "," "," e "," "," "," "," "," "," "," "," "," h J "," i j "," "," "," "," "," "," "," "," "," ","o456789:;<=>?@ ABpqCDEFGH IJ "," "," r6789:;<=>?@ AB CDEFGH IJ "," s789:;<=>?@ AB CDEFGH IJ "," t89:;<=>?@ AB CDEFGH IJ "," u89:;<=>?@ AB CDEFGH IJ "," v9:;<=>?@ AB CDEFGH IJ "," w9:;<=>?@ AB CDEFGH IJ "," x9:;<=>?@ AB CDEFGH IJ "," y9:;<=>?@ AB CDEFGH IJ "," z:;<=>?@ AB CDEFGH IJ "," {:;<=>?@ AB CDEFGH IJ "," |;<=>?@ AB CDEFGH IJ "," };<=>?@ AB CDEFGH IJ "," ~;<=>?@ AB CDEFGH IJ "," =>?@ AB CDEFGH IJ ","€456789:;<=>?@ AB CDEFGH IJ"," ‚ EFGH IJ "," ƒ EFGH IJ "," "," „ GH IJ "," … GH IJ "," i † "," i ‡ "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," ","o456789:;<=>?@ ABŒqCDEFGH IJ "," "," "],l.productions=[[1,1,2],[2,1,3],[3,1,4],[3,3,3,-9,4],[4,1,5],[4,3,4,-8,5],[5,1,6],[5,3,5,-22,6],[5,3,5,-5,6],[6,1,7],[6,3,6,-23,7],[6,3,6,-24,7],[6,3,6,-6,7],[6,3,6,-7,7],[7,1,8],[7,3,7,-25,8],[7,3,7,-26,8],[8,1,9],[8,3,8,-12,9],[8,3,8,-11,9],[8,3,8,-10,9],[9,1,10],[9,2,-26,9],[10,1,11],[10,3,10,-27,11],[11,1,12],[11,1,13],[11,3,13,-28,14],[11,3,13,-4,14],[13,1,15],[13,2,13,16],[15,1,17],[15,3,-29,2,-30],[15,1,-15],[15,1,-16],[15,1,18],[18,3,-13,-29,-30],[18,4,-13,-29,19,-30],[19,1,20],[19,3,20,-31,19],[20,1,2],[12,1,14],[12,1,21],[21,1,-28],[21,2,-28,14],[21,1,22],[14,1,23],[14,3,14,-28,23],[14,1,24],[23,2,25,26],[23,1,26],[23,3,25,26,27],[23,2,26,27],[23,1,28],[27,1,16],[27,2,16,27],[25,2,-14,-3],[25,1,-32],[26,1,29],[26,3,-20,-29,-30],[26,4,-21,-29,-15,-30],[16,3,-33,30,-34],[30,1,2],[22,2,-4,14],[24,3,14,-4,23],[28,1,-35],[28,1,-2],[17,2,-36,-18],[29,1,-17],[29,1,-19],[29,1,-18]],l.DOUBLEDOT=2,l.DOUBLECOLON=3,l.DOUBLESLASH=4,l.NOTEQUAL=5,l.LESSTHANOREQUAL=6,l.GREATERTHANOREQUAL=7,l.AND=8,l.OR=9,l.MOD=10,l.DIV=11,l.MULTIPLYOPERATOR=12,l.FUNCTIONNAME=13,l.AXISNAME=14,l.LITERAL=15,l.NUMBER=16,l.ASTERISKNAMETEST=17,l.QNAME=18,l.NCNAMECOLONASTERISK=19,l.NODETYPE=20,l.PROCESSINGINSTRUCTIONWITHLITERAL=21,l.EQUALS=22,l.LESSTHAN=23,l.GREATERTHAN=24,l.PLUS=25,l.MINUS=26,l.BAR=27,l.SLASH=28,l.LEFTPARENTHESIS=29,l.RIGHTPARENTHESIS=30,l.COMMA=31,l.AT=32,l.LEFTBRACKET=33,l.RIGHTBRACKET=34,l.DOT=35,l.DOLLAR=36,l.prototype.tokenize=function(t){for(var e=[],r=[],a=t+"\\0",o=0,u=a.charAt(o++);;){for(;u==" "||u==" "||u=="\\r"||u==\`
1853
+ \`;)u=a.charAt(o++);if(u=="\\0"||o>=a.length)break;if(u=="("){e.push(l.LEFTPARENTHESIS),r.push(u),u=a.charAt(o++);continue}if(u==")"){e.push(l.RIGHTPARENTHESIS),r.push(u),u=a.charAt(o++);continue}if(u=="["){e.push(l.LEFTBRACKET),r.push(u),u=a.charAt(o++);continue}if(u=="]"){e.push(l.RIGHTBRACKET),r.push(u),u=a.charAt(o++);continue}if(u=="@"){e.push(l.AT),r.push(u),u=a.charAt(o++);continue}if(u==","){e.push(l.COMMA),r.push(u),u=a.charAt(o++);continue}if(u=="|"){e.push(l.BAR),r.push(u),u=a.charAt(o++);continue}if(u=="+"){e.push(l.PLUS),r.push(u),u=a.charAt(o++);continue}if(u=="-"){e.push(l.MINUS),r.push(u),u=a.charAt(o++);continue}if(u=="="){e.push(l.EQUALS),r.push(u),u=a.charAt(o++);continue}if(u=="$"){e.push(l.DOLLAR),r.push(u),u=a.charAt(o++);continue}if(u=="."){if(u=a.charAt(o++),u=="."){e.push(l.DOUBLEDOT),r.push(".."),u=a.charAt(o++);continue}if(u>="0"&&u<="9"){var D="."+u;for(u=a.charAt(o++);u>="0"&&u<="9";)D+=u,u=a.charAt(o++);e.push(l.NUMBER),r.push(D);continue}e.push(l.DOT),r.push(".");continue}if(u=="'"||u=='"'){for(var Z=u,tt="";o<a.length&&(u=a.charAt(o))!==Z;)tt+=u,o+=1;if(u!==Z)throw _t.fromMessage("Unterminated string literal: "+Z+tt);o+=1,e.push(l.LITERAL),r.push(tt),u=a.charAt(o++);continue}if(u>="0"&&u<="9"){var D=u;for(u=a.charAt(o++);u>="0"&&u<="9";)D+=u,u=a.charAt(o++);if(u=="."&&a.charAt(o)>="0"&&a.charAt(o)<="9")for(D+=u,D+=a.charAt(o++),u=a.charAt(o++);u>="0"&&u<="9";)D+=u,u=a.charAt(o++);e.push(l.NUMBER),r.push(D);continue}if(u=="*"){if(e.length>0){var w=e[e.length-1];if(w!=l.AT&&w!=l.DOUBLECOLON&&w!=l.LEFTPARENTHESIS&&w!=l.LEFTBRACKET&&w!=l.AND&&w!=l.OR&&w!=l.MOD&&w!=l.DIV&&w!=l.MULTIPLYOPERATOR&&w!=l.SLASH&&w!=l.DOUBLESLASH&&w!=l.BAR&&w!=l.PLUS&&w!=l.MINUS&&w!=l.EQUALS&&w!=l.NOTEQUAL&&w!=l.LESSTHAN&&w!=l.LESSTHANOREQUAL&&w!=l.GREATERTHAN&&w!=l.GREATERTHANOREQUAL){e.push(l.MULTIPLYOPERATOR),r.push(u),u=a.charAt(o++);continue}}e.push(l.ASTERISKNAMETEST),r.push(u),u=a.charAt(o++);continue}if(u==":"&&a.charAt(o)==":"){e.push(l.DOUBLECOLON),r.push("::"),o++,u=a.charAt(o++);continue}if(u=="/"){if(u=a.charAt(o++),u=="/"){e.push(l.DOUBLESLASH),r.push("//"),u=a.charAt(o++);continue}e.push(l.SLASH),r.push("/");continue}if(u=="!"&&a.charAt(o)=="="){e.push(l.NOTEQUAL),r.push("!="),o++,u=a.charAt(o++);continue}if(u=="<"){if(a.charAt(o)=="="){e.push(l.LESSTHANOREQUAL),r.push("<="),o++,u=a.charAt(o++);continue}e.push(l.LESSTHAN),r.push("<"),u=a.charAt(o++);continue}if(u==">"){if(a.charAt(o)=="="){e.push(l.GREATERTHANOREQUAL),r.push(">="),o++,u=a.charAt(o++);continue}e.push(l.GREATERTHAN),r.push(">"),u=a.charAt(o++);continue}if(u=="_"||S.isLetter(u.charCodeAt(0))){var B=u;for(u=a.charAt(o++);S.isNCNameChar(u.charCodeAt(0));)B+=u,u=a.charAt(o++);if(e.length>0){var w=e[e.length-1];if(w!=l.AT&&w!=l.DOUBLECOLON&&w!=l.LEFTPARENTHESIS&&w!=l.LEFTBRACKET&&w!=l.AND&&w!=l.OR&&w!=l.MOD&&w!=l.DIV&&w!=l.MULTIPLYOPERATOR&&w!=l.SLASH&&w!=l.DOUBLESLASH&&w!=l.BAR&&w!=l.PLUS&&w!=l.MINUS&&w!=l.EQUALS&&w!=l.NOTEQUAL&&w!=l.LESSTHAN&&w!=l.LESSTHANOREQUAL&&w!=l.GREATERTHAN&&w!=l.GREATERTHANOREQUAL){if(B=="and"){e.push(l.AND),r.push(B);continue}if(B=="or"){e.push(l.OR),r.push(B);continue}if(B=="mod"){e.push(l.MOD),r.push(B);continue}if(B=="div"){e.push(l.DIV),r.push(B);continue}}}if(u==":"){if(a.charAt(o)=="*"){e.push(l.NCNAMECOLONASTERISK),r.push(B+":*"),o++,u=a.charAt(o++);continue}if(a.charAt(o)=="_"||S.isLetter(a.charCodeAt(o))){for(B+=":",u=a.charAt(o++);S.isNCNameChar(u.charCodeAt(0));)B+=u,u=a.charAt(o++);if(u=="("){e.push(l.FUNCTIONNAME),r.push(B);continue}e.push(l.QNAME),r.push(B);continue}if(a.charAt(o)==":"){e.push(l.AXISNAME),r.push(B);continue}}if(u=="("){if(B=="comment"||B=="text"||B=="node"){e.push(l.NODETYPE),r.push(B);continue}if(B=="processing-instruction"){a.charAt(o)==")"?e.push(l.NODETYPE):e.push(l.PROCESSINGINSTRUCTIONWITHLITERAL),r.push(B);continue}e.push(l.FUNCTIONNAME),r.push(B);continue}e.push(l.QNAME),r.push(B);continue}throw new Error("Unexpected character "+u)}return e.push(1),r.push("[EOF]"),[e,r]},l.SHIFT="s",l.REDUCE="r",l.ACCEPT="a",l.prototype.parse=function(tt){if(!tt)throw new Error("XPath expression unspecified.");if(typeof tt!="string")throw new Error("XPath expression must be a string.");var e,r,a=this.tokenize(tt);if(a!=null){e=a[0],r=a[1];var o=0,u=[],D=[],Z=[],tt,w,B;for(u.push(0),D.push(1),Z.push("_S"),w=e[o],B=r[o++];;)switch(tt=u[u.length-1],l.actionTable[tt].charAt(w-1)){case l.SHIFT:D.push(-w),Z.push(B),u.push(l.actionTableNumber[tt].charCodeAt(w-1)-32),w=e[o],B=r[o++];break;case l.REDUCE:for(var Lt=l.productions[l.actionTableNumber[tt].charCodeAt(w-1)-32][1],kt=[],jt=0;jt<Lt;jt++)D.pop(),kt.unshift(Z.pop()),u.pop();var qt=u[u.length-1];D.push(l.productions[l.actionTableNumber[tt].charCodeAt(w-1)-32][0]),this.reduceActions[l.actionTableNumber[tt].charCodeAt(w-1)-32]==null?Z.push(kt[0]):Z.push(this.reduceActions[l.actionTableNumber[tt].charCodeAt(w-1)-32](kt)),u.push(l.gotoTable[qt].charCodeAt(l.productions[l.actionTableNumber[tt].charCodeAt(w-1)-32][0]-2)-33);break;case l.ACCEPT:return new f(Z.pop());default:throw new Error("XPath parse error")}}},f.prototype=new Object,f.prototype.constructor=f,f.superclass=Object.prototype;function f(t){this.expression=t}f.prototype.toString=function(){return this.expression.toString()};function x(t,e,r){e in t||(t[e]=r)}f.prototype.evaluate=function(t){var e=t.expressionContextNode;if(!(F(e)||W(e)))throw new Error("Context node does not appear to be a valid DOM node.");return t.contextNode=t.expressionContextNode,t.contextSize=1,t.contextPosition=1,t.isHtml&&(x(t,"caseInsensitive",!0),x(t,"allowAnyNamespaceForNoPrefix",!0)),x(t,"caseInsensitive",!1),this.expression.evaluate(t)},f.XML_NAMESPACE_URI="http://www.w3.org/XML/1998/namespace",f.XMLNS_NAMESPACE_URI="http://www.w3.org/2000/xmlns/",N.prototype=new Object,N.prototype.constructor=N,N.superclass=Object.prototype;function N(){}N.prototype.init=function(){},N.prototype.toString=function(){return"<Expression>"},N.prototype.evaluate=function(t){throw new Error("Could not evaluate expression.")},U.prototype=new N,U.prototype.constructor=U,U.superclass=N.prototype;function U(t){arguments.length>0&&this.init(t)}U.prototype.init=function(t){this.rhs=t},L.prototype=new U,L.prototype.constructor=L,L.superclass=U.prototype;function L(t){arguments.length>0&&this.init(t)}L.prototype.init=function(t){L.superclass.init.call(this,t)},L.prototype.evaluate=function(t){return this.rhs.evaluate(t).number().negate()},L.prototype.toString=function(){return"-"+this.rhs.toString()},C.prototype=new N,C.prototype.constructor=C,C.superclass=N.prototype;function C(t,e){arguments.length>0&&this.init(t,e)}C.prototype.init=function(t,e){this.lhs=t,this.rhs=e},_.prototype=new C,_.prototype.constructor=_,_.superclass=C.prototype;function _(t,e){arguments.length>0&&this.init(t,e)}_.prototype.init=function(t,e){_.superclass.init.call(this,t,e)},_.prototype.toString=function(){return"("+this.lhs.toString()+" or "+this.rhs.toString()+")"},_.prototype.evaluate=function(t){var e=this.lhs.evaluate(t).bool();return e.booleanValue()?e:this.rhs.evaluate(t).bool()},H.prototype=new C,H.prototype.constructor=H,H.superclass=C.prototype;function H(t,e){arguments.length>0&&this.init(t,e)}H.prototype.init=function(t,e){H.superclass.init.call(this,t,e)},H.prototype.toString=function(){return"("+this.lhs.toString()+" and "+this.rhs.toString()+")"},H.prototype.evaluate=function(t){var e=this.lhs.evaluate(t).bool();return e.booleanValue()?this.rhs.evaluate(t).bool():e},P.prototype=new C,P.prototype.constructor=P,P.superclass=C.prototype;function P(t,e){arguments.length>0&&this.init(t,e)}P.prototype.init=function(t,e){P.superclass.init.call(this,t,e)},P.prototype.toString=function(){return"("+this.lhs.toString()+" = "+this.rhs.toString()+")"},P.prototype.evaluate=function(t){return this.lhs.evaluate(t).equals(this.rhs.evaluate(t))},M.prototype=new C,M.prototype.constructor=M,M.superclass=C.prototype;function M(t,e){arguments.length>0&&this.init(t,e)}M.prototype.init=function(t,e){M.superclass.init.call(this,t,e)},M.prototype.toString=function(){return"("+this.lhs.toString()+" != "+this.rhs.toString()+")"},M.prototype.evaluate=function(t){return this.lhs.evaluate(t).notequal(this.rhs.evaluate(t))},k.prototype=new C,k.prototype.constructor=k,k.superclass=C.prototype;function k(t,e){arguments.length>0&&this.init(t,e)}k.prototype.init=function(t,e){k.superclass.init.call(this,t,e)},k.prototype.evaluate=function(t){return this.lhs.evaluate(t).lessthan(this.rhs.evaluate(t))},k.prototype.toString=function(){return"("+this.lhs.toString()+" < "+this.rhs.toString()+")"},nt.prototype=new C,nt.prototype.constructor=nt,nt.superclass=C.prototype;function nt(t,e){arguments.length>0&&this.init(t,e)}nt.prototype.init=function(t,e){nt.superclass.init.call(this,t,e)},nt.prototype.evaluate=function(t){return this.lhs.evaluate(t).greaterthan(this.rhs.evaluate(t))},nt.prototype.toString=function(){return"("+this.lhs.toString()+" > "+this.rhs.toString()+")"},Q.prototype=new C,Q.prototype.constructor=Q,Q.superclass=C.prototype;function Q(t,e){arguments.length>0&&this.init(t,e)}Q.prototype.init=function(t,e){Q.superclass.init.call(this,t,e)},Q.prototype.evaluate=function(t){return this.lhs.evaluate(t).lessthanorequal(this.rhs.evaluate(t))},Q.prototype.toString=function(){return"("+this.lhs.toString()+" <= "+this.rhs.toString()+")"},ut.prototype=new C,ut.prototype.constructor=ut,ut.superclass=C.prototype;function ut(t,e){arguments.length>0&&this.init(t,e)}ut.prototype.init=function(t,e){ut.superclass.init.call(this,t,e)},ut.prototype.evaluate=function(t){return this.lhs.evaluate(t).greaterthanorequal(this.rhs.evaluate(t))},ut.prototype.toString=function(){return"("+this.lhs.toString()+" >= "+this.rhs.toString()+")"},wt.prototype=new C,wt.prototype.constructor=wt,wt.superclass=C.prototype;function wt(t,e){arguments.length>0&&this.init(t,e)}wt.prototype.init=function(t,e){wt.superclass.init.call(this,t,e)},wt.prototype.evaluate=function(t){return this.lhs.evaluate(t).number().plus(this.rhs.evaluate(t).number())},wt.prototype.toString=function(){return"("+this.lhs.toString()+" + "+this.rhs.toString()+")"},lt.prototype=new C,lt.prototype.constructor=lt,lt.superclass=C.prototype;function lt(t,e){arguments.length>0&&this.init(t,e)}lt.prototype.init=function(t,e){lt.superclass.init.call(this,t,e)},lt.prototype.evaluate=function(t){return this.lhs.evaluate(t).number().minus(this.rhs.evaluate(t).number())},lt.prototype.toString=function(){return"("+this.lhs.toString()+" - "+this.rhs.toString()+")"},z.prototype=new C,z.prototype.constructor=z,z.superclass=C.prototype;function z(t,e){arguments.length>0&&this.init(t,e)}z.prototype.init=function(t,e){z.superclass.init.call(this,t,e)},z.prototype.evaluate=function(t){return this.lhs.evaluate(t).number().multiply(this.rhs.evaluate(t).number())},z.prototype.toString=function(){return"("+this.lhs.toString()+" * "+this.rhs.toString()+")"},vt.prototype=new C,vt.prototype.constructor=vt,vt.superclass=C.prototype;function vt(t,e){arguments.length>0&&this.init(t,e)}vt.prototype.init=function(t,e){vt.superclass.init.call(this,t,e)},vt.prototype.evaluate=function(t){return this.lhs.evaluate(t).number().div(this.rhs.evaluate(t).number())},vt.prototype.toString=function(){return"("+this.lhs.toString()+" div "+this.rhs.toString()+")"},xt.prototype=new C,xt.prototype.constructor=xt,xt.superclass=C.prototype;function xt(t,e){arguments.length>0&&this.init(t,e)}xt.prototype.init=function(t,e){xt.superclass.init.call(this,t,e)},xt.prototype.evaluate=function(t){return this.lhs.evaluate(t).number().mod(this.rhs.evaluate(t).number())},xt.prototype.toString=function(){return"("+this.lhs.toString()+" mod "+this.rhs.toString()+")"},ot.prototype=new C,ot.prototype.constructor=ot,ot.superclass=C.prototype;function ot(t,e){arguments.length>0&&this.init(t,e)}ot.prototype.init=function(t,e){ot.superclass.init.call(this,t,e)},ot.prototype.evaluate=function(t){return this.lhs.evaluate(t).nodeset().union(this.rhs.evaluate(t).nodeset())},ot.prototype.toString=function(){return at(X,[this.lhs,this.rhs]).join(" | ")},q.prototype=new N,q.prototype.constructor=q,q.superclass=N.prototype;function q(t,e,r){arguments.length>0&&this.init(t,e,r)}q.prototype.init=function(t,e,r){q.superclass.init.call(this),this.filter=t,this.filterPredicates=e,this.locationPath=r};function Mt(t){for(;t&&t.parentNode;)t=t.parentNode;return t}var Ft=function(t,e,r,a){if(t.length===0)return r;var o=e.extend({});return mt(function(u,D){return o.contextSize=u.length,St(function(Z,tt){return o.contextNode=Z,o.contextPosition=tt+1,q.predicateMatches(D,o)},u)},bt(r,a),t)};q.getRoot=function(t,e){var r=e[0];if(r&&r.nodeType===b.DOCUMENT_NODE)return r;if(t.virtualRoot)return t.virtualRoot;if(!r)throw new Error("Context node not found when determining document root.");var a=r.ownerDocument;if(a)return a;for(var o=r;o.parentNode!=null;)o=o.parentNode;return o};var Ht=function(t){var e=String(t.name);return e==="xmlns"?"":e.substring(0,6)==="xmlns:"?e.substring(6,e.length):null};q.applyStep=function(t,e,r){if(!r)throw new Error("Context node not found when evaluating XPath step: "+t);var a=[];switch(e.contextNode=r,t.axis){case c.ANCESTOR:if(e.contextNode===e.virtualRoot)break;var o;for(e.contextNode.nodeType==b.ATTRIBUTE_NODE?o=q.getOwnerElement(e.contextNode):o=e.contextNode.parentNode;o!=null&&(t.nodeTest.matches(o,e)&&a.push(o),o!==e.virtualRoot);)o=o.parentNode;break;case c.ANCESTORORSELF:for(var o=e.contextNode;o!=null&&(t.nodeTest.matches(o,e)&&a.push(o),o!==e.virtualRoot);o=o.nodeType==b.ATTRIBUTE_NODE?q.getOwnerElement(o):o.parentNode);break;case c.ATTRIBUTE:var u=e.contextNode.attributes;if(u!=null)for(var D=0;D<u.length;D++){var o=u.item(D);t.nodeTest.matches(o,e)&&a.push(o)}break;case c.CHILD:for(var o=e.contextNode.firstChild;o!=null;o=o.nextSibling)t.nodeTest.matches(o,e)&&a.push(o);break;case c.DESCENDANT:for(var B=[e.contextNode.firstChild];B.length>0;)for(var o=B.pop();o!=null;)t.nodeTest.matches(o,e)&&a.push(o),o.firstChild!=null?(B.push(o.nextSibling),o=o.firstChild):o=o.nextSibling;break;case c.DESCENDANTORSELF:t.nodeTest.matches(e.contextNode,e)&&a.push(e.contextNode);for(var B=[e.contextNode.firstChild];B.length>0;)for(var o=B.pop();o!=null;)t.nodeTest.matches(o,e)&&a.push(o),o.firstChild!=null?(B.push(o.nextSibling),o=o.firstChild):o=o.nextSibling;break;case c.FOLLOWING:if(e.contextNode===e.virtualRoot)break;var B=[];e.contextNode.firstChild!=null?B.unshift(e.contextNode.firstChild):B.unshift(e.contextNode.nextSibling);for(var o=e.contextNode.parentNode;o!=null&&o.nodeType!=b.DOCUMENT_NODE&&o!==e.virtualRoot;o=o.parentNode)B.unshift(o.nextSibling);do for(var o=B.pop();o!=null;)t.nodeTest.matches(o,e)&&a.push(o),o.firstChild!=null?(B.push(o.nextSibling),o=o.firstChild):o=o.nextSibling;while(B.length>0);break;case c.FOLLOWINGSIBLING:if(e.contextNode===e.virtualRoot)break;for(var o=e.contextNode.nextSibling;o!=null;o=o.nextSibling)t.nodeTest.matches(o,e)&&a.push(o);break;case c.NAMESPACE:var Z={};if(e.contextNode.nodeType==b.ELEMENT_NODE){Z.xml=new ct("xml",null,f.XML_NAMESPACE_URI,e.contextNode);for(var o=e.contextNode;o!=null&&o.nodeType==b.ELEMENT_NODE;o=o.parentNode)for(var D=0;D<o.attributes.length;D++){var tt=o.attributes.item(D),w=Ht(tt);w!=null&&Z[w]==null&&(Z[w]=new ct(w,tt,tt.value,e.contextNode))}for(var w in Z){var r=Z[w];t.nodeTest.matches(r,e)&&a.push(r)}}break;case c.PARENT:o=null,e.contextNode!==e.virtualRoot&&(e.contextNode.nodeType==b.ATTRIBUTE_NODE?o=q.getOwnerElement(e.contextNode):o=e.contextNode.parentNode),o!=null&&t.nodeTest.matches(o,e)&&a.push(o);break;case c.PRECEDING:var B;e.virtualRoot!=null?B=[e.virtualRoot]:B=[Mt(e.contextNode)];t:for(;B.length>0;)for(var o=B.pop();o!=null;){if(o==e.contextNode)break t;t.nodeTest.matches(o,e)&&a.unshift(o),o.firstChild!=null?(B.push(o.nextSibling),o=o.firstChild):o=o.nextSibling}break;case c.PRECEDINGSIBLING:if(e.contextNode===e.virtualRoot)break;for(var o=e.contextNode.previousSibling;o!=null;o=o.previousSibling)t.nodeTest.matches(o,e)&&a.push(o);break;case c.SELF:t.nodeTest.matches(e.contextNode,e)&&a.push(e.contextNode);break}return a};function Yt(t,e,r){return Ft(t.predicates,e,q.applyStep(t,e,r),y(Vt,t.axis))}function Nt(t,e,r){return Ct(at(Yt.bind(null,r,t),e))}q.applySteps=function(t,e,r){return mt(Nt.bind(null,e),r,t)},q.prototype.applyFilter=function(t,e){if(!this.filter)return{nodes:[t.contextNode]};var r=this.filter.evaluate(t);if(!S.instance_of(r,E)){if(this.filterPredicates!=null&&this.filterPredicates.length>0||this.locationPath!=null)throw new Error("Path expression filter must evaluate to a nodeset if predicates or location path are used");return{nonNodes:r}}return{nodes:Ft(this.filterPredicates||[],e,r.toUnsortedArray(),!1)}},q.applyLocationPath=function(t,e,r){if(!t)return r;var a=t.absolute?[q.getRoot(e,r)]:r;return q.applySteps(t.steps,e,a)},q.prototype.evaluate=function(t){var e=ht(new Dt,t),r=this.applyFilter(t,e);if("nonNodes"in r)return r.nonNodes;var a=new E;return a.addArray(q.applyLocationPath(this.locationPath,e,r.nodes)),a},q.predicateMatches=function(t,e){var r=t.evaluate(e);return S.instance_of(r,R)?e.contextPosition===r.numberValue():r.booleanValue()},q.predicateString=function(t){return j("[","]",t.toString())},q.predicatesString=function(t){return J("",at(q.predicateString,t))},q.prototype.toString=function(){if(this.filter!=null){var t=X(this.filter);return S.instance_of(this.filter,v)?j("'","'",t):this.filterPredicates!=null&&this.filterPredicates.length?j("(",")",t)+q.predicatesString(this.filterPredicates):this.locationPath!=null?t+(this.locationPath.absolute?"":"/")+X(this.locationPath):t}return X(this.locationPath)},q.getOwnerElement=function(t){if(t.ownerElement)return t.ownerElement;try{if(t.selectSingleNode)return t.selectSingleNode("..")}catch{}for(var e=t.nodeType==b.DOCUMENT_NODE?t:t.ownerDocument,r=e.getElementsByTagName("*"),a=0;a<r.length;a++)for(var o=r.item(a),u=o.attributes,D=0;D<u.length;D++){var Z=u.item(D);if(Z===t)return o}return null},At.prototype=new Object,At.prototype.constructor=At,At.superclass=Object.prototype;function At(t,e){arguments.length>0&&this.init(t,e)}At.prototype.init=function(t,e){this.absolute=t,this.steps=e},At.prototype.toString=function(){return(this.absolute?"/":"")+at(X,this.steps).join("/")},c.prototype=new Object,c.prototype.constructor=c,c.superclass=Object.prototype;function c(t,e,r){arguments.length>0&&this.init(t,e,r)}c.prototype.init=function(t,e,r){this.axis=t,this.nodeTest=e,this.predicates=r},c.prototype.toString=function(){return c.STEPNAMES[this.axis]+"::"+this.nodeTest.toString()+q.predicatesString(this.predicates)},c.ANCESTOR=0,c.ANCESTORORSELF=1,c.ATTRIBUTE=2,c.CHILD=3,c.DESCENDANT=4,c.DESCENDANTORSELF=5,c.FOLLOWING=6,c.FOLLOWINGSIBLING=7,c.NAMESPACE=8,c.PARENT=9,c.PRECEDING=10,c.PRECEDINGSIBLING=11,c.SELF=12,c.STEPNAMES=mt(function(t,e){return t[e[0]]=e[1],t},{},[[c.ANCESTOR,"ancestor"],[c.ANCESTORORSELF,"ancestor-or-self"],[c.ATTRIBUTE,"attribute"],[c.CHILD,"child"],[c.DESCENDANT,"descendant"],[c.DESCENDANTORSELF,"descendant-or-self"],[c.FOLLOWING,"following"],[c.FOLLOWINGSIBLING,"following-sibling"],[c.NAMESPACE,"namespace"],[c.PARENT,"parent"],[c.PRECEDING,"preceding"],[c.PRECEDINGSIBLING,"preceding-sibling"],[c.SELF,"self"]]);var Vt=[c.ANCESTOR,c.ANCESTORORSELF,c.PARENT,c.PRECEDING,c.PRECEDINGSIBLING];g.prototype=new Object,g.prototype.constructor=g,g.superclass=Object.prototype;function g(t,e){arguments.length>0&&this.init(t,e)}g.prototype.init=function(t,e){this.type=t,this.value=e},g.prototype.toString=function(){return"<unknown nodetest type>"},g.prototype.matches=function(t,e){console.warn("unknown node test type")},g.NAMETESTANY=0,g.NAMETESTPREFIXANY=1,g.NAMETESTQNAME=2,g.COMMENT=3,g.TEXT=4,g.PI=5,g.NODE=6,g.isNodeType=function(t){return function(e){return y(t,e.nodeType)}},g.makeNodeTestType=function(t,e,r){var a=r||function(){};return a.prototype=new g(t),a.prototype.constructor=a,ht(a.prototype,e),a},g.makeNodeTypeTest=function(t,e,r){return new(g.makeNodeTestType(t,{matches:g.isNodeType(e),toString:$(r)}))},g.hasPrefix=function(t){return t.prefix||(t.nodeName||t.tagName).indexOf(":")!==-1},g.isElementOrAttribute=g.isNodeType([1,2]),g.nameSpaceMatches=function(t,e,r){var a=r.namespaceURI||"";if(!t)return!a||e.allowAnyNamespaceForNoPrefix&&!g.hasPrefix(r);var o=e.namespaceResolver.getNamespace(t,e.expressionContextNode);if(o==null)throw new Error("Cannot resolve QName "+t);return o===a},g.localNameMatches=function(t,e,r){var a=r.localName||r.nodeName;return e.caseInsensitive?t.toLowerCase()===a.toLowerCase():t===a},g.NameTestPrefixAny=g.makeNodeTestType(g.NAMETESTPREFIXANY,{matches:function(t,e){return g.isElementOrAttribute(t)&&g.nameSpaceMatches(this.prefix,e,t)},toString:function(){return this.prefix+":*"}},function(e){this.prefix=e}),g.NameTestQName=g.makeNodeTestType(g.NAMETESTQNAME,{matches:function(t,e){return g.isNodeType([b.ELEMENT_NODE,b.ATTRIBUTE_NODE,b.NAMESPACE_NODE])(t)&&g.nameSpaceMatches(this.prefix,e,t)&&g.localNameMatches(this.localName,e,t)},toString:function(){return this.name}},function(e){var r=e.split(":");this.name=e,this.prefix=r.length>1?r[0]:null,this.localName=r[r.length>1?1:0]}),g.PITest=g.makeNodeTestType(g.PI,{matches:function(t,e){return g.isNodeType([b.PROCESSING_INSTRUCTION_NODE])(t)&&(t.target||t.nodeName)===this.name},toString:function(){return j('processing-instruction("','")',this.name)}},function(t){this.name=t}),g.nameTestAny=g.makeNodeTypeTest(g.NAMETESTANY,[b.ELEMENT_NODE,b.ATTRIBUTE_NODE,b.NAMESPACE_NODE],"*"),g.textTest=g.makeNodeTypeTest(g.TEXT,[b.TEXT_NODE,b.CDATA_SECTION_NODE],"text()"),g.commentTest=g.makeNodeTypeTest(g.COMMENT,[b.COMMENT_NODE],"comment()"),g.nodeTest=g.makeNodeTypeTest(g.NODE,[b.ELEMENT_NODE,b.ATTRIBUTE_NODE,b.TEXT_NODE,b.CDATA_SECTION_NODE,b.PROCESSING_INSTRUCTION_NODE,b.COMMENT_NODE,b.DOCUMENT_NODE],"node()"),g.anyPiTest=g.makeNodeTypeTest(g.PI,[b.PROCESSING_INSTRUCTION_NODE],"processing-instruction()"),Ot.prototype=new N,Ot.prototype.constructor=Ot,Ot.superclass=N.prototype;function Ot(t){arguments.length>0&&this.init(t)}Ot.prototype.init=function(t){this.variable=t},Ot.prototype.toString=function(){return"$"+this.variable},Ot.prototype.evaluate=function(t){var e=S.resolveQName(this.variable,t.namespaceResolver,t.contextNode,!1);if(e[0]==null)throw new Error("Cannot resolve QName "+fn);var r=t.variableResolver.getVariable(e[1],e[0]);if(!r)throw _t.fromMessage("Undeclared variable: "+this.toString());return r},dt.prototype=new N,dt.prototype.constructor=dt,dt.superclass=N.prototype;function dt(t,e){arguments.length>0&&this.init(t,e)}dt.prototype.init=function(t,e){this.functionName=t,this.arguments=e},dt.prototype.toString=function(){for(var t=this.functionName+"(",e=0;e<this.arguments.length;e++)e>0&&(t+=", "),t+=this.arguments[e].toString();return t+")"},dt.prototype.evaluate=function(t){var e=st.getFunctionFromContext(this.functionName,t);if(!e)throw new Error("Unknown function "+this.functionName);var r=[t].concat(this.arguments);return e.apply(t.functionResolver.thisArg,r)};var G=new Object;G.equals=function(t,e){return t.equals(e)},G.notequal=function(t,e){return t.notequal(e)},G.lessthan=function(t,e){return t.lessthan(e)},G.greaterthan=function(t,e){return t.greaterthan(e)},G.lessthanorequal=function(t,e){return t.lessthanorequal(e)},G.greaterthanorequal=function(t,e){return t.greaterthanorequal(e)},v.prototype=new N,v.prototype.constructor=v,v.superclass=N.prototype;function v(t){arguments.length>0&&this.init(t)}v.prototype.init=function(t){this.str=String(t)},v.prototype.toString=function(){return this.str},v.prototype.evaluate=function(t){return this},v.prototype.string=function(){return this},v.prototype.number=function(){return new R(this.str)},v.prototype.bool=function(){return new s(this.str)},v.prototype.nodeset=function(){throw new Error("Cannot convert string to nodeset")},v.prototype.stringValue=function(){return this.str},v.prototype.numberValue=function(){return this.number().numberValue()},v.prototype.booleanValue=function(){return this.bool().booleanValue()},v.prototype.equals=function(t){return S.instance_of(t,s)?this.bool().equals(t):S.instance_of(t,R)?this.number().equals(t):S.instance_of(t,E)?t.compareWithString(this,G.equals):new s(this.str==t.str)},v.prototype.notequal=function(t){return S.instance_of(t,s)?this.bool().notequal(t):S.instance_of(t,R)?this.number().notequal(t):S.instance_of(t,E)?t.compareWithString(this,G.notequal):new s(this.str!=t.str)},v.prototype.lessthan=function(t){return this.number().lessthan(t)},v.prototype.greaterthan=function(t){return this.number().greaterthan(t)},v.prototype.lessthanorequal=function(t){return this.number().lessthanorequal(t)},v.prototype.greaterthanorequal=function(t){return this.number().greaterthanorequal(t)},R.prototype=new N,R.prototype.constructor=R,R.superclass=N.prototype;function R(t){arguments.length>0&&this.init(t)}R.prototype.init=function(t){this.num=typeof t=="string"?this.parse(t):Number(t)},R.prototype.numberFormat=/^\\s*-?[0-9]*\\.?[0-9]+\\s*$/,R.prototype.parse=function(t){return this.numberFormat.test(t)?parseFloat(t):Number.NaN};function n(t){for(var e=t.split("e-"),r=e[0].replace(".",""),a=Number(e[1]),o=0;o<a-1;o+=1)r="0"+r;return"0."+r}function i(t){for(var e=t.split("e"),r=e[0].replace(".",""),a=Number(e[1]),o=a+1-r.length,u=0;u<o;u+=1)r+="0";return r}R.prototype.toString=function(){var t=this.num.toString();return t.indexOf("e-")!==-1?n(t):t.indexOf("e")!==-1?i(t):t},R.prototype.evaluate=function(t){return this},R.prototype.string=function(){return new v(this.toString())},R.prototype.number=function(){return this},R.prototype.bool=function(){return new s(this.num)},R.prototype.nodeset=function(){throw new Error("Cannot convert number to nodeset")},R.prototype.stringValue=function(){return this.string().stringValue()},R.prototype.numberValue=function(){return this.num},R.prototype.booleanValue=function(){return this.bool().booleanValue()},R.prototype.negate=function(){return new R(-this.num)},R.prototype.equals=function(t){return S.instance_of(t,s)?this.bool().equals(t):S.instance_of(t,v)?this.equals(t.number()):S.instance_of(t,E)?t.compareWithNumber(this,G.equals):new s(this.num==t.num)},R.prototype.notequal=function(t){return S.instance_of(t,s)?this.bool().notequal(t):S.instance_of(t,v)?this.notequal(t.number()):S.instance_of(t,E)?t.compareWithNumber(this,G.notequal):new s(this.num!=t.num)},R.prototype.lessthan=function(t){return S.instance_of(t,E)?t.compareWithNumber(this,G.greaterthan):S.instance_of(t,s)||S.instance_of(t,v)?this.lessthan(t.number()):new s(this.num<t.num)},R.prototype.greaterthan=function(t){return S.instance_of(t,E)?t.compareWithNumber(this,G.lessthan):S.instance_of(t,s)||S.instance_of(t,v)?this.greaterthan(t.number()):new s(this.num>t.num)},R.prototype.lessthanorequal=function(t){return S.instance_of(t,E)?t.compareWithNumber(this,G.greaterthanorequal):S.instance_of(t,s)||S.instance_of(t,v)?this.lessthanorequal(t.number()):new s(this.num<=t.num)},R.prototype.greaterthanorequal=function(t){return S.instance_of(t,E)?t.compareWithNumber(this,G.lessthanorequal):S.instance_of(t,s)||S.instance_of(t,v)?this.greaterthanorequal(t.number()):new s(this.num>=t.num)},R.prototype.plus=function(t){return new R(this.num+t.num)},R.prototype.minus=function(t){return new R(this.num-t.num)},R.prototype.multiply=function(t){return new R(this.num*t.num)},R.prototype.div=function(t){return new R(this.num/t.num)},R.prototype.mod=function(t){return new R(this.num%t.num)},s.prototype=new N,s.prototype.constructor=s,s.superclass=N.prototype;function s(t){arguments.length>0&&this.init(t)}s.prototype.init=function(t){this.b=!!t},s.prototype.toString=function(){return this.b.toString()},s.prototype.evaluate=function(t){return this},s.prototype.string=function(){return new v(this.b)},s.prototype.number=function(){return new R(this.b)},s.prototype.bool=function(){return this},s.prototype.nodeset=function(){throw new Error("Cannot convert boolean to nodeset")},s.prototype.stringValue=function(){return this.string().stringValue()},s.prototype.numberValue=function(){return this.number().numberValue()},s.prototype.booleanValue=function(){return this.b},s.prototype.not=function(){return new s(!this.b)},s.prototype.equals=function(t){return S.instance_of(t,v)||S.instance_of(t,R)?this.equals(t.bool()):S.instance_of(t,E)?t.compareWithBoolean(this,G.equals):new s(this.b==t.b)},s.prototype.notequal=function(t){return S.instance_of(t,v)||S.instance_of(t,R)?this.notequal(t.bool()):S.instance_of(t,E)?t.compareWithBoolean(this,G.notequal):new s(this.b!=t.b)},s.prototype.lessthan=function(t){return this.number().lessthan(t)},s.prototype.greaterthan=function(t){return this.number().greaterthan(t)},s.prototype.lessthanorequal=function(t){return this.number().lessthanorequal(t)},s.prototype.greaterthanorequal=function(t){return this.number().greaterthanorequal(t)},s.true_=new s(!0),s.false_=new s(!1),p.prototype=new Object,p.prototype.constructor=p,p.superclass=Object.prototype;function p(t){this.init(t)}p.prototype.init=function(t){this.left=null,this.right=null,this.node=t,this.depth=1},p.prototype.balance=function(){var t=this.left==null?0:this.left.depth,e=this.right==null?0:this.right.depth;if(t>e+1){var r=this.left.left==null?0:this.left.left.depth,a=this.left.right==null?0:this.left.right.depth;r<a&&this.left.rotateRR(),this.rotateLL()}else if(t+1<e){var o=this.right.right==null?0:this.right.right.depth,u=this.right.left==null?0:this.right.left.depth;u>o&&this.right.rotateLL(),this.rotateRR()}},p.prototype.rotateLL=function(){var t=this.node,e=this.right;this.node=this.left.node,this.right=this.left,this.left=this.left.left,this.right.left=this.right.right,this.right.right=e,this.right.node=t,this.right.updateInNewLocation(),this.updateInNewLocation()},p.prototype.rotateRR=function(){var t=this.node,e=this.left;this.node=this.right.node,this.left=this.right,this.right=this.right.right,this.left.right=this.left.left,this.left.left=e,this.left.node=t,this.left.updateInNewLocation(),this.updateInNewLocation()},p.prototype.updateInNewLocation=function(){this.getDepthFromChildren()},p.prototype.getDepthFromChildren=function(){this.depth=this.node==null?0:1,this.left!=null&&(this.depth=this.left.depth+1),this.right!=null&&this.depth<=this.right.depth&&(this.depth=this.right.depth+1)};function T(t,e){if(t===e)return 0;if(t.compareDocumentPosition){var r=t.compareDocumentPosition(e);return r&1||r&10?1:r&20?-1:0}for(var a=0,o=0,u=t;u!=null;u=u.parentNode||u.ownerElement)a++;for(var D=e;D!=null;D=D.parentNode||D.ownerElement)o++;if(a>o){for(;a>o;)t=t.parentNode||t.ownerElement,a--;if(t===e)return 1}else if(o>a){for(;o>a;)e=e.parentNode||e.ownerElement,o--;if(t===e)return-1}for(var Z=t.parentNode||t.ownerElement,tt=e.parentNode||e.ownerElement;Z!==tt;)t=Z,e=tt,Z=t.parentNode||t.ownerElement,tt=e.parentNode||e.ownerElement;var w=gt(t),B=gt(e);if(w&&!B)return-1;if(!w&&B)return 1;if(t.isXPathNamespace){if(t.nodeValue===f.XML_NAMESPACE_URI||!e.isXPathNamespace)return-1;if(e.nodeValue===f.XML_NAMESPACE_URI)return 1}else if(e.isXPathNamespace)return 1;if(Z)for(var Lt=w?Z.attributes:Z.childNodes,kt=Lt.length,jt=t.baseNode||t,qt=e.baseNode||e,Qt=0;Qt<kt;Qt+=1){var Kt=Lt[Qt];if(Kt===jt)return-1;if(Kt===qt)return 1}throw new Error("Unexpected: could not determine node order")}p.prototype.add=function(t){if(t===this.node)return!1;var e=T(t,this.node),r=!1;return e==-1?this.left==null?(this.left=new p(t),r=!0):(r=this.left.add(t),r&&this.balance()):e==1&&(this.right==null?(this.right=new p(t),r=!0):(r=this.right.add(t),r&&this.balance())),r&&this.getDepthFromChildren(),r},E.prototype=new N,E.prototype.constructor=E,E.superclass=N.prototype;function E(){this.init()}E.prototype.init=function(){this.tree=null,this.nodes=[],this.size=0},E.prototype.toString=function(){var t=this.first();return t==null?"":this.stringForNode(t)},E.prototype.evaluate=function(t){return this},E.prototype.string=function(){return new v(this.toString())},E.prototype.stringValue=function(){return this.toString()},E.prototype.number=function(){return new R(this.string())},E.prototype.numberValue=function(){return Number(this.string())},E.prototype.bool=function(){return new s(this.booleanValue())},E.prototype.booleanValue=function(){return!!this.size},E.prototype.nodeset=function(){return this},E.prototype.stringForNode=function(t){return t.nodeType==b.DOCUMENT_NODE||t.nodeType==b.ELEMENT_NODE||t.nodeType===b.DOCUMENT_FRAGMENT_NODE?this.stringForContainerNode(t):t.nodeType===b.ATTRIBUTE_NODE?t.value||t.nodeValue:t.isNamespaceNode?t.namespace:t.nodeValue},E.prototype.stringForContainerNode=function(t){for(var e="",r=t.firstChild;r!=null;r=r.nextSibling){var a=r.nodeType;(a===1||a===3||a===4||a===9||a===11)&&(e+=this.stringForNode(r))}return e},E.prototype.buildTree=function(){if(!this.tree&&this.nodes.length){this.tree=new p(this.nodes[0]);for(var t=1;t<this.nodes.length;t+=1)this.tree.add(this.nodes[t])}return this.tree},E.prototype.first=function(){var t=this.buildTree();if(t==null)return null;for(;t.left!=null;)t=t.left;return t.node},E.prototype.add=function(t){for(var e=0;e<this.nodes.length;e+=1)if(t===this.nodes[e])return;this.tree=null,this.nodes.push(t),this.size+=1},E.prototype.addArray=function(t){var e=this;pt(function(r){e.add(r)},t)},E.prototype.toArray=function(){var t=[];return this.toArrayRec(this.buildTree(),t),t},E.prototype.toArrayRec=function(t,e){t!=null&&(this.toArrayRec(t.left,e),e.push(t.node),this.toArrayRec(t.right,e))},E.prototype.toUnsortedArray=function(){return this.nodes.slice()},E.prototype.compareWithString=function(t,e){for(var r=this.toUnsortedArray(),a=0;a<r.length;a++){var o=r[a],u=new v(this.stringForNode(o)),D=e(u,t);if(D.booleanValue())return D}return new s(!1)},E.prototype.compareWithNumber=function(t,e){for(var r=this.toUnsortedArray(),a=0;a<r.length;a++){var o=r[a],u=new R(this.stringForNode(o)),D=e(u,t);if(D.booleanValue())return D}return new s(!1)},E.prototype.compareWithBoolean=function(t,e){return e(this.bool(),t)},E.prototype.compareWithNodeSet=function(t,e){for(var r=this.toUnsortedArray(),a=function(Z,tt){return e(tt,Z)},o=0;o<r.length;o++){var u=new v(this.stringForNode(r[o])),D=t.compareWithString(u,a);if(D.booleanValue())return D}return new s(!1)},E.compareWith=it(function(t,e){return S.instance_of(e,v)?this.compareWithString(e,t):S.instance_of(e,R)?this.compareWithNumber(e,t):S.instance_of(e,s)?this.compareWithBoolean(e,t):this.compareWithNodeSet(e,t)}),E.prototype.equals=E.compareWith(G.equals),E.prototype.notequal=E.compareWith(G.notequal),E.prototype.lessthan=E.compareWith(G.lessthan),E.prototype.greaterthan=E.compareWith(G.greaterthan),E.prototype.lessthanorequal=E.compareWith(G.lessthanorequal),E.prototype.greaterthanorequal=E.compareWith(G.greaterthanorequal),E.prototype.union=function(t){var e=new E;return e.addArray(this.toUnsortedArray()),e.addArray(t.toUnsortedArray()),e},ct.prototype=new Object,ct.prototype.constructor=ct,ct.superclass=Object.prototype;function ct(t,e,r,a){this.isXPathNamespace=!0,this.baseNode=e,this.ownerDocument=a.ownerDocument,this.nodeName=t,this.prefix=t,this.localName=t,this.namespaceURI=null,this.nodeValue=r,this.ownerElement=a,this.nodeType=b.NAMESPACE_NODE}ct.prototype.toString=function(){return'{ "'+this.prefix+'", "'+this.namespaceURI+'" }'},Dt.prototype=new Object,Dt.prototype.constructor=Dt,Dt.superclass=Object.prototype;function Dt(t,e,r){this.variableResolver=t??new Tt,this.namespaceResolver=e??new Et,this.functionResolver=r??new st}Dt.prototype.extend=function(t){return ht(new Dt,this,t)},Tt.prototype=new Object,Tt.prototype.constructor=Tt,Tt.superclass=Object.prototype;function Tt(){}Tt.prototype.getVariable=function(t,e){return null},st.prototype=new Object,st.prototype.constructor=st,st.superclass=Object.prototype;function st(t){this.thisArg=t??I,this.functions=new Object,this.addStandardFunctions()}st.prototype.addStandardFunctions=function(){this.functions["{}last"]=I.last,this.functions["{}position"]=I.position,this.functions["{}count"]=I.count,this.functions["{}id"]=I.id,this.functions["{}local-name"]=I.localName,this.functions["{}namespace-uri"]=I.namespaceURI,this.functions["{}name"]=I.name,this.functions["{}string"]=I.string,this.functions["{}concat"]=I.concat,this.functions["{}starts-with"]=I.startsWith,this.functions["{}contains"]=I.contains,this.functions["{}substring-before"]=I.substringBefore,this.functions["{}substring-after"]=I.substringAfter,this.functions["{}substring"]=I.substring,this.functions["{}string-length"]=I.stringLength,this.functions["{}normalize-space"]=I.normalizeSpace,this.functions["{}translate"]=I.translate,this.functions["{}boolean"]=I.boolean_,this.functions["{}not"]=I.not,this.functions["{}true"]=I.true_,this.functions["{}false"]=I.false_,this.functions["{}lang"]=I.lang,this.functions["{}number"]=I.number,this.functions["{}sum"]=I.sum,this.functions["{}floor"]=I.floor,this.functions["{}ceiling"]=I.ceiling,this.functions["{}round"]=I.round},st.prototype.addFunction=function(t,e,r){this.functions["{"+t+"}"+e]=r},st.getFunctionFromContext=function(t,e){var r=S.resolveQName(t,e.namespaceResolver,e.contextNode,!1);if(r[0]===null)throw new Error("Cannot resolve QName "+name);return e.functionResolver.getFunction(r[1],r[0])},st.prototype.getFunction=function(t,e){return this.functions["{"+e+"}"+t]},Et.prototype=new Object,Et.prototype.constructor=Et,Et.superclass=Object.prototype;function Et(){}Et.prototype.getNamespace=function(t,e){if(t=="xml")return f.XML_NAMESPACE_URI;if(t=="xmlns")return f.XMLNS_NAMESPACE_URI;for(e.nodeType==b.DOCUMENT_NODE?e=e.documentElement:e.nodeType==b.ATTRIBUTE_NODE?e=q.getOwnerElement(e):e.nodeType!=b.ELEMENT_NODE&&(e=e.parentNode);e!=null&&e.nodeType==b.ELEMENT_NODE;){for(var r=e.attributes,a=0;a<r.length;a++){var o=r.item(a),u=o.name||o.nodeName;if(u==="xmlns"&&t===""||u==="xmlns:"+t)return String(o.value||o.nodeValue)}e=e.parentNode}return null};var I=new Object;I.last=function(t){if(arguments.length!=1)throw new Error("Function last expects ()");return new R(t.contextSize)},I.position=function(t){if(arguments.length!=1)throw new Error("Function position expects ()");return new R(t.contextPosition)},I.count=function(){var t=arguments[0],e;if(arguments.length!=2||!S.instance_of(e=arguments[1].evaluate(t),E))throw new Error("Function count expects (node-set)");return new R(e.size)},I.id=function(){var t=arguments[0],e;if(arguments.length!=2)throw new Error("Function id expects (object)");e=arguments[1].evaluate(t),S.instance_of(e,E)?e=e.toArray().join(" "):e=e.stringValue();for(var r=e.split(/[\\x0d\\x0a\\x09\\x20]+/),a=new E,o=t.contextNode.nodeType==b.DOCUMENT_NODE?t.contextNode:t.contextNode.ownerDocument,u=0;u<r.length;u++){var D;o.getElementById?D=o.getElementById(r[u]):D=S.getElementById(o,r[u]),D!=null&&a.add(D)}return a},I.localName=function(t,e){var r;if(arguments.length==1)r=t.contextNode;else if(arguments.length==2)r=e.evaluate(t).first();else throw new Error("Function local-name expects (node-set?)");return r==null?new v(""):new v(r.localName||r.baseName||r.target||r.nodeName||"")},I.namespaceURI=function(){var t=arguments[0],e;if(arguments.length==1)e=t.contextNode;else if(arguments.length==2)e=arguments[1].evaluate(t).first();else throw new Error("Function namespace-uri expects (node-set?)");return e==null?new v(""):new v(e.namespaceURI||"")},I.name=function(){var t=arguments[0],e;if(arguments.length==1)e=t.contextNode;else if(arguments.length==2)e=arguments[1].evaluate(t).first();else throw new Error("Function name expects (node-set?)");return e==null?new v(""):e.nodeType==b.ELEMENT_NODE?new v(e.nodeName):e.nodeType==b.ATTRIBUTE_NODE?new v(e.name||e.nodeName):e.nodeType===b.PROCESSING_INSTRUCTION_NODE?new v(e.target||e.nodeName):e.localName==null?new v(""):new v(e.localName)},I.string=function(){var t=arguments[0];if(arguments.length==1)return new v(E.prototype.stringForNode(t.contextNode));if(arguments.length==2)return arguments[1].evaluate(t).string();throw new Error("Function string expects (object?)")},I.concat=function(t){if(arguments.length<3)throw new Error("Function concat expects (string, string[, string]*)");for(var e="",r=1;r<arguments.length;r++)e+=arguments[r].evaluate(t).stringValue();return new v(e)},I.startsWith=function(){var t=arguments[0];if(arguments.length!=3)throw new Error("Function startsWith expects (string, string)");var e=arguments[1].evaluate(t).stringValue(),r=arguments[2].evaluate(t).stringValue();return new s(e.substring(0,r.length)==r)},I.contains=function(){var t=arguments[0];if(arguments.length!=3)throw new Error("Function contains expects (string, string)");var e=arguments[1].evaluate(t).stringValue(),r=arguments[2].evaluate(t).stringValue();return new s(e.indexOf(r)!==-1)},I.substringBefore=function(){var t=arguments[0];if(arguments.length!=3)throw new Error("Function substring-before expects (string, string)");var e=arguments[1].evaluate(t).stringValue(),r=arguments[2].evaluate(t).stringValue();return new v(e.substring(0,e.indexOf(r)))},I.substringAfter=function(){var t=arguments[0];if(arguments.length!=3)throw new Error("Function substring-after expects (string, string)");var e=arguments[1].evaluate(t).stringValue(),r=arguments[2].evaluate(t).stringValue();if(r.length==0)return new v(e);var a=e.indexOf(r);return a==-1?new v(""):new v(e.substring(a+r.length))},I.substring=function(){var t=arguments[0];if(!(arguments.length==3||arguments.length==4))throw new Error("Function substring expects (string, number, number?)");var e=arguments[1].evaluate(t).stringValue(),r=Math.round(arguments[2].evaluate(t).numberValue())-1,a=arguments.length==4?r+Math.round(arguments[3].evaluate(t).numberValue()):void 0;return new v(e.substring(r,a))},I.stringLength=function(){var t=arguments[0],e;if(arguments.length==1)e=E.prototype.stringForNode(t.contextNode);else if(arguments.length==2)e=arguments[1].evaluate(t).stringValue();else throw new Error("Function string-length expects (string?)");return new R(e.length)},I.normalizeSpace=function(){var t=arguments[0],e;if(arguments.length==1)e=E.prototype.stringForNode(t.contextNode);else if(arguments.length==2)e=arguments[1].evaluate(t).stringValue();else throw new Error("Function normalize-space expects (string?)");for(var r=0,a=e.length-1;S.isSpace(e.charCodeAt(a));)a--;for(var o="";r<=a&&S.isSpace(e.charCodeAt(r));)r++;for(;r<=a;)if(S.isSpace(e.charCodeAt(r)))for(o+=" ";r<=a&&S.isSpace(e.charCodeAt(r));)r++;else o+=e.charAt(r),r++;return new v(o)},I.translate=function(t,e,r,a){if(arguments.length!=4)throw new Error("Function translate expects (string, string, string)");var o=e.evaluate(t).stringValue(),u=r.evaluate(t).stringValue(),D=a.evaluate(t).stringValue(),Z=mt(function(w,B,Lt){return B in w||(w[B]=Lt>D.length?"":D[Lt]),w},{},u),tt=J("",at(function(w){return w in Z?Z[w]:w},o));return new v(tt)},I.boolean_=function(){var t=arguments[0];if(arguments.length!=2)throw new Error("Function boolean expects (object)");return arguments[1].evaluate(t).bool()},I.not=function(t,e){if(arguments.length!=2)throw new Error("Function not expects (object)");return e.evaluate(t).bool().not()},I.true_=function(){if(arguments.length!=1)throw new Error("Function true expects ()");return s.true_},I.false_=function(){if(arguments.length!=1)throw new Error("Function false expects ()");return s.false_},I.lang=function(){var t=arguments[0];if(arguments.length!=2)throw new Error("Function lang expects (string)");for(var e,r=t.contextNode;r!=null&&r.nodeType!=b.DOCUMENT_NODE;r=r.parentNode){var a=r.getAttributeNS(f.XML_NAMESPACE_URI,"lang");if(a!=null){e=String(a);break}}if(e==null)return s.false_;var o=arguments[1].evaluate(t).stringValue();return new s(e.substring(0,o.length)==o&&(e.length==o.length||e.charAt(o.length)=="-"))},I.number=function(){var t=arguments[0];if(!(arguments.length==1||arguments.length==2))throw new Error("Function number expects (object?)");return arguments.length==1?new R(E.prototype.stringForNode(t.contextNode)):arguments[1].evaluate(t).number()},I.sum=function(){var t=arguments[0],e;if(arguments.length!=2||!S.instance_of(e=arguments[1].evaluate(t),E))throw new Error("Function sum expects (node-set)");e=e.toUnsortedArray();for(var r=0,a=0;a<e.length;a++)r+=new R(E.prototype.stringForNode(e[a])).numberValue();return new R(r)},I.floor=function(){var t=arguments[0];if(arguments.length!=2)throw new Error("Function floor expects (number)");return new R(Math.floor(arguments[1].evaluate(t).numberValue()))},I.ceiling=function(){var t=arguments[0];if(arguments.length!=2)throw new Error("Function ceiling expects (number)");return new R(Math.ceil(arguments[1].evaluate(t).numberValue()))},I.round=function(){var t=arguments[0];if(arguments.length!=2)throw new Error("Function round expects (number)");return new R(Math.round(arguments[1].evaluate(t).numberValue()))};var S=new Object,gt=function(t){return t&&(t.nodeType===b.ATTRIBUTE_NODE||t.ownerElement||t.isXPathNamespace)};S.splitQName=function(t){var e=t.indexOf(":");return e==-1?[null,t]:[t.substring(0,e),t.substring(e+1)]},S.resolveQName=function(t,e,r,a){var o=S.splitQName(t);return o[0]!=null?o[0]=e.getNamespace(o[0],r):a?(o[0]=e.getNamespace("",r),o[0]==null&&(o[0]="")):o[0]="",o},S.isSpace=function(t){return t==9||t==13||t==10||t==32},S.isLetter=function(t){return t>=65&&t<=90||t>=97&&t<=122||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=255||t>=256&&t<=305||t>=308&&t<=318||t>=321&&t<=328||t>=330&&t<=382||t>=384&&t<=451||t>=461&&t<=496||t>=500&&t<=501||t>=506&&t<=535||t>=592&&t<=680||t>=699&&t<=705||t==902||t>=904&&t<=906||t==908||t>=910&&t<=929||t>=931&&t<=974||t>=976&&t<=982||t==986||t==988||t==990||t==992||t>=994&&t<=1011||t>=1025&&t<=1036||t>=1038&&t<=1103||t>=1105&&t<=1116||t>=1118&&t<=1153||t>=1168&&t<=1220||t>=1223&&t<=1224||t>=1227&&t<=1228||t>=1232&&t<=1259||t>=1262&&t<=1269||t>=1272&&t<=1273||t>=1329&&t<=1366||t==1369||t>=1377&&t<=1414||t>=1488&&t<=1514||t>=1520&&t<=1522||t>=1569&&t<=1594||t>=1601&&t<=1610||t>=1649&&t<=1719||t>=1722&&t<=1726||t>=1728&&t<=1742||t>=1744&&t<=1747||t==1749||t>=1765&&t<=1766||t>=2309&&t<=2361||t==2365||t>=2392&&t<=2401||t>=2437&&t<=2444||t>=2447&&t<=2448||t>=2451&&t<=2472||t>=2474&&t<=2480||t==2482||t>=2486&&t<=2489||t>=2524&&t<=2525||t>=2527&&t<=2529||t>=2544&&t<=2545||t>=2565&&t<=2570||t>=2575&&t<=2576||t>=2579&&t<=2600||t>=2602&&t<=2608||t>=2610&&t<=2611||t>=2613&&t<=2614||t>=2616&&t<=2617||t>=2649&&t<=2652||t==2654||t>=2674&&t<=2676||t>=2693&&t<=2699||t==2701||t>=2703&&t<=2705||t>=2707&&t<=2728||t>=2730&&t<=2736||t>=2738&&t<=2739||t>=2741&&t<=2745||t==2749||t==2784||t>=2821&&t<=2828||t>=2831&&t<=2832||t>=2835&&t<=2856||t>=2858&&t<=2864||t>=2866&&t<=2867||t>=2870&&t<=2873||t==2877||t>=2908&&t<=2909||t>=2911&&t<=2913||t>=2949&&t<=2954||t>=2958&&t<=2960||t>=2962&&t<=2965||t>=2969&&t<=2970||t==2972||t>=2974&&t<=2975||t>=2979&&t<=2980||t>=2984&&t<=2986||t>=2990&&t<=2997||t>=2999&&t<=3001||t>=3077&&t<=3084||t>=3086&&t<=3088||t>=3090&&t<=3112||t>=3114&&t<=3123||t>=3125&&t<=3129||t>=3168&&t<=3169||t>=3205&&t<=3212||t>=3214&&t<=3216||t>=3218&&t<=3240||t>=3242&&t<=3251||t>=3253&&t<=3257||t==3294||t>=3296&&t<=3297||t>=3333&&t<=3340||t>=3342&&t<=3344||t>=3346&&t<=3368||t>=3370&&t<=3385||t>=3424&&t<=3425||t>=3585&&t<=3630||t==3632||t>=3634&&t<=3635||t>=3648&&t<=3653||t>=3713&&t<=3714||t==3716||t>=3719&&t<=3720||t==3722||t==3725||t>=3732&&t<=3735||t>=3737&&t<=3743||t>=3745&&t<=3747||t==3749||t==3751||t>=3754&&t<=3755||t>=3757&&t<=3758||t==3760||t>=3762&&t<=3763||t==3773||t>=3776&&t<=3780||t>=3904&&t<=3911||t>=3913&&t<=3945||t>=4256&&t<=4293||t>=4304&&t<=4342||t==4352||t>=4354&&t<=4355||t>=4357&&t<=4359||t==4361||t>=4363&&t<=4364||t>=4366&&t<=4370||t==4412||t==4414||t==4416||t==4428||t==4430||t==4432||t>=4436&&t<=4437||t==4441||t>=4447&&t<=4449||t==4451||t==4453||t==4455||t==4457||t>=4461&&t<=4462||t>=4466&&t<=4467||t==4469||t==4510||t==4520||t==4523||t>=4526&&t<=4527||t>=4535&&t<=4536||t==4538||t>=4540&&t<=4546||t==4587||t==4592||t==4601||t>=7680&&t<=7835||t>=7840&&t<=7929||t>=7936&&t<=7957||t>=7960&&t<=7965||t>=7968&&t<=8005||t>=8008&&t<=8013||t>=8016&&t<=8023||t==8025||t==8027||t==8029||t>=8031&&t<=8061||t>=8064&&t<=8116||t>=8118&&t<=8124||t==8126||t>=8130&&t<=8132||t>=8134&&t<=8140||t>=8144&&t<=8147||t>=8150&&t<=8155||t>=8160&&t<=8172||t>=8178&&t<=8180||t>=8182&&t<=8188||t==8486||t>=8490&&t<=8491||t==8494||t>=8576&&t<=8578||t>=12353&&t<=12436||t>=12449&&t<=12538||t>=12549&&t<=12588||t>=44032&&t<=55203||t>=19968&&t<=40869||t==12295||t>=12321&&t<=12329},S.isNCNameChar=function(t){return t>=48&&t<=57||t>=1632&&t<=1641||t>=1776&&t<=1785||t>=2406&&t<=2415||t>=2534&&t<=2543||t>=2662&&t<=2671||t>=2790&&t<=2799||t>=2918&&t<=2927||t>=3047&&t<=3055||t>=3174&&t<=3183||t>=3302&&t<=3311||t>=3430&&t<=3439||t>=3664&&t<=3673||t>=3792&&t<=3801||t>=3872&&t<=3881||t==46||t==45||t==95||S.isLetter(t)||t>=768&&t<=837||t>=864&&t<=865||t>=1155&&t<=1158||t>=1425&&t<=1441||t>=1443&&t<=1465||t>=1467&&t<=1469||t==1471||t>=1473&&t<=1474||t==1476||t>=1611&&t<=1618||t==1648||t>=1750&&t<=1756||t>=1757&&t<=1759||t>=1760&&t<=1764||t>=1767&&t<=1768||t>=1770&&t<=1773||t>=2305&&t<=2307||t==2364||t>=2366&&t<=2380||t==2381||t>=2385&&t<=2388||t>=2402&&t<=2403||t>=2433&&t<=2435||t==2492||t==2494||t==2495||t>=2496&&t<=2500||t>=2503&&t<=2504||t>=2507&&t<=2509||t==2519||t>=2530&&t<=2531||t==2562||t==2620||t==2622||t==2623||t>=2624&&t<=2626||t>=2631&&t<=2632||t>=2635&&t<=2637||t>=2672&&t<=2673||t>=2689&&t<=2691||t==2748||t>=2750&&t<=2757||t>=2759&&t<=2761||t>=2763&&t<=2765||t>=2817&&t<=2819||t==2876||t>=2878&&t<=2883||t>=2887&&t<=2888||t>=2891&&t<=2893||t>=2902&&t<=2903||t>=2946&&t<=2947||t>=3006&&t<=3010||t>=3014&&t<=3016||t>=3018&&t<=3021||t==3031||t>=3073&&t<=3075||t>=3134&&t<=3140||t>=3142&&t<=3144||t>=3146&&t<=3149||t>=3157&&t<=3158||t>=3202&&t<=3203||t>=3262&&t<=3268||t>=3270&&t<=3272||t>=3274&&t<=3277||t>=3285&&t<=3286||t>=3330&&t<=3331||t>=3390&&t<=3395||t>=3398&&t<=3400||t>=3402&&t<=3405||t==3415||t==3633||t>=3636&&t<=3642||t>=3655&&t<=3662||t==3761||t>=3764&&t<=3769||t>=3771&&t<=3772||t>=3784&&t<=3789||t>=3864&&t<=3865||t==3893||t==3895||t==3897||t==3902||t==3903||t>=3953&&t<=3972||t>=3974&&t<=3979||t>=3984&&t<=3989||t==3991||t>=3993&&t<=4013||t>=4017&&t<=4023||t==4025||t>=8400&&t<=8412||t==8417||t>=12330&&t<=12335||t==12441||t==12442||t==183||t==720||t==721||t==903||t==1600||t==3654||t==3782||t==12293||t>=12337&&t<=12341||t>=12445&&t<=12446||t>=12540&&t<=12542},S.coalesceText=function(t){for(var e=t.firstChild;e!=null;e=e.nextSibling)if(e.nodeType==b.TEXT_NODE||e.nodeType==b.CDATA_SECTION_NODE){var r=e.nodeValue,a=e;for(e=e.nextSibling;e!=null&&(e.nodeType==b.TEXT_NODE||e.nodeType==b.CDATA_SECTION_NODE);){r+=e.nodeValue;var o=e;e=e.nextSibling,o.parentNode.removeChild(o)}if(a.nodeType==b.CDATA_SECTION_NODE){var u=a.parentNode;if(a.nextSibling==null)u.removeChild(a),u.appendChild(u.ownerDocument.createTextNode(r));else{var D=a.nextSibling;u.removeChild(a),u.insertBefore(u.ownerDocument.createTextNode(r),D)}}else a.nodeValue=r;if(e==null)break}else e.nodeType==b.ELEMENT_NODE&&S.coalesceText(e)},S.instance_of=function(t,e){for(;t!=null;){if(t.constructor===e)return!0;if(t===Object)return!1;t=t.constructor.superclass}return!1},S.getElementById=function(t,e){if(t.nodeType==b.ELEMENT_NODE&&(t.getAttribute("id")==e||t.getAttributeNS(null,"id")==e))return t;for(var r=t.firstChild;r!=null;r=r.nextSibling){var a=S.getElementById(r,e);if(a!=null)return a}return null};var _t=(function(){function t(r,a){var o=a?": "+a.toString():"";switch(r){case e.INVALID_EXPRESSION_ERR:return"Invalid expression"+o;case e.TYPE_ERR:return"Type error"+o}return null}function e(r,a,o){var u=Error.call(this,t(r,a)||o);return u.code=r,u.exception=a,u}return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e.superclass=Error,e.prototype.toString=function(){return this.message},e.fromMessage=function(r,a){return new e(null,a,r)},e.INVALID_EXPRESSION_ERR=51,e.TYPE_ERR=52,e})();yt.prototype={},yt.prototype.constructor=yt,yt.superclass=Object.prototype;function yt(t,e,r){this.xpath=r.parse(t),this.context=new Dt,this.context.namespaceResolver=new Bt(e)}yt.getOwnerDocument=function(t){return t.nodeType===b.DOCUMENT_NODE?t:t.ownerDocument},yt.detectHtmlDom=function(t){if(!t)return!1;var e=yt.getOwnerDocument(t);try{return e.implementation.hasFeature("HTML","2.0")}catch{return!0}},yt.prototype.evaluate=function(t,e,r){this.context.expressionContextNode=t,this.context.caseInsensitive=yt.detectHtmlDom(t);var a=this.xpath.evaluate(this.context);return new Y(a,e)},Bt.prototype={},Bt.prototype.constructor=Bt,Bt.superclass=Object.prototype;function Bt(t){this.xpathNSResolver=t}Bt.prototype.getNamespace=function(t,e){return this.xpathNSResolver==null?null:this.xpathNSResolver.lookupNamespaceURI(t)},Wt.prototype={},Wt.prototype.constructor=Wt,Wt.superclass=Object.prototype;function Wt(t){this.node=t,this.namespaceResolver=new Et}Wt.prototype.lookupNamespaceURI=function(t){return this.namespaceResolver.getNamespace(t,this.node)},Y.prototype={},Y.prototype.constructor=Y,Y.superclass=Object.prototype;function Y(t,e){switch(e==Y.ANY_TYPE&&(t.constructor===v?e=Y.STRING_TYPE:t.constructor===R?e=Y.NUMBER_TYPE:t.constructor===s?e=Y.BOOLEAN_TYPE:t.constructor===E&&(e=Y.UNORDERED_NODE_ITERATOR_TYPE)),this.resultType=e,e){case Y.NUMBER_TYPE:this.numberValue=t.numberValue();return;case Y.STRING_TYPE:this.stringValue=t.stringValue();return;case Y.BOOLEAN_TYPE:this.booleanValue=t.booleanValue();return;case Y.ANY_UNORDERED_NODE_TYPE:case Y.FIRST_ORDERED_NODE_TYPE:if(t.constructor===E){this.singleNodeValue=t.first();return}break;case Y.UNORDERED_NODE_ITERATOR_TYPE:case Y.ORDERED_NODE_ITERATOR_TYPE:if(t.constructor===E){this.invalidIteratorState=!1,this.nodes=t.toArray(),this.iteratorIndex=0;return}break;case Y.UNORDERED_NODE_SNAPSHOT_TYPE:case Y.ORDERED_NODE_SNAPSHOT_TYPE:if(t.constructor===E){this.nodes=t.toArray(),this.snapshotLength=this.nodes.length;return}break}throw new _t(_t.TYPE_ERR)}Y.prototype.iterateNext=function(){if(this.resultType!=Y.UNORDERED_NODE_ITERATOR_TYPE&&this.resultType!=Y.ORDERED_NODE_ITERATOR_TYPE)throw new _t(_t.TYPE_ERR);return this.nodes[this.iteratorIndex++]},Y.prototype.snapshotItem=function(t){if(this.resultType!=Y.UNORDERED_NODE_SNAPSHOT_TYPE&&this.resultType!=Y.ORDERED_NODE_SNAPSHOT_TYPE)throw new _t(_t.TYPE_ERR);return this.nodes[t]},Y.ANY_TYPE=0,Y.NUMBER_TYPE=1,Y.STRING_TYPE=2,Y.BOOLEAN_TYPE=3,Y.UNORDERED_NODE_ITERATOR_TYPE=4,Y.ORDERED_NODE_ITERATOR_TYPE=5,Y.UNORDERED_NODE_SNAPSHOT_TYPE=6,Y.ORDERED_NODE_SNAPSHOT_TYPE=7,Y.ANY_UNORDERED_NODE_TYPE=8,Y.FIRST_ORDERED_NODE_TYPE=9;function he(t,e){t.createExpression=function(r,a){try{return new yt(r,a,e)}catch(o){throw new _t(_t.INVALID_EXPRESSION_ERR,o)}},t.createNSResolver=function(r){return new Wt(r)},t.evaluate=function(r,a,o,u,D){if(u<0||u>9)throw{code:0,toString:function(){return"Request type not supported"}};return t.createExpression(r,o,e).evaluate(a,u,D)}}try{var ce=!0;try{document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("XPath",null)&&(ce=!1)}catch{}ce&&he(document,new l)}catch{}he(A,new l),(function(){var t=new l,e=new Et,r=new st,a=new Tt;function o(m){return{getNamespace:function(et,Rt){var Ut=m(et,Rt);return Ut||e.getNamespace(et,Rt)}}}function u(m){return o(m.getNamespace.bind(m))}function D(m){return o(function(et){return m[et]})}function Z(m){return m&&typeof m.getNamespace=="function"?u(m):typeof m=="function"?o(m):typeof m=="object"?D(m):e}function tt(m){if(m===null||typeof m>"u"||m instanceof v||m instanceof s||m instanceof R||m instanceof E)return m;switch(typeof m){case"string":return new v(m);case"boolean":return new s(m);case"number":return new R(m)}var et=new E;return et.addArray([].concat(m)),et}function w(m){return function(et){var Rt=Array.prototype.slice.call(arguments,1).map(function(Ue){return Ue.evaluate(et)}),Ut=m.apply(this,[].concat(et,Rt));return tt(Ut)}}function B(m){return{getFunction:function(et,Rt){var Ut=m(et,Rt);return Ut?w(Ut):r.getFunction(et,Rt)}}}function Lt(m){return B(m.getFunction.bind(m))}function kt(m){return B(function(et){return m[et]})}function jt(m){return m&&typeof m.getFunction=="function"?Lt(m):typeof m=="function"?B(m):typeof m=="object"?kt(m):r}function qt(m){return{getVariable:function(et,Rt){var Ut=m(et,Rt);return tt(Ut)}}}function Qt(m){if(m){if(typeof m.getVariable=="function")return qt(m.getVariable.bind(m));if(typeof m=="function")return qt(m);if(typeof m=="object")return qt(function(et){return m[et]})}return a}function Kt(m,et,Rt){m in Rt&&(et[m]=Rt[m])}function Be(m){var et=new Dt;return m?(et.namespaceResolver=Z(m.namespaces),et.functionResolver=jt(m.functions),et.variableResolver=Qt(m.variables),et.expressionContextNode=m.node,Kt("allowAnyNamespaceForNoPrefix",et,m),Kt("isHtml",et,m)):et.namespaceResolver=e,et}function Pe(m,et){var Rt=Be(et);return m.evaluate(Rt)}var Le={evaluate:function(m){return Pe(this.expression,m)},evaluateNumber:function(m){return this.evaluate(m).numberValue()},evaluateString:function(m){return this.evaluate(m).stringValue()},evaluateBoolean:function(m){return this.evaluate(m).booleanValue()},evaluateNodeSet:function(m){return this.evaluate(m).nodeset()},select:function(m){return this.evaluateNodeSet(m).toArray()},select1:function(m){return this.select(m)[0]}};function Me(m){var et=t.parse(m);return Object.create(Le,{expression:{value:et}})}A.parse=Me})(),ht(A,{XPath:f,XPathParser:l,XPathResult:Y,Step:c,PathExpr:q,NodeTest:g,LocationPath:At,OrOperation:_,AndOperation:H,BarOperation:ot,EqualsOperation:P,NotEqualOperation:M,LessThanOperation:k,GreaterThanOperation:nt,LessThanOrEqualOperation:Q,GreaterThanOrEqualOperation:ut,PlusOperation:wt,MinusOperation:lt,MultiplyOperation:z,DivOperation:vt,ModOperation:xt,UnaryMinusOperation:L,FunctionCall:dt,VariableReference:Ot,XPathContext:Dt,XNodeSet:E,XBoolean:s,XString:v,XNumber:R,NamespaceResolver:Et,FunctionResolver:st,VariableResolver:Tt,Utilities:S}),A.select=function(t,e,r){return A.selectWithResolver(t,e,null,r)},A.useNamespaces=function(t){var e={mappings:t||{},lookupNamespaceURI:function(r){return this.mappings[r]}};return function(r,a,o){return A.selectWithResolver(r,a,e,o)}},A.selectWithResolver=function(t,e,r,a){var o=new yt(t,r,new l),u=Y.ANY_TYPE,D=o.evaluate(e,u,null);return D.resultType==Y.STRING_TYPE?D=D.stringValue:D.resultType==Y.NUMBER_TYPE?D=D.numberValue:D.resultType==Y.BOOLEAN_TYPE?D=D.booleanValue:(D=D.nodes,a&&(D=D[0])),D},A.select1=function(t,e){return A.select(t,e,!0)};var Fe=function(t){return Array.isArray(t)&&t.every(W)},Pt=function(t){return function(e){return W(e)&&e.nodeType===t}};ht(A,{isNodeLike:W,isArrayOfNodes:Fe,isElement:Pt(b.ELEMENT_NODE),isAttribute:Pt(b.ATTRIBUTE_NODE),isTextNode:Pt(b.TEXT_NODE),isCDATASection:Pt(b.CDATA_SECTION_NODE),isProcessingInstruction:Pt(b.PROCESSING_INSTRUCTION_NODE),isComment:Pt(b.COMMENT_NODE),isDocumentNode:Pt(b.DOCUMENT_NODE),isDocumentTypeNode:Pt(b.DOCUMENT_TYPE_NODE),isDocumentFragment:Pt(b.DOCUMENT_FRAGMENT_NODE)})})(d)})(Zt)),Zt}var ge=Ne();const se=self,ve={ubl:"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2",cbc:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2",cac:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2",rsm:"urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100",ram:"urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100",udt:"urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100",qdt:"urn:un:unece:uncefact:data:standard:QualifiedDataType:100"},Ae=ge.useNamespaces(ve),K={xmlVersion:0,doc:null,xmlLines:[],mappings:[],mappingByKey:new Map,sortedCursorMappings:[],elementIndex:[],countByKey:new Map,matchesCache:new Map,nodeCache:new Map},Te={"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2":"ubl","urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2":"cac","urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2":"cbc","urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100":"rsm","urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100":"ram","urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100":"udt","urn:un:unece:uncefact:data:standard:QualifiedDataType:100":"qdt"};function It(h){se.postMessage(h)}function ae(h,d){return h.line!==d.line?h.line-d.line:h.column-d.column}function ye(h){const d=[];let A=h;for(;A&&A.nodeType===1;){const O=A.namespaceURI,F=A.localName||A.tagName,V=O?Te[O]:null,W=V?\`\${V}:\${F}\`:A.tagName;d.unshift(W),A=A.parentNode}return d.length?\`/\${d.join("/")}\`:""}function we(h){return h?h.nodeType===1?h:h.nodeType===2&&h.ownerElement?h.ownerElement:h.parentNode??null:null}function ue(h){const d=we(h);if(!d)return null;const A=typeof d.lineNumber=="number"?d.lineNumber:1,O=typeof d.columnNumber=="number"?d.columnNumber:1,F=typeof h?.nodeType=="number"?h.nodeType:1,V=typeof d.toString=="function"?String(d.toString()):"",W=V.split(\`
1854
+ \`),it=A+Math.max(0,W.length-1),pt=W.length>1?(W[W.length-1]?.length??0)+1:Math.max(O+Math.max(0,V.length),O+1);return{line:A,column:O,nodeType:F,endLine:it,endColumn:pt}}function le(h){if(!K.doc)return[];try{const d=Ae(h,K.doc);return Array.isArray(d)?d:d!=null?[d]:[]}catch{return[]}}function pe(h,d){let A=d;for(;A;){if(A===h)return!0;A=A.parentNode}return!1}function fe(h,d){if(!d?.length)return h;const A=De(d);if(!A.length)return[];let O=h;for(const F of A)O=O.filter(V=>pe(F,V));return O}function De(h){const d=[];for(const A of h){let O=$t(A.nodeKey);for(const V of d)O=O.filter(W=>pe(V,W));const F=O[A.occurrenceIndex];if(!F)return[];d.push(F)}return d}function $t(h){const d=K.nodeCache.get(h);if(d)return d;const A=K.mappingByKey.get(h);if(!A)return[];const O=le(A.xpath);return K.nodeCache.set(h,O),O}function be(h,d){if(!h||!d)return h;const A=d.match(/<\\/\\s*([A-Za-z_][\\w.-]*(?::[\\w.-]+)?)\\s*>/);if(!A)return h;const O=A[1],F=h.split("/").filter(Boolean);if(!F.length)return h;for(let V=F.length-1;V>=0;V--)if(F[V]===O)return\`/\${F.slice(0,V+1).join("/")}\`;return h}function Oe(h,d){const A=[];let O=0;const F=V=>{if(!V)return;V.nodeType===1&&typeof V.lineNumber=="number"&&typeof V.columnNumber=="number"&&(O+=1,A.push({line:V.lineNumber,column:V.columnNumber,absolutePath:ye(V)}),O%5e3===0&&It({type:"INIT_PROGRESS",xmlVersion:d,scannedElements:O}));const W=V.childNodes;if(W)for(let it=0;it<W.length;it++)F(W[it])};return F(h),A.sort((V,W)=>ae(V,W)),A}function Ce(h){const d=K.mappings.length,A=[];for(let O=0;O<d;O++){const F=K.mappings[O],V=le(F.xpath).length;K.countByKey.set(F.key,V),A.push({key:F.key,count:V}),(A.length>=25||O===d-1)&&(It({type:"COUNT_BATCH",xmlVersion:h,entries:[...A],done:O+1,total:d}),A.length=0)}}function Se(h){K.xmlVersion=h.xmlVersion,K.xmlLines=h.xmlText.split(/\\r?\\n/),K.mappings=h.mappings,K.mappingByKey=new Map(h.mappings.map(A=>[A.key,A])),K.sortedCursorMappings=[...h.mappings].sort((A,O)=>O.cursorXpath.length-A.cursorXpath.length),K.countByKey.clear(),K.matchesCache.clear(),K.nodeCache.clear();const d=new xe.DOMParser().parseFromString(h.xmlText,"application/xml");K.doc=d,K.elementIndex=Oe(d,h.xmlVersion),Ce(h.xmlVersion),It({type:"INIT_READY",xmlVersion:h.xmlVersion,scannedElements:K.elementIndex.length})}function Re(h){if(h.xmlVersion!==K.xmlVersion||!K.elementIndex.length){It({type:"CURSOR_RESULT",xmlVersion:h.xmlVersion,requestId:h.requestId,key:null});return}const d={line:h.line,column:h.column};let A=0,O=K.elementIndex.length-1,F=-1;for(;A<=O;){const at=A+O>>1;ae({line:K.elementIndex[at].line,column:K.elementIndex[at].column},d)<=0?(F=at,A=at+1):O=at-1}const V=F>=0?K.elementIndex[F].absolutePath:"",W=h.line>=1&&h.line<=K.xmlLines.length?K.xmlLines[h.line-1]:"",it=be(V,W);let pt=null,mt=null;for(const at of K.sortedCursorMappings)if(it.startsWith(at.cursorXpath)){pt=at.key,mt=at.cursorXpath;break}It({type:"CURSOR_RESULT",xmlVersion:h.xmlVersion,requestId:h.requestId,key:pt,debug:{targetLine:h.line,targetColumn:h.column,bestIndex:F,bestLine:F>=0?K.elementIndex[F].line:null,bestColumn:F>=0?K.elementIndex[F].column:null,absolutePath:it,matchedCursorXpath:mt}})}function _e(h){if(h.xmlVersion!==K.xmlVersion)return;if(!K.mappingByKey.get(h.nodeKey)){It({type:"MATCH_RESULT",xmlVersion:h.xmlVersion,requestId:h.requestId,nodeKey:h.nodeKey,total:0,matches:[]});return}if(!K.matchesCache.get(h.nodeKey)){const pt=$t(h.nodeKey).map(mt=>ue(mt)).filter(mt=>!!mt);K.matchesCache.set(h.nodeKey,pt)}const O=fe($t(h.nodeKey),h.context).map(it=>ue(it)).filter(it=>!!it),F=Math.max(0,h.offset),V=Math.max(F,F+Math.max(1,h.limit)),W=O.slice(F,V);It({type:"MATCH_RESULT",xmlVersion:h.xmlVersion,requestId:h.requestId,nodeKey:h.nodeKey,total:O.length,matches:W})}function Ie(h){if(h.xmlVersion!==K.xmlVersion)return;if(!K.mappingByKey.get(h.nodeKey)){It({type:"COUNT_RESULT",xmlVersion:h.xmlVersion,requestId:h.requestId,nodeKey:h.nodeKey,count:0});return}const A=fe($t(h.nodeKey),h.context);It({type:"COUNT_RESULT",xmlVersion:h.xmlVersion,requestId:h.requestId,nodeKey:h.nodeKey,count:A.length})}se.onmessage=h=>{const d=h.data;try{if(d.type==="INIT"){Se(d);return}if(d.type==="CURSOR_LOOKUP"){Re(d);return}if(d.type==="GET_MATCHES"){_e(d);return}d.type==="GET_COUNT"&&Ie(d)}catch(A){It({type:"ERROR",xmlVersion:d.xmlVersion,requestId:"requestId"in d?d.requestId:void 0,message:A instanceof Error?A.message:"Unknown worker error"})}}})();
1855
+ `, Se = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Ae], { type: "text/javascript;charset=utf-8" });
1856
+ function Fe(t) {
1857
+ let r;
1858
+ try {
1859
+ if (r = Se && (self.URL || self.webkitURL).createObjectURL(Se), !r) throw "";
1860
+ const a = new Worker(r, {
1861
+ name: t?.name
1862
+ });
1863
+ return a.addEventListener("error", () => {
1864
+ (self.URL || self.webkitURL).revokeObjectURL(r);
1865
+ }), a;
1866
+ } catch {
1867
+ return new Worker(
1868
+ "data:text/javascript;charset=utf-8," + encodeURIComponent(Ae),
1869
+ {
1870
+ name: t?.name
1871
+ }
1872
+ );
1873
+ }
1874
+ }
1875
+ function Ve() {
1852
1876
  return typeof window < "u" && window.localStorage.getItem("xmlExplorerDebug") === "1";
1853
1877
  }
1854
- function Ge(r) {
1855
- const { xmlText: a, syntax: d, mappings: t } = r, s = D(null), c = D(0), l = D(0), p = D(
1878
+ function Ge(t) {
1879
+ const { xmlText: r, syntax: a, mappings: n } = t, o = w(null), c = w(0), l = w(0), p = w(
1856
1880
  /* @__PURE__ */ new Map()
1857
- ), T = D(
1881
+ ), h = w(
1858
1882
  /* @__PURE__ */ new Map()
1859
- ), g = D(null), E = D(null), k = D("idle"), [f, x] = M("idle"), [V, $] = M(null), [q, ee] = M({}), [W, N] = M(null), [re, U] = M(null), [ae, _] = M(null);
1860
- j(() => {
1861
- k.current = f;
1862
- }, [f]);
1883
+ ), N = w(null), D = w(null), _ = w("idle"), [I, v] = U("idle"), [V, G] = U(null), [Y, ee] = U({}), [K, L] = U(null), [te, j] = U(null), [re, H] = U(null);
1884
+ F(() => {
1885
+ _.current = I;
1886
+ }, [I]);
1863
1887
  const se = le(
1864
- () => t.map((C) => `${C.key}|${C.xpath}`).join("||"),
1865
- [t]
1888
+ () => n.map((g) => `${g.key}|${g.xpath}`).join("||"),
1889
+ [n]
1866
1890
  );
1867
- j(() => {
1868
- const C = new Worker(
1869
- new URL(
1870
- /* @vite-ignore */
1871
- "/assets/xmlExplorer.worker-CHTIePgi.js",
1872
- import.meta.url
1873
- ),
1874
- { type: "module" }
1875
- );
1876
- return s.current = C, C.onmessage = (y) => {
1877
- const o = y.data;
1878
- if (o.xmlVersion === c.current)
1879
- switch (o.type) {
1891
+ F(() => {
1892
+ const g = new Fe();
1893
+ return o.current = g, g.onmessage = (f) => {
1894
+ const u = f.data;
1895
+ if (u.xmlVersion === c.current)
1896
+ switch (u.type) {
1880
1897
  case "INIT_PROGRESS":
1881
- x("indexing");
1898
+ v("indexing");
1882
1899
  return;
1883
1900
  case "INIT_READY":
1884
- x("ready"), N((h) => h?.total ? h : null);
1901
+ v("ready"), L((T) => T?.total ? T : null);
1885
1902
  return;
1886
1903
  case "COUNT_BATCH":
1887
- ee((h) => {
1888
- const b = { ...h };
1889
- for (const L of o.entries)
1890
- b[L.key] = L.count;
1904
+ ee((T) => {
1905
+ const b = { ...T };
1906
+ for (const R of u.entries)
1907
+ b[R.key] = R.count;
1891
1908
  return b;
1892
- }), N({ done: o.done, total: o.total }), o.done >= o.total && N(null);
1909
+ }), L({ done: u.done, total: u.total }), u.done >= u.total && L(null);
1893
1910
  return;
1894
1911
  case "CURSOR_RESULT":
1895
- if (o.requestId !== l.current) return;
1896
- _e() && console.debug("[xml-explorer] cursor-result", {
1897
- requestId: o.requestId,
1898
- key: o.key,
1899
- debug: o.debug
1900
- }), U(o.key), _(o.debug ?? null);
1912
+ if (u.requestId !== l.current) return;
1913
+ Ve() && console.debug("[xml-explorer] cursor-result", {
1914
+ requestId: u.requestId,
1915
+ key: u.key,
1916
+ debug: u.debug
1917
+ }), j(u.key), H(u.debug ?? null);
1901
1918
  return;
1902
1919
  case "MATCH_RESULT": {
1903
- const h = p.current.get(o.requestId);
1904
- h && (p.current.delete(o.requestId), h.resolve({ total: o.total, matches: o.matches }));
1920
+ const T = p.current.get(u.requestId);
1921
+ T && (p.current.delete(u.requestId), T.resolve({ total: u.total, matches: u.matches }));
1905
1922
  return;
1906
1923
  }
1907
1924
  case "COUNT_RESULT": {
1908
- const h = T.current.get(o.requestId);
1909
- h && (T.current.delete(o.requestId), h.resolve(o.count));
1925
+ const T = h.current.get(u.requestId);
1926
+ T && (h.current.delete(u.requestId), T.resolve(u.count));
1910
1927
  return;
1911
1928
  }
1912
1929
  case "ERROR":
1913
- if (x("error"), $(o.message), typeof o.requestId == "number") {
1914
- const h = p.current.get(o.requestId);
1915
- h && (p.current.delete(o.requestId), h.reject(new Error(o.message)));
1916
- const b = T.current.get(o.requestId);
1917
- b && (T.current.delete(o.requestId), b.reject(new Error(o.message)));
1930
+ if (v("error"), G(u.message), typeof u.requestId == "number") {
1931
+ const T = p.current.get(u.requestId);
1932
+ T && (p.current.delete(u.requestId), T.reject(new Error(u.message)));
1933
+ const b = h.current.get(u.requestId);
1934
+ b && (h.current.delete(u.requestId), b.reject(new Error(u.message)));
1918
1935
  }
1919
1936
  }
1920
1937
  }, () => {
1921
- C.terminate(), s.current = null, p.current.forEach(
1922
- (y) => y.reject(new Error("Worker terminated"))
1923
- ), p.current.clear(), T.current.forEach(
1924
- (y) => y.reject(new Error("Worker terminated"))
1925
- ), T.current.clear();
1938
+ g.terminate(), o.current = null, p.current.forEach(
1939
+ (f) => f.reject(new Error("Worker terminated"))
1940
+ ), p.current.clear(), h.current.forEach(
1941
+ (f) => f.reject(new Error("Worker terminated"))
1942
+ ), h.current.clear();
1926
1943
  };
1927
- }, []), j(() => {
1944
+ }, []), F(() => {
1928
1945
  c.current += 1;
1929
- const C = c.current;
1930
- l.current = 0, U(null), $(null), x("indexing"), ee({}), N(t.length ? { done: 0, total: t.length } : null), _(null), p.current.forEach(
1931
- (o) => o.reject(new Error("Canceled due to new XML version"))
1932
- ), p.current.clear(), T.current.forEach(
1933
- (o) => o.reject(new Error("Canceled due to new XML version"))
1934
- ), T.current.clear();
1935
- const y = {
1946
+ const g = c.current;
1947
+ l.current = 0, j(null), G(null), v("indexing"), ee({}), L(n.length ? { done: 0, total: n.length } : null), H(null), p.current.forEach(
1948
+ (u) => u.reject(new Error("Canceled due to new XML version"))
1949
+ ), p.current.clear(), h.current.forEach(
1950
+ (u) => u.reject(new Error("Canceled due to new XML version"))
1951
+ ), h.current.clear();
1952
+ const f = {
1936
1953
  type: "INIT",
1937
- xmlVersion: C,
1938
- xmlText: a,
1939
- syntax: d,
1940
- mappings: t
1954
+ xmlVersion: g,
1955
+ xmlText: r,
1956
+ syntax: a,
1957
+ mappings: n
1941
1958
  };
1942
- s.current?.postMessage(y);
1943
- }, [a, d, se, t]);
1944
- const O = ue((C, y) => {
1945
- if (k.current !== "ready" || g.current === C && E.current === y)
1959
+ o.current?.postMessage(f);
1960
+ }, [r, a, se, n]);
1961
+ const M = me((g, f) => {
1962
+ if (_.current !== "ready" || N.current === g && D.current === f)
1946
1963
  return;
1947
- g.current = C, E.current = y;
1948
- const o = ++l.current, h = {
1964
+ N.current = g, D.current = f;
1965
+ const u = ++l.current, T = {
1949
1966
  type: "CURSOR_LOOKUP",
1950
1967
  xmlVersion: c.current,
1951
- requestId: o,
1952
- line: C,
1953
- column: y
1968
+ requestId: u,
1969
+ line: g,
1970
+ column: f
1954
1971
  };
1955
- s.current?.postMessage(h);
1956
- }, []), z = ue(
1957
- (C, y, o = 1, h) => new Promise((b, L) => {
1958
- const K = ++l.current, G = {
1972
+ o.current?.postMessage(T);
1973
+ }, []), Q = me(
1974
+ (g, f, u = 1, T) => new Promise((b, R) => {
1975
+ const X = ++l.current, k = {
1959
1976
  type: "GET_MATCHES",
1960
1977
  xmlVersion: c.current,
1961
- requestId: K,
1962
- nodeKey: C,
1963
- offset: y,
1964
- limit: o,
1965
- context: h
1978
+ requestId: X,
1979
+ nodeKey: g,
1980
+ offset: f,
1981
+ limit: u,
1982
+ context: T
1966
1983
  };
1967
- p.current.set(K, { resolve: b, reject: L }), s.current?.postMessage(G);
1984
+ p.current.set(X, { resolve: b, reject: R }), o.current?.postMessage(k);
1968
1985
  }),
1969
1986
  []
1970
- ), F = ue(
1971
- (C, y) => new Promise((o, h) => {
1972
- const b = ++l.current, L = {
1987
+ ), q = me(
1988
+ (g, f) => new Promise((u, T) => {
1989
+ const b = ++l.current, R = {
1973
1990
  type: "GET_COUNT",
1974
1991
  xmlVersion: c.current,
1975
1992
  requestId: b,
1976
- nodeKey: C,
1977
- context: y
1993
+ nodeKey: g,
1994
+ context: f
1978
1995
  };
1979
- T.current.set(b, { resolve: o, reject: h }), s.current?.postMessage(L);
1996
+ h.current.set(b, { resolve: u, reject: T }), o.current?.postMessage(R);
1980
1997
  }),
1981
1998
  []
1982
1999
  );
1983
2000
  return {
1984
- workerState: f,
2001
+ workerState: I,
1985
2002
  error: V,
1986
- countByKey: q,
1987
- countProgress: W,
1988
- cursorMatchKey: re,
1989
- cursorLookupDebug: ae,
1990
- lookupCursor: O,
1991
- requestMatches: z,
1992
- requestCount: F
2003
+ countByKey: Y,
2004
+ countProgress: K,
2005
+ cursorMatchKey: te,
2006
+ cursorLookupDebug: re,
2007
+ lookupCursor: M,
2008
+ requestMatches: Q,
2009
+ requestCount: q
1993
2010
  };
1994
2011
  }
1995
- const je = 120, xe = 500;
1996
- function Se() {
2012
+ const je = 120, Ne = 500;
2013
+ function Ie() {
1997
2014
  return typeof window < "u" && window.localStorage.getItem("xmlExplorerDebug") === "1";
1998
2015
  }
1999
- function Qe({ xml: r, syntax: a = "cii" }) {
2000
- const d = D(null), t = D([]), s = D(null), c = D(/* @__PURE__ */ new Set()), l = D(
2016
+ function tt({ xml: t, syntax: r = "cii" }) {
2017
+ const a = w(null), n = w([]), o = w(null), c = w(/* @__PURE__ */ new Set()), l = w(
2001
2018
  "idle"
2002
- ), p = D(!1), T = D(null), g = D(null), E = D(null), [k, f] = M(""), [x, V] = M(
2019
+ ), p = w(!1), h = w(null), N = w(null), D = w(null), [_, I] = U(""), [v, V] = U(
2003
2020
  "nearest"
2004
- ), [$, q] = M(null), [ee, W] = M({}), [N, re] = M({}), [U, ae] = M({});
2005
- j(() => {
2006
- W({}), q(null), ae({}), c.current.clear();
2007
- }, [r]);
2008
- const _ = le(() => Ne(), []), se = le(
2009
- () => Oe(_, a),
2010
- [_, a]
2021
+ ), [G, Y] = U(null), [ee, K] = U({}), [L, te] = U({}), [j, re] = U({});
2022
+ F(() => {
2023
+ K({}), Y(null), re({}), c.current.clear();
2024
+ }, [t]);
2025
+ const H = le(() => Ue(), []), se = le(
2026
+ () => He(H, r),
2027
+ [H, r]
2011
2028
  ), {
2012
- workerState: O,
2013
- error: z,
2014
- countByKey: F,
2015
- countProgress: C,
2016
- cursorMatchKey: y,
2017
- cursorLookupDebug: o,
2018
- lookupCursor: h,
2029
+ workerState: M,
2030
+ error: Q,
2031
+ countByKey: q,
2032
+ countProgress: g,
2033
+ cursorMatchKey: f,
2034
+ cursorLookupDebug: u,
2035
+ lookupCursor: T,
2019
2036
  requestMatches: b,
2020
- requestCount: L
2037
+ requestCount: R
2021
2038
  } = Ge({
2022
- xmlText: r,
2023
- syntax: a,
2039
+ xmlText: t,
2040
+ syntax: r,
2024
2041
  mappings: se
2025
2042
  });
2026
- j(() => {
2027
- l.current = O;
2028
- }, [O]), j(() => {
2043
+ F(() => {
2044
+ l.current = M;
2045
+ }, [M]), F(() => {
2029
2046
  const i = (S) => {
2030
2047
  S.key === "Control" && (p.current = !0);
2031
- }, n = (S) => {
2048
+ }, s = (S) => {
2032
2049
  S.key === "Control" && (p.current = !1);
2033
- }, B = () => {
2050
+ }, E = () => {
2034
2051
  p.current = !1;
2035
2052
  };
2036
- return window.addEventListener("keydown", i), window.addEventListener("keyup", n), window.addEventListener("blur", B), () => {
2037
- window.removeEventListener("keydown", i), window.removeEventListener("keyup", n), window.removeEventListener("blur", B);
2053
+ return window.addEventListener("keydown", i), window.addEventListener("keyup", s), window.addEventListener("blur", E), () => {
2054
+ window.removeEventListener("keydown", i), window.removeEventListener("keyup", s), window.removeEventListener("blur", E);
2038
2055
  };
2039
- }, []), j(() => {
2040
- z && f(z);
2041
- }, [z]);
2042
- const K = (i) => i.xpaths?.[a], G = le(() => {
2043
- const i = (n) => {
2044
- const B = n.children ?? [], S = ne(n.key), P = S.length > 0 ? U[n.key] : void 0, H = typeof P == "number" ? P : S.length > 0 ? void 0 : F[me(n.key)] ?? 0;
2045
- if (typeof H == "number" && H > 1 && B.length > 0 && N[n.key]) {
2046
- const R = Math.min(H, xe);
2056
+ }, []), F(() => {
2057
+ Q && I(Q);
2058
+ }, [Q]);
2059
+ const X = (i) => i.xpaths?.[r], k = le(() => {
2060
+ const i = (s) => {
2061
+ const E = s.children ?? [], S = ae(s.key), x = S.length > 0 ? j[s.key] : void 0, O = typeof x == "number" ? x : S.length > 0 ? void 0 : q[de(s.key)] ?? 0;
2062
+ if (typeof O == "number" && O > 1 && E.length > 0 && L[s.key]) {
2063
+ const B = Math.min(O, Ne);
2047
2064
  return {
2048
- ...n,
2049
- children: Array.from({ length: R }, (w, v) => {
2050
- const J = v + 1, Q = `${n.key}::${J}`;
2065
+ ...s,
2066
+ children: Array.from({ length: B }, (P, A) => {
2067
+ const J = A + 1, z = `${s.key}::${J}`;
2051
2068
  return {
2052
- key: Q,
2053
- id: n.id,
2054
- title: `${n.title} [${J}]`,
2055
- xpaths: n.xpaths,
2069
+ key: z,
2070
+ id: s.id,
2071
+ title: `${s.title} [${J}]`,
2072
+ xpaths: s.xpaths,
2056
2073
  isOccurrence: !0,
2057
- children: B.map((Y, ie) => {
2058
- const X = fe(Q, Y.id, ie);
2059
- return i({ ...Y, key: X });
2074
+ children: E.map((W, ie) => {
2075
+ const $ = Ee(z, W.id, ie);
2076
+ return i({ ...W, key: $ });
2060
2077
  })
2061
2078
  };
2062
2079
  })
2063
2080
  };
2064
2081
  }
2065
2082
  return {
2066
- ...n,
2067
- children: B.map(
2068
- (R, w) => i({
2069
- ...R,
2070
- key: fe(n.key, R.id, w)
2083
+ ...s,
2084
+ children: E.map(
2085
+ (B, P) => i({
2086
+ ...B,
2087
+ key: Ee(s.key, B.id, P)
2071
2088
  })
2072
2089
  )
2073
2090
  };
2074
2091
  };
2075
- return i(_);
2076
- }, [_, F, U, N]), de = le(
2077
- () => Ue(G, N),
2078
- [G, N]
2092
+ return i(H);
2093
+ }, [H, q, j, L]), oe = le(
2094
+ () => Xe(k, L),
2095
+ [k, L]
2079
2096
  );
2080
- j(() => {
2081
- E.current = G;
2082
- }, [G]), j(() => {
2083
- $ && requestAnimationFrame(() => {
2084
- ve(T.current, $);
2097
+ F(() => {
2098
+ D.current = k;
2099
+ }, [k]), F(() => {
2100
+ G && requestAnimationFrame(() => {
2101
+ be(h.current, G);
2085
2102
  });
2086
- }, [$, G, N]), j(() => {
2087
- if (!y) return;
2088
- const i = `${y}|${o?.bestLine ?? ""}|${o?.bestColumn ?? ""}`;
2089
- if (g.current === i) return;
2090
- g.current = i;
2091
- let n = !1;
2103
+ }, [G, k, L]), F(() => {
2104
+ if (!f) return;
2105
+ const i = `${f}|${u?.bestLine ?? ""}|${u?.bestColumn ?? ""}`;
2106
+ if (N.current === i) return;
2107
+ N.current = i;
2108
+ let s = !1;
2092
2109
  return (async () => {
2093
- const S = o?.bestLine, P = o?.bestColumn, H = Xe(o), R = Be(o?.absolutePath), w = Be(o?.matchedCursorXpath);
2094
- if (!H && x === "strict") {
2095
- e(), f(
2096
- `No exact BT/BG for ${R}. Strict mode blocks fallback${w ? ` (nearest: ${w})` : ""}.`
2110
+ const S = u?.bestLine, x = u?.bestColumn, O = Je(u), B = Ce(u?.absolutePath), P = Ce(u?.matchedCursorXpath);
2111
+ if (!O && v === "strict") {
2112
+ e(), I(
2113
+ `No exact BT/BG for ${B}. Strict mode blocks fallback${P ? ` (nearest: ${P})` : ""}.`
2097
2114
  );
2098
2115
  return;
2099
2116
  }
2100
- let v = y;
2101
- if (typeof S == "number" && typeof P == "number" && (v = await We(
2102
- y,
2117
+ let A = f;
2118
+ if (typeof S == "number" && typeof x == "number" && (A = await ze(
2119
+ f,
2103
2120
  S,
2104
- P,
2105
- _,
2106
- L,
2121
+ x,
2122
+ H,
2123
+ R,
2107
2124
  b
2108
- )), Se() && console.debug("[xml-explorer] editor->tree sync", {
2109
- cursorMatchKey: y,
2110
- resolvedKey: v,
2111
- depth: ne(v).length,
2112
- cursor: { line: S, column: P }
2113
- }), n) return;
2114
- e(), q((X) => X === v ? X : v), Ve(v, re);
2115
- const Q = (E.current ? Te(E.current, v) : null)?.title ?? v, Y = me(v), ie = ne(v);
2125
+ )), Ie() && console.debug("[xml-explorer] editor->tree sync", {
2126
+ cursorMatchKey: f,
2127
+ resolvedKey: A,
2128
+ depth: ae(A).length,
2129
+ cursor: { line: S, column: x }
2130
+ }), s) return;
2131
+ e(), Y(($) => $ === A ? $ : A), qe(A, te);
2132
+ const z = (D.current ? he(D.current, A) : null)?.title ?? A, W = de(A), ie = ae(A);
2116
2133
  try {
2117
- const X = ie.length > 0 ? 10 : Math.min(50, F[Y] ?? 1), Z = await b(
2118
- Y,
2134
+ const $ = ie.length > 0 ? 10 : Math.min(50, q[W] ?? 1), Z = await b(
2135
+ W,
2119
2136
  0,
2120
- Math.max(1, X),
2137
+ Math.max(1, $),
2121
2138
  ie
2122
- ), ye = typeof S == "number" && typeof P == "number" ? Z.matches[ge(Z.matches, S, P)] : Z.matches[0];
2123
- if (!ye || n) return;
2124
- I(ye, Q, 0, Z.total), H || f(
2125
- `No exact BT/BG for ${R}. Mapped to nearest: ${w}.`
2126
- ), W((be) => ({ ...be, [v]: 0 }));
2139
+ ), fe = typeof S == "number" && typeof x == "number" ? Z.matches[xe(Z.matches, S, x)] : Z.matches[0];
2140
+ if (!fe || s) return;
2141
+ y(fe, z, 0, Z.total), O || I(
2142
+ `No exact BT/BG for ${B}. Mapped to nearest: ${P}.`
2143
+ ), K((we) => ({ ...we, [A]: 0 }));
2127
2144
  } catch {
2128
2145
  }
2129
2146
  })(), () => {
2130
- n = !0;
2147
+ s = !0;
2131
2148
  };
2132
2149
  }, [
2133
- y,
2134
- o,
2135
- _,
2150
+ f,
2151
+ u,
2152
+ H,
2136
2153
  b,
2137
- L,
2138
- F,
2139
- x
2140
- ]), j(() => {
2141
- if (O === "ready")
2142
- for (const i of de)
2143
- typeof U[i.key] != "number" && (c.current.has(i.key) || (c.current.add(i.key), L(i.baseKey, i.context).then((n) => {
2144
- ae((B) => ({ ...B, [i.key]: n }));
2154
+ R,
2155
+ q,
2156
+ v
2157
+ ]), F(() => {
2158
+ if (M === "ready")
2159
+ for (const i of oe)
2160
+ typeof j[i.key] != "number" && (c.current.has(i.key) || (c.current.add(i.key), R(i.baseKey, i.context).then((s) => {
2161
+ re((E) => ({ ...E, [i.key]: s }));
2145
2162
  }).catch(() => {
2146
2163
  }).finally(() => {
2147
2164
  c.current.delete(i.key);
2148
2165
  })));
2149
- }, [O, de, U, L]);
2166
+ }, [M, oe, j, R]);
2150
2167
  function e() {
2151
- const i = d.current, n = i?.getModel();
2152
- !i || !n || (t.current = i.deltaDecorations(
2153
- t.current,
2168
+ const i = a.current, s = i?.getModel();
2169
+ !i || !s || (n.current = i.deltaDecorations(
2170
+ n.current,
2154
2171
  []
2155
2172
  ));
2156
2173
  }
2157
- function m(i) {
2158
- re((n) => ({ ...n, [i]: !n[i] }));
2174
+ function d(i) {
2175
+ te((s) => ({ ...s, [i]: !s[i] }));
2159
2176
  }
2160
- function I(i, n, B, S) {
2161
- const P = d.current, H = P?.getModel();
2162
- if (!P || !H) return;
2163
- const R = Math.min(
2177
+ function y(i, s, E, S) {
2178
+ const x = a.current, O = x?.getModel();
2179
+ if (!x || !O) return;
2180
+ const B = Math.min(
2164
2181
  Math.max(1, i.line),
2165
- H.getLineCount()
2166
- ), w = H.getLineMaxColumn(R), v = Math.min(Math.max(1, i.column), w), J = i.endLine ?? R, Q = Math.min(
2167
- Math.max(R, J),
2168
- H.getLineCount()
2169
- ), Y = H.getLineMaxColumn(Q), ie = i.endColumn ?? Y, X = Math.min(Math.max(1, ie), Y), Z = new Ee.Range(
2170
- R,
2171
- v,
2172
- Q,
2173
- X
2182
+ O.getLineCount()
2183
+ ), P = O.getLineMaxColumn(B), A = Math.min(Math.max(1, i.column), P), J = i.endLine ?? B, z = Math.min(
2184
+ Math.max(B, J),
2185
+ O.getLineCount()
2186
+ ), W = O.getLineMaxColumn(z), ie = i.endColumn ?? W, $ = Math.min(Math.max(1, ie), W), Z = new Re.Range(
2187
+ B,
2188
+ A,
2189
+ z,
2190
+ $
2174
2191
  );
2175
- P.revealRangeInCenter(Z), t.current = P.deltaDecorations(t.current, [
2192
+ x.revealRangeInCenter(Z), n.current = x.deltaDecorations(n.current, [
2176
2193
  {
2177
2194
  range: Z,
2178
2195
  options: {
2179
2196
  inlineClassName: "xml-xpath-highlight"
2180
2197
  }
2181
2198
  }
2182
- ]), f(
2183
- S > 1 ? `Highlighted ${n}: ${B + 1}/${S}` : `Highlighted ${n}`
2199
+ ]), I(
2200
+ S > 1 ? `Highlighted ${s}: ${E + 1}/${S}` : `Highlighted ${s}`
2184
2201
  );
2185
2202
  }
2186
- async function A(i) {
2187
- q(i.key);
2188
- const n = me(i.key), B = ne(i.key), S = i.isOccurrence ? 1 : B.length ? void 0 : F[n] ?? 0, P = K(i);
2189
- if (!P) {
2203
+ async function C(i) {
2204
+ Y(i.key);
2205
+ const s = de(i.key), E = ae(i.key), S = i.isOccurrence ? 1 : E.length ? void 0 : q[s] ?? 0, x = X(i);
2206
+ if (!x) {
2190
2207
  e();
2191
2208
  return;
2192
2209
  }
2193
2210
  if (S === 0)
2194
- f(`${i.id}: no match found in XML. (${P})`), e();
2211
+ I(`${i.id}: no match found in XML. (${x})`), e();
2195
2212
  else {
2196
- const H = ee[i.key] ?? -1, R = i.isOccurrence ? 0 : $ === i.key && typeof S == "number" && S > 1 ? (H + 1) % S : 0;
2213
+ const O = ee[i.key] ?? -1, B = i.isOccurrence ? 0 : G === i.key && typeof S == "number" && S > 1 ? (O + 1) % S : 0;
2197
2214
  try {
2198
- const w = await b(n, R, 1, B), v = w.matches[0];
2199
- v ? (I(
2200
- v,
2215
+ const P = await b(s, B, 1, E), A = P.matches[0];
2216
+ A ? (y(
2217
+ A,
2201
2218
  i.title,
2202
- i.isOccurrence ? 0 : R,
2203
- w.total
2204
- ), W((J) => ({
2219
+ i.isOccurrence ? 0 : B,
2220
+ P.total
2221
+ ), K((J) => ({
2205
2222
  ...J,
2206
- [i.key]: i.isOccurrence ? 0 : R
2207
- }))) : (f(`${i.id}: no match found in XML.`), e());
2208
- } catch (w) {
2209
- const v = w instanceof Error ? w.message : "Failed to resolve match";
2210
- f(v);
2223
+ [i.key]: i.isOccurrence ? 0 : B
2224
+ }))) : (I(`${i.id}: no match found in XML.`), e());
2225
+ } catch (P) {
2226
+ const A = P instanceof Error ? P.message : "Failed to resolve match";
2227
+ I(A);
2211
2228
  }
2212
2229
  }
2213
- i.children?.length && m(i.key);
2230
+ i.children?.length && d(i.key);
2214
2231
  }
2215
- function te(i) {
2232
+ function ne(i) {
2216
2233
  if (l.current !== "ready" || !p.current) return;
2217
- s.current != null && window.clearTimeout(s.current);
2218
- const n = i.position;
2219
- Se() && console.debug("[xml-explorer] cursor-change", {
2220
- line: n.lineNumber,
2221
- column: n.column
2222
- }), s.current = window.setTimeout(() => {
2223
- h(n.lineNumber, n.column);
2234
+ o.current != null && window.clearTimeout(o.current);
2235
+ const s = i.position;
2236
+ Ie() && console.debug("[xml-explorer] cursor-change", {
2237
+ line: s.lineNumber,
2238
+ column: s.column
2239
+ }), o.current = window.setTimeout(() => {
2240
+ T(s.lineNumber, s.column);
2224
2241
  }, je);
2225
2242
  }
2226
- return /* @__PURE__ */ u.jsxs(
2243
+ return /* @__PURE__ */ m.jsxs(
2227
2244
  "div",
2228
2245
  {
2229
2246
  style: {
@@ -2237,7 +2254,7 @@ function Qe({ xml: r, syntax: a = "cii" }) {
2237
2254
  width: "100%"
2238
2255
  },
2239
2256
  children: [
2240
- /* @__PURE__ */ u.jsxs(
2257
+ /* @__PURE__ */ m.jsxs(
2241
2258
  "div",
2242
2259
  {
2243
2260
  style: {
@@ -2251,8 +2268,8 @@ function Qe({ xml: r, syntax: a = "cii" }) {
2251
2268
  minWidth: 0
2252
2269
  },
2253
2270
  children: [
2254
- /* @__PURE__ */ u.jsx("button", { onClick: e, style: { padding: "6px 10px" }, children: "Clear highlight" }),
2255
- /* @__PURE__ */ u.jsxs(
2271
+ /* @__PURE__ */ m.jsx("button", { onClick: e, style: { padding: "6px 10px" }, children: "Clear highlight" }),
2272
+ /* @__PURE__ */ m.jsxs(
2256
2273
  "button",
2257
2274
  {
2258
2275
  onClick: () => V((i) => i === "nearest" ? "strict" : "nearest"),
@@ -2260,21 +2277,21 @@ function Qe({ xml: r, syntax: a = "cii" }) {
2260
2277
  title: "Toggle mapping mode for XML clicks",
2261
2278
  children: [
2262
2279
  "Mode: ",
2263
- x === "nearest" ? "Nearest fallback" : "Strict exact"
2280
+ v === "nearest" ? "Nearest fallback" : "Strict exact"
2264
2281
  ]
2265
2282
  }
2266
2283
  ),
2267
- /* @__PURE__ */ u.jsxs("span", { style: { color: "#374151", fontSize: 12 }, children: [
2284
+ /* @__PURE__ */ m.jsxs("span", { style: { color: "#374151", fontSize: 12 }, children: [
2268
2285
  "Worker:",
2269
2286
  " ",
2270
- O === "indexing" ? "indexing XML..." : O === "ready" ? "ready" : O
2287
+ M === "indexing" ? "indexing XML..." : M === "ready" ? "ready" : M
2271
2288
  ] }),
2272
- /* @__PURE__ */ u.jsxs("span", { style: { color: "#374151", fontSize: 12 }, children: [
2289
+ /* @__PURE__ */ m.jsxs("span", { style: { color: "#374151", fontSize: 12 }, children: [
2273
2290
  "Counts:",
2274
2291
  " ",
2275
- C ? `${C.done}/${C.total}` : "ready"
2292
+ g ? `${g.done}/${g.total}` : "ready"
2276
2293
  ] }),
2277
- /* @__PURE__ */ u.jsx(
2294
+ /* @__PURE__ */ m.jsx(
2278
2295
  "span",
2279
2296
  {
2280
2297
  style: {
@@ -2284,14 +2301,14 @@ function Qe({ xml: r, syntax: a = "cii" }) {
2284
2301
  textOverflow: "ellipsis",
2285
2302
  whiteSpace: "nowrap"
2286
2303
  },
2287
- title: k,
2288
- children: k
2304
+ title: _,
2305
+ children: _
2289
2306
  }
2290
2307
  )
2291
2308
  ]
2292
2309
  }
2293
2310
  ),
2294
- /* @__PURE__ */ u.jsxs(
2311
+ /* @__PURE__ */ m.jsxs(
2295
2312
  "div",
2296
2313
  {
2297
2314
  style: {
@@ -2303,14 +2320,14 @@ function Qe({ xml: r, syntax: a = "cii" }) {
2303
2320
  width: "100%"
2304
2321
  },
2305
2322
  children: [
2306
- /* @__PURE__ */ u.jsx("div", { style: { minWidth: 0, minHeight: 0, width: "100%" }, children: /* @__PURE__ */ u.jsx(
2307
- De,
2323
+ /* @__PURE__ */ m.jsx("div", { style: { minWidth: 0, minHeight: 0, width: "100%" }, children: /* @__PURE__ */ m.jsx(
2324
+ Be,
2308
2325
  {
2309
2326
  height: "100%",
2310
2327
  defaultLanguage: "xml",
2311
- value: r,
2328
+ value: t,
2312
2329
  onMount: (i) => {
2313
- d.current = i, i.onDidChangeCursorPosition(te);
2330
+ a.current = i, i.onDidChangeCursorPosition(ne);
2314
2331
  },
2315
2332
  options: {
2316
2333
  minimap: { enabled: !1 },
@@ -2321,7 +2338,7 @@ function Qe({ xml: r, syntax: a = "cii" }) {
2321
2338
  }
2322
2339
  }
2323
2340
  ) }),
2324
- /* @__PURE__ */ u.jsxs(
2341
+ /* @__PURE__ */ m.jsxs(
2325
2342
  "div",
2326
2343
  {
2327
2344
  style: {
@@ -2335,41 +2352,41 @@ function Qe({ xml: r, syntax: a = "cii" }) {
2335
2352
  background: "#fafafa"
2336
2353
  },
2337
2354
  children: [
2338
- /* @__PURE__ */ u.jsx("div", { style: { fontWeight: 600, marginBottom: 8, flexShrink: 0 }, children: "BT / BG (EN16931)" }),
2339
- /* @__PURE__ */ u.jsx(
2355
+ /* @__PURE__ */ m.jsx("div", { style: { fontWeight: 600, marginBottom: 8, flexShrink: 0 }, children: "BT / BG (EN16931)" }),
2356
+ /* @__PURE__ */ m.jsx(
2340
2357
  "div",
2341
2358
  {
2342
- ref: T,
2359
+ ref: h,
2343
2360
  style: { flex: 1, minHeight: 0, overflow: "auto" },
2344
- children: /* @__PURE__ */ u.jsx(
2345
- Me,
2361
+ children: /* @__PURE__ */ m.jsx(
2362
+ ke,
2346
2363
  {
2347
- root: G,
2348
- expanded: N,
2349
- selectedKey: $,
2350
- onToggle: m,
2351
- onClickNode: A,
2352
- getNodeXpath: K,
2364
+ root: k,
2365
+ expanded: L,
2366
+ selectedKey: G,
2367
+ onToggle: d,
2368
+ onClickNode: C,
2369
+ getNodeXpath: X,
2353
2370
  getMatchCount: (i) => {
2354
2371
  if (i.isOccurrence) return 1;
2355
- const n = U[i.key];
2356
- if (typeof n == "number") return n;
2357
- if (ne(i.key).length > 0) return;
2358
- const B = me(i.key);
2359
- return F[B];
2372
+ const s = j[i.key];
2373
+ if (typeof s == "number") return s;
2374
+ if (ae(i.key).length > 0) return;
2375
+ const E = de(i.key);
2376
+ return q[E];
2360
2377
  }
2361
2378
  }
2362
2379
  )
2363
2380
  }
2364
2381
  ),
2365
- /* @__PURE__ */ u.jsx("div", { style: { marginTop: 10, fontSize: 12, color: "#444" }, children: "Cursor sync and count calculation run in a worker thread." })
2382
+ /* @__PURE__ */ m.jsx("div", { style: { marginTop: 10, fontSize: 12, color: "#444" }, children: "Cursor sync and count calculation run in a worker thread." })
2366
2383
  ]
2367
2384
  }
2368
2385
  )
2369
2386
  ]
2370
2387
  }
2371
2388
  ),
2372
- /* @__PURE__ */ u.jsx("style", { children: `
2389
+ /* @__PURE__ */ m.jsx("style", { children: `
2373
2390
  .xml-xpath-highlight {
2374
2391
  background: rgba(255, 230, 0, 0.35);
2375
2392
  border-bottom: 1px solid rgba(255, 180, 0, 0.9);
@@ -2379,143 +2396,143 @@ function Qe({ xml: r, syntax: a = "cii" }) {
2379
2396
  }
2380
2397
  );
2381
2398
  }
2382
- function Ve(r, a) {
2383
- const d = Fe(r);
2384
- d.length && a((t) => {
2385
- let s = !1;
2386
- const c = { ...t };
2387
- for (const l of d)
2388
- c[l] || (c[l] = !0, s = !0);
2389
- return s ? c : t;
2399
+ function qe(t, r) {
2400
+ const a = We(t);
2401
+ a.length && r((n) => {
2402
+ let o = !1;
2403
+ const c = { ...n };
2404
+ for (const l of a)
2405
+ c[l] || (c[l] = !0, o = !0);
2406
+ return o ? c : n;
2390
2407
  });
2391
2408
  }
2392
- function $e(r) {
2393
- const a = r.indexOf("::");
2394
- return a >= 0 ? r.slice(0, a) : r;
2409
+ function Ye(t) {
2410
+ const r = t.indexOf("::");
2411
+ return r >= 0 ? t.slice(0, r) : t;
2395
2412
  }
2396
- function me(r) {
2397
- return r.split(".").map($e).join(".");
2413
+ function de(t) {
2414
+ return t.split(".").map(Ye).join(".");
2398
2415
  }
2399
- function ne(r) {
2400
- const a = [], d = r.split("."), t = [];
2401
- for (const s of d) {
2402
- const c = s.indexOf("::");
2416
+ function ae(t) {
2417
+ const r = [], a = t.split("."), n = [];
2418
+ for (const o of a) {
2419
+ const c = o.indexOf("::");
2403
2420
  if (c >= 0) {
2404
- const l = Number(s.slice(c + 2)), p = Number.isFinite(l) ? Math.max(0, l - 1) : 0, T = s.slice(0, c);
2405
- t.push(T), a.push({ nodeKey: t.join("."), occurrenceIndex: p });
2421
+ const l = Number(o.slice(c + 2)), p = Number.isFinite(l) ? Math.max(0, l - 1) : 0, h = o.slice(0, c);
2422
+ n.push(h), r.push({ nodeKey: n.join("."), occurrenceIndex: p });
2406
2423
  } else
2407
- t.push(s);
2424
+ n.push(o);
2408
2425
  }
2409
- return a;
2426
+ return r;
2410
2427
  }
2411
- function Ue(r, a) {
2412
- const d = [], t = (s) => {
2413
- const c = ne(s.key);
2414
- if (c.length > 0 && s.xpaths && d.push({
2415
- key: s.key,
2416
- baseKey: me(s.key),
2428
+ function Xe(t, r) {
2429
+ const a = [], n = (o) => {
2430
+ const c = ae(o.key);
2431
+ if (c.length > 0 && o.xpaths && a.push({
2432
+ key: o.key,
2433
+ baseKey: de(o.key),
2417
2434
  context: c
2418
- }), !!s.children?.length && a[s.key])
2419
- for (const l of s.children) t(l);
2435
+ }), !!o.children?.length && r[o.key])
2436
+ for (const l of o.children) n(l);
2420
2437
  };
2421
- return t(r), d;
2438
+ return n(t), a;
2422
2439
  }
2423
- function Fe(r) {
2424
- const a = r.split("."), d = [], t = [];
2425
- for (let l = 0; l < a.length - 1; l++) {
2426
- const p = a[l], T = p.indexOf("::");
2427
- if (T >= 0) {
2428
- const g = p.slice(0, T);
2429
- t.push(g), d.push(t.join(".")), t[t.length - 1] = p, d.push(t.join("."));
2440
+ function We(t) {
2441
+ const r = t.split("."), a = [], n = [];
2442
+ for (let l = 0; l < r.length - 1; l++) {
2443
+ const p = r[l], h = p.indexOf("::");
2444
+ if (h >= 0) {
2445
+ const N = p.slice(0, h);
2446
+ n.push(N), a.push(n.join(".")), n[n.length - 1] = p, a.push(n.join("."));
2430
2447
  } else
2431
- t.push(p), d.push(t.join("."));
2448
+ n.push(p), a.push(n.join("."));
2432
2449
  }
2433
- const s = a[a.length - 1], c = s.indexOf("::");
2450
+ const o = r[r.length - 1], c = o.indexOf("::");
2434
2451
  if (c >= 0) {
2435
- const l = s.slice(0, c);
2436
- d.push([...t, l].join("."));
2452
+ const l = o.slice(0, c);
2453
+ a.push([...n, l].join("."));
2437
2454
  }
2438
- return Array.from(new Set(d));
2455
+ return Array.from(new Set(a));
2439
2456
  }
2440
- function fe(r, a, d) {
2441
- return `${r}.${a}:${d}`;
2457
+ function Ee(t, r, a) {
2458
+ return `${t}.${r}:${a}`;
2442
2459
  }
2443
- function Te(r, a) {
2444
- if (r.key === a) return r;
2445
- if (!r.children?.length) return null;
2446
- for (const d of r.children) {
2447
- const t = Te(d, a);
2448
- if (t) return t;
2460
+ function he(t, r) {
2461
+ if (t.key === r) return t;
2462
+ if (!t.children?.length) return null;
2463
+ for (const a of t.children) {
2464
+ const n = he(a, r);
2465
+ if (n) return n;
2449
2466
  }
2450
2467
  return null;
2451
2468
  }
2452
- function qe(r, a) {
2453
- if (!r) return !1;
2454
- const d = typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(a) : a.replace(/["\\]/g, "\\$&"), t = r.querySelector(
2455
- `[data-tree-key="${d}"]`
2469
+ function $e(t, r) {
2470
+ if (!t) return !1;
2471
+ const a = typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(r) : r.replace(/["\\]/g, "\\$&"), n = t.querySelector(
2472
+ `[data-tree-key="${a}"]`
2456
2473
  );
2457
- return t ? (t.scrollIntoView({ block: "center", inline: "nearest" }), !0) : !1;
2474
+ return n ? (n.scrollIntoView({ block: "center", inline: "nearest" }), !0) : !1;
2458
2475
  }
2459
- function ve(r, a, d = 12) {
2460
- qe(r, a) || d <= 0 || requestAnimationFrame(() => {
2461
- ve(r, a, d - 1);
2476
+ function be(t, r, a = 12) {
2477
+ $e(t, r) || a <= 0 || requestAnimationFrame(() => {
2478
+ be(t, r, a - 1);
2462
2479
  });
2463
2480
  }
2464
- function Ke(r, a, d) {
2465
- if (!r.length) return -1;
2466
- let t = 0, s = Number.POSITIVE_INFINITY;
2467
- for (let c = 0; c < r.length; c++) {
2468
- const l = r[c], p = Math.abs(l.line - a) * 1e3 + Math.abs(l.column - d);
2469
- p < s && (s = p, t = c);
2481
+ function Ke(t, r, a) {
2482
+ if (!t.length) return -1;
2483
+ let n = 0, o = Number.POSITIVE_INFINITY;
2484
+ for (let c = 0; c < t.length; c++) {
2485
+ const l = t[c], p = Math.abs(l.line - r) * 1e3 + Math.abs(l.column - a);
2486
+ p < o && (o = p, n = c);
2470
2487
  }
2471
- return t;
2488
+ return n;
2472
2489
  }
2473
- function Ye(r, a, d) {
2474
- const t = r.line, s = r.column, c = r.endLine ?? t, l = r.endColumn ?? s;
2475
- return !(a < t || a > c || a === t && d < s || a === c && d > l);
2490
+ function Qe(t, r, a) {
2491
+ const n = t.line, o = t.column, c = t.endLine ?? n, l = t.endColumn ?? o;
2492
+ return !(r < n || r > c || r === n && a < o || r === c && a > l);
2476
2493
  }
2477
- function ge(r, a, d) {
2478
- for (let t = 0; t < r.length; t++)
2479
- if (Ye(r[t], a, d)) return t;
2480
- return Ke(r, a, d);
2494
+ function xe(t, r, a) {
2495
+ for (let n = 0; n < t.length; n++)
2496
+ if (Qe(t[n], r, a)) return n;
2497
+ return Ke(t, r, a);
2481
2498
  }
2482
- function Xe(r) {
2483
- return r?.absolutePath ? r.matchedCursorXpath ? r.absolutePath === r.matchedCursorXpath : !1 : !0;
2499
+ function Je(t) {
2500
+ return t?.absolutePath ? t.matchedCursorXpath ? t.absolutePath === t.matchedCursorXpath : !1 : !0;
2484
2501
  }
2485
- function Be(r) {
2486
- if (!r) return "unknown element";
2487
- const a = r.split("/").filter(Boolean);
2488
- return a[a.length - 1] ?? "unknown element";
2502
+ function Ce(t) {
2503
+ if (!t) return "unknown element";
2504
+ const r = t.split("/").filter(Boolean);
2505
+ return r[r.length - 1] ?? "unknown element";
2489
2506
  }
2490
- async function We(r, a, d, t, s, c) {
2491
- const l = r.split("."), p = [...l], T = [];
2492
- for (let g = 0; g < l.length; g++) {
2493
- const E = l.slice(0, g + 1).join(".");
2494
- if (!Te(t, E)?.children?.length) continue;
2495
- let f = 0;
2507
+ async function ze(t, r, a, n, o, c) {
2508
+ const l = t.split("."), p = [...l], h = [];
2509
+ for (let N = 0; N < l.length; N++) {
2510
+ const D = l.slice(0, N + 1).join(".");
2511
+ if (!he(n, D)?.children?.length) continue;
2512
+ let I = 0;
2496
2513
  try {
2497
- f = await s(E, T);
2514
+ I = await o(D, h);
2498
2515
  } catch {
2499
2516
  continue;
2500
2517
  }
2501
- if (!(f <= 1))
2518
+ if (!(I <= 1))
2502
2519
  try {
2503
- const x = await c(
2504
- E,
2520
+ const v = await c(
2521
+ D,
2505
2522
  0,
2506
- Math.min(f, xe),
2507
- T
2508
- ), V = ge(x.matches, a, d);
2523
+ Math.min(I, Ne),
2524
+ h
2525
+ ), V = xe(v.matches, r, a);
2509
2526
  if (V < 0) continue;
2510
- p[g] = `${l[g]}::${V + 1}`, T.push({ nodeKey: E, occurrenceIndex: V });
2527
+ p[N] = `${l[N]}::${V + 1}`, h.push({ nodeKey: D, occurrenceIndex: V });
2511
2528
  } catch {
2512
2529
  }
2513
2530
  }
2514
2531
  return p.join(".");
2515
2532
  }
2516
2533
  export {
2517
- Qe as XMLExplorer,
2518
- we as btTree,
2519
- Oe as buildMappingsForSyntax,
2520
- Ne as buildRuntimeTree
2534
+ tt as XMLExplorer,
2535
+ Le as btTree,
2536
+ He as buildMappingsForSyntax,
2537
+ Ue as buildRuntimeTree
2521
2538
  };