lakutata 2.0.80 → 2.0.81

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