lakutata 2.0.81 → 2.0.83

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.
Files changed (234) hide show
  1. package/com/docker.cjs +1 -1
  2. package/com/docker.mjs +1 -1
  3. package/decorator/orm.cjs +84 -84
  4. package/decorator/orm.mjs +42 -128
  5. package/orm.cjs +873 -1410
  6. package/orm.mjs +708 -1458
  7. package/package.json +1 -1
  8. package/src/components/cacher/adapters/CreateFileCacheAdapter.cjs +230 -239
  9. package/src/components/cacher/adapters/CreateFileCacheAdapter.mjs +230 -239
  10. package/src/components/docker/ConnectionOptionsBuilder.cjs +1 -1
  11. package/src/components/docker/ConnectionOptionsBuilder.mjs +1 -1
  12. package/src/components/docker/Docker.cjs +4919 -4808
  13. package/src/components/docker/Docker.mjs +4939 -4828
  14. package/src/components/docker/lib/DockerContainer.cjs +1 -1
  15. package/src/components/docker/lib/DockerContainer.mjs +1 -1
  16. package/src/components/docker/lib/DockerContainerTTY.cjs +1 -1
  17. package/src/components/docker/lib/DockerContainerTTY.mjs +1 -1
  18. package/src/components/entrypoint/Entrypoint.cjs +1669 -2159
  19. package/src/components/entrypoint/Entrypoint.mjs +1629 -2119
  20. package/src/decorators/orm/AfterInsert.cjs +26 -4
  21. package/src/decorators/orm/AfterInsert.mjs +25 -5
  22. package/src/decorators/orm/AfterLoad.cjs +26 -4
  23. package/src/decorators/orm/AfterLoad.mjs +25 -5
  24. package/src/decorators/orm/AfterRecover.cjs +26 -4
  25. package/src/decorators/orm/AfterRecover.mjs +25 -5
  26. package/src/decorators/orm/AfterRemove.cjs +26 -4
  27. package/src/decorators/orm/AfterRemove.mjs +25 -5
  28. package/src/decorators/orm/AfterSoftRemove.cjs +26 -4
  29. package/src/decorators/orm/AfterSoftRemove.mjs +25 -5
  30. package/src/decorators/orm/AfterUpdate.cjs +26 -4
  31. package/src/decorators/orm/AfterUpdate.mjs +25 -5
  32. package/src/decorators/orm/BeforeInsert.cjs +26 -4
  33. package/src/decorators/orm/BeforeInsert.mjs +25 -5
  34. package/src/decorators/orm/BeforeRecover.cjs +26 -4
  35. package/src/decorators/orm/BeforeRecover.mjs +25 -5
  36. package/src/decorators/orm/BeforeRemove.cjs +26 -4
  37. package/src/decorators/orm/BeforeRemove.mjs +25 -5
  38. package/src/decorators/orm/BeforeSoftRemove.cjs +26 -4
  39. package/src/decorators/orm/BeforeSoftRemove.mjs +25 -5
  40. package/src/decorators/orm/BeforeUpdate.cjs +26 -4
  41. package/src/decorators/orm/BeforeUpdate.mjs +25 -5
  42. package/src/decorators/orm/Check.cjs +29 -4
  43. package/src/decorators/orm/Check.mjs +28 -5
  44. package/src/decorators/orm/ChildEntity.cjs +29 -4
  45. package/src/decorators/orm/ChildEntity.mjs +28 -5
  46. package/src/decorators/orm/Column.cjs +61 -4
  47. package/src/decorators/orm/Column.mjs +61 -6
  48. package/src/decorators/orm/CreateDateColumn.cjs +25 -4
  49. package/src/decorators/orm/CreateDateColumn.mjs +24 -5
  50. package/src/decorators/orm/DeleteDateColumn.cjs +25 -4
  51. package/src/decorators/orm/DeleteDateColumn.mjs +23 -4
  52. package/src/decorators/orm/Entity.cjs +35 -4
  53. package/src/decorators/orm/Entity.mjs +33 -4
  54. package/src/decorators/orm/EventSubscriber.cjs +22 -4
  55. package/src/decorators/orm/EventSubscriber.mjs +21 -5
  56. package/src/decorators/orm/Exclusion.cjs +29 -4
  57. package/src/decorators/orm/Exclusion.mjs +28 -5
  58. package/src/decorators/orm/Generated.cjs +24 -4
  59. package/src/decorators/orm/Generated.mjs +23 -5
  60. package/src/decorators/orm/Index.cjs +41 -4
  61. package/src/decorators/orm/Index.mjs +41 -6
  62. package/src/decorators/orm/JoinColumn.cjs +29 -4
  63. package/src/decorators/orm/JoinColumn.mjs +28 -5
  64. package/src/decorators/orm/JoinTable.cjs +30 -4
  65. package/src/decorators/orm/JoinTable.mjs +28 -4
  66. package/src/decorators/orm/ManyToMany.cjs +42 -4
  67. package/src/decorators/orm/ManyToMany.mjs +40 -4
  68. package/src/decorators/orm/ManyToOne.cjs +42 -4
  69. package/src/decorators/orm/ManyToOne.mjs +40 -4
  70. package/src/decorators/orm/ObjectIdColumn.cjs +28 -4
  71. package/src/decorators/orm/ObjectIdColumn.mjs +27 -5
  72. package/src/decorators/orm/OneToMany.cjs +34 -4
  73. package/src/decorators/orm/OneToMany.mjs +34 -6
  74. package/src/decorators/orm/OneToOne.cjs +42 -4
  75. package/src/decorators/orm/OneToOne.mjs +40 -4
  76. package/src/decorators/orm/PrimaryColumn.cjs +49 -4
  77. package/src/decorators/orm/PrimaryColumn.mjs +49 -6
  78. package/src/decorators/orm/PrimaryGeneratedColumn.cjs +54 -4
  79. package/src/decorators/orm/PrimaryGeneratedColumn.mjs +54 -6
  80. package/src/decorators/orm/RelationId.cjs +26 -4
  81. package/src/decorators/orm/RelationId.mjs +25 -5
  82. package/src/decorators/orm/TableInheritance.cjs +26 -4
  83. package/src/decorators/orm/TableInheritance.mjs +25 -5
  84. package/src/decorators/orm/Tree.cjs +24 -4
  85. package/src/decorators/orm/Tree.mjs +23 -5
  86. package/src/decorators/orm/TreeChildren.cjs +31 -4
  87. package/src/decorators/orm/TreeChildren.mjs +29 -4
  88. package/src/decorators/orm/TreeLevelColumn.cjs +25 -4
  89. package/src/decorators/orm/TreeLevelColumn.mjs +23 -4
  90. package/src/decorators/orm/TreeParent.cjs +31 -4
  91. package/src/decorators/orm/TreeParent.mjs +29 -4
  92. package/src/decorators/orm/Unique.cjs +44 -4
  93. package/src/decorators/orm/Unique.mjs +44 -6
  94. package/src/decorators/orm/UpdateDateColumn.cjs +25 -4
  95. package/src/decorators/orm/UpdateDateColumn.mjs +24 -5
  96. package/src/decorators/orm/VersionColumn.cjs +25 -4
  97. package/src/decorators/orm/VersionColumn.mjs +24 -5
  98. package/src/decorators/orm/ViewColumn.cjs +25 -4
  99. package/src/decorators/orm/ViewColumn.mjs +24 -5
  100. package/src/decorators/orm/ViewEntity.cjs +34 -4
  101. package/src/decorators/orm/ViewEntity.mjs +33 -5
  102. package/src/decorators/orm/VirtualColumn.cjs +42 -4
  103. package/src/decorators/orm/VirtualColumn.mjs +40 -4
  104. package/src/lib/base/EventEmitter.cjs +1193 -1200
  105. package/src/lib/base/EventEmitter.mjs +1194 -1201
  106. package/src/lib/base/internal/DataValidator.cjs +185 -174
  107. package/src/lib/base/internal/DataValidator.mjs +186 -175
  108. package/src/lib/base/internal/PatternManager.cjs +735 -740
  109. package/src/lib/base/internal/PatternManager.mjs +740 -745
  110. package/src/lib/core/Application.cjs +99 -112
  111. package/src/lib/core/Application.mjs +127 -140
  112. package/src/lib/helpers/IsHtml.cjs +13 -7
  113. package/src/lib/helpers/IsHtml.mjs +13 -7
  114. package/src/lib/helpers/IsXML.cjs +1016 -1158
  115. package/src/lib/helpers/IsXML.mjs +729 -871
  116. package/src/lib/helpers/ObjectHash.cjs +371 -378
  117. package/src/lib/helpers/ObjectHash.mjs +371 -378
  118. package/src/lib/helpers/RandomString.cjs +146 -167
  119. package/src/lib/helpers/RandomString.mjs +145 -166
  120. package/src/lib/helpers/URLBuilder.cjs +355 -355
  121. package/src/lib/helpers/URLBuilder.mjs +350 -350
  122. package/src/lib/ioc/ListModules.cjs +5237 -5160
  123. package/src/lib/ioc/ListModules.mjs +5252 -5175
  124. package/src/lib/validation/VLD.cjs +3903 -4080
  125. package/src/lib/validation/VLD.mjs +2793 -2970
  126. package/src/providers/migration/GenerateMigration.cjs +2 -2
  127. package/src/providers/migration/GenerateMigration.mjs +2 -2
  128. package/vendor/Package.112.cjs +38321 -38240
  129. package/vendor/Package.112.mjs +37720 -37579
  130. package/vendor/Package.16.cjs +7386 -7268
  131. package/vendor/Package.16.mjs +6706 -6588
  132. package/vendor/Package.18.cjs +48229 -20
  133. package/vendor/Package.18.mjs +48192 -24
  134. package/vendor/Package.2.cjs +5698 -5727
  135. package/vendor/Package.2.mjs +5707 -5736
  136. package/vendor/Package.4.cjs +874 -884
  137. package/vendor/Package.4.mjs +874 -884
  138. package/vendor/Package.5.cjs +11 -15
  139. package/vendor/Package.5.mjs +7 -11
  140. package/vendor/Package.6.cjs +511 -520
  141. package/vendor/Package.6.mjs +534 -543
  142. package/vendor/Package.62.cjs +87 -90
  143. package/vendor/Package.62.mjs +180 -183
  144. package/vendor/Package.65.cjs +1285 -1292
  145. package/vendor/Package.65.mjs +190 -197
  146. package/vendor/Package.68.cjs +111 -252
  147. package/vendor/Package.68.mjs +134 -268
  148. package/vendor/Package.9.cjs +118 -132
  149. package/vendor/Package.9.mjs +124 -138
  150. package/vendor/TypeDef.internal.3.d.ts +0 -14
  151. package/vendor/Package.19.cjs +0 -37
  152. package/vendor/Package.19.mjs +0 -35
  153. package/vendor/Package.20.cjs +0 -37
  154. package/vendor/Package.20.mjs +0 -35
  155. package/vendor/Package.21.cjs +0 -37
  156. package/vendor/Package.21.mjs +0 -35
  157. package/vendor/Package.22.cjs +0 -37
  158. package/vendor/Package.22.mjs +0 -35
  159. package/vendor/Package.23.cjs +0 -37
  160. package/vendor/Package.23.mjs +0 -35
  161. package/vendor/Package.24.cjs +0 -37
  162. package/vendor/Package.24.mjs +0 -35
  163. package/vendor/Package.25.cjs +0 -37
  164. package/vendor/Package.25.mjs +0 -35
  165. package/vendor/Package.26.cjs +0 -37
  166. package/vendor/Package.26.mjs +0 -35
  167. package/vendor/Package.27.cjs +0 -37
  168. package/vendor/Package.27.mjs +0 -35
  169. package/vendor/Package.28.cjs +0 -37
  170. package/vendor/Package.28.mjs +0 -35
  171. package/vendor/Package.29.cjs +0 -40
  172. package/vendor/Package.29.mjs +0 -38
  173. package/vendor/Package.30.cjs +0 -41
  174. package/vendor/Package.30.mjs +0 -39
  175. package/vendor/Package.31.cjs +0 -72
  176. package/vendor/Package.31.mjs +0 -70
  177. package/vendor/Package.32.cjs +0 -37
  178. package/vendor/Package.32.mjs +0 -35
  179. package/vendor/Package.33.cjs +0 -37
  180. package/vendor/Package.33.mjs +0 -35
  181. package/vendor/Package.34.cjs +0 -46
  182. package/vendor/Package.34.mjs +0 -44
  183. package/vendor/Package.35.cjs +0 -34
  184. package/vendor/Package.35.mjs +0 -32
  185. package/vendor/Package.36.cjs +0 -40
  186. package/vendor/Package.36.mjs +0 -38
  187. package/vendor/Package.37.cjs +0 -36
  188. package/vendor/Package.37.mjs +0 -34
  189. package/vendor/Package.38.cjs +0 -52
  190. package/vendor/Package.38.mjs +0 -50
  191. package/vendor/Package.39.cjs +0 -41
  192. package/vendor/Package.39.mjs +0 -39
  193. package/vendor/Package.40.cjs +0 -42
  194. package/vendor/Package.40.mjs +0 -40
  195. package/vendor/Package.41.cjs +0 -53
  196. package/vendor/Package.41.mjs +0 -51
  197. package/vendor/Package.42.cjs +0 -53
  198. package/vendor/Package.42.mjs +0 -51
  199. package/vendor/Package.43.cjs +0 -40
  200. package/vendor/Package.43.mjs +0 -38
  201. package/vendor/Package.44.cjs +0 -46
  202. package/vendor/Package.44.mjs +0 -44
  203. package/vendor/Package.45.cjs +0 -53
  204. package/vendor/Package.45.mjs +0 -51
  205. package/vendor/Package.46.cjs +0 -59
  206. package/vendor/Package.46.mjs +0 -57
  207. package/vendor/Package.47.cjs +0 -65
  208. package/vendor/Package.47.mjs +0 -63
  209. package/vendor/Package.48.cjs +0 -38
  210. package/vendor/Package.48.mjs +0 -36
  211. package/vendor/Package.49.cjs +0 -38
  212. package/vendor/Package.49.mjs +0 -36
  213. package/vendor/Package.50.cjs +0 -36
  214. package/vendor/Package.50.mjs +0 -34
  215. package/vendor/Package.51.cjs +0 -43
  216. package/vendor/Package.51.mjs +0 -41
  217. package/vendor/Package.52.cjs +0 -37
  218. package/vendor/Package.52.mjs +0 -35
  219. package/vendor/Package.53.cjs +0 -43
  220. package/vendor/Package.53.mjs +0 -41
  221. package/vendor/Package.54.cjs +0 -55
  222. package/vendor/Package.54.mjs +0 -53
  223. package/vendor/Package.55.cjs +0 -37
  224. package/vendor/Package.55.mjs +0 -35
  225. package/vendor/Package.56.cjs +0 -37
  226. package/vendor/Package.56.mjs +0 -35
  227. package/vendor/Package.57.cjs +0 -37
  228. package/vendor/Package.57.mjs +0 -35
  229. package/vendor/Package.58.cjs +0 -45
  230. package/vendor/Package.58.mjs +0 -43
  231. package/vendor/Package.59.cjs +0 -53
  232. package/vendor/Package.59.mjs +0 -51
  233. package/vendor/Package.60.cjs +0 -47649
  234. package/vendor/Package.60.mjs +0 -47606
@@ -4,383 +4,390 @@ Object.defineProperty(exports, Symbol.toStringTag, {
4
4
  value: "Module"
5
5
  });
6
6
 
7
- "use strict";
8
-
9
- const e = ":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";
10
-
11
- const t = e + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
12
-
13
- const i = "[" + e + "][" + t + "]*";
14
-
15
- const n = new RegExp("^" + i + "$");
16
-
17
- function s(e, t) {
18
- const i = [];
19
- let n = t.exec(e);
20
- while (n) {
21
- const s = [];
22
- s.startIndex = t.lastIndex - n[0].length;
23
- const r = n.length;
24
- for (let e = 0; e < r; e++) {
25
- s.push(n[e]);
7
+ const t = require("../../../vendor/Package.5.cjs");
8
+
9
+ var e = {};
10
+
11
+ var n = {};
12
+
13
+ (function(t) {
14
+ "use strict";
15
+ const e = ":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";
16
+ const n = e + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
17
+ const s = "[" + e + "][" + n + "]*";
18
+ const i = new RegExp("^" + s + "$");
19
+ const r = function(t, e) {
20
+ const n = [];
21
+ let s = e.exec(t);
22
+ while (s) {
23
+ const i = [];
24
+ i.startIndex = e.lastIndex - s[0].length;
25
+ const r = s.length;
26
+ for (let t = 0; t < r; t++) {
27
+ i.push(s[t]);
28
+ }
29
+ n.push(i);
30
+ s = e.exec(t);
26
31
  }
27
- i.push(s);
28
- n = t.exec(e);
29
- }
30
- return i;
31
- }
32
-
33
- const r = function(e) {
34
- const t = n.exec(e);
35
- return !(t === null || typeof t === "undefined");
36
- };
37
-
38
- function o(e) {
39
- return typeof e !== "undefined";
40
- }
41
-
42
- function a(e) {
43
- return Object.keys(e).length === 0;
44
- }
45
-
46
- function l(e, t, i) {
47
- if (t) {
48
- const n = Object.keys(t);
49
- const s = n.length;
50
- for (let r = 0; r < s; r++) {
51
- if (i === "strict") {
52
- e[n[r]] = [ t[n[r]] ];
53
- } else {
54
- e[n[r]] = t[n[r]];
32
+ return n;
33
+ };
34
+ const o = function(t) {
35
+ const e = i.exec(t);
36
+ return !(e === null || typeof e === "undefined");
37
+ };
38
+ t.isExist = function(t) {
39
+ return typeof t !== "undefined";
40
+ };
41
+ t.isEmptyObject = function(t) {
42
+ return Object.keys(t).length === 0;
43
+ };
44
+ t.merge = function(t, e, n) {
45
+ if (e) {
46
+ const s = Object.keys(e);
47
+ const i = s.length;
48
+ for (let r = 0; r < i; r++) {
49
+ if (n === "strict") {
50
+ t[s[r]] = [ e[s[r]] ];
51
+ } else {
52
+ t[s[r]] = e[s[r]];
53
+ }
55
54
  }
56
55
  }
57
- }
58
- }
56
+ };
57
+ t.getValue = function(e) {
58
+ if (t.isExist(e)) {
59
+ return e;
60
+ } else {
61
+ return "";
62
+ }
63
+ };
64
+ t.isName = o;
65
+ t.getAllMatches = r;
66
+ t.nameRegexp = s;
67
+ })(n);
59
68
 
60
- function u(e) {
61
- if (exports.isExist(e)) {
62
- return e;
63
- } else {
64
- return "";
65
- }
66
- }
69
+ const s = t.getDefaultExportFromCjs(n);
67
70
 
68
71
  "use strict";
69
72
 
70
- const f = {
73
+ const i = n;
74
+
75
+ const r = {
71
76
  allowBooleanAttributes: false,
72
77
  unpairedTags: []
73
78
  };
74
79
 
75
- function d(e, t) {
76
- t = Object.assign({}, f, t);
77
- const i = [];
78
- let n = false;
80
+ var o = e.validate = function(t, e) {
81
+ e = Object.assign({}, r, e);
82
+ const n = [];
79
83
  let s = false;
80
- if (e[0] === "\ufeff") {
81
- e = e.substr(1);
84
+ let i = false;
85
+ if (t[0] === "\ufeff") {
86
+ t = t.substr(1);
82
87
  }
83
- for (let r = 0; r < e.length; r++) {
84
- if (e[r] === "<" && e[r + 1] === "?") {
88
+ for (let r = 0; r < t.length; r++) {
89
+ if (t[r] === "<" && t[r + 1] === "?") {
85
90
  r += 2;
86
- r = c(e, r);
91
+ r = l(t, r);
87
92
  if (r.err) return r;
88
- } else if (e[r] === "<") {
93
+ } else if (t[r] === "<") {
89
94
  let o = r;
90
95
  r++;
91
- if (e[r] === "!") {
92
- r = p(e, r);
96
+ if (t[r] === "!") {
97
+ r = u(t, r);
93
98
  continue;
94
99
  } else {
95
- let a = false;
96
- if (e[r] === "/") {
97
- a = true;
100
+ let f = false;
101
+ if (t[r] === "/") {
102
+ f = true;
98
103
  r++;
99
104
  }
100
- let l = "";
101
- for (;r < e.length && e[r] !== ">" && e[r] !== " " && e[r] !== "\t" && e[r] !== "\n" && e[r] !== "\r"; r++) {
102
- l += e[r];
105
+ let c = "";
106
+ for (;r < t.length && t[r] !== ">" && t[r] !== " " && t[r] !== "\t" && t[r] !== "\n" && t[r] !== "\r"; r++) {
107
+ c += t[r];
103
108
  }
104
- l = l.trim();
105
- if (l[l.length - 1] === "/") {
106
- l = l.substring(0, l.length - 1);
109
+ c = c.trim();
110
+ if (c[c.length - 1] === "/") {
111
+ c = c.substring(0, c.length - 1);
107
112
  r--;
108
113
  }
109
- if (!I(l)) {
110
- let t;
111
- if (l.trim().length === 0) {
112
- t = "Invalid space after '<'.";
114
+ if (!b(c)) {
115
+ let e;
116
+ if (c.trim().length === 0) {
117
+ e = "Invalid space after '<'.";
113
118
  } else {
114
- t = "Tag '" + l + "' is an invalid name.";
119
+ e = "Tag '" + c + "' is an invalid name.";
115
120
  }
116
- return T("InvalidTag", t, v(e, r));
121
+ return x("InvalidTag", e, E(t, r));
117
122
  }
118
- const u = x(e, r);
119
- if (u === false) {
120
- return T("InvalidAttr", "Attributes for '" + l + "' have open quote.", v(e, r));
123
+ const d = h(t, r);
124
+ if (d === false) {
125
+ return x("InvalidAttr", "Attributes for '" + c + "' have open quote.", E(t, r));
121
126
  }
122
- let f = u.value;
123
- r = u.index;
124
- if (f[f.length - 1] === "/") {
125
- const i = r - f.length;
126
- f = f.substring(0, f.length - 1);
127
- const s = b(f, t);
128
- if (s === true) {
129
- n = true;
127
+ let g = d.value;
128
+ r = d.index;
129
+ if (g[g.length - 1] === "/") {
130
+ const n = r - g.length;
131
+ g = g.substring(0, g.length - 1);
132
+ const i = p(g, e);
133
+ if (i === true) {
134
+ s = true;
130
135
  } else {
131
- return T(s.err.code, s.err.msg, v(e, i + s.err.line));
136
+ return x(i.err.code, i.err.msg, E(t, n + i.err.line));
132
137
  }
133
- } else if (a) {
134
- if (!u.tagClosed) {
135
- return T("InvalidTag", "Closing tag '" + l + "' doesn't have proper closing.", v(e, r));
136
- } else if (f.trim().length > 0) {
137
- return T("InvalidTag", "Closing tag '" + l + "' can't have attributes or invalid starting.", v(e, o));
138
- } else if (i.length === 0) {
139
- return T("InvalidTag", "Closing tag '" + l + "' has not been opened.", v(e, o));
138
+ } else if (f) {
139
+ if (!d.tagClosed) {
140
+ return x("InvalidTag", "Closing tag '" + c + "' doesn't have proper closing.", E(t, r));
141
+ } else if (g.trim().length > 0) {
142
+ return x("InvalidTag", "Closing tag '" + c + "' can't have attributes or invalid starting.", E(t, o));
143
+ } else if (n.length === 0) {
144
+ return x("InvalidTag", "Closing tag '" + c + "' has not been opened.", E(t, o));
140
145
  } else {
141
- const t = i.pop();
142
- if (l !== t.tagName) {
143
- let i = v(e, t.tagStartPos);
144
- return T("InvalidTag", "Expected closing tag '" + t.tagName + "' (opened in line " + i.line + ", col " + i.col + ") instead of closing tag '" + l + "'.", v(e, o));
146
+ const e = n.pop();
147
+ if (c !== e.tagName) {
148
+ let n = E(t, e.tagStartPos);
149
+ return x("InvalidTag", "Expected closing tag '" + e.tagName + "' (opened in line " + n.line + ", col " + n.col + ") instead of closing tag '" + c + "'.", E(t, o));
145
150
  }
146
- if (i.length == 0) {
147
- s = true;
151
+ if (n.length == 0) {
152
+ i = true;
148
153
  }
149
154
  }
150
155
  } else {
151
- const a = b(f, t);
156
+ const a = p(g, e);
152
157
  if (a !== true) {
153
- return T(a.err.code, a.err.msg, v(e, r - f.length + a.err.line));
158
+ return x(a.err.code, a.err.msg, E(t, r - g.length + a.err.line));
154
159
  }
155
- if (s === true) {
156
- return T("InvalidXml", "Multiple possible root nodes found.", v(e, r));
157
- } else if (t.unpairedTags.indexOf(l) !== -1) {} else {
158
- i.push({
159
- tagName: l,
160
+ if (i === true) {
161
+ return x("InvalidXml", "Multiple possible root nodes found.", E(t, r));
162
+ } else if (e.unpairedTags.indexOf(c) !== -1) {} else {
163
+ n.push({
164
+ tagName: c,
160
165
  tagStartPos: o
161
166
  });
162
167
  }
163
- n = true;
168
+ s = true;
164
169
  }
165
- for (r++; r < e.length; r++) {
166
- if (e[r] === "<") {
167
- if (e[r + 1] === "!") {
170
+ for (r++; r < t.length; r++) {
171
+ if (t[r] === "<") {
172
+ if (t[r + 1] === "!") {
168
173
  r++;
169
- r = p(e, r);
174
+ r = u(t, r);
170
175
  continue;
171
- } else if (e[r + 1] === "?") {
172
- r = c(e, ++r);
176
+ } else if (t[r + 1] === "?") {
177
+ r = l(t, ++r);
173
178
  if (r.err) return r;
174
179
  } else {
175
180
  break;
176
181
  }
177
- } else if (e[r] === "&") {
178
- const t = w(e, r);
179
- if (t == -1) return T("InvalidChar", "char '&' is not expected.", v(e, r));
180
- r = t;
182
+ } else if (t[r] === "&") {
183
+ const e = m(t, r);
184
+ if (e == -1) return x("InvalidChar", "char '&' is not expected.", E(t, r));
185
+ r = e;
181
186
  } else {
182
- if (s === true && !h(e[r])) {
183
- return T("InvalidXml", "Extra text at the end", v(e, r));
187
+ if (i === true && !a(t[r])) {
188
+ return x("InvalidXml", "Extra text at the end", E(t, r));
184
189
  }
185
190
  }
186
191
  }
187
- if (e[r] === "<") {
192
+ if (t[r] === "<") {
188
193
  r--;
189
194
  }
190
195
  }
191
196
  } else {
192
- if (h(e[r])) {
197
+ if (a(t[r])) {
193
198
  continue;
194
199
  }
195
- return T("InvalidChar", "char '" + e[r] + "' is not expected.", v(e, r));
200
+ return x("InvalidChar", "char '" + t[r] + "' is not expected.", E(t, r));
196
201
  }
197
202
  }
198
- if (!n) {
199
- return T("InvalidXml", "Start tag expected.", 1);
200
- } else if (i.length == 1) {
201
- return T("InvalidTag", "Unclosed tag '" + i[0].tagName + "'.", v(e, i[0].tagStartPos));
202
- } else if (i.length > 0) {
203
- return T("InvalidXml", "Invalid '" + JSON.stringify(i.map((e => e.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", {
203
+ if (!s) {
204
+ return x("InvalidXml", "Start tag expected.", 1);
205
+ } else if (n.length == 1) {
206
+ return x("InvalidTag", "Unclosed tag '" + n[0].tagName + "'.", E(t, n[0].tagStartPos));
207
+ } else if (n.length > 0) {
208
+ return x("InvalidXml", "Invalid '" + JSON.stringify(n.map((t => t.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", {
204
209
  line: 1,
205
210
  col: 1
206
211
  });
207
212
  }
208
213
  return true;
209
- }
214
+ };
210
215
 
211
- function h(e) {
212
- return e === " " || e === "\t" || e === "\n" || e === "\r";
216
+ function a(t) {
217
+ return t === " " || t === "\t" || t === "\n" || t === "\r";
213
218
  }
214
219
 
215
- function c(e, t) {
216
- const i = t;
217
- for (;t < e.length; t++) {
218
- if (e[t] == "?" || e[t] == " ") {
219
- const n = e.substr(i, t - i);
220
- if (t > 5 && n === "xml") {
221
- return T("InvalidXml", "XML declaration allowed only at the start of the document.", v(e, t));
222
- } else if (e[t] == "?" && e[t + 1] == ">") {
223
- t++;
220
+ function l(t, e) {
221
+ const n = e;
222
+ for (;e < t.length; e++) {
223
+ if (t[e] == "?" || t[e] == " ") {
224
+ const s = t.substr(n, e - n);
225
+ if (e > 5 && s === "xml") {
226
+ return x("InvalidXml", "XML declaration allowed only at the start of the document.", E(t, e));
227
+ } else if (t[e] == "?" && t[e + 1] == ">") {
228
+ e++;
224
229
  break;
225
230
  } else {
226
231
  continue;
227
232
  }
228
233
  }
229
234
  }
230
- return t;
235
+ return e;
231
236
  }
232
237
 
233
- function p(e, t) {
234
- if (e.length > t + 5 && e[t + 1] === "-" && e[t + 2] === "-") {
235
- for (t += 3; t < e.length; t++) {
236
- if (e[t] === "-" && e[t + 1] === "-" && e[t + 2] === ">") {
237
- t += 2;
238
+ function u(t, e) {
239
+ if (t.length > e + 5 && t[e + 1] === "-" && t[e + 2] === "-") {
240
+ for (e += 3; e < t.length; e++) {
241
+ if (t[e] === "-" && t[e + 1] === "-" && t[e + 2] === ">") {
242
+ e += 2;
238
243
  break;
239
244
  }
240
245
  }
241
- } else if (e.length > t + 8 && e[t + 1] === "D" && e[t + 2] === "O" && e[t + 3] === "C" && e[t + 4] === "T" && e[t + 5] === "Y" && e[t + 6] === "P" && e[t + 7] === "E") {
242
- let i = 1;
243
- for (t += 8; t < e.length; t++) {
244
- if (e[t] === "<") {
245
- i++;
246
- } else if (e[t] === ">") {
247
- i--;
248
- if (i === 0) {
246
+ } 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") {
247
+ let n = 1;
248
+ for (e += 8; e < t.length; e++) {
249
+ if (t[e] === "<") {
250
+ n++;
251
+ } else if (t[e] === ">") {
252
+ n--;
253
+ if (n === 0) {
249
254
  break;
250
255
  }
251
256
  }
252
257
  }
253
- } else if (e.length > t + 9 && e[t + 1] === "[" && e[t + 2] === "C" && e[t + 3] === "D" && e[t + 4] === "A" && e[t + 5] === "T" && e[t + 6] === "A" && e[t + 7] === "[") {
254
- for (t += 8; t < e.length; t++) {
255
- if (e[t] === "]" && e[t + 1] === "]" && e[t + 2] === ">") {
256
- t += 2;
258
+ } 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] === "[") {
259
+ for (e += 8; e < t.length; e++) {
260
+ if (t[e] === "]" && t[e + 1] === "]" && t[e + 2] === ">") {
261
+ e += 2;
257
262
  break;
258
263
  }
259
264
  }
260
265
  }
261
- return t;
266
+ return e;
262
267
  }
263
268
 
264
- const g = '"';
269
+ const f = '"';
265
270
 
266
- const m = "'";
271
+ const c = "'";
267
272
 
268
- function x(e, t) {
269
- let i = "";
273
+ function h(t, e) {
270
274
  let n = "";
271
- let s = false;
272
- for (;t < e.length; t++) {
273
- if (e[t] === g || e[t] === m) {
274
- if (n === "") {
275
- n = e[t];
276
- } else if (n !== e[t]) {} else {
277
- n = "";
275
+ let s = "";
276
+ let i = false;
277
+ for (;e < t.length; e++) {
278
+ if (t[e] === f || t[e] === c) {
279
+ if (s === "") {
280
+ s = t[e];
281
+ } else if (s !== t[e]) {} else {
282
+ s = "";
278
283
  }
279
- } else if (e[t] === ">") {
280
- if (n === "") {
281
- s = true;
284
+ } else if (t[e] === ">") {
285
+ if (s === "") {
286
+ i = true;
282
287
  break;
283
288
  }
284
289
  }
285
- i += e[t];
290
+ n += t[e];
286
291
  }
287
- if (n !== "") {
292
+ if (s !== "") {
288
293
  return false;
289
294
  }
290
295
  return {
291
- value: i,
292
- index: t,
293
- tagClosed: s
296
+ value: n,
297
+ index: e,
298
+ tagClosed: i
294
299
  };
295
300
  }
296
301
 
297
- const N = new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?", "g");
302
+ const d = new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?", "g");
298
303
 
299
- function b(e, t) {
300
- const i = s(e, N);
301
- const n = {};
302
- for (let e = 0; e < i.length; e++) {
303
- if (i[e][1].length === 0) {
304
- return T("InvalidAttr", "Attribute '" + i[e][2] + "' has no space in starting.", O(i[e]));
305
- } else if (i[e][3] !== undefined && i[e][4] === undefined) {
306
- return T("InvalidAttr", "Attribute '" + i[e][2] + "' is without value.", O(i[e]));
307
- } else if (i[e][3] === undefined && !t.allowBooleanAttributes) {
308
- return T("InvalidAttr", "boolean attribute '" + i[e][2] + "' is not allowed.", O(i[e]));
309
- }
310
- const s = i[e][2];
311
- if (!y(s)) {
312
- return T("InvalidAttr", "Attribute '" + s + "' is an invalid name.", O(i[e]));
313
- }
314
- if (!n.hasOwnProperty(s)) {
315
- n[s] = 1;
304
+ function p(t, e) {
305
+ const n = i.getAllMatches(t, d);
306
+ const s = {};
307
+ for (let t = 0; t < n.length; t++) {
308
+ if (n[t][1].length === 0) {
309
+ return x("InvalidAttr", "Attribute '" + n[t][2] + "' has no space in starting.", v(n[t]));
310
+ } else if (n[t][3] !== undefined && n[t][4] === undefined) {
311
+ return x("InvalidAttr", "Attribute '" + n[t][2] + "' is without value.", v(n[t]));
312
+ } else if (n[t][3] === undefined && !e.allowBooleanAttributes) {
313
+ return x("InvalidAttr", "boolean attribute '" + n[t][2] + "' is not allowed.", v(n[t]));
314
+ }
315
+ const i = n[t][2];
316
+ if (!N(i)) {
317
+ return x("InvalidAttr", "Attribute '" + i + "' is an invalid name.", v(n[t]));
318
+ }
319
+ if (!s.hasOwnProperty(i)) {
320
+ s[i] = 1;
316
321
  } else {
317
- return T("InvalidAttr", "Attribute '" + s + "' is repeated.", O(i[e]));
322
+ return x("InvalidAttr", "Attribute '" + i + "' is repeated.", v(n[t]));
318
323
  }
319
324
  }
320
325
  return true;
321
326
  }
322
327
 
323
- function E(e, t) {
324
- let i = /\d/;
325
- if (e[t] === "x") {
326
- t++;
327
- i = /[\da-fA-F]/;
328
+ function g(t, e) {
329
+ let n = /\d/;
330
+ if (t[e] === "x") {
331
+ e++;
332
+ n = /[\da-fA-F]/;
328
333
  }
329
- for (;t < e.length; t++) {
330
- if (e[t] === ";") return t;
331
- if (!e[t].match(i)) break;
334
+ for (;e < t.length; e++) {
335
+ if (t[e] === ";") return e;
336
+ if (!t[e].match(n)) break;
332
337
  }
333
338
  return -1;
334
339
  }
335
340
 
336
- function w(e, t) {
337
- t++;
338
- if (e[t] === ";") return -1;
339
- if (e[t] === "#") {
340
- t++;
341
- return E(e, t);
342
- }
343
- let i = 0;
344
- for (;t < e.length; t++, i++) {
345
- if (e[t].match(/\w/) && i < 20) continue;
346
- if (e[t] === ";") break;
341
+ function m(t, e) {
342
+ e++;
343
+ if (t[e] === ";") return -1;
344
+ if (t[e] === "#") {
345
+ e++;
346
+ return g(t, e);
347
+ }
348
+ let n = 0;
349
+ for (;e < t.length; e++, n++) {
350
+ if (t[e].match(/\w/) && n < 20) continue;
351
+ if (t[e] === ";") break;
347
352
  return -1;
348
353
  }
349
- return t;
354
+ return e;
350
355
  }
351
356
 
352
- function T(e, t, i) {
357
+ function x(t, e, n) {
353
358
  return {
354
359
  err: {
355
- code: e,
356
- msg: t,
357
- line: i.line || i,
358
- col: i.col
360
+ code: t,
361
+ msg: e,
362
+ line: n.line || n,
363
+ col: n.col
359
364
  }
360
365
  };
361
366
  }
362
367
 
363
- function y(e) {
364
- return r(e);
368
+ function N(t) {
369
+ return i.isName(t);
365
370
  }
366
371
 
367
- function I(e) {
368
- return r(e);
372
+ function b(t) {
373
+ return i.isName(t);
369
374
  }
370
375
 
371
- function v(e, t) {
372
- const i = e.substring(0, t).split(/\r?\n/);
376
+ function E(t, e) {
377
+ const n = t.substring(0, e).split(/\r?\n/);
373
378
  return {
374
- line: i.length,
375
- col: i[i.length - 1].length + 1
379
+ line: n.length,
380
+ col: n[n.length - 1].length + 1
376
381
  };
377
382
  }
378
383
 
379
- function O(e) {
380
- return e.startIndex + e[1].length;
384
+ function v(t) {
385
+ return t.startIndex + t[1].length;
381
386
  }
382
387
 
383
- const P = {
388
+ var y = {};
389
+
390
+ const T = {
384
391
  preserveOrder: false,
385
392
  attributeNamePrefix: "@_",
386
393
  attributesGroupName: false,
@@ -397,11 +404,11 @@ const P = {
397
404
  leadingZeros: true,
398
405
  eNotation: true
399
406
  },
400
- tagValueProcessor: function(e, t) {
401
- return t;
407
+ tagValueProcessor: function(t, e) {
408
+ return e;
402
409
  },
403
- attributeValueProcessor: function(e, t) {
404
- return t;
410
+ attributeValueProcessor: function(t, e) {
411
+ return e;
405
412
  },
406
413
  stopNodes: [],
407
414
  alwaysCreateTextNode: false,
@@ -414,421 +421,237 @@ const P = {
414
421
  ignorePiTags: false,
415
422
  transformTagName: false,
416
423
  transformAttributeName: false,
417
- updateTag: function(e, t, i) {
418
- return e;
419
- },
420
- captureMetaData: false
424
+ updateTag: function(t, e, n) {
425
+ return t;
426
+ }
421
427
  };
422
428
 
423
- const A = function(e) {
424
- return Object.assign({}, P, e);
429
+ const O = function(t) {
430
+ return Object.assign({}, T, t);
425
431
  };
426
432
 
427
- "use strict";
433
+ var P = y.buildOptions = O;
428
434
 
429
- let S;
435
+ var w = y.defaultOptions = T;
430
436
 
431
- if (typeof Symbol !== "function") {
432
- S = "@@xmlMetadata";
433
- } else {
434
- S = Symbol("XML Node Metadata");
435
- }
437
+ "use strict";
436
438
 
437
439
  class XmlNode {
438
- constructor(e) {
439
- this.tagname = e;
440
+ constructor(t) {
441
+ this.tagname = t;
440
442
  this.child = [];
441
443
  this[":@"] = {};
442
444
  }
443
- add(e, t) {
444
- if (e === "__proto__") e = "#__proto__";
445
+ add(t, e) {
446
+ if (t === "__proto__") t = "#__proto__";
445
447
  this.child.push({
446
- [e]: t
448
+ [t]: e
447
449
  });
448
450
  }
449
- addChild(e, t) {
450
- if (e.tagname === "__proto__") e.tagname = "#__proto__";
451
- if (e[":@"] && Object.keys(e[":@"]).length > 0) {
451
+ addChild(t) {
452
+ if (t.tagname === "__proto__") t.tagname = "#__proto__";
453
+ if (t[":@"] && Object.keys(t[":@"]).length > 0) {
452
454
  this.child.push({
453
- [e.tagname]: e.child,
454
- [":@"]: e[":@"]
455
+ [t.tagname]: t.child,
456
+ [":@"]: t[":@"]
455
457
  });
456
458
  } else {
457
459
  this.child.push({
458
- [e.tagname]: e.child
460
+ [t.tagname]: t.child
459
461
  });
460
462
  }
461
- if (t !== undefined) {
462
- this.child[this.child.length - 1][S] = {
463
- startIndex: t
464
- };
465
- }
466
- }
467
- static getMetaDataSymbol() {
468
- return S;
469
463
  }
470
464
  }
471
465
 
472
- class DocTypeReader {
473
- constructor(e) {
474
- this.suppressValidationErr = !e;
475
- }
476
- readDocType(e, t) {
477
- const i = {};
478
- if (e[t + 3] === "O" && e[t + 4] === "C" && e[t + 5] === "T" && e[t + 6] === "Y" && e[t + 7] === "P" && e[t + 8] === "E") {
479
- t = t + 9;
480
- let n = 1;
481
- let s = false, r = false;
482
- let o = "";
483
- for (;t < e.length; t++) {
484
- if (e[t] === "<" && !r) {
485
- if (s && V(e, "!ENTITY", t)) {
486
- t += 7;
487
- let n, s;
488
- [n, s, t] = this.readEntityExp(e, t + 1, this.suppressValidationErr);
489
- if (s.indexOf("&") === -1) i[n] = {
490
- regx: RegExp(`&${n};`, "g"),
491
- val: s
492
- };
493
- } else if (s && V(e, "!ELEMENT", t)) {
494
- t += 8;
495
- const {index: i} = this.readElementExp(e, t + 1);
496
- t = i;
497
- } else if (s && V(e, "!ATTLIST", t)) {
498
- t += 8;
499
- } else if (s && V(e, "!NOTATION", t)) {
500
- t += 9;
501
- const {index: i} = this.readNotationExp(e, t + 1, this.suppressValidationErr);
502
- t = i;
503
- } else if (V(e, "!--", t)) r = true; else throw new Error(`Invalid DOCTYPE`);
504
- n++;
505
- o = "";
506
- } else if (e[t] === ">") {
507
- if (r) {
508
- if (e[t - 1] === "-" && e[t - 2] === "-") {
509
- r = false;
510
- n--;
511
- }
512
- } else {
513
- n--;
514
- }
515
- if (n === 0) {
516
- break;
466
+ var A = XmlNode;
467
+
468
+ const C = t.getDefaultExportFromCjs(A);
469
+
470
+ const I = n;
471
+
472
+ function j(t, e) {
473
+ const n = {};
474
+ 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") {
475
+ e = e + 9;
476
+ let s = 1;
477
+ let i = false, r = false;
478
+ let o = "";
479
+ for (;e < t.length; e++) {
480
+ if (t[e] === "<" && !r) {
481
+ if (i && D(t, e)) {
482
+ e += 7;
483
+ let s, i;
484
+ [s, i, e] = S(t, e + 1);
485
+ if (i.indexOf("&") === -1) n[_(s)] = {
486
+ regx: RegExp(`&${s};`, "g"),
487
+ val: i
488
+ };
489
+ } else if (i && V(t, e)) e += 8; else if (i && k(t, e)) e += 8; else if (i && $(t, e)) e += 9; else if (F) r = true; else throw new Error("Invalid DOCTYPE");
490
+ s++;
491
+ o = "";
492
+ } else if (t[e] === ">") {
493
+ if (r) {
494
+ if (t[e - 1] === "-" && t[e - 2] === "-") {
495
+ r = false;
496
+ s--;
517
497
  }
518
- } else if (e[t] === "[") {
519
- s = true;
520
498
  } else {
521
- o += e[t];
522
- }
523
- }
524
- if (n !== 0) {
525
- throw new Error(`Unclosed DOCTYPE`);
526
- }
527
- } else {
528
- throw new Error(`Invalid Tag instead of DOCTYPE`);
529
- }
530
- return {
531
- entities: i,
532
- i: t
533
- };
534
- }
535
- readEntityExp(e, t) {
536
- t = C(e, t);
537
- let i = "";
538
- while (t < e.length && !/\s/.test(e[t]) && e[t] !== '"' && e[t] !== "'") {
539
- i += e[t];
540
- t++;
541
- }
542
- D(i);
543
- t = C(e, t);
544
- if (!this.suppressValidationErr) {
545
- if (e.substring(t, t + 6).toUpperCase() === "SYSTEM") {
546
- throw new Error("External entities are not supported");
547
- } else if (e[t] === "%") {
548
- throw new Error("Parameter entities are not supported");
549
- }
550
- }
551
- let n = "";
552
- [t, n] = this.readIdentifierVal(e, t, "entity");
553
- t--;
554
- return [ i, n, t ];
555
- }
556
- readNotationExp(e, t) {
557
- t = C(e, t);
558
- let i = "";
559
- while (t < e.length && !/\s/.test(e[t])) {
560
- i += e[t];
561
- t++;
562
- }
563
- !this.suppressValidationErr && D(i);
564
- t = C(e, t);
565
- const n = e.substring(t, t + 6).toUpperCase();
566
- if (!this.suppressValidationErr && n !== "SYSTEM" && n !== "PUBLIC") {
567
- throw new Error(`Expected SYSTEM or PUBLIC, found "${n}"`);
568
- }
569
- t += n.length;
570
- t = C(e, t);
571
- let s = null;
572
- let r = null;
573
- if (n === "PUBLIC") {
574
- [t, s] = this.readIdentifierVal(e, t, "publicIdentifier");
575
- t = C(e, t);
576
- if (e[t] === '"' || e[t] === "'") {
577
- [t, r] = this.readIdentifierVal(e, t, "systemIdentifier");
578
- }
579
- } else if (n === "SYSTEM") {
580
- [t, r] = this.readIdentifierVal(e, t, "systemIdentifier");
581
- if (!this.suppressValidationErr && !r) {
582
- throw new Error("Missing mandatory system identifier for SYSTEM notation");
583
- }
584
- }
585
- return {
586
- notationName: i,
587
- publicIdentifier: s,
588
- systemIdentifier: r,
589
- index: --t
590
- };
591
- }
592
- readIdentifierVal(e, t, i) {
593
- let n = "";
594
- const s = e[t];
595
- if (s !== '"' && s !== "'") {
596
- throw new Error(`Expected quoted string, found "${s}"`);
597
- }
598
- t++;
599
- while (t < e.length && e[t] !== s) {
600
- n += e[t];
601
- t++;
602
- }
603
- if (e[t] !== s) {
604
- throw new Error(`Unterminated ${i} value`);
605
- }
606
- t++;
607
- return [ t, n ];
608
- }
609
- readElementExp(e, t) {
610
- t = C(e, t);
611
- let i = "";
612
- while (t < e.length && !/\s/.test(e[t])) {
613
- i += e[t];
614
- t++;
615
- }
616
- if (!this.suppressValidationErr && !r(i)) {
617
- throw new Error(`Invalid element name: "${i}"`);
618
- }
619
- t = C(e, t);
620
- let n = "";
621
- if (e[t] === "E" && V(e, "MPTY", t)) t += 4; else if (e[t] === "A" && V(e, "NY", t)) t += 2; else if (e[t] === "(") {
622
- t++;
623
- while (t < e.length && e[t] !== ")") {
624
- n += e[t];
625
- t++;
626
- }
627
- if (e[t] !== ")") {
628
- throw new Error("Unterminated content model");
629
- }
630
- } else if (!this.suppressValidationErr) {
631
- throw new Error(`Invalid Element Expression, found "${e[t]}"`);
632
- }
633
- return {
634
- elementName: i,
635
- contentModel: n.trim(),
636
- index: t
637
- };
638
- }
639
- readAttlistExp(e, t) {
640
- t = C(e, t);
641
- let i = "";
642
- while (t < e.length && !/\s/.test(e[t])) {
643
- i += e[t];
644
- t++;
645
- }
646
- D(i);
647
- t = C(e, t);
648
- let n = "";
649
- while (t < e.length && !/\s/.test(e[t])) {
650
- n += e[t];
651
- t++;
652
- }
653
- if (!D(n)) {
654
- throw new Error(`Invalid attribute name: "${n}"`);
655
- }
656
- t = C(e, t);
657
- let s = "";
658
- if (e.substring(t, t + 8).toUpperCase() === "NOTATION") {
659
- s = "NOTATION";
660
- t += 8;
661
- t = C(e, t);
662
- if (e[t] !== "(") {
663
- throw new Error(`Expected '(', found "${e[t]}"`);
664
- }
665
- t++;
666
- let i = [];
667
- while (t < e.length && e[t] !== ")") {
668
- let n = "";
669
- while (t < e.length && e[t] !== "|" && e[t] !== ")") {
670
- n += e[t];
671
- t++;
672
- }
673
- n = n.trim();
674
- if (!D(n)) {
675
- throw new Error(`Invalid notation name: "${n}"`);
499
+ s--;
676
500
  }
677
- i.push(n);
678
- if (e[t] === "|") {
679
- t++;
680
- t = C(e, t);
501
+ if (s === 0) {
502
+ break;
681
503
  }
682
- }
683
- if (e[t] !== ")") {
684
- throw new Error("Unterminated list of notations");
685
- }
686
- t++;
687
- s += " (" + i.join("|") + ")";
688
- } else {
689
- while (t < e.length && !/\s/.test(e[t])) {
690
- s += e[t];
691
- t++;
692
- }
693
- const i = [ "CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS" ];
694
- if (!this.suppressValidationErr && !i.includes(s.toUpperCase())) {
695
- throw new Error(`Invalid attribute type: "${s}"`);
504
+ } else if (t[e] === "[") {
505
+ i = true;
506
+ } else {
507
+ o += t[e];
696
508
  }
697
509
  }
698
- t = C(e, t);
699
- let r = "";
700
- if (e.substring(t, t + 8).toUpperCase() === "#REQUIRED") {
701
- r = "#REQUIRED";
702
- t += 8;
703
- } else if (e.substring(t, t + 7).toUpperCase() === "#IMPLIED") {
704
- r = "#IMPLIED";
705
- t += 7;
706
- } else {
707
- [t, r] = this.readIdentifierVal(e, t, "ATTLIST");
510
+ if (s !== 0) {
511
+ throw new Error(`Unclosed DOCTYPE`);
708
512
  }
709
- return {
710
- elementName: i,
711
- attributeName: n,
712
- attributeType: s,
713
- defaultValue: r,
714
- index: t
715
- };
513
+ } else {
514
+ throw new Error(`Invalid Tag instead of DOCTYPE`);
716
515
  }
516
+ return {
517
+ entities: n,
518
+ i: e
519
+ };
717
520
  }
718
521
 
719
- const C = (e, t) => {
720
- while (t < e.length && /\s/.test(e[t])) {
721
- t++;
522
+ function S(t, e) {
523
+ let n = "";
524
+ for (;e < t.length && (t[e] !== "'" && t[e] !== '"'); e++) {
525
+ n += t[e];
722
526
  }
723
- return t;
724
- };
725
-
726
- function V(e, t, i) {
727
- for (let n = 0; n < t.length; n++) {
728
- if (t[n] !== e[i + n + 1]) return false;
527
+ n = n.trim();
528
+ if (n.indexOf(" ") !== -1) throw new Error("External entites are not supported");
529
+ const s = t[e++];
530
+ let i = "";
531
+ for (;e < t.length && t[e] !== s; e++) {
532
+ i += t[e];
729
533
  }
730
- return true;
534
+ return [ n, i, e ];
731
535
  }
732
536
 
733
- function D(e) {
734
- if (r(e)) return e; else throw new Error(`Invalid entity name ${e}`);
537
+ function F(t, e) {
538
+ if (t[e + 1] === "!" && t[e + 2] === "-" && t[e + 3] === "-") return true;
539
+ return false;
735
540
  }
736
541
 
737
- const $ = /^[-+]?0x[a-fA-F0-9]+$/;
542
+ function D(t, e) {
543
+ if (t[e + 1] === "!" && t[e + 2] === "E" && t[e + 3] === "N" && t[e + 4] === "T" && t[e + 5] === "I" && t[e + 6] === "T" && t[e + 7] === "Y") return true;
544
+ return false;
545
+ }
738
546
 
739
- const j = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/;
547
+ function V(t, e) {
548
+ if (t[e + 1] === "!" && t[e + 2] === "E" && t[e + 3] === "L" && t[e + 4] === "E" && t[e + 5] === "M" && t[e + 6] === "E" && t[e + 7] === "N" && t[e + 8] === "T") return true;
549
+ return false;
550
+ }
551
+
552
+ function k(t, e) {
553
+ if (t[e + 1] === "!" && t[e + 2] === "A" && t[e + 3] === "T" && t[e + 4] === "T" && t[e + 5] === "L" && t[e + 6] === "I" && t[e + 7] === "S" && t[e + 8] === "T") return true;
554
+ return false;
555
+ }
556
+
557
+ function $(t, e) {
558
+ if (t[e + 1] === "!" && t[e + 2] === "N" && t[e + 3] === "O" && t[e + 4] === "T" && t[e + 5] === "A" && t[e + 6] === "T" && t[e + 7] === "I" && t[e + 8] === "O" && t[e + 9] === "N") return true;
559
+ return false;
560
+ }
561
+
562
+ function _(t) {
563
+ if (I.isName(t)) return t; else throw new Error(`Invalid entity name ${t}`);
564
+ }
740
565
 
741
- const M = {
566
+ var L = j;
567
+
568
+ const M = t.getDefaultExportFromCjs(L);
569
+
570
+ const X = /^[-+]?0x[a-fA-F0-9]+$/;
571
+
572
+ const B = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/;
573
+
574
+ const G = {
742
575
  hex: true,
743
576
  leadingZeros: true,
744
577
  decimalPoint: ".",
745
578
  eNotation: true
746
579
  };
747
580
 
748
- function k(e, t = {}) {
749
- t = Object.assign({}, M, t);
750
- if (!e || typeof e !== "string") return e;
751
- let i = e.trim();
752
- if (t.skipLike !== undefined && t.skipLike.test(i)) return e; else if (e === "0") return 0; else if (t.hex && $.test(i)) {
753
- return U(i, 16);
754
- } else if (i.search(/.+[eE].+/) !== -1) {
755
- return _(e, i, t);
756
- } else {
757
- const n = j.exec(i);
758
- if (n) {
759
- const s = n[1] || "";
760
- const r = n[2];
761
- let o = L(n[3]);
762
- const a = s ? e[r.length + 1] === "." : e[r.length] === ".";
763
- if (!t.leadingZeros && (r.length > 1 || r.length === 1 && !a)) {
764
- return e;
581
+ function R(t, e = {}) {
582
+ e = Object.assign({}, G, e);
583
+ if (!t || typeof t !== "string") return t;
584
+ let n = t.trim();
585
+ if (e.skipLike !== undefined && e.skipLike.test(n)) return t; else if (t === "0") return 0; else if (e.hex && X.test(n)) {
586
+ return Z(n, 16);
587
+ } else if (n.search(/[eE]/) !== -1) {
588
+ const s = n.match(/^([-\+])?(0*)([0-9]*(\.[0-9]*)?[eE][-\+]?[0-9]+)$/);
589
+ if (s) {
590
+ if (e.leadingZeros) {
591
+ n = (s[1] || "") + s[3];
765
592
  } else {
766
- const n = Number(i);
767
- const a = String(n);
768
- if (n === 0) return n;
593
+ if (s[2] === "0" && s[3][0] === ".") {} else {
594
+ return t;
595
+ }
596
+ }
597
+ return e.eNotation ? Number(n) : t;
598
+ } else {
599
+ return t;
600
+ }
601
+ } else {
602
+ const s = B.exec(n);
603
+ if (s) {
604
+ const i = s[1];
605
+ const r = s[2];
606
+ let o = U(s[3]);
607
+ if (!e.leadingZeros && r.length > 0 && i && n[2] !== ".") return t; else if (!e.leadingZeros && r.length > 0 && !i && n[1] !== ".") return t; else if (e.leadingZeros && r === t) return 0; else {
608
+ const s = Number(n);
609
+ const a = "" + s;
769
610
  if (a.search(/[eE]/) !== -1) {
770
- if (t.eNotation) return n; else return e;
771
- } else if (i.indexOf(".") !== -1) {
772
- if (a === "0") return n; else if (a === o) return n; else if (a === `${s}${o}`) return n; else return e;
611
+ if (e.eNotation) return s; else return t;
612
+ } else if (n.indexOf(".") !== -1) {
613
+ if (a === "0" && o === "") return s; else if (a === o) return s; else if (i && a === "-" + o) return s; else return t;
773
614
  }
774
- let l = r ? o : i;
775
615
  if (r) {
776
- return l === a || s + l === a ? n : e;
616
+ return o === a || i + o === a ? s : t;
777
617
  } else {
778
- return l === a || l === s + a ? n : e;
618
+ return n === a || n === i + a ? s : t;
779
619
  }
780
620
  }
781
621
  } else {
782
- return e;
622
+ return t;
783
623
  }
784
624
  }
785
625
  }
786
626
 
787
- const F = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;
788
-
789
- function _(e, t, i) {
790
- if (!i.eNotation) return e;
791
- const n = t.match(F);
792
- if (n) {
793
- let s = n[1] || "";
794
- const r = n[3].indexOf("e") === -1 ? "E" : "e";
795
- const o = n[2];
796
- const a = s ? e[o.length + 1] === r : e[o.length] === r;
797
- if (o.length > 1 && a) return e; else if (o.length === 1 && (n[3].startsWith(`.${r}`) || n[3][0] === r)) {
798
- return Number(t);
799
- } else if (i.leadingZeros && !a) {
800
- t = (n[1] || "") + n[3];
801
- return Number(t);
802
- } else return e;
803
- } else {
804
- return e;
627
+ function U(t) {
628
+ if (t && t.indexOf(".") !== -1) {
629
+ t = t.replace(/0+$/, "");
630
+ if (t === ".") t = "0"; else if (t[0] === ".") t = "0" + t; else if (t[t.length - 1] === ".") t = t.substr(0, t.length - 1);
631
+ return t;
805
632
  }
633
+ return t;
806
634
  }
807
635
 
808
- function L(e) {
809
- if (e && e.indexOf(".") !== -1) {
810
- e = e.replace(/0+$/, "");
811
- if (e === ".") e = "0"; else if (e[0] === ".") e = "0" + e; else if (e[e.length - 1] === ".") e = e.substring(0, e.length - 1);
812
- return e;
813
- }
814
- return e;
636
+ function Z(t, e) {
637
+ if (parseInt) return parseInt(t, e); else if (Number.parseInt) return Number.parseInt(t, e); else if (window && window.parseInt) return window.parseInt(t, e); else throw new Error("parseInt, Number.parseInt, window.parseInt are not supported");
815
638
  }
816
639
 
817
- function U(e, t) {
818
- if (parseInt) return parseInt(e, t); else if (Number.parseInt) return Number.parseInt(e, t); else if (window && window.parseInt) return window.parseInt(e, t); else throw new Error("parseInt, Number.parseInt, window.parseInt are not supported");
819
- }
640
+ var Y = R;
820
641
 
821
- function X(e) {
822
- if (typeof e === "function") {
823
- return e;
642
+ const q = t.getDefaultExportFromCjs(Y);
643
+
644
+ function W(t) {
645
+ if (typeof t === "function") {
646
+ return t;
824
647
  }
825
- if (Array.isArray(e)) {
826
- return t => {
827
- for (const i of e) {
828
- if (typeof i === "string" && t === i) {
648
+ if (Array.isArray(t)) {
649
+ return e => {
650
+ for (const n of t) {
651
+ if (typeof n === "string" && e === n) {
829
652
  return true;
830
653
  }
831
- if (i instanceof RegExp && i.test(t)) {
654
+ if (n instanceof RegExp && n.test(e)) {
832
655
  return true;
833
656
  }
834
657
  }
@@ -837,11 +660,25 @@ function X(e) {
837
660
  return () => false;
838
661
  }
839
662
 
663
+ var z = W;
664
+
665
+ const J = t.getDefaultExportFromCjs(z);
666
+
840
667
  "use strict";
841
668
 
842
- class OrderedObjParser {
843
- constructor(e) {
844
- this.options = e;
669
+ const H = n;
670
+
671
+ const K = A;
672
+
673
+ const Q = L;
674
+
675
+ const tt = Y;
676
+
677
+ const et = z;
678
+
679
+ let nt = class OrderedObjParser {
680
+ constructor(t) {
681
+ this.options = t;
845
682
  this.currentNode = null;
846
683
  this.tagsNodeStack = [];
847
684
  this.docTypeEntities = {};
@@ -902,279 +739,264 @@ class OrderedObjParser {
902
739
  },
903
740
  num_dec: {
904
741
  regex: /&#([0-9]{1,7});/g,
905
- val: (e, t) => String.fromCodePoint(Number.parseInt(t, 10))
742
+ val: (t, e) => String.fromCharCode(Number.parseInt(e, 10))
906
743
  },
907
744
  num_hex: {
908
745
  regex: /&#x([0-9a-fA-F]{1,6});/g,
909
- val: (e, t) => String.fromCodePoint(Number.parseInt(t, 16))
746
+ val: (t, e) => String.fromCharCode(Number.parseInt(e, 16))
910
747
  }
911
748
  };
912
- this.addExternalEntities = R;
913
- this.parseXml = q;
914
- this.parseTextData = B;
915
- this.resolveNameSpace = Y;
916
- this.buildAttributesMap = W;
917
- this.isItStopNode = z;
918
- this.replaceEntitiesValue = K;
919
- this.readStopNodeData = te;
920
- this.saveTextToParentTag = Q;
921
- this.addChild = Z;
922
- this.ignoreAttributesFn = X(this.options.ignoreAttributes);
923
- if (this.options.stopNodes && this.options.stopNodes.length > 0) {
924
- this.stopNodesExact = new Set;
925
- this.stopNodesWildcard = new Set;
926
- for (let e = 0; e < this.options.stopNodes.length; e++) {
927
- const t = this.options.stopNodes[e];
928
- if (typeof t !== "string") continue;
929
- if (t.startsWith("*.")) {
930
- this.stopNodesWildcard.add(t.substring(2));
931
- } else {
932
- this.stopNodesExact.add(t);
933
- }
934
- }
935
- }
749
+ this.addExternalEntities = st;
750
+ this.parseXml = lt;
751
+ this.parseTextData = it;
752
+ this.resolveNameSpace = rt;
753
+ this.buildAttributesMap = at;
754
+ this.isItStopNode = ht;
755
+ this.replaceEntitiesValue = ft;
756
+ this.readStopNodeData = mt;
757
+ this.saveTextToParentTag = ct;
758
+ this.addChild = ut;
759
+ this.ignoreAttributesFn = et(this.options.ignoreAttributes);
936
760
  }
937
- }
761
+ };
938
762
 
939
- function R(e) {
940
- const t = Object.keys(e);
941
- for (let i = 0; i < t.length; i++) {
942
- const n = t[i];
943
- this.lastEntities[n] = {
944
- regex: new RegExp("&" + n + ";", "g"),
945
- val: e[n]
763
+ function st(t) {
764
+ const e = Object.keys(t);
765
+ for (let n = 0; n < e.length; n++) {
766
+ const s = e[n];
767
+ this.lastEntities[s] = {
768
+ regex: new RegExp("&" + s + ";", "g"),
769
+ val: t[s]
946
770
  };
947
771
  }
948
772
  }
949
773
 
950
- function B(e, t, i, n, s, r, o) {
951
- if (e !== undefined) {
952
- if (this.options.trimValues && !n) {
953
- e = e.trim();
954
- }
955
- if (e.length > 0) {
956
- if (!o) e = this.replaceEntitiesValue(e);
957
- const n = this.options.tagValueProcessor(t, e, i, s, r);
958
- if (n === null || n === undefined) {
959
- return e;
960
- } else if (typeof n !== typeof e || n !== e) {
961
- return n;
774
+ function it(t, e, n, s, i, r, o) {
775
+ if (t !== undefined) {
776
+ if (this.options.trimValues && !s) {
777
+ t = t.trim();
778
+ }
779
+ if (t.length > 0) {
780
+ if (!o) t = this.replaceEntitiesValue(t);
781
+ const s = this.options.tagValueProcessor(e, t, n, i, r);
782
+ if (s === null || s === undefined) {
783
+ return t;
784
+ } else if (typeof s !== typeof t || s !== t) {
785
+ return s;
962
786
  } else if (this.options.trimValues) {
963
- return ie(e, this.options.parseTagValue, this.options.numberParseOptions);
787
+ return xt(t, this.options.parseTagValue, this.options.numberParseOptions);
964
788
  } else {
965
- const t = e.trim();
966
- if (t === e) {
967
- return ie(e, this.options.parseTagValue, this.options.numberParseOptions);
789
+ const e = t.trim();
790
+ if (e === t) {
791
+ return xt(t, this.options.parseTagValue, this.options.numberParseOptions);
968
792
  } else {
969
- return e;
793
+ return t;
970
794
  }
971
795
  }
972
796
  }
973
797
  }
974
798
  }
975
799
 
976
- function Y(e) {
800
+ function rt(t) {
977
801
  if (this.options.removeNSPrefix) {
978
- const t = e.split(":");
979
- const i = e.charAt(0) === "/" ? "/" : "";
980
- if (t[0] === "xmlns") {
802
+ const e = t.split(":");
803
+ const n = t.charAt(0) === "/" ? "/" : "";
804
+ if (e[0] === "xmlns") {
981
805
  return "";
982
806
  }
983
- if (t.length === 2) {
984
- e = i + t[1];
807
+ if (e.length === 2) {
808
+ t = n + e[1];
985
809
  }
986
810
  }
987
- return e;
811
+ return t;
988
812
  }
989
813
 
990
- const G = new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?", "gm");
814
+ const ot = new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?", "gm");
991
815
 
992
- function W(e, t, i) {
993
- if (this.options.ignoreAttributes !== true && typeof e === "string") {
994
- const i = s(e, G);
995
- const n = i.length;
996
- const r = {};
997
- for (let e = 0; e < n; e++) {
998
- const n = this.resolveNameSpace(i[e][1]);
999
- if (this.ignoreAttributesFn(n, t)) {
816
+ function at(t, e, n) {
817
+ if (this.options.ignoreAttributes !== true && typeof t === "string") {
818
+ const n = H.getAllMatches(t, ot);
819
+ const s = n.length;
820
+ const i = {};
821
+ for (let t = 0; t < s; t++) {
822
+ const s = this.resolveNameSpace(n[t][1]);
823
+ if (this.ignoreAttributesFn(s, e)) {
1000
824
  continue;
1001
825
  }
1002
- let s = i[e][4];
1003
- let o = this.options.attributeNamePrefix + n;
1004
- if (n.length) {
826
+ let r = n[t][4];
827
+ let o = this.options.attributeNamePrefix + s;
828
+ if (s.length) {
1005
829
  if (this.options.transformAttributeName) {
1006
830
  o = this.options.transformAttributeName(o);
1007
831
  }
1008
832
  if (o === "__proto__") o = "#__proto__";
1009
- if (s !== undefined) {
833
+ if (r !== undefined) {
1010
834
  if (this.options.trimValues) {
1011
- s = s.trim();
835
+ r = r.trim();
1012
836
  }
1013
- s = this.replaceEntitiesValue(s);
1014
- const e = this.options.attributeValueProcessor(n, s, t);
1015
- if (e === null || e === undefined) {
1016
- r[o] = s;
1017
- } else if (typeof e !== typeof s || e !== s) {
1018
- r[o] = e;
837
+ r = this.replaceEntitiesValue(r);
838
+ const t = this.options.attributeValueProcessor(s, r, e);
839
+ if (t === null || t === undefined) {
840
+ i[o] = r;
841
+ } else if (typeof t !== typeof r || t !== r) {
842
+ i[o] = t;
1019
843
  } else {
1020
- r[o] = ie(s, this.options.parseAttributeValue, this.options.numberParseOptions);
844
+ i[o] = xt(r, this.options.parseAttributeValue, this.options.numberParseOptions);
1021
845
  }
1022
846
  } else if (this.options.allowBooleanAttributes) {
1023
- r[o] = true;
847
+ i[o] = true;
1024
848
  }
1025
849
  }
1026
850
  }
1027
- if (!Object.keys(r).length) {
851
+ if (!Object.keys(i).length) {
1028
852
  return;
1029
853
  }
1030
854
  if (this.options.attributesGroupName) {
1031
- const e = {};
1032
- e[this.options.attributesGroupName] = r;
1033
- return e;
855
+ const t = {};
856
+ t[this.options.attributesGroupName] = i;
857
+ return t;
1034
858
  }
1035
- return r;
859
+ return i;
1036
860
  }
1037
861
  }
1038
862
 
1039
- const q = function(e) {
1040
- e = e.replace(/\r\n?/g, "\n");
1041
- const t = new XmlNode("!xml");
1042
- let i = t;
1043
- let n = "";
863
+ const lt = function(t) {
864
+ t = t.replace(/\r\n?/g, "\n");
865
+ const e = new K("!xml");
866
+ let n = e;
1044
867
  let s = "";
1045
- const r = new DocTypeReader(this.options.processEntities);
1046
- for (let o = 0; o < e.length; o++) {
1047
- const a = e[o];
1048
- if (a === "<") {
1049
- if (e[o + 1] === "/") {
1050
- const t = H(e, ">", o, "Closing Tag is not closed.");
1051
- let r = e.substring(o + 2, t).trim();
868
+ let i = "";
869
+ for (let r = 0; r < t.length; r++) {
870
+ const o = t[r];
871
+ if (o === "<") {
872
+ if (t[r + 1] === "/") {
873
+ const e = pt(t, ">", r, "Closing Tag is not closed.");
874
+ let o = t.substring(r + 2, e).trim();
1052
875
  if (this.options.removeNSPrefix) {
1053
- const e = r.indexOf(":");
1054
- if (e !== -1) {
1055
- r = r.substr(e + 1);
876
+ const t = o.indexOf(":");
877
+ if (t !== -1) {
878
+ o = o.substr(t + 1);
1056
879
  }
1057
880
  }
1058
881
  if (this.options.transformTagName) {
1059
- r = this.options.transformTagName(r);
882
+ o = this.options.transformTagName(o);
1060
883
  }
1061
- if (i) {
1062
- n = this.saveTextToParentTag(n, i, s);
884
+ if (n) {
885
+ s = this.saveTextToParentTag(s, n, i);
1063
886
  }
1064
- const a = s.substring(s.lastIndexOf(".") + 1);
1065
- if (r && this.options.unpairedTags.indexOf(r) !== -1) {
1066
- throw new Error(`Unpaired tag can not be used as closing tag: </${r}>`);
887
+ const a = i.substring(i.lastIndexOf(".") + 1);
888
+ if (o && this.options.unpairedTags.indexOf(o) !== -1) {
889
+ throw new Error(`Unpaired tag can not be used as closing tag: </${o}>`);
1067
890
  }
1068
891
  let l = 0;
1069
892
  if (a && this.options.unpairedTags.indexOf(a) !== -1) {
1070
- l = s.lastIndexOf(".", s.lastIndexOf(".") - 1);
893
+ l = i.lastIndexOf(".", i.lastIndexOf(".") - 1);
1071
894
  this.tagsNodeStack.pop();
1072
895
  } else {
1073
- l = s.lastIndexOf(".");
896
+ l = i.lastIndexOf(".");
1074
897
  }
1075
- s = s.substring(0, l);
1076
- i = this.tagsNodeStack.pop();
1077
- n = "";
1078
- o = t;
1079
- } else if (e[o + 1] === "?") {
1080
- let t = ee(e, o, false, "?>");
1081
- if (!t) throw new Error("Pi Tag is not closed.");
1082
- n = this.saveTextToParentTag(n, i, s);
1083
- if (this.options.ignoreDeclaration && t.tagName === "?xml" || this.options.ignorePiTags) {} else {
1084
- const e = new XmlNode(t.tagName);
1085
- e.add(this.options.textNodeName, "");
1086
- if (t.tagName !== t.tagExp && t.attrExpPresent) {
1087
- e[":@"] = this.buildAttributesMap(t.tagExp, s, t.tagName);
898
+ i = i.substring(0, l);
899
+ n = this.tagsNodeStack.pop();
900
+ s = "";
901
+ r = e;
902
+ } else if (t[r + 1] === "?") {
903
+ let e = gt(t, r, false, "?>");
904
+ if (!e) throw new Error("Pi Tag is not closed.");
905
+ s = this.saveTextToParentTag(s, n, i);
906
+ if (this.options.ignoreDeclaration && e.tagName === "?xml" || this.options.ignorePiTags) {} else {
907
+ const t = new K(e.tagName);
908
+ t.add(this.options.textNodeName, "");
909
+ if (e.tagName !== e.tagExp && e.attrExpPresent) {
910
+ t[":@"] = this.buildAttributesMap(e.tagExp, i, e.tagName);
1088
911
  }
1089
- this.addChild(i, e, s, o);
912
+ this.addChild(n, t, i);
1090
913
  }
1091
- o = t.closeIndex + 1;
1092
- } else if (e.substr(o + 1, 3) === "!--") {
1093
- const t = H(e, "--\x3e", o + 4, "Comment is not closed.");
914
+ r = e.closeIndex + 1;
915
+ } else if (t.substr(r + 1, 3) === "!--") {
916
+ const e = pt(t, "--\x3e", r + 4, "Comment is not closed.");
1094
917
  if (this.options.commentPropName) {
1095
- const r = e.substring(o + 4, t - 2);
1096
- n = this.saveTextToParentTag(n, i, s);
1097
- i.add(this.options.commentPropName, [ {
1098
- [this.options.textNodeName]: r
918
+ const o = t.substring(r + 4, e - 2);
919
+ s = this.saveTextToParentTag(s, n, i);
920
+ n.add(this.options.commentPropName, [ {
921
+ [this.options.textNodeName]: o
1099
922
  } ]);
1100
923
  }
1101
- o = t;
1102
- } else if (e.substr(o + 1, 2) === "!D") {
1103
- const t = r.readDocType(e, o);
1104
- this.docTypeEntities = t.entities;
1105
- o = t.i;
1106
- } else if (e.substr(o + 1, 2) === "![") {
1107
- const t = H(e, "]]>", o, "CDATA is not closed.") - 2;
1108
- const r = e.substring(o + 9, t);
1109
- n = this.saveTextToParentTag(n, i, s);
1110
- let a = this.parseTextData(r, i.tagname, s, true, false, true, true);
924
+ r = e;
925
+ } else if (t.substr(r + 1, 2) === "!D") {
926
+ const e = Q(t, r);
927
+ this.docTypeEntities = e.entities;
928
+ r = e.i;
929
+ } else if (t.substr(r + 1, 2) === "![") {
930
+ const e = pt(t, "]]>", r, "CDATA is not closed.") - 2;
931
+ const o = t.substring(r + 9, e);
932
+ s = this.saveTextToParentTag(s, n, i);
933
+ let a = this.parseTextData(o, n.tagname, i, true, false, true, true);
1111
934
  if (a == undefined) a = "";
1112
935
  if (this.options.cdataPropName) {
1113
- i.add(this.options.cdataPropName, [ {
1114
- [this.options.textNodeName]: r
936
+ n.add(this.options.cdataPropName, [ {
937
+ [this.options.textNodeName]: o
1115
938
  } ]);
1116
939
  } else {
1117
- i.add(this.options.textNodeName, a);
940
+ n.add(this.options.textNodeName, a);
1118
941
  }
1119
- o = t + 2;
942
+ r = e + 2;
1120
943
  } else {
1121
- let r = ee(e, o, this.options.removeNSPrefix);
1122
- let a = r.tagName;
1123
- const l = r.rawTagName;
1124
- let u = r.tagExp;
1125
- let f = r.attrExpPresent;
1126
- let d = r.closeIndex;
944
+ let o = gt(t, r, this.options.removeNSPrefix);
945
+ let a = o.tagName;
946
+ const l = o.rawTagName;
947
+ let u = o.tagExp;
948
+ let f = o.attrExpPresent;
949
+ let c = o.closeIndex;
1127
950
  if (this.options.transformTagName) {
1128
951
  a = this.options.transformTagName(a);
1129
952
  }
1130
- if (i && n) {
1131
- if (i.tagname !== "!xml") {
1132
- n = this.saveTextToParentTag(n, i, s, false);
953
+ if (n && s) {
954
+ if (n.tagname !== "!xml") {
955
+ s = this.saveTextToParentTag(s, n, i, false);
1133
956
  }
1134
957
  }
1135
- const h = i;
958
+ const h = n;
1136
959
  if (h && this.options.unpairedTags.indexOf(h.tagname) !== -1) {
1137
- i = this.tagsNodeStack.pop();
1138
- s = s.substring(0, s.lastIndexOf("."));
960
+ n = this.tagsNodeStack.pop();
961
+ i = i.substring(0, i.lastIndexOf("."));
1139
962
  }
1140
- if (a !== t.tagname) {
1141
- s += s ? "." + a : a;
963
+ if (a !== e.tagname) {
964
+ i += i ? "." + a : a;
1142
965
  }
1143
- const c = o;
1144
- if (this.isItStopNode(this.stopNodesExact, this.stopNodesWildcard, s, a)) {
1145
- let t = "";
966
+ if (this.isItStopNode(this.options.stopNodes, i, a)) {
967
+ let e = "";
1146
968
  if (u.length > 0 && u.lastIndexOf("/") === u.length - 1) {
1147
969
  if (a[a.length - 1] === "/") {
1148
970
  a = a.substr(0, a.length - 1);
1149
- s = s.substr(0, s.length - 1);
971
+ i = i.substr(0, i.length - 1);
1150
972
  u = a;
1151
973
  } else {
1152
974
  u = u.substr(0, u.length - 1);
1153
975
  }
1154
- o = r.closeIndex;
976
+ r = o.closeIndex;
1155
977
  } else if (this.options.unpairedTags.indexOf(a) !== -1) {
1156
- o = r.closeIndex;
978
+ r = o.closeIndex;
1157
979
  } else {
1158
- const i = this.readStopNodeData(e, l, d + 1);
1159
- if (!i) throw new Error(`Unexpected end of ${l}`);
1160
- o = i.i;
1161
- t = i.tagContent;
980
+ const n = this.readStopNodeData(t, l, c + 1);
981
+ if (!n) throw new Error(`Unexpected end of ${l}`);
982
+ r = n.i;
983
+ e = n.tagContent;
1162
984
  }
1163
- const n = new XmlNode(a);
985
+ const s = new K(a);
1164
986
  if (a !== u && f) {
1165
- n[":@"] = this.buildAttributesMap(u, s, a);
987
+ s[":@"] = this.buildAttributesMap(u, i, a);
1166
988
  }
1167
- if (t) {
1168
- t = this.parseTextData(t, a, s, true, f, true, true);
989
+ if (e) {
990
+ e = this.parseTextData(e, a, i, true, f, true, true);
1169
991
  }
1170
- s = s.substr(0, s.lastIndexOf("."));
1171
- n.add(this.options.textNodeName, t);
1172
- this.addChild(i, n, s, c);
992
+ i = i.substr(0, i.lastIndexOf("."));
993
+ s.add(this.options.textNodeName, e);
994
+ this.addChild(n, s, i);
1173
995
  } else {
1174
996
  if (u.length > 0 && u.lastIndexOf("/") === u.length - 1) {
1175
997
  if (a[a.length - 1] === "/") {
1176
998
  a = a.substr(0, a.length - 1);
1177
- s = s.substr(0, s.length - 1);
999
+ i = i.substr(0, i.length - 1);
1178
1000
  u = a;
1179
1001
  } else {
1180
1002
  u = u.substr(0, u.length - 1);
@@ -1182,124 +1004,126 @@ const q = function(e) {
1182
1004
  if (this.options.transformTagName) {
1183
1005
  a = this.options.transformTagName(a);
1184
1006
  }
1185
- const e = new XmlNode(a);
1007
+ const t = new K(a);
1186
1008
  if (a !== u && f) {
1187
- e[":@"] = this.buildAttributesMap(u, s, a);
1009
+ t[":@"] = this.buildAttributesMap(u, i, a);
1188
1010
  }
1189
- this.addChild(i, e, s, c);
1190
- s = s.substr(0, s.lastIndexOf("."));
1011
+ this.addChild(n, t, i);
1012
+ i = i.substr(0, i.lastIndexOf("."));
1191
1013
  } else {
1192
- const e = new XmlNode(a);
1193
- this.tagsNodeStack.push(i);
1014
+ const t = new K(a);
1015
+ this.tagsNodeStack.push(n);
1194
1016
  if (a !== u && f) {
1195
- e[":@"] = this.buildAttributesMap(u, s, a);
1017
+ t[":@"] = this.buildAttributesMap(u, i, a);
1196
1018
  }
1197
- this.addChild(i, e, s, c);
1198
- i = e;
1019
+ this.addChild(n, t, i);
1020
+ n = t;
1199
1021
  }
1200
- n = "";
1201
- o = d;
1022
+ s = "";
1023
+ r = c;
1202
1024
  }
1203
1025
  }
1204
1026
  } else {
1205
- n += e[o];
1027
+ s += t[r];
1206
1028
  }
1207
1029
  }
1208
- return t.child;
1030
+ return e.child;
1209
1031
  };
1210
1032
 
1211
- function Z(e, t, i, n) {
1212
- if (!this.options.captureMetaData) n = undefined;
1213
- const s = this.options.updateTag(t.tagname, i, t[":@"]);
1033
+ function ut(t, e, n) {
1034
+ const s = this.options.updateTag(e.tagname, n, e[":@"]);
1214
1035
  if (s === false) {} else if (typeof s === "string") {
1215
- t.tagname = s;
1216
- e.addChild(t, n);
1036
+ e.tagname = s;
1037
+ t.addChild(e);
1217
1038
  } else {
1218
- e.addChild(t, n);
1039
+ t.addChild(e);
1219
1040
  }
1220
1041
  }
1221
1042
 
1222
- const K = function(e) {
1043
+ const ft = function(t) {
1223
1044
  if (this.options.processEntities) {
1224
- for (let t in this.docTypeEntities) {
1225
- const i = this.docTypeEntities[t];
1226
- e = e.replace(i.regx, i.val);
1045
+ for (let e in this.docTypeEntities) {
1046
+ const n = this.docTypeEntities[e];
1047
+ t = t.replace(n.regx, n.val);
1227
1048
  }
1228
- for (let t in this.lastEntities) {
1229
- const i = this.lastEntities[t];
1230
- e = e.replace(i.regex, i.val);
1049
+ for (let e in this.lastEntities) {
1050
+ const n = this.lastEntities[e];
1051
+ t = t.replace(n.regex, n.val);
1231
1052
  }
1232
1053
  if (this.options.htmlEntities) {
1233
- for (let t in this.htmlEntities) {
1234
- const i = this.htmlEntities[t];
1235
- e = e.replace(i.regex, i.val);
1054
+ for (let e in this.htmlEntities) {
1055
+ const n = this.htmlEntities[e];
1056
+ t = t.replace(n.regex, n.val);
1236
1057
  }
1237
1058
  }
1238
- e = e.replace(this.ampEntity.regex, this.ampEntity.val);
1059
+ t = t.replace(this.ampEntity.regex, this.ampEntity.val);
1239
1060
  }
1240
- return e;
1061
+ return t;
1241
1062
  };
1242
1063
 
1243
- function Q(e, t, i, n) {
1244
- if (e) {
1245
- if (n === undefined) n = t.child.length === 0;
1246
- e = this.parseTextData(e, t.tagname, i, false, t[":@"] ? Object.keys(t[":@"]).length !== 0 : false, n);
1247
- if (e !== undefined && e !== "") t.add(this.options.textNodeName, e);
1248
- e = "";
1064
+ function ct(t, e, n, s) {
1065
+ if (t) {
1066
+ if (s === undefined) s = e.child.length === 0;
1067
+ t = this.parseTextData(t, e.tagname, n, false, e[":@"] ? Object.keys(e[":@"]).length !== 0 : false, s);
1068
+ if (t !== undefined && t !== "") e.add(this.options.textNodeName, t);
1069
+ t = "";
1249
1070
  }
1250
- return e;
1071
+ return t;
1251
1072
  }
1252
1073
 
1253
- function z(e, t, i, n) {
1254
- if (t && t.has(n)) return true;
1255
- if (e && e.has(i)) return true;
1074
+ function ht(t, e, n) {
1075
+ const s = "*." + n;
1076
+ for (const n in t) {
1077
+ const i = t[n];
1078
+ if (s === i || e === i) return true;
1079
+ }
1256
1080
  return false;
1257
1081
  }
1258
1082
 
1259
- function J(e, t, i = ">") {
1260
- let n;
1261
- let s = "";
1262
- for (let r = t; r < e.length; r++) {
1263
- let t = e[r];
1264
- if (n) {
1265
- if (t === n) n = "";
1266
- } else if (t === '"' || t === "'") {
1267
- n = t;
1268
- } else if (t === i[0]) {
1269
- if (i[1]) {
1270
- if (e[r + 1] === i[1]) {
1083
+ function dt(t, e, n = ">") {
1084
+ let s;
1085
+ let i = "";
1086
+ for (let r = e; r < t.length; r++) {
1087
+ let e = t[r];
1088
+ if (s) {
1089
+ if (e === s) s = "";
1090
+ } else if (e === '"' || e === "'") {
1091
+ s = e;
1092
+ } else if (e === n[0]) {
1093
+ if (n[1]) {
1094
+ if (t[r + 1] === n[1]) {
1271
1095
  return {
1272
- data: s,
1096
+ data: i,
1273
1097
  index: r
1274
1098
  };
1275
1099
  }
1276
1100
  } else {
1277
1101
  return {
1278
- data: s,
1102
+ data: i,
1279
1103
  index: r
1280
1104
  };
1281
1105
  }
1282
- } else if (t === "\t") {
1283
- t = " ";
1106
+ } else if (e === "\t") {
1107
+ e = " ";
1284
1108
  }
1285
- s += t;
1109
+ i += e;
1286
1110
  }
1287
1111
  }
1288
1112
 
1289
- function H(e, t, i, n) {
1290
- const s = e.indexOf(t, i);
1291
- if (s === -1) {
1292
- throw new Error(n);
1113
+ function pt(t, e, n, s) {
1114
+ const i = t.indexOf(e, n);
1115
+ if (i === -1) {
1116
+ throw new Error(s);
1293
1117
  } else {
1294
- return s + t.length - 1;
1118
+ return i + e.length - 1;
1295
1119
  }
1296
1120
  }
1297
1121
 
1298
- function ee(e, t, i, n = ">") {
1299
- const s = J(e, t + 1, n);
1300
- if (!s) return;
1301
- let r = s.data;
1302
- const o = s.index;
1122
+ function gt(t, e, n, s = ">") {
1123
+ const i = dt(t, e + 1, s);
1124
+ if (!i) return;
1125
+ let r = i.data;
1126
+ const o = i.index;
1303
1127
  const a = r.search(/\s/);
1304
1128
  let l = r;
1305
1129
  let u = true;
@@ -1308,11 +1132,11 @@ function ee(e, t, i, n = ">") {
1308
1132
  r = r.substring(a + 1).trimStart();
1309
1133
  }
1310
1134
  const f = l;
1311
- if (i) {
1312
- const e = l.indexOf(":");
1313
- if (e !== -1) {
1314
- l = l.substr(e + 1);
1315
- u = l !== s.data.substr(e + 1);
1135
+ if (n) {
1136
+ const t = l.indexOf(":");
1137
+ if (t !== -1) {
1138
+ l = l.substr(t + 1);
1139
+ u = l !== i.data.substr(t + 1);
1316
1140
  }
1317
1141
  }
1318
1142
  return {
@@ -1324,313 +1148,333 @@ function ee(e, t, i, n = ">") {
1324
1148
  };
1325
1149
  }
1326
1150
 
1327
- function te(e, t, i) {
1328
- const n = i;
1329
- let s = 1;
1330
- for (;i < e.length; i++) {
1331
- if (e[i] === "<") {
1332
- if (e[i + 1] === "/") {
1333
- const r = H(e, ">", i, `${t} is not closed`);
1334
- let o = e.substring(i + 2, r).trim();
1335
- if (o === t) {
1336
- s--;
1337
- if (s === 0) {
1151
+ function mt(t, e, n) {
1152
+ const s = n;
1153
+ let i = 1;
1154
+ for (;n < t.length; n++) {
1155
+ if (t[n] === "<") {
1156
+ if (t[n + 1] === "/") {
1157
+ const r = pt(t, ">", n, `${e} is not closed`);
1158
+ let o = t.substring(n + 2, r).trim();
1159
+ if (o === e) {
1160
+ i--;
1161
+ if (i === 0) {
1338
1162
  return {
1339
- tagContent: e.substring(n, i),
1163
+ tagContent: t.substring(s, n),
1340
1164
  i: r
1341
1165
  };
1342
1166
  }
1343
1167
  }
1344
- i = r;
1345
- } else if (e[i + 1] === "?") {
1346
- const t = H(e, "?>", i + 1, "StopNode is not closed.");
1347
- i = t;
1348
- } else if (e.substr(i + 1, 3) === "!--") {
1349
- const t = H(e, "--\x3e", i + 3, "StopNode is not closed.");
1350
- i = t;
1351
- } else if (e.substr(i + 1, 2) === "![") {
1352
- const t = H(e, "]]>", i, "StopNode is not closed.") - 2;
1353
- i = t;
1168
+ n = r;
1169
+ } else if (t[n + 1] === "?") {
1170
+ const e = pt(t, "?>", n + 1, "StopNode is not closed.");
1171
+ n = e;
1172
+ } else if (t.substr(n + 1, 3) === "!--") {
1173
+ const e = pt(t, "--\x3e", n + 3, "StopNode is not closed.");
1174
+ n = e;
1175
+ } else if (t.substr(n + 1, 2) === "![") {
1176
+ const e = pt(t, "]]>", n, "StopNode is not closed.") - 2;
1177
+ n = e;
1354
1178
  } else {
1355
- const n = ee(e, i, ">");
1356
- if (n) {
1357
- const e = n && n.tagName;
1358
- if (e === t && n.tagExp[n.tagExp.length - 1] !== "/") {
1359
- s++;
1179
+ const s = gt(t, n, ">");
1180
+ if (s) {
1181
+ const t = s && s.tagName;
1182
+ if (t === e && s.tagExp[s.tagExp.length - 1] !== "/") {
1183
+ i++;
1360
1184
  }
1361
- i = n.closeIndex;
1185
+ n = s.closeIndex;
1362
1186
  }
1363
1187
  }
1364
1188
  }
1365
1189
  }
1366
1190
  }
1367
1191
 
1368
- function ie(e, t, i) {
1369
- if (t && typeof e === "string") {
1370
- const t = e.trim();
1371
- if (t === "true") return true; else if (t === "false") return false; else return k(e, i);
1192
+ function xt(t, e, n) {
1193
+ if (e && typeof t === "string") {
1194
+ const e = t.trim();
1195
+ if (e === "true") return true; else if (e === "false") return false; else return tt(t, n);
1372
1196
  } else {
1373
- if (o(e)) {
1374
- return e;
1197
+ if (H.isExist(t)) {
1198
+ return t;
1375
1199
  } else {
1376
1200
  return "";
1377
1201
  }
1378
1202
  }
1379
1203
  }
1380
1204
 
1381
- "use strict";
1205
+ var Nt = nt;
1382
1206
 
1383
- const ne = XmlNode.getMetaDataSymbol();
1207
+ const bt = t.getDefaultExportFromCjs(Nt);
1384
1208
 
1385
- function se(e, t) {
1386
- return re(e, t);
1209
+ var Et = {};
1210
+
1211
+ "use strict";
1212
+
1213
+ function vt(t, e) {
1214
+ return yt(t, e);
1387
1215
  }
1388
1216
 
1389
- function re(e, t, i) {
1390
- let n;
1391
- const s = {};
1392
- for (let r = 0; r < e.length; r++) {
1393
- const o = e[r];
1394
- const a = oe(o);
1217
+ function yt(t, e, n) {
1218
+ let s;
1219
+ const i = {};
1220
+ for (let r = 0; r < t.length; r++) {
1221
+ const o = t[r];
1222
+ const a = Tt(o);
1395
1223
  let l = "";
1396
- if (i === undefined) l = a; else l = i + "." + a;
1397
- if (a === t.textNodeName) {
1398
- if (n === undefined) n = o[a]; else n += "" + o[a];
1224
+ if (n === undefined) l = a; else l = n + "." + a;
1225
+ if (a === e.textNodeName) {
1226
+ if (s === undefined) s = o[a]; else s += "" + o[a];
1399
1227
  } else if (a === undefined) {
1400
1228
  continue;
1401
1229
  } else if (o[a]) {
1402
- let e = re(o[a], t, l);
1403
- const i = le(e, t);
1404
- if (o[ne] !== undefined) {
1405
- e[ne] = o[ne];
1406
- }
1230
+ let t = yt(o[a], e, l);
1231
+ const n = Pt(t, e);
1407
1232
  if (o[":@"]) {
1408
- ae(e, o[":@"], l, t);
1409
- } else if (Object.keys(e).length === 1 && e[t.textNodeName] !== undefined && !t.alwaysCreateTextNode) {
1410
- e = e[t.textNodeName];
1411
- } else if (Object.keys(e).length === 0) {
1412
- if (t.alwaysCreateTextNode) e[t.textNodeName] = ""; else e = "";
1233
+ Ot(t, o[":@"], l, e);
1234
+ } else if (Object.keys(t).length === 1 && t[e.textNodeName] !== undefined && !e.alwaysCreateTextNode) {
1235
+ t = t[e.textNodeName];
1236
+ } else if (Object.keys(t).length === 0) {
1237
+ if (e.alwaysCreateTextNode) t[e.textNodeName] = ""; else t = "";
1413
1238
  }
1414
- if (s[a] !== undefined && s.hasOwnProperty(a)) {
1415
- if (!Array.isArray(s[a])) {
1416
- s[a] = [ s[a] ];
1239
+ if (i[a] !== undefined && i.hasOwnProperty(a)) {
1240
+ if (!Array.isArray(i[a])) {
1241
+ i[a] = [ i[a] ];
1417
1242
  }
1418
- s[a].push(e);
1243
+ i[a].push(t);
1419
1244
  } else {
1420
- if (t.isArray(a, l, i)) {
1421
- s[a] = [ e ];
1245
+ if (e.isArray(a, l, n)) {
1246
+ i[a] = [ t ];
1422
1247
  } else {
1423
- s[a] = e;
1248
+ i[a] = t;
1424
1249
  }
1425
1250
  }
1426
1251
  }
1427
1252
  }
1428
- if (typeof n === "string") {
1429
- if (n.length > 0) s[t.textNodeName] = n;
1430
- } else if (n !== undefined) s[t.textNodeName] = n;
1431
- return s;
1253
+ if (typeof s === "string") {
1254
+ if (s.length > 0) i[e.textNodeName] = s;
1255
+ } else if (s !== undefined) i[e.textNodeName] = s;
1256
+ return i;
1432
1257
  }
1433
1258
 
1434
- function oe(e) {
1435
- const t = Object.keys(e);
1436
- for (let e = 0; e < t.length; e++) {
1437
- const i = t[e];
1438
- if (i !== ":@") return i;
1259
+ function Tt(t) {
1260
+ const e = Object.keys(t);
1261
+ for (let t = 0; t < e.length; t++) {
1262
+ const n = e[t];
1263
+ if (n !== ":@") return n;
1439
1264
  }
1440
1265
  }
1441
1266
 
1442
- function ae(e, t, i, n) {
1443
- if (t) {
1444
- const s = Object.keys(t);
1445
- const r = s.length;
1267
+ function Ot(t, e, n, s) {
1268
+ if (e) {
1269
+ const i = Object.keys(e);
1270
+ const r = i.length;
1446
1271
  for (let o = 0; o < r; o++) {
1447
- const r = s[o];
1448
- if (n.isArray(r, i + "." + r, true, true)) {
1449
- e[r] = [ t[r] ];
1272
+ const r = i[o];
1273
+ if (s.isArray(r, n + "." + r, true, true)) {
1274
+ t[r] = [ e[r] ];
1450
1275
  } else {
1451
- e[r] = t[r];
1276
+ t[r] = e[r];
1452
1277
  }
1453
1278
  }
1454
1279
  }
1455
1280
  }
1456
1281
 
1457
- function le(e, t) {
1458
- const {textNodeName: i} = t;
1459
- const n = Object.keys(e).length;
1460
- if (n === 0) {
1282
+ function Pt(t, e) {
1283
+ const {textNodeName: n} = e;
1284
+ const s = Object.keys(t).length;
1285
+ if (s === 0) {
1461
1286
  return true;
1462
1287
  }
1463
- if (n === 1 && (e[i] || typeof e[i] === "boolean" || e[i] === 0)) {
1288
+ if (s === 1 && (t[n] || typeof t[n] === "boolean" || t[n] === 0)) {
1464
1289
  return true;
1465
1290
  }
1466
1291
  return false;
1467
1292
  }
1468
1293
 
1469
- class XMLParser {
1470
- constructor(e) {
1294
+ var wt = Et.prettify = vt;
1295
+
1296
+ const {buildOptions: At} = y;
1297
+
1298
+ const Ct = Nt;
1299
+
1300
+ const {prettify: It} = Et;
1301
+
1302
+ const jt = e;
1303
+
1304
+ let St = class XMLParser {
1305
+ constructor(t) {
1471
1306
  this.externalEntities = {};
1472
- this.options = A(e);
1307
+ this.options = At(t);
1473
1308
  }
1474
- parse(e, t) {
1475
- if (typeof e !== "string" && e.toString) {
1476
- e = e.toString();
1477
- } else if (typeof e !== "string") {
1309
+ parse(t, e) {
1310
+ if (typeof t === "string") {} else if (t.toString) {
1311
+ t = t.toString();
1312
+ } else {
1478
1313
  throw new Error("XML data is accepted in String or Bytes[] form.");
1479
1314
  }
1480
- if (t) {
1481
- if (t === true) t = {};
1482
- const i = d(e, t);
1483
- if (i !== true) {
1484
- throw Error(`${i.err.msg}:${i.err.line}:${i.err.col}`);
1315
+ if (e) {
1316
+ if (e === true) e = {};
1317
+ const n = jt.validate(t, e);
1318
+ if (n !== true) {
1319
+ throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`);
1485
1320
  }
1486
1321
  }
1487
- const i = new OrderedObjParser(this.options);
1488
- i.addExternalEntities(this.externalEntities);
1489
- const n = i.parseXml(e);
1490
- if (this.options.preserveOrder || n === undefined) return n; else return se(n, this.options);
1322
+ const n = new Ct(this.options);
1323
+ n.addExternalEntities(this.externalEntities);
1324
+ const s = n.parseXml(t);
1325
+ if (this.options.preserveOrder || s === undefined) return s; else return It(s, this.options);
1491
1326
  }
1492
- addEntity(e, t) {
1493
- if (t.indexOf("&") !== -1) {
1327
+ addEntity(t, e) {
1328
+ if (e.indexOf("&") !== -1) {
1494
1329
  throw new Error("Entity value can't have '&'");
1495
- } else if (e.indexOf("&") !== -1 || e.indexOf(";") !== -1) {
1330
+ } else if (t.indexOf("&") !== -1 || t.indexOf(";") !== -1) {
1496
1331
  throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");
1497
- } else if (t === "&") {
1332
+ } else if (e === "&") {
1498
1333
  throw new Error("An entity with value '&' is not permitted");
1499
1334
  } else {
1500
- this.externalEntities[e] = t;
1335
+ this.externalEntities[t] = e;
1501
1336
  }
1502
1337
  }
1503
- static getMetaDataSymbol() {
1504
- return XmlNode.getMetaDataSymbol();
1505
- }
1506
- }
1338
+ };
1507
1339
 
1508
- const ue = "\n";
1340
+ var Ft = St;
1509
1341
 
1510
- function fe(e, t) {
1511
- let i = "";
1512
- if (t.format && t.indentBy.length > 0) {
1513
- i = ue;
1342
+ const Dt = t.getDefaultExportFromCjs(Ft);
1343
+
1344
+ const Vt = "\n";
1345
+
1346
+ function kt(t, e) {
1347
+ let n = "";
1348
+ if (e.format && e.indentBy.length > 0) {
1349
+ n = Vt;
1514
1350
  }
1515
- return de(e, t, "", i);
1351
+ return $t(t, e, "", n);
1516
1352
  }
1517
1353
 
1518
- function de(e, t, i, n) {
1519
- let s = "";
1354
+ function $t(t, e, n, s) {
1355
+ let i = "";
1520
1356
  let r = false;
1521
- for (let o = 0; o < e.length; o++) {
1522
- const a = e[o];
1523
- const l = he(a);
1357
+ for (let o = 0; o < t.length; o++) {
1358
+ const a = t[o];
1359
+ const l = _t(a);
1524
1360
  if (l === undefined) continue;
1525
1361
  let u = "";
1526
- if (i.length === 0) u = l; else u = `${i}.${l}`;
1527
- if (l === t.textNodeName) {
1528
- let e = a[l];
1529
- if (!pe(u, t)) {
1530
- e = t.tagValueProcessor(l, e);
1531
- e = ge(e, t);
1362
+ if (n.length === 0) u = l; else u = `${n}.${l}`;
1363
+ if (l === e.textNodeName) {
1364
+ let t = a[l];
1365
+ if (!Mt(u, e)) {
1366
+ t = e.tagValueProcessor(l, t);
1367
+ t = Xt(t, e);
1532
1368
  }
1533
1369
  if (r) {
1534
- s += n;
1370
+ i += s;
1535
1371
  }
1536
- s += e;
1372
+ i += t;
1537
1373
  r = false;
1538
1374
  continue;
1539
- } else if (l === t.cdataPropName) {
1375
+ } else if (l === e.cdataPropName) {
1540
1376
  if (r) {
1541
- s += n;
1377
+ i += s;
1542
1378
  }
1543
- s += `<![CDATA[${a[l][0][t.textNodeName]}]]>`;
1379
+ i += `<![CDATA[${a[l][0][e.textNodeName]}]]>`;
1544
1380
  r = false;
1545
1381
  continue;
1546
- } else if (l === t.commentPropName) {
1547
- s += n + `\x3c!--${a[l][0][t.textNodeName]}--\x3e`;
1382
+ } else if (l === e.commentPropName) {
1383
+ i += s + `\x3c!--${a[l][0][e.textNodeName]}--\x3e`;
1548
1384
  r = true;
1549
1385
  continue;
1550
1386
  } else if (l[0] === "?") {
1551
- const e = ce(a[":@"], t);
1552
- const i = l === "?xml" ? "" : n;
1553
- let o = a[l][0][t.textNodeName];
1387
+ const t = Lt(a[":@"], e);
1388
+ const n = l === "?xml" ? "" : s;
1389
+ let o = a[l][0][e.textNodeName];
1554
1390
  o = o.length !== 0 ? " " + o : "";
1555
- s += i + `<${l}${o}${e}?>`;
1391
+ i += n + `<${l}${o}${t}?>`;
1556
1392
  r = true;
1557
1393
  continue;
1558
1394
  }
1559
- let f = n;
1395
+ let f = s;
1560
1396
  if (f !== "") {
1561
- f += t.indentBy;
1562
- }
1563
- const d = ce(a[":@"], t);
1564
- const h = n + `<${l}${d}`;
1565
- const c = de(a[l], t, u, f);
1566
- if (t.unpairedTags.indexOf(l) !== -1) {
1567
- if (t.suppressUnpairedNode) s += h + ">"; else s += h + "/>";
1568
- } else if ((!c || c.length === 0) && t.suppressEmptyNode) {
1569
- s += h + "/>";
1570
- } else if (c && c.endsWith(">")) {
1571
- s += h + `>${c}${n}</${l}>`;
1397
+ f += e.indentBy;
1398
+ }
1399
+ const c = Lt(a[":@"], e);
1400
+ const h = s + `<${l}${c}`;
1401
+ const d = $t(a[l], e, u, f);
1402
+ if (e.unpairedTags.indexOf(l) !== -1) {
1403
+ if (e.suppressUnpairedNode) i += h + ">"; else i += h + "/>";
1404
+ } else if ((!d || d.length === 0) && e.suppressEmptyNode) {
1405
+ i += h + "/>";
1406
+ } else if (d && d.endsWith(">")) {
1407
+ i += h + `>${d}${s}</${l}>`;
1572
1408
  } else {
1573
- s += h + ">";
1574
- if (c && n !== "" && (c.includes("/>") || c.includes("</"))) {
1575
- s += n + t.indentBy + c + n;
1409
+ i += h + ">";
1410
+ if (d && s !== "" && (d.includes("/>") || d.includes("</"))) {
1411
+ i += s + e.indentBy + d + s;
1576
1412
  } else {
1577
- s += c;
1413
+ i += d;
1578
1414
  }
1579
- s += `</${l}>`;
1415
+ i += `</${l}>`;
1580
1416
  }
1581
1417
  r = true;
1582
1418
  }
1583
- return s;
1419
+ return i;
1584
1420
  }
1585
1421
 
1586
- function he(e) {
1587
- const t = Object.keys(e);
1588
- for (let i = 0; i < t.length; i++) {
1589
- const n = t[i];
1590
- if (!e.hasOwnProperty(n)) continue;
1591
- if (n !== ":@") return n;
1422
+ function _t(t) {
1423
+ const e = Object.keys(t);
1424
+ for (let n = 0; n < e.length; n++) {
1425
+ const s = e[n];
1426
+ if (!t.hasOwnProperty(s)) continue;
1427
+ if (s !== ":@") return s;
1592
1428
  }
1593
1429
  }
1594
1430
 
1595
- function ce(e, t) {
1596
- let i = "";
1597
- if (e && !t.ignoreAttributes) {
1598
- for (let n in e) {
1599
- if (!e.hasOwnProperty(n)) continue;
1600
- let s = t.attributeValueProcessor(n, e[n]);
1601
- s = ge(s, t);
1602
- if (s === true && t.suppressBooleanAttributes) {
1603
- i += ` ${n.substr(t.attributeNamePrefix.length)}`;
1431
+ function Lt(t, e) {
1432
+ let n = "";
1433
+ if (t && !e.ignoreAttributes) {
1434
+ for (let s in t) {
1435
+ if (!t.hasOwnProperty(s)) continue;
1436
+ let i = e.attributeValueProcessor(s, t[s]);
1437
+ i = Xt(i, e);
1438
+ if (i === true && e.suppressBooleanAttributes) {
1439
+ n += ` ${s.substr(e.attributeNamePrefix.length)}`;
1604
1440
  } else {
1605
- i += ` ${n.substr(t.attributeNamePrefix.length)}="${s}"`;
1441
+ n += ` ${s.substr(e.attributeNamePrefix.length)}="${i}"`;
1606
1442
  }
1607
1443
  }
1608
1444
  }
1609
- return i;
1445
+ return n;
1610
1446
  }
1611
1447
 
1612
- function pe(e, t) {
1613
- e = e.substr(0, e.length - t.textNodeName.length - 1);
1614
- let i = e.substr(e.lastIndexOf(".") + 1);
1615
- for (let n in t.stopNodes) {
1616
- if (t.stopNodes[n] === e || t.stopNodes[n] === "*." + i) return true;
1448
+ function Mt(t, e) {
1449
+ t = t.substr(0, t.length - e.textNodeName.length - 1);
1450
+ let n = t.substr(t.lastIndexOf(".") + 1);
1451
+ for (let s in e.stopNodes) {
1452
+ if (e.stopNodes[s] === t || e.stopNodes[s] === "*." + n) return true;
1617
1453
  }
1618
1454
  return false;
1619
1455
  }
1620
1456
 
1621
- function ge(e, t) {
1622
- if (e && e.length > 0 && t.processEntities) {
1623
- for (let i = 0; i < t.entities.length; i++) {
1624
- const n = t.entities[i];
1625
- e = e.replace(n.regex, n.val);
1457
+ function Xt(t, e) {
1458
+ if (t && t.length > 0 && e.processEntities) {
1459
+ for (let n = 0; n < e.entities.length; n++) {
1460
+ const s = e.entities[n];
1461
+ t = t.replace(s.regex, s.val);
1626
1462
  }
1627
1463
  }
1628
- return e;
1464
+ return t;
1629
1465
  }
1630
1466
 
1467
+ var Bt = kt;
1468
+
1469
+ const Gt = t.getDefaultExportFromCjs(Bt);
1470
+
1631
1471
  "use strict";
1632
1472
 
1633
- const me = {
1473
+ const Rt = Bt;
1474
+
1475
+ const Ut = z;
1476
+
1477
+ const Zt = {
1634
1478
  attributeNamePrefix: "@_",
1635
1479
  attributesGroupName: false,
1636
1480
  textNodeName: "#text",
@@ -1641,11 +1485,11 @@ const me = {
1641
1485
  suppressEmptyNode: false,
1642
1486
  suppressUnpairedNode: true,
1643
1487
  suppressBooleanAttributes: true,
1644
- tagValueProcessor: function(e, t) {
1645
- return t;
1488
+ tagValueProcessor: function(t, e) {
1489
+ return e;
1646
1490
  },
1647
- attributeValueProcessor: function(e, t) {
1648
- return t;
1491
+ attributeValueProcessor: function(t, e) {
1492
+ return e;
1649
1493
  },
1650
1494
  preserveOrder: false,
1651
1495
  commentPropName: false,
@@ -1671,20 +1515,20 @@ const me = {
1671
1515
  oneListGroup: false
1672
1516
  };
1673
1517
 
1674
- function xe(e) {
1675
- this.options = Object.assign({}, me, e);
1518
+ function Yt(t) {
1519
+ this.options = Object.assign({}, Zt, t);
1676
1520
  if (this.options.ignoreAttributes === true || this.options.attributesGroupName) {
1677
1521
  this.isAttribute = function() {
1678
1522
  return false;
1679
1523
  };
1680
1524
  } else {
1681
- this.ignoreAttributesFn = X(this.options.ignoreAttributes);
1525
+ this.ignoreAttributesFn = Ut(this.options.ignoreAttributes);
1682
1526
  this.attrPrefixLen = this.options.attributeNamePrefix.length;
1683
- this.isAttribute = we;
1527
+ this.isAttribute = Jt;
1684
1528
  }
1685
- this.processTextOrObjNode = Ne;
1529
+ this.processTextOrObjNode = qt;
1686
1530
  if (this.options.format) {
1687
- this.indentate = Ee;
1531
+ this.indentate = zt;
1688
1532
  this.tagEndChar = ">\n";
1689
1533
  this.newLine = "\n";
1690
1534
  } else {
@@ -1696,219 +1540,233 @@ function xe(e) {
1696
1540
  }
1697
1541
  }
1698
1542
 
1699
- xe.prototype.build = function(e) {
1543
+ Yt.prototype.build = function(t) {
1700
1544
  if (this.options.preserveOrder) {
1701
- return fe(e, this.options);
1545
+ return Rt(t, this.options);
1702
1546
  } else {
1703
- if (Array.isArray(e) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1) {
1704
- e = {
1705
- [this.options.arrayNodeName]: e
1547
+ if (Array.isArray(t) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1) {
1548
+ t = {
1549
+ [this.options.arrayNodeName]: t
1706
1550
  };
1707
1551
  }
1708
- return this.j2x(e, 0, []).val;
1552
+ return this.j2x(t, 0, []).val;
1709
1553
  }
1710
1554
  };
1711
1555
 
1712
- xe.prototype.j2x = function(e, t, i) {
1713
- let n = "";
1556
+ Yt.prototype.j2x = function(t, e, n) {
1714
1557
  let s = "";
1715
- const r = i.join(".");
1716
- for (let o in e) {
1717
- if (!Object.prototype.hasOwnProperty.call(e, o)) continue;
1718
- if (typeof e[o] === "undefined") {
1558
+ let i = "";
1559
+ const r = n.join(".");
1560
+ for (let o in t) {
1561
+ if (!Object.prototype.hasOwnProperty.call(t, o)) continue;
1562
+ if (typeof t[o] === "undefined") {
1719
1563
  if (this.isAttribute(o)) {
1720
- s += "";
1564
+ i += "";
1721
1565
  }
1722
- } else if (e[o] === null) {
1566
+ } else if (t[o] === null) {
1723
1567
  if (this.isAttribute(o)) {
1724
- s += "";
1568
+ i += "";
1725
1569
  } else if (o === this.options.cdataPropName) {
1726
- s += "";
1570
+ i += "";
1727
1571
  } else if (o[0] === "?") {
1728
- s += this.indentate(t) + "<" + o + "?" + this.tagEndChar;
1572
+ i += this.indentate(e) + "<" + o + "?" + this.tagEndChar;
1729
1573
  } else {
1730
- s += this.indentate(t) + "<" + o + "/" + this.tagEndChar;
1574
+ i += this.indentate(e) + "<" + o + "/" + this.tagEndChar;
1731
1575
  }
1732
- } else if (e[o] instanceof Date) {
1733
- s += this.buildTextValNode(e[o], o, "", t);
1734
- } else if (typeof e[o] !== "object") {
1735
- const i = this.isAttribute(o);
1736
- if (i && !this.ignoreAttributesFn(i, r)) {
1737
- n += this.buildAttrPairStr(i, "" + e[o]);
1738
- } else if (!i) {
1576
+ } else if (t[o] instanceof Date) {
1577
+ i += this.buildTextValNode(t[o], o, "", e);
1578
+ } else if (typeof t[o] !== "object") {
1579
+ const n = this.isAttribute(o);
1580
+ if (n && !this.ignoreAttributesFn(n, r)) {
1581
+ s += this.buildAttrPairStr(n, "" + t[o]);
1582
+ } else if (!n) {
1739
1583
  if (o === this.options.textNodeName) {
1740
- let t = this.options.tagValueProcessor(o, "" + e[o]);
1741
- s += this.replaceEntitiesValue(t);
1584
+ let e = this.options.tagValueProcessor(o, "" + t[o]);
1585
+ i += this.replaceEntitiesValue(e);
1742
1586
  } else {
1743
- s += this.buildTextValNode(e[o], o, "", t);
1587
+ i += this.buildTextValNode(t[o], o, "", e);
1744
1588
  }
1745
1589
  }
1746
- } else if (Array.isArray(e[o])) {
1747
- const n = e[o].length;
1590
+ } else if (Array.isArray(t[o])) {
1591
+ const s = t[o].length;
1748
1592
  let r = "";
1749
1593
  let a = "";
1750
- for (let l = 0; l < n; l++) {
1751
- const n = e[o][l];
1752
- if (typeof n === "undefined") {} else if (n === null) {
1753
- if (o[0] === "?") s += this.indentate(t) + "<" + o + "?" + this.tagEndChar; else s += this.indentate(t) + "<" + o + "/" + this.tagEndChar;
1754
- } else if (typeof n === "object") {
1594
+ for (let l = 0; l < s; l++) {
1595
+ const s = t[o][l];
1596
+ if (typeof s === "undefined") {} else if (s === null) {
1597
+ if (o[0] === "?") i += this.indentate(e) + "<" + o + "?" + this.tagEndChar; else i += this.indentate(e) + "<" + o + "/" + this.tagEndChar;
1598
+ } else if (typeof s === "object") {
1755
1599
  if (this.options.oneListGroup) {
1756
- const e = this.j2x(n, t + 1, i.concat(o));
1757
- r += e.val;
1758
- if (this.options.attributesGroupName && n.hasOwnProperty(this.options.attributesGroupName)) {
1759
- a += e.attrStr;
1600
+ const t = this.j2x(s, e + 1, n.concat(o));
1601
+ r += t.val;
1602
+ if (this.options.attributesGroupName && s.hasOwnProperty(this.options.attributesGroupName)) {
1603
+ a += t.attrStr;
1760
1604
  }
1761
1605
  } else {
1762
- r += this.processTextOrObjNode(n, o, t, i);
1606
+ r += this.processTextOrObjNode(s, o, e, n);
1763
1607
  }
1764
1608
  } else {
1765
1609
  if (this.options.oneListGroup) {
1766
- let e = this.options.tagValueProcessor(o, n);
1767
- e = this.replaceEntitiesValue(e);
1768
- r += e;
1610
+ let t = this.options.tagValueProcessor(o, s);
1611
+ t = this.replaceEntitiesValue(t);
1612
+ r += t;
1769
1613
  } else {
1770
- r += this.buildTextValNode(n, o, "", t);
1614
+ r += this.buildTextValNode(s, o, "", e);
1771
1615
  }
1772
1616
  }
1773
1617
  }
1774
1618
  if (this.options.oneListGroup) {
1775
- r = this.buildObjectNode(r, o, a, t);
1619
+ r = this.buildObjectNode(r, o, a, e);
1776
1620
  }
1777
- s += r;
1621
+ i += r;
1778
1622
  } else {
1779
1623
  if (this.options.attributesGroupName && o === this.options.attributesGroupName) {
1780
- const t = Object.keys(e[o]);
1781
- const i = t.length;
1782
- for (let s = 0; s < i; s++) {
1783
- n += this.buildAttrPairStr(t[s], "" + e[o][t[s]]);
1624
+ const e = Object.keys(t[o]);
1625
+ const n = e.length;
1626
+ for (let i = 0; i < n; i++) {
1627
+ s += this.buildAttrPairStr(e[i], "" + t[o][e[i]]);
1784
1628
  }
1785
1629
  } else {
1786
- s += this.processTextOrObjNode(e[o], o, t, i);
1630
+ i += this.processTextOrObjNode(t[o], o, e, n);
1787
1631
  }
1788
1632
  }
1789
1633
  }
1790
1634
  return {
1791
- attrStr: n,
1792
- val: s
1635
+ attrStr: s,
1636
+ val: i
1793
1637
  };
1794
1638
  };
1795
1639
 
1796
- xe.prototype.buildAttrPairStr = function(e, t) {
1797
- t = this.options.attributeValueProcessor(e, "" + t);
1798
- t = this.replaceEntitiesValue(t);
1799
- if (this.options.suppressBooleanAttributes && t === "true") {
1800
- return " " + e;
1801
- } else return " " + e + '="' + t + '"';
1640
+ Yt.prototype.buildAttrPairStr = function(t, e) {
1641
+ e = this.options.attributeValueProcessor(t, "" + e);
1642
+ e = this.replaceEntitiesValue(e);
1643
+ if (this.options.suppressBooleanAttributes && e === "true") {
1644
+ return " " + t;
1645
+ } else return " " + t + '="' + e + '"';
1802
1646
  };
1803
1647
 
1804
- function Ne(e, t, i, n) {
1805
- const s = this.j2x(e, i + 1, n.concat(t));
1806
- if (e[this.options.textNodeName] !== undefined && Object.keys(e).length === 1) {
1807
- return this.buildTextValNode(e[this.options.textNodeName], t, s.attrStr, i);
1648
+ function qt(t, e, n, s) {
1649
+ const i = this.j2x(t, n + 1, s.concat(e));
1650
+ if (t[this.options.textNodeName] !== undefined && Object.keys(t).length === 1) {
1651
+ return this.buildTextValNode(t[this.options.textNodeName], e, i.attrStr, n);
1808
1652
  } else {
1809
- return this.buildObjectNode(s.val, t, s.attrStr, i);
1653
+ return this.buildObjectNode(i.val, e, i.attrStr, n);
1810
1654
  }
1811
1655
  }
1812
1656
 
1813
- xe.prototype.buildObjectNode = function(e, t, i, n) {
1814
- if (e === "") {
1815
- if (t[0] === "?") return this.indentate(n) + "<" + t + i + "?" + this.tagEndChar; else {
1816
- return this.indentate(n) + "<" + t + i + this.closeTag(t) + this.tagEndChar;
1657
+ Yt.prototype.buildObjectNode = function(t, e, n, s) {
1658
+ if (t === "") {
1659
+ if (e[0] === "?") return this.indentate(s) + "<" + e + n + "?" + this.tagEndChar; else {
1660
+ return this.indentate(s) + "<" + e + n + this.closeTag(e) + this.tagEndChar;
1817
1661
  }
1818
1662
  } else {
1819
- let s = "</" + t + this.tagEndChar;
1663
+ let i = "</" + e + this.tagEndChar;
1820
1664
  let r = "";
1821
- if (t[0] === "?") {
1665
+ if (e[0] === "?") {
1822
1666
  r = "?";
1823
- s = "";
1667
+ i = "";
1824
1668
  }
1825
- if ((i || i === "") && e.indexOf("<") === -1) {
1826
- return this.indentate(n) + "<" + t + i + r + ">" + e + s;
1827
- } else if (this.options.commentPropName !== false && t === this.options.commentPropName && r.length === 0) {
1828
- return this.indentate(n) + `\x3c!--${e}--\x3e` + this.newLine;
1669
+ if ((n || n === "") && t.indexOf("<") === -1) {
1670
+ return this.indentate(s) + "<" + e + n + r + ">" + t + i;
1671
+ } else if (this.options.commentPropName !== false && e === this.options.commentPropName && r.length === 0) {
1672
+ return this.indentate(s) + `\x3c!--${t}--\x3e` + this.newLine;
1829
1673
  } else {
1830
- return this.indentate(n) + "<" + t + i + r + this.tagEndChar + e + this.indentate(n) + s;
1674
+ return this.indentate(s) + "<" + e + n + r + this.tagEndChar + t + this.indentate(s) + i;
1831
1675
  }
1832
1676
  }
1833
1677
  };
1834
1678
 
1835
- xe.prototype.closeTag = function(e) {
1836
- let t = "";
1837
- if (this.options.unpairedTags.indexOf(e) !== -1) {
1838
- if (!this.options.suppressUnpairedNode) t = "/";
1679
+ Yt.prototype.closeTag = function(t) {
1680
+ let e = "";
1681
+ if (this.options.unpairedTags.indexOf(t) !== -1) {
1682
+ if (!this.options.suppressUnpairedNode) e = "/";
1839
1683
  } else if (this.options.suppressEmptyNode) {
1840
- t = "/";
1684
+ e = "/";
1841
1685
  } else {
1842
- t = `></${e}`;
1686
+ e = `></${t}`;
1843
1687
  }
1844
- return t;
1688
+ return e;
1845
1689
  };
1846
1690
 
1847
- function be(e, t, i, n) {
1848
- if (e !== "") {
1849
- return this.buildObjectNode(e, t, i, n);
1691
+ function Wt(t, e, n, s) {
1692
+ if (t !== "") {
1693
+ return this.buildObjectNode(t, e, n, s);
1850
1694
  } else {
1851
- if (t[0] === "?") return this.indentate(n) + "<" + t + i + "?" + this.tagEndChar; else {
1852
- return this.indentate(n) + "<" + t + i + "/" + this.tagEndChar;
1695
+ if (e[0] === "?") return this.indentate(s) + "<" + e + n + "?" + this.tagEndChar; else {
1696
+ return this.indentate(s) + "<" + e + n + "/" + this.tagEndChar;
1853
1697
  }
1854
1698
  }
1855
1699
  }
1856
1700
 
1857
- xe.prototype.buildTextValNode = function(e, t, i, n) {
1858
- if (this.options.cdataPropName !== false && t === this.options.cdataPropName) {
1859
- return this.indentate(n) + `<![CDATA[${e}]]>` + this.newLine;
1860
- } else if (this.options.commentPropName !== false && t === this.options.commentPropName) {
1861
- return this.indentate(n) + `\x3c!--${e}--\x3e` + this.newLine;
1862
- } else if (t[0] === "?") {
1863
- return this.indentate(n) + "<" + t + i + "?" + this.tagEndChar;
1701
+ Yt.prototype.buildTextValNode = function(t, e, n, s) {
1702
+ if (this.options.cdataPropName !== false && e === this.options.cdataPropName) {
1703
+ return this.indentate(s) + `<![CDATA[${t}]]>` + this.newLine;
1704
+ } else if (this.options.commentPropName !== false && e === this.options.commentPropName) {
1705
+ return this.indentate(s) + `\x3c!--${t}--\x3e` + this.newLine;
1706
+ } else if (e[0] === "?") {
1707
+ return this.indentate(s) + "<" + e + n + "?" + this.tagEndChar;
1864
1708
  } else {
1865
- let s = this.options.tagValueProcessor(t, e);
1866
- s = this.replaceEntitiesValue(s);
1867
- if (s === "") {
1868
- return this.indentate(n) + "<" + t + i + this.closeTag(t) + this.tagEndChar;
1709
+ let i = this.options.tagValueProcessor(e, t);
1710
+ i = this.replaceEntitiesValue(i);
1711
+ if (i === "") {
1712
+ return this.indentate(s) + "<" + e + n + this.closeTag(e) + this.tagEndChar;
1869
1713
  } else {
1870
- return this.indentate(n) + "<" + t + i + ">" + s + "</" + t + this.tagEndChar;
1714
+ return this.indentate(s) + "<" + e + n + ">" + i + "</" + e + this.tagEndChar;
1871
1715
  }
1872
1716
  }
1873
1717
  };
1874
1718
 
1875
- xe.prototype.replaceEntitiesValue = function(e) {
1876
- if (e && e.length > 0 && this.options.processEntities) {
1877
- for (let t = 0; t < this.options.entities.length; t++) {
1878
- const i = this.options.entities[t];
1879
- e = e.replace(i.regex, i.val);
1719
+ Yt.prototype.replaceEntitiesValue = function(t) {
1720
+ if (t && t.length > 0 && this.options.processEntities) {
1721
+ for (let e = 0; e < this.options.entities.length; e++) {
1722
+ const n = this.options.entities[e];
1723
+ t = t.replace(n.regex, n.val);
1880
1724
  }
1881
1725
  }
1882
- return e;
1726
+ return t;
1883
1727
  };
1884
1728
 
1885
- function Ee(e) {
1886
- return this.options.indentBy.repeat(e);
1729
+ function zt(t) {
1730
+ return this.options.indentBy.repeat(t);
1887
1731
  }
1888
1732
 
1889
- function we(e) {
1890
- if (e.startsWith(this.options.attributeNamePrefix) && e !== this.options.textNodeName) {
1891
- return e.substr(this.attrPrefixLen);
1733
+ function Jt(t) {
1734
+ if (t.startsWith(this.options.attributeNamePrefix) && t !== this.options.textNodeName) {
1735
+ return t.substr(this.attrPrefixLen);
1892
1736
  } else {
1893
1737
  return false;
1894
1738
  }
1895
1739
  }
1896
1740
 
1741
+ var Ht = Yt;
1742
+
1743
+ const Kt = t.getDefaultExportFromCjs(Ht);
1744
+
1897
1745
  "use strict";
1898
1746
 
1899
- const Te = {
1900
- validate: d
1747
+ const Qt = e;
1748
+
1749
+ const te = Ft;
1750
+
1751
+ const ee = Ht;
1752
+
1753
+ var ne = {
1754
+ XMLParser: te,
1755
+ XMLValidator: Qt,
1756
+ XMLBuilder: ee
1901
1757
  };
1902
1758
 
1903
- function ye(e) {
1759
+ const se = t.getDefaultExportFromCjs(ne);
1760
+
1761
+ function ie(t) {
1904
1762
  try {
1905
- Te.validate(e, {
1763
+ ne.XMLValidator.validate(t, {
1906
1764
  allowBooleanAttributes: true
1907
1765
  });
1908
1766
  return true;
1909
- } catch (e) {
1767
+ } catch (t) {
1910
1768
  return false;
1911
1769
  }
1912
1770
  }
1913
1771
 
1914
- exports.IsXML = ye;
1772
+ exports.IsXML = ie;