node-red-contrib-tak-registration 0.15.0 → 0.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (374) hide show
  1. package/node_modules/@types/node/README.md +2 -2
  2. package/node_modules/@types/node/assert.d.ts +8 -6
  3. package/node_modules/@types/node/async_hooks.d.ts +26 -6
  4. package/node_modules/@types/node/buffer.d.ts +7 -3
  5. package/node_modules/@types/node/child_process.d.ts +28 -124
  6. package/node_modules/@types/node/cluster.d.ts +15 -15
  7. package/node_modules/@types/node/console.d.ts +17 -17
  8. package/node_modules/@types/node/crypto.d.ts +95 -38
  9. package/node_modules/@types/node/dgram.d.ts +1 -1
  10. package/node_modules/@types/node/diagnostics_channel.d.ts +18 -13
  11. package/node_modules/@types/node/dns/promises.d.ts +36 -9
  12. package/node_modules/@types/node/dns.d.ts +89 -36
  13. package/node_modules/@types/node/domain.d.ts +1 -1
  14. package/node_modules/@types/node/events.d.ts +1 -2
  15. package/node_modules/@types/node/fs/promises.d.ts +67 -40
  16. package/node_modules/@types/node/fs.d.ts +88 -52
  17. package/node_modules/@types/node/globals.d.ts +148 -351
  18. package/node_modules/@types/node/globals.typedarray.d.ts +1 -0
  19. package/node_modules/@types/node/http.d.ts +73 -7
  20. package/node_modules/@types/node/http2.d.ts +88 -15
  21. package/node_modules/@types/node/https.d.ts +1 -1
  22. package/node_modules/@types/node/index.d.ts +13 -6
  23. package/node_modules/@types/node/inspector.d.ts +222 -13
  24. package/node_modules/@types/node/module.d.ts +153 -31
  25. package/node_modules/@types/node/net.d.ts +3 -6
  26. package/node_modules/@types/node/os.d.ts +8 -7
  27. package/node_modules/@types/node/package.json +14 -84
  28. package/node_modules/@types/node/path.d.ts +1 -1
  29. package/node_modules/@types/node/perf_hooks.d.ts +24 -10
  30. package/node_modules/@types/node/process.d.ts +21 -11
  31. package/node_modules/@types/node/punycode.d.ts +1 -1
  32. package/node_modules/@types/node/querystring.d.ts +1 -1
  33. package/node_modules/@types/node/readline/promises.d.ts +0 -1
  34. package/node_modules/@types/node/readline.d.ts +13 -13
  35. package/node_modules/@types/node/repl.d.ts +25 -17
  36. package/node_modules/@types/node/sea.d.ts +1 -1
  37. package/node_modules/@types/node/sqlite.d.ts +209 -3
  38. package/node_modules/@types/node/stream/web.d.ts +8 -0
  39. package/node_modules/@types/node/stream.d.ts +30 -24
  40. package/node_modules/@types/node/string_decoder.d.ts +1 -1
  41. package/node_modules/@types/node/test.d.ts +2029 -1975
  42. package/node_modules/@types/node/timers/promises.d.ts +1 -1
  43. package/node_modules/@types/node/timers.d.ts +1 -3
  44. package/node_modules/@types/node/tls.d.ts +2 -48
  45. package/node_modules/@types/node/trace_events.d.ts +6 -6
  46. package/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
  47. package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +1 -0
  48. package/node_modules/@types/node/ts5.6/index.d.ts +15 -6
  49. package/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
  50. package/node_modules/@types/node/ts5.7/index.d.ts +101 -0
  51. package/node_modules/@types/node/tty.d.ts +1 -1
  52. package/node_modules/@types/node/url.d.ts +73 -20
  53. package/node_modules/@types/node/util.d.ts +23 -298
  54. package/node_modules/@types/node/v8.d.ts +62 -32
  55. package/node_modules/@types/node/vm.d.ts +132 -24
  56. package/node_modules/@types/node/wasi.d.ts +22 -1
  57. package/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
  58. package/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
  59. package/node_modules/@types/node/web-globals/events.d.ts +94 -0
  60. package/node_modules/@types/node/web-globals/fetch.d.ts +50 -0
  61. package/node_modules/@types/node/web-globals/navigator.d.ts +22 -0
  62. package/node_modules/@types/node/web-globals/storage.d.ts +24 -0
  63. package/node_modules/@types/node/worker_threads.d.ts +85 -26
  64. package/node_modules/@types/node/zlib.d.ts +13 -9
  65. package/node_modules/axios/CHANGELOG.md +99 -0
  66. package/node_modules/axios/README.md +105 -28
  67. package/node_modules/axios/dist/axios.js +395 -292
  68. package/node_modules/axios/dist/axios.js.map +1 -1
  69. package/node_modules/axios/dist/axios.min.js +2 -2
  70. package/node_modules/axios/dist/axios.min.js.map +1 -1
  71. package/node_modules/axios/dist/browser/axios.cjs +333 -219
  72. package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
  73. package/node_modules/axios/dist/esm/axios.js +333 -219
  74. package/node_modules/axios/dist/esm/axios.js.map +1 -1
  75. package/node_modules/axios/dist/esm/axios.min.js +2 -2
  76. package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
  77. package/node_modules/axios/dist/node/axios.cjs +424 -219
  78. package/node_modules/axios/dist/node/axios.cjs.map +1 -1
  79. package/node_modules/axios/index.d.cts +26 -8
  80. package/node_modules/axios/index.d.ts +14 -5
  81. package/node_modules/axios/lib/adapters/adapters.js +6 -4
  82. package/node_modules/axios/lib/adapters/fetch.js +221 -162
  83. package/node_modules/axios/lib/adapters/http.js +18 -0
  84. package/node_modules/axios/lib/adapters/xhr.js +11 -8
  85. package/node_modules/axios/lib/core/Axios.js +2 -4
  86. package/node_modules/axios/lib/core/AxiosError.js +10 -3
  87. package/node_modules/axios/lib/core/dispatchRequest.js +1 -1
  88. package/node_modules/axios/lib/core/mergeConfig.js +1 -1
  89. package/node_modules/axios/lib/defaults/index.js +1 -1
  90. package/node_modules/axios/lib/env/data.js +1 -1
  91. package/node_modules/axios/lib/helpers/buildURL.js +1 -3
  92. package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +73 -0
  93. package/node_modules/axios/lib/helpers/resolveConfig.js +13 -9
  94. package/node_modules/axios/lib/helpers/throttle.js +1 -1
  95. package/node_modules/axios/lib/helpers/toFormData.js +4 -0
  96. package/node_modules/axios/lib/helpers/toURLEncodedForm.js +4 -3
  97. package/node_modules/axios/lib/utils.js +40 -2
  98. package/node_modules/axios/package.json +30 -15
  99. package/node_modules/bignumber.js/CHANGELOG.md +6 -1
  100. package/node_modules/bignumber.js/README.md +5 -4
  101. package/node_modules/bignumber.js/bignumber.js +2 -2
  102. package/node_modules/bignumber.js/bignumber.mjs +2 -2
  103. package/node_modules/bignumber.js/package.json +1 -1
  104. package/node_modules/fast-xml-parser/CHANGELOG.md +7 -0
  105. package/node_modules/fast-xml-parser/lib/fxp.cjs +1 -1
  106. package/node_modules/fast-xml-parser/lib/fxp.min.js +1 -1
  107. package/node_modules/fast-xml-parser/lib/fxp.min.js.map +1 -1
  108. package/node_modules/fast-xml-parser/lib/fxparser.min.js +1 -1
  109. package/node_modules/fast-xml-parser/lib/fxparser.min.js.map +1 -1
  110. package/node_modules/fast-xml-parser/package.json +1 -2
  111. package/node_modules/fast-xml-parser/src/cli/cli.js +4 -0
  112. package/node_modules/fast-xml-parser/src/fxp.d.ts +5 -5
  113. package/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +3 -3
  114. package/node_modules/follow-redirects/package.json +1 -1
  115. package/node_modules/form-data/CHANGELOG.md +601 -0
  116. package/node_modules/form-data/{Readme.md → README.md} +34 -37
  117. package/node_modules/form-data/lib/browser.js +3 -1
  118. package/node_modules/form-data/lib/form_data.js +126 -135
  119. package/node_modules/form-data/lib/populate.js +5 -5
  120. package/node_modules/form-data/package.json +24 -16
  121. package/node_modules/protobufjs/dist/light/protobuf.js +8 -7
  122. package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
  123. package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
  124. package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
  125. package/node_modules/protobufjs/dist/minimal/protobuf.js +2 -2
  126. package/node_modules/protobufjs/dist/minimal/protobuf.min.js +2 -2
  127. package/node_modules/protobufjs/dist/protobuf.js +8 -7
  128. package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
  129. package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
  130. package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
  131. package/node_modules/protobufjs/ext/descriptor/index.js +179 -69
  132. package/node_modules/protobufjs/google/protobuf/descriptor.json +660 -17
  133. package/node_modules/protobufjs/google/protobuf/descriptor.proto +255 -6
  134. package/node_modules/protobufjs/package.json +1 -1
  135. package/node_modules/protobufjs/src/namespace.js +3 -1
  136. package/node_modules/protobufjs/src/root.js +3 -4
  137. package/node_modules/undici-types/agent.d.ts +11 -7
  138. package/node_modules/undici-types/api.d.ts +24 -24
  139. package/node_modules/undici-types/balanced-pool.d.ts +11 -11
  140. package/node_modules/undici-types/cache-interceptor.d.ts +172 -0
  141. package/node_modules/undici-types/client-stats.d.ts +15 -0
  142. package/node_modules/undici-types/client.d.ts +18 -16
  143. package/node_modules/undici-types/cookies.d.ts +2 -0
  144. package/node_modules/undici-types/diagnostics-channel.d.ts +19 -10
  145. package/node_modules/undici-types/dispatcher.d.ts +119 -93
  146. package/node_modules/undici-types/env-http-proxy-agent.d.ts +4 -3
  147. package/node_modules/undici-types/errors.d.ts +69 -47
  148. package/node_modules/undici-types/eventsource.d.ts +3 -3
  149. package/node_modules/undici-types/fetch.d.ts +18 -16
  150. package/node_modules/undici-types/formdata.d.ts +7 -7
  151. package/node_modules/undici-types/global-dispatcher.d.ts +4 -4
  152. package/node_modules/undici-types/global-origin.d.ts +5 -5
  153. package/node_modules/undici-types/h2c-client.d.ts +75 -0
  154. package/node_modules/undici-types/handlers.d.ts +8 -8
  155. package/node_modules/undici-types/header.d.ts +157 -1
  156. package/node_modules/undici-types/index.d.ts +51 -47
  157. package/node_modules/undici-types/interceptors.d.ts +25 -8
  158. package/node_modules/undici-types/mock-agent.d.ts +36 -18
  159. package/node_modules/undici-types/mock-call-history.d.ts +111 -0
  160. package/node_modules/undici-types/mock-client.d.ts +6 -4
  161. package/node_modules/undici-types/mock-errors.d.ts +3 -3
  162. package/node_modules/undici-types/mock-interceptor.d.ts +21 -19
  163. package/node_modules/undici-types/mock-pool.d.ts +6 -4
  164. package/node_modules/undici-types/package.json +1 -1
  165. package/node_modules/undici-types/patch.d.ts +0 -4
  166. package/node_modules/undici-types/pool-stats.d.ts +8 -8
  167. package/node_modules/undici-types/pool.d.ts +14 -12
  168. package/node_modules/undici-types/proxy-agent.d.ts +5 -4
  169. package/node_modules/undici-types/readable.d.ts +18 -15
  170. package/node_modules/undici-types/retry-agent.d.ts +1 -1
  171. package/node_modules/undici-types/retry-handler.d.ts +19 -10
  172. package/node_modules/undici-types/util.d.ts +3 -3
  173. package/node_modules/undici-types/utility.d.ts +7 -0
  174. package/node_modules/undici-types/webidl.d.ts +50 -8
  175. package/node_modules/undici-types/websocket.d.ts +36 -2
  176. package/node_modules/uuid/README.md +8 -19
  177. package/node_modules/uuid/dist/{esm-browser/uuid-bin.js → uuid-bin.js} +1 -1
  178. package/node_modules/uuid/dist/{esm-browser/v4.js → v4.js} +7 -4
  179. package/node_modules/uuid/{dist/esm → dist-node}/md5.js +1 -1
  180. package/node_modules/uuid/dist-node/native.js +2 -0
  181. package/node_modules/uuid/{dist/esm → dist-node}/rng.js +1 -1
  182. package/node_modules/uuid/{dist/esm → dist-node}/sha1.js +1 -1
  183. package/node_modules/uuid/{dist/esm → dist-node}/uuid-bin.js +1 -1
  184. package/node_modules/uuid/{dist/esm → dist-node}/v4.js +7 -4
  185. package/node_modules/uuid/package.json +28 -41
  186. package/package.json +6 -6
  187. package/tak-registration.bak +557 -0
  188. package/tak-registration.js +14 -12
  189. package/node_modules/@types/node/compatibility/disposable.d.ts +0 -16
  190. package/node_modules/@types/node/compatibility/index.d.ts +0 -9
  191. package/node_modules/@types/node/compatibility/indexable.d.ts +0 -23
  192. package/node_modules/@types/node/dom-events.d.ts +0 -124
  193. package/node_modules/undici-types/file.d.ts +0 -39
  194. package/node_modules/undici-types/filereader.d.ts +0 -54
  195. package/node_modules/uuid/dist/cjs/index.d.ts +0 -15
  196. package/node_modules/uuid/dist/cjs/index.js +0 -31
  197. package/node_modules/uuid/dist/cjs/max.d.ts +0 -2
  198. package/node_modules/uuid/dist/cjs/max.js +0 -3
  199. package/node_modules/uuid/dist/cjs/md5.d.ts +0 -4
  200. package/node_modules/uuid/dist/cjs/md5.js +0 -13
  201. package/node_modules/uuid/dist/cjs/native.d.ts +0 -6
  202. package/node_modules/uuid/dist/cjs/native.js +0 -4
  203. package/node_modules/uuid/dist/cjs/nil.d.ts +0 -2
  204. package/node_modules/uuid/dist/cjs/nil.js +0 -3
  205. package/node_modules/uuid/dist/cjs/package.json +0 -1
  206. package/node_modules/uuid/dist/cjs/parse.d.ts +0 -2
  207. package/node_modules/uuid/dist/cjs/parse.js +0 -11
  208. package/node_modules/uuid/dist/cjs/regex.d.ts +0 -2
  209. package/node_modules/uuid/dist/cjs/regex.js +0 -3
  210. package/node_modules/uuid/dist/cjs/rng.d.ts +0 -1
  211. package/node_modules/uuid/dist/cjs/rng.js +0 -13
  212. package/node_modules/uuid/dist/cjs/sha1.d.ts +0 -4
  213. package/node_modules/uuid/dist/cjs/sha1.js +0 -13
  214. package/node_modules/uuid/dist/cjs/stringify.d.ts +0 -3
  215. package/node_modules/uuid/dist/cjs/stringify.js +0 -39
  216. package/node_modules/uuid/dist/cjs/types.d.ts +0 -21
  217. package/node_modules/uuid/dist/cjs/types.js +0 -2
  218. package/node_modules/uuid/dist/cjs/uuid-bin.d.ts +0 -1
  219. package/node_modules/uuid/dist/cjs/uuid-bin.js +0 -72
  220. package/node_modules/uuid/dist/cjs/v1.d.ts +0 -11
  221. package/node_modules/uuid/dist/cjs/v1.js +0 -87
  222. package/node_modules/uuid/dist/cjs/v1ToV6.d.ts +0 -2
  223. package/node_modules/uuid/dist/cjs/v1ToV6.js +0 -13
  224. package/node_modules/uuid/dist/cjs/v3.d.ts +0 -9
  225. package/node_modules/uuid/dist/cjs/v3.js +0 -14
  226. package/node_modules/uuid/dist/cjs/v35.d.ts +0 -7
  227. package/node_modules/uuid/dist/cjs/v35.js +0 -41
  228. package/node_modules/uuid/dist/cjs/v4.d.ts +0 -4
  229. package/node_modules/uuid/dist/cjs/v4.js +0 -29
  230. package/node_modules/uuid/dist/cjs/v5.d.ts +0 -9
  231. package/node_modules/uuid/dist/cjs/v5.js +0 -14
  232. package/node_modules/uuid/dist/cjs/v6.d.ts +0 -4
  233. package/node_modules/uuid/dist/cjs/v6.js +0 -19
  234. package/node_modules/uuid/dist/cjs/v6ToV1.d.ts +0 -2
  235. package/node_modules/uuid/dist/cjs/v6ToV1.js +0 -13
  236. package/node_modules/uuid/dist/cjs/v7.d.ts +0 -9
  237. package/node_modules/uuid/dist/cjs/v7.js +0 -69
  238. package/node_modules/uuid/dist/cjs/validate.d.ts +0 -2
  239. package/node_modules/uuid/dist/cjs/validate.js +0 -7
  240. package/node_modules/uuid/dist/cjs/version.d.ts +0 -2
  241. package/node_modules/uuid/dist/cjs/version.js +0 -10
  242. package/node_modules/uuid/dist/cjs-browser/index.js +0 -31
  243. package/node_modules/uuid/dist/cjs-browser/max.js +0 -3
  244. package/node_modules/uuid/dist/cjs-browser/md5.js +0 -137
  245. package/node_modules/uuid/dist/cjs-browser/native.js +0 -4
  246. package/node_modules/uuid/dist/cjs-browser/nil.js +0 -3
  247. package/node_modules/uuid/dist/cjs-browser/package.json +0 -1
  248. package/node_modules/uuid/dist/cjs-browser/parse.js +0 -11
  249. package/node_modules/uuid/dist/cjs-browser/regex.js +0 -3
  250. package/node_modules/uuid/dist/cjs-browser/rng.js +0 -14
  251. package/node_modules/uuid/dist/cjs-browser/sha1.js +0 -72
  252. package/node_modules/uuid/dist/cjs-browser/stringify.js +0 -39
  253. package/node_modules/uuid/dist/cjs-browser/types.js +0 -2
  254. package/node_modules/uuid/dist/cjs-browser/uuid-bin.js +0 -72
  255. package/node_modules/uuid/dist/cjs-browser/v1.js +0 -87
  256. package/node_modules/uuid/dist/cjs-browser/v1ToV6.js +0 -13
  257. package/node_modules/uuid/dist/cjs-browser/v3.js +0 -14
  258. package/node_modules/uuid/dist/cjs-browser/v35.js +0 -41
  259. package/node_modules/uuid/dist/cjs-browser/v4.js +0 -29
  260. package/node_modules/uuid/dist/cjs-browser/v5.js +0 -14
  261. package/node_modules/uuid/dist/cjs-browser/v6.js +0 -19
  262. package/node_modules/uuid/dist/cjs-browser/v6ToV1.js +0 -13
  263. package/node_modules/uuid/dist/cjs-browser/v7.js +0 -69
  264. package/node_modules/uuid/dist/cjs-browser/validate.js +0 -7
  265. package/node_modules/uuid/dist/cjs-browser/version.js +0 -10
  266. package/node_modules/uuid/dist/esm/index.d.ts +0 -15
  267. package/node_modules/uuid/dist/esm/max.d.ts +0 -2
  268. package/node_modules/uuid/dist/esm/md5.d.ts +0 -4
  269. package/node_modules/uuid/dist/esm/native.d.ts +0 -6
  270. package/node_modules/uuid/dist/esm/native.js +0 -2
  271. package/node_modules/uuid/dist/esm/nil.d.ts +0 -2
  272. package/node_modules/uuid/dist/esm/parse.d.ts +0 -2
  273. package/node_modules/uuid/dist/esm/regex.d.ts +0 -2
  274. package/node_modules/uuid/dist/esm/rng.d.ts +0 -1
  275. package/node_modules/uuid/dist/esm/sha1.d.ts +0 -4
  276. package/node_modules/uuid/dist/esm/stringify.d.ts +0 -3
  277. package/node_modules/uuid/dist/esm/types.d.ts +0 -21
  278. package/node_modules/uuid/dist/esm/uuid-bin.d.ts +0 -1
  279. package/node_modules/uuid/dist/esm/v1.d.ts +0 -11
  280. package/node_modules/uuid/dist/esm/v1ToV6.d.ts +0 -2
  281. package/node_modules/uuid/dist/esm/v3.d.ts +0 -9
  282. package/node_modules/uuid/dist/esm/v35.d.ts +0 -7
  283. package/node_modules/uuid/dist/esm/v4.d.ts +0 -4
  284. package/node_modules/uuid/dist/esm/v5.d.ts +0 -9
  285. package/node_modules/uuid/dist/esm/v6.d.ts +0 -4
  286. package/node_modules/uuid/dist/esm/v6ToV1.d.ts +0 -2
  287. package/node_modules/uuid/dist/esm/v7.d.ts +0 -9
  288. package/node_modules/uuid/dist/esm/validate.d.ts +0 -2
  289. package/node_modules/uuid/dist/esm/version.d.ts +0 -2
  290. package/node_modules/uuid/dist/esm-browser/index.d.ts +0 -15
  291. package/node_modules/uuid/dist/esm-browser/max.d.ts +0 -2
  292. package/node_modules/uuid/dist/esm-browser/md5.d.ts +0 -2
  293. package/node_modules/uuid/dist/esm-browser/native.d.ts +0 -4
  294. package/node_modules/uuid/dist/esm-browser/nil.d.ts +0 -2
  295. package/node_modules/uuid/dist/esm-browser/parse.d.ts +0 -2
  296. package/node_modules/uuid/dist/esm-browser/regex.d.ts +0 -2
  297. package/node_modules/uuid/dist/esm-browser/rng.d.ts +0 -1
  298. package/node_modules/uuid/dist/esm-browser/sha1.d.ts +0 -2
  299. package/node_modules/uuid/dist/esm-browser/stringify.d.ts +0 -3
  300. package/node_modules/uuid/dist/esm-browser/types.d.ts +0 -21
  301. package/node_modules/uuid/dist/esm-browser/uuid-bin.d.ts +0 -1
  302. package/node_modules/uuid/dist/esm-browser/v1.d.ts +0 -11
  303. package/node_modules/uuid/dist/esm-browser/v1ToV6.d.ts +0 -2
  304. package/node_modules/uuid/dist/esm-browser/v3.d.ts +0 -9
  305. package/node_modules/uuid/dist/esm-browser/v35.d.ts +0 -7
  306. package/node_modules/uuid/dist/esm-browser/v4.d.ts +0 -4
  307. package/node_modules/uuid/dist/esm-browser/v5.d.ts +0 -9
  308. package/node_modules/uuid/dist/esm-browser/v6.d.ts +0 -4
  309. package/node_modules/uuid/dist/esm-browser/v6ToV1.d.ts +0 -2
  310. package/node_modules/uuid/dist/esm-browser/v7.d.ts +0 -9
  311. package/node_modules/uuid/dist/esm-browser/validate.d.ts +0 -2
  312. package/node_modules/uuid/dist/esm-browser/version.d.ts +0 -2
  313. /package/node_modules/uuid/dist/{cjs-browser/index.d.ts → index.d.ts} +0 -0
  314. /package/node_modules/uuid/dist/{esm/index.js → index.js} +0 -0
  315. /package/node_modules/uuid/dist/{cjs-browser/max.d.ts → max.d.ts} +0 -0
  316. /package/node_modules/uuid/dist/{esm/max.js → max.js} +0 -0
  317. /package/node_modules/uuid/dist/{cjs-browser/md5.d.ts → md5.d.ts} +0 -0
  318. /package/node_modules/uuid/dist/{esm-browser/md5.js → md5.js} +0 -0
  319. /package/node_modules/uuid/dist/{cjs-browser/native.d.ts → native.d.ts} +0 -0
  320. /package/node_modules/uuid/dist/{esm-browser/native.js → native.js} +0 -0
  321. /package/node_modules/uuid/dist/{cjs-browser/nil.d.ts → nil.d.ts} +0 -0
  322. /package/node_modules/uuid/dist/{esm/nil.js → nil.js} +0 -0
  323. /package/node_modules/uuid/dist/{cjs-browser/parse.d.ts → parse.d.ts} +0 -0
  324. /package/node_modules/uuid/dist/{esm/parse.js → parse.js} +0 -0
  325. /package/node_modules/uuid/dist/{cjs-browser/regex.d.ts → regex.d.ts} +0 -0
  326. /package/node_modules/uuid/dist/{esm/regex.js → regex.js} +0 -0
  327. /package/node_modules/uuid/dist/{cjs-browser/rng.d.ts → rng.d.ts} +0 -0
  328. /package/node_modules/uuid/dist/{esm-browser/rng.js → rng.js} +0 -0
  329. /package/node_modules/uuid/dist/{cjs-browser/sha1.d.ts → sha1.d.ts} +0 -0
  330. /package/node_modules/uuid/dist/{esm-browser/sha1.js → sha1.js} +0 -0
  331. /package/node_modules/uuid/dist/{cjs-browser/stringify.d.ts → stringify.d.ts} +0 -0
  332. /package/node_modules/uuid/dist/{esm/stringify.js → stringify.js} +0 -0
  333. /package/node_modules/uuid/dist/{cjs-browser/types.d.ts → types.d.ts} +0 -0
  334. /package/node_modules/uuid/dist/{esm/types.js → types.js} +0 -0
  335. /package/node_modules/uuid/dist/{cjs-browser/uuid-bin.d.ts → uuid-bin.d.ts} +0 -0
  336. /package/node_modules/uuid/dist/{cjs-browser/v1.d.ts → v1.d.ts} +0 -0
  337. /package/node_modules/uuid/dist/{esm/v1.js → v1.js} +0 -0
  338. /package/node_modules/uuid/dist/{cjs-browser/v1ToV6.d.ts → v1ToV6.d.ts} +0 -0
  339. /package/node_modules/uuid/dist/{esm/v1ToV6.js → v1ToV6.js} +0 -0
  340. /package/node_modules/uuid/dist/{cjs-browser/v3.d.ts → v3.d.ts} +0 -0
  341. /package/node_modules/uuid/dist/{esm/v3.js → v3.js} +0 -0
  342. /package/node_modules/uuid/dist/{cjs-browser/v35.d.ts → v35.d.ts} +0 -0
  343. /package/node_modules/uuid/dist/{esm/v35.js → v35.js} +0 -0
  344. /package/node_modules/uuid/dist/{cjs-browser/v4.d.ts → v4.d.ts} +0 -0
  345. /package/node_modules/uuid/dist/{cjs-browser/v5.d.ts → v5.d.ts} +0 -0
  346. /package/node_modules/uuid/dist/{esm/v5.js → v5.js} +0 -0
  347. /package/node_modules/uuid/dist/{cjs-browser/v6.d.ts → v6.d.ts} +0 -0
  348. /package/node_modules/uuid/dist/{esm/v6.js → v6.js} +0 -0
  349. /package/node_modules/uuid/dist/{cjs-browser/v6ToV1.d.ts → v6ToV1.d.ts} +0 -0
  350. /package/node_modules/uuid/dist/{esm/v6ToV1.js → v6ToV1.js} +0 -0
  351. /package/node_modules/uuid/dist/{cjs-browser/v7.d.ts → v7.d.ts} +0 -0
  352. /package/node_modules/uuid/dist/{esm/v7.js → v7.js} +0 -0
  353. /package/node_modules/uuid/dist/{cjs-browser/validate.d.ts → validate.d.ts} +0 -0
  354. /package/node_modules/uuid/dist/{esm/validate.js → validate.js} +0 -0
  355. /package/node_modules/uuid/dist/{cjs-browser/version.d.ts → version.d.ts} +0 -0
  356. /package/node_modules/uuid/dist/{esm/version.js → version.js} +0 -0
  357. /package/node_modules/uuid/{dist/esm → dist-node}/bin/uuid +0 -0
  358. /package/node_modules/uuid/{dist/esm-browser → dist-node}/index.js +0 -0
  359. /package/node_modules/uuid/{dist/esm-browser → dist-node}/max.js +0 -0
  360. /package/node_modules/uuid/{dist/esm-browser → dist-node}/nil.js +0 -0
  361. /package/node_modules/uuid/{dist/esm-browser → dist-node}/parse.js +0 -0
  362. /package/node_modules/uuid/{dist/esm-browser → dist-node}/regex.js +0 -0
  363. /package/node_modules/uuid/{dist/esm-browser → dist-node}/stringify.js +0 -0
  364. /package/node_modules/uuid/{dist/esm-browser → dist-node}/types.js +0 -0
  365. /package/node_modules/uuid/{dist/esm-browser → dist-node}/v1.js +0 -0
  366. /package/node_modules/uuid/{dist/esm-browser → dist-node}/v1ToV6.js +0 -0
  367. /package/node_modules/uuid/{dist/esm-browser → dist-node}/v3.js +0 -0
  368. /package/node_modules/uuid/{dist/esm-browser → dist-node}/v35.js +0 -0
  369. /package/node_modules/uuid/{dist/esm-browser → dist-node}/v5.js +0 -0
  370. /package/node_modules/uuid/{dist/esm-browser → dist-node}/v6.js +0 -0
  371. /package/node_modules/uuid/{dist/esm-browser → dist-node}/v6ToV1.js +0 -0
  372. /package/node_modules/uuid/{dist/esm-browser → dist-node}/v7.js +0 -0
  373. /package/node_modules/uuid/{dist/esm-browser → dist-node}/validate.js +0 -0
  374. /package/node_modules/uuid/{dist/esm-browser → dist-node}/version.js +0 -0
@@ -1,5 +1,12 @@
1
1
  <small>Note: If you find missing information about particular minor version, that version must have been changed without any functional change in this library.</small>
2
2
 
3
+ **5.2.5 / 2025-06-08**
4
+ - Inform user to use [fxp-cli](https://github.com/NaturalIntelligence/fxp-cli) instead of in-built CLI feature
5
+ - Export typings for direct use
6
+
7
+ **5.2.4 / 2025-06-06**
8
+ - fix (#747): fix EMPTY and ANY with ELEMENT in DOCTYPE
9
+
3
10
  **5.2.3 / 2025-05-11**
4
11
  - fix (#747): support EMPTY and ANY with ELEMENT in DOCTYPE
5
12
 
@@ -1 +1 @@
1
- (()=>{"use strict";var t={d:(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{XMLBuilder:()=>ft,XMLParser:()=>st,XMLValidator:()=>mt});const n=":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",i=new RegExp("^["+n+"]["+n+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");function s(t,e){const n=[];let i=e.exec(t);for(;i;){const s=[];s.startIndex=e.lastIndex-i[0].length;const r=i.length;for(let t=0;t<r;t++)s.push(i[t]);n.push(s),i=e.exec(t)}return n}const r=function(t){return!(null==i.exec(t))},o={allowBooleanAttributes:!1,unpairedTags:[]};function a(t,e){e=Object.assign({},o,e);const n=[];let i=!1,s=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(let o=0;o<t.length;o++)if("<"===t[o]&&"?"===t[o+1]){if(o+=2,o=u(t,o),o.err)return o}else{if("<"!==t[o]){if(l(t[o]))continue;return x("InvalidChar","char '"+t[o]+"' is not expected.",N(t,o))}{let a=o;if(o++,"!"===t[o]){o=h(t,o);continue}{let d=!1;"/"===t[o]&&(d=!0,o++);let f="";for(;o<t.length&&">"!==t[o]&&" "!==t[o]&&"\t"!==t[o]&&"\n"!==t[o]&&"\r"!==t[o];o++)f+=t[o];if(f=f.trim(),"/"===f[f.length-1]&&(f=f.substring(0,f.length-1),o--),!r(f)){let e;return e=0===f.trim().length?"Invalid space after '<'.":"Tag '"+f+"' is an invalid name.",x("InvalidTag",e,N(t,o))}const p=c(t,o);if(!1===p)return x("InvalidAttr","Attributes for '"+f+"' have open quote.",N(t,o));let b=p.value;if(o=p.index,"/"===b[b.length-1]){const n=o-b.length;b=b.substring(0,b.length-1);const s=g(b,e);if(!0!==s)return x(s.err.code,s.err.msg,N(t,n+s.err.line));i=!0}else if(d){if(!p.tagClosed)return x("InvalidTag","Closing tag '"+f+"' doesn't have proper closing.",N(t,o));if(b.trim().length>0)return x("InvalidTag","Closing tag '"+f+"' can't have attributes or invalid starting.",N(t,a));if(0===n.length)return x("InvalidTag","Closing tag '"+f+"' has not been opened.",N(t,a));{const e=n.pop();if(f!==e.tagName){let n=N(t,e.tagStartPos);return x("InvalidTag","Expected closing tag '"+e.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+f+"'.",N(t,a))}0==n.length&&(s=!0)}}else{const r=g(b,e);if(!0!==r)return x(r.err.code,r.err.msg,N(t,o-b.length+r.err.line));if(!0===s)return x("InvalidXml","Multiple possible root nodes found.",N(t,o));-1!==e.unpairedTags.indexOf(f)||n.push({tagName:f,tagStartPos:a}),i=!0}for(o++;o<t.length;o++)if("<"===t[o]){if("!"===t[o+1]){o++,o=h(t,o);continue}if("?"!==t[o+1])break;if(o=u(t,++o),o.err)return o}else if("&"===t[o]){const e=m(t,o);if(-1==e)return x("InvalidChar","char '&' is not expected.",N(t,o));o=e}else if(!0===s&&!l(t[o]))return x("InvalidXml","Extra text at the end",N(t,o));"<"===t[o]&&o--}}}return i?1==n.length?x("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",N(t,n[0].tagStartPos)):!(n.length>0)||x("InvalidXml","Invalid '"+JSON.stringify(n.map((t=>t.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):x("InvalidXml","Start tag expected.",1)}function l(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function u(t,e){const n=e;for(;e<t.length;e++)if("?"!=t[e]&&" "!=t[e]);else{const i=t.substr(n,e-n);if(e>5&&"xml"===i)return x("InvalidXml","XML declaration allowed only at the start of the document.",N(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function h(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){let n=1;for(e+=8;e<t.length;e++)if("<"===t[e])n++;else if(">"===t[e]&&(n--,0===n))break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}const d='"',f="'";function c(t,e){let n="",i="",s=!1;for(;e<t.length;e++){if(t[e]===d||t[e]===f)""===i?i=t[e]:i!==t[e]||(i="");else if(">"===t[e]&&""===i){s=!0;break}n+=t[e]}return""===i&&{value:n,index:e,tagClosed:s}}const p=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function g(t,e){const n=s(t,p),i={};for(let t=0;t<n.length;t++){if(0===n[t][1].length)return x("InvalidAttr","Attribute '"+n[t][2]+"' has no space in starting.",E(n[t]));if(void 0!==n[t][3]&&void 0===n[t][4])return x("InvalidAttr","Attribute '"+n[t][2]+"' is without value.",E(n[t]));if(void 0===n[t][3]&&!e.allowBooleanAttributes)return x("InvalidAttr","boolean attribute '"+n[t][2]+"' is not allowed.",E(n[t]));const s=n[t][2];if(!b(s))return x("InvalidAttr","Attribute '"+s+"' is an invalid name.",E(n[t]));if(i.hasOwnProperty(s))return x("InvalidAttr","Attribute '"+s+"' is repeated.",E(n[t]));i[s]=1}return!0}function m(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){let n=/\d/;for("x"===t[e]&&(e++,n=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(n))break}return-1}(t,++e);let n=0;for(;e<t.length;e++,n++)if(!(t[e].match(/\w/)&&n<20)){if(";"===t[e])break;return-1}return e}function x(t,e,n){return{err:{code:t,msg:e,line:n.line||n,col:n.col}}}function b(t){return r(t)}function N(t,e){const n=t.substring(0,e).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function E(t){return t.startIndex+t[1].length}const v={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,n){return t},captureMetaData:!1};let y;y="function"!=typeof Symbol?"@@xmlMetadata":Symbol("XML Node Metadata");class T{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t,e){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child}),void 0!==e&&(this.child[this.child.length-1][y]={startIndex:e})}static getMetaDataSymbol(){return y}}function w(t,e){const n={};if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");{e+=9;let i=1,s=!1,r=!1,o="";for(;e<t.length;e++)if("<"!==t[e]||r)if(">"===t[e]){if(r?"-"===t[e-1]&&"-"===t[e-2]&&(r=!1,i--):i--,0===i)break}else"["===t[e]?s=!0:o+=t[e];else{if(s&&C(t,"!ENTITY",e)){let i,s;e+=7,[i,s,e]=O(t,e+1),-1===s.indexOf("&")&&(n[i]={regx:RegExp(`&${i};`,"g"),val:s})}else if(s&&C(t,"!ELEMENT",e)){e+=8;const{index:n}=S(t,e+1);e=n}else if(s&&C(t,"!ATTLIST",e))e+=8;else if(s&&C(t,"!NOTATION",e)){e+=9;const{index:n}=A(t,e+1);e=n}else{if(!C(t,"!--",e))throw new Error("Invalid DOCTYPE");r=!0}i++,o=""}if(0!==i)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:e}}const P=(t,e)=>{for(;e<t.length&&/\s/.test(t[e]);)e++;return e};function O(t,e){e=P(t,e);let n="";for(;e<t.length&&!/\s/.test(t[e])&&'"'!==t[e]&&"'"!==t[e];)n+=t[e],e++;if($(n),e=P(t,e),"SYSTEM"===t.substring(e,e+6).toUpperCase())throw new Error("External entities are not supported");if("%"===t[e])throw new Error("Parameter entities are not supported");let i="";return[e,i]=I(t,e,"entity"),[n,i,--e]}function A(t,e){e=P(t,e);let n="";for(;e<t.length&&!/\s/.test(t[e]);)n+=t[e],e++;$(n),e=P(t,e);const i=t.substring(e,e+6).toUpperCase();if("SYSTEM"!==i&&"PUBLIC"!==i)throw new Error(`Expected SYSTEM or PUBLIC, found "${i}"`);e+=i.length,e=P(t,e);let s=null,r=null;if("PUBLIC"===i)[e,s]=I(t,e,"publicIdentifier"),'"'!==t[e=P(t,e)]&&"'"!==t[e]||([e,r]=I(t,e,"systemIdentifier"));else if("SYSTEM"===i&&([e,r]=I(t,e,"systemIdentifier"),!r))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:n,publicIdentifier:s,systemIdentifier:r,index:--e}}function I(t,e,n){let i="";const s=t[e];if('"'!==s&&"'"!==s)throw new Error(`Expected quoted string, found "${s}"`);for(e++;e<t.length&&t[e]!==s;)i+=t[e],e++;if(t[e]!==s)throw new Error(`Unterminated ${n} value`);return[++e,i]}function S(t,e){e=P(t,e);let n="";for(;e<t.length&&!/\s/.test(t[e]);)n+=t[e],e++;if(!$(n))throw new Error(`Invalid element name: "${n}"`);let i="";if("E"===t[e=P(t,e)]&&C(t,"MPTY",e))e+=6;else if("A"===t[e]&&C(t,"NY",e))e+=4;else{if("("!==t[e])throw new Error(`Invalid Element Expression, found "${t[e]}"`);for(e++;e<t.length&&")"!==t[e];)i+=t[e],e++;if(")"!==t[e])throw new Error("Unterminated content model")}return{elementName:n,contentModel:i.trim(),index:e}}function C(t,e,n){for(let i=0;i<e.length;i++)if(e[i]!==t[n+i+1])return!1;return!0}function $(t){if(r(t))return t;throw new Error(`Invalid entity name ${t}`)}const j=/^[-+]?0x[a-fA-F0-9]+$/,D=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,V={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};const M=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function _(t){return"function"==typeof t?t:Array.isArray(t)?e=>{for(const n of t){if("string"==typeof n&&e===n)return!0;if(n instanceof RegExp&&n.test(e))return!0}}:()=>!1}class k{constructor(t){this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(t,e)=>String.fromCodePoint(Number.parseInt(e,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(t,e)=>String.fromCodePoint(Number.parseInt(e,16))}},this.addExternalEntities=F,this.parseXml=X,this.parseTextData=L,this.resolveNameSpace=B,this.buildAttributesMap=G,this.isItStopNode=Z,this.replaceEntitiesValue=R,this.readStopNodeData=J,this.saveTextToParentTag=q,this.addChild=Y,this.ignoreAttributesFn=_(this.options.ignoreAttributes)}}function F(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const i=e[n];this.lastEntities[i]={regex:new RegExp("&"+i+";","g"),val:t[i]}}}function L(t,e,n,i,s,r,o){if(void 0!==t&&(this.options.trimValues&&!i&&(t=t.trim()),t.length>0)){o||(t=this.replaceEntitiesValue(t));const i=this.options.tagValueProcessor(e,t,n,s,r);return null==i?t:typeof i!=typeof t||i!==t?i:this.options.trimValues||t.trim()===t?H(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function B(t){if(this.options.removeNSPrefix){const e=t.split(":"),n="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=n+e[1])}return t}const U=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function G(t,e,n){if(!0!==this.options.ignoreAttributes&&"string"==typeof t){const n=s(t,U),i=n.length,r={};for(let t=0;t<i;t++){const i=this.resolveNameSpace(n[t][1]);if(this.ignoreAttributesFn(i,e))continue;let s=n[t][4],o=this.options.attributeNamePrefix+i;if(i.length)if(this.options.transformAttributeName&&(o=this.options.transformAttributeName(o)),"__proto__"===o&&(o="#__proto__"),void 0!==s){this.options.trimValues&&(s=s.trim()),s=this.replaceEntitiesValue(s);const t=this.options.attributeValueProcessor(i,s,e);r[o]=null==t?s:typeof t!=typeof s||t!==s?t:H(s,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(r[o]=!0)}if(!Object.keys(r).length)return;if(this.options.attributesGroupName){const t={};return t[this.options.attributesGroupName]=r,t}return r}}const X=function(t){t=t.replace(/\r\n?/g,"\n");const e=new T("!xml");let n=e,i="",s="";for(let r=0;r<t.length;r++)if("<"===t[r])if("/"===t[r+1]){const e=W(t,">",r,"Closing Tag is not closed.");let o=t.substring(r+2,e).trim();if(this.options.removeNSPrefix){const t=o.indexOf(":");-1!==t&&(o=o.substr(t+1))}this.options.transformTagName&&(o=this.options.transformTagName(o)),n&&(i=this.saveTextToParentTag(i,n,s));const a=s.substring(s.lastIndexOf(".")+1);if(o&&-1!==this.options.unpairedTags.indexOf(o))throw new Error(`Unpaired tag can not be used as closing tag: </${o}>`);let l=0;a&&-1!==this.options.unpairedTags.indexOf(a)?(l=s.lastIndexOf(".",s.lastIndexOf(".")-1),this.tagsNodeStack.pop()):l=s.lastIndexOf("."),s=s.substring(0,l),n=this.tagsNodeStack.pop(),i="",r=e}else if("?"===t[r+1]){let e=z(t,r,!1,"?>");if(!e)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,n,s),this.options.ignoreDeclaration&&"?xml"===e.tagName||this.options.ignorePiTags);else{const t=new T(e.tagName);t.add(this.options.textNodeName,""),e.tagName!==e.tagExp&&e.attrExpPresent&&(t[":@"]=this.buildAttributesMap(e.tagExp,s,e.tagName)),this.addChild(n,t,s,r)}r=e.closeIndex+1}else if("!--"===t.substr(r+1,3)){const e=W(t,"--\x3e",r+4,"Comment is not closed.");if(this.options.commentPropName){const o=t.substring(r+4,e-2);i=this.saveTextToParentTag(i,n,s),n.add(this.options.commentPropName,[{[this.options.textNodeName]:o}])}r=e}else if("!D"===t.substr(r+1,2)){const e=w(t,r);this.docTypeEntities=e.entities,r=e.i}else if("!["===t.substr(r+1,2)){const e=W(t,"]]>",r,"CDATA is not closed.")-2,o=t.substring(r+9,e);i=this.saveTextToParentTag(i,n,s);let a=this.parseTextData(o,n.tagname,s,!0,!1,!0,!0);null==a&&(a=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:o}]):n.add(this.options.textNodeName,a),r=e+2}else{let o=z(t,r,this.options.removeNSPrefix),a=o.tagName;const l=o.rawTagName;let u=o.tagExp,h=o.attrExpPresent,d=o.closeIndex;this.options.transformTagName&&(a=this.options.transformTagName(a)),n&&i&&"!xml"!==n.tagname&&(i=this.saveTextToParentTag(i,n,s,!1));const f=n;f&&-1!==this.options.unpairedTags.indexOf(f.tagname)&&(n=this.tagsNodeStack.pop(),s=s.substring(0,s.lastIndexOf("."))),a!==e.tagname&&(s+=s?"."+a:a);const c=r;if(this.isItStopNode(this.options.stopNodes,s,a)){let e="";if(u.length>0&&u.lastIndexOf("/")===u.length-1)"/"===a[a.length-1]?(a=a.substr(0,a.length-1),s=s.substr(0,s.length-1),u=a):u=u.substr(0,u.length-1),r=o.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(a))r=o.closeIndex;else{const n=this.readStopNodeData(t,l,d+1);if(!n)throw new Error(`Unexpected end of ${l}`);r=n.i,e=n.tagContent}const i=new T(a);a!==u&&h&&(i[":@"]=this.buildAttributesMap(u,s,a)),e&&(e=this.parseTextData(e,a,s,!0,h,!0,!0)),s=s.substr(0,s.lastIndexOf(".")),i.add(this.options.textNodeName,e),this.addChild(n,i,s,c)}else{if(u.length>0&&u.lastIndexOf("/")===u.length-1){"/"===a[a.length-1]?(a=a.substr(0,a.length-1),s=s.substr(0,s.length-1),u=a):u=u.substr(0,u.length-1),this.options.transformTagName&&(a=this.options.transformTagName(a));const t=new T(a);a!==u&&h&&(t[":@"]=this.buildAttributesMap(u,s,a)),this.addChild(n,t,s,c),s=s.substr(0,s.lastIndexOf("."))}else{const t=new T(a);this.tagsNodeStack.push(n),a!==u&&h&&(t[":@"]=this.buildAttributesMap(u,s,a)),this.addChild(n,t,s,c),n=t}i="",r=d}}else i+=t[r];return e.child};function Y(t,e,n,i){this.options.captureMetaData||(i=void 0);const s=this.options.updateTag(e.tagname,n,e[":@"]);!1===s||("string"==typeof s?(e.tagname=s,t.addChild(e,i)):t.addChild(e,i))}const R=function(t){if(this.options.processEntities){for(let e in this.docTypeEntities){const n=this.docTypeEntities[e];t=t.replace(n.regx,n.val)}for(let e in this.lastEntities){const n=this.lastEntities[e];t=t.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const n=this.htmlEntities[e];t=t.replace(n.regex,n.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function q(t,e,n,i){return t&&(void 0===i&&(i=0===e.child.length),void 0!==(t=this.parseTextData(t,e.tagname,n,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,i))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function Z(t,e,n){const i="*."+n;for(const n in t){const s=t[n];if(i===s||e===s)return!0}return!1}function W(t,e,n,i){const s=t.indexOf(e,n);if(-1===s)throw new Error(i);return s+e.length-1}function z(t,e,n,i=">"){const s=function(t,e,n=">"){let i,s="";for(let r=e;r<t.length;r++){let e=t[r];if(i)e===i&&(i="");else if('"'===e||"'"===e)i=e;else if(e===n[0]){if(!n[1])return{data:s,index:r};if(t[r+1]===n[1])return{data:s,index:r}}else"\t"===e&&(e=" ");s+=e}}(t,e+1,i);if(!s)return;let r=s.data;const o=s.index,a=r.search(/\s/);let l=r,u=!0;-1!==a&&(l=r.substring(0,a),r=r.substring(a+1).trimStart());const h=l;if(n){const t=l.indexOf(":");-1!==t&&(l=l.substr(t+1),u=l!==s.data.substr(t+1))}return{tagName:l,tagExp:r,closeIndex:o,attrExpPresent:u,rawTagName:h}}function J(t,e,n){const i=n;let s=1;for(;n<t.length;n++)if("<"===t[n])if("/"===t[n+1]){const r=W(t,">",n,`${e} is not closed`);if(t.substring(n+2,r).trim()===e&&(s--,0===s))return{tagContent:t.substring(i,n),i:r};n=r}else if("?"===t[n+1])n=W(t,"?>",n+1,"StopNode is not closed.");else if("!--"===t.substr(n+1,3))n=W(t,"--\x3e",n+3,"StopNode is not closed.");else if("!["===t.substr(n+1,2))n=W(t,"]]>",n,"StopNode is not closed.")-2;else{const i=z(t,n,">");i&&((i&&i.tagName)===e&&"/"!==i.tagExp[i.tagExp.length-1]&&s++,n=i.closeIndex)}}function H(t,e,n){if(e&&"string"==typeof t){const e=t.trim();return"true"===e||"false"!==e&&function(t,e={}){if(e=Object.assign({},V,e),!t||"string"!=typeof t)return t;let n=t.trim();if(void 0!==e.skipLike&&e.skipLike.test(n))return t;if("0"===t)return 0;if(e.hex&&j.test(n))return function(t){if(parseInt)return parseInt(t,16);if(Number.parseInt)return Number.parseInt(t,16);if(window&&window.parseInt)return window.parseInt(t,16);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}(n);if(-1!==n.search(/.+[eE].+/))return function(t,e,n){if(!n.eNotation)return t;const i=e.match(M);if(i){let s=i[1]||"";const r=-1===i[3].indexOf("e")?"E":"e",o=i[2],a=s?t[o.length+1]===r:t[o.length]===r;return o.length>1&&a?t:1!==o.length||!i[3].startsWith(`.${r}`)&&i[3][0]!==r?n.leadingZeros&&!a?(e=(i[1]||"")+i[3],Number(e)):t:Number(e)}return t}(t,n,e);{const s=D.exec(n);if(s){const r=s[1]||"",o=s[2];let a=(i=s[3])&&-1!==i.indexOf(".")?("."===(i=i.replace(/0+$/,""))?i="0":"."===i[0]?i="0"+i:"."===i[i.length-1]&&(i=i.substring(0,i.length-1)),i):i;const l=r?"."===t[o.length+1]:"."===t[o.length];if(!e.leadingZeros&&(o.length>1||1===o.length&&!l))return t;{const i=Number(n),s=String(i);if(0===i||-0===i)return i;if(-1!==s.search(/[eE]/))return e.eNotation?i:t;if(-1!==n.indexOf("."))return"0"===s||s===a||s===`${r}${a}`?i:t;let l=o?a:n;return o?l===s||r+l===s?i:t:l===s||l===r+s?i:t}}return t}var i}(t,n)}return void 0!==t?t:""}const K=T.getMetaDataSymbol();function Q(t,e){return tt(t,e)}function tt(t,e,n){let i;const s={};for(let r=0;r<t.length;r++){const o=t[r],a=et(o);let l="";if(l=void 0===n?a:n+"."+a,a===e.textNodeName)void 0===i?i=o[a]:i+=""+o[a];else{if(void 0===a)continue;if(o[a]){let t=tt(o[a],e,l);const n=it(t,e);void 0!==o[K]&&(t[K]=o[K]),o[":@"]?nt(t,o[":@"],l,e):1!==Object.keys(t).length||void 0===t[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(t).length&&(e.alwaysCreateTextNode?t[e.textNodeName]="":t=""):t=t[e.textNodeName],void 0!==s[a]&&s.hasOwnProperty(a)?(Array.isArray(s[a])||(s[a]=[s[a]]),s[a].push(t)):e.isArray(a,l,n)?s[a]=[t]:s[a]=t}}}return"string"==typeof i?i.length>0&&(s[e.textNodeName]=i):void 0!==i&&(s[e.textNodeName]=i),s}function et(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=e[t];if(":@"!==n)return n}}function nt(t,e,n,i){if(e){const s=Object.keys(e),r=s.length;for(let o=0;o<r;o++){const r=s[o];i.isArray(r,n+"."+r,!0,!0)?t[r]=[e[r]]:t[r]=e[r]}}}function it(t,e){const{textNodeName:n}=e,i=Object.keys(t).length;return 0===i||!(1!==i||!t[n]&&"boolean"!=typeof t[n]&&0!==t[n])}class st{constructor(t){this.externalEntities={},this.options=function(t){return Object.assign({},v,t)}(t)}parse(t,e){if("string"==typeof t);else{if(!t.toString)throw new Error("XML data is accepted in String or Bytes[] form.");t=t.toString()}if(e){!0===e&&(e={});const n=a(t,e);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new k(this.options);n.addExternalEntities(this.externalEntities);const i=n.parseXml(t);return this.options.preserveOrder||void 0===i?i:Q(i,this.options)}addEntity(t,e){if(-1!==e.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==t.indexOf("&")||-1!==t.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===e)throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e}static getMetaDataSymbol(){return T.getMetaDataSymbol()}}function rt(t,e){let n="";return e.format&&e.indentBy.length>0&&(n="\n"),ot(t,e,"",n)}function ot(t,e,n,i){let s="",r=!1;for(let o=0;o<t.length;o++){const a=t[o],l=at(a);if(void 0===l)continue;let u="";if(u=0===n.length?l:`${n}.${l}`,l===e.textNodeName){let t=a[l];ut(u,e)||(t=e.tagValueProcessor(l,t),t=ht(t,e)),r&&(s+=i),s+=t,r=!1;continue}if(l===e.cdataPropName){r&&(s+=i),s+=`<![CDATA[${a[l][0][e.textNodeName]}]]>`,r=!1;continue}if(l===e.commentPropName){s+=i+`\x3c!--${a[l][0][e.textNodeName]}--\x3e`,r=!0;continue}if("?"===l[0]){const t=lt(a[":@"],e),n="?xml"===l?"":i;let o=a[l][0][e.textNodeName];o=0!==o.length?" "+o:"",s+=n+`<${l}${o}${t}?>`,r=!0;continue}let h=i;""!==h&&(h+=e.indentBy);const d=i+`<${l}${lt(a[":@"],e)}`,f=ot(a[l],e,u,h);-1!==e.unpairedTags.indexOf(l)?e.suppressUnpairedNode?s+=d+">":s+=d+"/>":f&&0!==f.length||!e.suppressEmptyNode?f&&f.endsWith(">")?s+=d+`>${f}${i}</${l}>`:(s+=d+">",f&&""!==i&&(f.includes("/>")||f.includes("</"))?s+=i+e.indentBy+f+i:s+=f,s+=`</${l}>`):s+=d+"/>",r=!0}return s}function at(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const i=e[n];if(t.hasOwnProperty(i)&&":@"!==i)return i}}function lt(t,e){let n="";if(t&&!e.ignoreAttributes)for(let i in t){if(!t.hasOwnProperty(i))continue;let s=e.attributeValueProcessor(i,t[i]);s=ht(s,e),!0===s&&e.suppressBooleanAttributes?n+=` ${i.substr(e.attributeNamePrefix.length)}`:n+=` ${i.substr(e.attributeNamePrefix.length)}="${s}"`}return n}function ut(t,e){let n=(t=t.substr(0,t.length-e.textNodeName.length-1)).substr(t.lastIndexOf(".")+1);for(let i in e.stopNodes)if(e.stopNodes[i]===t||e.stopNodes[i]==="*."+n)return!0;return!1}function ht(t,e){if(t&&t.length>0&&e.processEntities)for(let n=0;n<e.entities.length;n++){const i=e.entities[n];t=t.replace(i.regex,i.val)}return t}const dt={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function ft(t){this.options=Object.assign({},dt,t),!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=_(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=gt),this.processTextOrObjNode=ct,this.options.format?(this.indentate=pt,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function ct(t,e,n,i){const s=this.j2x(t,n+1,i.concat(e));return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,s.attrStr,n):this.buildObjectNode(s.val,e,s.attrStr,n)}function pt(t){return this.options.indentBy.repeat(t)}function gt(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}ft.prototype.build=function(t){return this.options.preserveOrder?rt(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0,[]).val)},ft.prototype.j2x=function(t,e,n){let i="",s="";const r=n.join(".");for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o))if(void 0===t[o])this.isAttribute(o)&&(s+="");else if(null===t[o])this.isAttribute(o)||o===this.options.cdataPropName?s+="":"?"===o[0]?s+=this.indentate(e)+"<"+o+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+o+"/"+this.tagEndChar;else if(t[o]instanceof Date)s+=this.buildTextValNode(t[o],o,"",e);else if("object"!=typeof t[o]){const n=this.isAttribute(o);if(n&&!this.ignoreAttributesFn(n,r))i+=this.buildAttrPairStr(n,""+t[o]);else if(!n)if(o===this.options.textNodeName){let e=this.options.tagValueProcessor(o,""+t[o]);s+=this.replaceEntitiesValue(e)}else s+=this.buildTextValNode(t[o],o,"",e)}else if(Array.isArray(t[o])){const i=t[o].length;let r="",a="";for(let l=0;l<i;l++){const i=t[o][l];if(void 0===i);else if(null===i)"?"===o[0]?s+=this.indentate(e)+"<"+o+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+o+"/"+this.tagEndChar;else if("object"==typeof i)if(this.options.oneListGroup){const t=this.j2x(i,e+1,n.concat(o));r+=t.val,this.options.attributesGroupName&&i.hasOwnProperty(this.options.attributesGroupName)&&(a+=t.attrStr)}else r+=this.processTextOrObjNode(i,o,e,n);else if(this.options.oneListGroup){let t=this.options.tagValueProcessor(o,i);t=this.replaceEntitiesValue(t),r+=t}else r+=this.buildTextValNode(i,o,"",e)}this.options.oneListGroup&&(r=this.buildObjectNode(r,o,a,e)),s+=r}else if(this.options.attributesGroupName&&o===this.options.attributesGroupName){const e=Object.keys(t[o]),n=e.length;for(let s=0;s<n;s++)i+=this.buildAttrPairStr(e[s],""+t[o][e[s]])}else s+=this.processTextOrObjNode(t[o],o,e,n);return{attrStr:i,val:s}},ft.prototype.buildAttrPairStr=function(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&"true"===e?" "+t:" "+t+'="'+e+'"'},ft.prototype.buildObjectNode=function(t,e,n,i){if(""===t)return"?"===e[0]?this.indentate(i)+"<"+e+n+"?"+this.tagEndChar:this.indentate(i)+"<"+e+n+this.closeTag(e)+this.tagEndChar;{let s="</"+e+this.tagEndChar,r="";return"?"===e[0]&&(r="?",s=""),!n&&""!==n||-1!==t.indexOf("<")?!1!==this.options.commentPropName&&e===this.options.commentPropName&&0===r.length?this.indentate(i)+`\x3c!--${t}--\x3e`+this.newLine:this.indentate(i)+"<"+e+n+r+this.tagEndChar+t+this.indentate(i)+s:this.indentate(i)+"<"+e+n+r+">"+t+s}},ft.prototype.closeTag=function(t){let e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":`></${t}`,e},ft.prototype.buildTextValNode=function(t,e,n,i){if(!1!==this.options.cdataPropName&&e===this.options.cdataPropName)return this.indentate(i)+`<![CDATA[${t}]]>`+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(i)+`\x3c!--${t}--\x3e`+this.newLine;if("?"===e[0])return this.indentate(i)+"<"+e+n+"?"+this.tagEndChar;{let s=this.options.tagValueProcessor(e,t);return s=this.replaceEntitiesValue(s),""===s?this.indentate(i)+"<"+e+n+this.closeTag(e)+this.tagEndChar:this.indentate(i)+"<"+e+n+">"+s+"</"+e+this.tagEndChar}},ft.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(let e=0;e<this.options.entities.length;e++){const n=this.options.entities[e];t=t.replace(n.regex,n.val)}return t};const mt={validate:a};module.exports=e})();
1
+ (()=>{"use strict";var t={d:(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{XMLBuilder:()=>ft,XMLParser:()=>st,XMLValidator:()=>mt});const n=":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",i=new RegExp("^["+n+"]["+n+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");function s(t,e){const n=[];let i=e.exec(t);for(;i;){const s=[];s.startIndex=e.lastIndex-i[0].length;const r=i.length;for(let t=0;t<r;t++)s.push(i[t]);n.push(s),i=e.exec(t)}return n}const r=function(t){return!(null==i.exec(t))},o={allowBooleanAttributes:!1,unpairedTags:[]};function a(t,e){e=Object.assign({},o,e);const n=[];let i=!1,s=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(let o=0;o<t.length;o++)if("<"===t[o]&&"?"===t[o+1]){if(o+=2,o=u(t,o),o.err)return o}else{if("<"!==t[o]){if(l(t[o]))continue;return x("InvalidChar","char '"+t[o]+"' is not expected.",N(t,o))}{let a=o;if(o++,"!"===t[o]){o=h(t,o);continue}{let d=!1;"/"===t[o]&&(d=!0,o++);let f="";for(;o<t.length&&">"!==t[o]&&" "!==t[o]&&"\t"!==t[o]&&"\n"!==t[o]&&"\r"!==t[o];o++)f+=t[o];if(f=f.trim(),"/"===f[f.length-1]&&(f=f.substring(0,f.length-1),o--),!r(f)){let e;return e=0===f.trim().length?"Invalid space after '<'.":"Tag '"+f+"' is an invalid name.",x("InvalidTag",e,N(t,o))}const p=c(t,o);if(!1===p)return x("InvalidAttr","Attributes for '"+f+"' have open quote.",N(t,o));let b=p.value;if(o=p.index,"/"===b[b.length-1]){const n=o-b.length;b=b.substring(0,b.length-1);const s=g(b,e);if(!0!==s)return x(s.err.code,s.err.msg,N(t,n+s.err.line));i=!0}else if(d){if(!p.tagClosed)return x("InvalidTag","Closing tag '"+f+"' doesn't have proper closing.",N(t,o));if(b.trim().length>0)return x("InvalidTag","Closing tag '"+f+"' can't have attributes or invalid starting.",N(t,a));if(0===n.length)return x("InvalidTag","Closing tag '"+f+"' has not been opened.",N(t,a));{const e=n.pop();if(f!==e.tagName){let n=N(t,e.tagStartPos);return x("InvalidTag","Expected closing tag '"+e.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+f+"'.",N(t,a))}0==n.length&&(s=!0)}}else{const r=g(b,e);if(!0!==r)return x(r.err.code,r.err.msg,N(t,o-b.length+r.err.line));if(!0===s)return x("InvalidXml","Multiple possible root nodes found.",N(t,o));-1!==e.unpairedTags.indexOf(f)||n.push({tagName:f,tagStartPos:a}),i=!0}for(o++;o<t.length;o++)if("<"===t[o]){if("!"===t[o+1]){o++,o=h(t,o);continue}if("?"!==t[o+1])break;if(o=u(t,++o),o.err)return o}else if("&"===t[o]){const e=m(t,o);if(-1==e)return x("InvalidChar","char '&' is not expected.",N(t,o));o=e}else if(!0===s&&!l(t[o]))return x("InvalidXml","Extra text at the end",N(t,o));"<"===t[o]&&o--}}}return i?1==n.length?x("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",N(t,n[0].tagStartPos)):!(n.length>0)||x("InvalidXml","Invalid '"+JSON.stringify(n.map((t=>t.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):x("InvalidXml","Start tag expected.",1)}function l(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function u(t,e){const n=e;for(;e<t.length;e++)if("?"!=t[e]&&" "!=t[e]);else{const i=t.substr(n,e-n);if(e>5&&"xml"===i)return x("InvalidXml","XML declaration allowed only at the start of the document.",N(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function h(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){let n=1;for(e+=8;e<t.length;e++)if("<"===t[e])n++;else if(">"===t[e]&&(n--,0===n))break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}const d='"',f="'";function c(t,e){let n="",i="",s=!1;for(;e<t.length;e++){if(t[e]===d||t[e]===f)""===i?i=t[e]:i!==t[e]||(i="");else if(">"===t[e]&&""===i){s=!0;break}n+=t[e]}return""===i&&{value:n,index:e,tagClosed:s}}const p=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function g(t,e){const n=s(t,p),i={};for(let t=0;t<n.length;t++){if(0===n[t][1].length)return x("InvalidAttr","Attribute '"+n[t][2]+"' has no space in starting.",E(n[t]));if(void 0!==n[t][3]&&void 0===n[t][4])return x("InvalidAttr","Attribute '"+n[t][2]+"' is without value.",E(n[t]));if(void 0===n[t][3]&&!e.allowBooleanAttributes)return x("InvalidAttr","boolean attribute '"+n[t][2]+"' is not allowed.",E(n[t]));const s=n[t][2];if(!b(s))return x("InvalidAttr","Attribute '"+s+"' is an invalid name.",E(n[t]));if(i.hasOwnProperty(s))return x("InvalidAttr","Attribute '"+s+"' is repeated.",E(n[t]));i[s]=1}return!0}function m(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){let n=/\d/;for("x"===t[e]&&(e++,n=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(n))break}return-1}(t,++e);let n=0;for(;e<t.length;e++,n++)if(!(t[e].match(/\w/)&&n<20)){if(";"===t[e])break;return-1}return e}function x(t,e,n){return{err:{code:t,msg:e,line:n.line||n,col:n.col}}}function b(t){return r(t)}function N(t,e){const n=t.substring(0,e).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function E(t){return t.startIndex+t[1].length}const v={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,n){return t},captureMetaData:!1};let y;y="function"!=typeof Symbol?"@@xmlMetadata":Symbol("XML Node Metadata");class T{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t,e){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child}),void 0!==e&&(this.child[this.child.length-1][y]={startIndex:e})}static getMetaDataSymbol(){return y}}function w(t,e){const n={};if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");{e+=9;let i=1,s=!1,r=!1,o="";for(;e<t.length;e++)if("<"!==t[e]||r)if(">"===t[e]){if(r?"-"===t[e-1]&&"-"===t[e-2]&&(r=!1,i--):i--,0===i)break}else"["===t[e]?s=!0:o+=t[e];else{if(s&&C(t,"!ENTITY",e)){let i,s;e+=7,[i,s,e]=O(t,e+1),-1===s.indexOf("&")&&(n[i]={regx:RegExp(`&${i};`,"g"),val:s})}else if(s&&C(t,"!ELEMENT",e)){e+=8;const{index:n}=S(t,e+1);e=n}else if(s&&C(t,"!ATTLIST",e))e+=8;else if(s&&C(t,"!NOTATION",e)){e+=9;const{index:n}=A(t,e+1);e=n}else{if(!C(t,"!--",e))throw new Error("Invalid DOCTYPE");r=!0}i++,o=""}if(0!==i)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:e}}const P=(t,e)=>{for(;e<t.length&&/\s/.test(t[e]);)e++;return e};function O(t,e){e=P(t,e);let n="";for(;e<t.length&&!/\s/.test(t[e])&&'"'!==t[e]&&"'"!==t[e];)n+=t[e],e++;if($(n),e=P(t,e),"SYSTEM"===t.substring(e,e+6).toUpperCase())throw new Error("External entities are not supported");if("%"===t[e])throw new Error("Parameter entities are not supported");let i="";return[e,i]=I(t,e,"entity"),[n,i,--e]}function A(t,e){e=P(t,e);let n="";for(;e<t.length&&!/\s/.test(t[e]);)n+=t[e],e++;$(n),e=P(t,e);const i=t.substring(e,e+6).toUpperCase();if("SYSTEM"!==i&&"PUBLIC"!==i)throw new Error(`Expected SYSTEM or PUBLIC, found "${i}"`);e+=i.length,e=P(t,e);let s=null,r=null;if("PUBLIC"===i)[e,s]=I(t,e,"publicIdentifier"),'"'!==t[e=P(t,e)]&&"'"!==t[e]||([e,r]=I(t,e,"systemIdentifier"));else if("SYSTEM"===i&&([e,r]=I(t,e,"systemIdentifier"),!r))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:n,publicIdentifier:s,systemIdentifier:r,index:--e}}function I(t,e,n){let i="";const s=t[e];if('"'!==s&&"'"!==s)throw new Error(`Expected quoted string, found "${s}"`);for(e++;e<t.length&&t[e]!==s;)i+=t[e],e++;if(t[e]!==s)throw new Error(`Unterminated ${n} value`);return[++e,i]}function S(t,e){e=P(t,e);let n="";for(;e<t.length&&!/\s/.test(t[e]);)n+=t[e],e++;if(!$(n))throw new Error(`Invalid element name: "${n}"`);let i="";if("E"===t[e=P(t,e)]&&C(t,"MPTY",e))e+=4;else if("A"===t[e]&&C(t,"NY",e))e+=2;else{if("("!==t[e])throw new Error(`Invalid Element Expression, found "${t[e]}"`);for(e++;e<t.length&&")"!==t[e];)i+=t[e],e++;if(")"!==t[e])throw new Error("Unterminated content model")}return{elementName:n,contentModel:i.trim(),index:e}}function C(t,e,n){for(let i=0;i<e.length;i++)if(e[i]!==t[n+i+1])return!1;return!0}function $(t){if(r(t))return t;throw new Error(`Invalid entity name ${t}`)}const j=/^[-+]?0x[a-fA-F0-9]+$/,D=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,V={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};const M=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function _(t){return"function"==typeof t?t:Array.isArray(t)?e=>{for(const n of t){if("string"==typeof n&&e===n)return!0;if(n instanceof RegExp&&n.test(e))return!0}}:()=>!1}class k{constructor(t){this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(t,e)=>String.fromCodePoint(Number.parseInt(e,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(t,e)=>String.fromCodePoint(Number.parseInt(e,16))}},this.addExternalEntities=F,this.parseXml=X,this.parseTextData=L,this.resolveNameSpace=B,this.buildAttributesMap=G,this.isItStopNode=Z,this.replaceEntitiesValue=R,this.readStopNodeData=J,this.saveTextToParentTag=q,this.addChild=Y,this.ignoreAttributesFn=_(this.options.ignoreAttributes)}}function F(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const i=e[n];this.lastEntities[i]={regex:new RegExp("&"+i+";","g"),val:t[i]}}}function L(t,e,n,i,s,r,o){if(void 0!==t&&(this.options.trimValues&&!i&&(t=t.trim()),t.length>0)){o||(t=this.replaceEntitiesValue(t));const i=this.options.tagValueProcessor(e,t,n,s,r);return null==i?t:typeof i!=typeof t||i!==t?i:this.options.trimValues||t.trim()===t?H(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function B(t){if(this.options.removeNSPrefix){const e=t.split(":"),n="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=n+e[1])}return t}const U=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function G(t,e,n){if(!0!==this.options.ignoreAttributes&&"string"==typeof t){const n=s(t,U),i=n.length,r={};for(let t=0;t<i;t++){const i=this.resolveNameSpace(n[t][1]);if(this.ignoreAttributesFn(i,e))continue;let s=n[t][4],o=this.options.attributeNamePrefix+i;if(i.length)if(this.options.transformAttributeName&&(o=this.options.transformAttributeName(o)),"__proto__"===o&&(o="#__proto__"),void 0!==s){this.options.trimValues&&(s=s.trim()),s=this.replaceEntitiesValue(s);const t=this.options.attributeValueProcessor(i,s,e);r[o]=null==t?s:typeof t!=typeof s||t!==s?t:H(s,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(r[o]=!0)}if(!Object.keys(r).length)return;if(this.options.attributesGroupName){const t={};return t[this.options.attributesGroupName]=r,t}return r}}const X=function(t){t=t.replace(/\r\n?/g,"\n");const e=new T("!xml");let n=e,i="",s="";for(let r=0;r<t.length;r++)if("<"===t[r])if("/"===t[r+1]){const e=W(t,">",r,"Closing Tag is not closed.");let o=t.substring(r+2,e).trim();if(this.options.removeNSPrefix){const t=o.indexOf(":");-1!==t&&(o=o.substr(t+1))}this.options.transformTagName&&(o=this.options.transformTagName(o)),n&&(i=this.saveTextToParentTag(i,n,s));const a=s.substring(s.lastIndexOf(".")+1);if(o&&-1!==this.options.unpairedTags.indexOf(o))throw new Error(`Unpaired tag can not be used as closing tag: </${o}>`);let l=0;a&&-1!==this.options.unpairedTags.indexOf(a)?(l=s.lastIndexOf(".",s.lastIndexOf(".")-1),this.tagsNodeStack.pop()):l=s.lastIndexOf("."),s=s.substring(0,l),n=this.tagsNodeStack.pop(),i="",r=e}else if("?"===t[r+1]){let e=z(t,r,!1,"?>");if(!e)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,n,s),this.options.ignoreDeclaration&&"?xml"===e.tagName||this.options.ignorePiTags);else{const t=new T(e.tagName);t.add(this.options.textNodeName,""),e.tagName!==e.tagExp&&e.attrExpPresent&&(t[":@"]=this.buildAttributesMap(e.tagExp,s,e.tagName)),this.addChild(n,t,s,r)}r=e.closeIndex+1}else if("!--"===t.substr(r+1,3)){const e=W(t,"--\x3e",r+4,"Comment is not closed.");if(this.options.commentPropName){const o=t.substring(r+4,e-2);i=this.saveTextToParentTag(i,n,s),n.add(this.options.commentPropName,[{[this.options.textNodeName]:o}])}r=e}else if("!D"===t.substr(r+1,2)){const e=w(t,r);this.docTypeEntities=e.entities,r=e.i}else if("!["===t.substr(r+1,2)){const e=W(t,"]]>",r,"CDATA is not closed.")-2,o=t.substring(r+9,e);i=this.saveTextToParentTag(i,n,s);let a=this.parseTextData(o,n.tagname,s,!0,!1,!0,!0);null==a&&(a=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:o}]):n.add(this.options.textNodeName,a),r=e+2}else{let o=z(t,r,this.options.removeNSPrefix),a=o.tagName;const l=o.rawTagName;let u=o.tagExp,h=o.attrExpPresent,d=o.closeIndex;this.options.transformTagName&&(a=this.options.transformTagName(a)),n&&i&&"!xml"!==n.tagname&&(i=this.saveTextToParentTag(i,n,s,!1));const f=n;f&&-1!==this.options.unpairedTags.indexOf(f.tagname)&&(n=this.tagsNodeStack.pop(),s=s.substring(0,s.lastIndexOf("."))),a!==e.tagname&&(s+=s?"."+a:a);const c=r;if(this.isItStopNode(this.options.stopNodes,s,a)){let e="";if(u.length>0&&u.lastIndexOf("/")===u.length-1)"/"===a[a.length-1]?(a=a.substr(0,a.length-1),s=s.substr(0,s.length-1),u=a):u=u.substr(0,u.length-1),r=o.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(a))r=o.closeIndex;else{const n=this.readStopNodeData(t,l,d+1);if(!n)throw new Error(`Unexpected end of ${l}`);r=n.i,e=n.tagContent}const i=new T(a);a!==u&&h&&(i[":@"]=this.buildAttributesMap(u,s,a)),e&&(e=this.parseTextData(e,a,s,!0,h,!0,!0)),s=s.substr(0,s.lastIndexOf(".")),i.add(this.options.textNodeName,e),this.addChild(n,i,s,c)}else{if(u.length>0&&u.lastIndexOf("/")===u.length-1){"/"===a[a.length-1]?(a=a.substr(0,a.length-1),s=s.substr(0,s.length-1),u=a):u=u.substr(0,u.length-1),this.options.transformTagName&&(a=this.options.transformTagName(a));const t=new T(a);a!==u&&h&&(t[":@"]=this.buildAttributesMap(u,s,a)),this.addChild(n,t,s,c),s=s.substr(0,s.lastIndexOf("."))}else{const t=new T(a);this.tagsNodeStack.push(n),a!==u&&h&&(t[":@"]=this.buildAttributesMap(u,s,a)),this.addChild(n,t,s,c),n=t}i="",r=d}}else i+=t[r];return e.child};function Y(t,e,n,i){this.options.captureMetaData||(i=void 0);const s=this.options.updateTag(e.tagname,n,e[":@"]);!1===s||("string"==typeof s?(e.tagname=s,t.addChild(e,i)):t.addChild(e,i))}const R=function(t){if(this.options.processEntities){for(let e in this.docTypeEntities){const n=this.docTypeEntities[e];t=t.replace(n.regx,n.val)}for(let e in this.lastEntities){const n=this.lastEntities[e];t=t.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const n=this.htmlEntities[e];t=t.replace(n.regex,n.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function q(t,e,n,i){return t&&(void 0===i&&(i=0===e.child.length),void 0!==(t=this.parseTextData(t,e.tagname,n,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,i))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function Z(t,e,n){const i="*."+n;for(const n in t){const s=t[n];if(i===s||e===s)return!0}return!1}function W(t,e,n,i){const s=t.indexOf(e,n);if(-1===s)throw new Error(i);return s+e.length-1}function z(t,e,n,i=">"){const s=function(t,e,n=">"){let i,s="";for(let r=e;r<t.length;r++){let e=t[r];if(i)e===i&&(i="");else if('"'===e||"'"===e)i=e;else if(e===n[0]){if(!n[1])return{data:s,index:r};if(t[r+1]===n[1])return{data:s,index:r}}else"\t"===e&&(e=" ");s+=e}}(t,e+1,i);if(!s)return;let r=s.data;const o=s.index,a=r.search(/\s/);let l=r,u=!0;-1!==a&&(l=r.substring(0,a),r=r.substring(a+1).trimStart());const h=l;if(n){const t=l.indexOf(":");-1!==t&&(l=l.substr(t+1),u=l!==s.data.substr(t+1))}return{tagName:l,tagExp:r,closeIndex:o,attrExpPresent:u,rawTagName:h}}function J(t,e,n){const i=n;let s=1;for(;n<t.length;n++)if("<"===t[n])if("/"===t[n+1]){const r=W(t,">",n,`${e} is not closed`);if(t.substring(n+2,r).trim()===e&&(s--,0===s))return{tagContent:t.substring(i,n),i:r};n=r}else if("?"===t[n+1])n=W(t,"?>",n+1,"StopNode is not closed.");else if("!--"===t.substr(n+1,3))n=W(t,"--\x3e",n+3,"StopNode is not closed.");else if("!["===t.substr(n+1,2))n=W(t,"]]>",n,"StopNode is not closed.")-2;else{const i=z(t,n,">");i&&((i&&i.tagName)===e&&"/"!==i.tagExp[i.tagExp.length-1]&&s++,n=i.closeIndex)}}function H(t,e,n){if(e&&"string"==typeof t){const e=t.trim();return"true"===e||"false"!==e&&function(t,e={}){if(e=Object.assign({},V,e),!t||"string"!=typeof t)return t;let n=t.trim();if(void 0!==e.skipLike&&e.skipLike.test(n))return t;if("0"===t)return 0;if(e.hex&&j.test(n))return function(t){if(parseInt)return parseInt(t,16);if(Number.parseInt)return Number.parseInt(t,16);if(window&&window.parseInt)return window.parseInt(t,16);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}(n);if(-1!==n.search(/.+[eE].+/))return function(t,e,n){if(!n.eNotation)return t;const i=e.match(M);if(i){let s=i[1]||"";const r=-1===i[3].indexOf("e")?"E":"e",o=i[2],a=s?t[o.length+1]===r:t[o.length]===r;return o.length>1&&a?t:1!==o.length||!i[3].startsWith(`.${r}`)&&i[3][0]!==r?n.leadingZeros&&!a?(e=(i[1]||"")+i[3],Number(e)):t:Number(e)}return t}(t,n,e);{const s=D.exec(n);if(s){const r=s[1]||"",o=s[2];let a=(i=s[3])&&-1!==i.indexOf(".")?("."===(i=i.replace(/0+$/,""))?i="0":"."===i[0]?i="0"+i:"."===i[i.length-1]&&(i=i.substring(0,i.length-1)),i):i;const l=r?"."===t[o.length+1]:"."===t[o.length];if(!e.leadingZeros&&(o.length>1||1===o.length&&!l))return t;{const i=Number(n),s=String(i);if(0===i||-0===i)return i;if(-1!==s.search(/[eE]/))return e.eNotation?i:t;if(-1!==n.indexOf("."))return"0"===s||s===a||s===`${r}${a}`?i:t;let l=o?a:n;return o?l===s||r+l===s?i:t:l===s||l===r+s?i:t}}return t}var i}(t,n)}return void 0!==t?t:""}const K=T.getMetaDataSymbol();function Q(t,e){return tt(t,e)}function tt(t,e,n){let i;const s={};for(let r=0;r<t.length;r++){const o=t[r],a=et(o);let l="";if(l=void 0===n?a:n+"."+a,a===e.textNodeName)void 0===i?i=o[a]:i+=""+o[a];else{if(void 0===a)continue;if(o[a]){let t=tt(o[a],e,l);const n=it(t,e);void 0!==o[K]&&(t[K]=o[K]),o[":@"]?nt(t,o[":@"],l,e):1!==Object.keys(t).length||void 0===t[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(t).length&&(e.alwaysCreateTextNode?t[e.textNodeName]="":t=""):t=t[e.textNodeName],void 0!==s[a]&&s.hasOwnProperty(a)?(Array.isArray(s[a])||(s[a]=[s[a]]),s[a].push(t)):e.isArray(a,l,n)?s[a]=[t]:s[a]=t}}}return"string"==typeof i?i.length>0&&(s[e.textNodeName]=i):void 0!==i&&(s[e.textNodeName]=i),s}function et(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=e[t];if(":@"!==n)return n}}function nt(t,e,n,i){if(e){const s=Object.keys(e),r=s.length;for(let o=0;o<r;o++){const r=s[o];i.isArray(r,n+"."+r,!0,!0)?t[r]=[e[r]]:t[r]=e[r]}}}function it(t,e){const{textNodeName:n}=e,i=Object.keys(t).length;return 0===i||!(1!==i||!t[n]&&"boolean"!=typeof t[n]&&0!==t[n])}class st{constructor(t){this.externalEntities={},this.options=function(t){return Object.assign({},v,t)}(t)}parse(t,e){if("string"==typeof t);else{if(!t.toString)throw new Error("XML data is accepted in String or Bytes[] form.");t=t.toString()}if(e){!0===e&&(e={});const n=a(t,e);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new k(this.options);n.addExternalEntities(this.externalEntities);const i=n.parseXml(t);return this.options.preserveOrder||void 0===i?i:Q(i,this.options)}addEntity(t,e){if(-1!==e.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==t.indexOf("&")||-1!==t.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===e)throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e}static getMetaDataSymbol(){return T.getMetaDataSymbol()}}function rt(t,e){let n="";return e.format&&e.indentBy.length>0&&(n="\n"),ot(t,e,"",n)}function ot(t,e,n,i){let s="",r=!1;for(let o=0;o<t.length;o++){const a=t[o],l=at(a);if(void 0===l)continue;let u="";if(u=0===n.length?l:`${n}.${l}`,l===e.textNodeName){let t=a[l];ut(u,e)||(t=e.tagValueProcessor(l,t),t=ht(t,e)),r&&(s+=i),s+=t,r=!1;continue}if(l===e.cdataPropName){r&&(s+=i),s+=`<![CDATA[${a[l][0][e.textNodeName]}]]>`,r=!1;continue}if(l===e.commentPropName){s+=i+`\x3c!--${a[l][0][e.textNodeName]}--\x3e`,r=!0;continue}if("?"===l[0]){const t=lt(a[":@"],e),n="?xml"===l?"":i;let o=a[l][0][e.textNodeName];o=0!==o.length?" "+o:"",s+=n+`<${l}${o}${t}?>`,r=!0;continue}let h=i;""!==h&&(h+=e.indentBy);const d=i+`<${l}${lt(a[":@"],e)}`,f=ot(a[l],e,u,h);-1!==e.unpairedTags.indexOf(l)?e.suppressUnpairedNode?s+=d+">":s+=d+"/>":f&&0!==f.length||!e.suppressEmptyNode?f&&f.endsWith(">")?s+=d+`>${f}${i}</${l}>`:(s+=d+">",f&&""!==i&&(f.includes("/>")||f.includes("</"))?s+=i+e.indentBy+f+i:s+=f,s+=`</${l}>`):s+=d+"/>",r=!0}return s}function at(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const i=e[n];if(t.hasOwnProperty(i)&&":@"!==i)return i}}function lt(t,e){let n="";if(t&&!e.ignoreAttributes)for(let i in t){if(!t.hasOwnProperty(i))continue;let s=e.attributeValueProcessor(i,t[i]);s=ht(s,e),!0===s&&e.suppressBooleanAttributes?n+=` ${i.substr(e.attributeNamePrefix.length)}`:n+=` ${i.substr(e.attributeNamePrefix.length)}="${s}"`}return n}function ut(t,e){let n=(t=t.substr(0,t.length-e.textNodeName.length-1)).substr(t.lastIndexOf(".")+1);for(let i in e.stopNodes)if(e.stopNodes[i]===t||e.stopNodes[i]==="*."+n)return!0;return!1}function ht(t,e){if(t&&t.length>0&&e.processEntities)for(let n=0;n<e.entities.length;n++){const i=e.entities[n];t=t.replace(i.regex,i.val)}return t}const dt={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function ft(t){this.options=Object.assign({},dt,t),!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=_(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=gt),this.processTextOrObjNode=ct,this.options.format?(this.indentate=pt,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function ct(t,e,n,i){const s=this.j2x(t,n+1,i.concat(e));return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,s.attrStr,n):this.buildObjectNode(s.val,e,s.attrStr,n)}function pt(t){return this.options.indentBy.repeat(t)}function gt(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}ft.prototype.build=function(t){return this.options.preserveOrder?rt(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0,[]).val)},ft.prototype.j2x=function(t,e,n){let i="",s="";const r=n.join(".");for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o))if(void 0===t[o])this.isAttribute(o)&&(s+="");else if(null===t[o])this.isAttribute(o)||o===this.options.cdataPropName?s+="":"?"===o[0]?s+=this.indentate(e)+"<"+o+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+o+"/"+this.tagEndChar;else if(t[o]instanceof Date)s+=this.buildTextValNode(t[o],o,"",e);else if("object"!=typeof t[o]){const n=this.isAttribute(o);if(n&&!this.ignoreAttributesFn(n,r))i+=this.buildAttrPairStr(n,""+t[o]);else if(!n)if(o===this.options.textNodeName){let e=this.options.tagValueProcessor(o,""+t[o]);s+=this.replaceEntitiesValue(e)}else s+=this.buildTextValNode(t[o],o,"",e)}else if(Array.isArray(t[o])){const i=t[o].length;let r="",a="";for(let l=0;l<i;l++){const i=t[o][l];if(void 0===i);else if(null===i)"?"===o[0]?s+=this.indentate(e)+"<"+o+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+o+"/"+this.tagEndChar;else if("object"==typeof i)if(this.options.oneListGroup){const t=this.j2x(i,e+1,n.concat(o));r+=t.val,this.options.attributesGroupName&&i.hasOwnProperty(this.options.attributesGroupName)&&(a+=t.attrStr)}else r+=this.processTextOrObjNode(i,o,e,n);else if(this.options.oneListGroup){let t=this.options.tagValueProcessor(o,i);t=this.replaceEntitiesValue(t),r+=t}else r+=this.buildTextValNode(i,o,"",e)}this.options.oneListGroup&&(r=this.buildObjectNode(r,o,a,e)),s+=r}else if(this.options.attributesGroupName&&o===this.options.attributesGroupName){const e=Object.keys(t[o]),n=e.length;for(let s=0;s<n;s++)i+=this.buildAttrPairStr(e[s],""+t[o][e[s]])}else s+=this.processTextOrObjNode(t[o],o,e,n);return{attrStr:i,val:s}},ft.prototype.buildAttrPairStr=function(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&"true"===e?" "+t:" "+t+'="'+e+'"'},ft.prototype.buildObjectNode=function(t,e,n,i){if(""===t)return"?"===e[0]?this.indentate(i)+"<"+e+n+"?"+this.tagEndChar:this.indentate(i)+"<"+e+n+this.closeTag(e)+this.tagEndChar;{let s="</"+e+this.tagEndChar,r="";return"?"===e[0]&&(r="?",s=""),!n&&""!==n||-1!==t.indexOf("<")?!1!==this.options.commentPropName&&e===this.options.commentPropName&&0===r.length?this.indentate(i)+`\x3c!--${t}--\x3e`+this.newLine:this.indentate(i)+"<"+e+n+r+this.tagEndChar+t+this.indentate(i)+s:this.indentate(i)+"<"+e+n+r+">"+t+s}},ft.prototype.closeTag=function(t){let e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":`></${t}`,e},ft.prototype.buildTextValNode=function(t,e,n,i){if(!1!==this.options.cdataPropName&&e===this.options.cdataPropName)return this.indentate(i)+`<![CDATA[${t}]]>`+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(i)+`\x3c!--${t}--\x3e`+this.newLine;if("?"===e[0])return this.indentate(i)+"<"+e+n+"?"+this.tagEndChar;{let s=this.options.tagValueProcessor(e,t);return s=this.replaceEntitiesValue(s),""===s?this.indentate(i)+"<"+e+n+this.closeTag(e)+this.tagEndChar:this.indentate(i)+"<"+e+n+">"+s+"</"+e+this.tagEndChar}},ft.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(let e=0;e<this.options.entities.length;e++){const n=this.options.entities[e];t=t.replace(n.regex,n.val)}return t};const mt={validate:a};module.exports=e})();
@@ -1,2 +1,2 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.fxp=e():t.fxp=e()}(this,(()=>(()=>{"use strict";var t={d:(e,r)=>{for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{XMLBuilder:()=>pt,XMLParser:()=>at,XMLValidator:()=>mt});var r=":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",i=new RegExp("^["+r+"]["+r+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");function n(t,e){for(var r=[],i=e.exec(t);i;){var n=[];n.startIndex=e.lastIndex-i[0].length;for(var a=i.length,s=0;s<a;s++)n.push(i[s]);r.push(n),i=e.exec(t)}return r}var a=function(t){return!(null==i.exec(t))},s={allowBooleanAttributes:!1,unpairedTags:[]};function o(t,e){e=Object.assign({},s,e);var r=[],i=!1,n=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(var o=0;o<t.length;o++)if("<"===t[o]&&"?"===t[o+1]){if((o=l(t,o+=2)).err)return o}else{if("<"!==t[o]){if(u(t[o]))continue;return m("InvalidChar","char '"+t[o]+"' is not expected.",b(t,o))}var f=o;if("!"===t[++o]){o=h(t,o);continue}var d=!1;"/"===t[o]&&(d=!0,o++);for(var g="";o<t.length&&">"!==t[o]&&" "!==t[o]&&"\t"!==t[o]&&"\n"!==t[o]&&"\r"!==t[o];o++)g+=t[o];if("/"===(g=g.trim())[g.length-1]&&(g=g.substring(0,g.length-1),o--),!a(g))return m("InvalidTag",0===g.trim().length?"Invalid space after '<'.":"Tag '"+g+"' is an invalid name.",b(t,o));var x=p(t,o);if(!1===x)return m("InvalidAttr","Attributes for '"+g+"' have open quote.",b(t,o));var N=x.value;if(o=x.index,"/"===N[N.length-1]){var E=o-N.length,y=c(N=N.substring(0,N.length-1),e);if(!0!==y)return m(y.err.code,y.err.msg,b(t,E+y.err.line));i=!0}else if(d){if(!x.tagClosed)return m("InvalidTag","Closing tag '"+g+"' doesn't have proper closing.",b(t,o));if(N.trim().length>0)return m("InvalidTag","Closing tag '"+g+"' can't have attributes or invalid starting.",b(t,f));if(0===r.length)return m("InvalidTag","Closing tag '"+g+"' has not been opened.",b(t,f));var T=r.pop();if(g!==T.tagName){var w=b(t,T.tagStartPos);return m("InvalidTag","Expected closing tag '"+T.tagName+"' (opened in line "+w.line+", col "+w.col+") instead of closing tag '"+g+"'.",b(t,f))}0==r.length&&(n=!0)}else{var P=c(N,e);if(!0!==P)return m(P.err.code,P.err.msg,b(t,o-N.length+P.err.line));if(!0===n)return m("InvalidXml","Multiple possible root nodes found.",b(t,o));-1!==e.unpairedTags.indexOf(g)||r.push({tagName:g,tagStartPos:f}),i=!0}for(o++;o<t.length;o++)if("<"===t[o]){if("!"===t[o+1]){o=h(t,++o);continue}if("?"!==t[o+1])break;if((o=l(t,++o)).err)return o}else if("&"===t[o]){var A=v(t,o);if(-1==A)return m("InvalidChar","char '&' is not expected.",b(t,o));o=A}else if(!0===n&&!u(t[o]))return m("InvalidXml","Extra text at the end",b(t,o));"<"===t[o]&&o--}return i?1==r.length?m("InvalidTag","Unclosed tag '"+r[0].tagName+"'.",b(t,r[0].tagStartPos)):!(r.length>0)||m("InvalidXml","Invalid '"+JSON.stringify(r.map((function(t){return t.tagName})),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):m("InvalidXml","Start tag expected.",1)}function u(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function l(t,e){for(var r=e;e<t.length;e++)if("?"!=t[e]&&" "!=t[e]);else{var i=t.substr(r,e-r);if(e>5&&"xml"===i)return m("InvalidXml","XML declaration allowed only at the start of the document.",b(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function h(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){var r=1;for(e+=8;e<t.length;e++)if("<"===t[e])r++;else if(">"===t[e]&&0==--r)break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}var f='"',d="'";function p(t,e){for(var r="",i="",n=!1;e<t.length;e++){if(t[e]===f||t[e]===d)""===i?i=t[e]:i!==t[e]||(i="");else if(">"===t[e]&&""===i){n=!0;break}r+=t[e]}return""===i&&{value:r,index:e,tagClosed:n}}var g=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function c(t,e){for(var r=n(t,g),i={},a=0;a<r.length;a++){if(0===r[a][1].length)return m("InvalidAttr","Attribute '"+r[a][2]+"' has no space in starting.",N(r[a]));if(void 0!==r[a][3]&&void 0===r[a][4])return m("InvalidAttr","Attribute '"+r[a][2]+"' is without value.",N(r[a]));if(void 0===r[a][3]&&!e.allowBooleanAttributes)return m("InvalidAttr","boolean attribute '"+r[a][2]+"' is not allowed.",N(r[a]));var s=r[a][2];if(!x(s))return m("InvalidAttr","Attribute '"+s+"' is an invalid name.",N(r[a]));if(i.hasOwnProperty(s))return m("InvalidAttr","Attribute '"+s+"' is repeated.",N(r[a]));i[s]=1}return!0}function v(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){var r=/\d/;for("x"===t[e]&&(e++,r=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(r))break}return-1}(t,++e);for(var r=0;e<t.length;e++,r++)if(!(t[e].match(/\w/)&&r<20)){if(";"===t[e])break;return-1}return e}function m(t,e,r){return{err:{code:t,msg:e,line:r.line||r,col:r.col}}}function x(t){return a(t)}function b(t,e){var r=t.substring(0,e).split(/\r?\n/);return{line:r.length,col:r[r.length-1].length+1}}function N(t){return t.startIndex+t[1].length}var E,y={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:function(){return!1},commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,r){return t},captureMetaData:!1};E="function"!=typeof Symbol?"@@xmlMetadata":Symbol("XML Node Metadata");var T=function(){function t(t){this.tagname=t,this.child=[],this[":@"]={}}var e=t.prototype;return e.add=function(t,e){var r;"__proto__"===t&&(t="#__proto__"),this.child.push(((r={})[t]=e,r))},e.addChild=function(t,e){var r,i;"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push(((r={})[t.tagname]=t.child,r[":@"]=t[":@"],r)):this.child.push(((i={})[t.tagname]=t.child,i)),void 0!==e&&(this.child[this.child.length-1][E]={startIndex:e})},t.getMetaDataSymbol=function(){return E},t}();function w(t,e){var r={};if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");e+=9;for(var i=1,n=!1,a=!1;e<t.length;e++)if("<"!==t[e]||a)if(">"===t[e]){if(a?"-"===t[e-1]&&"-"===t[e-2]&&(a=!1,i--):i--,0===i)break}else"["===t[e]?n=!0:t[e];else{if(n&&C(t,"!ENTITY",e)){var s,o=void 0,u=A(t,(e+=7)+1);s=u[0],o=u[1],e=u[2],-1===o.indexOf("&")&&(r[s]={regx:RegExp("&"+s+";","g"),val:o})}else if(n&&C(t,"!ELEMENT",e))e=S(t,(e+=8)+1).index;else if(n&&C(t,"!ATTLIST",e))e+=8;else if(n&&C(t,"!NOTATION",e))e=O(t,(e+=9)+1).index;else{if(!C(t,"!--",e))throw new Error("Invalid DOCTYPE");a=!0}i++}if(0!==i)throw new Error("Unclosed DOCTYPE");return{entities:r,i:e}}var P=function(t,e){for(;e<t.length&&/\s/.test(t[e]);)e++;return e};function A(t,e){e=P(t,e);for(var r="";e<t.length&&!/\s/.test(t[e])&&'"'!==t[e]&&"'"!==t[e];)r+=t[e],e++;if(j(r),e=P(t,e),"SYSTEM"===t.substring(e,e+6).toUpperCase())throw new Error("External entities are not supported");if("%"===t[e])throw new Error("Parameter entities are not supported");var i=I(t,e,"entity");return e=i[0],[r,i[1],--e]}function O(t,e){e=P(t,e);for(var r="";e<t.length&&!/\s/.test(t[e]);)r+=t[e],e++;j(r),e=P(t,e);var i=t.substring(e,e+6).toUpperCase();if("SYSTEM"!==i&&"PUBLIC"!==i)throw new Error('Expected SYSTEM or PUBLIC, found "'+i+'"');e+=i.length,e=P(t,e);var n=null,a=null;if("PUBLIC"===i){var s=I(t,e,"publicIdentifier");if(e=s[0],n=s[1],'"'===t[e=P(t,e)]||"'"===t[e]){var o=I(t,e,"systemIdentifier");e=o[0],a=o[1]}}else if("SYSTEM"===i){var u=I(t,e,"systemIdentifier");if(e=u[0],!(a=u[1]))throw new Error("Missing mandatory system identifier for SYSTEM notation")}return{notationName:r,publicIdentifier:n,systemIdentifier:a,index:--e}}function I(t,e,r){var i="",n=t[e];if('"'!==n&&"'"!==n)throw new Error('Expected quoted string, found "'+n+'"');for(e++;e<t.length&&t[e]!==n;)i+=t[e],e++;if(t[e]!==n)throw new Error("Unterminated "+r+" value");return[++e,i]}function S(t,e){e=P(t,e);for(var r="";e<t.length&&!/\s/.test(t[e]);)r+=t[e],e++;if(!j(r))throw new Error('Invalid element name: "'+r+'"');var i="";if("E"===t[e=P(t,e)]&&C(t,"MPTY",e))e+=6;else if("A"===t[e]&&C(t,"NY",e))e+=4;else{if("("!==t[e])throw new Error('Invalid Element Expression, found "'+t[e]+'"');for(e++;e<t.length&&")"!==t[e];)i+=t[e],e++;if(")"!==t[e])throw new Error("Unterminated content model")}return{elementName:r,contentModel:i.trim(),index:e}}function C(t,e,r){for(var i=0;i<e.length;i++)if(e[i]!==t[r+i+1])return!1;return!0}function j(t){if(a(t))return t;throw new Error("Invalid entity name "+t)}const D=/^[-+]?0x[a-fA-F0-9]+$/,V=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,M={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};const _=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function k(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=Array(e);r<e;r++)i[r]=t[r];return i}function F(t){return"function"==typeof t?t:Array.isArray(t)?function(e){for(var r,i=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return k(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?k(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(t);!(r=i()).done;){var n=r.value;if("string"==typeof n&&e===n)return!0;if(n instanceof RegExp&&n.test(e))return!0}}:function(){return!1}}var L=function(t){this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:function(t,e){return String.fromCodePoint(Number.parseInt(e,10))}},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:function(t,e){return String.fromCodePoint(Number.parseInt(e,16))}}},this.addExternalEntities=B,this.parseXml=R,this.parseTextData=U,this.resolveNameSpace=G,this.buildAttributesMap=Y,this.isItStopNode=W,this.replaceEntitiesValue=q,this.readStopNodeData=H,this.saveTextToParentTag=Z,this.addChild=$,this.ignoreAttributesFn=F(this.options.ignoreAttributes)};function B(t){for(var e=Object.keys(t),r=0;r<e.length;r++){var i=e[r];this.lastEntities[i]={regex:new RegExp("&"+i+";","g"),val:t[i]}}}function U(t,e,r,i,n,a,s){if(void 0!==t&&(this.options.trimValues&&!i&&(t=t.trim()),t.length>0)){s||(t=this.replaceEntitiesValue(t));var o=this.options.tagValueProcessor(e,t,r,n,a);return null==o?t:typeof o!=typeof t||o!==t?o:this.options.trimValues||t.trim()===t?K(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function G(t){if(this.options.removeNSPrefix){var e=t.split(":"),r="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=r+e[1])}return t}var X=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function Y(t,e,r){if(!0!==this.options.ignoreAttributes&&"string"==typeof t){for(var i=n(t,X),a=i.length,s={},o=0;o<a;o++){var u=this.resolveNameSpace(i[o][1]);if(!this.ignoreAttributesFn(u,e)){var l=i[o][4],h=this.options.attributeNamePrefix+u;if(u.length)if(this.options.transformAttributeName&&(h=this.options.transformAttributeName(h)),"__proto__"===h&&(h="#__proto__"),void 0!==l){this.options.trimValues&&(l=l.trim()),l=this.replaceEntitiesValue(l);var f=this.options.attributeValueProcessor(u,l,e);s[h]=null==f?l:typeof f!=typeof l||f!==l?f:K(l,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(s[h]=!0)}}if(!Object.keys(s).length)return;if(this.options.attributesGroupName){var d={};return d[this.options.attributesGroupName]=s,d}return s}}var R=function(t){t=t.replace(/\r\n?/g,"\n");for(var e=new T("!xml"),r=e,i="",n="",a=0;a<t.length;a++)if("<"===t[a])if("/"===t[a+1]){var s=z(t,">",a,"Closing Tag is not closed."),o=t.substring(a+2,s).trim();if(this.options.removeNSPrefix){var u=o.indexOf(":");-1!==u&&(o=o.substr(u+1))}this.options.transformTagName&&(o=this.options.transformTagName(o)),r&&(i=this.saveTextToParentTag(i,r,n));var l=n.substring(n.lastIndexOf(".")+1);if(o&&-1!==this.options.unpairedTags.indexOf(o))throw new Error("Unpaired tag can not be used as closing tag: </"+o+">");var h=0;l&&-1!==this.options.unpairedTags.indexOf(l)?(h=n.lastIndexOf(".",n.lastIndexOf(".")-1),this.tagsNodeStack.pop()):h=n.lastIndexOf("."),n=n.substring(0,h),r=this.tagsNodeStack.pop(),i="",a=s}else if("?"===t[a+1]){var f=J(t,a,!1,"?>");if(!f)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,r,n),this.options.ignoreDeclaration&&"?xml"===f.tagName||this.options.ignorePiTags);else{var d=new T(f.tagName);d.add(this.options.textNodeName,""),f.tagName!==f.tagExp&&f.attrExpPresent&&(d[":@"]=this.buildAttributesMap(f.tagExp,n,f.tagName)),this.addChild(r,d,n,a)}a=f.closeIndex+1}else if("!--"===t.substr(a+1,3)){var p=z(t,"--\x3e",a+4,"Comment is not closed.");if(this.options.commentPropName){var g,c=t.substring(a+4,p-2);i=this.saveTextToParentTag(i,r,n),r.add(this.options.commentPropName,[(g={},g[this.options.textNodeName]=c,g)])}a=p}else if("!D"===t.substr(a+1,2)){var v=w(t,a);this.docTypeEntities=v.entities,a=v.i}else if("!["===t.substr(a+1,2)){var m=z(t,"]]>",a,"CDATA is not closed.")-2,x=t.substring(a+9,m);i=this.saveTextToParentTag(i,r,n);var b,N=this.parseTextData(x,r.tagname,n,!0,!1,!0,!0);null==N&&(N=""),this.options.cdataPropName?r.add(this.options.cdataPropName,[(b={},b[this.options.textNodeName]=x,b)]):r.add(this.options.textNodeName,N),a=m+2}else{var E=J(t,a,this.options.removeNSPrefix),y=E.tagName,P=E.rawTagName,A=E.tagExp,O=E.attrExpPresent,I=E.closeIndex;this.options.transformTagName&&(y=this.options.transformTagName(y)),r&&i&&"!xml"!==r.tagname&&(i=this.saveTextToParentTag(i,r,n,!1));var S=r;S&&-1!==this.options.unpairedTags.indexOf(S.tagname)&&(r=this.tagsNodeStack.pop(),n=n.substring(0,n.lastIndexOf("."))),y!==e.tagname&&(n+=n?"."+y:y);var C=a;if(this.isItStopNode(this.options.stopNodes,n,y)){var j="";if(A.length>0&&A.lastIndexOf("/")===A.length-1)"/"===y[y.length-1]?(y=y.substr(0,y.length-1),n=n.substr(0,n.length-1),A=y):A=A.substr(0,A.length-1),a=E.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(y))a=E.closeIndex;else{var D=this.readStopNodeData(t,P,I+1);if(!D)throw new Error("Unexpected end of "+P);a=D.i,j=D.tagContent}var V=new T(y);y!==A&&O&&(V[":@"]=this.buildAttributesMap(A,n,y)),j&&(j=this.parseTextData(j,y,n,!0,O,!0,!0)),n=n.substr(0,n.lastIndexOf(".")),V.add(this.options.textNodeName,j),this.addChild(r,V,n,C)}else{if(A.length>0&&A.lastIndexOf("/")===A.length-1){"/"===y[y.length-1]?(y=y.substr(0,y.length-1),n=n.substr(0,n.length-1),A=y):A=A.substr(0,A.length-1),this.options.transformTagName&&(y=this.options.transformTagName(y));var M=new T(y);y!==A&&O&&(M[":@"]=this.buildAttributesMap(A,n,y)),this.addChild(r,M,n,C),n=n.substr(0,n.lastIndexOf("."))}else{var _=new T(y);this.tagsNodeStack.push(r),y!==A&&O&&(_[":@"]=this.buildAttributesMap(A,n,y)),this.addChild(r,_,n,C),r=_}i="",a=I}}else i+=t[a];return e.child};function $(t,e,r,i){this.options.captureMetaData||(i=void 0);var n=this.options.updateTag(e.tagname,r,e[":@"]);!1===n||("string"==typeof n?(e.tagname=n,t.addChild(e,i)):t.addChild(e,i))}var q=function(t){if(this.options.processEntities){for(var e in this.docTypeEntities){var r=this.docTypeEntities[e];t=t.replace(r.regx,r.val)}for(var i in this.lastEntities){var n=this.lastEntities[i];t=t.replace(n.regex,n.val)}if(this.options.htmlEntities)for(var a in this.htmlEntities){var s=this.htmlEntities[a];t=t.replace(s.regex,s.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function Z(t,e,r,i){return t&&(void 0===i&&(i=0===e.child.length),void 0!==(t=this.parseTextData(t,e.tagname,r,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,i))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function W(t,e,r){var i="*."+r;for(var n in t){var a=t[n];if(i===a||e===a)return!0}return!1}function z(t,e,r,i){var n=t.indexOf(e,r);if(-1===n)throw new Error(i);return n+e.length-1}function J(t,e,r,i){void 0===i&&(i=">");var n=function(t,e,r){var i;void 0===r&&(r=">");for(var n="",a=e;a<t.length;a++){var s=t[a];if(i)s===i&&(i="");else if('"'===s||"'"===s)i=s;else if(s===r[0]){if(!r[1])return{data:n,index:a};if(t[a+1]===r[1])return{data:n,index:a}}else"\t"===s&&(s=" ");n+=s}}(t,e+1,i);if(n){var a=n.data,s=n.index,o=a.search(/\s/),u=a,l=!0;-1!==o&&(u=a.substring(0,o),a=a.substring(o+1).trimStart());var h=u;if(r){var f=u.indexOf(":");-1!==f&&(l=(u=u.substr(f+1))!==n.data.substr(f+1))}return{tagName:u,tagExp:a,closeIndex:s,attrExpPresent:l,rawTagName:h}}}function H(t,e,r){for(var i=r,n=1;r<t.length;r++)if("<"===t[r])if("/"===t[r+1]){var a=z(t,">",r,e+" is not closed");if(t.substring(r+2,a).trim()===e&&0==--n)return{tagContent:t.substring(i,r),i:a};r=a}else if("?"===t[r+1])r=z(t,"?>",r+1,"StopNode is not closed.");else if("!--"===t.substr(r+1,3))r=z(t,"--\x3e",r+3,"StopNode is not closed.");else if("!["===t.substr(r+1,2))r=z(t,"]]>",r,"StopNode is not closed.")-2;else{var s=J(t,r,">");s&&((s&&s.tagName)===e&&"/"!==s.tagExp[s.tagExp.length-1]&&n++,r=s.closeIndex)}}function K(t,e,r){if(e&&"string"==typeof t){var i=t.trim();return"true"===i||"false"!==i&&function(t,e={}){if(e=Object.assign({},M,e),!t||"string"!=typeof t)return t;let r=t.trim();if(void 0!==e.skipLike&&e.skipLike.test(r))return t;if("0"===t)return 0;if(e.hex&&D.test(r))return function(t){if(parseInt)return parseInt(t,16);if(Number.parseInt)return Number.parseInt(t,16);if(window&&window.parseInt)return window.parseInt(t,16);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}(r);if(-1!==r.search(/.+[eE].+/))return function(t,e,r){if(!r.eNotation)return t;const i=e.match(_);if(i){let n=i[1]||"";const a=-1===i[3].indexOf("e")?"E":"e",s=i[2],o=n?t[s.length+1]===a:t[s.length]===a;return s.length>1&&o?t:1!==s.length||!i[3].startsWith(`.${a}`)&&i[3][0]!==a?r.leadingZeros&&!o?(e=(i[1]||"")+i[3],Number(e)):t:Number(e)}return t}(t,r,e);{const n=V.exec(r);if(n){const a=n[1]||"",s=n[2];let o=(i=n[3])&&-1!==i.indexOf(".")?("."===(i=i.replace(/0+$/,""))?i="0":"."===i[0]?i="0"+i:"."===i[i.length-1]&&(i=i.substring(0,i.length-1)),i):i;const u=a?"."===t[s.length+1]:"."===t[s.length];if(!e.leadingZeros&&(s.length>1||1===s.length&&!u))return t;{const i=Number(r),n=String(i);if(0===i||-0===i)return i;if(-1!==n.search(/[eE]/))return e.eNotation?i:t;if(-1!==r.indexOf("."))return"0"===n||n===o||n===`${a}${o}`?i:t;let u=s?o:r;return s?u===n||a+u===n?i:t:u===n||u===a+n?i:t}}return t}var i}(t,r)}return void 0!==t?t:""}var Q=T.getMetaDataSymbol();function tt(t,e){return et(t,e)}function et(t,e,r){for(var i,n={},a=0;a<t.length;a++){var s,o=t[a],u=rt(o);if(s=void 0===r?u:r+"."+u,u===e.textNodeName)void 0===i?i=o[u]:i+=""+o[u];else{if(void 0===u)continue;if(o[u]){var l=et(o[u],e,s),h=nt(l,e);void 0!==o[Q]&&(l[Q]=o[Q]),o[":@"]?it(l,o[":@"],s,e):1!==Object.keys(l).length||void 0===l[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(l).length&&(e.alwaysCreateTextNode?l[e.textNodeName]="":l=""):l=l[e.textNodeName],void 0!==n[u]&&n.hasOwnProperty(u)?(Array.isArray(n[u])||(n[u]=[n[u]]),n[u].push(l)):e.isArray(u,s,h)?n[u]=[l]:n[u]=l}}}return"string"==typeof i?i.length>0&&(n[e.textNodeName]=i):void 0!==i&&(n[e.textNodeName]=i),n}function rt(t){for(var e=Object.keys(t),r=0;r<e.length;r++){var i=e[r];if(":@"!==i)return i}}function it(t,e,r,i){if(e)for(var n=Object.keys(e),a=n.length,s=0;s<a;s++){var o=n[s];i.isArray(o,r+"."+o,!0,!0)?t[o]=[e[o]]:t[o]=e[o]}}function nt(t,e){var r=e.textNodeName,i=Object.keys(t).length;return 0===i||!(1!==i||!t[r]&&"boolean"!=typeof t[r]&&0!==t[r])}var at=function(){function t(t){this.externalEntities={},this.options=function(t){return Object.assign({},y,t)}(t)}var e=t.prototype;return e.parse=function(t,e){if("string"==typeof t);else{if(!t.toString)throw new Error("XML data is accepted in String or Bytes[] form.");t=t.toString()}if(e){!0===e&&(e={});var r=o(t,e);if(!0!==r)throw Error(r.err.msg+":"+r.err.line+":"+r.err.col)}var i=new L(this.options);i.addExternalEntities(this.externalEntities);var n=i.parseXml(t);return this.options.preserveOrder||void 0===n?n:tt(n,this.options)},e.addEntity=function(t,e){if(-1!==e.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==t.indexOf("&")||-1!==t.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===e)throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e},t.getMetaDataSymbol=function(){return T.getMetaDataSymbol()},t}();function st(t,e){var r="";return e.format&&e.indentBy.length>0&&(r="\n"),ot(t,e,"",r)}function ot(t,e,r,i){for(var n="",a=!1,s=0;s<t.length;s++){var o=t[s],u=ut(o);if(void 0!==u){var l;if(l=0===r.length?u:r+"."+u,u!==e.textNodeName)if(u!==e.cdataPropName)if(u!==e.commentPropName)if("?"!==u[0]){var h=i;""!==h&&(h+=e.indentBy);var f=i+"<"+u+lt(o[":@"],e),d=ot(o[u],e,l,h);-1!==e.unpairedTags.indexOf(u)?e.suppressUnpairedNode?n+=f+">":n+=f+"/>":d&&0!==d.length||!e.suppressEmptyNode?d&&d.endsWith(">")?n+=f+">"+d+i+"</"+u+">":(n+=f+">",d&&""!==i&&(d.includes("/>")||d.includes("</"))?n+=i+e.indentBy+d+i:n+=d,n+="</"+u+">"):n+=f+"/>",a=!0}else{var p=lt(o[":@"],e),g="?xml"===u?"":i,c=o[u][0][e.textNodeName];n+=g+"<"+u+(c=0!==c.length?" "+c:"")+p+"?>",a=!0}else n+=i+"\x3c!--"+o[u][0][e.textNodeName]+"--\x3e",a=!0;else a&&(n+=i),n+="<![CDATA["+o[u][0][e.textNodeName]+"]]>",a=!1;else{var v=o[u];ht(l,e)||(v=ft(v=e.tagValueProcessor(u,v),e)),a&&(n+=i),n+=v,a=!1}}}return n}function ut(t){for(var e=Object.keys(t),r=0;r<e.length;r++){var i=e[r];if(t.hasOwnProperty(i)&&":@"!==i)return i}}function lt(t,e){var r="";if(t&&!e.ignoreAttributes)for(var i in t)if(t.hasOwnProperty(i)){var n=e.attributeValueProcessor(i,t[i]);!0===(n=ft(n,e))&&e.suppressBooleanAttributes?r+=" "+i.substr(e.attributeNamePrefix.length):r+=" "+i.substr(e.attributeNamePrefix.length)+'="'+n+'"'}return r}function ht(t,e){var r=(t=t.substr(0,t.length-e.textNodeName.length-1)).substr(t.lastIndexOf(".")+1);for(var i in e.stopNodes)if(e.stopNodes[i]===t||e.stopNodes[i]==="*."+r)return!0;return!1}function ft(t,e){if(t&&t.length>0&&e.processEntities)for(var r=0;r<e.entities.length;r++){var i=e.entities[r];t=t.replace(i.regex,i.val)}return t}var dt={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function pt(t){this.options=Object.assign({},dt,t),!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=F(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=vt),this.processTextOrObjNode=gt,this.options.format?(this.indentate=ct,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function gt(t,e,r,i){var n=this.j2x(t,r+1,i.concat(e));return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,n.attrStr,r):this.buildObjectNode(n.val,e,n.attrStr,r)}function ct(t){return this.options.indentBy.repeat(t)}function vt(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}pt.prototype.build=function(t){return this.options.preserveOrder?st(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&((e={})[this.options.arrayNodeName]=t,t=e),this.j2x(t,0,[]).val);var e},pt.prototype.j2x=function(t,e,r){var i="",n="",a=r.join(".");for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s))if(void 0===t[s])this.isAttribute(s)&&(n+="");else if(null===t[s])this.isAttribute(s)||s===this.options.cdataPropName?n+="":"?"===s[0]?n+=this.indentate(e)+"<"+s+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+s+"/"+this.tagEndChar;else if(t[s]instanceof Date)n+=this.buildTextValNode(t[s],s,"",e);else if("object"!=typeof t[s]){var o=this.isAttribute(s);if(o&&!this.ignoreAttributesFn(o,a))i+=this.buildAttrPairStr(o,""+t[s]);else if(!o)if(s===this.options.textNodeName){var u=this.options.tagValueProcessor(s,""+t[s]);n+=this.replaceEntitiesValue(u)}else n+=this.buildTextValNode(t[s],s,"",e)}else if(Array.isArray(t[s])){for(var l=t[s].length,h="",f="",d=0;d<l;d++){var p=t[s][d];if(void 0===p);else if(null===p)"?"===s[0]?n+=this.indentate(e)+"<"+s+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+s+"/"+this.tagEndChar;else if("object"==typeof p)if(this.options.oneListGroup){var g=this.j2x(p,e+1,r.concat(s));h+=g.val,this.options.attributesGroupName&&p.hasOwnProperty(this.options.attributesGroupName)&&(f+=g.attrStr)}else h+=this.processTextOrObjNode(p,s,e,r);else if(this.options.oneListGroup){var c=this.options.tagValueProcessor(s,p);h+=c=this.replaceEntitiesValue(c)}else h+=this.buildTextValNode(p,s,"",e)}this.options.oneListGroup&&(h=this.buildObjectNode(h,s,f,e)),n+=h}else if(this.options.attributesGroupName&&s===this.options.attributesGroupName)for(var v=Object.keys(t[s]),m=v.length,x=0;x<m;x++)i+=this.buildAttrPairStr(v[x],""+t[s][v[x]]);else n+=this.processTextOrObjNode(t[s],s,e,r);return{attrStr:i,val:n}},pt.prototype.buildAttrPairStr=function(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&"true"===e?" "+t:" "+t+'="'+e+'"'},pt.prototype.buildObjectNode=function(t,e,r,i){if(""===t)return"?"===e[0]?this.indentate(i)+"<"+e+r+"?"+this.tagEndChar:this.indentate(i)+"<"+e+r+this.closeTag(e)+this.tagEndChar;var n="</"+e+this.tagEndChar,a="";return"?"===e[0]&&(a="?",n=""),!r&&""!==r||-1!==t.indexOf("<")?!1!==this.options.commentPropName&&e===this.options.commentPropName&&0===a.length?this.indentate(i)+"\x3c!--"+t+"--\x3e"+this.newLine:this.indentate(i)+"<"+e+r+a+this.tagEndChar+t+this.indentate(i)+n:this.indentate(i)+"<"+e+r+a+">"+t+n},pt.prototype.closeTag=function(t){var e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":"></"+t,e},pt.prototype.buildTextValNode=function(t,e,r,i){if(!1!==this.options.cdataPropName&&e===this.options.cdataPropName)return this.indentate(i)+"<![CDATA["+t+"]]>"+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(i)+"\x3c!--"+t+"--\x3e"+this.newLine;if("?"===e[0])return this.indentate(i)+"<"+e+r+"?"+this.tagEndChar;var n=this.options.tagValueProcessor(e,t);return""===(n=this.replaceEntitiesValue(n))?this.indentate(i)+"<"+e+r+this.closeTag(e)+this.tagEndChar:this.indentate(i)+"<"+e+r+">"+n+"</"+e+this.tagEndChar},pt.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(var e=0;e<this.options.entities.length;e++){var r=this.options.entities[e];t=t.replace(r.regex,r.val)}return t};var mt={validate:o};return e})()));
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.fxp=e():t.fxp=e()}(this,(()=>(()=>{"use strict";var t={d:(e,r)=>{for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{XMLBuilder:()=>pt,XMLParser:()=>at,XMLValidator:()=>mt});var r=":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",i=new RegExp("^["+r+"]["+r+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");function n(t,e){for(var r=[],i=e.exec(t);i;){var n=[];n.startIndex=e.lastIndex-i[0].length;for(var a=i.length,s=0;s<a;s++)n.push(i[s]);r.push(n),i=e.exec(t)}return r}var a=function(t){return!(null==i.exec(t))},s={allowBooleanAttributes:!1,unpairedTags:[]};function o(t,e){e=Object.assign({},s,e);var r=[],i=!1,n=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(var o=0;o<t.length;o++)if("<"===t[o]&&"?"===t[o+1]){if((o=l(t,o+=2)).err)return o}else{if("<"!==t[o]){if(u(t[o]))continue;return m("InvalidChar","char '"+t[o]+"' is not expected.",b(t,o))}var f=o;if("!"===t[++o]){o=h(t,o);continue}var d=!1;"/"===t[o]&&(d=!0,o++);for(var g="";o<t.length&&">"!==t[o]&&" "!==t[o]&&"\t"!==t[o]&&"\n"!==t[o]&&"\r"!==t[o];o++)g+=t[o];if("/"===(g=g.trim())[g.length-1]&&(g=g.substring(0,g.length-1),o--),!a(g))return m("InvalidTag",0===g.trim().length?"Invalid space after '<'.":"Tag '"+g+"' is an invalid name.",b(t,o));var x=p(t,o);if(!1===x)return m("InvalidAttr","Attributes for '"+g+"' have open quote.",b(t,o));var N=x.value;if(o=x.index,"/"===N[N.length-1]){var E=o-N.length,y=c(N=N.substring(0,N.length-1),e);if(!0!==y)return m(y.err.code,y.err.msg,b(t,E+y.err.line));i=!0}else if(d){if(!x.tagClosed)return m("InvalidTag","Closing tag '"+g+"' doesn't have proper closing.",b(t,o));if(N.trim().length>0)return m("InvalidTag","Closing tag '"+g+"' can't have attributes or invalid starting.",b(t,f));if(0===r.length)return m("InvalidTag","Closing tag '"+g+"' has not been opened.",b(t,f));var T=r.pop();if(g!==T.tagName){var w=b(t,T.tagStartPos);return m("InvalidTag","Expected closing tag '"+T.tagName+"' (opened in line "+w.line+", col "+w.col+") instead of closing tag '"+g+"'.",b(t,f))}0==r.length&&(n=!0)}else{var P=c(N,e);if(!0!==P)return m(P.err.code,P.err.msg,b(t,o-N.length+P.err.line));if(!0===n)return m("InvalidXml","Multiple possible root nodes found.",b(t,o));-1!==e.unpairedTags.indexOf(g)||r.push({tagName:g,tagStartPos:f}),i=!0}for(o++;o<t.length;o++)if("<"===t[o]){if("!"===t[o+1]){o=h(t,++o);continue}if("?"!==t[o+1])break;if((o=l(t,++o)).err)return o}else if("&"===t[o]){var A=v(t,o);if(-1==A)return m("InvalidChar","char '&' is not expected.",b(t,o));o=A}else if(!0===n&&!u(t[o]))return m("InvalidXml","Extra text at the end",b(t,o));"<"===t[o]&&o--}return i?1==r.length?m("InvalidTag","Unclosed tag '"+r[0].tagName+"'.",b(t,r[0].tagStartPos)):!(r.length>0)||m("InvalidXml","Invalid '"+JSON.stringify(r.map((function(t){return t.tagName})),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):m("InvalidXml","Start tag expected.",1)}function u(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function l(t,e){for(var r=e;e<t.length;e++)if("?"!=t[e]&&" "!=t[e]);else{var i=t.substr(r,e-r);if(e>5&&"xml"===i)return m("InvalidXml","XML declaration allowed only at the start of the document.",b(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function h(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){var r=1;for(e+=8;e<t.length;e++)if("<"===t[e])r++;else if(">"===t[e]&&0==--r)break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}var f='"',d="'";function p(t,e){for(var r="",i="",n=!1;e<t.length;e++){if(t[e]===f||t[e]===d)""===i?i=t[e]:i!==t[e]||(i="");else if(">"===t[e]&&""===i){n=!0;break}r+=t[e]}return""===i&&{value:r,index:e,tagClosed:n}}var g=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function c(t,e){for(var r=n(t,g),i={},a=0;a<r.length;a++){if(0===r[a][1].length)return m("InvalidAttr","Attribute '"+r[a][2]+"' has no space in starting.",N(r[a]));if(void 0!==r[a][3]&&void 0===r[a][4])return m("InvalidAttr","Attribute '"+r[a][2]+"' is without value.",N(r[a]));if(void 0===r[a][3]&&!e.allowBooleanAttributes)return m("InvalidAttr","boolean attribute '"+r[a][2]+"' is not allowed.",N(r[a]));var s=r[a][2];if(!x(s))return m("InvalidAttr","Attribute '"+s+"' is an invalid name.",N(r[a]));if(i.hasOwnProperty(s))return m("InvalidAttr","Attribute '"+s+"' is repeated.",N(r[a]));i[s]=1}return!0}function v(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){var r=/\d/;for("x"===t[e]&&(e++,r=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(r))break}return-1}(t,++e);for(var r=0;e<t.length;e++,r++)if(!(t[e].match(/\w/)&&r<20)){if(";"===t[e])break;return-1}return e}function m(t,e,r){return{err:{code:t,msg:e,line:r.line||r,col:r.col}}}function x(t){return a(t)}function b(t,e){var r=t.substring(0,e).split(/\r?\n/);return{line:r.length,col:r[r.length-1].length+1}}function N(t){return t.startIndex+t[1].length}var E,y={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:function(){return!1},commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,r){return t},captureMetaData:!1};E="function"!=typeof Symbol?"@@xmlMetadata":Symbol("XML Node Metadata");var T=function(){function t(t){this.tagname=t,this.child=[],this[":@"]={}}var e=t.prototype;return e.add=function(t,e){var r;"__proto__"===t&&(t="#__proto__"),this.child.push(((r={})[t]=e,r))},e.addChild=function(t,e){var r,i;"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push(((r={})[t.tagname]=t.child,r[":@"]=t[":@"],r)):this.child.push(((i={})[t.tagname]=t.child,i)),void 0!==e&&(this.child[this.child.length-1][E]={startIndex:e})},t.getMetaDataSymbol=function(){return E},t}();function w(t,e){var r={};if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");e+=9;for(var i=1,n=!1,a=!1;e<t.length;e++)if("<"!==t[e]||a)if(">"===t[e]){if(a?"-"===t[e-1]&&"-"===t[e-2]&&(a=!1,i--):i--,0===i)break}else"["===t[e]?n=!0:t[e];else{if(n&&C(t,"!ENTITY",e)){var s,o=void 0,u=A(t,(e+=7)+1);s=u[0],o=u[1],e=u[2],-1===o.indexOf("&")&&(r[s]={regx:RegExp("&"+s+";","g"),val:o})}else if(n&&C(t,"!ELEMENT",e))e=S(t,(e+=8)+1).index;else if(n&&C(t,"!ATTLIST",e))e+=8;else if(n&&C(t,"!NOTATION",e))e=O(t,(e+=9)+1).index;else{if(!C(t,"!--",e))throw new Error("Invalid DOCTYPE");a=!0}i++}if(0!==i)throw new Error("Unclosed DOCTYPE");return{entities:r,i:e}}var P=function(t,e){for(;e<t.length&&/\s/.test(t[e]);)e++;return e};function A(t,e){e=P(t,e);for(var r="";e<t.length&&!/\s/.test(t[e])&&'"'!==t[e]&&"'"!==t[e];)r+=t[e],e++;if(j(r),e=P(t,e),"SYSTEM"===t.substring(e,e+6).toUpperCase())throw new Error("External entities are not supported");if("%"===t[e])throw new Error("Parameter entities are not supported");var i=I(t,e,"entity");return e=i[0],[r,i[1],--e]}function O(t,e){e=P(t,e);for(var r="";e<t.length&&!/\s/.test(t[e]);)r+=t[e],e++;j(r),e=P(t,e);var i=t.substring(e,e+6).toUpperCase();if("SYSTEM"!==i&&"PUBLIC"!==i)throw new Error('Expected SYSTEM or PUBLIC, found "'+i+'"');e+=i.length,e=P(t,e);var n=null,a=null;if("PUBLIC"===i){var s=I(t,e,"publicIdentifier");if(e=s[0],n=s[1],'"'===t[e=P(t,e)]||"'"===t[e]){var o=I(t,e,"systemIdentifier");e=o[0],a=o[1]}}else if("SYSTEM"===i){var u=I(t,e,"systemIdentifier");if(e=u[0],!(a=u[1]))throw new Error("Missing mandatory system identifier for SYSTEM notation")}return{notationName:r,publicIdentifier:n,systemIdentifier:a,index:--e}}function I(t,e,r){var i="",n=t[e];if('"'!==n&&"'"!==n)throw new Error('Expected quoted string, found "'+n+'"');for(e++;e<t.length&&t[e]!==n;)i+=t[e],e++;if(t[e]!==n)throw new Error("Unterminated "+r+" value");return[++e,i]}function S(t,e){e=P(t,e);for(var r="";e<t.length&&!/\s/.test(t[e]);)r+=t[e],e++;if(!j(r))throw new Error('Invalid element name: "'+r+'"');var i="";if("E"===t[e=P(t,e)]&&C(t,"MPTY",e))e+=4;else if("A"===t[e]&&C(t,"NY",e))e+=2;else{if("("!==t[e])throw new Error('Invalid Element Expression, found "'+t[e]+'"');for(e++;e<t.length&&")"!==t[e];)i+=t[e],e++;if(")"!==t[e])throw new Error("Unterminated content model")}return{elementName:r,contentModel:i.trim(),index:e}}function C(t,e,r){for(var i=0;i<e.length;i++)if(e[i]!==t[r+i+1])return!1;return!0}function j(t){if(a(t))return t;throw new Error("Invalid entity name "+t)}const D=/^[-+]?0x[a-fA-F0-9]+$/,V=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,M={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};const _=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function k(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=Array(e);r<e;r++)i[r]=t[r];return i}function F(t){return"function"==typeof t?t:Array.isArray(t)?function(e){for(var r,i=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return k(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?k(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(t);!(r=i()).done;){var n=r.value;if("string"==typeof n&&e===n)return!0;if(n instanceof RegExp&&n.test(e))return!0}}:function(){return!1}}var L=function(t){this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:function(t,e){return String.fromCodePoint(Number.parseInt(e,10))}},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:function(t,e){return String.fromCodePoint(Number.parseInt(e,16))}}},this.addExternalEntities=B,this.parseXml=R,this.parseTextData=U,this.resolveNameSpace=G,this.buildAttributesMap=Y,this.isItStopNode=W,this.replaceEntitiesValue=q,this.readStopNodeData=H,this.saveTextToParentTag=Z,this.addChild=$,this.ignoreAttributesFn=F(this.options.ignoreAttributes)};function B(t){for(var e=Object.keys(t),r=0;r<e.length;r++){var i=e[r];this.lastEntities[i]={regex:new RegExp("&"+i+";","g"),val:t[i]}}}function U(t,e,r,i,n,a,s){if(void 0!==t&&(this.options.trimValues&&!i&&(t=t.trim()),t.length>0)){s||(t=this.replaceEntitiesValue(t));var o=this.options.tagValueProcessor(e,t,r,n,a);return null==o?t:typeof o!=typeof t||o!==t?o:this.options.trimValues||t.trim()===t?K(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function G(t){if(this.options.removeNSPrefix){var e=t.split(":"),r="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=r+e[1])}return t}var X=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function Y(t,e,r){if(!0!==this.options.ignoreAttributes&&"string"==typeof t){for(var i=n(t,X),a=i.length,s={},o=0;o<a;o++){var u=this.resolveNameSpace(i[o][1]);if(!this.ignoreAttributesFn(u,e)){var l=i[o][4],h=this.options.attributeNamePrefix+u;if(u.length)if(this.options.transformAttributeName&&(h=this.options.transformAttributeName(h)),"__proto__"===h&&(h="#__proto__"),void 0!==l){this.options.trimValues&&(l=l.trim()),l=this.replaceEntitiesValue(l);var f=this.options.attributeValueProcessor(u,l,e);s[h]=null==f?l:typeof f!=typeof l||f!==l?f:K(l,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(s[h]=!0)}}if(!Object.keys(s).length)return;if(this.options.attributesGroupName){var d={};return d[this.options.attributesGroupName]=s,d}return s}}var R=function(t){t=t.replace(/\r\n?/g,"\n");for(var e=new T("!xml"),r=e,i="",n="",a=0;a<t.length;a++)if("<"===t[a])if("/"===t[a+1]){var s=z(t,">",a,"Closing Tag is not closed."),o=t.substring(a+2,s).trim();if(this.options.removeNSPrefix){var u=o.indexOf(":");-1!==u&&(o=o.substr(u+1))}this.options.transformTagName&&(o=this.options.transformTagName(o)),r&&(i=this.saveTextToParentTag(i,r,n));var l=n.substring(n.lastIndexOf(".")+1);if(o&&-1!==this.options.unpairedTags.indexOf(o))throw new Error("Unpaired tag can not be used as closing tag: </"+o+">");var h=0;l&&-1!==this.options.unpairedTags.indexOf(l)?(h=n.lastIndexOf(".",n.lastIndexOf(".")-1),this.tagsNodeStack.pop()):h=n.lastIndexOf("."),n=n.substring(0,h),r=this.tagsNodeStack.pop(),i="",a=s}else if("?"===t[a+1]){var f=J(t,a,!1,"?>");if(!f)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,r,n),this.options.ignoreDeclaration&&"?xml"===f.tagName||this.options.ignorePiTags);else{var d=new T(f.tagName);d.add(this.options.textNodeName,""),f.tagName!==f.tagExp&&f.attrExpPresent&&(d[":@"]=this.buildAttributesMap(f.tagExp,n,f.tagName)),this.addChild(r,d,n,a)}a=f.closeIndex+1}else if("!--"===t.substr(a+1,3)){var p=z(t,"--\x3e",a+4,"Comment is not closed.");if(this.options.commentPropName){var g,c=t.substring(a+4,p-2);i=this.saveTextToParentTag(i,r,n),r.add(this.options.commentPropName,[(g={},g[this.options.textNodeName]=c,g)])}a=p}else if("!D"===t.substr(a+1,2)){var v=w(t,a);this.docTypeEntities=v.entities,a=v.i}else if("!["===t.substr(a+1,2)){var m=z(t,"]]>",a,"CDATA is not closed.")-2,x=t.substring(a+9,m);i=this.saveTextToParentTag(i,r,n);var b,N=this.parseTextData(x,r.tagname,n,!0,!1,!0,!0);null==N&&(N=""),this.options.cdataPropName?r.add(this.options.cdataPropName,[(b={},b[this.options.textNodeName]=x,b)]):r.add(this.options.textNodeName,N),a=m+2}else{var E=J(t,a,this.options.removeNSPrefix),y=E.tagName,P=E.rawTagName,A=E.tagExp,O=E.attrExpPresent,I=E.closeIndex;this.options.transformTagName&&(y=this.options.transformTagName(y)),r&&i&&"!xml"!==r.tagname&&(i=this.saveTextToParentTag(i,r,n,!1));var S=r;S&&-1!==this.options.unpairedTags.indexOf(S.tagname)&&(r=this.tagsNodeStack.pop(),n=n.substring(0,n.lastIndexOf("."))),y!==e.tagname&&(n+=n?"."+y:y);var C=a;if(this.isItStopNode(this.options.stopNodes,n,y)){var j="";if(A.length>0&&A.lastIndexOf("/")===A.length-1)"/"===y[y.length-1]?(y=y.substr(0,y.length-1),n=n.substr(0,n.length-1),A=y):A=A.substr(0,A.length-1),a=E.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(y))a=E.closeIndex;else{var D=this.readStopNodeData(t,P,I+1);if(!D)throw new Error("Unexpected end of "+P);a=D.i,j=D.tagContent}var V=new T(y);y!==A&&O&&(V[":@"]=this.buildAttributesMap(A,n,y)),j&&(j=this.parseTextData(j,y,n,!0,O,!0,!0)),n=n.substr(0,n.lastIndexOf(".")),V.add(this.options.textNodeName,j),this.addChild(r,V,n,C)}else{if(A.length>0&&A.lastIndexOf("/")===A.length-1){"/"===y[y.length-1]?(y=y.substr(0,y.length-1),n=n.substr(0,n.length-1),A=y):A=A.substr(0,A.length-1),this.options.transformTagName&&(y=this.options.transformTagName(y));var M=new T(y);y!==A&&O&&(M[":@"]=this.buildAttributesMap(A,n,y)),this.addChild(r,M,n,C),n=n.substr(0,n.lastIndexOf("."))}else{var _=new T(y);this.tagsNodeStack.push(r),y!==A&&O&&(_[":@"]=this.buildAttributesMap(A,n,y)),this.addChild(r,_,n,C),r=_}i="",a=I}}else i+=t[a];return e.child};function $(t,e,r,i){this.options.captureMetaData||(i=void 0);var n=this.options.updateTag(e.tagname,r,e[":@"]);!1===n||("string"==typeof n?(e.tagname=n,t.addChild(e,i)):t.addChild(e,i))}var q=function(t){if(this.options.processEntities){for(var e in this.docTypeEntities){var r=this.docTypeEntities[e];t=t.replace(r.regx,r.val)}for(var i in this.lastEntities){var n=this.lastEntities[i];t=t.replace(n.regex,n.val)}if(this.options.htmlEntities)for(var a in this.htmlEntities){var s=this.htmlEntities[a];t=t.replace(s.regex,s.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function Z(t,e,r,i){return t&&(void 0===i&&(i=0===e.child.length),void 0!==(t=this.parseTextData(t,e.tagname,r,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,i))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function W(t,e,r){var i="*."+r;for(var n in t){var a=t[n];if(i===a||e===a)return!0}return!1}function z(t,e,r,i){var n=t.indexOf(e,r);if(-1===n)throw new Error(i);return n+e.length-1}function J(t,e,r,i){void 0===i&&(i=">");var n=function(t,e,r){var i;void 0===r&&(r=">");for(var n="",a=e;a<t.length;a++){var s=t[a];if(i)s===i&&(i="");else if('"'===s||"'"===s)i=s;else if(s===r[0]){if(!r[1])return{data:n,index:a};if(t[a+1]===r[1])return{data:n,index:a}}else"\t"===s&&(s=" ");n+=s}}(t,e+1,i);if(n){var a=n.data,s=n.index,o=a.search(/\s/),u=a,l=!0;-1!==o&&(u=a.substring(0,o),a=a.substring(o+1).trimStart());var h=u;if(r){var f=u.indexOf(":");-1!==f&&(l=(u=u.substr(f+1))!==n.data.substr(f+1))}return{tagName:u,tagExp:a,closeIndex:s,attrExpPresent:l,rawTagName:h}}}function H(t,e,r){for(var i=r,n=1;r<t.length;r++)if("<"===t[r])if("/"===t[r+1]){var a=z(t,">",r,e+" is not closed");if(t.substring(r+2,a).trim()===e&&0==--n)return{tagContent:t.substring(i,r),i:a};r=a}else if("?"===t[r+1])r=z(t,"?>",r+1,"StopNode is not closed.");else if("!--"===t.substr(r+1,3))r=z(t,"--\x3e",r+3,"StopNode is not closed.");else if("!["===t.substr(r+1,2))r=z(t,"]]>",r,"StopNode is not closed.")-2;else{var s=J(t,r,">");s&&((s&&s.tagName)===e&&"/"!==s.tagExp[s.tagExp.length-1]&&n++,r=s.closeIndex)}}function K(t,e,r){if(e&&"string"==typeof t){var i=t.trim();return"true"===i||"false"!==i&&function(t,e={}){if(e=Object.assign({},M,e),!t||"string"!=typeof t)return t;let r=t.trim();if(void 0!==e.skipLike&&e.skipLike.test(r))return t;if("0"===t)return 0;if(e.hex&&D.test(r))return function(t){if(parseInt)return parseInt(t,16);if(Number.parseInt)return Number.parseInt(t,16);if(window&&window.parseInt)return window.parseInt(t,16);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}(r);if(-1!==r.search(/.+[eE].+/))return function(t,e,r){if(!r.eNotation)return t;const i=e.match(_);if(i){let n=i[1]||"";const a=-1===i[3].indexOf("e")?"E":"e",s=i[2],o=n?t[s.length+1]===a:t[s.length]===a;return s.length>1&&o?t:1!==s.length||!i[3].startsWith(`.${a}`)&&i[3][0]!==a?r.leadingZeros&&!o?(e=(i[1]||"")+i[3],Number(e)):t:Number(e)}return t}(t,r,e);{const n=V.exec(r);if(n){const a=n[1]||"",s=n[2];let o=(i=n[3])&&-1!==i.indexOf(".")?("."===(i=i.replace(/0+$/,""))?i="0":"."===i[0]?i="0"+i:"."===i[i.length-1]&&(i=i.substring(0,i.length-1)),i):i;const u=a?"."===t[s.length+1]:"."===t[s.length];if(!e.leadingZeros&&(s.length>1||1===s.length&&!u))return t;{const i=Number(r),n=String(i);if(0===i||-0===i)return i;if(-1!==n.search(/[eE]/))return e.eNotation?i:t;if(-1!==r.indexOf("."))return"0"===n||n===o||n===`${a}${o}`?i:t;let u=s?o:r;return s?u===n||a+u===n?i:t:u===n||u===a+n?i:t}}return t}var i}(t,r)}return void 0!==t?t:""}var Q=T.getMetaDataSymbol();function tt(t,e){return et(t,e)}function et(t,e,r){for(var i,n={},a=0;a<t.length;a++){var s,o=t[a],u=rt(o);if(s=void 0===r?u:r+"."+u,u===e.textNodeName)void 0===i?i=o[u]:i+=""+o[u];else{if(void 0===u)continue;if(o[u]){var l=et(o[u],e,s),h=nt(l,e);void 0!==o[Q]&&(l[Q]=o[Q]),o[":@"]?it(l,o[":@"],s,e):1!==Object.keys(l).length||void 0===l[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(l).length&&(e.alwaysCreateTextNode?l[e.textNodeName]="":l=""):l=l[e.textNodeName],void 0!==n[u]&&n.hasOwnProperty(u)?(Array.isArray(n[u])||(n[u]=[n[u]]),n[u].push(l)):e.isArray(u,s,h)?n[u]=[l]:n[u]=l}}}return"string"==typeof i?i.length>0&&(n[e.textNodeName]=i):void 0!==i&&(n[e.textNodeName]=i),n}function rt(t){for(var e=Object.keys(t),r=0;r<e.length;r++){var i=e[r];if(":@"!==i)return i}}function it(t,e,r,i){if(e)for(var n=Object.keys(e),a=n.length,s=0;s<a;s++){var o=n[s];i.isArray(o,r+"."+o,!0,!0)?t[o]=[e[o]]:t[o]=e[o]}}function nt(t,e){var r=e.textNodeName,i=Object.keys(t).length;return 0===i||!(1!==i||!t[r]&&"boolean"!=typeof t[r]&&0!==t[r])}var at=function(){function t(t){this.externalEntities={},this.options=function(t){return Object.assign({},y,t)}(t)}var e=t.prototype;return e.parse=function(t,e){if("string"==typeof t);else{if(!t.toString)throw new Error("XML data is accepted in String or Bytes[] form.");t=t.toString()}if(e){!0===e&&(e={});var r=o(t,e);if(!0!==r)throw Error(r.err.msg+":"+r.err.line+":"+r.err.col)}var i=new L(this.options);i.addExternalEntities(this.externalEntities);var n=i.parseXml(t);return this.options.preserveOrder||void 0===n?n:tt(n,this.options)},e.addEntity=function(t,e){if(-1!==e.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==t.indexOf("&")||-1!==t.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===e)throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e},t.getMetaDataSymbol=function(){return T.getMetaDataSymbol()},t}();function st(t,e){var r="";return e.format&&e.indentBy.length>0&&(r="\n"),ot(t,e,"",r)}function ot(t,e,r,i){for(var n="",a=!1,s=0;s<t.length;s++){var o=t[s],u=ut(o);if(void 0!==u){var l;if(l=0===r.length?u:r+"."+u,u!==e.textNodeName)if(u!==e.cdataPropName)if(u!==e.commentPropName)if("?"!==u[0]){var h=i;""!==h&&(h+=e.indentBy);var f=i+"<"+u+lt(o[":@"],e),d=ot(o[u],e,l,h);-1!==e.unpairedTags.indexOf(u)?e.suppressUnpairedNode?n+=f+">":n+=f+"/>":d&&0!==d.length||!e.suppressEmptyNode?d&&d.endsWith(">")?n+=f+">"+d+i+"</"+u+">":(n+=f+">",d&&""!==i&&(d.includes("/>")||d.includes("</"))?n+=i+e.indentBy+d+i:n+=d,n+="</"+u+">"):n+=f+"/>",a=!0}else{var p=lt(o[":@"],e),g="?xml"===u?"":i,c=o[u][0][e.textNodeName];n+=g+"<"+u+(c=0!==c.length?" "+c:"")+p+"?>",a=!0}else n+=i+"\x3c!--"+o[u][0][e.textNodeName]+"--\x3e",a=!0;else a&&(n+=i),n+="<![CDATA["+o[u][0][e.textNodeName]+"]]>",a=!1;else{var v=o[u];ht(l,e)||(v=ft(v=e.tagValueProcessor(u,v),e)),a&&(n+=i),n+=v,a=!1}}}return n}function ut(t){for(var e=Object.keys(t),r=0;r<e.length;r++){var i=e[r];if(t.hasOwnProperty(i)&&":@"!==i)return i}}function lt(t,e){var r="";if(t&&!e.ignoreAttributes)for(var i in t)if(t.hasOwnProperty(i)){var n=e.attributeValueProcessor(i,t[i]);!0===(n=ft(n,e))&&e.suppressBooleanAttributes?r+=" "+i.substr(e.attributeNamePrefix.length):r+=" "+i.substr(e.attributeNamePrefix.length)+'="'+n+'"'}return r}function ht(t,e){var r=(t=t.substr(0,t.length-e.textNodeName.length-1)).substr(t.lastIndexOf(".")+1);for(var i in e.stopNodes)if(e.stopNodes[i]===t||e.stopNodes[i]==="*."+r)return!0;return!1}function ft(t,e){if(t&&t.length>0&&e.processEntities)for(var r=0;r<e.entities.length;r++){var i=e.entities[r];t=t.replace(i.regex,i.val)}return t}var dt={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function pt(t){this.options=Object.assign({},dt,t),!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=F(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=vt),this.processTextOrObjNode=gt,this.options.format?(this.indentate=ct,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function gt(t,e,r,i){var n=this.j2x(t,r+1,i.concat(e));return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,n.attrStr,r):this.buildObjectNode(n.val,e,n.attrStr,r)}function ct(t){return this.options.indentBy.repeat(t)}function vt(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}pt.prototype.build=function(t){return this.options.preserveOrder?st(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&((e={})[this.options.arrayNodeName]=t,t=e),this.j2x(t,0,[]).val);var e},pt.prototype.j2x=function(t,e,r){var i="",n="",a=r.join(".");for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s))if(void 0===t[s])this.isAttribute(s)&&(n+="");else if(null===t[s])this.isAttribute(s)||s===this.options.cdataPropName?n+="":"?"===s[0]?n+=this.indentate(e)+"<"+s+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+s+"/"+this.tagEndChar;else if(t[s]instanceof Date)n+=this.buildTextValNode(t[s],s,"",e);else if("object"!=typeof t[s]){var o=this.isAttribute(s);if(o&&!this.ignoreAttributesFn(o,a))i+=this.buildAttrPairStr(o,""+t[s]);else if(!o)if(s===this.options.textNodeName){var u=this.options.tagValueProcessor(s,""+t[s]);n+=this.replaceEntitiesValue(u)}else n+=this.buildTextValNode(t[s],s,"",e)}else if(Array.isArray(t[s])){for(var l=t[s].length,h="",f="",d=0;d<l;d++){var p=t[s][d];if(void 0===p);else if(null===p)"?"===s[0]?n+=this.indentate(e)+"<"+s+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+s+"/"+this.tagEndChar;else if("object"==typeof p)if(this.options.oneListGroup){var g=this.j2x(p,e+1,r.concat(s));h+=g.val,this.options.attributesGroupName&&p.hasOwnProperty(this.options.attributesGroupName)&&(f+=g.attrStr)}else h+=this.processTextOrObjNode(p,s,e,r);else if(this.options.oneListGroup){var c=this.options.tagValueProcessor(s,p);h+=c=this.replaceEntitiesValue(c)}else h+=this.buildTextValNode(p,s,"",e)}this.options.oneListGroup&&(h=this.buildObjectNode(h,s,f,e)),n+=h}else if(this.options.attributesGroupName&&s===this.options.attributesGroupName)for(var v=Object.keys(t[s]),m=v.length,x=0;x<m;x++)i+=this.buildAttrPairStr(v[x],""+t[s][v[x]]);else n+=this.processTextOrObjNode(t[s],s,e,r);return{attrStr:i,val:n}},pt.prototype.buildAttrPairStr=function(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&"true"===e?" "+t:" "+t+'="'+e+'"'},pt.prototype.buildObjectNode=function(t,e,r,i){if(""===t)return"?"===e[0]?this.indentate(i)+"<"+e+r+"?"+this.tagEndChar:this.indentate(i)+"<"+e+r+this.closeTag(e)+this.tagEndChar;var n="</"+e+this.tagEndChar,a="";return"?"===e[0]&&(a="?",n=""),!r&&""!==r||-1!==t.indexOf("<")?!1!==this.options.commentPropName&&e===this.options.commentPropName&&0===a.length?this.indentate(i)+"\x3c!--"+t+"--\x3e"+this.newLine:this.indentate(i)+"<"+e+r+a+this.tagEndChar+t+this.indentate(i)+n:this.indentate(i)+"<"+e+r+a+">"+t+n},pt.prototype.closeTag=function(t){var e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":"></"+t,e},pt.prototype.buildTextValNode=function(t,e,r,i){if(!1!==this.options.cdataPropName&&e===this.options.cdataPropName)return this.indentate(i)+"<![CDATA["+t+"]]>"+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(i)+"\x3c!--"+t+"--\x3e"+this.newLine;if("?"===e[0])return this.indentate(i)+"<"+e+r+"?"+this.tagEndChar;var n=this.options.tagValueProcessor(e,t);return""===(n=this.replaceEntitiesValue(n))?this.indentate(i)+"<"+e+r+this.closeTag(e)+this.tagEndChar:this.indentate(i)+"<"+e+r+">"+n+"</"+e+this.tagEndChar},pt.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(var e=0;e<this.options.entities.length;e++){var r=this.options.entities[e];t=t.replace(r.regex,r.val)}return t};var mt={validate:o};return e})()));
2
2
  //# sourceMappingURL=fxp.min.js.map