lakutata 2.0.80 → 2.0.82

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