@opentrainticketing/netex-deckplan-editor 1.0.9 → 1.0.11

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.
@@ -1,256 +1,267 @@
1
- import { defineComponent as ne, ref as $, computed as le, resolveComponent as ae, createBlock as D, openBlock as m, withCtx as ve, createVNode as G, createElementBlock as k, createCommentVNode as be, Fragment as z, renderList as j, createElementVNode as w, withDirectives as me, toDisplayString as Z, vModelText as We, normalizeClass as te, vModelDynamic as st, vModelCheckbox as nt, watch as Ue, nextTick as it, reactive as Ae, mergeProps as rt, withModifiers as we } from "vue";
2
- const qe = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", ot = qe + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040", at = "[" + qe + "][" + ot + "]*", lt = new RegExp("^" + at + "$");
3
- function Be(t, e) {
4
- const s = [];
5
- let n = e.exec(t);
6
- for (; n; ) {
7
- const i = [];
8
- i.startIndex = e.lastIndex - n[0].length;
9
- const r = n.length;
10
- for (let o = 0; o < r; o++)
11
- i.push(n[o]);
12
- s.push(i), n = e.exec(t);
1
+ import { defineComponent as rt, ref as W, computed as ct, resolveComponent as lt, openBlock as b, createBlock as nt, withCtx as yt, createVNode as Y, createElementBlock as x, Fragment as K, renderList as Z, createCommentVNode as vt, createElementVNode as w, toDisplayString as D, withDirectives as bt, vModelText as Gt, normalizeClass as st, vModelDynamic as de, vModelCheckbox as fe, watch as zt, nextTick as pe, reactive as It, mergeProps as ge, withModifiers as wt } from "vue";
2
+ const Ht = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", me = Ht + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040", ye = "[" + Ht + "][" + me + "]*", be = new RegExp("^" + ye + "$");
3
+ function Yt(n, t) {
4
+ const e = [];
5
+ let s = t.exec(n);
6
+ for (; s; ) {
7
+ const r = [];
8
+ r.startIndex = t.lastIndex - s[0].length;
9
+ const i = s.length;
10
+ for (let l = 0; l < i; l++)
11
+ r.push(s[l]);
12
+ e.push(r), s = t.exec(n);
13
13
  }
14
- return s;
14
+ return e;
15
15
  }
16
- const Ee = function(t) {
17
- const e = lt.exec(t);
18
- return !(e === null || typeof e > "u");
16
+ const Nt = function(n) {
17
+ const t = be.exec(n);
18
+ return !(t === null || typeof t > "u");
19
19
  };
20
- function ct(t) {
21
- return typeof t < "u";
22
- }
23
- const dt = {
20
+ function ve(n) {
21
+ return typeof n < "u";
22
+ }
23
+ const Pt = [
24
+ // '__proto__',
25
+ // 'constructor',
26
+ // 'prototype',
27
+ "hasOwnProperty",
28
+ "toString",
29
+ "valueOf",
30
+ "__defineGetter__",
31
+ "__defineSetter__",
32
+ "__lookupGetter__",
33
+ "__lookupSetter__"
34
+ ], Kt = ["__proto__", "constructor", "prototype"], Ee = {
24
35
  allowBooleanAttributes: !1,
25
36
  //A tag can have attributes without any value
26
37
  unpairedTags: []
27
38
  };
28
- function ut(t, e) {
29
- e = Object.assign({}, dt, e);
30
- const s = [];
31
- let n = !1, i = !1;
32
- t[0] === "\uFEFF" && (t = t.substr(1));
33
- for (let r = 0; r < t.length; r++)
34
- if (t[r] === "<" && t[r + 1] === "?") {
35
- if (r += 2, r = Me(t, r), r.err) return r;
36
- } else if (t[r] === "<") {
37
- let o = r;
38
- if (r++, t[r] === "!") {
39
- r = Ve(t, r);
39
+ function Ne(n, t) {
40
+ t = Object.assign({}, Ee, t);
41
+ const e = [];
42
+ let s = !1, r = !1;
43
+ n[0] === "\uFEFF" && (n = n.substr(1));
44
+ for (let i = 0; i < n.length; i++)
45
+ if (n[i] === "<" && n[i + 1] === "?") {
46
+ if (i += 2, i = Rt(n, i), i.err) return i;
47
+ } else if (n[i] === "<") {
48
+ let l = i;
49
+ if (i++, n[i] === "!") {
50
+ i = Ft(n, i);
40
51
  continue;
41
52
  } else {
42
- let c = !1;
43
- t[r] === "/" && (c = !0, r++);
53
+ let o = !1;
54
+ n[i] === "/" && (o = !0, i++);
44
55
  let a = "";
45
- for (; r < t.length && t[r] !== ">" && t[r] !== " " && t[r] !== " " && t[r] !== `
46
- ` && t[r] !== "\r"; r++)
47
- a += t[r];
48
- if (a = a.trim(), a[a.length - 1] === "/" && (a = a.substring(0, a.length - 1), r--), !yt(a)) {
56
+ for (; i < n.length && n[i] !== ">" && n[i] !== " " && n[i] !== " " && n[i] !== `
57
+ ` && n[i] !== "\r"; i++)
58
+ a += n[i];
59
+ if (a = a.trim(), a[a.length - 1] === "/" && (a = a.substring(0, a.length - 1), i--), !Te(a)) {
49
60
  let d;
50
- return a.trim().length === 0 ? d = "Invalid space after '<'." : d = "Tag '" + a + "' is an invalid name.", T("InvalidTag", d, R(t, r));
61
+ return a.trim().length === 0 ? d = "Invalid space after '<'." : d = "Tag '" + a + "' is an invalid name.", T("InvalidTag", d, V(n, i));
51
62
  }
52
- const l = gt(t, r);
53
- if (l === !1)
54
- return T("InvalidAttr", "Attributes for '" + a + "' have open quote.", R(t, r));
55
- let h = l.value;
56
- if (r = l.index, h[h.length - 1] === "/") {
57
- const d = r - h.length;
63
+ const c = xe(n, i);
64
+ if (c === !1)
65
+ return T("InvalidAttr", "Attributes for '" + a + "' have open quote.", V(n, i));
66
+ let h = c.value;
67
+ if (i = c.index, h[h.length - 1] === "/") {
68
+ const d = i - h.length;
58
69
  h = h.substring(0, h.length - 1);
59
- const f = Re(h, e);
70
+ const f = Wt(h, t);
60
71
  if (f === !0)
61
- n = !0;
72
+ s = !0;
62
73
  else
63
- return T(f.err.code, f.err.msg, R(t, d + f.err.line));
64
- } else if (c)
65
- if (l.tagClosed) {
74
+ return T(f.err.code, f.err.msg, V(n, d + f.err.line));
75
+ } else if (o)
76
+ if (c.tagClosed) {
66
77
  if (h.trim().length > 0)
67
- return T("InvalidTag", "Closing tag '" + a + "' can't have attributes or invalid starting.", R(t, o));
68
- if (s.length === 0)
69
- return T("InvalidTag", "Closing tag '" + a + "' has not been opened.", R(t, o));
78
+ return T("InvalidTag", "Closing tag '" + a + "' can't have attributes or invalid starting.", V(n, l));
79
+ if (e.length === 0)
80
+ return T("InvalidTag", "Closing tag '" + a + "' has not been opened.", V(n, l));
70
81
  {
71
- const d = s.pop();
82
+ const d = e.pop();
72
83
  if (a !== d.tagName) {
73
- let f = R(t, d.tagStartPos);
84
+ let f = V(n, d.tagStartPos);
74
85
  return T(
75
86
  "InvalidTag",
76
87
  "Expected closing tag '" + d.tagName + "' (opened in line " + f.line + ", col " + f.col + ") instead of closing tag '" + a + "'.",
77
- R(t, o)
88
+ V(n, l)
78
89
  );
79
90
  }
80
- s.length == 0 && (i = !0);
91
+ e.length == 0 && (r = !0);
81
92
  }
82
- } else return T("InvalidTag", "Closing tag '" + a + "' doesn't have proper closing.", R(t, r));
93
+ } else return T("InvalidTag", "Closing tag '" + a + "' doesn't have proper closing.", V(n, i));
83
94
  else {
84
- const d = Re(h, e);
95
+ const d = Wt(h, t);
85
96
  if (d !== !0)
86
- return T(d.err.code, d.err.msg, R(t, r - h.length + d.err.line));
87
- if (i === !0)
88
- return T("InvalidXml", "Multiple possible root nodes found.", R(t, r));
89
- e.unpairedTags.indexOf(a) !== -1 || s.push({ tagName: a, tagStartPos: o }), n = !0;
97
+ return T(d.err.code, d.err.msg, V(n, i - h.length + d.err.line));
98
+ if (r === !0)
99
+ return T("InvalidXml", "Multiple possible root nodes found.", V(n, i));
100
+ t.unpairedTags.indexOf(a) !== -1 || e.push({ tagName: a, tagStartPos: l }), s = !0;
90
101
  }
91
- for (r++; r < t.length; r++)
92
- if (t[r] === "<")
93
- if (t[r + 1] === "!") {
94
- r++, r = Ve(t, r);
102
+ for (i++; i < n.length; i++)
103
+ if (n[i] === "<")
104
+ if (n[i + 1] === "!") {
105
+ i++, i = Ft(n, i);
95
106
  continue;
96
- } else if (t[r + 1] === "?") {
97
- if (r = Me(t, ++r), r.err) return r;
107
+ } else if (n[i + 1] === "?") {
108
+ if (i = Rt(n, ++i), i.err) return i;
98
109
  } else
99
110
  break;
100
- else if (t[r] === "&") {
101
- const d = mt(t, r);
111
+ else if (n[i] === "&") {
112
+ const d = _e(n, i);
102
113
  if (d == -1)
103
- return T("InvalidChar", "char '&' is not expected.", R(t, r));
104
- r = d;
105
- } else if (i === !0 && !Ie(t[r]))
106
- return T("InvalidXml", "Extra text at the end", R(t, r));
107
- t[r] === "<" && r--;
114
+ return T("InvalidChar", "char '&' is not expected.", V(n, i));
115
+ i = d;
116
+ } else if (r === !0 && !Vt(n[i]))
117
+ return T("InvalidXml", "Extra text at the end", V(n, i));
118
+ n[i] === "<" && i--;
108
119
  }
109
120
  } else {
110
- if (Ie(t[r]))
121
+ if (Vt(n[i]))
111
122
  continue;
112
- return T("InvalidChar", "char '" + t[r] + "' is not expected.", R(t, r));
123
+ return T("InvalidChar", "char '" + n[i] + "' is not expected.", V(n, i));
113
124
  }
114
- if (n) {
115
- if (s.length == 1)
116
- return T("InvalidTag", "Unclosed tag '" + s[0].tagName + "'.", R(t, s[0].tagStartPos));
117
- if (s.length > 0)
118
- return T("InvalidXml", "Invalid '" + JSON.stringify(s.map((r) => r.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 });
125
+ if (s) {
126
+ if (e.length == 1)
127
+ return T("InvalidTag", "Unclosed tag '" + e[0].tagName + "'.", V(n, e[0].tagStartPos));
128
+ if (e.length > 0)
129
+ return T("InvalidXml", "Invalid '" + JSON.stringify(e.map((i) => i.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 });
119
130
  } else return T("InvalidXml", "Start tag expected.", 1);
120
131
  return !0;
121
132
  }
122
- function Ie(t) {
123
- return t === " " || t === " " || t === `
124
- ` || t === "\r";
125
- }
126
- function Me(t, e) {
127
- const s = e;
128
- for (; e < t.length; e++)
129
- if (t[e] == "?" || t[e] == " ") {
130
- const n = t.substr(s, e - s);
131
- if (e > 5 && n === "xml")
132
- return T("InvalidXml", "XML declaration allowed only at the start of the document.", R(t, e));
133
- if (t[e] == "?" && t[e + 1] == ">") {
134
- e++;
133
+ function Vt(n) {
134
+ return n === " " || n === " " || n === `
135
+ ` || n === "\r";
136
+ }
137
+ function Rt(n, t) {
138
+ const e = t;
139
+ for (; t < n.length; t++)
140
+ if (n[t] == "?" || n[t] == " ") {
141
+ const s = n.substr(e, t - e);
142
+ if (t > 5 && s === "xml")
143
+ return T("InvalidXml", "XML declaration allowed only at the start of the document.", V(n, t));
144
+ if (n[t] == "?" && n[t + 1] == ">") {
145
+ t++;
135
146
  break;
136
147
  } else
137
148
  continue;
138
149
  }
139
- return e;
150
+ return t;
140
151
  }
141
- function Ve(t, e) {
142
- if (t.length > e + 5 && t[e + 1] === "-" && t[e + 2] === "-") {
143
- for (e += 3; e < t.length; e++)
144
- if (t[e] === "-" && t[e + 1] === "-" && t[e + 2] === ">") {
145
- e += 2;
152
+ function Ft(n, t) {
153
+ if (n.length > t + 5 && n[t + 1] === "-" && n[t + 2] === "-") {
154
+ for (t += 3; t < n.length; t++)
155
+ if (n[t] === "-" && n[t + 1] === "-" && n[t + 2] === ">") {
156
+ t += 2;
146
157
  break;
147
158
  }
148
- } else if (t.length > e + 8 && t[e + 1] === "D" && t[e + 2] === "O" && t[e + 3] === "C" && t[e + 4] === "T" && t[e + 5] === "Y" && t[e + 6] === "P" && t[e + 7] === "E") {
149
- let s = 1;
150
- for (e += 8; e < t.length; e++)
151
- if (t[e] === "<")
152
- s++;
153
- else if (t[e] === ">" && (s--, s === 0))
159
+ } else if (n.length > t + 8 && n[t + 1] === "D" && n[t + 2] === "O" && n[t + 3] === "C" && n[t + 4] === "T" && n[t + 5] === "Y" && n[t + 6] === "P" && n[t + 7] === "E") {
160
+ let e = 1;
161
+ for (t += 8; t < n.length; t++)
162
+ if (n[t] === "<")
163
+ e++;
164
+ else if (n[t] === ">" && (e--, e === 0))
154
165
  break;
155
- } else if (t.length > e + 9 && t[e + 1] === "[" && t[e + 2] === "C" && t[e + 3] === "D" && t[e + 4] === "A" && t[e + 5] === "T" && t[e + 6] === "A" && t[e + 7] === "[") {
156
- for (e += 8; e < t.length; e++)
157
- if (t[e] === "]" && t[e + 1] === "]" && t[e + 2] === ">") {
158
- e += 2;
166
+ } else if (n.length > t + 9 && n[t + 1] === "[" && n[t + 2] === "C" && n[t + 3] === "D" && n[t + 4] === "A" && n[t + 5] === "T" && n[t + 6] === "A" && n[t + 7] === "[") {
167
+ for (t += 8; t < n.length; t++)
168
+ if (n[t] === "]" && n[t + 1] === "]" && n[t + 2] === ">") {
169
+ t += 2;
159
170
  break;
160
171
  }
161
172
  }
162
- return e;
173
+ return t;
163
174
  }
164
- const ht = '"', ft = "'";
165
- function gt(t, e) {
166
- let s = "", n = "", i = !1;
167
- for (; e < t.length; e++) {
168
- if (t[e] === ht || t[e] === ft)
169
- n === "" ? n = t[e] : n !== t[e] || (n = "");
170
- else if (t[e] === ">" && n === "") {
171
- i = !0;
175
+ const we = '"', Se = "'";
176
+ function xe(n, t) {
177
+ let e = "", s = "", r = !1;
178
+ for (; t < n.length; t++) {
179
+ if (n[t] === we || n[t] === Se)
180
+ s === "" ? s = n[t] : s !== n[t] || (s = "");
181
+ else if (n[t] === ">" && s === "") {
182
+ r = !0;
172
183
  break;
173
184
  }
174
- s += t[e];
185
+ e += n[t];
175
186
  }
176
- return n !== "" ? !1 : {
177
- value: s,
178
- index: e,
179
- tagClosed: i
187
+ return s !== "" ? !1 : {
188
+ value: e,
189
+ index: t,
190
+ tagClosed: r
180
191
  };
181
192
  }
182
- const pt = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g");
183
- function Re(t, e) {
184
- const s = Be(t, pt), n = {};
185
- for (let i = 0; i < s.length; i++) {
186
- if (s[i][1].length === 0)
187
- return T("InvalidAttr", "Attribute '" + s[i][2] + "' has no space in starting.", ue(s[i]));
188
- if (s[i][3] !== void 0 && s[i][4] === void 0)
189
- return T("InvalidAttr", "Attribute '" + s[i][2] + "' is without value.", ue(s[i]));
190
- if (s[i][3] === void 0 && !e.allowBooleanAttributes)
191
- return T("InvalidAttr", "boolean attribute '" + s[i][2] + "' is not allowed.", ue(s[i]));
192
- const r = s[i][2];
193
- if (!bt(r))
194
- return T("InvalidAttr", "Attribute '" + r + "' is an invalid name.", ue(s[i]));
195
- if (!n.hasOwnProperty(r))
196
- n[r] = 1;
193
+ const ke = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g");
194
+ function Wt(n, t) {
195
+ const e = Yt(n, ke), s = {};
196
+ for (let r = 0; r < e.length; r++) {
197
+ if (e[r][1].length === 0)
198
+ return T("InvalidAttr", "Attribute '" + e[r][2] + "' has no space in starting.", dt(e[r]));
199
+ if (e[r][3] !== void 0 && e[r][4] === void 0)
200
+ return T("InvalidAttr", "Attribute '" + e[r][2] + "' is without value.", dt(e[r]));
201
+ if (e[r][3] === void 0 && !t.allowBooleanAttributes)
202
+ return T("InvalidAttr", "boolean attribute '" + e[r][2] + "' is not allowed.", dt(e[r]));
203
+ const i = e[r][2];
204
+ if (!Pe(i))
205
+ return T("InvalidAttr", "Attribute '" + i + "' is an invalid name.", dt(e[r]));
206
+ if (!Object.prototype.hasOwnProperty.call(s, i))
207
+ s[i] = 1;
197
208
  else
198
- return T("InvalidAttr", "Attribute '" + r + "' is repeated.", ue(s[i]));
209
+ return T("InvalidAttr", "Attribute '" + i + "' is repeated.", dt(e[r]));
199
210
  }
200
211
  return !0;
201
212
  }
202
- function vt(t, e) {
203
- let s = /\d/;
204
- for (t[e] === "x" && (e++, s = /[\da-fA-F]/); e < t.length; e++) {
205
- if (t[e] === ";")
206
- return e;
207
- if (!t[e].match(s))
213
+ function Ce(n, t) {
214
+ let e = /\d/;
215
+ for (n[t] === "x" && (t++, e = /[\da-fA-F]/); t < n.length; t++) {
216
+ if (n[t] === ";")
217
+ return t;
218
+ if (!n[t].match(e))
208
219
  break;
209
220
  }
210
221
  return -1;
211
222
  }
212
- function mt(t, e) {
213
- if (e++, t[e] === ";")
223
+ function _e(n, t) {
224
+ if (t++, n[t] === ";")
214
225
  return -1;
215
- if (t[e] === "#")
216
- return e++, vt(t, e);
217
- let s = 0;
218
- for (; e < t.length; e++, s++)
219
- if (!(t[e].match(/\w/) && s < 20)) {
220
- if (t[e] === ";")
226
+ if (n[t] === "#")
227
+ return t++, Ce(n, t);
228
+ let e = 0;
229
+ for (; t < n.length; t++, e++)
230
+ if (!(n[t].match(/\w/) && e < 20)) {
231
+ if (n[t] === ";")
221
232
  break;
222
233
  return -1;
223
234
  }
224
- return e;
235
+ return t;
225
236
  }
226
- function T(t, e, s) {
237
+ function T(n, t, e) {
227
238
  return {
228
239
  err: {
229
- code: t,
230
- msg: e,
231
- line: s.line || s,
232
- col: s.col
240
+ code: n,
241
+ msg: t,
242
+ line: e.line || e,
243
+ col: e.col
233
244
  }
234
245
  };
235
246
  }
236
- function bt(t) {
237
- return Ee(t);
247
+ function Pe(n) {
248
+ return Nt(n);
238
249
  }
239
- function yt(t) {
240
- return Ee(t);
250
+ function Te(n) {
251
+ return Nt(n);
241
252
  }
242
- function R(t, e) {
243
- const s = t.substring(0, e).split(/\r?\n/);
253
+ function V(n, t) {
254
+ const e = n.substring(0, t).split(/\r?\n/);
244
255
  return {
245
- line: s.length,
256
+ line: e.length,
246
257
  // column number is last line's length + 1, because column numbering starts at 1:
247
- col: s[s.length - 1].length + 1
258
+ col: e[e.length - 1].length + 1
248
259
  };
249
260
  }
250
- function ue(t) {
251
- return t.startIndex + t[1].length;
261
+ function dt(n) {
262
+ return n.startIndex + n[1].length;
252
263
  }
253
- const Et = {
264
+ const Zt = (n) => Pt.includes(n) ? "__" + n : n, Ae = {
254
265
  preserveOrder: !1,
255
266
  attributeNamePrefix: "@_",
256
267
  attributesGroupName: !1,
@@ -271,11 +282,11 @@ const Et = {
271
282
  leadingZeros: !0,
272
283
  eNotation: !0
273
284
  },
274
- tagValueProcessor: function(t, e) {
275
- return e;
285
+ tagValueProcessor: function(n, t) {
286
+ return t;
276
287
  },
277
- attributeValueProcessor: function(t, e) {
278
- return e;
288
+ attributeValueProcessor: function(n, t) {
289
+ return t;
279
290
  },
280
291
  stopNodes: [],
281
292
  //nested tags will not be parsed even for errors
@@ -289,275 +300,788 @@ const Et = {
289
300
  ignorePiTags: !1,
290
301
  transformTagName: !1,
291
302
  transformAttributeName: !1,
292
- updateTag: function(t, e, s) {
293
- return t;
303
+ updateTag: function(n, t, e) {
304
+ return n;
294
305
  },
295
306
  // skipEmptyListItem: false
296
- captureMetaData: !1
297
- }, wt = function(t) {
298
- return Object.assign({}, Et, t);
307
+ captureMetaData: !1,
308
+ maxNestedTags: 100,
309
+ strictReservedNames: !0,
310
+ jPath: !0,
311
+ // if true, pass jPath string to callbacks; if false, pass matcher instance
312
+ onDangerousProperty: Zt
299
313
  };
300
- let ye;
301
- typeof Symbol != "function" ? ye = "@@xmlMetadata" : ye = Symbol("XML Node Metadata");
302
- class ee {
303
- constructor(e) {
304
- this.tagname = e, this.child = [], this[":@"] = {};
314
+ function Le(n, t) {
315
+ if (typeof n != "string")
316
+ return;
317
+ const e = n.toLowerCase();
318
+ if (Pt.some((s) => e === s.toLowerCase()))
319
+ throw new Error(
320
+ `[SECURITY] Invalid ${t}: "${n}" is a reserved JavaScript keyword that could cause prototype pollution`
321
+ );
322
+ if (Kt.some((s) => e === s.toLowerCase()))
323
+ throw new Error(
324
+ `[SECURITY] Invalid ${t}: "${n}" is a reserved JavaScript keyword that could cause prototype pollution`
325
+ );
326
+ }
327
+ function Jt(n) {
328
+ return typeof n == "boolean" ? {
329
+ enabled: n,
330
+ // true or false
331
+ maxEntitySize: 1e4,
332
+ maxExpansionDepth: 10,
333
+ maxTotalExpansions: 1e3,
334
+ maxExpandedLength: 1e5,
335
+ maxEntityCount: 100,
336
+ allowedTags: null,
337
+ tagFilter: null
338
+ } : typeof n == "object" && n !== null ? {
339
+ enabled: n.enabled !== !1,
340
+ maxEntitySize: Math.max(1, n.maxEntitySize ?? 1e4),
341
+ maxExpansionDepth: Math.max(1, n.maxExpansionDepth ?? 10),
342
+ maxTotalExpansions: Math.max(1, n.maxTotalExpansions ?? 1e3),
343
+ maxExpandedLength: Math.max(1, n.maxExpandedLength ?? 1e5),
344
+ maxEntityCount: Math.max(1, n.maxEntityCount ?? 100),
345
+ allowedTags: n.allowedTags ?? null,
346
+ tagFilter: n.tagFilter ?? null
347
+ } : Jt(!0);
348
+ }
349
+ const $e = function(n) {
350
+ const t = Object.assign({}, Ae, n), e = [
351
+ { value: t.attributeNamePrefix, name: "attributeNamePrefix" },
352
+ { value: t.attributesGroupName, name: "attributesGroupName" },
353
+ { value: t.textNodeName, name: "textNodeName" },
354
+ { value: t.cdataPropName, name: "cdataPropName" },
355
+ { value: t.commentPropName, name: "commentPropName" }
356
+ ];
357
+ for (const { value: s, name: r } of e)
358
+ s && Le(s, r);
359
+ return t.onDangerousProperty === null && (t.onDangerousProperty = Zt), t.processEntities = Jt(t.processEntities), t.stopNodes && Array.isArray(t.stopNodes) && (t.stopNodes = t.stopNodes.map((s) => typeof s == "string" && s.startsWith("*.") ? ".." + s.substring(2) : s)), t;
360
+ };
361
+ let Et;
362
+ typeof Symbol != "function" ? Et = "@@xmlMetadata" : Et = Symbol("XML Node Metadata");
363
+ class Q {
364
+ constructor(t) {
365
+ this.tagname = t, this.child = [], this[":@"] = /* @__PURE__ */ Object.create(null);
305
366
  }
306
- add(e, s) {
307
- e === "__proto__" && (e = "#__proto__"), this.child.push({ [e]: s });
367
+ add(t, e) {
368
+ t === "__proto__" && (t = "#__proto__"), this.child.push({ [t]: e });
308
369
  }
309
- addChild(e, s) {
310
- e.tagname === "__proto__" && (e.tagname = "#__proto__"), e[":@"] && Object.keys(e[":@"]).length > 0 ? this.child.push({ [e.tagname]: e.child, ":@": e[":@"] }) : this.child.push({ [e.tagname]: e.child }), s !== void 0 && (this.child[this.child.length - 1][ye] = { startIndex: s });
370
+ addChild(t, e) {
371
+ t.tagname === "__proto__" && (t.tagname = "#__proto__"), t[":@"] && Object.keys(t[":@"]).length > 0 ? this.child.push({ [t.tagname]: t.child, ":@": t[":@"] }) : this.child.push({ [t.tagname]: t.child }), e !== void 0 && (this.child[this.child.length - 1][Et] = { startIndex: e });
311
372
  }
312
373
  /** symbol used for metadata */
313
374
  static getMetaDataSymbol() {
314
- return ye;
315
- }
316
- }
317
- class St {
318
- constructor(e) {
319
- this.suppressValidationErr = !e;
320
- }
321
- readDocType(e, s) {
322
- const n = {};
323
- if (e[s + 3] === "O" && e[s + 4] === "C" && e[s + 5] === "T" && e[s + 6] === "Y" && e[s + 7] === "P" && e[s + 8] === "E") {
324
- s = s + 9;
325
- let i = 1, r = !1, o = !1, c = "";
326
- for (; s < e.length; s++)
327
- if (e[s] === "<" && !o) {
328
- if (r && J(e, "!ENTITY", s)) {
329
- s += 7;
330
- let a, l;
331
- [a, l, s] = this.readEntityExp(e, s + 1, this.suppressValidationErr), l.indexOf("&") === -1 && (n[a] = {
332
- regx: RegExp(`&${a};`, "g"),
333
- val: l
334
- });
335
- } else if (r && J(e, "!ELEMENT", s)) {
336
- s += 8;
337
- const { index: a } = this.readElementExp(e, s + 1);
338
- s = a;
339
- } else if (r && J(e, "!ATTLIST", s))
340
- s += 8;
341
- else if (r && J(e, "!NOTATION", s)) {
342
- s += 9;
343
- const { index: a } = this.readNotationExp(e, s + 1, this.suppressValidationErr);
344
- s = a;
345
- } else if (J(e, "!--", s)) o = !0;
375
+ return Et;
376
+ }
377
+ }
378
+ class Me {
379
+ constructor(t) {
380
+ this.suppressValidationErr = !t, this.options = t;
381
+ }
382
+ readDocType(t, e) {
383
+ const s = /* @__PURE__ */ Object.create(null);
384
+ let r = 0;
385
+ if (t[e + 3] === "O" && t[e + 4] === "C" && t[e + 5] === "T" && t[e + 6] === "Y" && t[e + 7] === "P" && t[e + 8] === "E") {
386
+ e = e + 9;
387
+ let i = 1, l = !1, o = !1, a = "";
388
+ for (; e < t.length; e++)
389
+ if (t[e] === "<" && !o) {
390
+ if (l && et(t, "!ENTITY", e)) {
391
+ e += 7;
392
+ let c, h;
393
+ if ([c, h, e] = this.readEntityExp(t, e + 1, this.suppressValidationErr), h.indexOf("&") === -1) {
394
+ if (this.options.enabled !== !1 && this.options.maxEntityCount != null && r >= this.options.maxEntityCount)
395
+ throw new Error(
396
+ `Entity count (${r + 1}) exceeds maximum allowed (${this.options.maxEntityCount})`
397
+ );
398
+ const d = c.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
399
+ s[c] = {
400
+ regx: RegExp(`&${d};`, "g"),
401
+ val: h
402
+ }, r++;
403
+ }
404
+ } else if (l && et(t, "!ELEMENT", e)) {
405
+ e += 8;
406
+ const { index: c } = this.readElementExp(t, e + 1);
407
+ e = c;
408
+ } else if (l && et(t, "!ATTLIST", e))
409
+ e += 8;
410
+ else if (l && et(t, "!NOTATION", e)) {
411
+ e += 9;
412
+ const { index: c } = this.readNotationExp(t, e + 1, this.suppressValidationErr);
413
+ e = c;
414
+ } else if (et(t, "!--", e)) o = !0;
346
415
  else throw new Error("Invalid DOCTYPE");
347
- i++, c = "";
348
- } else if (e[s] === ">") {
349
- if (o ? e[s - 1] === "-" && e[s - 2] === "-" && (o = !1, i--) : i--, i === 0)
416
+ i++, a = "";
417
+ } else if (t[e] === ">") {
418
+ if (o ? t[e - 1] === "-" && t[e - 2] === "-" && (o = !1, i--) : i--, i === 0)
350
419
  break;
351
- } else e[s] === "[" ? r = !0 : c += e[s];
420
+ } else t[e] === "[" ? l = !0 : a += t[e];
352
421
  if (i !== 0)
353
422
  throw new Error("Unclosed DOCTYPE");
354
423
  } else
355
424
  throw new Error("Invalid Tag instead of DOCTYPE");
356
- return { entities: n, i: s };
357
- }
358
- readEntityExp(e, s) {
359
- s = O(e, s);
360
- let n = "";
361
- for (; s < e.length && !/\s/.test(e[s]) && e[s] !== '"' && e[s] !== "'"; )
362
- n += e[s], s++;
363
- if (he(n), s = O(e, s), !this.suppressValidationErr) {
364
- if (e.substring(s, s + 6).toUpperCase() === "SYSTEM")
425
+ return { entities: s, i: e };
426
+ }
427
+ readEntityExp(t, e) {
428
+ e = R(t, e);
429
+ const s = e;
430
+ for (; e < t.length && !/\s/.test(t[e]) && t[e] !== '"' && t[e] !== "'"; )
431
+ e++;
432
+ let r = t.substring(s, e);
433
+ if (ft(r), e = R(t, e), !this.suppressValidationErr) {
434
+ if (t.substring(e, e + 6).toUpperCase() === "SYSTEM")
365
435
  throw new Error("External entities are not supported");
366
- if (e[s] === "%")
436
+ if (t[e] === "%")
367
437
  throw new Error("Parameter entities are not supported");
368
438
  }
369
439
  let i = "";
370
- return [s, i] = this.readIdentifierVal(e, s, "entity"), s--, [n, i, s];
371
- }
372
- readNotationExp(e, s) {
373
- s = O(e, s);
374
- let n = "";
375
- for (; s < e.length && !/\s/.test(e[s]); )
376
- n += e[s], s++;
377
- !this.suppressValidationErr && he(n), s = O(e, s);
378
- const i = e.substring(s, s + 6).toUpperCase();
440
+ if ([e, i] = this.readIdentifierVal(t, e, "entity"), this.options.enabled !== !1 && this.options.maxEntitySize != null && i.length > this.options.maxEntitySize)
441
+ throw new Error(
442
+ `Entity "${r}" size (${i.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`
443
+ );
444
+ return e--, [r, i, e];
445
+ }
446
+ readNotationExp(t, e) {
447
+ e = R(t, e);
448
+ const s = e;
449
+ for (; e < t.length && !/\s/.test(t[e]); )
450
+ e++;
451
+ let r = t.substring(s, e);
452
+ !this.suppressValidationErr && ft(r), e = R(t, e);
453
+ const i = t.substring(e, e + 6).toUpperCase();
379
454
  if (!this.suppressValidationErr && i !== "SYSTEM" && i !== "PUBLIC")
380
455
  throw new Error(`Expected SYSTEM or PUBLIC, found "${i}"`);
381
- s += i.length, s = O(e, s);
382
- let r = null, o = null;
456
+ e += i.length, e = R(t, e);
457
+ let l = null, o = null;
383
458
  if (i === "PUBLIC")
384
- [s, r] = this.readIdentifierVal(e, s, "publicIdentifier"), s = O(e, s), (e[s] === '"' || e[s] === "'") && ([s, o] = this.readIdentifierVal(e, s, "systemIdentifier"));
385
- else if (i === "SYSTEM" && ([s, o] = this.readIdentifierVal(e, s, "systemIdentifier"), !this.suppressValidationErr && !o))
459
+ [e, l] = this.readIdentifierVal(t, e, "publicIdentifier"), e = R(t, e), (t[e] === '"' || t[e] === "'") && ([e, o] = this.readIdentifierVal(t, e, "systemIdentifier"));
460
+ else if (i === "SYSTEM" && ([e, o] = this.readIdentifierVal(t, e, "systemIdentifier"), !this.suppressValidationErr && !o))
386
461
  throw new Error("Missing mandatory system identifier for SYSTEM notation");
387
- return { notationName: n, publicIdentifier: r, systemIdentifier: o, index: --s };
462
+ return { notationName: r, publicIdentifier: l, systemIdentifier: o, index: --e };
388
463
  }
389
- readIdentifierVal(e, s, n) {
390
- let i = "";
391
- const r = e[s];
392
- if (r !== '"' && r !== "'")
393
- throw new Error(`Expected quoted string, found "${r}"`);
394
- for (s++; s < e.length && e[s] !== r; )
395
- i += e[s], s++;
396
- if (e[s] !== r)
397
- throw new Error(`Unterminated ${n} value`);
398
- return s++, [s, i];
399
- }
400
- readElementExp(e, s) {
401
- s = O(e, s);
402
- let n = "";
403
- for (; s < e.length && !/\s/.test(e[s]); )
404
- n += e[s], s++;
405
- if (!this.suppressValidationErr && !Ee(n))
406
- throw new Error(`Invalid element name: "${n}"`);
407
- s = O(e, s);
464
+ readIdentifierVal(t, e, s) {
465
+ let r = "";
466
+ const i = t[e];
467
+ if (i !== '"' && i !== "'")
468
+ throw new Error(`Expected quoted string, found "${i}"`);
469
+ e++;
470
+ const l = e;
471
+ for (; e < t.length && t[e] !== i; )
472
+ e++;
473
+ if (r = t.substring(l, e), t[e] !== i)
474
+ throw new Error(`Unterminated ${s} value`);
475
+ return e++, [e, r];
476
+ }
477
+ readElementExp(t, e) {
478
+ e = R(t, e);
479
+ const s = e;
480
+ for (; e < t.length && !/\s/.test(t[e]); )
481
+ e++;
482
+ let r = t.substring(s, e);
483
+ if (!this.suppressValidationErr && !Nt(r))
484
+ throw new Error(`Invalid element name: "${r}"`);
485
+ e = R(t, e);
408
486
  let i = "";
409
- if (e[s] === "E" && J(e, "MPTY", s)) s += 4;
410
- else if (e[s] === "A" && J(e, "NY", s)) s += 2;
411
- else if (e[s] === "(") {
412
- for (s++; s < e.length && e[s] !== ")"; )
413
- i += e[s], s++;
414
- if (e[s] !== ")")
487
+ if (t[e] === "E" && et(t, "MPTY", e)) e += 4;
488
+ else if (t[e] === "A" && et(t, "NY", e)) e += 2;
489
+ else if (t[e] === "(") {
490
+ e++;
491
+ const l = e;
492
+ for (; e < t.length && t[e] !== ")"; )
493
+ e++;
494
+ if (i = t.substring(l, e), t[e] !== ")")
415
495
  throw new Error("Unterminated content model");
416
496
  } else if (!this.suppressValidationErr)
417
- throw new Error(`Invalid Element Expression, found "${e[s]}"`);
497
+ throw new Error(`Invalid Element Expression, found "${t[e]}"`);
418
498
  return {
419
- elementName: n,
499
+ elementName: r,
420
500
  contentModel: i.trim(),
421
- index: s
501
+ index: e
422
502
  };
423
503
  }
424
- readAttlistExp(e, s) {
425
- s = O(e, s);
426
- let n = "";
427
- for (; s < e.length && !/\s/.test(e[s]); )
428
- n += e[s], s++;
429
- he(n), s = O(e, s);
430
- let i = "";
431
- for (; s < e.length && !/\s/.test(e[s]); )
432
- i += e[s], s++;
433
- if (!he(i))
504
+ readAttlistExp(t, e) {
505
+ e = R(t, e);
506
+ let s = e;
507
+ for (; e < t.length && !/\s/.test(t[e]); )
508
+ e++;
509
+ let r = t.substring(s, e);
510
+ for (ft(r), e = R(t, e), s = e; e < t.length && !/\s/.test(t[e]); )
511
+ e++;
512
+ let i = t.substring(s, e);
513
+ if (!ft(i))
434
514
  throw new Error(`Invalid attribute name: "${i}"`);
435
- s = O(e, s);
436
- let r = "";
437
- if (e.substring(s, s + 8).toUpperCase() === "NOTATION") {
438
- if (r = "NOTATION", s += 8, s = O(e, s), e[s] !== "(")
439
- throw new Error(`Expected '(', found "${e[s]}"`);
440
- s++;
441
- let c = [];
442
- for (; s < e.length && e[s] !== ")"; ) {
443
- let a = "";
444
- for (; s < e.length && e[s] !== "|" && e[s] !== ")"; )
445
- a += e[s], s++;
446
- if (a = a.trim(), !he(a))
447
- throw new Error(`Invalid notation name: "${a}"`);
448
- c.push(a), e[s] === "|" && (s++, s = O(e, s));
515
+ e = R(t, e);
516
+ let l = "";
517
+ if (t.substring(e, e + 8).toUpperCase() === "NOTATION") {
518
+ if (l = "NOTATION", e += 8, e = R(t, e), t[e] !== "(")
519
+ throw new Error(`Expected '(', found "${t[e]}"`);
520
+ e++;
521
+ let a = [];
522
+ for (; e < t.length && t[e] !== ")"; ) {
523
+ const c = e;
524
+ for (; e < t.length && t[e] !== "|" && t[e] !== ")"; )
525
+ e++;
526
+ let h = t.substring(c, e);
527
+ if (h = h.trim(), !ft(h))
528
+ throw new Error(`Invalid notation name: "${h}"`);
529
+ a.push(h), t[e] === "|" && (e++, e = R(t, e));
449
530
  }
450
- if (e[s] !== ")")
531
+ if (t[e] !== ")")
451
532
  throw new Error("Unterminated list of notations");
452
- s++, r += " (" + c.join("|") + ")";
533
+ e++, l += " (" + a.join("|") + ")";
453
534
  } else {
454
- for (; s < e.length && !/\s/.test(e[s]); )
455
- r += e[s], s++;
535
+ const a = e;
536
+ for (; e < t.length && !/\s/.test(t[e]); )
537
+ e++;
538
+ l += t.substring(a, e);
456
539
  const c = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"];
457
- if (!this.suppressValidationErr && !c.includes(r.toUpperCase()))
458
- throw new Error(`Invalid attribute type: "${r}"`);
540
+ if (!this.suppressValidationErr && !c.includes(l.toUpperCase()))
541
+ throw new Error(`Invalid attribute type: "${l}"`);
459
542
  }
460
- s = O(e, s);
543
+ e = R(t, e);
461
544
  let o = "";
462
- return e.substring(s, s + 8).toUpperCase() === "#REQUIRED" ? (o = "#REQUIRED", s += 8) : e.substring(s, s + 7).toUpperCase() === "#IMPLIED" ? (o = "#IMPLIED", s += 7) : [s, o] = this.readIdentifierVal(e, s, "ATTLIST"), {
463
- elementName: n,
545
+ return t.substring(e, e + 8).toUpperCase() === "#REQUIRED" ? (o = "#REQUIRED", e += 8) : t.substring(e, e + 7).toUpperCase() === "#IMPLIED" ? (o = "#IMPLIED", e += 7) : [e, o] = this.readIdentifierVal(t, e, "ATTLIST"), {
546
+ elementName: r,
464
547
  attributeName: i,
465
- attributeType: r,
548
+ attributeType: l,
466
549
  defaultValue: o,
467
- index: s
550
+ index: e
468
551
  };
469
552
  }
470
553
  }
471
- const O = (t, e) => {
472
- for (; e < t.length && /\s/.test(t[e]); )
473
- e++;
474
- return e;
554
+ const R = (n, t) => {
555
+ for (; t < n.length && /\s/.test(n[t]); )
556
+ t++;
557
+ return t;
475
558
  };
476
- function J(t, e, s) {
477
- for (let n = 0; n < e.length; n++)
478
- if (e[n] !== t[s + n + 1]) return !1;
559
+ function et(n, t, e) {
560
+ for (let s = 0; s < t.length; s++)
561
+ if (t[s] !== n[e + s + 1]) return !1;
479
562
  return !0;
480
563
  }
481
- function he(t) {
482
- if (Ee(t))
483
- return t;
484
- throw new Error(`Invalid entity name ${t}`);
564
+ function ft(n) {
565
+ if (Nt(n))
566
+ return n;
567
+ throw new Error(`Invalid entity name ${n}`);
485
568
  }
486
- const Nt = /^[-+]?0x[a-fA-F0-9]+$/, kt = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, _t = {
569
+ const Oe = /^[-+]?0x[a-fA-F0-9]+$/, Ie = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, Ve = {
487
570
  hex: !0,
488
571
  // oct: false,
489
572
  leadingZeros: !0,
490
573
  decimalPoint: ".",
491
- eNotation: !0
492
- //skipLike: /regex/
574
+ eNotation: !0,
575
+ //skipLike: /regex/,
576
+ infinity: "original"
577
+ // "null", "infinity" (Infinity type), "string" ("Infinity" (the string literal))
493
578
  };
494
- function xt(t, e = {}) {
495
- if (e = Object.assign({}, _t, e), !t || typeof t != "string") return t;
496
- let s = t.trim();
497
- if (e.skipLike !== void 0 && e.skipLike.test(s)) return t;
498
- if (t === "0") return 0;
499
- if (e.hex && Nt.test(s))
500
- return Lt(s, 16);
501
- if (s.includes("e") || s.includes("E"))
502
- return Tt(t, s, e);
503
- {
504
- const n = kt.exec(s);
505
- if (n) {
506
- const i = n[1] || "", r = n[2];
507
- let o = Pt(n[3]);
508
- const c = i ? (
509
- // 0., -00., 000.
510
- t[r.length + 1] === "."
511
- ) : t[r.length] === ".";
512
- if (!e.leadingZeros && (r.length > 1 || r.length === 1 && !c))
513
- return t;
514
- {
515
- const a = Number(s), l = String(a);
516
- if (a === 0) return a;
517
- if (l.search(/[eE]/) !== -1)
518
- return e.eNotation ? a : t;
519
- if (s.indexOf(".") !== -1)
520
- return l === "0" || l === o || l === `${i}${o}` ? a : t;
521
- let h = r ? o : s;
522
- return r ? h === l || i + h === l ? a : t : h === l || h === i + l ? a : t;
523
- }
524
- } else
525
- return t;
526
- }
579
+ function Re(n, t = {}) {
580
+ if (t = Object.assign({}, Ve, t), !n || typeof n != "string") return n;
581
+ let e = n.trim();
582
+ if (e.length === 0) return n;
583
+ if (t.skipLike !== void 0 && t.skipLike.test(e)) return n;
584
+ if (e === "0") return 0;
585
+ if (t.hex && Oe.test(e))
586
+ return Ue(e, 16);
587
+ if (isFinite(e)) {
588
+ if (e.includes("e") || e.includes("E"))
589
+ return We(n, e, t);
590
+ {
591
+ const s = Ie.exec(e);
592
+ if (s) {
593
+ const r = s[1] || "", i = s[2];
594
+ let l = Xe(s[3]);
595
+ const o = r ? (
596
+ // 0., -00., 000.
597
+ n[i.length + 1] === "."
598
+ ) : n[i.length] === ".";
599
+ if (!t.leadingZeros && (i.length > 1 || i.length === 1 && !o))
600
+ return n;
601
+ {
602
+ const a = Number(e), c = String(a);
603
+ if (a === 0) return a;
604
+ if (c.search(/[eE]/) !== -1)
605
+ return t.eNotation ? a : n;
606
+ if (e.indexOf(".") !== -1)
607
+ return c === "0" || c === l || c === `${r}${l}` ? a : n;
608
+ let h = i ? l : e;
609
+ return i ? h === c || r + h === c ? a : n : h === c || h === r + c ? a : n;
610
+ }
611
+ } else
612
+ return n;
613
+ }
614
+ } else return Be(n, Number(e), t);
527
615
  }
528
- const Ct = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;
529
- function Tt(t, e, s) {
530
- if (!s.eNotation) return t;
531
- const n = e.match(Ct);
532
- if (n) {
533
- let i = n[1] || "";
534
- const r = n[3].indexOf("e") === -1 ? "E" : "e", o = n[2], c = i ? (
616
+ const Fe = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;
617
+ function We(n, t, e) {
618
+ if (!e.eNotation) return n;
619
+ const s = t.match(Fe);
620
+ if (s) {
621
+ let r = s[1] || "";
622
+ const i = s[3].indexOf("e") === -1 ? "E" : "e", l = s[2], o = r ? (
535
623
  // 0E.
536
- t[o.length + 1] === r
537
- ) : t[o.length] === r;
538
- return o.length > 1 && c ? t : o.length === 1 && (n[3].startsWith(`.${r}`) || n[3][0] === r) ? Number(e) : s.leadingZeros && !c ? (e = (n[1] || "") + n[3], Number(e)) : t;
624
+ n[l.length + 1] === i
625
+ ) : n[l.length] === i;
626
+ return l.length > 1 && o ? n : l.length === 1 && (s[3].startsWith(`.${i}`) || s[3][0] === i) ? Number(t) : l.length > 0 ? e.leadingZeros && !o ? (t = (s[1] || "") + s[3], Number(t)) : n : Number(t);
539
627
  } else
540
- return t;
628
+ return n;
541
629
  }
542
- function Pt(t) {
543
- return t && t.indexOf(".") !== -1 && (t = t.replace(/0+$/, ""), t === "." ? t = "0" : t[0] === "." ? t = "0" + t : t[t.length - 1] === "." && (t = t.substring(0, t.length - 1))), t;
630
+ function Xe(n) {
631
+ return n && n.indexOf(".") !== -1 && (n = n.replace(/0+$/, ""), n === "." ? n = "0" : n[0] === "." ? n = "0" + n : n[n.length - 1] === "." && (n = n.substring(0, n.length - 1))), n;
544
632
  }
545
- function Lt(t, e) {
546
- if (parseInt) return parseInt(t, e);
547
- if (Number.parseInt) return Number.parseInt(t, e);
548
- if (window && window.parseInt) return window.parseInt(t, e);
633
+ function Ue(n, t) {
634
+ if (parseInt) return parseInt(n, t);
635
+ if (Number.parseInt) return Number.parseInt(n, t);
636
+ if (window && window.parseInt) return window.parseInt(n, t);
549
637
  throw new Error("parseInt, Number.parseInt, window.parseInt are not supported");
550
638
  }
551
- function He(t) {
552
- return typeof t == "function" ? t : Array.isArray(t) ? (e) => {
553
- for (const s of t)
554
- if (typeof s == "string" && e === s || s instanceof RegExp && s.test(e))
639
+ function Be(n, t, e) {
640
+ const s = t === 1 / 0;
641
+ switch (e.infinity.toLowerCase()) {
642
+ case "null":
643
+ return null;
644
+ case "infinity":
645
+ return t;
646
+ // Return Infinity or -Infinity
647
+ case "string":
648
+ return s ? "Infinity" : "-Infinity";
649
+ case "original":
650
+ default:
651
+ return n;
652
+ }
653
+ }
654
+ function qe(n) {
655
+ return typeof n == "function" ? n : Array.isArray(n) ? (t) => {
656
+ for (const e of n)
657
+ if (typeof e == "string" && t === e || e instanceof RegExp && e.test(t))
555
658
  return !0;
556
659
  } : () => !1;
557
660
  }
558
- class At {
559
- constructor(e) {
560
- if (this.options = e, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = {
661
+ class ut {
662
+ /**
663
+ * Create a new Expression
664
+ * @param {string} pattern - Pattern string (e.g., "root.users.user", "..user[id]")
665
+ * @param {Object} options - Configuration options
666
+ * @param {string} options.separator - Path separator (default: '.')
667
+ */
668
+ constructor(t, e = {}) {
669
+ this.pattern = t, this.separator = e.separator || ".", this.segments = this._parse(t), this._hasDeepWildcard = this.segments.some((s) => s.type === "deep-wildcard"), this._hasAttributeCondition = this.segments.some((s) => s.attrName !== void 0), this._hasPositionSelector = this.segments.some((s) => s.position !== void 0);
670
+ }
671
+ /**
672
+ * Parse pattern string into segments
673
+ * @private
674
+ * @param {string} pattern - Pattern to parse
675
+ * @returns {Array} Array of segment objects
676
+ */
677
+ _parse(t) {
678
+ const e = [];
679
+ let s = 0, r = "";
680
+ for (; s < t.length; )
681
+ t[s] === this.separator ? s + 1 < t.length && t[s + 1] === this.separator ? (r.trim() && (e.push(this._parseSegment(r.trim())), r = ""), e.push({ type: "deep-wildcard" }), s += 2) : (r.trim() && e.push(this._parseSegment(r.trim())), r = "", s++) : (r += t[s], s++);
682
+ return r.trim() && e.push(this._parseSegment(r.trim())), e;
683
+ }
684
+ /**
685
+ * Parse a single segment
686
+ * @private
687
+ * @param {string} part - Segment string (e.g., "user", "ns::user", "user[id]", "ns::user:first")
688
+ * @returns {Object} Segment object
689
+ */
690
+ _parseSegment(t) {
691
+ const e = { type: "tag" };
692
+ let s = null, r = t;
693
+ const i = t.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);
694
+ if (i && (r = i[1] + i[3], i[2])) {
695
+ const h = i[2].slice(1, -1);
696
+ h && (s = h);
697
+ }
698
+ let l, o = r;
699
+ if (r.includes("::")) {
700
+ const h = r.indexOf("::");
701
+ if (l = r.substring(0, h).trim(), o = r.substring(h + 2).trim(), !l)
702
+ throw new Error(`Invalid namespace in pattern: ${t}`);
703
+ }
704
+ let a, c = null;
705
+ if (o.includes(":")) {
706
+ const h = o.lastIndexOf(":"), d = o.substring(0, h).trim(), f = o.substring(h + 1).trim();
707
+ ["first", "last", "odd", "even"].includes(f) || /^nth\(\d+\)$/.test(f) ? (a = d, c = f) : a = o;
708
+ } else
709
+ a = o;
710
+ if (!a)
711
+ throw new Error(`Invalid segment pattern: ${t}`);
712
+ if (e.tag = a, l && (e.namespace = l), s)
713
+ if (s.includes("=")) {
714
+ const h = s.indexOf("=");
715
+ e.attrName = s.substring(0, h).trim(), e.attrValue = s.substring(h + 1).trim();
716
+ } else
717
+ e.attrName = s.trim();
718
+ if (c) {
719
+ const h = c.match(/^nth\((\d+)\)$/);
720
+ h ? (e.position = "nth", e.positionValue = parseInt(h[1], 10)) : e.position = c;
721
+ }
722
+ return e;
723
+ }
724
+ /**
725
+ * Get the number of segments
726
+ * @returns {number}
727
+ */
728
+ get length() {
729
+ return this.segments.length;
730
+ }
731
+ /**
732
+ * Check if expression contains deep wildcard
733
+ * @returns {boolean}
734
+ */
735
+ hasDeepWildcard() {
736
+ return this._hasDeepWildcard;
737
+ }
738
+ /**
739
+ * Check if expression has attribute conditions
740
+ * @returns {boolean}
741
+ */
742
+ hasAttributeCondition() {
743
+ return this._hasAttributeCondition;
744
+ }
745
+ /**
746
+ * Check if expression has position selectors
747
+ * @returns {boolean}
748
+ */
749
+ hasPositionSelector() {
750
+ return this._hasPositionSelector;
751
+ }
752
+ /**
753
+ * Get string representation
754
+ * @returns {string}
755
+ */
756
+ toString() {
757
+ return this.pattern;
758
+ }
759
+ }
760
+ const je = /* @__PURE__ */ new Set(["push", "pop", "reset", "updateCurrent", "restore"]);
761
+ class Tt {
762
+ /**
763
+ * Create a new Matcher
764
+ * @param {Object} options - Configuration options
765
+ * @param {string} options.separator - Default path separator (default: '.')
766
+ */
767
+ constructor(t = {}) {
768
+ this.separator = t.separator || ".", this.path = [], this.siblingStacks = [];
769
+ }
770
+ /**
771
+ * Push a new tag onto the path
772
+ * @param {string} tagName - Name of the tag
773
+ * @param {Object} attrValues - Attribute key-value pairs for current node (optional)
774
+ * @param {string} namespace - Namespace for the tag (optional)
775
+ */
776
+ push(t, e = null, s = null) {
777
+ if (this.path.length > 0) {
778
+ const h = this.path[this.path.length - 1];
779
+ h.values = void 0;
780
+ }
781
+ const r = this.path.length;
782
+ this.siblingStacks[r] || (this.siblingStacks[r] = /* @__PURE__ */ new Map());
783
+ const i = this.siblingStacks[r], l = s ? `${s}:${t}` : t, o = i.get(l) || 0;
784
+ let a = 0;
785
+ for (const h of i.values())
786
+ a += h;
787
+ i.set(l, o + 1);
788
+ const c = {
789
+ tag: t,
790
+ position: a,
791
+ counter: o
792
+ };
793
+ s != null && (c.namespace = s), e != null && (c.values = e), this.path.push(c);
794
+ }
795
+ /**
796
+ * Pop the last tag from the path
797
+ * @returns {Object|undefined} The popped node
798
+ */
799
+ pop() {
800
+ if (this.path.length === 0)
801
+ return;
802
+ const t = this.path.pop();
803
+ return this.siblingStacks.length > this.path.length + 1 && (this.siblingStacks.length = this.path.length + 1), t;
804
+ }
805
+ /**
806
+ * Update current node's attribute values
807
+ * Useful when attributes are parsed after push
808
+ * @param {Object} attrValues - Attribute values
809
+ */
810
+ updateCurrent(t) {
811
+ if (this.path.length > 0) {
812
+ const e = this.path[this.path.length - 1];
813
+ t != null && (e.values = t);
814
+ }
815
+ }
816
+ /**
817
+ * Get current tag name
818
+ * @returns {string|undefined}
819
+ */
820
+ getCurrentTag() {
821
+ return this.path.length > 0 ? this.path[this.path.length - 1].tag : void 0;
822
+ }
823
+ /**
824
+ * Get current namespace
825
+ * @returns {string|undefined}
826
+ */
827
+ getCurrentNamespace() {
828
+ return this.path.length > 0 ? this.path[this.path.length - 1].namespace : void 0;
829
+ }
830
+ /**
831
+ * Get current node's attribute value
832
+ * @param {string} attrName - Attribute name
833
+ * @returns {*} Attribute value or undefined
834
+ */
835
+ getAttrValue(t) {
836
+ return this.path.length === 0 ? void 0 : this.path[this.path.length - 1].values?.[t];
837
+ }
838
+ /**
839
+ * Check if current node has an attribute
840
+ * @param {string} attrName - Attribute name
841
+ * @returns {boolean}
842
+ */
843
+ hasAttr(t) {
844
+ if (this.path.length === 0) return !1;
845
+ const e = this.path[this.path.length - 1];
846
+ return e.values !== void 0 && t in e.values;
847
+ }
848
+ /**
849
+ * Get current node's sibling position (child index in parent)
850
+ * @returns {number}
851
+ */
852
+ getPosition() {
853
+ return this.path.length === 0 ? -1 : this.path[this.path.length - 1].position ?? 0;
854
+ }
855
+ /**
856
+ * Get current node's repeat counter (occurrence count of this tag name)
857
+ * @returns {number}
858
+ */
859
+ getCounter() {
860
+ return this.path.length === 0 ? -1 : this.path[this.path.length - 1].counter ?? 0;
861
+ }
862
+ /**
863
+ * Get current node's sibling index (alias for getPosition for backward compatibility)
864
+ * @returns {number}
865
+ * @deprecated Use getPosition() or getCounter() instead
866
+ */
867
+ getIndex() {
868
+ return this.getPosition();
869
+ }
870
+ /**
871
+ * Get current path depth
872
+ * @returns {number}
873
+ */
874
+ getDepth() {
875
+ return this.path.length;
876
+ }
877
+ /**
878
+ * Get path as string
879
+ * @param {string} separator - Optional separator (uses default if not provided)
880
+ * @param {boolean} includeNamespace - Whether to include namespace in output (default: true)
881
+ * @returns {string}
882
+ */
883
+ toString(t, e = !0) {
884
+ const s = t || this.separator;
885
+ return this.path.map((r) => e && r.namespace ? `${r.namespace}:${r.tag}` : r.tag).join(s);
886
+ }
887
+ /**
888
+ * Get path as array of tag names
889
+ * @returns {string[]}
890
+ */
891
+ toArray() {
892
+ return this.path.map((t) => t.tag);
893
+ }
894
+ /**
895
+ * Reset the path to empty
896
+ */
897
+ reset() {
898
+ this.path = [], this.siblingStacks = [];
899
+ }
900
+ /**
901
+ * Match current path against an Expression
902
+ * @param {Expression} expression - The expression to match against
903
+ * @returns {boolean} True if current path matches the expression
904
+ */
905
+ matches(t) {
906
+ const e = t.segments;
907
+ return e.length === 0 ? !1 : t.hasDeepWildcard() ? this._matchWithDeepWildcard(e) : this._matchSimple(e);
908
+ }
909
+ /**
910
+ * Match simple path (no deep wildcards)
911
+ * @private
912
+ */
913
+ _matchSimple(t) {
914
+ if (this.path.length !== t.length)
915
+ return !1;
916
+ for (let e = 0; e < t.length; e++) {
917
+ const s = t[e], r = this.path[e], i = e === this.path.length - 1;
918
+ if (!this._matchSegment(s, r, i))
919
+ return !1;
920
+ }
921
+ return !0;
922
+ }
923
+ /**
924
+ * Match path with deep wildcards
925
+ * @private
926
+ */
927
+ _matchWithDeepWildcard(t) {
928
+ let e = this.path.length - 1, s = t.length - 1;
929
+ for (; s >= 0 && e >= 0; ) {
930
+ const r = t[s];
931
+ if (r.type === "deep-wildcard") {
932
+ if (s--, s < 0)
933
+ return !0;
934
+ const i = t[s];
935
+ let l = !1;
936
+ for (let o = e; o >= 0; o--) {
937
+ const a = o === this.path.length - 1;
938
+ if (this._matchSegment(i, this.path[o], a)) {
939
+ e = o - 1, s--, l = !0;
940
+ break;
941
+ }
942
+ }
943
+ if (!l)
944
+ return !1;
945
+ } else {
946
+ const i = e === this.path.length - 1;
947
+ if (!this._matchSegment(r, this.path[e], i))
948
+ return !1;
949
+ e--, s--;
950
+ }
951
+ }
952
+ return s < 0;
953
+ }
954
+ /**
955
+ * Match a single segment against a node
956
+ * @private
957
+ * @param {Object} segment - Segment from Expression
958
+ * @param {Object} node - Node from path
959
+ * @param {boolean} isCurrentNode - Whether this is the current (last) node
960
+ * @returns {boolean}
961
+ */
962
+ _matchSegment(t, e, s) {
963
+ if (t.tag !== "*" && t.tag !== e.tag || t.namespace !== void 0 && t.namespace !== "*" && t.namespace !== e.namespace)
964
+ return !1;
965
+ if (t.attrName !== void 0) {
966
+ if (!s || !e.values || !(t.attrName in e.values))
967
+ return !1;
968
+ if (t.attrValue !== void 0) {
969
+ const r = e.values[t.attrName];
970
+ if (String(r) !== String(t.attrValue))
971
+ return !1;
972
+ }
973
+ }
974
+ if (t.position !== void 0) {
975
+ if (!s)
976
+ return !1;
977
+ const r = e.counter ?? 0;
978
+ if (t.position === "first" && r !== 0)
979
+ return !1;
980
+ if (t.position === "odd" && r % 2 !== 1)
981
+ return !1;
982
+ if (t.position === "even" && r % 2 !== 0)
983
+ return !1;
984
+ if (t.position === "nth" && r !== t.positionValue)
985
+ return !1;
986
+ }
987
+ return !0;
988
+ }
989
+ /**
990
+ * Create a snapshot of current state
991
+ * @returns {Object} State snapshot
992
+ */
993
+ snapshot() {
994
+ return {
995
+ path: this.path.map((t) => ({ ...t })),
996
+ siblingStacks: this.siblingStacks.map((t) => new Map(t))
997
+ };
998
+ }
999
+ /**
1000
+ * Restore state from snapshot
1001
+ * @param {Object} snapshot - State snapshot
1002
+ */
1003
+ restore(t) {
1004
+ this.path = t.path.map((e) => ({ ...e })), this.siblingStacks = t.siblingStacks.map((e) => new Map(e));
1005
+ }
1006
+ /**
1007
+ * Return a read-only view of this matcher.
1008
+ *
1009
+ * The returned object exposes all query/inspection methods but throws a
1010
+ * TypeError if any state-mutating method is called (`push`, `pop`, `reset`,
1011
+ * `updateCurrent`, `restore`). Property reads (e.g. `.path`, `.separator`)
1012
+ * are allowed but the returned arrays/objects are frozen so callers cannot
1013
+ * mutate internal state through them either.
1014
+ *
1015
+ * @returns {ReadOnlyMatcher} A proxy that forwards read operations and blocks writes.
1016
+ *
1017
+ * @example
1018
+ * const matcher = new Matcher();
1019
+ * matcher.push("root", {});
1020
+ *
1021
+ * const ro = matcher.readOnly();
1022
+ * ro.matches(expr); // ✓ works
1023
+ * ro.getCurrentTag(); // ✓ works
1024
+ * ro.push("child", {}); // ✗ throws TypeError
1025
+ * ro.reset(); // ✗ throws TypeError
1026
+ */
1027
+ readOnly() {
1028
+ const t = this;
1029
+ return new Proxy(t, {
1030
+ get(e, s, r) {
1031
+ if (je.has(s))
1032
+ return () => {
1033
+ throw new TypeError(
1034
+ `Cannot call '${s}' on a read-only Matcher. Obtain a writable instance to mutate state.`
1035
+ );
1036
+ };
1037
+ const i = Reflect.get(e, s, r);
1038
+ return s === "path" || s === "siblingStacks" ? Object.freeze(
1039
+ Array.isArray(i) ? i.map(
1040
+ (l) => l instanceof Map ? Object.freeze(new Map(l)) : Object.freeze({ ...l })
1041
+ // freeze a copy of each node
1042
+ ) : i
1043
+ ) : typeof i == "function" ? i.bind(e) : i;
1044
+ },
1045
+ // Prevent any property assignment on the read-only view
1046
+ set(e, s) {
1047
+ throw new TypeError(
1048
+ `Cannot set property '${String(s)}' on a read-only Matcher.`
1049
+ );
1050
+ },
1051
+ // Prevent property deletion
1052
+ deleteProperty(e, s) {
1053
+ throw new TypeError(
1054
+ `Cannot delete property '${String(s)}' from a read-only Matcher.`
1055
+ );
1056
+ }
1057
+ });
1058
+ }
1059
+ }
1060
+ function Ge(n, t) {
1061
+ if (!n) return {};
1062
+ const e = t.attributesGroupName ? n[t.attributesGroupName] : n;
1063
+ if (!e) return {};
1064
+ const s = {};
1065
+ for (const r in e)
1066
+ if (r.startsWith(t.attributeNamePrefix)) {
1067
+ const i = r.substring(t.attributeNamePrefix.length);
1068
+ s[i] = e[r];
1069
+ } else
1070
+ s[r] = e[r];
1071
+ return s;
1072
+ }
1073
+ function ze(n) {
1074
+ if (!n || typeof n != "string") return;
1075
+ const t = n.indexOf(":");
1076
+ if (t !== -1 && t > 0) {
1077
+ const e = n.substring(0, t);
1078
+ if (e !== "xmlns")
1079
+ return e;
1080
+ }
1081
+ }
1082
+ class He {
1083
+ constructor(t) {
1084
+ if (this.options = t, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = {
561
1085
  apos: { regex: /&(apos|#39|#x27);/g, val: "'" },
562
1086
  gt: { regex: /&(gt|#62|#x3E);/g, val: ">" },
563
1087
  lt: { regex: /&(lt|#60|#x3C);/g, val: "<" },
@@ -576,363 +1100,451 @@ class At {
576
1100
  copyright: { regex: /&(copy|#169);/g, val: "©" },
577
1101
  reg: { regex: /&(reg|#174);/g, val: "®" },
578
1102
  inr: { regex: /&(inr|#8377);/g, val: "₹" },
579
- num_dec: { regex: /&#([0-9]{1,7});/g, val: (s, n) => String.fromCodePoint(Number.parseInt(n, 10)) },
580
- num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (s, n) => String.fromCodePoint(Number.parseInt(n, 16)) }
581
- }, this.addExternalEntities = It, this.parseXml = $t, this.parseTextData = Mt, this.resolveNameSpace = Vt, this.buildAttributesMap = Ot, this.isItStopNode = Ut, this.replaceEntitiesValue = Xt, this.readStopNodeData = Bt, this.saveTextToParentTag = Wt, this.addChild = Ft, this.ignoreAttributesFn = He(this.options.ignoreAttributes), this.options.stopNodes && this.options.stopNodes.length > 0) {
582
- this.stopNodesExact = /* @__PURE__ */ new Set(), this.stopNodesWildcard = /* @__PURE__ */ new Set();
583
- for (let s = 0; s < this.options.stopNodes.length; s++) {
584
- const n = this.options.stopNodes[s];
585
- typeof n == "string" && (n.startsWith("*.") ? this.stopNodesWildcard.add(n.substring(2)) : this.stopNodesExact.add(n));
1103
+ num_dec: { regex: /&#([0-9]{1,7});/g, val: (e, s) => Xt(s, 10, "&#") },
1104
+ num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (e, s) => Xt(s, 16, "&#x") }
1105
+ }, this.addExternalEntities = Ye, this.parseXml = De, this.parseTextData = Ke, this.resolveNameSpace = Ze, this.buildAttributesMap = Qe, this.isItStopNode = sn, this.replaceEntitiesValue = en, this.readStopNodeData = on, this.saveTextToParentTag = nn, this.addChild = tn, this.ignoreAttributesFn = qe(this.options.ignoreAttributes), this.entityExpansionCount = 0, this.currentExpandedLength = 0, this.matcher = new Tt(), this.readonlyMatcher = this.matcher.readOnly(), this.isCurrentNodeStopNode = !1, this.options.stopNodes && this.options.stopNodes.length > 0) {
1106
+ this.stopNodeExpressions = [];
1107
+ for (let e = 0; e < this.options.stopNodes.length; e++) {
1108
+ const s = this.options.stopNodes[e];
1109
+ typeof s == "string" ? this.stopNodeExpressions.push(new ut(s)) : s instanceof ut && this.stopNodeExpressions.push(s);
586
1110
  }
587
1111
  }
588
1112
  }
589
1113
  }
590
- function It(t) {
591
- const e = Object.keys(t);
592
- for (let s = 0; s < e.length; s++) {
593
- const n = e[s];
594
- this.lastEntities[n] = {
595
- regex: new RegExp("&" + n + ";", "g"),
596
- val: t[n]
1114
+ function Ye(n) {
1115
+ const t = Object.keys(n);
1116
+ for (let e = 0; e < t.length; e++) {
1117
+ const s = t[e], r = s.replace(/[.\-+*:]/g, "\\.");
1118
+ this.lastEntities[s] = {
1119
+ regex: new RegExp("&" + r + ";", "g"),
1120
+ val: n[s]
597
1121
  };
598
1122
  }
599
1123
  }
600
- function Mt(t, e, s, n, i, r, o) {
601
- if (t !== void 0 && (this.options.trimValues && !n && (t = t.trim()), t.length > 0)) {
602
- o || (t = this.replaceEntitiesValue(t));
603
- const c = this.options.tagValueProcessor(e, t, s, i, r);
604
- return c == null ? t : typeof c != typeof t || c !== t ? c : this.options.trimValues ? ke(t, this.options.parseTagValue, this.options.numberParseOptions) : t.trim() === t ? ke(t, this.options.parseTagValue, this.options.numberParseOptions) : t;
1124
+ function Ke(n, t, e, s, r, i, l) {
1125
+ if (n !== void 0 && (this.options.trimValues && !s && (n = n.trim()), n.length > 0)) {
1126
+ l || (n = this.replaceEntitiesValue(n, t, e));
1127
+ const o = this.options.jPath ? e.toString() : e, a = this.options.tagValueProcessor(t, n, o, r, i);
1128
+ return a == null ? n : typeof a != typeof n || a !== n ? a : this.options.trimValues ? Ct(n, this.options.parseTagValue, this.options.numberParseOptions) : n.trim() === n ? Ct(n, this.options.parseTagValue, this.options.numberParseOptions) : n;
605
1129
  }
606
1130
  }
607
- function Vt(t) {
1131
+ function Ze(n) {
608
1132
  if (this.options.removeNSPrefix) {
609
- const e = t.split(":"), s = t.charAt(0) === "/" ? "/" : "";
610
- if (e[0] === "xmlns")
1133
+ const t = n.split(":"), e = n.charAt(0) === "/" ? "/" : "";
1134
+ if (t[0] === "xmlns")
611
1135
  return "";
612
- e.length === 2 && (t = s + e[1]);
1136
+ t.length === 2 && (n = e + t[1]);
613
1137
  }
614
- return t;
1138
+ return n;
615
1139
  }
616
- const Rt = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm");
617
- function Ot(t, e) {
618
- if (this.options.ignoreAttributes !== !0 && typeof t == "string") {
619
- const s = Be(t, Rt), n = s.length, i = {};
620
- for (let r = 0; r < n; r++) {
621
- const o = this.resolveNameSpace(s[r][1]);
622
- if (this.ignoreAttributesFn(o, e))
1140
+ const Je = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm");
1141
+ function Qe(n, t, e) {
1142
+ if (this.options.ignoreAttributes !== !0 && typeof n == "string") {
1143
+ const s = Yt(n, Je), r = s.length, i = {}, l = {};
1144
+ for (let o = 0; o < r; o++) {
1145
+ const a = this.resolveNameSpace(s[o][1]), c = s[o][4];
1146
+ if (a.length && c !== void 0) {
1147
+ let h = c;
1148
+ this.options.trimValues && (h = h.trim()), h = this.replaceEntitiesValue(h, e, this.readonlyMatcher), l[a] = h;
1149
+ }
1150
+ }
1151
+ Object.keys(l).length > 0 && typeof t == "object" && t.updateCurrent && t.updateCurrent(l);
1152
+ for (let o = 0; o < r; o++) {
1153
+ const a = this.resolveNameSpace(s[o][1]), c = this.options.jPath ? t.toString() : this.readonlyMatcher;
1154
+ if (this.ignoreAttributesFn(a, c))
623
1155
  continue;
624
- let c = s[r][4], a = this.options.attributeNamePrefix + o;
625
- if (o.length)
626
- if (this.options.transformAttributeName && (a = this.options.transformAttributeName(a)), a === "__proto__" && (a = "#__proto__"), c !== void 0) {
627
- this.options.trimValues && (c = c.trim()), c = this.replaceEntitiesValue(c);
628
- const l = this.options.attributeValueProcessor(o, c, e);
629
- l == null ? i[a] = c : typeof l != typeof c || l !== c ? i[a] = l : i[a] = ke(
630
- c,
1156
+ let h = s[o][4], d = this.options.attributeNamePrefix + a;
1157
+ if (a.length)
1158
+ if (this.options.transformAttributeName && (d = this.options.transformAttributeName(d)), d = Qt(d, this.options), h !== void 0) {
1159
+ this.options.trimValues && (h = h.trim()), h = this.replaceEntitiesValue(h, e, this.readonlyMatcher);
1160
+ const f = this.options.jPath ? t.toString() : this.readonlyMatcher, y = this.options.attributeValueProcessor(a, h, f);
1161
+ y == null ? i[d] = h : typeof y != typeof h || y !== h ? i[d] = y : i[d] = Ct(
1162
+ h,
631
1163
  this.options.parseAttributeValue,
632
1164
  this.options.numberParseOptions
633
1165
  );
634
- } else this.options.allowBooleanAttributes && (i[a] = !0);
1166
+ } else this.options.allowBooleanAttributes && (i[d] = !0);
635
1167
  }
636
1168
  if (!Object.keys(i).length)
637
1169
  return;
638
1170
  if (this.options.attributesGroupName) {
639
- const r = {};
640
- return r[this.options.attributesGroupName] = i, r;
1171
+ const o = {};
1172
+ return o[this.options.attributesGroupName] = i, o;
641
1173
  }
642
1174
  return i;
643
1175
  }
644
1176
  }
645
- const $t = function(t) {
646
- t = t.replace(/\r\n?/g, `
1177
+ const De = function(n) {
1178
+ n = n.replace(/\r\n?/g, `
647
1179
  `);
648
- const e = new ee("!xml");
649
- let s = e, n = "", i = "";
650
- const r = new St(this.options.processEntities);
651
- for (let o = 0; o < t.length; o++)
652
- if (t[o] === "<")
653
- if (t[o + 1] === "/") {
654
- const a = se(t, ">", o, "Closing Tag is not closed.");
655
- let l = t.substring(o + 2, a).trim();
1180
+ const t = new Q("!xml");
1181
+ let e = t, s = "";
1182
+ this.matcher.reset(), this.entityExpansionCount = 0, this.currentExpandedLength = 0;
1183
+ const r = new Me(this.options.processEntities);
1184
+ for (let i = 0; i < n.length; i++)
1185
+ if (n[i] === "<")
1186
+ if (n[i + 1] === "/") {
1187
+ const o = it(n, ">", i, "Closing Tag is not closed.");
1188
+ let a = n.substring(i + 2, o).trim();
656
1189
  if (this.options.removeNSPrefix) {
657
- const f = l.indexOf(":");
658
- f !== -1 && (l = l.substr(f + 1));
1190
+ const h = a.indexOf(":");
1191
+ h !== -1 && (a = a.substr(h + 1));
659
1192
  }
660
- this.options.transformTagName && (l = this.options.transformTagName(l)), s && (n = this.saveTextToParentTag(n, s, i));
661
- const h = i.substring(i.lastIndexOf(".") + 1);
662
- if (l && this.options.unpairedTags.indexOf(l) !== -1)
663
- throw new Error(`Unpaired tag can not be used as closing tag: </${l}>`);
664
- let d = 0;
665
- h && this.options.unpairedTags.indexOf(h) !== -1 ? (d = i.lastIndexOf(".", i.lastIndexOf(".") - 1), this.tagsNodeStack.pop()) : d = i.lastIndexOf("."), i = i.substring(0, d), s = this.tagsNodeStack.pop(), n = "", o = a;
666
- } else if (t[o + 1] === "?") {
667
- let a = Ne(t, o, !1, "?>");
668
- if (!a) throw new Error("Pi Tag is not closed.");
669
- if (n = this.saveTextToParentTag(n, s, i), !(this.options.ignoreDeclaration && a.tagName === "?xml" || this.options.ignorePiTags)) {
670
- const l = new ee(a.tagName);
671
- l.add(this.options.textNodeName, ""), a.tagName !== a.tagExp && a.attrExpPresent && (l[":@"] = this.buildAttributesMap(a.tagExp, i)), this.addChild(s, l, i, o);
1193
+ a = St(this.options.transformTagName, a, "", this.options).tagName, e && (s = this.saveTextToParentTag(s, e, this.readonlyMatcher));
1194
+ const c = this.matcher.getCurrentTag();
1195
+ if (a && this.options.unpairedTags.indexOf(a) !== -1)
1196
+ throw new Error(`Unpaired tag can not be used as closing tag: </${a}>`);
1197
+ c && this.options.unpairedTags.indexOf(c) !== -1 && (this.matcher.pop(), this.tagsNodeStack.pop()), this.matcher.pop(), this.isCurrentNodeStopNode = !1, e = this.tagsNodeStack.pop(), s = "", i = o;
1198
+ } else if (n[i + 1] === "?") {
1199
+ let o = kt(n, i, !1, "?>");
1200
+ if (!o) throw new Error("Pi Tag is not closed.");
1201
+ if (s = this.saveTextToParentTag(s, e, this.readonlyMatcher), !(this.options.ignoreDeclaration && o.tagName === "?xml" || this.options.ignorePiTags)) {
1202
+ const a = new Q(o.tagName);
1203
+ a.add(this.options.textNodeName, ""), o.tagName !== o.tagExp && o.attrExpPresent && (a[":@"] = this.buildAttributesMap(o.tagExp, this.matcher, o.tagName)), this.addChild(e, a, this.readonlyMatcher, i);
672
1204
  }
673
- o = a.closeIndex + 1;
674
- } else if (t.substr(o + 1, 3) === "!--") {
675
- const a = se(t, "-->", o + 4, "Comment is not closed.");
1205
+ i = o.closeIndex + 1;
1206
+ } else if (n.substr(i + 1, 3) === "!--") {
1207
+ const o = it(n, "-->", i + 4, "Comment is not closed.");
676
1208
  if (this.options.commentPropName) {
677
- const l = t.substring(o + 4, a - 2);
678
- n = this.saveTextToParentTag(n, s, i), s.add(this.options.commentPropName, [{ [this.options.textNodeName]: l }]);
1209
+ const a = n.substring(i + 4, o - 2);
1210
+ s = this.saveTextToParentTag(s, e, this.readonlyMatcher), e.add(this.options.commentPropName, [{ [this.options.textNodeName]: a }]);
679
1211
  }
680
- o = a;
681
- } else if (t.substr(o + 1, 2) === "!D") {
682
- const a = r.readDocType(t, o);
683
- this.docTypeEntities = a.entities, o = a.i;
684
- } else if (t.substr(o + 1, 2) === "![") {
685
- const a = se(t, "]]>", o, "CDATA is not closed.") - 2, l = t.substring(o + 9, a);
686
- n = this.saveTextToParentTag(n, s, i);
687
- let h = this.parseTextData(l, s.tagname, i, !0, !1, !0, !0);
688
- h == null && (h = ""), this.options.cdataPropName ? s.add(this.options.cdataPropName, [{ [this.options.textNodeName]: l }]) : s.add(this.options.textNodeName, h), o = a + 2;
1212
+ i = o;
1213
+ } else if (n.substr(i + 1, 2) === "!D") {
1214
+ const o = r.readDocType(n, i);
1215
+ this.docTypeEntities = o.entities, i = o.i;
1216
+ } else if (n.substr(i + 1, 2) === "![") {
1217
+ const o = it(n, "]]>", i, "CDATA is not closed.") - 2, a = n.substring(i + 9, o);
1218
+ s = this.saveTextToParentTag(s, e, this.readonlyMatcher);
1219
+ let c = this.parseTextData(a, e.tagname, this.readonlyMatcher, !0, !1, !0, !0);
1220
+ c == null && (c = ""), this.options.cdataPropName ? e.add(this.options.cdataPropName, [{ [this.options.textNodeName]: a }]) : e.add(this.options.textNodeName, c), i = o + 2;
689
1221
  } else {
690
- let a = Ne(t, o, this.options.removeNSPrefix), l = a.tagName;
691
- const h = a.rawTagName;
692
- let d = a.tagExp, f = a.attrExpPresent, y = a.closeIndex;
693
- if (this.options.transformTagName) {
694
- const S = this.options.transformTagName(l);
695
- d === l && (d = S), l = S;
1222
+ let o = kt(n, i, this.options.removeNSPrefix);
1223
+ if (!o) {
1224
+ const _ = n.substring(Math.max(0, i - 50), Math.min(n.length, i + 50));
1225
+ throw new Error(`readTagExp returned undefined at position ${i}. Context: "${_}"`);
696
1226
  }
697
- s && n && s.tagname !== "!xml" && (n = this.saveTextToParentTag(n, s, i, !1));
698
- const x = s;
699
- x && this.options.unpairedTags.indexOf(x.tagname) !== -1 && (s = this.tagsNodeStack.pop(), i = i.substring(0, i.lastIndexOf("."))), l !== e.tagname && (i += i ? "." + l : l);
700
- const V = o;
701
- if (this.isItStopNode(this.stopNodesExact, this.stopNodesWildcard, i, l)) {
702
- let S = "";
703
- if (d.length > 0 && d.lastIndexOf("/") === d.length - 1)
704
- l[l.length - 1] === "/" ? (l = l.substr(0, l.length - 1), i = i.substr(0, i.length - 1), d = l) : d = d.substr(0, d.length - 1), o = a.closeIndex;
705
- else if (this.options.unpairedTags.indexOf(l) !== -1)
706
- o = a.closeIndex;
1227
+ let a = o.tagName;
1228
+ const c = o.rawTagName;
1229
+ let h = o.tagExp, d = o.attrExpPresent, f = o.closeIndex;
1230
+ if ({ tagName: a, tagExp: h } = St(this.options.transformTagName, a, h, this.options), this.options.strictReservedNames && (a === this.options.commentPropName || a === this.options.cdataPropName || a === this.options.textNodeName || a === this.options.attributesGroupName))
1231
+ throw new Error(`Invalid tag name: ${a}`);
1232
+ e && s && e.tagname !== "!xml" && (s = this.saveTextToParentTag(s, e, this.readonlyMatcher, !1));
1233
+ const y = e;
1234
+ y && this.options.unpairedTags.indexOf(y.tagname) !== -1 && (e = this.tagsNodeStack.pop(), this.matcher.pop());
1235
+ let C = !1;
1236
+ h.length > 0 && h.lastIndexOf("/") === h.length - 1 && (C = !0, a[a.length - 1] === "/" ? (a = a.substr(0, a.length - 1), h = a) : h = h.substr(0, h.length - 1), d = a !== h);
1237
+ let E = null, L;
1238
+ L = ze(c), a !== t.tagname && this.matcher.push(a, {}, L), a !== h && d && (E = this.buildAttributesMap(h, this.matcher, a), E && Ge(E, this.options)), a !== t.tagname && (this.isCurrentNodeStopNode = this.isItStopNode(this.stopNodeExpressions, this.matcher));
1239
+ const X = i;
1240
+ if (this.isCurrentNodeStopNode) {
1241
+ let _ = "";
1242
+ if (C)
1243
+ i = o.closeIndex;
1244
+ else if (this.options.unpairedTags.indexOf(a) !== -1)
1245
+ i = o.closeIndex;
707
1246
  else {
708
- const B = this.readStopNodeData(t, h, y + 1);
709
- if (!B) throw new Error(`Unexpected end of ${h}`);
710
- o = B.i, S = B.tagContent;
1247
+ const q = this.readStopNodeData(n, c, f + 1);
1248
+ if (!q) throw new Error(`Unexpected end of ${c}`);
1249
+ i = q.i, _ = q.tagContent;
711
1250
  }
712
- const F = new ee(l);
713
- l !== d && f && (F[":@"] = this.buildAttributesMap(
714
- d,
715
- i
716
- )), S && (S = this.parseTextData(S, l, i, !0, f, !0, !0)), i = i.substr(0, i.lastIndexOf(".")), F.add(this.options.textNodeName, S), this.addChild(s, F, i, V);
1251
+ const G = new Q(a);
1252
+ E && (G[":@"] = E), G.add(this.options.textNodeName, _), this.matcher.pop(), this.isCurrentNodeStopNode = !1, this.addChild(e, G, this.readonlyMatcher, X);
717
1253
  } else {
718
- if (d.length > 0 && d.lastIndexOf("/") === d.length - 1) {
719
- if (l[l.length - 1] === "/" ? (l = l.substr(0, l.length - 1), i = i.substr(0, i.length - 1), d = l) : d = d.substr(0, d.length - 1), this.options.transformTagName) {
720
- const F = this.options.transformTagName(l);
721
- d === l && (d = F), l = F;
722
- }
723
- const S = new ee(l);
724
- l !== d && f && (S[":@"] = this.buildAttributesMap(d, i)), this.addChild(s, S, i, V), i = i.substr(0, i.lastIndexOf("."));
1254
+ if (C) {
1255
+ ({ tagName: a, tagExp: h } = St(this.options.transformTagName, a, h, this.options));
1256
+ const _ = new Q(a);
1257
+ E && (_[":@"] = E), this.addChild(e, _, this.readonlyMatcher, X), this.matcher.pop(), this.isCurrentNodeStopNode = !1;
1258
+ } else if (this.options.unpairedTags.indexOf(a) !== -1) {
1259
+ const _ = new Q(a);
1260
+ E && (_[":@"] = E), this.addChild(e, _, this.readonlyMatcher, X), this.matcher.pop(), this.isCurrentNodeStopNode = !1, i = o.closeIndex;
1261
+ continue;
725
1262
  } else {
726
- const S = new ee(l);
727
- this.tagsNodeStack.push(s), l !== d && f && (S[":@"] = this.buildAttributesMap(d, i)), this.addChild(s, S, i, V), s = S;
1263
+ const _ = new Q(a);
1264
+ if (this.tagsNodeStack.length > this.options.maxNestedTags)
1265
+ throw new Error("Maximum nested tags exceeded");
1266
+ this.tagsNodeStack.push(e), E && (_[":@"] = E), this.addChild(e, _, this.readonlyMatcher, X), e = _;
728
1267
  }
729
- n = "", o = y;
1268
+ s = "", i = f;
730
1269
  }
731
1270
  }
732
1271
  else
733
- n += t[o];
734
- return e.child;
1272
+ s += n[i];
1273
+ return t.child;
735
1274
  };
736
- function Ft(t, e, s, n) {
737
- this.options.captureMetaData || (n = void 0);
738
- const i = this.options.updateTag(e.tagname, s, e[":@"]);
739
- i === !1 || (typeof i == "string" && (e.tagname = i), t.addChild(e, n));
740
- }
741
- const Xt = function(t) {
742
- if (this.options.processEntities) {
743
- for (let e in this.docTypeEntities) {
744
- const s = this.docTypeEntities[e];
745
- t = t.replace(s.regx, s.val);
746
- }
747
- for (let e in this.lastEntities) {
748
- const s = this.lastEntities[e];
749
- t = t.replace(s.regex, s.val);
1275
+ function tn(n, t, e, s) {
1276
+ this.options.captureMetaData || (s = void 0);
1277
+ const r = this.options.jPath ? e.toString() : e, i = this.options.updateTag(t.tagname, r, t[":@"]);
1278
+ i === !1 || (typeof i == "string" && (t.tagname = i), n.addChild(t, s));
1279
+ }
1280
+ function en(n, t, e) {
1281
+ const s = this.options.processEntities;
1282
+ if (!s || !s.enabled)
1283
+ return n;
1284
+ if (s.allowedTags) {
1285
+ const r = this.options.jPath ? e.toString() : e;
1286
+ if (!(Array.isArray(s.allowedTags) ? s.allowedTags.includes(t) : s.allowedTags(t, r)))
1287
+ return n;
1288
+ }
1289
+ if (s.tagFilter) {
1290
+ const r = this.options.jPath ? e.toString() : e;
1291
+ if (!s.tagFilter(t, r))
1292
+ return n;
1293
+ }
1294
+ for (const r of Object.keys(this.docTypeEntities)) {
1295
+ const i = this.docTypeEntities[r], l = n.match(i.regx);
1296
+ if (l) {
1297
+ if (this.entityExpansionCount += l.length, s.maxTotalExpansions && this.entityExpansionCount > s.maxTotalExpansions)
1298
+ throw new Error(
1299
+ `Entity expansion limit exceeded: ${this.entityExpansionCount} > ${s.maxTotalExpansions}`
1300
+ );
1301
+ const o = n.length;
1302
+ if (n = n.replace(i.regx, i.val), s.maxExpandedLength && (this.currentExpandedLength += n.length - o, this.currentExpandedLength > s.maxExpandedLength))
1303
+ throw new Error(
1304
+ `Total expanded content size exceeded: ${this.currentExpandedLength} > ${s.maxExpandedLength}`
1305
+ );
750
1306
  }
751
- if (this.options.htmlEntities)
752
- for (let e in this.htmlEntities) {
753
- const s = this.htmlEntities[e];
754
- t = t.replace(s.regex, s.val);
755
- }
756
- t = t.replace(this.ampEntity.regex, this.ampEntity.val);
757
1307
  }
758
- return t;
759
- };
760
- function Wt(t, e, s, n) {
761
- return t && (n === void 0 && (n = e.child.length === 0), t = this.parseTextData(
762
- t,
763
- e.tagname,
764
- s,
1308
+ for (const r of Object.keys(this.lastEntities)) {
1309
+ const i = this.lastEntities[r], l = n.match(i.regex);
1310
+ if (l && (this.entityExpansionCount += l.length, s.maxTotalExpansions && this.entityExpansionCount > s.maxTotalExpansions))
1311
+ throw new Error(
1312
+ `Entity expansion limit exceeded: ${this.entityExpansionCount} > ${s.maxTotalExpansions}`
1313
+ );
1314
+ n = n.replace(i.regex, i.val);
1315
+ }
1316
+ if (n.indexOf("&") === -1) return n;
1317
+ if (this.options.htmlEntities)
1318
+ for (const r of Object.keys(this.htmlEntities)) {
1319
+ const i = this.htmlEntities[r], l = n.match(i.regex);
1320
+ if (l && (this.entityExpansionCount += l.length, s.maxTotalExpansions && this.entityExpansionCount > s.maxTotalExpansions))
1321
+ throw new Error(
1322
+ `Entity expansion limit exceeded: ${this.entityExpansionCount} > ${s.maxTotalExpansions}`
1323
+ );
1324
+ n = n.replace(i.regex, i.val);
1325
+ }
1326
+ return n = n.replace(this.ampEntity.regex, this.ampEntity.val), n;
1327
+ }
1328
+ function nn(n, t, e, s) {
1329
+ return n && (s === void 0 && (s = t.child.length === 0), n = this.parseTextData(
1330
+ n,
1331
+ t.tagname,
1332
+ e,
765
1333
  !1,
766
- e[":@"] ? Object.keys(e[":@"]).length !== 0 : !1,
767
- n
768
- ), t !== void 0 && t !== "" && e.add(this.options.textNodeName, t), t = ""), t;
769
- }
770
- function Ut(t, e, s, n) {
771
- return !!(e && e.has(n) || t && t.has(s));
772
- }
773
- function qt(t, e, s = ">") {
774
- let n, i = "";
775
- for (let r = e; r < t.length; r++) {
776
- let o = t[r];
777
- if (n)
778
- o === n && (n = "");
779
- else if (o === '"' || o === "'")
780
- n = o;
781
- else if (o === s[0])
782
- if (s[1]) {
783
- if (t[r + 1] === s[1])
1334
+ t[":@"] ? Object.keys(t[":@"]).length !== 0 : !1,
1335
+ s
1336
+ ), n !== void 0 && n !== "" && t.add(this.options.textNodeName, n), n = ""), n;
1337
+ }
1338
+ function sn(n, t) {
1339
+ if (!n || n.length === 0) return !1;
1340
+ for (let e = 0; e < n.length; e++)
1341
+ if (t.matches(n[e]))
1342
+ return !0;
1343
+ return !1;
1344
+ }
1345
+ function rn(n, t, e = ">") {
1346
+ let s, r = "";
1347
+ for (let i = t; i < n.length; i++) {
1348
+ let l = n[i];
1349
+ if (s)
1350
+ l === s && (s = "");
1351
+ else if (l === '"' || l === "'")
1352
+ s = l;
1353
+ else if (l === e[0])
1354
+ if (e[1]) {
1355
+ if (n[i + 1] === e[1])
784
1356
  return {
785
- data: i,
786
- index: r
1357
+ data: r,
1358
+ index: i
787
1359
  };
788
1360
  } else
789
1361
  return {
790
- data: i,
791
- index: r
1362
+ data: r,
1363
+ index: i
792
1364
  };
793
- else o === " " && (o = " ");
794
- i += o;
795
- }
796
- }
797
- function se(t, e, s, n) {
798
- const i = t.indexOf(e, s);
799
- if (i === -1)
800
- throw new Error(n);
801
- return i + e.length - 1;
802
- }
803
- function Ne(t, e, s, n = ">") {
804
- const i = qt(t, e + 1, n);
805
- if (!i) return;
806
- let r = i.data;
807
- const o = i.index, c = r.search(/\s/);
808
- let a = r, l = !0;
809
- c !== -1 && (a = r.substring(0, c), r = r.substring(c + 1).trimStart());
1365
+ else l === " " && (l = " ");
1366
+ r += l;
1367
+ }
1368
+ }
1369
+ function it(n, t, e, s) {
1370
+ const r = n.indexOf(t, e);
1371
+ if (r === -1)
1372
+ throw new Error(s);
1373
+ return r + t.length - 1;
1374
+ }
1375
+ function kt(n, t, e, s = ">") {
1376
+ const r = rn(n, t + 1, s);
1377
+ if (!r) return;
1378
+ let i = r.data;
1379
+ const l = r.index, o = i.search(/\s/);
1380
+ let a = i, c = !0;
1381
+ o !== -1 && (a = i.substring(0, o), i = i.substring(o + 1).trimStart());
810
1382
  const h = a;
811
- if (s) {
1383
+ if (e) {
812
1384
  const d = a.indexOf(":");
813
- d !== -1 && (a = a.substr(d + 1), l = a !== i.data.substr(d + 1));
1385
+ d !== -1 && (a = a.substr(d + 1), c = a !== r.data.substr(d + 1));
814
1386
  }
815
1387
  return {
816
1388
  tagName: a,
817
- tagExp: r,
818
- closeIndex: o,
819
- attrExpPresent: l,
1389
+ tagExp: i,
1390
+ closeIndex: l,
1391
+ attrExpPresent: c,
820
1392
  rawTagName: h
821
1393
  };
822
1394
  }
823
- function Bt(t, e, s) {
824
- const n = s;
825
- let i = 1;
826
- for (; s < t.length; s++)
827
- if (t[s] === "<")
828
- if (t[s + 1] === "/") {
829
- const r = se(t, ">", s, `${e} is not closed`);
830
- if (t.substring(s + 2, r).trim() === e && (i--, i === 0))
1395
+ function on(n, t, e) {
1396
+ const s = e;
1397
+ let r = 1;
1398
+ for (; e < n.length; e++)
1399
+ if (n[e] === "<")
1400
+ if (n[e + 1] === "/") {
1401
+ const i = it(n, ">", e, `${t} is not closed`);
1402
+ if (n.substring(e + 2, i).trim() === t && (r--, r === 0))
831
1403
  return {
832
- tagContent: t.substring(n, s),
833
- i: r
1404
+ tagContent: n.substring(s, e),
1405
+ i
834
1406
  };
835
- s = r;
836
- } else if (t[s + 1] === "?")
837
- s = se(t, "?>", s + 1, "StopNode is not closed.");
838
- else if (t.substr(s + 1, 3) === "!--")
839
- s = se(t, "-->", s + 3, "StopNode is not closed.");
840
- else if (t.substr(s + 1, 2) === "![")
841
- s = se(t, "]]>", s, "StopNode is not closed.") - 2;
1407
+ e = i;
1408
+ } else if (n[e + 1] === "?")
1409
+ e = it(n, "?>", e + 1, "StopNode is not closed.");
1410
+ else if (n.substr(e + 1, 3) === "!--")
1411
+ e = it(n, "-->", e + 3, "StopNode is not closed.");
1412
+ else if (n.substr(e + 1, 2) === "![")
1413
+ e = it(n, "]]>", e, "StopNode is not closed.") - 2;
842
1414
  else {
843
- const r = Ne(t, s, ">");
844
- r && ((r && r.tagName) === e && r.tagExp[r.tagExp.length - 1] !== "/" && i++, s = r.closeIndex);
1415
+ const i = kt(n, e, ">");
1416
+ i && ((i && i.tagName) === t && i.tagExp[i.tagExp.length - 1] !== "/" && r++, e = i.closeIndex);
845
1417
  }
846
1418
  }
847
- function ke(t, e, s) {
848
- if (e && typeof t == "string") {
849
- const n = t.trim();
850
- return n === "true" ? !0 : n === "false" ? !1 : xt(t, s);
1419
+ function Ct(n, t, e) {
1420
+ if (t && typeof n == "string") {
1421
+ const s = n.trim();
1422
+ return s === "true" ? !0 : s === "false" ? !1 : Re(n, e);
851
1423
  } else
852
- return ct(t) ? t : "";
1424
+ return ve(n) ? n : "";
1425
+ }
1426
+ function Xt(n, t, e) {
1427
+ const s = Number.parseInt(n, t);
1428
+ return s >= 0 && s <= 1114111 ? String.fromCodePoint(s) : e + n + ";";
1429
+ }
1430
+ function St(n, t, e, s) {
1431
+ if (n) {
1432
+ const r = n(t);
1433
+ e === t && (e = r), t = r;
1434
+ }
1435
+ return t = Qt(t, s), { tagName: t, tagExp: e };
1436
+ }
1437
+ function Qt(n, t) {
1438
+ if (Kt.includes(n))
1439
+ throw new Error(`[SECURITY] Invalid name: "${n}" is a reserved JavaScript keyword that could cause prototype pollution`);
1440
+ return Pt.includes(n) ? t.onDangerousProperty(n) : n;
1441
+ }
1442
+ const xt = Q.getMetaDataSymbol();
1443
+ function an(n, t) {
1444
+ if (!n || typeof n != "object") return {};
1445
+ if (!t) return n;
1446
+ const e = {};
1447
+ for (const s in n)
1448
+ if (s.startsWith(t)) {
1449
+ const r = s.substring(t.length);
1450
+ e[r] = n[s];
1451
+ } else
1452
+ e[s] = n[s];
1453
+ return e;
853
1454
  }
854
- const Se = ee.getMetaDataSymbol();
855
- function Ht(t, e) {
856
- return Ye(t, e);
1455
+ function ln(n, t, e, s) {
1456
+ return Dt(n, t, e, s);
857
1457
  }
858
- function Ye(t, e, s) {
859
- let n;
1458
+ function Dt(n, t, e, s) {
1459
+ let r;
860
1460
  const i = {};
861
- for (let r = 0; r < t.length; r++) {
862
- const o = t[r], c = Yt(o);
863
- let a = "";
864
- if (s === void 0 ? a = c : a = s + "." + c, c === e.textNodeName)
865
- n === void 0 ? n = o[c] : n += "" + o[c];
1461
+ for (let l = 0; l < n.length; l++) {
1462
+ const o = n[l], a = cn(o);
1463
+ if (a !== void 0 && a !== t.textNodeName) {
1464
+ const c = an(
1465
+ o[":@"] || {},
1466
+ t.attributeNamePrefix
1467
+ );
1468
+ e.push(a, c);
1469
+ }
1470
+ if (a === t.textNodeName)
1471
+ r === void 0 ? r = o[a] : r += "" + o[a];
866
1472
  else {
867
- if (c === void 0)
1473
+ if (a === void 0)
868
1474
  continue;
869
- if (o[c]) {
870
- let l = Ye(o[c], e, a);
871
- const h = zt(l, e);
872
- o[Se] !== void 0 && (l[Se] = o[Se]), o[":@"] ? Gt(l, o[":@"], a, e) : Object.keys(l).length === 1 && l[e.textNodeName] !== void 0 && !e.alwaysCreateTextNode ? l = l[e.textNodeName] : Object.keys(l).length === 0 && (e.alwaysCreateTextNode ? l[e.textNodeName] = "" : l = ""), i[c] !== void 0 && i.hasOwnProperty(c) ? (Array.isArray(i[c]) || (i[c] = [i[c]]), i[c].push(l)) : e.isArray(c, a, h) ? i[c] = [l] : i[c] = l;
1475
+ if (o[a]) {
1476
+ let c = Dt(o[a], t, e, s);
1477
+ const h = un(c, t);
1478
+ if (o[":@"] ? hn(c, o[":@"], s, t) : Object.keys(c).length === 1 && c[t.textNodeName] !== void 0 && !t.alwaysCreateTextNode ? c = c[t.textNodeName] : Object.keys(c).length === 0 && (t.alwaysCreateTextNode ? c[t.textNodeName] = "" : c = ""), o[xt] !== void 0 && typeof c == "object" && c !== null && (c[xt] = o[xt]), i[a] !== void 0 && Object.prototype.hasOwnProperty.call(i, a))
1479
+ Array.isArray(i[a]) || (i[a] = [i[a]]), i[a].push(c);
1480
+ else {
1481
+ const d = t.jPath ? s.toString() : s;
1482
+ t.isArray(a, d, h) ? i[a] = [c] : i[a] = c;
1483
+ }
1484
+ a !== void 0 && a !== t.textNodeName && e.pop();
873
1485
  }
874
1486
  }
875
1487
  }
876
- return typeof n == "string" ? n.length > 0 && (i[e.textNodeName] = n) : n !== void 0 && (i[e.textNodeName] = n), i;
1488
+ return typeof r == "string" ? r.length > 0 && (i[t.textNodeName] = r) : r !== void 0 && (i[t.textNodeName] = r), i;
877
1489
  }
878
- function Yt(t) {
879
- const e = Object.keys(t);
880
- for (let s = 0; s < e.length; s++) {
881
- const n = e[s];
882
- if (n !== ":@") return n;
1490
+ function cn(n) {
1491
+ const t = Object.keys(n);
1492
+ for (let e = 0; e < t.length; e++) {
1493
+ const s = t[e];
1494
+ if (s !== ":@") return s;
883
1495
  }
884
1496
  }
885
- function Gt(t, e, s, n) {
886
- if (e) {
887
- const i = Object.keys(e), r = i.length;
888
- for (let o = 0; o < r; o++) {
889
- const c = i[o];
890
- n.isArray(c, s + "." + c, !0, !0) ? t[c] = [e[c]] : t[c] = e[c];
1497
+ function hn(n, t, e, s) {
1498
+ if (t) {
1499
+ const r = Object.keys(t), i = r.length;
1500
+ for (let l = 0; l < i; l++) {
1501
+ const o = r[l], a = o.startsWith(s.attributeNamePrefix) ? o.substring(s.attributeNamePrefix.length) : o, c = s.jPath ? e.toString() + "." + a : e;
1502
+ s.isArray(o, c, !0, !0) ? n[o] = [t[o]] : n[o] = t[o];
891
1503
  }
892
1504
  }
893
1505
  }
894
- function zt(t, e) {
895
- const { textNodeName: s } = e, n = Object.keys(t).length;
896
- return !!(n === 0 || n === 1 && (t[s] || typeof t[s] == "boolean" || t[s] === 0));
1506
+ function un(n, t) {
1507
+ const { textNodeName: e } = t, s = Object.keys(n).length;
1508
+ return !!(s === 0 || s === 1 && (n[e] || typeof n[e] == "boolean" || n[e] === 0));
897
1509
  }
898
- class _e {
899
- constructor(e) {
900
- this.externalEntities = {}, this.options = wt(e);
1510
+ class te {
1511
+ constructor(t) {
1512
+ this.externalEntities = {}, this.options = $e(t);
901
1513
  }
902
1514
  /**
903
1515
  * Parse XML dats to JS object
904
1516
  * @param {string|Uint8Array} xmlData
905
1517
  * @param {boolean|Object} validationOption
906
1518
  */
907
- parse(e, s) {
908
- if (typeof e != "string" && e.toString)
909
- e = e.toString();
910
- else if (typeof e != "string")
1519
+ parse(t, e) {
1520
+ if (typeof t != "string" && t.toString)
1521
+ t = t.toString();
1522
+ else if (typeof t != "string")
911
1523
  throw new Error("XML data is accepted in String or Bytes[] form.");
912
- if (s) {
913
- s === !0 && (s = {});
914
- const r = ut(e, s);
915
- if (r !== !0)
916
- throw Error(`${r.err.msg}:${r.err.line}:${r.err.col}`);
1524
+ if (e) {
1525
+ e === !0 && (e = {});
1526
+ const i = Ne(t, e);
1527
+ if (i !== !0)
1528
+ throw Error(`${i.err.msg}:${i.err.line}:${i.err.col}`);
917
1529
  }
918
- const n = new At(this.options);
919
- n.addExternalEntities(this.externalEntities);
920
- const i = n.parseXml(e);
921
- return this.options.preserveOrder || i === void 0 ? i : Ht(i, this.options);
1530
+ const s = new He(this.options);
1531
+ s.addExternalEntities(this.externalEntities);
1532
+ const r = s.parseXml(t);
1533
+ return this.options.preserveOrder || r === void 0 ? r : ln(r, this.options, s.matcher, s.readonlyMatcher);
922
1534
  }
923
1535
  /**
924
1536
  * Add Entity which is not by default supported by this library
925
1537
  * @param {string} key
926
1538
  * @param {string} value
927
1539
  */
928
- addEntity(e, s) {
929
- if (s.indexOf("&") !== -1)
1540
+ addEntity(t, e) {
1541
+ if (e.indexOf("&") !== -1)
930
1542
  throw new Error("Entity value can't have '&'");
931
- if (e.indexOf("&") !== -1 || e.indexOf(";") !== -1)
1543
+ if (t.indexOf("&") !== -1 || t.indexOf(";") !== -1)
932
1544
  throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");
933
- if (s === "&")
1545
+ if (e === "&")
934
1546
  throw new Error("An entity with value '&' is not permitted");
935
- this.externalEntities[e] = s;
1547
+ this.externalEntities[t] = e;
936
1548
  }
937
1549
  /**
938
1550
  * Returns a Symbol that can be used to access the metadata
@@ -945,78 +1557,149 @@ class _e {
945
1557
  * is true in the options.
946
1558
  */
947
1559
  static getMetaDataSymbol() {
948
- return ee.getMetaDataSymbol();
1560
+ return Q.getMetaDataSymbol();
949
1561
  }
950
1562
  }
951
- const jt = `
1563
+ const dn = `
952
1564
  `;
953
- function Kt(t, e) {
954
- let s = "";
955
- return e.format && e.indentBy.length > 0 && (s = jt), Ge(t, e, "", s);
956
- }
957
- function Ge(t, e, s, n) {
958
- let i = "", r = !1;
959
- for (let o = 0; o < t.length; o++) {
960
- const c = t[o], a = Zt(c);
961
- if (a === void 0) continue;
962
- let l = "";
963
- if (s.length === 0 ? l = a : l = `${s}.${a}`, a === e.textNodeName) {
964
- let x = c[a];
965
- Qt(l, e) || (x = e.tagValueProcessor(a, x), x = ze(x, e)), r && (i += n), i += x, r = !1;
1565
+ function fn(n, t) {
1566
+ let e = "";
1567
+ t.format && t.indentBy.length > 0 && (e = dn);
1568
+ const s = [];
1569
+ if (t.stopNodes && Array.isArray(t.stopNodes))
1570
+ for (let i = 0; i < t.stopNodes.length; i++) {
1571
+ const l = t.stopNodes[i];
1572
+ typeof l == "string" ? s.push(new ut(l)) : l instanceof ut && s.push(l);
1573
+ }
1574
+ const r = new Tt();
1575
+ return ee(n, t, e, r, s);
1576
+ }
1577
+ function ee(n, t, e, s, r) {
1578
+ let i = "", l = !1;
1579
+ if (t.maxNestedTags && s.getDepth() > t.maxNestedTags)
1580
+ throw new Error("Maximum nested tags exceeded");
1581
+ if (!Array.isArray(n)) {
1582
+ if (n != null) {
1583
+ let o = n.toString();
1584
+ return o = _t(o, t), o;
1585
+ }
1586
+ return "";
1587
+ }
1588
+ for (let o = 0; o < n.length; o++) {
1589
+ const a = n[o], c = se(a);
1590
+ if (c === void 0) continue;
1591
+ const h = pn(a[":@"], t);
1592
+ s.push(c, h);
1593
+ const d = mn(s, r);
1594
+ if (c === t.textNodeName) {
1595
+ let L = a[c];
1596
+ d || (L = t.tagValueProcessor(c, L), L = _t(L, t)), l && (i += e), i += L, l = !1, s.pop();
966
1597
  continue;
967
- } else if (a === e.cdataPropName) {
968
- r && (i += n), i += `<![CDATA[${c[a][0][e.textNodeName]}]]>`, r = !1;
1598
+ } else if (c === t.cdataPropName) {
1599
+ l && (i += e), i += `<![CDATA[${a[c][0][t.textNodeName]}]]>`, l = !1, s.pop();
969
1600
  continue;
970
- } else if (a === e.commentPropName) {
971
- i += n + `<!--${c[a][0][e.textNodeName]}-->`, r = !0;
1601
+ } else if (c === t.commentPropName) {
1602
+ i += e + `<!--${a[c][0][t.textNodeName]}-->`, l = !0, s.pop();
972
1603
  continue;
973
- } else if (a[0] === "?") {
974
- const x = Oe(c[":@"], e), V = a === "?xml" ? "" : n;
975
- let S = c[a][0][e.textNodeName];
976
- S = S.length !== 0 ? " " + S : "", i += V + `<${a}${S}${x}?>`, r = !0;
1604
+ } else if (c[0] === "?") {
1605
+ const L = Ut(a[":@"], t, d), X = c === "?xml" ? "" : e;
1606
+ let _ = a[c][0][t.textNodeName];
1607
+ _ = _.length !== 0 ? " " + _ : "", i += X + `<${c}${_}${L}?>`, l = !0, s.pop();
977
1608
  continue;
978
1609
  }
979
- let h = n;
980
- h !== "" && (h += e.indentBy);
981
- const d = Oe(c[":@"], e), f = n + `<${a}${d}`, y = Ge(c[a], e, l, h);
982
- e.unpairedTags.indexOf(a) !== -1 ? e.suppressUnpairedNode ? i += f + ">" : i += f + "/>" : (!y || y.length === 0) && e.suppressEmptyNode ? i += f + "/>" : y && y.endsWith(">") ? i += f + `>${y}${n}</${a}>` : (i += f + ">", y && n !== "" && (y.includes("/>") || y.includes("</")) ? i += n + e.indentBy + y + n : i += y, i += `</${a}>`), r = !0;
1610
+ let f = e;
1611
+ f !== "" && (f += t.indentBy);
1612
+ const y = Ut(a[":@"], t, d), C = e + `<${c}${y}`;
1613
+ let E;
1614
+ d ? E = ne(a[c], t) : E = ee(a[c], t, f, s, r), t.unpairedTags.indexOf(c) !== -1 ? t.suppressUnpairedNode ? i += C + ">" : i += C + "/>" : (!E || E.length === 0) && t.suppressEmptyNode ? i += C + "/>" : E && E.endsWith(">") ? i += C + `>${E}${e}</${c}>` : (i += C + ">", E && e !== "" && (E.includes("/>") || E.includes("</")) ? i += e + t.indentBy + E + e : i += E, i += `</${c}>`), l = !0, s.pop();
983
1615
  }
984
1616
  return i;
985
1617
  }
986
- function Zt(t) {
987
- const e = Object.keys(t);
988
- for (let s = 0; s < e.length; s++) {
989
- const n = e[s];
990
- if (t.hasOwnProperty(n) && n !== ":@")
991
- return n;
1618
+ function pn(n, t) {
1619
+ if (!n || t.ignoreAttributes) return null;
1620
+ const e = {};
1621
+ let s = !1;
1622
+ for (let r in n) {
1623
+ if (!Object.prototype.hasOwnProperty.call(n, r)) continue;
1624
+ const i = r.startsWith(t.attributeNamePrefix) ? r.substr(t.attributeNamePrefix.length) : r;
1625
+ e[i] = n[r], s = !0;
1626
+ }
1627
+ return s ? e : null;
1628
+ }
1629
+ function ne(n, t) {
1630
+ if (!Array.isArray(n))
1631
+ return n != null ? n.toString() : "";
1632
+ let e = "";
1633
+ for (let s = 0; s < n.length; s++) {
1634
+ const r = n[s], i = se(r);
1635
+ if (i === t.textNodeName)
1636
+ e += r[i];
1637
+ else if (i === t.cdataPropName)
1638
+ e += r[i][0][t.textNodeName];
1639
+ else if (i === t.commentPropName)
1640
+ e += r[i][0][t.textNodeName];
1641
+ else {
1642
+ if (i && i[0] === "?")
1643
+ continue;
1644
+ if (i) {
1645
+ const l = gn(r[":@"], t), o = ne(r[i], t);
1646
+ !o || o.length === 0 ? e += `<${i}${l}/>` : e += `<${i}${l}>${o}</${i}>`;
1647
+ }
1648
+ }
1649
+ }
1650
+ return e;
1651
+ }
1652
+ function gn(n, t) {
1653
+ let e = "";
1654
+ if (n && !t.ignoreAttributes)
1655
+ for (let s in n) {
1656
+ if (!Object.prototype.hasOwnProperty.call(n, s)) continue;
1657
+ let r = n[s];
1658
+ r === !0 && t.suppressBooleanAttributes ? e += ` ${s.substr(t.attributeNamePrefix.length)}` : e += ` ${s.substr(t.attributeNamePrefix.length)}="${r}"`;
1659
+ }
1660
+ return e;
1661
+ }
1662
+ function se(n) {
1663
+ const t = Object.keys(n);
1664
+ for (let e = 0; e < t.length; e++) {
1665
+ const s = t[e];
1666
+ if (Object.prototype.hasOwnProperty.call(n, s) && s !== ":@")
1667
+ return s;
992
1668
  }
993
1669
  }
994
- function Oe(t, e) {
1670
+ function Ut(n, t, e) {
995
1671
  let s = "";
996
- if (t && !e.ignoreAttributes)
997
- for (let n in t) {
998
- if (!t.hasOwnProperty(n)) continue;
999
- let i = e.attributeValueProcessor(n, t[n]);
1000
- i = ze(i, e), i === !0 && e.suppressBooleanAttributes ? s += ` ${n.substr(e.attributeNamePrefix.length)}` : s += ` ${n.substr(e.attributeNamePrefix.length)}="${i}"`;
1672
+ if (n && !t.ignoreAttributes)
1673
+ for (let r in n) {
1674
+ if (!Object.prototype.hasOwnProperty.call(n, r)) continue;
1675
+ let i;
1676
+ e ? i = n[r] : (i = t.attributeValueProcessor(r, n[r]), i = _t(i, t)), i === !0 && t.suppressBooleanAttributes ? s += ` ${r.substr(t.attributeNamePrefix.length)}` : s += ` ${r.substr(t.attributeNamePrefix.length)}="${i}"`;
1001
1677
  }
1002
1678
  return s;
1003
1679
  }
1004
- function Qt(t, e) {
1005
- t = t.substr(0, t.length - e.textNodeName.length - 1);
1006
- let s = t.substr(t.lastIndexOf(".") + 1);
1007
- for (let n in e.stopNodes)
1008
- if (e.stopNodes[n] === t || e.stopNodes[n] === "*." + s) return !0;
1680
+ function mn(n, t) {
1681
+ if (!t || t.length === 0) return !1;
1682
+ for (let e = 0; e < t.length; e++)
1683
+ if (n.matches(t[e]))
1684
+ return !0;
1009
1685
  return !1;
1010
1686
  }
1011
- function ze(t, e) {
1012
- if (t && t.length > 0 && e.processEntities)
1013
- for (let s = 0; s < e.entities.length; s++) {
1014
- const n = e.entities[s];
1015
- t = t.replace(n.regex, n.val);
1687
+ function _t(n, t) {
1688
+ if (n && n.length > 0 && t.processEntities)
1689
+ for (let e = 0; e < t.entities.length; e++) {
1690
+ const s = t.entities[e];
1691
+ n = n.replace(s.regex, s.val);
1016
1692
  }
1017
- return t;
1693
+ return n;
1018
1694
  }
1019
- const Jt = {
1695
+ function yn(n) {
1696
+ return typeof n == "function" ? n : Array.isArray(n) ? (t) => {
1697
+ for (const e of n)
1698
+ if (typeof e == "string" && t === e || e instanceof RegExp && e.test(t))
1699
+ return !0;
1700
+ } : () => !1;
1701
+ }
1702
+ const bn = {
1020
1703
  attributeNamePrefix: "@_",
1021
1704
  attributesGroupName: !1,
1022
1705
  textNodeName: "#text",
@@ -1027,11 +1710,11 @@ const Jt = {
1027
1710
  suppressEmptyNode: !1,
1028
1711
  suppressUnpairedNode: !0,
1029
1712
  suppressBooleanAttributes: !0,
1030
- tagValueProcessor: function(t, e) {
1031
- return e;
1713
+ tagValueProcessor: function(n, t) {
1714
+ return t;
1032
1715
  },
1033
- attributeValueProcessor: function(t, e) {
1034
- return e;
1716
+ attributeValueProcessor: function(n, t) {
1717
+ return t;
1035
1718
  },
1036
1719
  preserveOrder: !1,
1037
1720
  commentPropName: !1,
@@ -1048,126 +1731,238 @@ const Jt = {
1048
1731
  stopNodes: [],
1049
1732
  // transformTagName: false,
1050
1733
  // transformAttributeName: false,
1051
- oneListGroup: !1
1734
+ oneListGroup: !1,
1735
+ maxNestedTags: 100,
1736
+ jPath: !0
1737
+ // When true, callbacks receive string jPath; when false, receive Matcher instance
1052
1738
  };
1053
- function q(t) {
1054
- this.options = Object.assign({}, Jt, t), this.options.ignoreAttributes === !0 || this.options.attributesGroupName ? this.isAttribute = function() {
1739
+ function F(n) {
1740
+ if (this.options = Object.assign({}, bn, n), this.options.stopNodes && Array.isArray(this.options.stopNodes) && (this.options.stopNodes = this.options.stopNodes.map((t) => typeof t == "string" && t.startsWith("*.") ? ".." + t.substring(2) : t)), this.stopNodeExpressions = [], this.options.stopNodes && Array.isArray(this.options.stopNodes))
1741
+ for (let t = 0; t < this.options.stopNodes.length; t++) {
1742
+ const e = this.options.stopNodes[t];
1743
+ typeof e == "string" ? this.stopNodeExpressions.push(new ut(e)) : e instanceof ut && this.stopNodeExpressions.push(e);
1744
+ }
1745
+ this.options.ignoreAttributes === !0 || this.options.attributesGroupName ? this.isAttribute = function() {
1055
1746
  return !1;
1056
- } : (this.ignoreAttributesFn = He(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = ts), this.processTextOrObjNode = Dt, this.options.format ? (this.indentate = es, this.tagEndChar = `>
1747
+ } : (this.ignoreAttributesFn = yn(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = Nn), this.processTextOrObjNode = vn, this.options.format ? (this.indentate = En, this.tagEndChar = `>
1057
1748
  `, this.newLine = `
1058
1749
  `) : (this.indentate = function() {
1059
1750
  return "";
1060
1751
  }, this.tagEndChar = ">", this.newLine = "");
1061
1752
  }
1062
- q.prototype.build = function(t) {
1063
- return this.options.preserveOrder ? Kt(t, this.options) : (Array.isArray(t) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t = {
1064
- [this.options.arrayNodeName]: t
1065
- }), this.j2x(t, 0, []).val);
1753
+ F.prototype.build = function(n) {
1754
+ if (this.options.preserveOrder)
1755
+ return fn(n, this.options);
1756
+ {
1757
+ Array.isArray(n) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (n = {
1758
+ [this.options.arrayNodeName]: n
1759
+ });
1760
+ const t = new Tt();
1761
+ return this.j2x(n, 0, t).val;
1762
+ }
1066
1763
  };
1067
- q.prototype.j2x = function(t, e, s) {
1068
- let n = "", i = "";
1069
- const r = s.join(".");
1070
- for (let o in t)
1071
- if (Object.prototype.hasOwnProperty.call(t, o))
1072
- if (typeof t[o] > "u")
1073
- this.isAttribute(o) && (i += "");
1074
- else if (t[o] === null)
1075
- this.isAttribute(o) || o === this.options.cdataPropName ? i += "" : o[0] === "?" ? i += this.indentate(e) + "<" + o + "?" + this.tagEndChar : i += this.indentate(e) + "<" + o + "/" + this.tagEndChar;
1076
- else if (t[o] instanceof Date)
1077
- i += this.buildTextValNode(t[o], o, "", e);
1078
- else if (typeof t[o] != "object") {
1079
- const c = this.isAttribute(o);
1080
- if (c && !this.ignoreAttributesFn(c, r))
1081
- n += this.buildAttrPairStr(c, "" + t[o]);
1082
- else if (!c)
1764
+ F.prototype.j2x = function(n, t, e) {
1765
+ let s = "", r = "";
1766
+ if (this.options.maxNestedTags && e.getDepth() >= this.options.maxNestedTags)
1767
+ throw new Error("Maximum nested tags exceeded");
1768
+ const i = this.options.jPath ? e.toString() : e, l = this.checkStopNode(e);
1769
+ for (let o in n)
1770
+ if (Object.prototype.hasOwnProperty.call(n, o))
1771
+ if (typeof n[o] > "u")
1772
+ this.isAttribute(o) && (r += "");
1773
+ else if (n[o] === null)
1774
+ this.isAttribute(o) || o === this.options.cdataPropName ? r += "" : o[0] === "?" ? r += this.indentate(t) + "<" + o + "?" + this.tagEndChar : r += this.indentate(t) + "<" + o + "/" + this.tagEndChar;
1775
+ else if (n[o] instanceof Date)
1776
+ r += this.buildTextValNode(n[o], o, "", t, e);
1777
+ else if (typeof n[o] != "object") {
1778
+ const a = this.isAttribute(o);
1779
+ if (a && !this.ignoreAttributesFn(a, i))
1780
+ s += this.buildAttrPairStr(a, "" + n[o], l);
1781
+ else if (!a)
1083
1782
  if (o === this.options.textNodeName) {
1084
- let a = this.options.tagValueProcessor(o, "" + t[o]);
1085
- i += this.replaceEntitiesValue(a);
1086
- } else
1087
- i += this.buildTextValNode(t[o], o, "", e);
1088
- } else if (Array.isArray(t[o])) {
1089
- const c = t[o].length;
1090
- let a = "", l = "";
1091
- for (let h = 0; h < c; h++) {
1092
- const d = t[o][h];
1093
- if (!(typeof d > "u")) if (d === null)
1094
- o[0] === "?" ? i += this.indentate(e) + "<" + o + "?" + this.tagEndChar : i += this.indentate(e) + "<" + o + "/" + this.tagEndChar;
1095
- else if (typeof d == "object")
1783
+ let c = this.options.tagValueProcessor(o, "" + n[o]);
1784
+ r += this.replaceEntitiesValue(c);
1785
+ } else {
1786
+ e.push(o);
1787
+ const c = this.checkStopNode(e);
1788
+ if (e.pop(), c) {
1789
+ const h = "" + n[o];
1790
+ h === "" ? r += this.indentate(t) + "<" + o + this.closeTag(o) + this.tagEndChar : r += this.indentate(t) + "<" + o + ">" + h + "</" + o + this.tagEndChar;
1791
+ } else
1792
+ r += this.buildTextValNode(n[o], o, "", t, e);
1793
+ }
1794
+ } else if (Array.isArray(n[o])) {
1795
+ const a = n[o].length;
1796
+ let c = "", h = "";
1797
+ for (let d = 0; d < a; d++) {
1798
+ const f = n[o][d];
1799
+ if (!(typeof f > "u")) if (f === null)
1800
+ o[0] === "?" ? r += this.indentate(t) + "<" + o + "?" + this.tagEndChar : r += this.indentate(t) + "<" + o + "/" + this.tagEndChar;
1801
+ else if (typeof f == "object")
1096
1802
  if (this.options.oneListGroup) {
1097
- const f = this.j2x(d, e + 1, s.concat(o));
1098
- a += f.val, this.options.attributesGroupName && d.hasOwnProperty(this.options.attributesGroupName) && (l += f.attrStr);
1803
+ e.push(o);
1804
+ const y = this.j2x(f, t + 1, e);
1805
+ e.pop(), c += y.val, this.options.attributesGroupName && f.hasOwnProperty(this.options.attributesGroupName) && (h += y.attrStr);
1099
1806
  } else
1100
- a += this.processTextOrObjNode(d, o, e, s);
1807
+ c += this.processTextOrObjNode(f, o, t, e);
1101
1808
  else if (this.options.oneListGroup) {
1102
- let f = this.options.tagValueProcessor(o, d);
1103
- f = this.replaceEntitiesValue(f), a += f;
1104
- } else
1105
- a += this.buildTextValNode(d, o, "", e);
1809
+ let y = this.options.tagValueProcessor(o, f);
1810
+ y = this.replaceEntitiesValue(y), c += y;
1811
+ } else {
1812
+ e.push(o);
1813
+ const y = this.checkStopNode(e);
1814
+ if (e.pop(), y) {
1815
+ const C = "" + f;
1816
+ C === "" ? c += this.indentate(t) + "<" + o + this.closeTag(o) + this.tagEndChar : c += this.indentate(t) + "<" + o + ">" + C + "</" + o + this.tagEndChar;
1817
+ } else
1818
+ c += this.buildTextValNode(f, o, "", t, e);
1819
+ }
1106
1820
  }
1107
- this.options.oneListGroup && (a = this.buildObjectNode(a, o, l, e)), i += a;
1821
+ this.options.oneListGroup && (c = this.buildObjectNode(c, o, h, t)), r += c;
1108
1822
  } else if (this.options.attributesGroupName && o === this.options.attributesGroupName) {
1109
- const c = Object.keys(t[o]), a = c.length;
1110
- for (let l = 0; l < a; l++)
1111
- n += this.buildAttrPairStr(c[l], "" + t[o][c[l]]);
1823
+ const a = Object.keys(n[o]), c = a.length;
1824
+ for (let h = 0; h < c; h++)
1825
+ s += this.buildAttrPairStr(a[h], "" + n[o][a[h]], l);
1112
1826
  } else
1113
- i += this.processTextOrObjNode(t[o], o, e, s);
1114
- return { attrStr: n, val: i };
1827
+ r += this.processTextOrObjNode(n[o], o, t, e);
1828
+ return { attrStr: s, val: r };
1115
1829
  };
1116
- q.prototype.buildAttrPairStr = function(t, e) {
1117
- return e = this.options.attributeValueProcessor(t, "" + e), e = this.replaceEntitiesValue(e), this.options.suppressBooleanAttributes && e === "true" ? " " + t : " " + t + '="' + e + '"';
1830
+ F.prototype.buildAttrPairStr = function(n, t, e) {
1831
+ return e || (t = this.options.attributeValueProcessor(n, "" + t), t = this.replaceEntitiesValue(t)), this.options.suppressBooleanAttributes && t === "true" ? " " + n : " " + n + '="' + t + '"';
1118
1832
  };
1119
- function Dt(t, e, s, n) {
1120
- const i = this.j2x(t, s + 1, n.concat(e));
1121
- return t[this.options.textNodeName] !== void 0 && Object.keys(t).length === 1 ? this.buildTextValNode(t[this.options.textNodeName], e, i.attrStr, s) : this.buildObjectNode(i.val, e, i.attrStr, s);
1122
- }
1123
- q.prototype.buildObjectNode = function(t, e, s, n) {
1124
- if (t === "")
1125
- return e[0] === "?" ? this.indentate(n) + "<" + e + s + "?" + this.tagEndChar : this.indentate(n) + "<" + e + s + this.closeTag(e) + this.tagEndChar;
1833
+ function vn(n, t, e, s) {
1834
+ const r = this.extractAttributes(n);
1835
+ if (s.push(t, r), this.checkStopNode(s)) {
1836
+ const o = this.buildRawContent(n), a = this.buildAttributesForStopNode(n);
1837
+ return s.pop(), this.buildObjectNode(o, t, a, e);
1838
+ }
1839
+ const l = this.j2x(n, e + 1, s);
1840
+ return s.pop(), n[this.options.textNodeName] !== void 0 && Object.keys(n).length === 1 ? this.buildTextValNode(n[this.options.textNodeName], t, l.attrStr, e, s) : this.buildObjectNode(l.val, t, l.attrStr, e);
1841
+ }
1842
+ F.prototype.extractAttributes = function(n) {
1843
+ if (!n || typeof n != "object") return null;
1844
+ const t = {};
1845
+ let e = !1;
1846
+ if (this.options.attributesGroupName && n[this.options.attributesGroupName]) {
1847
+ const s = n[this.options.attributesGroupName];
1848
+ for (let r in s) {
1849
+ if (!Object.prototype.hasOwnProperty.call(s, r)) continue;
1850
+ const i = r.startsWith(this.options.attributeNamePrefix) ? r.substring(this.options.attributeNamePrefix.length) : r;
1851
+ t[i] = s[r], e = !0;
1852
+ }
1853
+ } else
1854
+ for (let s in n) {
1855
+ if (!Object.prototype.hasOwnProperty.call(n, s)) continue;
1856
+ const r = this.isAttribute(s);
1857
+ r && (t[r] = n[s], e = !0);
1858
+ }
1859
+ return e ? t : null;
1860
+ };
1861
+ F.prototype.buildRawContent = function(n) {
1862
+ if (typeof n == "string")
1863
+ return n;
1864
+ if (typeof n != "object" || n === null)
1865
+ return String(n);
1866
+ if (n[this.options.textNodeName] !== void 0)
1867
+ return n[this.options.textNodeName];
1868
+ let t = "";
1869
+ for (let e in n) {
1870
+ if (!Object.prototype.hasOwnProperty.call(n, e) || this.isAttribute(e) || this.options.attributesGroupName && e === this.options.attributesGroupName) continue;
1871
+ const s = n[e];
1872
+ if (e === this.options.textNodeName)
1873
+ t += s;
1874
+ else if (Array.isArray(s)) {
1875
+ for (let r of s)
1876
+ if (typeof r == "string" || typeof r == "number")
1877
+ t += `<${e}>${r}</${e}>`;
1878
+ else if (typeof r == "object" && r !== null) {
1879
+ const i = this.buildRawContent(r), l = this.buildAttributesForStopNode(r);
1880
+ i === "" ? t += `<${e}${l}/>` : t += `<${e}${l}>${i}</${e}>`;
1881
+ }
1882
+ } else if (typeof s == "object" && s !== null) {
1883
+ const r = this.buildRawContent(s), i = this.buildAttributesForStopNode(s);
1884
+ r === "" ? t += `<${e}${i}/>` : t += `<${e}${i}>${r}</${e}>`;
1885
+ } else
1886
+ t += `<${e}>${s}</${e}>`;
1887
+ }
1888
+ return t;
1889
+ };
1890
+ F.prototype.buildAttributesForStopNode = function(n) {
1891
+ if (!n || typeof n != "object") return "";
1892
+ let t = "";
1893
+ if (this.options.attributesGroupName && n[this.options.attributesGroupName]) {
1894
+ const e = n[this.options.attributesGroupName];
1895
+ for (let s in e) {
1896
+ if (!Object.prototype.hasOwnProperty.call(e, s)) continue;
1897
+ const r = s.startsWith(this.options.attributeNamePrefix) ? s.substring(this.options.attributeNamePrefix.length) : s, i = e[s];
1898
+ i === !0 && this.options.suppressBooleanAttributes ? t += " " + r : t += " " + r + '="' + i + '"';
1899
+ }
1900
+ } else
1901
+ for (let e in n) {
1902
+ if (!Object.prototype.hasOwnProperty.call(n, e)) continue;
1903
+ const s = this.isAttribute(e);
1904
+ if (s) {
1905
+ const r = n[e];
1906
+ r === !0 && this.options.suppressBooleanAttributes ? t += " " + s : t += " " + s + '="' + r + '"';
1907
+ }
1908
+ }
1909
+ return t;
1910
+ };
1911
+ F.prototype.buildObjectNode = function(n, t, e, s) {
1912
+ if (n === "")
1913
+ return t[0] === "?" ? this.indentate(s) + "<" + t + e + "?" + this.tagEndChar : this.indentate(s) + "<" + t + e + this.closeTag(t) + this.tagEndChar;
1126
1914
  {
1127
- let i = "</" + e + this.tagEndChar, r = "";
1128
- return e[0] === "?" && (r = "?", i = ""), (s || s === "") && t.indexOf("<") === -1 ? this.indentate(n) + "<" + e + s + r + ">" + t + i : this.options.commentPropName !== !1 && e === this.options.commentPropName && r.length === 0 ? this.indentate(n) + `<!--${t}-->` + this.newLine : this.indentate(n) + "<" + e + s + r + this.tagEndChar + t + this.indentate(n) + i;
1915
+ let r = "</" + t + this.tagEndChar, i = "";
1916
+ return t[0] === "?" && (i = "?", r = ""), (e || e === "") && n.indexOf("<") === -1 ? this.indentate(s) + "<" + t + e + i + ">" + n + r : this.options.commentPropName !== !1 && t === this.options.commentPropName && i.length === 0 ? this.indentate(s) + `<!--${n}-->` + this.newLine : this.indentate(s) + "<" + t + e + i + this.tagEndChar + n + this.indentate(s) + r;
1129
1917
  }
1130
1918
  };
1131
- q.prototype.closeTag = function(t) {
1132
- let e = "";
1133
- return this.options.unpairedTags.indexOf(t) !== -1 ? this.options.suppressUnpairedNode || (e = "/") : this.options.suppressEmptyNode ? e = "/" : e = `></${t}`, e;
1919
+ F.prototype.closeTag = function(n) {
1920
+ let t = "";
1921
+ return this.options.unpairedTags.indexOf(n) !== -1 ? this.options.suppressUnpairedNode || (t = "/") : this.options.suppressEmptyNode ? t = "/" : t = `></${n}`, t;
1134
1922
  };
1135
- q.prototype.buildTextValNode = function(t, e, s, n) {
1136
- if (this.options.cdataPropName !== !1 && e === this.options.cdataPropName)
1137
- return this.indentate(n) + `<![CDATA[${t}]]>` + this.newLine;
1138
- if (this.options.commentPropName !== !1 && e === this.options.commentPropName)
1139
- return this.indentate(n) + `<!--${t}-->` + this.newLine;
1140
- if (e[0] === "?")
1141
- return this.indentate(n) + "<" + e + s + "?" + this.tagEndChar;
1923
+ F.prototype.checkStopNode = function(n) {
1924
+ if (!this.stopNodeExpressions || this.stopNodeExpressions.length === 0) return !1;
1925
+ for (let t = 0; t < this.stopNodeExpressions.length; t++)
1926
+ if (n.matches(this.stopNodeExpressions[t]))
1927
+ return !0;
1928
+ return !1;
1929
+ };
1930
+ F.prototype.buildTextValNode = function(n, t, e, s, r) {
1931
+ if (this.options.cdataPropName !== !1 && t === this.options.cdataPropName)
1932
+ return this.indentate(s) + `<![CDATA[${n}]]>` + this.newLine;
1933
+ if (this.options.commentPropName !== !1 && t === this.options.commentPropName)
1934
+ return this.indentate(s) + `<!--${n}-->` + this.newLine;
1935
+ if (t[0] === "?")
1936
+ return this.indentate(s) + "<" + t + e + "?" + this.tagEndChar;
1142
1937
  {
1143
- let i = this.options.tagValueProcessor(e, t);
1144
- return i = this.replaceEntitiesValue(i), i === "" ? this.indentate(n) + "<" + e + s + this.closeTag(e) + this.tagEndChar : this.indentate(n) + "<" + e + s + ">" + i + "</" + e + this.tagEndChar;
1938
+ let i = this.options.tagValueProcessor(t, n);
1939
+ return i = this.replaceEntitiesValue(i), i === "" ? this.indentate(s) + "<" + t + e + this.closeTag(t) + this.tagEndChar : this.indentate(s) + "<" + t + e + ">" + i + "</" + t + this.tagEndChar;
1145
1940
  }
1146
1941
  };
1147
- q.prototype.replaceEntitiesValue = function(t) {
1148
- if (t && t.length > 0 && this.options.processEntities)
1149
- for (let e = 0; e < this.options.entities.length; e++) {
1150
- const s = this.options.entities[e];
1151
- t = t.replace(s.regex, s.val);
1942
+ F.prototype.replaceEntitiesValue = function(n) {
1943
+ if (n && n.length > 0 && this.options.processEntities)
1944
+ for (let t = 0; t < this.options.entities.length; t++) {
1945
+ const e = this.options.entities[t];
1946
+ n = n.replace(e.regex, e.val);
1152
1947
  }
1153
- return t;
1948
+ return n;
1154
1949
  };
1155
- function es(t) {
1156
- return this.options.indentBy.repeat(t);
1950
+ function En(n) {
1951
+ return this.options.indentBy.repeat(n);
1157
1952
  }
1158
- function ts(t) {
1159
- return t.startsWith(this.options.attributeNamePrefix) && t !== this.options.textNodeName ? t.substr(this.attrPrefixLen) : !1;
1953
+ function Nn(n) {
1954
+ return n.startsWith(this.options.attributeNamePrefix) && n !== this.options.textNodeName ? n.substr(this.attrPrefixLen) : !1;
1160
1955
  }
1161
- class ss {
1956
+ class wn {
1162
1957
  attr_id;
1163
1958
  attr_version;
1164
1959
  Label;
1165
1960
  constructor({
1166
- Label: e,
1167
- attr_id: s,
1168
- attr_version: n
1961
+ Label: t,
1962
+ attr_id: e,
1963
+ attr_version: s
1169
1964
  }) {
1170
- this.attr_id = s, this.attr_version = n, this.Label = e;
1965
+ this.attr_id = e, this.attr_version = s, this.Label = t;
1171
1966
  }
1172
1967
  toXML() {
1173
1968
  return {
@@ -1177,11 +1972,11 @@ class ss {
1177
1972
  };
1178
1973
  }
1179
1974
  }
1180
- class ns {
1975
+ class Sn {
1181
1976
  attr_ref;
1182
1977
  attr_version;
1183
- constructor({ attr_ref: e, attr_version: s }) {
1184
- this.attr_ref = e, this.attr_version = s;
1978
+ constructor({ attr_ref: t, attr_version: e }) {
1979
+ this.attr_ref = t, this.attr_version = e;
1185
1980
  }
1186
1981
  toXML() {
1187
1982
  return {
@@ -1190,42 +1985,42 @@ class ns {
1190
1985
  };
1191
1986
  }
1192
1987
  }
1193
- class je {
1988
+ class ie {
1194
1989
  value;
1195
- constructor(e) {
1196
- this.value = e?.text_value;
1990
+ constructor(t) {
1991
+ this.value = t?.text_value;
1197
1992
  }
1198
1993
  toXML() {
1199
1994
  return { text_value: this.value };
1200
1995
  }
1201
1996
  }
1202
- function P(t, e) {
1203
- return t ? Array.isArray(t) ? t.map((s) => new e(s)) : [new e(t)] : [];
1997
+ function A(n, t) {
1998
+ return n ? Array.isArray(n) ? n.map((e) => new t(e)) : [new t(n)] : [];
1204
1999
  }
1205
- function K(t) {
1206
- return t.map((e) => e.toXML());
2000
+ function J(n) {
2001
+ return n.map((t) => t.toXML());
1207
2002
  }
1208
- function U(t) {
1209
- const e = {};
1210
- return t.forEach((s) => {
1211
- const i = s.constructor.xmlTagName ?? s.constructor.name;
1212
- e[i] || (e[i] = []), e[i].push(s.toXML());
1213
- }), e;
2003
+ function j(n) {
2004
+ const t = {};
2005
+ return n.forEach((e) => {
2006
+ const r = e.constructor.xmlTagName ?? e.constructor.name;
2007
+ t[r] || (t[r] = []), t[r].push(e.toXML());
2008
+ }), t;
1214
2009
  }
1215
- class ge {
2010
+ class gt {
1216
2011
  attr_id;
1217
2012
  attr_version;
1218
2013
  Units;
1219
2014
  TicketingEquipmentRef;
1220
2015
  TicketValidatorEquipmentRef;
1221
2016
  constructor({
1222
- attr_id: e,
1223
- attr_version: s,
1224
- Units: n,
1225
- TicketingEquipmentRef: i = void 0,
1226
- TicketValidatorEquipmentRef: r = void 0
2017
+ attr_id: t,
2018
+ attr_version: e,
2019
+ Units: s,
2020
+ TicketingEquipmentRef: r = void 0,
2021
+ TicketValidatorEquipmentRef: i = void 0
1227
2022
  }) {
1228
- this.attr_id = e, this.attr_version = s, this.Units = n, this.TicketingEquipmentRef = i, this.TicketValidatorEquipmentRef = r;
2023
+ this.attr_id = t, this.attr_version = e, this.Units = s, this.TicketingEquipmentRef = r, this.TicketValidatorEquipmentRef = i;
1229
2024
  }
1230
2025
  toXML() {
1231
2026
  return {
@@ -1237,7 +2032,7 @@ class ge {
1237
2032
  };
1238
2033
  }
1239
2034
  }
1240
- class is {
2035
+ class xn {
1241
2036
  attr_id;
1242
2037
  attr_version;
1243
2038
  Name;
@@ -1245,14 +2040,14 @@ class is {
1245
2040
  TotalCapacity;
1246
2041
  actualVehicleEquipments;
1247
2042
  constructor({
1248
- attr_id: e,
1249
- attr_version: s,
1250
- Name: n,
1251
- PublicUse: i,
1252
- TotalCapacity: r,
1253
- actualVehicleEquipments: o
2043
+ attr_id: t,
2044
+ attr_version: e,
2045
+ Name: s,
2046
+ PublicUse: r,
2047
+ TotalCapacity: i,
2048
+ actualVehicleEquipments: l
1254
2049
  }) {
1255
- this.attr_id = e, this.attr_version = s, this.Name = n ? new je(n) : void 0, this.actualVehicleEquipments = o ? P(o.ActualVehicleEquipment, ge) : [], this.PublicUse = i?.text_value, this.TotalCapacity = r?.text_value;
2050
+ this.attr_id = t, this.attr_version = e, this.Name = s ? new ie(s) : void 0, this.actualVehicleEquipments = l ? A(l.ActualVehicleEquipment, gt) : [], this.PublicUse = r?.text_value, this.TotalCapacity = i?.text_value;
1256
2051
  }
1257
2052
  toXML() {
1258
2053
  return {
@@ -1262,21 +2057,21 @@ class is {
1262
2057
  };
1263
2058
  }
1264
2059
  }
1265
- class Q {
2060
+ class tt {
1266
2061
  x;
1267
2062
  y;
1268
- constructor(e, s) {
1269
- this.x = e, this.y = s;
2063
+ constructor(t, e) {
2064
+ this.x = t, this.y = e;
1270
2065
  }
1271
2066
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1272
- static fromXML(e) {
1273
- const s = e?.Location?.pos;
1274
- if (typeof s == "string") {
1275
- const [n, i] = s.split(" ").map(Number);
1276
- if (typeof n == "number" && typeof i == "number")
1277
- return new Q(n, i);
2067
+ static fromXML(t) {
2068
+ const e = t?.Location?.pos;
2069
+ if (typeof e == "string") {
2070
+ const [s, r] = e.split(" ").map(Number);
2071
+ if (typeof s == "number" && typeof r == "number")
2072
+ return new tt(s, r);
1278
2073
  } else
1279
- return new Q(0, 0);
2074
+ return new tt(0, 0);
1280
2075
  }
1281
2076
  toXML() {
1282
2077
  return {
@@ -1286,7 +2081,7 @@ class Q {
1286
2081
  };
1287
2082
  }
1288
2083
  }
1289
- class Ke {
2084
+ class re {
1290
2085
  static xmlTagName = "PassengerEntrance";
1291
2086
  attr_id;
1292
2087
  attr_version;
@@ -1306,28 +2101,28 @@ class Ke {
1306
2101
  Centroid;
1307
2102
  // sensorInEntrance: SensorInEntrance[]
1308
2103
  constructor({
1309
- attr_id: e,
1310
- attr_version: s,
1311
- Name: n,
1312
- Label: i,
1313
- Width: r,
1314
- Height: o,
1315
- actualVehicleEquipments: c,
2104
+ attr_id: t,
2105
+ attr_version: e,
2106
+ Name: s,
2107
+ Label: r,
2108
+ Width: i,
2109
+ Height: l,
2110
+ actualVehicleEquipments: o,
1316
2111
  PublicUse: a,
1317
- VehicleSide: l,
2112
+ VehicleSide: c,
1318
2113
  SequenceFromFront: h,
1319
2114
  HeightFromGround: d,
1320
2115
  DeckEntranceType: f,
1321
2116
  IsEmergencyExit: y,
1322
- HasDoor: x,
1323
- IsAutomatic: V,
1324
- Centroid: S = void 0
2117
+ HasDoor: C,
2118
+ IsAutomatic: E,
2119
+ Centroid: L = void 0
1325
2120
  // sensorInEntrance,
1326
2121
  }) {
1327
- this.attr_id = e, this.attr_version = s, this.Name = n ? new je(n) : void 0, this.Label = i?.text_value, this.Width = r?.text_value, this.Height = o?.text_value, this.actualVehicleEquipments = P(
1328
- c?.ActualVehicleEquipment,
1329
- ge
1330
- ), this.PublicUse = a?.text_value, this.VehicleSide = l?.text_value, this.SequenceFromFront = h?.text_value, this.HeightFromGround = d?.text_value, this.DeckEntranceType = f?.text_value, this.IsEmergencyExit = y?.text_value, this.HasDoor = x?.text_value, this.IsAutomatic = V?.text_value, this.Centroid = S ? Q.fromXML(S) : void 0;
2122
+ this.attr_id = t, this.attr_version = e, this.Name = s ? new ie(s) : void 0, this.Label = r?.text_value, this.Width = i?.text_value, this.Height = l?.text_value, this.actualVehicleEquipments = A(
2123
+ o?.ActualVehicleEquipment,
2124
+ gt
2125
+ ), this.PublicUse = a?.text_value, this.VehicleSide = c?.text_value, this.SequenceFromFront = h?.text_value, this.HeightFromGround = d?.text_value, this.DeckEntranceType = f?.text_value, this.IsEmergencyExit = y?.text_value, this.HasDoor = C?.text_value, this.IsAutomatic = E?.text_value, this.Centroid = L ? tt.fromXML(L) : void 0;
1331
2126
  }
1332
2127
  toXML() {
1333
2128
  return {
@@ -1338,7 +2133,7 @@ class Ke {
1338
2133
  Width: this.Width,
1339
2134
  Height: this.Height,
1340
2135
  actualVehicleEquipments: {
1341
- ActualVehicleEquipment: K(this.actualVehicleEquipments)
2136
+ ActualVehicleEquipment: J(this.actualVehicleEquipments)
1342
2137
  },
1343
2138
  PublicUse: this.PublicUse,
1344
2139
  VehicleSide: this.VehicleSide,
@@ -1352,27 +2147,27 @@ class Ke {
1352
2147
  // sensorInEntrance: {SensorInEntrance: serializeElements(this.sensorInEntrance)},
1353
2148
  };
1354
2149
  }
1355
- getShape(e, s, n) {
1356
- const i = (this.Width || 0.8) * e, r = 0.2 * e;
1357
- let o = i, c = r, a = 0, l = 0;
1358
- if ((this.VehicleSide === "front" || this.VehicleSide === "back") && (o = r, c = i), this.Centroid) {
1359
- let h = (this.Centroid?.x ?? 0) * e, d = (this.Centroid?.y ?? 0) * e;
1360
- return this.VehicleSide === "leftSide" ? d = (this.Centroid?.y ?? 0) * e - c / 2 : this.VehicleSide === "rightSide" ? d = (this.Centroid?.y ?? 0) * e + c / 2 : this.VehicleSide === "front" ? h = (this.Centroid?.x ?? 0) * e - o / 2 : this.VehicleSide === "back" && (h = (this.Centroid?.x ?? 0) * e + o / 2), {
2150
+ getShape(t, e, s) {
2151
+ const r = (this.Width || 0.8) * t, i = 0.2 * t;
2152
+ let l = r, o = i, a = 0, c = 0;
2153
+ if ((this.VehicleSide === "front" || this.VehicleSide === "back") && (l = i, o = r), this.Centroid) {
2154
+ let h = (this.Centroid?.x ?? 0) * t, d = (this.Centroid?.y ?? 0) * t;
2155
+ return this.VehicleSide === "leftSide" ? d = (this.Centroid?.y ?? 0) * t - o / 2 : this.VehicleSide === "rightSide" ? d = (this.Centroid?.y ?? 0) * t + o / 2 : this.VehicleSide === "front" ? h = (this.Centroid?.x ?? 0) * t - l / 2 : this.VehicleSide === "back" && (h = (this.Centroid?.x ?? 0) * t + l / 2), {
1361
2156
  x: h,
1362
2157
  y: d,
1363
- width: o,
1364
- height: c,
2158
+ width: l,
2159
+ height: o,
1365
2160
  fill: "orange",
1366
2161
  stroke: "darkorange",
1367
2162
  strokeWidth: 2,
1368
2163
  draggable: !0
1369
2164
  };
1370
2165
  }
1371
- return this.VehicleSide === "leftSide" ? (a = (this.SequenceFromFront ?? 0) * e - o / 2 + 5, l = 5) : this.VehicleSide === "rightSide" ? (a = (this.SequenceFromFront ?? 0) * e - o / 2 + 5, l = n * e + 5 - c) : this.VehicleSide === "front" ? (a = 5, l = n * e / 2 + 5 - c / 2) : this.VehicleSide === "back" ? (a = s * e + 5 - o, l = n * e / 2 + 5 - c / 2) : (a = 5, l = 5), {
2166
+ return this.VehicleSide === "leftSide" ? (a = (this.SequenceFromFront ?? 0) * t - l / 2 + 5, c = 5) : this.VehicleSide === "rightSide" ? (a = (this.SequenceFromFront ?? 0) * t - l / 2 + 5, c = s * t + 5 - o) : this.VehicleSide === "front" ? (a = 5, c = s * t / 2 + 5 - o / 2) : this.VehicleSide === "back" ? (a = e * t + 5 - l, c = s * t / 2 + 5 - o / 2) : (a = 5, c = 5), {
1372
2167
  x: a,
1373
- y: l,
1374
- width: o,
1375
- height: c,
2168
+ y: c,
2169
+ width: l,
2170
+ height: o,
1376
2171
  fill: "orange",
1377
2172
  stroke: "darkorange",
1378
2173
  strokeWidth: 2,
@@ -1380,11 +2175,11 @@ class Ke {
1380
2175
  };
1381
2176
  }
1382
2177
  }
1383
- class $e {
2178
+ class Bt {
1384
2179
  attr_ref;
1385
2180
  attr_version;
1386
- constructor({ attr_ref: e, attr_version: s }) {
1387
- this.attr_ref = e, this.attr_version = s;
2181
+ constructor({ attr_ref: t, attr_version: e }) {
2182
+ this.attr_ref = t, this.attr_version = e;
1388
2183
  }
1389
2184
  toXML() {
1390
2185
  return {
@@ -1393,13 +2188,13 @@ class $e {
1393
2188
  };
1394
2189
  }
1395
2190
  }
1396
- class rs {
2191
+ class kn {
1397
2192
  attr_ref;
1398
2193
  attr_version;
1399
2194
  FromDeckEntranceRef;
1400
2195
  ToDeckEntranceRef;
1401
- constructor({ attr_ref: e, attr_version: s, FromDeckEntranceRef: n, ToDeckEntranceRef: i }) {
1402
- this.attr_ref = e, this.attr_version = s, this.FromDeckEntranceRef = new $e(n), this.ToDeckEntranceRef = new $e(i);
2196
+ constructor({ attr_ref: t, attr_version: e, FromDeckEntranceRef: s, ToDeckEntranceRef: r }) {
2197
+ this.attr_ref = t, this.attr_version = e, this.FromDeckEntranceRef = new Bt(s), this.ToDeckEntranceRef = new Bt(r);
1403
2198
  }
1404
2199
  toXML() {
1405
2200
  return {
@@ -1410,12 +2205,12 @@ class rs {
1410
2205
  };
1411
2206
  }
1412
2207
  }
1413
- class os {
2208
+ class Cn {
1414
2209
  attr_id;
1415
2210
  attr_version;
1416
2211
  Name;
1417
- constructor({ attr_id: e, attr_version: s, Name: n }) {
1418
- this.attr_id = e, this.attr_version = s, this.Name = n;
2212
+ constructor({ attr_id: t, attr_version: e, Name: s }) {
2213
+ this.attr_id = t, this.attr_version = e, this.Name = s;
1419
2214
  }
1420
2215
  toXML() {
1421
2216
  return {
@@ -1425,11 +2220,11 @@ class os {
1425
2220
  };
1426
2221
  }
1427
2222
  }
1428
- class as {
2223
+ class _n {
1429
2224
  attr_ref;
1430
2225
  attr_version;
1431
- constructor({ attr_ref: e, attr_version: s }) {
1432
- this.attr_ref = e, this.attr_version = s;
2226
+ constructor({ attr_ref: t, attr_version: e }) {
2227
+ this.attr_ref = t, this.attr_version = e;
1433
2228
  }
1434
2229
  toXML() {
1435
2230
  return {
@@ -1438,7 +2233,7 @@ class as {
1438
2233
  };
1439
2234
  }
1440
2235
  }
1441
- class ls {
2236
+ class Pn {
1442
2237
  attr_ref;
1443
2238
  attr_version;
1444
2239
  validityConditions;
@@ -1446,14 +2241,14 @@ class ls {
1446
2241
  EntranceUsageType;
1447
2242
  EntranceSetting;
1448
2243
  ControlledLocking;
1449
- constructor({ attr_ref: e, attr_version: s, validityConditions: n, Name: i, EntranceUsageType: r, EntranceSetting: o, ControlledLocking: c }) {
1450
- this.attr_ref = e, this.attr_version = s, this.validityConditions = Object.entries(n).flatMap(([a, l]) => (a === "ValidityConditionRef" && l.map((h) => new as(h)), a === "ValidityCondition" && l.map((h) => new os(h)), [])), this.Name = i, this.EntranceUsageType = r, this.EntranceSetting = o, this.ControlledLocking = c;
2244
+ constructor({ attr_ref: t, attr_version: e, validityConditions: s, Name: r, EntranceUsageType: i, EntranceSetting: l, ControlledLocking: o }) {
2245
+ this.attr_ref = t, this.attr_version = e, this.validityConditions = Object.entries(s).flatMap(([a, c]) => (a === "ValidityConditionRef" && c.map((h) => new _n(h)), a === "ValidityCondition" && c.map((h) => new Cn(h)), [])), this.Name = r, this.EntranceUsageType = i, this.EntranceSetting = l, this.ControlledLocking = o;
1451
2246
  }
1452
2247
  toXML() {
1453
2248
  return {
1454
2249
  attr_ref: this.attr_ref,
1455
2250
  attr_version: this.attr_version,
1456
- validityConditions: U(this.validityConditions),
2251
+ validityConditions: j(this.validityConditions),
1457
2252
  Name: this.Name,
1458
2253
  EntranceUsageType: this.EntranceUsageType,
1459
2254
  EntranceSetting: this.EntranceSetting,
@@ -1461,13 +2256,13 @@ class ls {
1461
2256
  };
1462
2257
  }
1463
2258
  }
1464
- class cs {
2259
+ class Tn {
1465
2260
  attr_ref;
1466
2261
  attr_version;
1467
2262
  LocatableSpotType;
1468
2263
  capacity;
1469
- constructor({ attr_ref: e, attr_version: s, LocatableSpotType: n, capacity: i }) {
1470
- this.attr_ref = e, this.attr_version = s, this.LocatableSpotType = n, this.capacity = i;
2264
+ constructor({ attr_ref: t, attr_version: e, LocatableSpotType: s, capacity: r }) {
2265
+ this.attr_ref = t, this.attr_version = e, this.LocatableSpotType = s, this.capacity = r;
1471
2266
  }
1472
2267
  toXML() {
1473
2268
  return {
@@ -1478,11 +2273,11 @@ class cs {
1478
2273
  };
1479
2274
  }
1480
2275
  }
1481
- class ds {
2276
+ class An {
1482
2277
  attr_id;
1483
2278
  label;
1484
- constructor({ attr_id: e, Label: s }) {
1485
- this.attr_id = e, this.label = s;
2279
+ constructor({ attr_id: t, Label: e }) {
2280
+ this.attr_id = t, this.label = e;
1486
2281
  }
1487
2282
  toXML() {
1488
2283
  return {
@@ -1491,11 +2286,11 @@ class ds {
1491
2286
  };
1492
2287
  }
1493
2288
  }
1494
- class Ze {
2289
+ class oe {
1495
2290
  attr_ref;
1496
2291
  attr_version;
1497
- constructor({ attr_ref: e, attr_version: s }) {
1498
- this.attr_ref = e, this.attr_version = s;
2292
+ constructor({ attr_ref: t, attr_version: e }) {
2293
+ this.attr_ref = t, this.attr_version = e;
1499
2294
  }
1500
2295
  toXML() {
1501
2296
  return {
@@ -1504,12 +2299,12 @@ class Ze {
1504
2299
  };
1505
2300
  }
1506
2301
  }
1507
- class us {
2302
+ class Ln {
1508
2303
  attr_id;
1509
2304
  label;
1510
2305
  //GeneralLabel[]
1511
- constructor({ attr_id: e, Label: s }) {
1512
- this.attr_id = e, this.label = s;
2306
+ constructor({ attr_id: t, Label: e }) {
2307
+ this.attr_id = t, this.label = e;
1513
2308
  }
1514
2309
  toXML() {
1515
2310
  return {
@@ -1518,11 +2313,11 @@ class us {
1518
2313
  };
1519
2314
  }
1520
2315
  }
1521
- class Qe {
2316
+ class ae {
1522
2317
  attr_ref;
1523
2318
  attr_version;
1524
- constructor({ attr_ref: e, attr_version: s }) {
1525
- this.attr_ref = e, this.attr_version = s;
2319
+ constructor({ attr_ref: t, attr_version: e }) {
2320
+ this.attr_ref = t, this.attr_version = e;
1526
2321
  }
1527
2322
  toXML() {
1528
2323
  return {
@@ -1531,7 +2326,7 @@ class Qe {
1531
2326
  };
1532
2327
  }
1533
2328
  }
1534
- class hs {
2329
+ class $n {
1535
2330
  attr_id;
1536
2331
  attr_version;
1537
2332
  Label;
@@ -1539,8 +2334,8 @@ class hs {
1539
2334
  actualVehicleEquipments;
1540
2335
  SpotColumnRef;
1541
2336
  SpotRowRef;
1542
- constructor({ attr_id: e, attr_version: s, Label: n, Orientation: i, actualVehicleEquipments: r, SpotColumnRef: o, SpotRowRef: c }) {
1543
- this.attr_id = e, this.attr_version = s, this.Label = n, this.Orientation = i, this.actualVehicleEquipments = r ? P(r, ge) : [], this.SpotColumnRef = o ? new Ze(o) : void 0, this.SpotRowRef = c ? new Qe(c) : void 0;
2337
+ constructor({ attr_id: t, attr_version: e, Label: s, Orientation: r, actualVehicleEquipments: i, SpotColumnRef: l, SpotRowRef: o }) {
2338
+ this.attr_id = t, this.attr_version = e, this.Label = s, this.Orientation = r, this.actualVehicleEquipments = i ? A(i, gt) : [], this.SpotColumnRef = l ? new oe(l) : void 0, this.SpotRowRef = o ? new ae(o) : void 0;
1544
2339
  }
1545
2340
  toXML() {
1546
2341
  return {
@@ -1548,17 +2343,17 @@ class hs {
1548
2343
  attr_version: this.attr_version,
1549
2344
  Label: this.Label,
1550
2345
  Orientation: this.Orientation,
1551
- actualVehicleEquipments: { ActualVehicleEquipment: K(this.actualVehicleEquipments) },
2346
+ actualVehicleEquipments: { ActualVehicleEquipment: J(this.actualVehicleEquipments) },
1552
2347
  SpotColumnRef: this.SpotColumnRef?.toXML(),
1553
2348
  SpotRowRef: this.SpotRowRef?.toXML()
1554
2349
  };
1555
2350
  }
1556
2351
  }
1557
- class fs {
2352
+ class Mn {
1558
2353
  attr_ref;
1559
2354
  attr_version;
1560
- constructor({ attr_ref: e, attr_version: s }) {
1561
- this.attr_ref = e, this.attr_version = s;
2355
+ constructor({ attr_ref: t, attr_version: e }) {
2356
+ this.attr_ref = t, this.attr_version = e;
1562
2357
  }
1563
2358
  toXML() {
1564
2359
  return {
@@ -1567,8 +2362,8 @@ class fs {
1567
2362
  };
1568
2363
  }
1569
2364
  }
1570
- var fe = /* @__PURE__ */ ((t) => (t.Occupied = "Occupied", t.Selected = "Selected", t.Filtered = "Filtered", t.Defect = "Defect", t.Undefined = "Undefined", t))(fe || {});
1571
- class ce {
2365
+ var pt = /* @__PURE__ */ ((n) => (n.Occupied = "Occupied", n.Selected = "Selected", n.Filtered = "Filtered", n.Defect = "Defect", n.Undefined = "Undefined", n))(pt || {});
2366
+ class ht {
1572
2367
  static xmlTagName = "PassengerSpot";
1573
2368
  attr_id;
1574
2369
  attr_version;
@@ -1585,21 +2380,21 @@ class ce {
1585
2380
  Length;
1586
2381
  availability;
1587
2382
  constructor({
1588
- attr_id: e,
1589
- attr_version: s,
1590
- Label: n,
1591
- Orientation: i,
1592
- actualVehicleEquipments: r,
1593
- SpotColumnRef: o,
1594
- SpotRowRef: c,
2383
+ attr_id: t,
2384
+ attr_version: e,
2385
+ Label: s,
2386
+ Orientation: r,
2387
+ actualVehicleEquipments: i,
2388
+ SpotColumnRef: l,
2389
+ SpotRowRef: o,
1595
2390
  ByWindow: a,
1596
- ByAisle: l,
2391
+ ByAisle: c,
1597
2392
  HasPower: h,
1598
2393
  Centroid: d,
1599
2394
  Width: f,
1600
2395
  Length: y
1601
2396
  }) {
1602
- this.attr_id = e, this.attr_version = s, this.Label = n || "", this.Orientation = i || void 0, this.actualVehicleEquipments = r ? P(r, ge) : void 0, this.SpotColumnRef = o ? new Ze(o) : void 0, this.SpotRowRef = c ? new Qe(c) : void 0, this.ByWindow = a, this.ByAisle = l, this.HasPower = h, this.Centroid = d ? Q.fromXML(d) : void 0, this.Width = f || 0.5, this.Length = y || 0.5;
2397
+ this.attr_id = t, this.attr_version = e, this.Label = s || "", this.Orientation = r || void 0, this.actualVehicleEquipments = i ? A(i, gt) : void 0, this.SpotColumnRef = l ? new oe(l) : void 0, this.SpotRowRef = o ? new ae(o) : void 0, this.ByWindow = a, this.ByAisle = c, this.HasPower = h, this.Centroid = d ? tt.fromXML(d) : void 0, this.Width = f || 0.5, this.Length = y || 0.5;
1603
2398
  }
1604
2399
  toXML() {
1605
2400
  return {
@@ -1607,7 +2402,7 @@ class ce {
1607
2402
  attr_version: this.attr_version,
1608
2403
  Label: this.Label ? { text_value: this.Label } : void 0,
1609
2404
  Orientation: this.Orientation ? { text_value: this.Orientation } : void 0,
1610
- actualVehicleEquipments: this.actualVehicleEquipments ? U(this.actualVehicleEquipments) : void 0,
2405
+ actualVehicleEquipments: this.actualVehicleEquipments ? j(this.actualVehicleEquipments) : void 0,
1611
2406
  SpotColumnRef: this.SpotColumnRef?.toXML(),
1612
2407
  SpotRowRef: this.SpotRowRef?.toXML(),
1613
2408
  ByWindow: this.ByWindow ? { text_value: this.ByWindow } : void 0,
@@ -1619,17 +2414,17 @@ class ce {
1619
2414
  };
1620
2415
  }
1621
2416
  getClasses() {
1622
- const e = [];
1623
- return this.ByWindow && e.push("seat__by-window"), this.ByAisle && e.push("seat__by-aisle"), this.HasPower && e.push("seat__has-power"), this.Orientation && e.push(`seat__orientation-${this.Orientation}`), this.availability && e.push(`seat__availability-${this.availability.toLowerCase()}`), e.join(" ");
2417
+ const t = [];
2418
+ return this.ByWindow && t.push("seat__by-window"), this.ByAisle && t.push("seat__by-aisle"), this.HasPower && t.push("seat__has-power"), this.Orientation && t.push(`seat__orientation-${this.Orientation}`), this.availability && t.push(`seat__availability-${this.availability.toLowerCase()}`), t.join(" ");
1624
2419
  }
1625
- getShape(e) {
2420
+ getShape(t) {
1626
2421
  if (this.Centroid) {
1627
- const s = this.Width * e, n = this.Length * e;
2422
+ const e = this.Width * t, s = this.Length * t;
1628
2423
  return {
1629
- x: (this.Centroid?.x ?? 1) * e - s / 2 + 5,
1630
- y: (this.Centroid?.y ?? 1) * e - n / 2 + 5,
1631
- width: s,
1632
- height: n,
2424
+ x: (this.Centroid?.x ?? 1) * t - e / 2 + 5,
2425
+ y: (this.Centroid?.y ?? 1) * t - s / 2 + 5,
2426
+ width: e,
2427
+ height: s,
1633
2428
  fill: "lightgray",
1634
2429
  stroke: "gray",
1635
2430
  strokeWidth: 1,
@@ -1640,18 +2435,18 @@ class ce {
1640
2435
  return {
1641
2436
  x: 0,
1642
2437
  y: 0,
1643
- width: this.Width * e,
1644
- height: this.Length * e,
2438
+ width: this.Width * t,
2439
+ height: this.Length * t,
1645
2440
  fill: "red",
1646
2441
  draggable: !0
1647
2442
  };
1648
2443
  }
1649
2444
  }
1650
- class gs {
2445
+ class On {
1651
2446
  attr_ref;
1652
2447
  attr_version;
1653
- constructor({ attr_ref: e, attr_version: s }) {
1654
- this.attr_ref = e, this.attr_version = s;
2448
+ constructor({ attr_ref: t, attr_version: e }) {
2449
+ this.attr_ref = t, this.attr_version = e;
1655
2450
  }
1656
2451
  toXML() {
1657
2452
  return {
@@ -1660,20 +2455,20 @@ class gs {
1660
2455
  };
1661
2456
  }
1662
2457
  }
1663
- class Je {
2458
+ class le {
1664
2459
  value;
1665
- constructor(e) {
1666
- this.value = e;
2460
+ constructor(t) {
2461
+ this.value = t;
1667
2462
  }
1668
2463
  toXML() {
1669
2464
  return this.value;
1670
2465
  }
1671
2466
  }
1672
- class ps {
2467
+ class In {
1673
2468
  attr_ref;
1674
2469
  attr_version;
1675
- constructor({ attr_ref: e, attr_version: s }) {
1676
- this.attr_ref = e, this.attr_version = s;
2470
+ constructor({ attr_ref: t, attr_version: e }) {
2471
+ this.attr_ref = t, this.attr_version = e;
1677
2472
  }
1678
2473
  toXML() {
1679
2474
  return {
@@ -1682,7 +2477,7 @@ class ps {
1682
2477
  };
1683
2478
  }
1684
2479
  }
1685
- class W {
2480
+ class B {
1686
2481
  static xmlTagName = "PassengerSpace";
1687
2482
  attr_id;
1688
2483
  attr_version;
@@ -1707,29 +2502,29 @@ class W {
1707
2502
  FareClass;
1708
2503
  AirConditioned;
1709
2504
  constructor({
1710
- attr_id: e,
1711
- attr_version: s,
1712
- Name: n,
1713
- SmokingAllowed: i,
1714
- StandingAllowed: r,
1715
- PassengerSpaceType: o,
1716
- passengerSpots: c,
2505
+ attr_id: t,
2506
+ attr_version: e,
2507
+ Name: s,
2508
+ SmokingAllowed: r,
2509
+ StandingAllowed: i,
2510
+ PassengerSpaceType: l,
2511
+ passengerSpots: o,
1717
2512
  luggageSpots: a,
1718
- deckEntrances: l,
2513
+ deckEntrances: c,
1719
2514
  deckEntranceUsage: h,
1720
2515
  deckEntranceCouples: d,
1721
2516
  deckSpaceCapacities: f,
1722
2517
  actualVehicleEquipments: y,
1723
- ServiceFacilitySetRef: x,
2518
+ ServiceFacilitySetRef: C,
1724
2519
  // spotAffinities,
1725
- Centroid: V,
1726
- Polygon: S,
1727
- PublicUse: F,
1728
- TotalCapacity: B,
1729
- FareClass: de,
1730
- AirConditioned: ie
2520
+ Centroid: E,
2521
+ Polygon: L,
2522
+ PublicUse: X,
2523
+ TotalCapacity: _,
2524
+ FareClass: G,
2525
+ AirConditioned: q
1731
2526
  }) {
1732
- this.attr_id = e, this.attr_version = s, this.Name = n, this.SmokingAllowed = i, this.StandingAllowed = r, this.PassengerSpaceType = o, this.passengerSpots = c ? Object.entries(c).flatMap(([H, b]) => H === "PassengerSpot" ? P(b, ce) : H === "PassengerSpotRef" ? P(b, gs) : []) : [], this.luggageSpots = a ? Object.entries(a).flatMap(([H, b]) => H === "LuggageSpot" ? P(b, hs) : H === "LuggageSpotRef" ? P(b, fs) : []) : [], this.deckEntrances = P(l?.PassengerEntrance, Ke), this.deckEntranceUsage = P(h?.DeckEntranceUsage, ls), this.deckEntranceCouples = P(d?.DeckEntranceCouple, rs), this.deckSpaceCapacities = P(f?.DeckSpaceCapacity, cs), this.actualVehicleEquipments = P(y?.ActualVehicleEquipment, ge), this.ServiceFacilitySetRef = x ? new ps(x) : void 0, this.Centroid = V ? Q.fromXML(V) : void 0, this.Polygon = S ? new Je(S) : void 0, this.PublicUse = F?.text_value, this.TotalCapacity = B?.text_value, this.FareClass = de?.text_value, this.AirConditioned = ie?.text_value;
2527
+ this.attr_id = t, this.attr_version = e, this.Name = s, this.SmokingAllowed = r, this.StandingAllowed = i, this.PassengerSpaceType = l, this.passengerSpots = o ? Object.entries(o).flatMap(([z, v]) => z === "PassengerSpot" ? A(v, ht) : z === "PassengerSpotRef" ? A(v, On) : []) : [], this.luggageSpots = a ? Object.entries(a).flatMap(([z, v]) => z === "LuggageSpot" ? A(v, $n) : z === "LuggageSpotRef" ? A(v, Mn) : []) : [], this.deckEntrances = A(c?.PassengerEntrance, re), this.deckEntranceUsage = A(h?.DeckEntranceUsage, Pn), this.deckEntranceCouples = A(d?.DeckEntranceCouple, kn), this.deckSpaceCapacities = A(f?.DeckSpaceCapacity, Tn), this.actualVehicleEquipments = A(y?.ActualVehicleEquipment, gt), this.ServiceFacilitySetRef = C ? new In(C) : void 0, this.Centroid = E ? tt.fromXML(E) : void 0, this.Polygon = L ? new le(L) : void 0, this.PublicUse = X?.text_value, this.TotalCapacity = _?.text_value, this.FareClass = G?.text_value, this.AirConditioned = q?.text_value;
1733
2528
  }
1734
2529
  toXML() {
1735
2530
  return {
@@ -1739,13 +2534,13 @@ class W {
1739
2534
  SmokingAllowed: this.SmokingAllowed,
1740
2535
  StandingAllowed: this.StandingAllowed,
1741
2536
  PassengerSpaceType: this.PassengerSpaceType,
1742
- passengerSpots: this.passengerSpots ? U(this.passengerSpots) : "",
1743
- luggageSpots: this.luggageSpots ? U(this.luggageSpots) : void 0,
1744
- deckEntrances: this.deckEntrances ? U(this.deckEntrances) : void 0,
1745
- deckEntranceUsage: this.deckEntranceUsage ? U(this.deckEntranceUsage) : void 0,
1746
- deckEntranceCouples: this.deckEntranceCouples ? U(this.deckEntranceCouples) : void 0,
1747
- deckSpaceCapacities: this.deckSpaceCapacities ? U(this.deckSpaceCapacities) : void 0,
1748
- actualVehicleEquipments: this.actualVehicleEquipments ? U(this.actualVehicleEquipments) : void 0,
2537
+ passengerSpots: this.passengerSpots ? j(this.passengerSpots) : "",
2538
+ luggageSpots: this.luggageSpots ? j(this.luggageSpots) : void 0,
2539
+ deckEntrances: this.deckEntrances ? j(this.deckEntrances) : void 0,
2540
+ deckEntranceUsage: this.deckEntranceUsage ? j(this.deckEntranceUsage) : void 0,
2541
+ deckEntranceCouples: this.deckEntranceCouples ? j(this.deckEntranceCouples) : void 0,
2542
+ deckSpaceCapacities: this.deckSpaceCapacities ? j(this.deckSpaceCapacities) : void 0,
2543
+ actualVehicleEquipments: this.actualVehicleEquipments ? j(this.actualVehicleEquipments) : void 0,
1749
2544
  ServiceFacilitySetRef: this.ServiceFacilitySetRef?.toXML(),
1750
2545
  Centroid: this.Centroid?.toXML(),
1751
2546
  Polygon: this.Polygon?.toXML(),
@@ -1756,7 +2551,7 @@ class W {
1756
2551
  };
1757
2552
  }
1758
2553
  }
1759
- class vs {
2554
+ class Vn {
1760
2555
  attr_id;
1761
2556
  attr_version;
1762
2557
  Name;
@@ -1768,26 +2563,26 @@ class vs {
1768
2563
  Width;
1769
2564
  Length;
1770
2565
  constructor({
1771
- attr_id: e,
1772
- attr_version: s,
1773
- deckSpaces: n,
1774
- spotRows: i = void 0,
1775
- spotColumns: r = void 0,
1776
- DeckLevelRef: o = void 0,
1777
- Name: c = void 0,
2566
+ attr_id: t,
2567
+ attr_version: e,
2568
+ deckSpaces: s,
2569
+ spotRows: r = void 0,
2570
+ spotColumns: i = void 0,
2571
+ DeckLevelRef: l = void 0,
2572
+ Name: o = void 0,
1778
2573
  polygon: a = void 0,
1779
- Width: l = void 0,
2574
+ Width: c = void 0,
1780
2575
  Length: h = void 0
1781
2576
  }) {
1782
- this.attr_id = e, this.attr_version = s, this.Name = c ?? "", this.polygon = a ? new Je(a) : void 0, this.DeckLevelRef = o ? new ns(o) : void 0, this.Width = l ?? 2.825, this.Length = h ?? 26.4, this.deckspaces = n ? Object.entries(n).flatMap(([d, f]) => d === "OtherDeckSpace" ? P(f, is) : d === "PassengerSpace" ? P(f, W) : []) : [], this.spotRows = P(i?.SpotRow, us), this.spotColumns = P(r?.SpotColumn, ds);
2577
+ this.attr_id = t, this.attr_version = e, this.Name = o ?? "", this.polygon = a ? new le(a) : void 0, this.DeckLevelRef = l ? new Sn(l) : void 0, this.Width = c ?? 2.825, this.Length = h ?? 26.4, this.deckspaces = s ? Object.entries(s).flatMap(([d, f]) => d === "OtherDeckSpace" ? A(f, xn) : d === "PassengerSpace" ? A(f, B) : []) : [], this.spotRows = A(r?.SpotRow, Ln), this.spotColumns = A(i?.SpotColumn, An);
1783
2578
  }
1784
2579
  toXML() {
1785
2580
  return {
1786
2581
  attr_id: this.attr_id,
1787
2582
  attr_version: this.attr_version,
1788
- spotRows: { SpotRow: K(this.spotRows) },
1789
- spotColumns: { SpotColumn: K(this.spotColumns) },
1790
- deckSpaces: U(this.deckspaces),
2583
+ spotRows: { SpotRow: J(this.spotRows) },
2584
+ spotColumns: { SpotColumn: J(this.spotColumns) },
2585
+ deckSpaces: j(this.deckspaces),
1791
2586
  DeckLevelRef: this.DeckLevelRef?.toXML(),
1792
2587
  polygon: this.polygon?.toXML(),
1793
2588
  Name: this.Name,
@@ -1796,16 +2591,16 @@ class vs {
1796
2591
  };
1797
2592
  }
1798
2593
  getBoundingBox() {
1799
- const e = this.Length, s = this.Width;
1800
- return { width: e, height: s };
2594
+ const t = this.Length, e = this.Width;
2595
+ return { width: t, height: e };
1801
2596
  }
1802
- getShape(e) {
1803
- const { width: s, height: n } = this.getBoundingBox();
2597
+ getShape(t) {
2598
+ const { width: e, height: s } = this.getBoundingBox();
1804
2599
  return {
1805
2600
  x: 5,
1806
2601
  y: 5,
1807
- width: s * e,
1808
- height: n * e,
2602
+ width: e * t,
2603
+ height: s * t,
1809
2604
  fill: "white",
1810
2605
  stroke: "gray",
1811
2606
  strokeWidth: 2,
@@ -1813,29 +2608,29 @@ class vs {
1813
2608
  };
1814
2609
  }
1815
2610
  }
1816
- class De {
2611
+ class ce {
1817
2612
  attr_id;
1818
2613
  attr_version;
1819
2614
  deckLevels;
1820
2615
  decks;
1821
2616
  constructor({
1822
- attr_id: e,
1823
- attr_version: s,
1824
- decks: n = void 0,
1825
- deckLevels: i = void 0
2617
+ attr_id: t,
2618
+ attr_version: e,
2619
+ decks: s = void 0,
2620
+ deckLevels: r = void 0
1826
2621
  }) {
1827
- this.attr_id = e, this.attr_version = s, this.deckLevels = P(i?.DeckLevel, ss), this.decks = P(n?.Deck, vs);
2622
+ this.attr_id = t, this.attr_version = e, this.deckLevels = A(r?.DeckLevel, wn), this.decks = A(s?.Deck, Vn);
1828
2623
  }
1829
2624
  toXML() {
1830
2625
  return {
1831
2626
  attr_id: this.attr_id,
1832
2627
  attr_version: this.attr_version,
1833
- decks: { Deck: K(this.decks) },
1834
- deckLevels: { DeckLevel: K(this.deckLevels) }
2628
+ decks: { Deck: J(this.decks) },
2629
+ deckLevels: { DeckLevel: J(this.deckLevels) }
1835
2630
  };
1836
2631
  }
1837
2632
  }
1838
- const et = /* @__PURE__ */ ne({
2633
+ const he = /* @__PURE__ */ rt({
1839
2634
  __name: "DeckVisualization",
1840
2635
  props: {
1841
2636
  deck: {
@@ -1855,31 +2650,31 @@ const et = /* @__PURE__ */ ne({
1855
2650
  }
1856
2651
  },
1857
2652
  emits: ["select", "area-select"],
1858
- setup(t, { emit: e }) {
1859
- const s = t, n = e, i = $(null), r = $(!1), o = $({ x: 0, y: 0 }), c = $([]), a = $(/* @__PURE__ */ new Map()), l = le(() => s.deck.deckspaces?.flatMap((u) => u instanceof W ? u.passengerSpots?.filter((g) => g instanceof ce) || [] : []).map((u) => {
1860
- const g = u;
1861
- return g.availability = s.availability && u.attr_id ? fe[s.availability[u.attr_id] ?? "Undefined"] : fe.Undefined, g;
1862
- }) || []), h = le(() => s.deck.deckspaces?.flatMap((u) => u instanceof W ? u.deckEntrances || [] : []) || []), d = (u) => s.selectedElements.includes(u) ? {
2653
+ setup(n, { emit: t }) {
2654
+ const e = n, s = t, r = W(null), i = W(!1), l = W({ x: 0, y: 0 }), o = W([]), a = W(/* @__PURE__ */ new Map()), c = ct(() => e.deck.deckspaces?.flatMap((u) => u instanceof B ? u.passengerSpots?.filter((p) => p instanceof ht) || [] : []).map((u) => {
2655
+ const p = u;
2656
+ return p.availability = e.availability && u.attr_id ? pt[e.availability[u.attr_id] ?? "Undefined"] : pt.Undefined, p;
2657
+ }) || []), h = ct(() => e.deck.deckspaces?.flatMap((u) => u instanceof B ? u.deckEntrances || [] : []) || []), d = (u) => e.selectedElements.includes(u) ? {
1863
2658
  stroke: "#68a691",
1864
2659
  strokeWidth: 3
1865
- } : {}, f = (u, g) => {
1866
- let p = 0, E = 0;
1867
- const { width: N, height: I } = u.getBoundingBox();
1868
- return p = Math.max(p, N), E = Math.max(E, I), {
1869
- width: p * g + 10,
1870
- height: E * g + 10
2660
+ } : {}, f = (u, p) => {
2661
+ let g = 0, N = 0;
2662
+ const { width: S, height: O } = u.getBoundingBox();
2663
+ return g = Math.max(g, S), N = Math.max(N, O), {
2664
+ width: g * p + 10,
2665
+ height: N * p + 10
1871
2666
  };
1872
- }, y = (u, g) => {
1873
- r.value || (n("select", { element: g, ctrlKey: u.evt.ctrlKey || u.evt.metaKey }), u.cancelBubble = !0);
1874
- }, x = (u) => {
2667
+ }, y = (u, p) => {
2668
+ i.value || (s("select", { element: p, ctrlKey: u.evt.ctrlKey || u.evt.metaKey }), u.cancelBubble = !0);
2669
+ }, C = (u) => {
1875
2670
  if (u.evt.ctrlKey || u.evt.metaKey || u.target === u.target.getStage()) {
1876
- r.value = !0;
1877
- const p = u.target.getStage().getPointerPosition(), E = u.target.getAbsoluteTransform().copy();
1878
- E.invert();
1879
- const N = E.point(p);
1880
- o.value = { x: N.x, y: N.y }, i.value = {
1881
- x: N.x,
1882
- y: N.y,
2671
+ i.value = !0;
2672
+ const g = u.target.getStage().getPointerPosition(), N = u.target.getAbsoluteTransform().copy();
2673
+ N.invert();
2674
+ const S = N.point(g);
2675
+ l.value = { x: S.x, y: S.y }, r.value = {
2676
+ x: S.x,
2677
+ y: S.y,
1883
2678
  width: 0,
1884
2679
  height: 0,
1885
2680
  fill: "rgba(0, 255, 0, 0.3)",
@@ -1887,170 +2682,170 @@ const et = /* @__PURE__ */ ne({
1887
2682
  strokeWidth: 1
1888
2683
  };
1889
2684
  } else
1890
- n("area-select", []);
1891
- }, V = (u) => {
1892
- if (!r.value) return;
1893
- const p = u.target.getStage().getPointerPosition(), E = u.target.getAbsoluteTransform().copy();
1894
- E.invert();
1895
- const N = E.point(p);
1896
- i.value.width = N.x - o.value.x, i.value.height = N.y - o.value.y;
1897
- }, S = () => {
1898
- if (!r.value) return;
1899
- r.value = !1;
1900
- const u = i.value;
2685
+ s("area-select", []);
2686
+ }, E = (u) => {
2687
+ if (!i.value) return;
2688
+ const g = u.target.getStage().getPointerPosition(), N = u.target.getAbsoluteTransform().copy();
2689
+ N.invert();
2690
+ const S = N.point(g);
2691
+ r.value.width = S.x - l.value.x, r.value.height = S.y - l.value.y;
2692
+ }, L = () => {
2693
+ if (!i.value) return;
2694
+ i.value = !1;
2695
+ const u = r.value;
1901
2696
  if (!u) return;
1902
- const g = u.width > 0 ? u.x : u.x + u.width, p = u.height > 0 ? u.y : u.y + u.height, E = Math.abs(u.width), N = Math.abs(u.height), I = l.value.filter((A) => {
1903
- const C = A.getShape(s.scale);
1904
- return C.x < g + E && C.x + C.width > g && C.y < p + N && C.y + C.height > p;
2697
+ const p = u.width > 0 ? u.x : u.x + u.width, g = u.height > 0 ? u.y : u.y + u.height, N = Math.abs(u.width), S = Math.abs(u.height), O = c.value.filter((M) => {
2698
+ const P = M.getShape(e.scale);
2699
+ return P.x < p + N && P.x + P.width > p && P.y < g + S && P.y + P.height > g;
1905
2700
  });
1906
- I.length > 0 && n("area-select", I), i.value = null;
1907
- }, F = (u, g) => {
1908
- a.value.clear(), s.selectedElements.includes(g) && s.selectedElements.forEach((p) => {
1909
- if (p instanceof ce) {
1910
- const E = p.getShape(s.scale);
1911
- a.value.set(p, { x: E.x, y: E.y });
2701
+ O.length > 0 && s("area-select", O), r.value = null;
2702
+ }, X = (u, p) => {
2703
+ a.value.clear(), e.selectedElements.includes(p) && e.selectedElements.forEach((g) => {
2704
+ if (g instanceof ht) {
2705
+ const N = g.getShape(e.scale);
2706
+ a.value.set(g, { x: N.x, y: N.y });
1912
2707
  }
1913
2708
  });
1914
- }, B = (u, g) => {
1915
- c.value = [];
1916
- const p = u.target.getStage(), E = l.value.filter((_) => _ !== g && !s.selectedElements.includes(_)), N = u.target.x(), I = u.target.y(), A = 10;
1917
- let C = N, v = I;
1918
- E.forEach((_) => {
1919
- const M = _.getShape(s.scale);
1920
- Math.abs(N - M.x) < A && (C = M.x, c.value.push({
1921
- points: [M.x, 0, M.x, p.height()],
2709
+ }, _ = (u, p) => {
2710
+ o.value = [];
2711
+ const g = u.target.getStage(), N = c.value.filter((k) => k !== p && !e.selectedElements.includes(k)), S = u.target.x(), O = u.target.y(), M = 10;
2712
+ let P = S, m = O;
2713
+ N.forEach((k) => {
2714
+ const I = k.getShape(e.scale);
2715
+ Math.abs(S - I.x) < M && (P = I.x, o.value.push({
2716
+ points: [I.x, 0, I.x, g.height()],
1922
2717
  stroke: "red",
1923
2718
  strokeWidth: 1,
1924
2719
  dash: [4, 6]
1925
- })), Math.abs(I - M.y) < A && (v = M.y, c.value.push({
1926
- points: [0, M.y, p.width(), M.y],
2720
+ })), Math.abs(O - I.y) < M && (m = I.y, o.value.push({
2721
+ points: [0, I.y, g.width(), I.y],
1927
2722
  stroke: "red",
1928
2723
  strokeWidth: 1,
1929
2724
  dash: [4, 6]
1930
2725
  }));
1931
- }), u.target.x(C), u.target.y(v);
1932
- const L = a.value.get(g);
1933
- if (L && s.selectedElements.includes(g)) {
1934
- const _ = C - L.x, M = v - L.y;
1935
- s.selectedElements.forEach((Y) => {
1936
- if (Y !== g && Y instanceof ce) {
1937
- const X = a.value.get(Y);
1938
- X && ie(Y, X.x + _, X.y + M);
2726
+ }), u.target.x(P), u.target.y(m);
2727
+ const $ = a.value.get(p);
2728
+ if ($ && e.selectedElements.includes(p)) {
2729
+ const k = P - $.x, I = m - $.y;
2730
+ e.selectedElements.forEach((H) => {
2731
+ if (H !== p && H instanceof ht) {
2732
+ const U = a.value.get(H);
2733
+ U && q(H, U.x + k, U.y + I);
1939
2734
  }
1940
2735
  });
1941
2736
  }
1942
- }, de = (u, g) => {
1943
- c.value = [];
1944
- const p = u.target.x(), E = u.target.y();
1945
- ie(g, p, E), a.value.clear();
1946
- }, ie = (u, g, p) => {
1947
- u.Centroid ? (u.Centroid.x = (g - 5) / s.scale + u.Width / 2, u.Centroid.y = (p - 5) / s.scale + u.Length / 2) : u.Centroid = new Q(
1948
- (g - 5) / s.scale + u.Width / 2,
1949
- (p - 5) / s.scale + u.Length / 2
2737
+ }, G = (u, p) => {
2738
+ o.value = [];
2739
+ const g = u.target.x(), N = u.target.y();
2740
+ q(p, g, N), a.value.clear();
2741
+ }, q = (u, p, g) => {
2742
+ u.Centroid ? (u.Centroid.x = (p - 5) / e.scale + u.Width / 2, u.Centroid.y = (g - 5) / e.scale + u.Length / 2) : u.Centroid = new tt(
2743
+ (p - 5) / e.scale + u.Width / 2,
2744
+ (g - 5) / e.scale + u.Length / 2
1950
2745
  );
1951
- }, H = (u, g) => {
1952
- const p = u.target.x(), E = u.target.y(), N = s.deck.Width * s.scale, I = s.deck.Length * s.scale, A = g.getShape(s.scale, s.deck.Length, s.deck.Width), C = A.width, v = A.height, L = 5, _ = 5, M = L + I, Y = _ + N, X = p + C / 2, xe = E + v / 2, Ce = Math.abs(X - L), Te = Math.abs(X - M), Pe = Math.abs(xe - _), Le = Math.abs(xe - Y), pe = Math.min(Ce, Te, Pe, Le);
1953
- let re = p, oe = E;
1954
- pe === Pe ? (oe = _, re = Math.max(L, Math.min(p, M - C))) : pe === Le ? (oe = Y - v, re = Math.max(L, Math.min(p, M - C))) : pe === Ce ? (re = L, oe = N / 2 + 5 - v / 2) : pe === Te && (re = M - C, oe = N / 2 + 5 - v / 2), u.target.x(re), u.target.y(oe), g.Centroid || (g.Centroid = new Q(0, 0)), g.Centroid.x = re / s.scale, g.Centroid.y = oe / s.scale;
1955
- }, b = (u, g) => {
1956
- const p = u.target.x(), E = u.target.y(), N = s.deck.Width * s.scale, I = s.deck.Length * s.scale, A = g.getShape(s.scale, s.deck.Length, s.deck.Width), C = A.width, v = A.height, L = 5, _ = 5, M = L + I, Y = _ + N, X = 1;
1957
- Math.abs(E - _) < X ? (g.VehicleSide = "leftSide", g.SequenceFromFront = (p - L + C / 2) / s.scale) : Math.abs(E - (Y - v)) < X ? (g.VehicleSide = "rightSide", g.SequenceFromFront = (p - L + C / 2) / s.scale) : Math.abs(p - L) < X ? (g.VehicleSide = "front", g.SequenceFromFront = 0) : Math.abs(p - (M - C)) < X && (g.VehicleSide = "back", g.SequenceFromFront = s.deck.Length);
2746
+ }, z = (u, p) => {
2747
+ const g = u.target.x(), N = u.target.y(), S = e.deck.Width * e.scale, O = e.deck.Length * e.scale, M = p.getShape(e.scale, e.deck.Length, e.deck.Width), P = M.width, m = M.height, $ = 5, k = 5, I = $ + O, H = k + S, U = g + P / 2, At = N + m / 2, Lt = Math.abs(U - $), $t = Math.abs(U - I), Mt = Math.abs(At - k), Ot = Math.abs(At - H), mt = Math.min(Lt, $t, Mt, Ot);
2748
+ let ot = g, at = N;
2749
+ mt === Mt ? (at = k, ot = Math.max($, Math.min(g, I - P))) : mt === Ot ? (at = H - m, ot = Math.max($, Math.min(g, I - P))) : mt === Lt ? (ot = $, at = S / 2 + 5 - m / 2) : mt === $t && (ot = I - P, at = S / 2 + 5 - m / 2), u.target.x(ot), u.target.y(at), p.Centroid || (p.Centroid = new tt(0, 0)), p.Centroid.x = ot / e.scale, p.Centroid.y = at / e.scale;
2750
+ }, v = (u, p) => {
2751
+ const g = u.target.x(), N = u.target.y(), S = e.deck.Width * e.scale, O = e.deck.Length * e.scale, M = p.getShape(e.scale, e.deck.Length, e.deck.Width), P = M.width, m = M.height, $ = 5, k = 5, I = $ + O, H = k + S, U = 1;
2752
+ Math.abs(N - k) < U ? (p.VehicleSide = "leftSide", p.SequenceFromFront = (g - $ + P / 2) / e.scale) : Math.abs(N - (H - m)) < U ? (p.VehicleSide = "rightSide", p.SequenceFromFront = (g - $ + P / 2) / e.scale) : Math.abs(g - $) < U ? (p.VehicleSide = "front", p.SequenceFromFront = 0) : Math.abs(g - (I - P)) < U && (p.VehicleSide = "back", p.SequenceFromFront = e.deck.Length);
1958
2753
  };
1959
- return (u, g) => {
1960
- const p = ae("v-rect"), E = ae("v-text"), N = ae("v-group"), I = ae("v-line"), A = ae("v-layer"), C = ae("v-stage");
1961
- return m(), D(C, {
1962
- config: f(t.deck, t.scale)
2754
+ return (u, p) => {
2755
+ const g = lt("v-rect"), N = lt("v-text"), S = lt("v-group"), O = lt("v-line"), M = lt("v-layer"), P = lt("v-stage");
2756
+ return b(), nt(P, {
2757
+ config: f(n.deck, n.scale)
1963
2758
  }, {
1964
- default: ve(() => [
1965
- G(A, null, {
1966
- default: ve(() => [
1967
- G(p, {
1968
- config: { ...t.deck.getShape(t.scale), y: 5, ...d(t.deck) },
1969
- onClick: g[0] || (g[0] = (v) => y(v, t.deck))
2759
+ default: yt(() => [
2760
+ Y(M, null, {
2761
+ default: yt(() => [
2762
+ Y(g, {
2763
+ config: { ...n.deck.getShape(n.scale), y: 5, ...d(n.deck) },
2764
+ onClick: p[0] || (p[0] = (m) => y(m, n.deck))
1970
2765
  }, null, 8, ["config"]),
1971
- G(p, {
2766
+ Y(g, {
1972
2767
  config: {
1973
2768
  x: 0,
1974
2769
  y: 0,
1975
- width: t.deck.getShape(t.scale).width,
1976
- height: t.deck.getShape(t.scale).height,
2770
+ width: n.deck.getShape(n.scale).width,
2771
+ height: n.deck.getShape(n.scale).height,
1977
2772
  fill: "transparent",
1978
2773
  listening: !0
1979
2774
  },
1980
- onMousedown: x,
1981
- onMousemove: V,
1982
- onMouseup: S
2775
+ onMousedown: C,
2776
+ onMousemove: E,
2777
+ onMouseup: L
1983
2778
  }, null, 8, ["config"]),
1984
- (m(!0), k(z, null, j(l.value, (v, L) => (m(), D(N, {
1985
- key: `seats-${L}`,
2779
+ (b(!0), x(K, null, Z(c.value, (m, $) => (b(), nt(S, {
2780
+ key: `seats-${$}`,
1986
2781
  config: {
1987
- x: v.getShape(t.scale).x,
1988
- y: v.getShape(t.scale).y,
2782
+ x: m.getShape(n.scale).x,
2783
+ y: m.getShape(n.scale).y,
1989
2784
  draggable: !0
1990
2785
  },
1991
- onDragstart: (_) => F(_, v),
1992
- onDragend: (_) => de(_, v),
1993
- onDragmove: (_) => B(_, v),
1994
- onClick: (_) => y(_, v)
2786
+ onDragstart: (k) => X(k, m),
2787
+ onDragend: (k) => G(k, m),
2788
+ onDragmove: (k) => _(k, m),
2789
+ onClick: (k) => y(k, m)
1995
2790
  }, {
1996
- default: ve(() => [
1997
- G(p, {
2791
+ default: yt(() => [
2792
+ Y(g, {
1998
2793
  config: {
1999
- width: v.getShape(t.scale).width,
2000
- height: v.getShape(t.scale).height,
2001
- fill: v.getShape(t.scale).fill,
2002
- stroke: v.getShape(t.scale).stroke,
2003
- strokeWidth: v.getShape(t.scale).strokeWidth,
2004
- cornerRadius: v.getShape(t.scale).cornerRadius,
2005
- ...d(v)
2794
+ width: m.getShape(n.scale).width,
2795
+ height: m.getShape(n.scale).height,
2796
+ fill: m.getShape(n.scale).fill,
2797
+ stroke: m.getShape(n.scale).stroke,
2798
+ strokeWidth: m.getShape(n.scale).strokeWidth,
2799
+ cornerRadius: m.getShape(n.scale).cornerRadius,
2800
+ ...d(m)
2006
2801
  }
2007
2802
  }, null, 8, ["config"]),
2008
- G(E, {
2803
+ Y(N, {
2009
2804
  config: {
2010
- width: v.getShape(t.scale).width,
2011
- height: v.getShape(t.scale).height,
2012
- text: v.Label,
2805
+ width: m.getShape(n.scale).width,
2806
+ height: m.getShape(n.scale).height,
2807
+ text: m.Label,
2013
2808
  align: "center",
2014
2809
  verticalAlign: "middle",
2015
- fontSize: Math.min(Math.min(v.getShape(t.scale).width, v.getShape(t.scale).height) / 2, 16),
2810
+ fontSize: Math.min(Math.min(m.getShape(n.scale).width, m.getShape(n.scale).height) / 2, 16),
2016
2811
  listening: !1
2017
2812
  }
2018
2813
  }, null, 8, ["config"])
2019
2814
  ]),
2020
2815
  _: 2
2021
2816
  }, 1032, ["config", "onDragstart", "onDragend", "onDragmove", "onClick"]))), 128)),
2022
- (m(!0), k(z, null, j(h.value, (v, L) => (m(), D(N, {
2023
- key: `entrance-${L}`,
2817
+ (b(!0), x(K, null, Z(h.value, (m, $) => (b(), nt(S, {
2818
+ key: `entrance-${$}`,
2024
2819
  config: {
2025
- x: v.getShape(t.scale, t.deck.Length, t.deck.Width).x,
2026
- y: v.getShape(t.scale, t.deck.Length, t.deck.Width).y,
2820
+ x: m.getShape(n.scale, n.deck.Length, n.deck.Width).x,
2821
+ y: m.getShape(n.scale, n.deck.Length, n.deck.Width).y,
2027
2822
  draggable: !0
2028
2823
  },
2029
- onDragmove: (_) => H(_, v),
2030
- onDragend: (_) => b(_, v),
2031
- onClick: (_) => y(_, v)
2824
+ onDragmove: (k) => z(k, m),
2825
+ onDragend: (k) => v(k, m),
2826
+ onClick: (k) => y(k, m)
2032
2827
  }, {
2033
- default: ve(() => [
2034
- G(p, {
2828
+ default: yt(() => [
2829
+ Y(g, {
2035
2830
  config: {
2036
- width: v.getShape(t.scale, t.deck.Length, t.deck.Width).width,
2037
- height: v.getShape(t.scale, t.deck.Length, t.deck.Width).height,
2038
- fill: v.getShape(t.scale, t.deck.Length, t.deck.Width).fill,
2039
- stroke: v.getShape(t.scale, t.deck.Length, t.deck.Width).stroke,
2040
- strokeWidth: v.getShape(t.scale, t.deck.Length, t.deck.Width).strokeWidth,
2041
- ...d(v)
2831
+ width: m.getShape(n.scale, n.deck.Length, n.deck.Width).width,
2832
+ height: m.getShape(n.scale, n.deck.Length, n.deck.Width).height,
2833
+ fill: m.getShape(n.scale, n.deck.Length, n.deck.Width).fill,
2834
+ stroke: m.getShape(n.scale, n.deck.Length, n.deck.Width).stroke,
2835
+ strokeWidth: m.getShape(n.scale, n.deck.Length, n.deck.Width).strokeWidth,
2836
+ ...d(m)
2042
2837
  }
2043
2838
  }, null, 8, ["config"])
2044
2839
  ]),
2045
2840
  _: 2
2046
2841
  }, 1032, ["config", "onDragmove", "onDragend", "onClick"]))), 128)),
2047
- i.value ? (m(), D(p, {
2842
+ r.value ? (b(), nt(g, {
2048
2843
  key: 0,
2049
- config: { ...i.value, listening: !1 }
2050
- }, null, 8, ["config"])) : be("", !0),
2051
- (m(!0), k(z, null, j(c.value, (v, L) => (m(), D(I, {
2052
- key: `guide-${L}`,
2053
- config: v
2844
+ config: { ...r.value, listening: !1 }
2845
+ }, null, 8, ["config"])) : vt("", !0),
2846
+ (b(!0), x(K, null, Z(o.value, (m, $) => (b(), nt(O, {
2847
+ key: `guide-${$}`,
2848
+ config: m
2054
2849
  }, null, 8, ["config"]))), 128))
2055
2850
  ]),
2056
2851
  _: 1
@@ -2060,7 +2855,7 @@ const et = /* @__PURE__ */ ne({
2060
2855
  }, 8, ["config"]);
2061
2856
  };
2062
2857
  }
2063
- }), ms = { class: "flex flex-col h-full" }, bs = { class: "flex p-4 w-full items-center justify-center gap-10" }, ys = { for: "scale-slider" }, Es = { style: { display: "flex", "flex-direction": "row", "overflow-x": "auto", gap: "20px", padding: "20px" } }, ws = ["onClick"], tt = /* @__PURE__ */ ne({
2858
+ }), Rn = { class: "flex flex-col h-full" }, Fn = { class: "flex p-4 w-full items-center justify-center gap-10" }, Wn = { for: "scale-slider" }, Xn = { style: { display: "flex", "flex-direction": "row", "overflow-x": "auto", gap: "20px", padding: "20px" } }, Un = ["onClick"], ue = /* @__PURE__ */ rt({
2064
2859
  __name: "WagonVisualization",
2065
2860
  props: {
2066
2861
  deckPlans: {
@@ -2072,51 +2867,51 @@ const et = /* @__PURE__ */ ne({
2072
2867
  default: () => []
2073
2868
  }
2074
2869
  },
2075
- setup(t) {
2076
- const e = $(20);
2077
- return (s, n) => (m(), k("div", ms, [
2078
- w("div", bs, [
2079
- w("label", ys, "Scale: " + Z(e.value), 1),
2080
- me(w("input", {
2870
+ setup(n) {
2871
+ const t = W(20);
2872
+ return (e, s) => (b(), x("div", Rn, [
2873
+ w("div", Fn, [
2874
+ w("label", Wn, "Scale: " + D(t.value), 1),
2875
+ bt(w("input", {
2081
2876
  id: "scale-slider",
2082
2877
  type: "range",
2083
2878
  min: "10",
2084
2879
  max: "50",
2085
- "onUpdate:modelValue": n[0] || (n[0] = (i) => e.value = i)
2880
+ "onUpdate:modelValue": s[0] || (s[0] = (r) => t.value = r)
2086
2881
  }, null, 512), [
2087
2882
  [
2088
- We,
2089
- e.value,
2883
+ Gt,
2884
+ t.value,
2090
2885
  void 0,
2091
2886
  { number: !0 }
2092
2887
  ]
2093
2888
  ])
2094
2889
  ]),
2095
- w("div", Es, [
2096
- (m(!0), k(z, null, j(t.deckPlans, (i, r) => (m(), k("div", {
2097
- key: `deckplan-${r}`
2890
+ w("div", Xn, [
2891
+ (b(!0), x(K, null, Z(n.deckPlans, (r, i) => (b(), x("div", {
2892
+ key: `deckplan-${i}`
2098
2893
  }, [
2099
- w("h3", null, Z(i.attr_id), 1),
2100
- (m(!0), k(z, null, j(i.decks, (o, c) => (m(), k("div", {
2101
- key: `deck-${c}`
2894
+ w("h3", null, D(r.attr_id), 1),
2895
+ (b(!0), x(K, null, Z(r.decks, (l, o) => (b(), x("div", {
2896
+ key: `deck-${o}`
2102
2897
  }, [
2103
2898
  w("h4", {
2104
- onClick: (a) => s.$emit("select", { element: o, ctrlKey: !1 }),
2105
- class: te(`${t.selectedElements.includes(o) ? "text-ott-accent" : ""} cursor-pointer`)
2106
- }, Z(o.Name), 11, ws),
2107
- G(et, {
2108
- deck: o,
2109
- scale: e.value,
2110
- selectedElements: t.selectedElements,
2111
- onSelect: n[1] || (n[1] = (a) => s.$emit("select", a)),
2112
- onAreaSelect: n[2] || (n[2] = (a) => s.$emit("area-select", a))
2899
+ onClick: (a) => e.$emit("select", { element: l, ctrlKey: !1 }),
2900
+ class: st(`${n.selectedElements.includes(l) ? "text-ott-accent" : ""} cursor-pointer`)
2901
+ }, D(l.Name), 11, Un),
2902
+ Y(he, {
2903
+ deck: l,
2904
+ scale: t.value,
2905
+ selectedElements: n.selectedElements,
2906
+ onSelect: s[1] || (s[1] = (a) => e.$emit("select", a)),
2907
+ onAreaSelect: s[2] || (s[2] = (a) => e.$emit("area-select", a))
2113
2908
  }, null, 8, ["deck", "scale", "selectedElements"])
2114
2909
  ]))), 128))
2115
2910
  ]))), 128))
2116
2911
  ])
2117
2912
  ]));
2118
2913
  }
2119
- }), Ss = { class: "bg-ott-bg-primary p-4" }, Ns = { class: "flex justify-between items-center mb-4" }, ks = { key: 0 }, _s = ["for"], xs = ["id", "onUpdate:modelValue", "type"], Cs = ["id", "onUpdate:modelValue"], Ts = { key: 2 }, Ps = ["id", "onUpdate:modelValue"], Ls = { key: 3 }, As = { key: 4 }, Is = { key: 1 }, Ms = /* @__PURE__ */ ne({
2914
+ }), Bn = { class: "bg-ott-bg-primary p-4" }, qn = { class: "flex justify-between items-center mb-4" }, jn = { key: 0 }, Gn = ["for"], zn = ["id", "onUpdate:modelValue", "type"], Hn = ["id", "onUpdate:modelValue"], Yn = { key: 2 }, Kn = ["id", "onUpdate:modelValue"], Zn = { key: 3 }, Jn = { key: 4 }, Qn = { key: 1 }, Dn = /* @__PURE__ */ rt({
2120
2915
  __name: "ObjectProperties",
2121
2916
  props: {
2122
2917
  element: {
@@ -2125,78 +2920,78 @@ const et = /* @__PURE__ */ ne({
2125
2920
  }
2126
2921
  },
2127
2922
  emits: ["delete"],
2128
- setup(t) {
2129
- return (e, s) => (m(), k("div", Ss, [
2130
- w("div", Ns, [
2131
- s[1] || (s[1] = w("h3", { class: "font-bold" }, "Properties", -1)),
2132
- t.element ? (m(), k("button", {
2923
+ setup(n) {
2924
+ return (t, e) => (b(), x("div", Bn, [
2925
+ w("div", qn, [
2926
+ e[1] || (e[1] = w("h3", { class: "font-bold" }, "Properties", -1)),
2927
+ n.element ? (b(), x("button", {
2133
2928
  key: 0,
2134
2929
  class: "ott-button border-ott-error! text-ott-error!",
2135
- onClick: s[0] || (s[0] = (n) => e.$emit("delete", t.element))
2136
- }, " Delete ")) : be("", !0)
2930
+ onClick: e[0] || (e[0] = (s) => t.$emit("delete", n.element))
2931
+ }, " Delete ")) : vt("", !0)
2137
2932
  ]),
2138
- t.element ? (m(), k("div", ks, [
2139
- (m(!0), k(z, null, j(t.element, (n, i) => (m(), k("div", {
2140
- key: i,
2933
+ n.element ? (b(), x("div", jn, [
2934
+ (b(!0), x(K, null, Z(n.element, (s, r) => (b(), x("div", {
2935
+ key: r,
2141
2936
  class: "flex items-center mb-10"
2142
2937
  }, [
2143
2938
  w("label", {
2144
- for: i,
2939
+ for: r,
2145
2940
  class: "min-w-[150px] font-bold"
2146
- }, Z(i), 9, _s),
2147
- typeof n == "string" || typeof n == "number" ? me((m(), k("input", {
2941
+ }, D(r), 9, Gn),
2942
+ typeof s == "string" || typeof s == "number" ? bt((b(), x("input", {
2148
2943
  key: 0,
2149
- id: i,
2150
- "onUpdate:modelValue": (r) => t.element[i] = r,
2151
- type: typeof n == "number" ? "number" : "text"
2152
- }, null, 8, xs)), [
2153
- [st, t.element[i]]
2154
- ]) : typeof n == "boolean" ? me((m(), k("input", {
2944
+ id: r,
2945
+ "onUpdate:modelValue": (i) => n.element[r] = i,
2946
+ type: typeof s == "number" ? "number" : "text"
2947
+ }, null, 8, zn)), [
2948
+ [de, n.element[r]]
2949
+ ]) : typeof s == "boolean" ? bt((b(), x("input", {
2155
2950
  key: 1,
2156
- id: i,
2157
- "onUpdate:modelValue": (r) => t.element[i] = r,
2951
+ id: r,
2952
+ "onUpdate:modelValue": (i) => n.element[r] = i,
2158
2953
  type: "checkbox"
2159
- }, null, 8, Cs)), [
2160
- [nt, t.element[i]]
2161
- ]) : n && typeof n == "object" && n.value !== void 0 ? (m(), k("span", Ts, [
2162
- me(w("input", {
2163
- id: i,
2164
- "onUpdate:modelValue": (r) => n.value = r,
2954
+ }, null, 8, Hn)), [
2955
+ [fe, n.element[r]]
2956
+ ]) : s && typeof s == "object" && s.value !== void 0 ? (b(), x("span", Yn, [
2957
+ bt(w("input", {
2958
+ id: r,
2959
+ "onUpdate:modelValue": (i) => s.value = i,
2165
2960
  type: "text"
2166
- }, null, 8, Ps), [
2167
- [We, n.value]
2961
+ }, null, 8, Kn), [
2962
+ [Gt, s.value]
2168
2963
  ])
2169
- ])) : n && Array.isArray(n) ? (m(), k("span", Ls, Z(n.length) + " elements ", 1)) : (m(), k("span", As, Z(n), 1))
2964
+ ])) : s && Array.isArray(s) ? (b(), x("span", Zn, D(s.length) + " elements ", 1)) : (b(), x("span", Jn, D(s), 1))
2170
2965
  ]))), 128))
2171
- ])) : (m(), k("div", Is, [...s[2] || (s[2] = [
2966
+ ])) : (b(), x("div", Qn, [...e[2] || (e[2] = [
2172
2967
  w("p", null, "Select an element to view properties.", -1)
2173
2968
  ])]))
2174
2969
  ]));
2175
2970
  }
2176
- }), Vs = (t, e) => {
2177
- const s = t.__vccOpts || t;
2178
- for (const [n, i] of e)
2179
- s[n] = i;
2180
- return s;
2181
- }, Rs = /* @__PURE__ */ Vs(Ms, [["__scopeId", "data-v-1987e529"]]), Os = { class: "flex flex-col gap-2 p-4 bg-white flex-1" }, $s = { class: "flex flex-col gap-2" }, Fs = /* @__PURE__ */ ne({
2971
+ }), ts = (n, t) => {
2972
+ const e = n.__vccOpts || n;
2973
+ for (const [s, r] of t)
2974
+ e[s] = r;
2975
+ return e;
2976
+ }, es = /* @__PURE__ */ ts(Dn, [["__scopeId", "data-v-1987e529"]]), ns = { class: "flex flex-col gap-2 p-4 bg-white flex-1" }, ss = { class: "flex flex-col gap-2" }, is = /* @__PURE__ */ rt({
2182
2977
  __name: "ElementCatalog",
2183
2978
  emits: ["add-seat", "add-door"],
2184
- setup(t) {
2185
- return (e, s) => (m(), k("div", Os, [
2186
- s[2] || (s[2] = w("h3", { class: "font-bold mb-2" }, "Catalog", -1)),
2187
- w("div", $s, [
2979
+ setup(n) {
2980
+ return (t, e) => (b(), x("div", ns, [
2981
+ e[2] || (e[2] = w("h3", { class: "font-bold mb-2" }, "Catalog", -1)),
2982
+ w("div", ss, [
2188
2983
  w("button", {
2189
2984
  class: "ott-button w-fit text-left",
2190
- onClick: s[0] || (s[0] = (n) => e.$emit("add-seat"))
2985
+ onClick: e[0] || (e[0] = (s) => t.$emit("add-seat"))
2191
2986
  }, " + Add Seat "),
2192
2987
  w("button", {
2193
2988
  class: "ott-button w-fit text-left",
2194
- onClick: s[1] || (s[1] = (n) => e.$emit("add-door"))
2989
+ onClick: e[1] || (e[1] = (s) => t.$emit("add-door"))
2195
2990
  }, " + Add Door ")
2196
2991
  ])
2197
2992
  ]));
2198
2993
  }
2199
- }), Xs = { class: "h-full overflow-y-auto bg-gray-100 p-4 font-mono text-sm" }, Ws = ["id"], Us = /* @__PURE__ */ ne({
2994
+ }), rs = { class: "h-full overflow-y-auto bg-gray-100 p-4 font-mono text-sm" }, os = ["id"], as = /* @__PURE__ */ rt({
2200
2995
  __name: "XmlViewer",
2201
2996
  props: {
2202
2997
  xml: {
@@ -2208,137 +3003,132 @@ const et = /* @__PURE__ */ ne({
2208
3003
  default: null
2209
3004
  }
2210
3005
  },
2211
- setup(t) {
2212
- const e = t, s = le(() => e.xml.split(`
2213
- `)), n = $(null), i = (o) => n.value ? o >= n.value.start && o <= n.value.end : !1, r = () => {
2214
- if (!e.selectedId) {
2215
- n.value = null;
3006
+ setup(n) {
3007
+ const t = n, e = ct(() => t.xml.split(`
3008
+ `)), s = W(null), r = (l) => s.value ? l >= s.value.start && l <= s.value.end : !1, i = () => {
3009
+ if (!t.selectedId) {
3010
+ s.value = null;
2216
3011
  return;
2217
3012
  }
2218
- const o = s.value.findIndex((a) => a.includes(`id="${e.selectedId}"`));
2219
- if (o === -1) {
2220
- n.value = null;
3013
+ const l = e.value.findIndex((a) => a.includes(`id="${t.selectedId}"`));
3014
+ if (l === -1) {
3015
+ s.value = null;
2221
3016
  return;
2222
3017
  }
2223
- const c = s.value[o];
2224
- if (c) {
2225
- if (c.trim().endsWith("/>"))
2226
- n.value = { start: o, end: o };
3018
+ const o = e.value[l];
3019
+ if (o) {
3020
+ if (o.trim().endsWith("/>"))
3021
+ s.value = { start: l, end: l };
2227
3022
  else {
2228
- const a = c.match(/<(\w+)/);
3023
+ const a = o.match(/<(\w+)/);
2229
3024
  if (a) {
2230
- const l = a[1];
2231
- let h = 1, d = o;
2232
- for (let f = o + 1; f < s.value.length; f++) {
2233
- const y = s.value[f];
2234
- if (y && !y.match(new RegExp(`<${l}.*/>`)) && (y.match(new RegExp(`<${l}`)) ? h++ : y.match(new RegExp(`</${l}>`)) && h--, h === 0)) {
3025
+ const c = a[1];
3026
+ let h = 1, d = l;
3027
+ for (let f = l + 1; f < e.value.length; f++) {
3028
+ const y = e.value[f];
3029
+ if (y && !y.match(new RegExp(`<${c}.*/>`)) && (y.match(new RegExp(`<${c}`)) ? h++ : y.match(new RegExp(`</${c}>`)) && h--, h === 0)) {
2235
3030
  d = f;
2236
3031
  break;
2237
3032
  }
2238
3033
  }
2239
- n.value = { start: o, end: d };
3034
+ s.value = { start: l, end: d };
2240
3035
  } else
2241
- n.value = { start: o, end: o };
3036
+ s.value = { start: l, end: l };
2242
3037
  }
2243
- it(() => {
2244
- document.getElementById(`line-${o}`)?.scrollIntoView({ behavior: "smooth", block: "center" });
3038
+ pe(() => {
3039
+ document.getElementById(`line-${l}`)?.scrollIntoView({ behavior: "smooth", block: "center" });
2245
3040
  });
2246
3041
  }
2247
3042
  };
2248
- return Ue(() => [e.selectedId, e.xml], () => {
2249
- r();
2250
- }, { immediate: !0 }), (o, c) => (m(), k("div", Xs, [
2251
- (m(!0), k(z, null, j(s.value, (a, l) => (m(), k("div", {
2252
- key: l,
2253
- id: `line-${l}`,
2254
- class: te({ "bg-yellow-200": i(l) })
3043
+ return zt(() => [t.selectedId, t.xml], () => {
3044
+ i();
3045
+ }, { immediate: !0 }), (l, o) => (b(), x("div", rs, [
3046
+ (b(!0), x(K, null, Z(e.value, (a, c) => (b(), x("div", {
3047
+ key: c,
3048
+ id: `line-${c}`,
3049
+ class: st({ "bg-yellow-200": r(c) })
2255
3050
  }, [
2256
- w("pre", null, Z(a), 1)
2257
- ], 10, Ws))), 128))
3051
+ w("pre", null, D(a), 1)
3052
+ ], 10, os))), 128))
2258
3053
  ]));
2259
3054
  }
2260
- }), qs = (t) => {
2261
- const s = new _e({
3055
+ }), ls = (n) => {
3056
+ const e = new te({
2262
3057
  ignoreAttributes: !1,
2263
3058
  attributeNamePrefix: "attr_",
3059
+ textNodeName: "text_value",
2264
3060
  removeNSPrefix: !0
2265
- }).parse(t);
2266
- return P(
2267
- s.PublicationDelivery.dataObjects.CompositeFrame.frames.ResourceFrame.deckPlans.DeckPlan,
2268
- De
3061
+ }).parse(n);
3062
+ return A(
3063
+ e.PublicationDelivery.dataObjects.CompositeFrame.frames.ResourceFrame.deckPlans.DeckPlan,
3064
+ ce
2269
3065
  );
2270
- }, Bs = { class: "flex flex-col h-full" }, Hs = { class: "p-4 border-b border-b-ott-bg-dark flex gap-2 items-center bg-ott-bg-primary" }, Ys = { class: "flex-1 flex overflow-hidden" }, Gs = { class: "flex-1 overflow-hidden" }, zs = { class: "flex flex-row h-75 border-t border-ott-bg-dark" }, js = /* @__PURE__ */ ne({
3066
+ }, cs = { class: "flex flex-col h-full" }, hs = { class: "p-4 border-b border-b-ott-bg-dark flex gap-2 items-center bg-ott-bg-primary" }, us = { class: "flex-1 flex overflow-hidden" }, ds = { class: "flex-1 overflow-hidden" }, fs = { class: "flex flex-row h-75 border-t border-ott-bg-dark" }, ps = /* @__PURE__ */ rt({
2271
3067
  __name: "DeckplanEditor",
2272
- setup(t, { expose: e }) {
2273
- const s = $(null), n = $([]), i = $([]), r = $(null), o = $(!1), c = $(""), a = () => {
2274
- if (!o.value || !r.value) return;
2275
- r.value.PublicationDelivery.dataObjects.CompositeFrame.frames.ResourceFrame.deckPlans.DeckPlan = K(n.value);
2276
- const b = new q({
3068
+ setup(n, { expose: t }) {
3069
+ const e = W(null), s = W([]), r = W([]), i = W(null), l = W(!1), o = W(""), a = () => {
3070
+ if (!l.value || !i.value) return;
3071
+ i.value.PublicationDelivery.dataObjects.CompositeFrame.frames.ResourceFrame.deckPlans.DeckPlan = J(s.value);
3072
+ const v = new F({
2277
3073
  ignoreAttributes: !1,
2278
3074
  textNodeName: "text_value",
2279
3075
  attributeNamePrefix: "attr_",
2280
3076
  format: !0
2281
3077
  });
2282
- c.value = b.build(r.value);
2283
- }, l = () => {
2284
- o.value = !o.value, o.value && a();
3078
+ o.value = v.build(i.value);
3079
+ }, c = () => {
3080
+ l.value = !l.value, l.value && a();
2285
3081
  };
2286
- Ue(n, () => {
3082
+ zt(s, () => {
2287
3083
  a();
2288
3084
  }, { deep: !0 });
2289
- const h = ({ element: b, ctrlKey: u }) => {
3085
+ const h = ({ element: v, ctrlKey: u }) => {
2290
3086
  if (u) {
2291
- const g = i.value.indexOf(b);
2292
- if (g > -1)
2293
- i.value.splice(g, 1);
3087
+ const p = r.value.indexOf(v);
3088
+ if (p > -1)
3089
+ r.value.splice(p, 1);
2294
3090
  else {
2295
- if (i.value.length > 0 && i.value[0].constructor !== b.constructor)
3091
+ if (r.value.length > 0 && r.value[0].constructor !== v.constructor)
2296
3092
  return;
2297
- i.value.push(b);
3093
+ r.value.push(v);
2298
3094
  }
2299
3095
  } else
2300
- i.value = [b];
2301
- }, d = (b) => {
2302
- i.value = b;
2303
- }, f = (b) => {
2304
- const u = b.target;
2305
- s.value = u.files ? u.files[0] : null;
3096
+ r.value = [v];
3097
+ }, d = (v) => {
3098
+ r.value = v;
3099
+ }, f = (v) => {
3100
+ const u = v.target;
3101
+ e.value = u.files ? u.files[0] : null;
2306
3102
  };
2307
3103
  function y() {
2308
- if (s.value) {
2309
- const b = new FileReader();
2310
- b.addEventListener("load", (u) => {
2311
- const g = u.target?.result;
2312
- if (typeof g != "string") return;
2313
- const p = new _e({
2314
- ignoreAttributes: !1,
2315
- attributeNamePrefix: "attr_",
2316
- removeNSPrefix: !0
2317
- });
2318
- r.value = p.parse(g), n.value = qs(g), n.value = [...n.value];
2319
- }), b.readAsText(s.value);
3104
+ if (e.value) {
3105
+ const v = new FileReader();
3106
+ v.addEventListener("load", (u) => {
3107
+ const p = u.target?.result;
3108
+ typeof p == "string" && (s.value = ls(p), s.value = [...s.value]);
3109
+ }), v.readAsText(e.value);
2320
3110
  }
2321
3111
  }
2322
- function x() {
2323
- if (s.value) {
2324
- r.value.PublicationDelivery.dataObjects.CompositeFrame.frames.ResourceFrame.deckPlans.DeckPlan = K(n.value);
2325
- const u = new q({
3112
+ function C() {
3113
+ if (e.value) {
3114
+ i.value.PublicationDelivery.dataObjects.CompositeFrame.frames.ResourceFrame.deckPlans.DeckPlan = J(s.value);
3115
+ const u = new F({
2326
3116
  ignoreAttributes: !1,
2327
3117
  textNodeName: "text_value",
2328
3118
  attributeNamePrefix: "attr_"
2329
- }).build(r.value), g = new Blob([u], { type: "text/xml" }), p = document.createElement("a");
2330
- p.href = URL.createObjectURL(g), p.download = "Demo.xml", p.click();
3119
+ }).build(i.value), p = new Blob([u], { type: "text/xml" }), g = document.createElement("a");
3120
+ g.href = URL.createObjectURL(p), g.download = "Demo.xml", g.click();
2331
3121
  }
2332
3122
  }
2333
- const V = () => n.value.length > 0 && n.value[0]?.decks.length && n.value[0]?.decks?.length > 0 ? n.value[0].decks[0] : null, S = () => {
2334
- const b = V();
2335
- if (!b) return;
2336
- const u = b.deckspaces?.find((p) => p instanceof W);
3123
+ const E = () => s.value.length > 0 && s.value[0]?.decks.length && s.value[0]?.decks?.length > 0 ? s.value[0].decks[0] : null, L = () => {
3124
+ const v = E();
3125
+ if (!v) return;
3126
+ const u = v.deckspaces?.find((g) => g instanceof B);
2337
3127
  if (!u) {
2338
3128
  console.warn("No PassengerSpace found to add seat to");
2339
3129
  return;
2340
3130
  }
2341
- const g = new ce({
3131
+ const p = new ht({
2342
3132
  attr_id: `seat_${Date.now()}`,
2343
3133
  attr_version: "1",
2344
3134
  Label: "",
@@ -2354,16 +3144,16 @@ const et = /* @__PURE__ */ ne({
2354
3144
  Width: 0.5,
2355
3145
  Length: 0.5
2356
3146
  });
2357
- u.passengerSpots || (u.passengerSpots = []), u.passengerSpots.push(g);
2358
- }, F = () => {
2359
- const b = V();
2360
- if (!b) return;
2361
- const u = b.deckspaces?.find((p) => p instanceof W);
3147
+ u.passengerSpots || (u.passengerSpots = []), u.passengerSpots.push(p);
3148
+ }, X = () => {
3149
+ const v = E();
3150
+ if (!v) return;
3151
+ const u = v.deckspaces?.find((g) => g instanceof B);
2362
3152
  if (!u) {
2363
3153
  console.warn("No PassengerSpace found to add door to");
2364
3154
  return;
2365
3155
  }
2366
- const g = new Ke({
3156
+ const p = new re({
2367
3157
  attr_id: `door_${Date.now()}`,
2368
3158
  attr_version: "1",
2369
3159
  Name: { text_value: "New Door" },
@@ -2381,35 +3171,35 @@ const et = /* @__PURE__ */ ne({
2381
3171
  IsAutomatic: void 0,
2382
3172
  Centroid: void 0
2383
3173
  });
2384
- u.deckEntrances || (u.deckEntrances = []), u.deckEntrances.push(g);
2385
- }, B = (b) => {
2386
- n.value.forEach((u) => {
2387
- u.decks.forEach((g) => {
2388
- g.deckspaces?.forEach((p) => {
2389
- if (p instanceof W) {
2390
- if (p.passengerSpots) {
2391
- const E = p.passengerSpots.indexOf(b);
2392
- E > -1 && p.passengerSpots.splice(E, 1);
3174
+ u.deckEntrances || (u.deckEntrances = []), u.deckEntrances.push(p);
3175
+ }, _ = (v) => {
3176
+ s.value.forEach((u) => {
3177
+ u.decks.forEach((p) => {
3178
+ p.deckspaces?.forEach((g) => {
3179
+ if (g instanceof B) {
3180
+ if (g.passengerSpots) {
3181
+ const N = g.passengerSpots.indexOf(v);
3182
+ N > -1 && g.passengerSpots.splice(N, 1);
2393
3183
  }
2394
- if (p.deckEntrances) {
2395
- const E = p.deckEntrances.indexOf(b);
2396
- E > -1 && p.deckEntrances.splice(E, 1);
3184
+ if (g.deckEntrances) {
3185
+ const N = g.deckEntrances.indexOf(v);
3186
+ N > -1 && g.deckEntrances.splice(N, 1);
2397
3187
  }
2398
3188
  }
2399
3189
  });
2400
3190
  });
2401
- }), i.value = [];
3191
+ }), r.value = [];
2402
3192
  };
2403
- function de() {
2404
- return r.value ? (r.value.PublicationDelivery.dataObjects.CompositeFrame.frames.ResourceFrame.deckPlans.DeckPlan = K(n.value), new q({
3193
+ function G() {
3194
+ return i.value ? (i.value.PublicationDelivery.dataObjects.CompositeFrame.frames.ResourceFrame.deckPlans.DeckPlan = J(s.value), new F({
2405
3195
  ignoreAttributes: !1,
2406
3196
  textNodeName: "text_value",
2407
3197
  attributeNamePrefix: "attr_",
2408
3198
  format: !0
2409
- }).build(r.value)) : null;
3199
+ }).build(i.value)) : null;
2410
3200
  }
2411
- function ie() {
2412
- return new W({
3201
+ function q() {
3202
+ return new B({
2413
3203
  attr_id: `ps-${Date.now()}`,
2414
3204
  attr_version: "1",
2415
3205
  Name: void 0,
@@ -2448,33 +3238,33 @@ const et = /* @__PURE__ */ ne({
2448
3238
  AirConditioned: void 0
2449
3239
  });
2450
3240
  }
2451
- function H(b) {
2452
- const g = new _e({
3241
+ function z(v) {
3242
+ const p = new te({
2453
3243
  ignoreAttributes: !1,
2454
3244
  attributeNamePrefix: "attr_",
2455
3245
  removeNSPrefix: !0,
2456
3246
  alwaysCreateTextNode: !1
2457
- }).parse(b);
2458
- r.value = g;
2459
- const p = P(g.PublicationDelivery.dataObjects.CompositeFrame.frames.ResourceFrame.deckPlans.DeckPlan, De);
2460
- p.forEach((E) => {
2461
- E.decks.forEach((N) => {
2462
- if (!N.deckspaces || N.deckspaces.length === 0) {
2463
- N.deckspaces = [ie()];
3247
+ }).parse(v);
3248
+ i.value = p;
3249
+ const g = A(p.PublicationDelivery.dataObjects.CompositeFrame.frames.ResourceFrame.deckPlans.DeckPlan, ce);
3250
+ g.forEach((N) => {
3251
+ N.decks.forEach((S) => {
3252
+ if (!S.deckspaces || S.deckspaces.length === 0) {
3253
+ S.deckspaces = [q()];
2464
3254
  return;
2465
3255
  }
2466
- const I = [];
2467
- N.deckspaces.forEach((A) => {
2468
- A instanceof W ? I.push(A) : (A?.passengerSpots || A?.PassengerSpaceType) && I.push(new W(A));
2469
- }), N.deckspaces = I;
3256
+ const O = [];
3257
+ S.deckspaces.forEach((M) => {
3258
+ M instanceof B ? O.push(M) : (M?.passengerSpots || M?.PassengerSpaceType) && O.push(new B(M));
3259
+ }), S.deckspaces = O;
2470
3260
  });
2471
- }), n.value = p;
3261
+ }), s.value = g;
2472
3262
  }
2473
- return e({
2474
- exportXml: de,
2475
- loadXml: H
2476
- }), (b, u) => (m(), k("div", Bs, [
2477
- w("div", Hs, [
3263
+ return t({
3264
+ exportXml: G,
3265
+ loadXml: z
3266
+ }), (v, u) => (b(), x("div", cs, [
3267
+ w("div", hs, [
2478
3268
  w("input", {
2479
3269
  ref: "inputRef",
2480
3270
  class: "ott-button",
@@ -2488,51 +3278,51 @@ const et = /* @__PURE__ */ ne({
2488
3278
  class: "ott-button"
2489
3279
  }, "Load"),
2490
3280
  w("button", {
2491
- onClick: x,
3281
+ onClick: C,
2492
3282
  class: "ott-button"
2493
3283
  }, "Save"),
2494
3284
  w("button", {
2495
- onClick: l,
2496
- class: te(["ott-button", { "bg-ott-accent text-white": o.value }])
3285
+ onClick: c,
3286
+ class: st(["ott-button", { "bg-ott-accent text-white": l.value }])
2497
3287
  }, "XML", 2)
2498
3288
  ]),
2499
- w("div", Ys, [
2500
- w("div", Gs, [
2501
- n.value.length > 0 ? (m(), D(tt, {
3289
+ w("div", us, [
3290
+ w("div", ds, [
3291
+ s.value.length > 0 ? (b(), nt(ue, {
2502
3292
  key: 0,
2503
- deckPlans: n.value,
2504
- selectedElements: i.value,
3293
+ deckPlans: s.value,
3294
+ selectedElements: r.value,
2505
3295
  onSelect: h,
2506
3296
  onAreaSelect: d
2507
- }, null, 8, ["deckPlans", "selectedElements"])) : be("", !0)
3297
+ }, null, 8, ["deckPlans", "selectedElements"])) : vt("", !0)
2508
3298
  ]),
2509
- o.value ? (m(), D(Us, {
3299
+ l.value ? (b(), nt(as, {
2510
3300
  key: 0,
2511
- xml: c.value,
2512
- selectedId: i.value[0]?.attr_id,
3301
+ xml: o.value,
3302
+ selectedId: r.value[0]?.attr_id,
2513
3303
  class: "w-1/3 border-l border-ott-bg-dark"
2514
- }, null, 8, ["xml", "selectedId"])) : be("", !0)
3304
+ }, null, 8, ["xml", "selectedId"])) : vt("", !0)
2515
3305
  ]),
2516
- w("div", zs, [
2517
- G(Rs, {
2518
- element: i.value.length === 1 ? i.value[0] : null,
3306
+ w("div", fs, [
3307
+ Y(es, {
3308
+ element: r.value.length === 1 ? r.value[0] : null,
2519
3309
  class: "flex-1 overflow-y-auto",
2520
- onDelete: B
3310
+ onDelete: _
2521
3311
  }, null, 8, ["element"]),
2522
- G(Fs, {
3312
+ Y(is, {
2523
3313
  class: "w-50 border-l border-ott-bg-dark",
2524
- onAddSeat: S,
2525
- onAddDoor: F
3314
+ onAddSeat: L,
3315
+ onAddDoor: X
2526
3316
  })
2527
3317
  ])
2528
3318
  ]));
2529
3319
  }
2530
- }), Fe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3320
+ }), qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2531
3321
  __proto__: null,
2532
- DeckVisualization: et,
2533
- DeckplanEditor: js,
2534
- WagonVisualization: tt
2535
- }, Symbol.toStringTag, { value: "Module" })), Ks = ["width", "height"], Zs = ["transform"], Qs = ["transform", "onClick"], Js = ["transform"], Ds = ["width", "height"], en = ["x", "width", "height"], tn = ["transform"], sn = ["x", "y", "font-size"], nn = ["transform", "onClick"], rn = ["width", "height"], on = /* @__PURE__ */ ne({
3322
+ DeckVisualization: he,
3323
+ DeckplanEditor: ps,
3324
+ WagonVisualization: ue
3325
+ }, Symbol.toStringTag, { value: "Module" })), gs = ["width", "height"], ms = ["transform"], ys = ["transform", "onClick"], bs = ["transform"], vs = ["width", "height"], Es = ["x", "width", "height"], Ns = ["transform"], ws = ["x", "y", "font-size"], Ss = ["transform", "onClick"], xs = ["width", "height"], ks = /* @__PURE__ */ rt({
2536
3326
  __name: "DeckRendering",
2537
3327
  props: {
2538
3328
  deck: { type: Object, required: !0 },
@@ -2543,120 +3333,120 @@ const et = /* @__PURE__ */ ne({
2543
3333
  vertical: { type: Boolean, default: !1 }
2544
3334
  },
2545
3335
  emits: ["select"],
2546
- setup(t, { emit: e }) {
2547
- const s = t, n = Ae(/* @__PURE__ */ new Map()), i = Ae(/* @__PURE__ */ new Map()), r = e, o = le(() => s.deck.deckspaces?.flatMap((h) => h instanceof W ? h.passengerSpots?.filter((d) => d instanceof ce) || [] : []).map((h) => (h.availability = s.availability && h.attr_id ? fe[s.availability[h.attr_id] ?? "Undefined"] : fe.Undefined, h)) || []), c = le(
2548
- () => s.deck.deckspaces?.flatMap(
2549
- (h) => h instanceof W ? h.deckEntrances ?? [] : []
3336
+ setup(n, { emit: t }) {
3337
+ const e = n, s = It(/* @__PURE__ */ new Map()), r = It(/* @__PURE__ */ new Map()), i = t, l = ct(() => e.deck.deckspaces?.flatMap((h) => h instanceof B ? h.passengerSpots?.filter((d) => d instanceof ht) || [] : []).map((h) => (h.availability = e.availability && h.attr_id ? pt[e.availability[h.attr_id] ?? "Undefined"] : pt.Undefined, h)) || []), o = ct(
3338
+ () => e.deck.deckspaces?.flatMap(
3339
+ (h) => h instanceof B ? h.deckEntrances ?? [] : []
2550
3340
  ) ?? []
2551
- ), a = le(() => {
2552
- const { width: h, height: d } = s.deck.getBoundingBox();
3341
+ ), a = ct(() => {
3342
+ const { width: h, height: d } = e.deck.getBoundingBox();
2553
3343
  return {
2554
- width: h * s.scale + 10,
2555
- height: d * s.scale + 10
3344
+ width: h * e.scale + 10,
3345
+ height: d * e.scale + 10
2556
3346
  };
2557
3347
  });
2558
- function l(h, d) {
2559
- r("select", { element: d, ctrlKey: h.ctrlKey || h.metaKey });
3348
+ function c(h, d) {
3349
+ i("select", { element: d, ctrlKey: h.ctrlKey || h.metaKey });
2560
3350
  }
2561
- return (h, d) => (m(), k("svg", {
2562
- width: t.vertical ? a.value.height : a.value.width,
2563
- height: t.vertical ? a.value.width : a.value.height,
3351
+ return (h, d) => (b(), x("svg", {
3352
+ width: n.vertical ? a.value.height : a.value.width,
3353
+ height: n.vertical ? a.value.width : a.value.height,
2564
3354
  class: "vehicle-frame",
2565
3355
  style: { "user-select": "none" }
2566
3356
  }, [
2567
3357
  w("g", {
2568
- class: te(`${t.vertical ? "vehicle-frame--vertical" : ""}`),
3358
+ class: st(`${n.vertical ? "vehicle-frame--vertical" : ""}`),
2569
3359
  transform: `rotate(
2570
- ${t.vertical ? 90 : 0},
3360
+ ${n.vertical ? 90 : 0},
2571
3361
  ${a.value.height / 2},
2572
3362
  ${a.value.height / 2}
2573
3363
  )`
2574
3364
  }, [
2575
- w("rect", rt({ ...t.deck.getShape(t.scale), y: 5 }, {
2576
- onClick: d[0] || (d[0] = we((f) => l(f, t.deck), ["stop"])),
3365
+ w("rect", ge({ ...n.deck.getShape(n.scale), y: 5 }, {
3366
+ onClick: d[0] || (d[0] = wt((f) => c(f, n.deck), ["stop"])),
2577
3367
  class: "vehicle-deck"
2578
3368
  }), null, 16),
2579
- (m(!0), k(z, null, j(o.value, (f, y) => (m(), k("g", {
3369
+ (b(!0), x(K, null, Z(l.value, (f, y) => (b(), x("g", {
2580
3370
  key: `seat-${y}`,
2581
- transform: `translate(${n.get(f)?.x ?? f.getShape(t.scale).x},
2582
- ${n.get(f)?.y ?? f.getShape(t.scale).y})`,
2583
- onClick: we((x) => l(x, f), ["stop"]),
2584
- class: te(`seat ${f.getClasses()}`)
3371
+ transform: `translate(${s.get(f)?.x ?? f.getShape(n.scale).x},
3372
+ ${s.get(f)?.y ?? f.getShape(n.scale).y})`,
3373
+ onClick: wt((C) => c(C, f), ["stop"]),
3374
+ class: st(`seat ${f.getClasses()}`)
2585
3375
  }, [
2586
3376
  w("g", {
2587
3377
  class: "seat__container",
2588
- transform: `rotate( ${f.Orientation === "forwards" ? 180 : 0}, ${f.getShape(t.scale).width / 2}, ${f.getShape(t.scale).height / 2})`
3378
+ transform: `rotate( ${f.Orientation === "forwards" ? 180 : 0}, ${f.getShape(n.scale).width / 2}, ${f.getShape(n.scale).height / 2})`
2589
3379
  }, [
2590
3380
  w("rect", {
2591
- width: f.getShape(t.scale).width,
2592
- height: f.getShape(t.scale).height,
2593
- class: te("seat__base")
2594
- }, null, 8, Ds),
3381
+ width: f.getShape(n.scale).width,
3382
+ height: f.getShape(n.scale).height,
3383
+ class: st("seat__base")
3384
+ }, null, 8, vs),
2595
3385
  w("rect", {
2596
- x: f.getShape(t.scale).width * 0.9,
3386
+ x: f.getShape(n.scale).width * 0.9,
2597
3387
  y: "0",
2598
- width: f.getShape(t.scale).width * 0.2,
2599
- height: f.getShape(t.scale).height,
3388
+ width: f.getShape(n.scale).width * 0.2,
3389
+ height: f.getShape(n.scale).height,
2600
3390
  rx: "6",
2601
3391
  ry: "6",
2602
- class: te(["seat__backrest", "seat__backrest"]),
3392
+ class: st(["seat__backrest", "seat__backrest"]),
2603
3393
  "pointer-events": "none"
2604
- }, null, 8, en)
2605
- ], 8, Js),
3394
+ }, null, 8, Es)
3395
+ ], 8, bs),
2606
3396
  w("g", {
2607
3397
  class: "seat__text-container",
2608
3398
  transform: `rotate(
2609
- ${t.vertical ? -90 : 0},
2610
- ${f.getShape(t.scale).width / 2},
2611
- ${f.getShape(t.scale).height / 2}
3399
+ ${n.vertical ? -90 : 0},
3400
+ ${f.getShape(n.scale).width / 2},
3401
+ ${f.getShape(n.scale).height / 2}
2612
3402
  )`
2613
3403
  }, [
2614
3404
  w("text", {
2615
- x: f.getShape(t.scale).width / 2,
2616
- y: f.getShape(t.scale).height / 2,
3405
+ x: f.getShape(n.scale).width / 2,
3406
+ y: f.getShape(n.scale).height / 2,
2617
3407
  "text-anchor": "middle",
2618
3408
  "dominant-baseline": "middle",
2619
3409
  class: "seat__text",
2620
3410
  "font-size": Math.max(
2621
- Math.min(f.getShape(t.scale).width, f.getShape(t.scale).height) / 3,
3411
+ Math.min(f.getShape(n.scale).width, f.getShape(n.scale).height) / 3,
2622
3412
  10
2623
3413
  ),
2624
3414
  "pointer-events": "none"
2625
- }, Z(f.Label), 9, sn)
2626
- ], 8, tn)
2627
- ], 10, Qs))), 128)),
2628
- (m(!0), k(z, null, j(c.value, (f, y) => (m(), k("g", {
3415
+ }, D(f.Label), 9, ws)
3416
+ ], 8, Ns)
3417
+ ], 10, ys))), 128)),
3418
+ (b(!0), x(K, null, Z(o.value, (f, y) => (b(), x("g", {
2629
3419
  key: `entrance-${y}`,
2630
- transform: `translate(${i.get(f)?.x ?? f.getShape(t.scale, t.deck.Length, t.deck.Width).x},
2631
- ${i.get(f)?.y ?? f.getShape(t.scale, t.deck.Length, t.deck.Width).y})`,
2632
- onClick: we((x) => l(x, f), ["stop"])
3420
+ transform: `translate(${r.get(f)?.x ?? f.getShape(n.scale, n.deck.Length, n.deck.Width).x},
3421
+ ${r.get(f)?.y ?? f.getShape(n.scale, n.deck.Length, n.deck.Width).y})`,
3422
+ onClick: wt((C) => c(C, f), ["stop"])
2633
3423
  }, [
2634
3424
  w("rect", {
2635
- width: f.getShape(t.scale, t.deck.Length, t.deck.Width).width,
2636
- height: f.getShape(t.scale, t.deck.Length, t.deck.Width).height,
3425
+ width: f.getShape(n.scale, n.deck.Length, n.deck.Width).width,
3426
+ height: f.getShape(n.scale, n.deck.Length, n.deck.Width).height,
2637
3427
  class: "door"
2638
- }, null, 8, rn)
2639
- ], 8, nn))), 128))
2640
- ], 10, Zs)
2641
- ], 8, Ks));
3428
+ }, null, 8, xs)
3429
+ ], 8, Ss))), 128))
3430
+ ], 10, ms)
3431
+ ], 8, gs));
2642
3432
  }
2643
- }), Xe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3433
+ }), jt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2644
3434
  __proto__: null,
2645
- DeckplanRenderer: on
3435
+ DeckplanRenderer: ks
2646
3436
  }, Symbol.toStringTag, { value: "Module" }));
2647
- function an(t) {
2648
- for (const e in Fe)
2649
- t.component(e, Fe[e]);
2650
- for (const e in Xe)
2651
- t.component(e, Xe[e]);
3437
+ function Cs(n) {
3438
+ for (const t in qt)
3439
+ n.component(t, qt[t]);
3440
+ for (const t in jt)
3441
+ n.component(t, jt[t]);
2652
3442
  }
2653
- const cn = { install: an };
3443
+ const Ps = { install: Cs };
2654
3444
  export {
2655
- et as DeckVisualization,
2656
- js as DeckplanEditor,
2657
- on as DeckplanRenderer,
2658
- fe as PassengerSpotAvailability,
2659
- tt as WagonVisualization,
2660
- cn as default,
2661
- qs as parseNeTEx
3445
+ he as DeckVisualization,
3446
+ ps as DeckplanEditor,
3447
+ ks as DeckplanRenderer,
3448
+ pt as PassengerSpotAvailability,
3449
+ ue as WagonVisualization,
3450
+ Ps as default,
3451
+ ls as parseNeTEx
2662
3452
  };