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