jsf.js_next_gen 4.1.0-beta.2 → 4.1.0-beta.21

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 (413) hide show
  1. package/AI_CONTRIBUTIONS.md +71 -0
  2. package/README.md +254 -78
  3. package/api-extractor.faces.json +38 -0
  4. package/dist/docs/assets/hierarchy.js +1 -1
  5. package/dist/docs/assets/navigation.js +1 -1
  6. package/dist/docs/assets/search.js +1 -1
  7. package/dist/docs/functions/faces.ajax.addOnError.html +2 -2
  8. package/dist/docs/functions/faces.ajax.addOnEvent.html +2 -2
  9. package/dist/docs/functions/faces.ajax.request.html +2 -2
  10. package/dist/docs/functions/faces.ajax.response.html +2 -2
  11. package/dist/docs/functions/faces.getClientWindow.html +2 -2
  12. package/dist/docs/functions/faces.getProjectStage.html +2 -2
  13. package/dist/docs/functions/faces.getViewState.html +1 -1
  14. package/dist/docs/functions/faces.push.close.html +1 -1
  15. package/dist/docs/functions/faces.push.init.html +6 -6
  16. package/dist/docs/functions/faces.push.open.html +1 -1
  17. package/dist/docs/functions/faces.util.chain.html +2 -2
  18. package/dist/docs/functions/myfaces.ab.html +3 -3
  19. package/dist/docs/functions/myfaces.onDomReady.html +1 -1
  20. package/dist/docs/functions/myfaces.reserveNamespace.html +1 -1
  21. package/dist/docs/hierarchy.html +1 -1
  22. package/dist/docs/index.html +292 -71
  23. package/dist/docs/interfaces/faces.AjaxData.html +6 -0
  24. package/dist/docs/interfaces/faces.AjaxError.html +18 -0
  25. package/dist/docs/interfaces/faces.AjaxEvent.html +8 -0
  26. package/dist/docs/interfaces/faces.ajax.RequestContext.html +6 -0
  27. package/dist/docs/interfaces/faces.ajax.RequestOptions.html +10 -0
  28. package/dist/docs/modules/faces.ajax.html +1 -1
  29. package/dist/docs/modules/faces.html +1 -1
  30. package/dist/docs/modules/faces.push.html +1 -1
  31. package/dist/docs/modules/faces.util.html +1 -1
  32. package/dist/docs/modules/myfaces.html +1 -1
  33. package/dist/docs/modules.html +1 -1
  34. package/dist/docs/types/faces.AjaxErrorStatus.html +2 -0
  35. package/dist/docs/types/faces.AjaxEventStatus.html +2 -0
  36. package/dist/docs/types/faces.ProjectStage.html +2 -0
  37. package/dist/docs/types/faces.ajax.OnErrorCallback.html +2 -0
  38. package/dist/docs/types/faces.ajax.OnEventCallback.html +2 -0
  39. package/dist/docs/types/faces.push.OnCloseHandler.html +2 -0
  40. package/dist/docs/types/faces.push.OnErrorHandler.html +2 -0
  41. package/dist/docs/types/faces.push.OnMessageHandler.html +2 -0
  42. package/dist/docs/types/faces.push.OnOpenHandler.html +2 -0
  43. package/dist/docs/variables/faces.contextpath.html +1 -1
  44. package/dist/docs/variables/faces.implversion.html +1 -1
  45. package/dist/docs/variables/faces.separatorchar.html +1 -1
  46. package/dist/docs/variables/faces.specversion.html +1 -1
  47. package/dist/docs/variables/myfaces.oam.html +1 -1
  48. package/dist/window/faces-development.js +1801 -499
  49. package/dist/window/faces-development.js.map +1 -1
  50. package/{target/api/_api.js → dist/window/faces.d.ts} +124 -151
  51. package/dist/window/faces.js +1 -1
  52. package/dist/window/faces.js.LICENSE.txt +0 -17
  53. package/dist/window/faces.js.map +1 -1
  54. package/dist/window/jsf-development.js +1806 -513
  55. package/dist/window/jsf-development.js.map +1 -1
  56. package/{target/src/main/typescript/api/_api.js → dist/window/jsf.d.ts} +125 -153
  57. package/dist/window/jsf.js +1 -1
  58. package/dist/window/jsf.js.LICENSE.txt +0 -17
  59. package/dist/window/jsf.js.map +1 -1
  60. package/package.json +22 -18
  61. package/scripts/build-dts.mjs +239 -0
  62. package/src/main/typescript/@types/definitions/index.d.ts +22 -122
  63. package/{target/test/frameworkBase/_ext/monadish/fixtures/test2.js → src/main/typescript/@types/definitions/modules.d.ts} +18 -2
  64. package/src/main/typescript/api/_api.ts +132 -29
  65. package/{target/test/frameworkBase/_ext/monadish/fixtures/test.js → src/main/typescript/api/_api_ae_stub.d.ts} +6 -2
  66. package/src/main/typescript/api/faces.ts +2 -2
  67. package/src/main/typescript/api/jsf.ts +15 -23
  68. package/src/main/typescript/impl/AjaxImpl.ts +15 -15
  69. package/src/main/typescript/impl/PushImpl.ts +139 -69
  70. package/src/main/typescript/impl/core/Const.ts +2 -2
  71. package/src/main/typescript/impl/i18n/Messages.ts +1 -1
  72. package/src/main/typescript/impl/util/Assertions.ts +1 -2
  73. package/src/main/typescript/impl/util/AsyncRunnable.ts +3 -4
  74. package/src/main/typescript/impl/util/ExtDomQuery.ts +19 -19
  75. package/src/main/typescript/impl/util/FileUtils.ts +30 -14
  76. package/src/main/typescript/impl/util/HiddenInputBuilder.ts +34 -34
  77. package/src/main/typescript/impl/util/Lang.ts +19 -22
  78. package/src/main/typescript/impl/util/XhrQueueController.ts +25 -3
  79. package/src/main/typescript/impl/xhrCore/ErrorData.ts +17 -12
  80. package/src/main/typescript/impl/xhrCore/EventData.ts +8 -7
  81. package/src/main/typescript/impl/xhrCore/IResponseProcessor.ts +3 -3
  82. package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +7 -6
  83. package/src/main/typescript/impl/xhrCore/Response.ts +3 -3
  84. package/src/main/typescript/impl/xhrCore/ResponseDataResolver.ts +0 -38
  85. package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +17 -15
  86. package/src/main/typescript/impl/xhrCore/XhrFormData.ts +72 -63
  87. package/src/main/typescript/impl/xhrCore/XhrRequest.ts +80 -134
  88. package/src/main/typescript/mona_dish_shim.ts +6 -2
  89. package/src/main/typescript/myfaces/OamSubmit.ts +10 -6
  90. package/src/main/typescript/test/api/JsfPushShimTest.spec.ts +126 -0
  91. package/src/main/typescript/test/api/MyFacesABTest.spec.ts +16 -0
  92. package/src/main/typescript/test/api/PushTypeCompatibility.ts +65 -0
  93. package/src/main/typescript/test/frameworkBase/LangTest.spec.ts +16 -0
  94. package/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.ts +1 -0
  95. package/src/main/typescript/test/frameworkBase/_ext/monadish/XmlQueryTest.spec.ts +16 -0
  96. package/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-with-header.ts +16 -0
  97. package/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-without-header.ts +16 -0
  98. package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +55 -9
  99. package/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.ts +16 -0
  100. package/src/main/typescript/test/impl/AssertionsTest.spec.ts +168 -0
  101. package/src/main/typescript/test/impl/FileUtilsTest.spec.ts +126 -0
  102. package/src/main/typescript/test/impl/ImplTest.spec.ts +75 -1
  103. package/src/main/typescript/test/impl/ResponseDataResolverTest.spec.ts +62 -0
  104. package/src/main/typescript/test/impl/util/ExtDomQueryTest.spec.ts +91 -1
  105. package/src/main/typescript/test/impl/util/ExtLangTest.spec.ts +110 -0
  106. package/src/main/typescript/test/impl/util/HiddenInputBuilderTest.spec.ts +74 -0
  107. package/src/main/typescript/test/myfaces/OamSubmit.spec.ts +61 -1
  108. package/src/main/typescript/test/queue/AsynchronousQueueTest.spec.ts +191 -2
  109. package/src/main/typescript/test/xhrCore/ClientWindow.spec.ts +16 -0
  110. package/src/main/typescript/test/xhrCore/ErrorChainTest.spec.ts +14 -0
  111. package/src/main/typescript/test/xhrCore/FakeWebsocket.ts +21 -5
  112. package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +363 -4
  113. package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +218 -4
  114. package/src/main/typescript/test/xhrCore/TobagoFileUploadTest.spec.ts +1 -1
  115. package/src/main/typescript/test/xhrCore/WebsocketTest.spec.ts +764 -0
  116. package/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.ts +265 -62
  117. package/src/main/typescript/test/xhrCore/XhrRequestProgress.spec.ts +16 -0
  118. package/{target/src/main/typescript/test/xhrCore/FakeWebsocket.js → src/main/typescript/tsconfig.ae.json} +16 -23
  119. package/src/main/typescript/{tsconfig.json → tsconfig.dts.json} +11 -27
  120. package/src/main/typescript/tsconfig.test.json +17 -0
  121. package/tsconfig.api-extractor.json +17 -0
  122. package/.claude/settings.local.json +0 -16
  123. package/.github/workflows/codeql-analysis.yml +0 -83
  124. package/.github/workflows/nodejs.yml +0 -26
  125. package/.mocharc.json +0 -10
  126. package/.nyc_output/384344d4-4f46-455f-84c3-010f829098cb.json +0 -1
  127. package/.nyc_output/a0f90016-f4f9-4039-bb51-57f4f7050541.json +0 -1
  128. package/.nyc_output/db388b5d-0b79-4bce-afd2-001aaf6f0245.json +0 -1
  129. package/.nyc_output/processinfo/384344d4-4f46-455f-84c3-010f829098cb.json +0 -1
  130. package/.nyc_output/processinfo/a0f90016-f4f9-4039-bb51-57f4f7050541.json +0 -1
  131. package/.nyc_output/processinfo/db388b5d-0b79-4bce-afd2-001aaf6f0245.json +0 -1
  132. package/.nyc_output/processinfo/index.json +0 -1
  133. package/.nycrc +0 -6
  134. package/build.cmd +0 -1
  135. package/build.sh +0 -3
  136. package/mvnw +0 -286
  137. package/mvnw.cmd +0 -161
  138. package/plans for 4.0.1.txt +0 -8
  139. package/remap.ts +0 -51
  140. package/src/main/typescript/test/xhrCore/WebsocketTest.ts +0 -221
  141. package/target/api/_api.js.map +0 -1
  142. package/target/api/faces.js +0 -45
  143. package/target/api/faces.js.map +0 -1
  144. package/target/api/jsf.js +0 -56
  145. package/target/api/jsf.js.map +0 -1
  146. package/target/impl/AjaxImpl.js +0 -748
  147. package/target/impl/AjaxImpl.js.map +0 -1
  148. package/target/impl/PushImpl.js +0 -265
  149. package/target/impl/PushImpl.js.map +0 -1
  150. package/target/impl/core/Const.js +0 -177
  151. package/target/impl/core/Const.js.map +0 -1
  152. package/target/impl/core/ImplTypes.js +0 -38
  153. package/target/impl/core/ImplTypes.js.map +0 -1
  154. package/target/impl/i18n/Messages.js +0 -113
  155. package/target/impl/i18n/Messages.js.map +0 -1
  156. package/target/impl/util/Assertions.js +0 -101
  157. package/target/impl/util/Assertions.js.map +0 -1
  158. package/target/impl/util/AsyncRunnable.js +0 -78
  159. package/target/impl/util/AsyncRunnable.js.map +0 -1
  160. package/target/impl/util/ExtDomQuery.js +0 -306
  161. package/target/impl/util/ExtDomQuery.js.map +0 -1
  162. package/target/impl/util/FileUtils.js +0 -98
  163. package/target/impl/util/FileUtils.js.map +0 -1
  164. package/target/impl/util/HiddenInputBuilder.js +0 -83
  165. package/target/impl/util/HiddenInputBuilder.js.map +0 -1
  166. package/target/impl/util/IListener.js +0 -3
  167. package/target/impl/util/IListener.js.map +0 -1
  168. package/target/impl/util/Lang.js +0 -263
  169. package/target/impl/util/Lang.js.map +0 -1
  170. package/target/impl/util/XhrQueueController.js +0 -92
  171. package/target/impl/util/XhrQueueController.js.map +0 -1
  172. package/target/impl/xhrCore/ErrorData.js +0 -87
  173. package/target/impl/xhrCore/ErrorData.js.map +0 -1
  174. package/target/impl/xhrCore/EventData.js +0 -52
  175. package/target/impl/xhrCore/EventData.js.map +0 -1
  176. package/target/impl/xhrCore/IResponseProcessor.js +0 -3
  177. package/target/impl/xhrCore/IResponseProcessor.js.map +0 -1
  178. package/target/impl/xhrCore/RequestDataResolver.js +0 -186
  179. package/target/impl/xhrCore/RequestDataResolver.js.map +0 -1
  180. package/target/impl/xhrCore/ResonseDataResolver.js +0 -104
  181. package/target/impl/xhrCore/ResonseDataResolver.js.map +0 -1
  182. package/target/impl/xhrCore/Response.js +0 -186
  183. package/target/impl/xhrCore/Response.js.map +0 -1
  184. package/target/impl/xhrCore/ResponseDataResolver.js +0 -104
  185. package/target/impl/xhrCore/ResponseDataResolver.js.map +0 -1
  186. package/target/impl/xhrCore/ResponseProcessor.js +0 -468
  187. package/target/impl/xhrCore/ResponseProcessor.js.map +0 -1
  188. package/target/impl/xhrCore/XhrFormData.js +0 -163
  189. package/target/impl/xhrCore/XhrFormData.js.map +0 -1
  190. package/target/impl/xhrCore/XhrRequest.js +0 -433
  191. package/target/impl/xhrCore/XhrRequest.js.map +0 -1
  192. package/target/mona_dish_shim.js +0 -70
  193. package/target/mona_dish_shim.js.map +0 -1
  194. package/target/myfaces/OamSubmit.js +0 -128
  195. package/target/myfaces/OamSubmit.js.map +0 -1
  196. package/target/src/main/typescript/api/_api.js.map +0 -1
  197. package/target/src/main/typescript/api/faces.js +0 -45
  198. package/target/src/main/typescript/api/faces.js.map +0 -1
  199. package/target/src/main/typescript/api/jsf.js +0 -56
  200. package/target/src/main/typescript/api/jsf.js.map +0 -1
  201. package/target/src/main/typescript/impl/AjaxImpl.js +0 -748
  202. package/target/src/main/typescript/impl/AjaxImpl.js.map +0 -1
  203. package/target/src/main/typescript/impl/PushImpl.js +0 -265
  204. package/target/src/main/typescript/impl/PushImpl.js.map +0 -1
  205. package/target/src/main/typescript/impl/core/Const.js +0 -177
  206. package/target/src/main/typescript/impl/core/Const.js.map +0 -1
  207. package/target/src/main/typescript/impl/core/ImplTypes.js +0 -38
  208. package/target/src/main/typescript/impl/core/ImplTypes.js.map +0 -1
  209. package/target/src/main/typescript/impl/i18n/Messages.js +0 -113
  210. package/target/src/main/typescript/impl/i18n/Messages.js.map +0 -1
  211. package/target/src/main/typescript/impl/util/Assertions.js +0 -101
  212. package/target/src/main/typescript/impl/util/Assertions.js.map +0 -1
  213. package/target/src/main/typescript/impl/util/AsyncRunnable.js +0 -78
  214. package/target/src/main/typescript/impl/util/AsyncRunnable.js.map +0 -1
  215. package/target/src/main/typescript/impl/util/ExtDomQuery.js +0 -306
  216. package/target/src/main/typescript/impl/util/ExtDomQuery.js.map +0 -1
  217. package/target/src/main/typescript/impl/util/FileUtils.js +0 -98
  218. package/target/src/main/typescript/impl/util/FileUtils.js.map +0 -1
  219. package/target/src/main/typescript/impl/util/HiddenInputBuilder.js +0 -83
  220. package/target/src/main/typescript/impl/util/HiddenInputBuilder.js.map +0 -1
  221. package/target/src/main/typescript/impl/util/IListener.js +0 -3
  222. package/target/src/main/typescript/impl/util/IListener.js.map +0 -1
  223. package/target/src/main/typescript/impl/util/Lang.js +0 -263
  224. package/target/src/main/typescript/impl/util/Lang.js.map +0 -1
  225. package/target/src/main/typescript/impl/util/XhrQueueController.js +0 -92
  226. package/target/src/main/typescript/impl/util/XhrQueueController.js.map +0 -1
  227. package/target/src/main/typescript/impl/xhrCore/ErrorData.js +0 -87
  228. package/target/src/main/typescript/impl/xhrCore/ErrorData.js.map +0 -1
  229. package/target/src/main/typescript/impl/xhrCore/EventData.js +0 -52
  230. package/target/src/main/typescript/impl/xhrCore/EventData.js.map +0 -1
  231. package/target/src/main/typescript/impl/xhrCore/IResponseProcessor.js +0 -3
  232. package/target/src/main/typescript/impl/xhrCore/IResponseProcessor.js.map +0 -1
  233. package/target/src/main/typescript/impl/xhrCore/RequestDataResolver.js +0 -186
  234. package/target/src/main/typescript/impl/xhrCore/RequestDataResolver.js.map +0 -1
  235. package/target/src/main/typescript/impl/xhrCore/Response.js +0 -186
  236. package/target/src/main/typescript/impl/xhrCore/Response.js.map +0 -1
  237. package/target/src/main/typescript/impl/xhrCore/ResponseDataResolver.js +0 -104
  238. package/target/src/main/typescript/impl/xhrCore/ResponseDataResolver.js.map +0 -1
  239. package/target/src/main/typescript/impl/xhrCore/ResponseProcessor.js +0 -468
  240. package/target/src/main/typescript/impl/xhrCore/ResponseProcessor.js.map +0 -1
  241. package/target/src/main/typescript/impl/xhrCore/XhrFormData.js +0 -163
  242. package/target/src/main/typescript/impl/xhrCore/XhrFormData.js.map +0 -1
  243. package/target/src/main/typescript/impl/xhrCore/XhrRequest.js +0 -433
  244. package/target/src/main/typescript/impl/xhrCore/XhrRequest.js.map +0 -1
  245. package/target/src/main/typescript/mona_dish_shim.js +0 -70
  246. package/target/src/main/typescript/mona_dish_shim.js.map +0 -1
  247. package/target/src/main/typescript/myfaces/OamSubmit.js +0 -128
  248. package/target/src/main/typescript/myfaces/OamSubmit.js.map +0 -1
  249. package/target/src/main/typescript/test/api/MyFacesABTest.spec.js +0 -117
  250. package/target/src/main/typescript/test/api/MyFacesABTest.spec.js.map +0 -1
  251. package/target/src/main/typescript/test/frameworkBase/LangTest.spec.js +0 -123
  252. package/target/src/main/typescript/test/frameworkBase/LangTest.spec.js.map +0 -1
  253. package/target/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +0 -657
  254. package/target/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +0 -1
  255. package/target/src/main/typescript/test/frameworkBase/_ext/monadish/LangTest.spec.js +0 -107
  256. package/target/src/main/typescript/test/frameworkBase/_ext/monadish/LangTest.spec.js.map +0 -1
  257. package/target/src/main/typescript/test/frameworkBase/_ext/monadish/MappingProbes.js +0 -106
  258. package/target/src/main/typescript/test/frameworkBase/_ext/monadish/MappingProbes.js.map +0 -1
  259. package/target/src/main/typescript/test/frameworkBase/_ext/monadish/MappingTest.spec.js +0 -39
  260. package/target/src/main/typescript/test/frameworkBase/_ext/monadish/MappingTest.spec.js.map +0 -1
  261. package/target/src/main/typescript/test/frameworkBase/_ext/monadish/MonadTest.spec.js +0 -153
  262. package/target/src/main/typescript/test/frameworkBase/_ext/monadish/MonadTest.spec.js.map +0 -1
  263. package/target/src/main/typescript/test/frameworkBase/_ext/monadish/XmlQueryTest.spec.js +0 -2
  264. package/target/src/main/typescript/test/frameworkBase/_ext/monadish/XmlQueryTest.spec.js.map +0 -1
  265. package/target/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-with-header.js +0 -925
  266. package/target/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-with-header.js.map +0 -1
  267. package/target/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-without-header.js +0 -112
  268. package/target/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-without-header.js.map +0 -1
  269. package/target/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.js +0 -728
  270. package/target/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.js.map +0 -1
  271. package/target/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.js +0 -296
  272. package/target/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.js.map +0 -1
  273. package/target/src/main/typescript/test/impl/ImplTest.spec.js +0 -225
  274. package/target/src/main/typescript/test/impl/ImplTest.spec.js.map +0 -1
  275. package/target/src/main/typescript/test/impl/ImplTest_23.spec.js +0 -143
  276. package/target/src/main/typescript/test/impl/ImplTest_23.spec.js.map +0 -1
  277. package/target/src/main/typescript/test/impl/SeparatorCharsTest.spec.js +0 -106
  278. package/target/src/main/typescript/test/impl/SeparatorCharsTest.spec.js.map +0 -1
  279. package/target/src/main/typescript/test/impl/util/ExtDomQueryTest.spec.js +0 -77
  280. package/target/src/main/typescript/test/impl/util/ExtDomQueryTest.spec.js.map +0 -1
  281. package/target/src/main/typescript/test/myfaces/OamSubmit.spec.js +0 -118
  282. package/target/src/main/typescript/test/myfaces/OamSubmit.spec.js.map +0 -1
  283. package/target/src/main/typescript/test/myfaces/OnLoad.spec.js +0 -57
  284. package/target/src/main/typescript/test/myfaces/OnLoad.spec.js.map +0 -1
  285. package/target/src/main/typescript/test/myfaces/ReserveNamespace.spec.js +0 -60
  286. package/target/src/main/typescript/test/myfaces/ReserveNamespace.spec.js.map +0 -1
  287. package/target/src/main/typescript/test/queue/AsynchronousProbe.js +0 -93
  288. package/target/src/main/typescript/test/queue/AsynchronousProbe.js.map +0 -1
  289. package/target/src/main/typescript/test/queue/AsynchronousQueueTest.spec.js +0 -133
  290. package/target/src/main/typescript/test/queue/AsynchronousQueueTest.spec.js.map +0 -1
  291. package/target/src/main/typescript/test/xhrCore/ClientWindow.spec.js +0 -101
  292. package/target/src/main/typescript/test/xhrCore/ClientWindow.spec.js.map +0 -1
  293. package/target/src/main/typescript/test/xhrCore/ErrorChainTest.spec.js +0 -175
  294. package/target/src/main/typescript/test/xhrCore/ErrorChainTest.spec.js.map +0 -1
  295. package/target/src/main/typescript/test/xhrCore/EventTests.spec.js +0 -184
  296. package/target/src/main/typescript/test/xhrCore/EventTests.spec.js.map +0 -1
  297. package/target/src/main/typescript/test/xhrCore/FakeWebsocket.js.map +0 -1
  298. package/target/src/main/typescript/test/xhrCore/FileUploadTest.spec.js +0 -181
  299. package/target/src/main/typescript/test/xhrCore/FileUploadTest.spec.js.map +0 -1
  300. package/target/src/main/typescript/test/xhrCore/NamespacesRequestTest.spec.js +0 -226
  301. package/target/src/main/typescript/test/xhrCore/NamespacesRequestTest.spec.js.map +0 -1
  302. package/target/src/main/typescript/test/xhrCore/OamSubmitTest.spec.js +0 -199
  303. package/target/src/main/typescript/test/xhrCore/OamSubmitTest.spec.js.map +0 -1
  304. package/target/src/main/typescript/test/xhrCore/RequestParamsTest.spec.js +0 -567
  305. package/target/src/main/typescript/test/xhrCore/RequestParamsTest.spec.js.map +0 -1
  306. package/target/src/main/typescript/test/xhrCore/RequestTest.spec.js +0 -845
  307. package/target/src/main/typescript/test/xhrCore/RequestTest.spec.js.map +0 -1
  308. package/target/src/main/typescript/test/xhrCore/RequestTest_23.spec.js +0 -382
  309. package/target/src/main/typescript/test/xhrCore/RequestTest_23.spec.js.map +0 -1
  310. package/target/src/main/typescript/test/xhrCore/ResponseTest.spec.js +0 -667
  311. package/target/src/main/typescript/test/xhrCore/ResponseTest.spec.js.map +0 -1
  312. package/target/src/main/typescript/test/xhrCore/ResponseTest23.spec.js +0 -367
  313. package/target/src/main/typescript/test/xhrCore/ResponseTest23.spec.js.map +0 -1
  314. package/target/src/main/typescript/test/xhrCore/ShadowDomTest.spec.js +0 -123
  315. package/target/src/main/typescript/test/xhrCore/ShadowDomTest.spec.js.map +0 -1
  316. package/target/src/main/typescript/test/xhrCore/TobagoFileUploadTest.spec.js +0 -147
  317. package/target/src/main/typescript/test/xhrCore/TobagoFileUploadTest.spec.js.map +0 -1
  318. package/target/src/main/typescript/test/xhrCore/WebsocketTest.js +0 -207
  319. package/target/src/main/typescript/test/xhrCore/WebsocketTest.js.map +0 -1
  320. package/target/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.js +0 -149
  321. package/target/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.js.map +0 -1
  322. package/target/src/main/typescript/test/xhrCore/XhrRequestProgress.spec.js +0 -130
  323. package/target/src/main/typescript/test/xhrCore/XhrRequestProgress.spec.js.map +0 -1
  324. package/target/test/api/MyFacesABTest.spec.js +0 -117
  325. package/target/test/api/MyFacesABTest.spec.js.map +0 -1
  326. package/target/test/frameworkBase/LangTest.spec.js +0 -123
  327. package/target/test/frameworkBase/LangTest.spec.js.map +0 -1
  328. package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +0 -657
  329. package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +0 -1
  330. package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js +0 -107
  331. package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js.map +0 -1
  332. package/target/test/frameworkBase/_ext/monadish/MappingProbes.js +0 -106
  333. package/target/test/frameworkBase/_ext/monadish/MappingProbes.js.map +0 -1
  334. package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js +0 -39
  335. package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js.map +0 -1
  336. package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js +0 -153
  337. package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js.map +0 -1
  338. package/target/test/frameworkBase/_ext/monadish/XmlQueryTest.spec.js +0 -1
  339. package/target/test/frameworkBase/_ext/monadish/XmlQueryTest.spec.js.map +0 -1
  340. package/target/test/frameworkBase/_ext/monadish/fixtures/test.js.map +0 -1
  341. package/target/test/frameworkBase/_ext/monadish/fixtures/test2.js.map +0 -1
  342. package/target/test/frameworkBase/_ext/monadish/markups/tobago-with-header.js +0 -925
  343. package/target/test/frameworkBase/_ext/monadish/markups/tobago-with-header.js.map +0 -1
  344. package/target/test/frameworkBase/_ext/monadish/markups/tobago-without-header.js +0 -112
  345. package/target/test/frameworkBase/_ext/monadish/markups/tobago-without-header.js.map +0 -1
  346. package/target/test/frameworkBase/_ext/shared/StandardInits.js +0 -728
  347. package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +0 -1
  348. package/target/test/frameworkBase/_ext/shared/XmlResponses.js +0 -296
  349. package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +0 -1
  350. package/target/test/frameworkBase/_ext/shared/fixtures/js/tobago.js +0 -16
  351. package/target/test/frameworkBase/_ext/shared/fixtures/js/tobago.js.map +0 -1
  352. package/target/test/impl/ImplTest.spec.js +0 -225
  353. package/target/test/impl/ImplTest.spec.js.map +0 -1
  354. package/target/test/impl/ImplTest_23.spec.js +0 -143
  355. package/target/test/impl/ImplTest_23.spec.js.map +0 -1
  356. package/target/test/impl/SeparatorCharsTest.spec.js +0 -106
  357. package/target/test/impl/SeparatorCharsTest.spec.js.map +0 -1
  358. package/target/test/impl/util/ExtDomQueryTest.spec.js +0 -77
  359. package/target/test/impl/util/ExtDomQueryTest.spec.js.map +0 -1
  360. package/target/test/myfaces/OamSubmit.spec.js +0 -118
  361. package/target/test/myfaces/OamSubmit.spec.js.map +0 -1
  362. package/target/test/myfaces/OnLoad.spec.js +0 -57
  363. package/target/test/myfaces/OnLoad.spec.js.map +0 -1
  364. package/target/test/myfaces/ReserveNamespace.spec.js +0 -60
  365. package/target/test/myfaces/ReserveNamespace.spec.js.map +0 -1
  366. package/target/test/queue/AsynchronousProbe.js +0 -93
  367. package/target/test/queue/AsynchronousProbe.js.map +0 -1
  368. package/target/test/queue/AsynchronousQueueTest.spec.js +0 -133
  369. package/target/test/queue/AsynchronousQueueTest.spec.js.map +0 -1
  370. package/target/test/xhrCore/ClientWindow.spec.js +0 -101
  371. package/target/test/xhrCore/ClientWindow.spec.js.map +0 -1
  372. package/target/test/xhrCore/ErrorChainTest.spec.js +0 -175
  373. package/target/test/xhrCore/ErrorChainTest.spec.js.map +0 -1
  374. package/target/test/xhrCore/EventTests.spec.js +0 -184
  375. package/target/test/xhrCore/EventTests.spec.js.map +0 -1
  376. package/target/test/xhrCore/FakeWebsocket.js +0 -38
  377. package/target/test/xhrCore/FakeWebsocket.js.map +0 -1
  378. package/target/test/xhrCore/FileUploadTest.spec.js +0 -181
  379. package/target/test/xhrCore/FileUploadTest.spec.js.map +0 -1
  380. package/target/test/xhrCore/NamespacesRequestTest.spec.js +0 -226
  381. package/target/test/xhrCore/NamespacesRequestTest.spec.js.map +0 -1
  382. package/target/test/xhrCore/OamSubmitTest.spec.js +0 -199
  383. package/target/test/xhrCore/OamSubmitTest.spec.js.map +0 -1
  384. package/target/test/xhrCore/RequestParamsTest.spec.js +0 -567
  385. package/target/test/xhrCore/RequestParamsTest.spec.js.map +0 -1
  386. package/target/test/xhrCore/RequestTest.spec.js +0 -845
  387. package/target/test/xhrCore/RequestTest.spec.js.map +0 -1
  388. package/target/test/xhrCore/RequestTest_23.spec.js +0 -382
  389. package/target/test/xhrCore/RequestTest_23.spec.js.map +0 -1
  390. package/target/test/xhrCore/ResponseTest.spec.js +0 -667
  391. package/target/test/xhrCore/ResponseTest.spec.js.map +0 -1
  392. package/target/test/xhrCore/ResponseTest23.spec.js +0 -367
  393. package/target/test/xhrCore/ResponseTest23.spec.js.map +0 -1
  394. package/target/test/xhrCore/ShadowDomTest.spec.js +0 -123
  395. package/target/test/xhrCore/ShadowDomTest.spec.js.map +0 -1
  396. package/target/test/xhrCore/TobagoFileUploadTest.spec.js +0 -147
  397. package/target/test/xhrCore/TobagoFileUploadTest.spec.js.map +0 -1
  398. package/target/test/xhrCore/WebsocketTest.js +0 -207
  399. package/target/test/xhrCore/WebsocketTest.js.map +0 -1
  400. package/target/test/xhrCore/XhrFormDataTest.spec.js +0 -149
  401. package/target/test/xhrCore/XhrFormDataTest.spec.js.map +0 -1
  402. package/target/test/xhrCore/XhrRequestProgress.spec.js +0 -130
  403. package/target/test/xhrCore/XhrRequestProgress.spec.js.map +0 -1
  404. package/target/test/xhrCore/fixtures/addedViewHead1.js +0 -17
  405. package/target/test/xhrCore/fixtures/addedViewHead1.js.map +0 -1
  406. package/target/test/xhrCore/fixtures/addedViewHead2.js +0 -17
  407. package/target/test/xhrCore/fixtures/addedViewHead2.js.map +0 -1
  408. package/target/test/xhrCore/fixtures/addedViewHead3.js +0 -17
  409. package/target/test/xhrCore/fixtures/addedViewHead3.js.map +0 -1
  410. package/target/test/xhrCore/fixtures/nonce_script.js +0 -17
  411. package/target/test/xhrCore/fixtures/nonce_script.js.map +0 -1
  412. package/tsconfig.json +0 -9
  413. package/webpack.config.ts +0 -54
@@ -91,7 +91,7 @@ function append(target, ...accessPath) {
91
91
  if (!Array.isArray(lastPathItem.target[lastPathItem.key])) {
92
92
  lastPathItem.target[lastPathItem.key] = [lastPathItem.target[lastPathItem.key]];
93
93
  }
94
- lastPathItem.target[lastPathItem.key].push(...value);
94
+ (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_0__.pushChunked)(lastPathItem.target[lastPathItem.key], value);
95
95
  }
96
96
  }
97
97
  })();
@@ -165,7 +165,7 @@ function alloc(arr, length, defaultVal = {}) {
165
165
  let toAdd = [];
166
166
  toAdd.length = length;
167
167
  toAdd[length - 1] = defaultVal;
168
- arr.push(...toAdd);
168
+ (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_0__.pushChunked)(arr, toAdd);
169
169
  }
170
170
  function flattenAccessPath(accessPath) {
171
171
  return new _Es2019Array__WEBPACK_IMPORTED_MODULE_0__.Es2019Array(...accessPath).flatMap((path) => path.split("["))
@@ -272,7 +272,7 @@ function _appendWithOverwrite(withAppend, target, key, arr, toAssign) {
272
272
  });
273
273
  target[key] = new _Es2019Array__WEBPACK_IMPORTED_MODULE_0__.Es2019Array(...[]);
274
274
  target[key].push(oldVal);
275
- target[key].push(...newVals);
275
+ (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_0__.pushChunked)(target[key], newVals);
276
276
  }
277
277
  else {
278
278
  let oldVal = target[key];
@@ -283,7 +283,7 @@ function _appendWithOverwrite(withAppend, target, key, arr, toAssign) {
283
283
  newVals.push(item);
284
284
  }
285
285
  });
286
- target[key].push(...newVals);
286
+ (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_0__.pushChunked)(target[key], newVals);
287
287
  }
288
288
  }
289
289
  }
@@ -301,10 +301,10 @@ function _appendWithoutOverwrite(withAppend, target, key, arr, toAssign) {
301
301
  let oldVal = target[key];
302
302
  target[key] = new _Es2019Array__WEBPACK_IMPORTED_MODULE_0__.Es2019Array(...[]);
303
303
  target[key].push(oldVal);
304
- target[key].push(...toAssign);
304
+ (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_0__.pushChunked)(target[key], toAssign);
305
305
  }
306
306
  else {
307
- target[key].push(...toAssign);
307
+ (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_0__.pushChunked)(target[key], toAssign);
308
308
  }
309
309
  }
310
310
  }
@@ -472,7 +472,7 @@ class Config extends _Monad__WEBPACK_IMPORTED_MODULE_1__.Optional {
472
472
  let newThis = (0,_AssocArray__WEBPACK_IMPORTED_MODULE_3__.shallowMerge)(overwrite, withAppend, this.value, other.value);
473
473
  if (Array.isArray(this._value)) {
474
474
  this._value.length = 0;
475
- this._value.push(...newThis);
475
+ (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_0__.pushChunked)(this._value, newThis);
476
476
  }
477
477
  else {
478
478
  Object.getOwnPropertyNames(this._value).forEach(key => delete this._value[key]);
@@ -579,7 +579,7 @@ class Config extends _Monad__WEBPACK_IMPORTED_MODULE_1__.Optional {
579
579
  if (this.isArray(arrPos)) {
580
580
  if (currKey != "") {
581
581
  currAccessPos = Array.isArray(currAccessPos.value) ?
582
- _Monad__WEBPACK_IMPORTED_MODULE_1__.Optional.fromNullable((_b = (_a = new _Es2019Array__WEBPACK_IMPORTED_MODULE_0__.Es2019Array(...currAccessPos.value)
582
+ _Monad__WEBPACK_IMPORTED_MODULE_1__.Optional.fromNullable((_b = (_a = (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_0__.Es2019ArrayFrom)(currAccessPos.value)
583
583
  .find(item => {
584
584
  var _a;
585
585
  return !!((_a = item === null || item === void 0 ? void 0 : item[currKey]) !== null && _a !== void 0 ? _a : false);
@@ -594,7 +594,7 @@ class Config extends _Monad__WEBPACK_IMPORTED_MODULE_1__.Optional {
594
594
  }
595
595
  else {
596
596
  //we now have an array and go further with a singular key
597
- currAccessPos = (Array.isArray(currAccessPos.value)) ? _Monad__WEBPACK_IMPORTED_MODULE_1__.Optional.fromNullable((_g = new _Es2019Array__WEBPACK_IMPORTED_MODULE_0__.Es2019Array(...currAccessPos.value)
597
+ currAccessPos = (Array.isArray(currAccessPos.value)) ? _Monad__WEBPACK_IMPORTED_MODULE_1__.Optional.fromNullable((_g = (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_0__.Es2019ArrayFrom)(currAccessPos.value)
598
598
  .find(item => {
599
599
  var _a;
600
600
  return !!((_a = item === null || item === void 0 ? void 0 : item[currKey]) !== null && _a !== void 0 ? _a : false);
@@ -676,6 +676,21 @@ const isString = _Lang__WEBPACK_IMPORTED_MODULE_2__.Lang.isString;
676
676
  const eqi = _Lang__WEBPACK_IMPORTED_MODULE_2__.Lang.equalsIgnoreCase;
677
677
  const objToArray = _Lang__WEBPACK_IMPORTED_MODULE_2__.Lang.objToArray;
678
678
 
679
+ /**
680
+ * chunk-safe version of target.prepend(...elements)
681
+ * (spreading a large element list overflows the argument stack)
682
+ *
683
+ * the chunks are prepended in reverse order, so the resulting
684
+ * element order is the same as a single prepend call would produce,
685
+ * for less than MAX_ARG_LENGTH elements this boils down to exactly
686
+ * one native prepend call
687
+ */
688
+ function prependChunked(target, elements) {
689
+ for (let end = elements.length; end > 0; end -= _Es2019Array__WEBPACK_IMPORTED_MODULE_4__.MAX_ARG_LENGTH) {
690
+ const start = Math.max(0, end - _Es2019Array__WEBPACK_IMPORTED_MODULE_4__.MAX_ARG_LENGTH);
691
+ target.prepend(...elements.slice(start, end));
692
+ }
693
+ }
679
694
  class NonceValueEmbedder extends _Monad__WEBPACK_IMPORTED_MODULE_0__.ValueEmbedder {
680
695
  constructor(rootElems) {
681
696
  super(rootElems === null || rootElems === void 0 ? void 0 : rootElems[0], "nonce");
@@ -784,7 +799,9 @@ function waitUntilDom(root, condition, options = {
784
799
  });
785
800
  }
786
801
  else { // fallback for legacy browsers without mutation observer
787
- let interval = setInterval(() => {
802
+ let interval;
803
+ let timeout;
804
+ interval = setInterval(() => {
788
805
  let found = findElement(root, condition);
789
806
  if (!!found) {
790
807
  if (timeout) {
@@ -795,7 +812,7 @@ function waitUntilDom(root, condition, options = {
795
812
  success(new DomQuery(found || root));
796
813
  }
797
814
  }, options.interval);
798
- let timeout = setTimeout(() => {
815
+ timeout = setTimeout(() => {
799
816
  if (interval) {
800
817
  clearInterval(interval);
801
818
  error(MUT_ERROR);
@@ -823,7 +840,6 @@ class ElementAttribute extends _Monad__WEBPACK_IMPORTED_MODULE_0__.ValueEmbedder
823
840
  for (let cnt = 0; cnt < val.length; cnt++) {
824
841
  val[cnt].setAttribute(this.name, value);
825
842
  }
826
- val[0].setAttribute(this.name, value);
827
843
  }
828
844
  getClass() {
829
845
  return ElementAttribute;
@@ -853,10 +869,10 @@ class Style extends _Monad__WEBPACK_IMPORTED_MODULE_0__.ValueEmbedder {
853
869
  }
854
870
  }
855
871
  getClass() {
856
- return ElementAttribute;
872
+ return Style;
857
873
  }
858
874
  static fromNullable(value, valueKey = "value") {
859
- return new ElementAttribute(value, valueKey);
875
+ return new Style(value, valueKey);
860
876
  }
861
877
  }
862
878
  /**
@@ -904,11 +920,16 @@ class DomQuery {
904
920
  else if (isString(rootNode[cnt])) {
905
921
  let foundElement = DomQuery.querySelectorAll(rootNode[cnt]);
906
922
  if (!foundElement.isAbsent()) {
907
- rootNode.push(...foundElement.values);
923
+ (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.pushChunked)(rootNode, foundElement.values);
908
924
  }
909
925
  }
910
926
  else if (rootNode[cnt] instanceof DomQuery) {
911
- this.rootNode.push(...rootNode[cnt].values);
927
+ (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.pushChunked)(this.rootNode, rootNode[cnt].values);
928
+ }
929
+ else if (Array.isArray(rootNode[cnt])) {
930
+ // flatten array arguments into the work list, so large element
931
+ // arrays can be passed without spreading them into the call
932
+ (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.pushChunked)(rootNode, rootNode[cnt]);
912
933
  }
913
934
  else {
914
935
  this.rootNode.push(rootNode[cnt]);
@@ -1010,17 +1031,17 @@ class DomQuery {
1010
1031
  this.id.value = value;
1011
1032
  }
1012
1033
  get checked() {
1013
- return new _Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019Array(...this.values).every(el => !!(el).checked);
1034
+ return (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019ArrayFrom)(this.values).every(el => !!el.checked);
1014
1035
  }
1015
1036
  set checked(newChecked) {
1016
1037
  this.eachElem(el => el.checked = newChecked);
1017
1038
  }
1018
1039
  get elements() {
1019
1040
  // a simple querySelectorAll should suffice
1020
- return this.querySelectorAll("input, checkbox, select, textarea, fieldset");
1041
+ return this.querySelectorAll("input, select, textarea, fieldset");
1021
1042
  }
1022
1043
  get deepElements() {
1023
- let elemStr = "input, select, textarea, checkbox, fieldset";
1044
+ let elemStr = "input, select, textarea, fieldset";
1024
1045
  return this.querySelectorAllDeep(elemStr);
1025
1046
  }
1026
1047
  /**
@@ -1034,14 +1055,45 @@ class DomQuery {
1034
1055
  if (queryRes.length) {
1035
1056
  found.push(queryRes);
1036
1057
  }
1037
- let shadowRoots = this.querySelectorAll("*").shadowRoot;
1058
+ let shadowRoots = this._collectShadowRoots();
1038
1059
  if (shadowRoots.length) {
1039
- let shadowRes = shadowRoots.querySelectorAllDeep(queryStr);
1060
+ let shadowRes = new DomQuery(shadowRoots).querySelectorAllDeep(queryStr);
1040
1061
  if (shadowRes.length) {
1041
1062
  found.push(shadowRes);
1042
1063
  }
1043
1064
  }
1044
- return new DomQuery(...found);
1065
+ return new DomQuery(found);
1066
+ }
1067
+ /**
1068
+ * Collects the shadow roots hosted by the light-DOM descendants of each root
1069
+ * node in a single pass.
1070
+ *
1071
+ * This replaces the prior `querySelectorAll("*").shadowRoot`, which
1072
+ * materialized a DomQuery wrapping every element on the page and then walked
1073
+ * that throwaway collection a second time through the shadowRoot getter. We
1074
+ * still have to inspect every element - there is no CSS selector for "has a
1075
+ * shadow root", so the cost stays O(number of elements) - but we drop the
1076
+ * intermediate all-elements DomQuery and the redundant second traversal.
1077
+ *
1078
+ * @private
1079
+ */
1080
+ _collectShadowRoots() {
1081
+ var _a, _b;
1082
+ let shadowRoots = [];
1083
+ for (let cnt = 0; cnt < ((_b = (_a = this === null || this === void 0 ? void 0 : this.rootNode) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0); cnt++) {
1084
+ let root = this.rootNode[cnt];
1085
+ if (!(root === null || root === void 0 ? void 0 : root.querySelectorAll)) {
1086
+ continue;
1087
+ }
1088
+ let all = root.querySelectorAll("*");
1089
+ for (let i = 0, len = all.length; i < len; i++) {
1090
+ let shadowRoot = all[i].shadowRoot;
1091
+ if (shadowRoot) {
1092
+ shadowRoots.push(shadowRoot);
1093
+ }
1094
+ }
1095
+ }
1096
+ return shadowRoots;
1045
1097
  }
1046
1098
  /**
1047
1099
  * disabled flag
@@ -1064,13 +1116,17 @@ class DomQuery {
1064
1116
  get childNodes() {
1065
1117
  let childNodeArr = [];
1066
1118
  this.eachElem((item) => {
1067
- childNodeArr = childNodeArr.concat(objToArray(item.childNodes));
1119
+ // push the live childNodes list straight into the single target in
1120
+ // chunks instead of concat(objToArray(...)) per root, which both
1121
+ // copied each child list and reallocated the growing accumulator
1122
+ // (O(roots * total children))
1123
+ (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.pushChunked)(childNodeArr, item.childNodes);
1068
1124
  });
1069
- return new DomQuery(...childNodeArr);
1125
+ return new DomQuery(childNodeArr);
1070
1126
  }
1071
1127
  get asArray() {
1072
1128
  // filter not supported by IE11
1073
- let items = new _Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019Array(...this.rootNode).filter(item => {
1129
+ let items = (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019ArrayFrom)(this.rootNode).filter(item => {
1074
1130
  return item != null;
1075
1131
  }).map(item => {
1076
1132
  return DomQuery.byId(item);
@@ -1078,31 +1134,31 @@ class DomQuery {
1078
1134
  return items;
1079
1135
  }
1080
1136
  get offsetWidth() {
1081
- return new _Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019Array(...this.rootNode)
1137
+ return (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019ArrayFrom)(this.rootNode)
1082
1138
  .filter(item => item != null)
1083
1139
  .map(elem => elem.offsetWidth)
1084
1140
  .reduce((accumulate, incoming) => accumulate + incoming, 0);
1085
1141
  }
1086
1142
  get offsetHeight() {
1087
- return new _Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019Array(...this.rootNode)
1143
+ return (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019ArrayFrom)(this.rootNode)
1088
1144
  .filter(item => item != null)
1089
1145
  .map(elem => elem.offsetHeight)
1090
1146
  .reduce((accumulate, incoming) => accumulate + incoming, 0);
1091
1147
  }
1092
1148
  get offsetLeft() {
1093
- return new _Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019Array(...this.rootNode)
1149
+ return (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019ArrayFrom)(this.rootNode)
1094
1150
  .filter(item => item != null)
1095
1151
  .map(elem => elem.offsetLeft)
1096
1152
  .reduce((accumulate, incoming) => accumulate + incoming, 0);
1097
1153
  }
1098
1154
  get offsetTop() {
1099
- return new _Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019Array(this.rootNode)
1155
+ return (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019ArrayFrom)(this.rootNode)
1100
1156
  .filter(item => item != null)
1101
1157
  .map(elem => elem.offsetTop)
1102
1158
  .reduce((accumulate, incoming) => accumulate + incoming, 0);
1103
1159
  }
1104
1160
  get asNodeArray() {
1105
- return new _Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019Array(...this.rootNode.filter(item => item != null));
1161
+ return (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019ArrayFrom)(this.rootNode.filter(item => item != null));
1106
1162
  }
1107
1163
  get nonce() {
1108
1164
  return new NonceValueEmbedder(this.rootNode);
@@ -1165,7 +1221,6 @@ class DomQuery {
1165
1221
  * @param markup the markup code to be executed from
1166
1222
  */
1167
1223
  static fromMarkup(markup) {
1168
- // https:// developer.mozilla.org/de/docs/Web/API/DOMParser license creative commons
1169
1224
  const doc = document.implementation.createHTMLDocument("");
1170
1225
  markup = trim(markup);
1171
1226
  let lowerMarkup = markup.toLowerCase();
@@ -1184,19 +1239,17 @@ class DomQuery {
1184
1239
  };
1185
1240
  let dummyPlaceHolder = new DomQuery(document.createElement("div"));
1186
1241
  // table needs special treatment due to the browsers auto creation
1187
- if (startsWithTag(lowerMarkup, "thead") || startsWithTag(lowerMarkup, "tbody")) {
1242
+ if (startsWithTag(lowerMarkup, "thead")
1243
+ || startsWithTag(lowerMarkup, "tbody")
1244
+ || startsWithTag(lowerMarkup, "tfoot")) {
1188
1245
  dummyPlaceHolder.html(`<table>${markup}</table>`);
1189
1246
  return dummyPlaceHolder.querySelectorAll("table").get(0).childNodes.detach();
1190
1247
  }
1191
- else if (startsWithTag(lowerMarkup, "tfoot")) {
1192
- dummyPlaceHolder.html(`<table><thead></thead><tbody><tbody${markup}</table>`);
1193
- return dummyPlaceHolder.querySelectorAll("table").get(2).childNodes.detach();
1194
- }
1195
1248
  else if (startsWithTag(lowerMarkup, "tr")) {
1196
1249
  dummyPlaceHolder.html(`<table><tbody>${markup}</tbody></table>`);
1197
1250
  return dummyPlaceHolder.querySelectorAll("tbody").get(0).childNodes.detach();
1198
1251
  }
1199
- else if (startsWithTag(lowerMarkup, "td")) {
1252
+ else if (startsWithTag(lowerMarkup, "td") || startsWithTag(lowerMarkup, "th")) {
1200
1253
  dummyPlaceHolder.html(`<table><tbody><tr>${markup}</tr></tbody></table>`);
1201
1254
  return dummyPlaceHolder.querySelectorAll("tr").get(0).childNodes.detach();
1202
1255
  }
@@ -1304,28 +1357,33 @@ class DomQuery {
1304
1357
  byId(id, includeRoot) {
1305
1358
  let res = [];
1306
1359
  if (includeRoot) {
1307
- res = res.concat(...new _Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019Array(...((this === null || this === void 0 ? void 0 : this.rootNode) || []))
1308
- .filter(((item) => id == item.id))
1360
+ res = res.concat((0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019ArrayFrom)((this === null || this === void 0 ? void 0 : this.rootNode) || [])
1361
+ .filter((item) => id == item.id)
1309
1362
  .map(item => new DomQuery(item)));
1310
1363
  }
1311
1364
  // for some strange kind of reason the # selector fails
1312
1365
  // on hidden elements we use the attributes match selector
1313
1366
  // that works
1314
1367
  res = res.concat(this.querySelectorAll(`[id="${id}"]`));
1315
- return new DomQuery(...res);
1368
+ return new DomQuery(res);
1316
1369
  }
1317
1370
  byIdDeep(id, includeRoot) {
1318
1371
  let res = [];
1319
1372
  if (includeRoot) {
1320
- res = res.concat(new _Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019Array(...((this === null || this === void 0 ? void 0 : this.rootNode) || []))
1373
+ res = res.concat((0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019ArrayFrom)((this === null || this === void 0 ? void 0 : this.rootNode) || [])
1321
1374
  .filter(item => id == item.id)
1322
1375
  .map(item => new DomQuery(item)));
1323
1376
  }
1377
+ // a "deep" id search must collect matches across every scope: ids are
1378
+ // unique only within a single node-tree, so the same id may legitimately
1379
+ // exist in the light DOM and inside one or more shadow roots at once.
1380
+ // We therefore cannot short-circuit on a light-DOM hit and must run the
1381
+ // full deep search.
1324
1382
  let subItems = this.querySelectorAllDeep(`[id="${id}"]`);
1325
1383
  if (subItems.length) {
1326
1384
  res.push(subItems);
1327
1385
  }
1328
- return new DomQuery(...res);
1386
+ return new DomQuery(res);
1329
1387
  }
1330
1388
  /**
1331
1389
  * same as byId just for the tag name
@@ -1337,12 +1395,15 @@ class DomQuery {
1337
1395
  var _a;
1338
1396
  let res = [];
1339
1397
  if (includeRoot) {
1340
- res = new _Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019Array(...((_a = this === null || this === void 0 ? void 0 : this.rootNode) !== null && _a !== void 0 ? _a : []))
1341
- .filter(element => (element === null || element === void 0 ? void 0 : element.tagName) == tagName)
1342
- .reduce((reduction, item) => reduction.concat([item]), res);
1398
+ // append the matching roots in a single pass; the prior
1399
+ // reduce(reduction.concat([item])) reallocated the accumulator on
1400
+ // every match (O(matches^2))
1401
+ let matchingRoots = (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019ArrayFrom)((_a = this === null || this === void 0 ? void 0 : this.rootNode) !== null && _a !== void 0 ? _a : [])
1402
+ .filter(element => (element === null || element === void 0 ? void 0 : element.tagName) == tagName);
1403
+ (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.pushChunked)(res, matchingRoots);
1343
1404
  }
1344
1405
  (deep) ? res.push(this.querySelectorAllDeep(tagName)) : res.push(this.querySelectorAll(tagName));
1345
- return new DomQuery(...res);
1406
+ return new DomQuery(res);
1346
1407
  }
1347
1408
  /**
1348
1409
  * attr accessor, usage myQuery.attr("class").value = "bla"
@@ -1463,7 +1524,7 @@ class DomQuery {
1463
1524
  matched.push(item);
1464
1525
  }
1465
1526
  });
1466
- return new DomQuery(...matched);
1527
+ return new DomQuery(matched);
1467
1528
  }
1468
1529
  /**
1469
1530
  * checks whether any item in this domQuery level matches the selector
@@ -1502,19 +1563,19 @@ class DomQuery {
1502
1563
  return this;
1503
1564
  }
1504
1565
  firstElem(func = item => item) {
1505
- if (this.rootNode.length > 1) {
1566
+ if (this.rootNode.length > 0) {
1506
1567
  func(this.rootNode[0], 0);
1507
1568
  }
1508
1569
  return this;
1509
1570
  }
1510
1571
  lastElem(func = item => item) {
1511
- if (this.rootNode.length > 1) {
1512
- func(this.rootNode[this.rootNode.length - 1], 0);
1572
+ if (this.rootNode.length > 0) {
1573
+ func(this.rootNode[this.rootNode.length - 1], this.rootNode.length - 1);
1513
1574
  }
1514
1575
  return this;
1515
1576
  }
1516
1577
  each(func) {
1517
- new _Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019Array(...this.rootNode)
1578
+ (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019ArrayFrom)(this.rootNode)
1518
1579
  .forEach((item, cnt) => {
1519
1580
  // we could use a filter, but for the best performance we don´t
1520
1581
  if (item == null) {
@@ -1583,7 +1644,7 @@ class DomQuery {
1583
1644
  this.each((item) => {
1584
1645
  func(item) ? reArr.push(item) : null;
1585
1646
  });
1586
- return new DomQuery(...reArr);
1647
+ return new DomQuery(reArr);
1587
1648
  }
1588
1649
  /**
1589
1650
  * global eval head appendix method
@@ -1698,7 +1759,7 @@ class DomQuery {
1698
1759
  let res = [];
1699
1760
  res.push(this);
1700
1761
  res = res.concat(toInsertParams);
1701
- return new DomQuery(...res);
1762
+ return new DomQuery(res);
1702
1763
  }
1703
1764
  insertBefore(...toInsertParams) {
1704
1765
  this.each(existingItem => {
@@ -1713,7 +1774,7 @@ class DomQuery {
1713
1774
  let res = [];
1714
1775
  res.push(this);
1715
1776
  res = res.concat(toInsertParams);
1716
- return new DomQuery(...res);
1777
+ return new DomQuery(res);
1717
1778
  }
1718
1779
  orElse(...elseValue) {
1719
1780
  if (this.isPresent()) {
@@ -1744,7 +1805,7 @@ class DomQuery {
1744
1805
  }
1745
1806
  parent = parent.parent();
1746
1807
  }
1747
- return new DomQuery(...ret);
1808
+ return new DomQuery(ret);
1748
1809
  }
1749
1810
  /**
1750
1811
  * finds the first parent in the hierarchy for which the selector matches
@@ -1771,7 +1832,7 @@ class DomQuery {
1771
1832
  retArr.push(parent);
1772
1833
  parent = parent.parent().filter(item => item.matchesSelector(selector));
1773
1834
  }
1774
- return new DomQuery(...retArr);
1835
+ return new DomQuery(retArr);
1775
1836
  }
1776
1837
  parent() {
1777
1838
  let ret = [];
@@ -1781,7 +1842,7 @@ class DomQuery {
1781
1842
  ret.push(parent);
1782
1843
  }
1783
1844
  });
1784
- return new DomQuery(...ret);
1845
+ return new DomQuery(ret);
1785
1846
  }
1786
1847
  copyAttrs(sourceItem) {
1787
1848
  sourceItem.eachElem((sourceNode) => {
@@ -1827,13 +1888,18 @@ class DomQuery {
1827
1888
  outerHTML(markup, runEmbeddedScripts, runEmbeddedCss, deep = false) {
1828
1889
  var _a;
1829
1890
  if (this.isAbsent()) {
1830
- return;
1891
+ return undefined;
1831
1892
  }
1832
- let focusElementId = (_a = document === null || document === void 0 ? void 0 : document.activeElement) === null || _a === void 0 ? void 0 : _a.id;
1833
- let caretPosition = (focusElementId) ? DomQuery.getCaretPosition(document.activeElement) : null;
1893
+ let toReplace = this.getAsElem(0).value;
1894
+ let activeElement = document === null || document === void 0 ? void 0 : document.activeElement;
1895
+ let focusElementId = activeElement === null || activeElement === void 0 ? void 0 : activeElement.id;
1896
+ // only save/restore the caret if the focused element is actually part of the
1897
+ // subtree that gets replaced. Otherwise updating an unrelated component would
1898
+ // reset the caret of a different, still focused input field.
1899
+ let restoreFocus = !!focusElementId && !!((_a = toReplace === null || toReplace === void 0 ? void 0 : toReplace.contains) === null || _a === void 0 ? void 0 : _a.call(toReplace, activeElement));
1900
+ let caretPosition = restoreFocus ? DomQuery.getCaretPosition(activeElement) : null;
1834
1901
  let nodes = DomQuery.fromMarkup(markup);
1835
1902
  let res = [];
1836
- let toReplace = this.getAsElem(0).value;
1837
1903
  let firstInsert = nodes.get(0);
1838
1904
  let parentNode = toReplace.parentNode;
1839
1905
  let replaced = firstInsert.getAsElem(0).value;
@@ -1845,8 +1911,8 @@ class DomQuery {
1845
1911
  }
1846
1912
  let insertAdditionalItems = [];
1847
1913
  if (nodes.length > 1) {
1848
- insertAdditionalItems = insertAdditionalItems.concat(...nodes.values.slice(1));
1849
- res.push(DomQuery.byId(replaced).insertAfter(new DomQuery(...insertAdditionalItems)));
1914
+ insertAdditionalItems = insertAdditionalItems.concat(nodes.values.slice(1));
1915
+ res.push(DomQuery.byId(replaced).insertAfter(new DomQuery(insertAdditionalItems)));
1850
1916
  }
1851
1917
  if (runEmbeddedScripts) {
1852
1918
  this.runScripts();
@@ -1854,10 +1920,12 @@ class DomQuery {
1854
1920
  if (runEmbeddedCss) {
1855
1921
  this.runCss();
1856
1922
  }
1857
- let focusElement = DomQuery.byId(focusElementId);
1858
- if (focusElementId && focusElement.isPresent() &&
1859
- caretPosition != null && "undefined" != typeof caretPosition) {
1860
- focusElement.eachElem(item => DomQuery.setCaretPosition(item, caretPosition));
1923
+ if (restoreFocus) {
1924
+ let focusElement = DomQuery.byId(focusElementId);
1925
+ if (focusElement.isPresent() &&
1926
+ caretPosition != null && "undefined" != typeof caretPosition) {
1927
+ focusElement.eachElem(item => DomQuery.setCaretPosition(item, caretPosition));
1928
+ }
1861
1929
  }
1862
1930
  return nodes;
1863
1931
  }
@@ -1874,7 +1942,7 @@ class DomQuery {
1874
1942
  // scripts before we run the 'include' command
1875
1943
  // this.globalEval(finalScripts.join("\n"));
1876
1944
  let joinedScripts = [];
1877
- new _Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019Array(...scriptsToProcess).forEach(item => {
1945
+ (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019ArrayFrom)(scriptsToProcess).forEach(item => {
1878
1946
  if (!item.nonce) {
1879
1947
  joinedScripts.push(item.evalText);
1880
1948
  }
@@ -1974,7 +2042,8 @@ class DomQuery {
1974
2042
  // because in the head appendix
1975
2043
  // method only a console
1976
2044
  // error would be raised as well
1977
- console.error(e.message || e.description);
2045
+ const error = e;
2046
+ console.error(error.message || error.description);
1978
2047
  }
1979
2048
  }
1980
2049
  finally {
@@ -2126,7 +2195,7 @@ class DomQuery {
2126
2195
  // browser behavior no element name no encoding (normal submit fails in that case)
2127
2196
  // https:// issues.apache.org/jira/browse/MYFACES-2847
2128
2197
  if (this.name.isAbsent()) {
2129
- return;
2198
+ return undefined;
2130
2199
  }
2131
2200
  // let´s keep it side-effects free
2132
2201
  let target = (0,_AssocArray__WEBPACK_IMPORTED_MODULE_5__.simpleShallowMerge)(toMerge);
@@ -2228,7 +2297,7 @@ class DomQuery {
2228
2297
  if (_Monad__WEBPACK_IMPORTED_MODULE_0__.Optional.fromNullable(to).isAbsent()) {
2229
2298
  to = this.length;
2230
2299
  }
2231
- return new DomQuery(...this.rootNode.slice(from, Math.min(to, this.length)));
2300
+ return new DomQuery(this.rootNode.slice(from, Math.min(to, this.length)));
2232
2301
  }
2233
2302
  limits(end) {
2234
2303
  this._limits = end;
@@ -2276,7 +2345,7 @@ class DomQuery {
2276
2345
  throw new Error("Shadow dom creation not supported by the browser, please use a shim, to gain this functionality");
2277
2346
  }
2278
2347
  });
2279
- return new DomQuery(...shadowRoots);
2348
+ return new DomQuery(shadowRoots);
2280
2349
  }
2281
2350
  /**
2282
2351
  * helper to fix a common dom problem
@@ -2301,8 +2370,10 @@ class DomQuery {
2301
2370
  get shadowElements() {
2302
2371
  let shadowElements = this.querySelectorAll("*")
2303
2372
  .filter(item => item.hasShadow);
2304
- let mapped = (shadowElements.allElems() || []).map(element => element.shadowRoot);
2305
- return new DomQuery(...mapped);
2373
+ let mapped = (shadowElements.allElems() || [])
2374
+ .map(element => element.shadowRoot)
2375
+ .filter((root) => !!root);
2376
+ return new DomQuery(mapped);
2306
2377
  }
2307
2378
  get shadowRoot() {
2308
2379
  let shadowRoots = [];
@@ -2311,7 +2382,7 @@ class DomQuery {
2311
2382
  shadowRoots.push(this.rootNode[cnt].shadowRoot);
2312
2383
  }
2313
2384
  }
2314
- return new DomQuery(...shadowRoots);
2385
+ return new DomQuery(shadowRoots);
2315
2386
  }
2316
2387
  get hasShadow() {
2317
2388
  for (let cnt = 0; cnt < this.rootNode.length; cnt++) {
@@ -2321,25 +2392,18 @@ class DomQuery {
2321
2392
  }
2322
2393
  return false;
2323
2394
  }
2324
- // from
2325
- // http:// blog.vishalon.net/index.php/javascript-getting-and-setting-caret-position-in-textarea/
2326
2395
  static getCaretPosition(ctrl) {
2327
- let caretPos = 0;
2328
2396
  try {
2329
- if (document === null || document === void 0 ? void 0 : document.selection) {
2330
- ctrl.focus();
2331
- let selection = document.selection.createRange();
2332
- // the selection now is start zero
2333
- selection.moveStart('character', -ctrl.value.length);
2334
- // the caret-position is the selection start
2335
- caretPos = selection.text.length;
2397
+ // selectionStart is supported on text inputs/textareas in every relevant
2398
+ // browser (IE9+ and all modern engines)
2399
+ if (typeof (ctrl === null || ctrl === void 0 ? void 0 : ctrl.selectionStart) === "number") {
2400
+ return ctrl.selectionStart;
2336
2401
  }
2337
2402
  }
2338
2403
  catch (e) {
2339
- // now this is ugly, but not supported input types throw errors for selectionStart
2340
- // just in case someone dumps this code onto unsupported browsers
2404
+ // some input types throw on selectionStart access; treat as "no caret"
2341
2405
  }
2342
- return caretPos;
2406
+ return 0;
2343
2407
  }
2344
2408
  /**
2345
2409
  * sets the caret position
@@ -2354,7 +2418,19 @@ class DomQuery {
2354
2418
  static setCaretPosition(ctrl, pos) {
2355
2419
  (ctrl === null || ctrl === void 0 ? void 0 : ctrl.focus) ? ctrl === null || ctrl === void 0 ? void 0 : ctrl.focus() : null;
2356
2420
  // the selection range is our caret position
2357
- (ctrl === null || ctrl === void 0 ? void 0 : ctrl.setSelectiongRange) ? ctrl === null || ctrl === void 0 ? void 0 : ctrl.setSelectiongRange(pos, pos) : null;
2421
+ //
2422
+ // setSelectionRange exists on every HTMLInputElement, but the DOM spec
2423
+ // mandates that calling it on input types which do not support text
2424
+ // selection (checkbox, radio, button, file, ...) throws an
2425
+ // InvalidStateError. Hence a plain existence check is not enough; we
2426
+ // additionally swallow the error so the focus above still takes effect
2427
+ // (silent fail as documented).
2428
+ try {
2429
+ (ctrl === null || ctrl === void 0 ? void 0 : ctrl.setSelectionRange) ? ctrl === null || ctrl === void 0 ? void 0 : ctrl.setSelectionRange(pos, pos) : null;
2430
+ }
2431
+ catch (e) {
2432
+ // input type does not support a caret/selection -> nothing to set
2433
+ }
2358
2434
  }
2359
2435
  /**
2360
2436
  * Implementation of an iterator
@@ -2379,13 +2455,13 @@ class DomQuery {
2379
2455
  */
2380
2456
  concat(toAttach, filterDoubles = true) {
2381
2457
  let domQueries = this.asArray;
2382
- const ret = new DomQuery(...domQueries.concat(toAttach.asArray));
2458
+ const ret = new DomQuery(domQueries.concat(toAttach.asArray));
2383
2459
  // we now filter the doubles out
2384
2460
  if (!filterDoubles) {
2385
2461
  return ret;
2386
2462
  }
2387
2463
  let idx = {}; // ie11 does not support sets, we have to fake it
2388
- return new DomQuery(...ret.asArray.filter(node => {
2464
+ return new DomQuery(ret.asArray.filter(node => {
2389
2465
  const notFound = !(idx === null || idx === void 0 ? void 0 : idx[node.value.value.outerHTML]);
2390
2466
  idx[node.value.value.outerHTML] = true;
2391
2467
  return notFound;
@@ -2397,13 +2473,13 @@ class DomQuery {
2397
2473
  }
2398
2474
  prependTo(elem) {
2399
2475
  elem.eachElem(item => {
2400
- item.prepend(...this.allElems());
2476
+ prependChunked(item, this.allElems());
2401
2477
  });
2402
2478
  return this;
2403
2479
  }
2404
2480
  prepend(elem) {
2405
2481
  this.eachElem(item => {
2406
- item.prepend(...elem.allElems());
2482
+ prependChunked(item, elem.allElems());
2407
2483
  });
2408
2484
  return this;
2409
2485
  }
@@ -2424,9 +2500,13 @@ class DomQuery {
2424
2500
  continue;
2425
2501
  }
2426
2502
  let res = this.rootNode[cnt].querySelectorAll(selector);
2427
- nodes = nodes.concat(...objToArray(res));
2503
+ // push the NodeList straight into the single target array in
2504
+ // argument-stack-safe chunks; this avoids the objToArray copy plus
2505
+ // the concat reallocation, which doubled a large result set (e.g. the
2506
+ // querySelectorAll("*") shadow scan) on every root iteration
2507
+ (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.pushChunked)(nodes, res);
2428
2508
  }
2429
- return new DomQuery(...nodes);
2509
+ return new DomQuery(nodes);
2430
2510
  }
2431
2511
  /*deep with a selector and a pseudo /shadow/ marker to break into the next level*/
2432
2512
  _querySelectorAllDeep(selector) {
@@ -2434,7 +2514,7 @@ class DomQuery {
2434
2514
  if (!((_a = this === null || this === void 0 ? void 0 : this.rootNode) === null || _a === void 0 ? void 0 : _a.length)) {
2435
2515
  return this;
2436
2516
  }
2437
- let foundNodes = new DomQuery(...this.rootNode);
2517
+ let foundNodes = new DomQuery(this.rootNode);
2438
2518
  let selectors = selector.split(/\/shadow\//);
2439
2519
  for (let cnt2 = 0; cnt2 < selectors.length; cnt2++) {
2440
2520
  if (selectors[cnt2] == "") {
@@ -2465,9 +2545,9 @@ class DomQuery {
2465
2545
  continue;
2466
2546
  }
2467
2547
  let res = [this.rootNode[cnt].closest(selector)];
2468
- nodes = nodes.concat(...res);
2548
+ nodes = nodes.concat(res);
2469
2549
  }
2470
- return new DomQuery(...nodes);
2550
+ return new DomQuery(nodes);
2471
2551
  }
2472
2552
  /*deep with a selector and a pseudo /shadow/ marker to break into the next level*/
2473
2553
  _closestDeep(selector) {
@@ -2475,7 +2555,7 @@ class DomQuery {
2475
2555
  if (!((_a = this === null || this === void 0 ? void 0 : this.rootNode) === null || _a === void 0 ? void 0 : _a.length)) {
2476
2556
  return this;
2477
2557
  }
2478
- let foundNodes = new DomQuery(...this.rootNode);
2558
+ let foundNodes = new DomQuery(this.rootNode);
2479
2559
  let selectors = selector.split(/\/shadow\//);
2480
2560
  for (let cnt2 = 0; cnt2 < selectors.length; cnt2++) {
2481
2561
  if (selectors[cnt2] == "") {
@@ -2612,7 +2692,7 @@ class DomQueryCollector {
2612
2692
  this.data.push(element);
2613
2693
  }
2614
2694
  get finalValue() {
2615
- return new DomQuery(...this.data);
2695
+ return new DomQuery(this.data);
2616
2696
  }
2617
2697
  }
2618
2698
  /**
@@ -2637,25 +2717,54 @@ const DQ$ = DomQuery.querySelectorAll;
2637
2717
  __webpack_require__.r(__webpack_exports__);
2638
2718
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2639
2719
  /* harmony export */ Es2019Array: () => (/* binding */ Es2019Array),
2640
- /* harmony export */ _Es2019Array: () => (/* binding */ _Es2019Array)
2720
+ /* harmony export */ Es2019ArrayFrom: () => (/* binding */ Es2019ArrayFrom),
2721
+ /* harmony export */ MAX_ARG_LENGTH: () => (/* binding */ MAX_ARG_LENGTH),
2722
+ /* harmony export */ _Es2019Array: () => (/* binding */ _Es2019Array),
2723
+ /* harmony export */ _Es2019ArrayFromArr: () => (/* binding */ _Es2019ArrayFromArr),
2724
+ /* harmony export */ pushChunked: () => (/* binding */ pushChunked)
2641
2725
  /* harmony export */ });
2642
2726
  /**
2643
2727
  * Extended array
2644
2728
  */
2729
+ /**
2730
+ * Max number of elements passed per function call.
2731
+ * Spreading or applying a large array into a single call
2732
+ * ("fn(...data)") overflows the argument stack on most browsers
2733
+ * (Chrome throws "RangeError: Maximum call stack size exceeded"
2734
+ * at roughly 65k arguments), so bulk operations must be chunked.
2735
+ */
2736
+ const MAX_ARG_LENGTH = 30000;
2737
+ /**
2738
+ * Appends the contents of source to target in argument-stack-safe chunks,
2739
+ * the chunk-safe replacement for target.push(...source)
2740
+ *
2741
+ * @param target the array to append to
2742
+ * @param source the elements to append
2743
+ * @returns target for chaining
2744
+ */
2745
+ function pushChunked(target, source) {
2746
+ for (let start = 0, len = source.length; start < len; start += MAX_ARG_LENGTH) {
2747
+ Array.prototype.push.apply(target, Array.prototype.slice.call(source, start, start + MAX_ARG_LENGTH));
2748
+ }
2749
+ return target;
2750
+ }
2645
2751
  /**
2646
2752
  * Extended array which adds various es 2019 shim functions to the normal array
2647
2753
  * We must remap all array producing functions in order to keep
2648
2754
  * the delegation active, once we are in!
2649
2755
  */
2650
2756
  class Es2019Array_ extends Array {
2651
- constructor(...another) {
2652
- super(...another);
2757
+ constructor(another = []) {
2758
+ super();
2759
+ // species constructors and legacy code paths may pass a scalar
2760
+ another = Array.isArray(another) ? another : [another];
2653
2761
  if (another._another) {
2654
2762
  this._another = another._another;
2655
2763
  }
2656
2764
  else {
2657
2765
  this._another = another;
2658
2766
  }
2767
+ pushChunked(this, another);
2659
2768
  //for testing it definitely runs into this branch because we are on es5 level
2660
2769
  //if (!(Array.prototype).flatMap as any) {
2661
2770
  this.flatMap = (flatMapFun) => this._flatMap(flatMapFun);
@@ -2666,27 +2775,27 @@ class Es2019Array_ extends Array {
2666
2775
  }
2667
2776
  map(callbackfn, thisArg) {
2668
2777
  const ret = Array.prototype.map.call(this._another, callbackfn, thisArg);
2669
- return new _Es2019Array(...ret);
2778
+ return _Es2019ArrayFromArr(ret);
2670
2779
  }
2671
2780
  concat(...items) {
2672
- const ret = Array.prototype.concat.call(this._another, ...items);
2673
- return new _Es2019Array(...ret);
2781
+ const ret = Array.prototype.concat.apply(this._another, items);
2782
+ return _Es2019ArrayFromArr(ret);
2674
2783
  }
2675
2784
  reverse() {
2676
2785
  const ret = Array.prototype.reverse.call(this._another);
2677
- return new _Es2019Array(...ret);
2786
+ return _Es2019ArrayFromArr(ret);
2678
2787
  }
2679
2788
  slice(start, end) {
2680
2789
  const ret = Array.prototype.slice.call(this._another, start, end);
2681
- return new _Es2019Array(...ret);
2790
+ return _Es2019ArrayFromArr(ret);
2682
2791
  }
2683
2792
  splice(start, deleteCount) {
2684
2793
  const ret = Array.prototype.splice.call(this._another, start, deleteCount !== null && deleteCount !== void 0 ? deleteCount : 0);
2685
- return new _Es2019Array(...ret);
2794
+ return _Es2019ArrayFromArr(ret);
2686
2795
  }
2687
2796
  filter(predicate, thisArg) {
2688
2797
  const ret = Array.prototype.filter.call(this._another, predicate, thisArg);
2689
- return new _Es2019Array(...ret);
2798
+ return _Es2019ArrayFromArr(ret);
2690
2799
  }
2691
2800
  reduce(callbackfn, initialValue) {
2692
2801
  const ret = Array.prototype.reduce.call(this._another, callbackfn, initialValue);
@@ -2711,7 +2820,7 @@ class Es2019Array_ extends Array {
2711
2820
  res = res.concat(mapped);
2712
2821
  };
2713
2822
  arr.forEach(reFlat);
2714
- return new Es2019Array(...res);
2823
+ return Es2019ArrayFrom(res);
2715
2824
  }
2716
2825
  _flatMap(mapperFunction) {
2717
2826
  let res = this.map(item => mapperFunction(item));
@@ -2721,7 +2830,14 @@ class Es2019Array_ extends Array {
2721
2830
  //let _Es2019Array = function<T>(...data: T[]) {};
2722
2831
  //let oldProto = Es2019Array.prototype;
2723
2832
  function _Es2019Array(...data) {
2724
- let ret = new Es2019Array_(...data);
2833
+ return _Es2019ArrayFromArr(data);
2834
+ }
2835
+ /**
2836
+ * chunk-safe variant of _Es2019Array which takes the backing array
2837
+ * directly instead of spreading it into the call
2838
+ */
2839
+ function _Es2019ArrayFromArr(data) {
2840
+ let ret = new Es2019Array_(data);
2725
2841
  let proxied = new Proxy(ret, {
2726
2842
  get(target, p, receiver) {
2727
2843
  if ("symbol" == typeof p) {
@@ -2743,20 +2859,26 @@ function _Es2019Array(...data) {
2743
2859
  return proxied;
2744
2860
  }
2745
2861
  ;
2746
- /**
2747
- * this is the switch between normal array and our shim
2748
- * the shim is only provided in case the native browser
2749
- * does not yet have flatMap support on arrays
2750
- */
2751
- // Runtime check for browser compatibility — TypeScript knows flatMap exists in lib but older browsers may not have it.
2752
- var Es2019Array = (Array.prototype.flatMap) ? function (...data) {
2862
+ var Es2019Array = ((Array.prototype.flatMap) ? function (...data) {
2753
2863
  // sometimes the typescript compiler produces
2754
2864
  // an array without flatmap between boundaries (the result produces True for Array.isArray
2755
2865
  // but has no flatMap function, could be a node issue also or Typescript!
2756
2866
  // we remap that (could be related to: https://github.com/microsoft/TypeScript/issues/31033
2757
2867
  // the check and remap fixes the issue which should not exist in the first place
2758
- return (data === null || data === void 0 ? void 0 : data.flatMap) ? data : _Es2019Array(...data);
2759
- } : _Es2019Array;
2868
+ return (data === null || data === void 0 ? void 0 : data.flatMap) ? data : _Es2019ArrayFromArr(data);
2869
+ } : _Es2019Array);
2870
+ /**
2871
+ * chunk-safe variant of new Es2019Array(...source) -
2872
+ * spreading a large array into the constructor call overflows the
2873
+ * argument stack ("Maximum call stack size exceeded"), this builder
2874
+ * copies the data over in safe chunks instead
2875
+ *
2876
+ * @param source an array or array-like holding the initial data
2877
+ */
2878
+ function Es2019ArrayFrom(source) {
2879
+ const data = pushChunked([], source);
2880
+ return (Array.prototype.flatMap) ? data : _Es2019ArrayFromArr(data);
2881
+ }
2760
2882
 
2761
2883
 
2762
2884
  /***/ },
@@ -2931,7 +3053,7 @@ var Lang;
2931
3053
  //special condition array delivered no offset no pack
2932
3054
  if ((obj) instanceof Array && !offset && !pack)
2933
3055
  return obj;
2934
- return new _Es2019Array__WEBPACK_IMPORTED_MODULE_1__.Es2019Array(...pack.concat(Array.prototype.slice.call(obj, offset)));
3056
+ return (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_1__.Es2019ArrayFrom)(pack.concat(Array.prototype.slice.call(obj, offset)));
2935
3057
  }
2936
3058
  Lang.objToArray = objToArray;
2937
3059
  /**
@@ -2978,8 +3100,6 @@ var Lang;
2978
3100
  return it instanceof Function || typeof it === "function";
2979
3101
  }
2980
3102
  Lang.isFunc = isFunc;
2981
- // code from https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
2982
- // license https://creativecommons.org/licenses/by-sa/2.5/
2983
3103
  function objAssign(target, ...theArgs) {
2984
3104
  if (target == null) { // TypeError if undefined or null
2985
3105
  throw new TypeError('Cannot convert undefined or null to object');
@@ -2991,9 +3111,11 @@ var Lang;
2991
3111
  }
2992
3112
  theArgs.filter(item => item != null).forEach(item => {
2993
3113
  let nextSource = item;
2994
- Object.keys(nextSource)
2995
- .filter(nextKey => Object.prototype.hasOwnProperty.call(nextSource, nextKey))
2996
- .forEach(nextKey => to[nextKey] = nextSource[nextKey]);
3114
+ const stringKeys = Object.keys(nextSource);
3115
+ const symbolKeys = Object.getOwnPropertySymbols(nextSource)
3116
+ .filter(sym => Object.prototype.propertyIsEnumerable.call(nextSource, sym));
3117
+ [...stringKeys, ...symbolKeys]
3118
+ .forEach(key => to[key] = nextSource[key]);
2997
3119
  });
2998
3120
  return to;
2999
3121
  }
@@ -3341,6 +3463,313 @@ class ValueEmbedder extends Optional {
3341
3463
  ValueEmbedder.absent = ValueEmbedder.fromNullable(null);
3342
3464
 
3343
3465
 
3466
+ /***/ },
3467
+
3468
+ /***/ "./node_modules/mona-dish/src/main/typescript/Promise.ts"
3469
+ /*!***************************************************************!*\
3470
+ !*** ./node_modules/mona-dish/src/main/typescript/Promise.ts ***!
3471
+ \***************************************************************/
3472
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
3473
+
3474
+ __webpack_require__.r(__webpack_exports__);
3475
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3476
+ /* harmony export */ CancellablePromise: () => (/* binding */ CancellablePromise),
3477
+ /* harmony export */ Promise: () => (/* binding */ Promise),
3478
+ /* harmony export */ PromiseStatus: () => (/* binding */ PromiseStatus),
3479
+ /* harmony export */ interval: () => (/* binding */ interval),
3480
+ /* harmony export */ timeout: () => (/* binding */ timeout)
3481
+ /* harmony export */ });
3482
+ /* harmony import */ var _Monad__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Monad */ "./node_modules/mona-dish/src/main/typescript/Monad.ts");
3483
+ /*!
3484
+ * Licensed to the Apache Software Foundation (ASF) under one
3485
+ * or more contributor license agreements. See the NOTICE file
3486
+ * distributed with this work for additional information
3487
+ * regarding copyright ownership. The ASF licenses this file
3488
+ * to you under the Apache License, Version 2.0 (the
3489
+ * "License"); you may not use this file except in compliance
3490
+ * with the License. You may obtain a copy of the License at
3491
+ *
3492
+ * http://www.apache.org/licenses/LICENSE-2.0
3493
+ *
3494
+ * Unless required by applicable law or agreed to in writing,
3495
+ * software distributed under the License is distributed on an
3496
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
3497
+ * KIND, either express or implied. See the License for the
3498
+ * specific language governing permissions and limitations
3499
+ * under the License.
3500
+ */
3501
+
3502
+ var PromiseStatus;
3503
+ (function (PromiseStatus) {
3504
+ PromiseStatus[PromiseStatus["PENDING"] = 0] = "PENDING";
3505
+ PromiseStatus[PromiseStatus["FULFILLED"] = 1] = "FULFILLED";
3506
+ PromiseStatus[PromiseStatus["REJECTED"] = 2] = "REJECTED";
3507
+ })(PromiseStatus || (PromiseStatus = {}));
3508
+ /*
3509
+ * Promise wrappers for timeout and interval
3510
+ */
3511
+ function timeout(timeout) {
3512
+ let handler = null;
3513
+ return new CancellablePromise((apply, reject) => {
3514
+ handler = setTimeout(() => apply(), timeout);
3515
+ }, () => {
3516
+ if (handler) {
3517
+ clearTimeout(handler);
3518
+ handler = null;
3519
+ }
3520
+ });
3521
+ }
3522
+ function interval(timeout) {
3523
+ let handler = null;
3524
+ return new CancellablePromise((apply, reject) => {
3525
+ handler = setInterval(() => {
3526
+ apply();
3527
+ }, timeout);
3528
+ }, () => {
3529
+ if (handler) {
3530
+ clearInterval(handler);
3531
+ handler = null;
3532
+ }
3533
+ });
3534
+ }
3535
+ /**
3536
+ * a small (probably not 100% correct, although I tried to be correct as possible) Promise implementation
3537
+ * for systems which do not have a promise implemented
3538
+ * Note, although an internal state is kept, this is sideffect free since
3539
+ * is value is a function to operate on, hence no real state is kept internally, except for the then
3540
+ * and catch calling order
3541
+ */
3542
+ class Promise {
3543
+ constructor(executor) {
3544
+ this.status = PromiseStatus.PENDING;
3545
+ this.allFuncs = [];
3546
+ //super(executor);
3547
+ this.value = executor;
3548
+ this.value((data) => this.resolve(data), (data) => this.reject(data));
3549
+ }
3550
+ static all(...promises) {
3551
+ let promiseCnt = 0;
3552
+ let myapply;
3553
+ let myPromise = new Promise((apply, reject) => {
3554
+ myapply = apply;
3555
+ });
3556
+ let executor = () => {
3557
+ promiseCnt++;
3558
+ if (promises.length == promiseCnt) {
3559
+ myapply();
3560
+ }
3561
+ };
3562
+ executor.__last__ = true;
3563
+ for (let cnt = 0; cnt < promises.length; cnt++) {
3564
+ promises[cnt].finally(executor);
3565
+ }
3566
+ return myPromise;
3567
+ }
3568
+ static race(...promises) {
3569
+ let promiseCnt = 0;
3570
+ let myapply;
3571
+ let myreject;
3572
+ let myPromise = new Promise((apply, reject) => {
3573
+ myapply = apply;
3574
+ myreject = reject;
3575
+ });
3576
+ let thenexecutor = () => {
3577
+ if (!!myapply) {
3578
+ myapply();
3579
+ }
3580
+ myapply = null;
3581
+ myreject = null;
3582
+ return null;
3583
+ };
3584
+ thenexecutor.__last__ = true;
3585
+ let catchexeutor = () => {
3586
+ if (!!myreject) {
3587
+ myreject();
3588
+ }
3589
+ myreject = null;
3590
+ myapply = null;
3591
+ return null;
3592
+ };
3593
+ catchexeutor.__last__ = true;
3594
+ for (let cnt = 0; cnt < promises.length; cnt++) {
3595
+ promises[cnt].then(thenexecutor);
3596
+ promises[cnt].catch(catchexeutor);
3597
+ }
3598
+ return myPromise;
3599
+ }
3600
+ static reject(reason) {
3601
+ let retVal = new Promise((resolve, reject) => {
3602
+ //not really doable without a hack
3603
+ if (reason instanceof Promise) {
3604
+ reason.then((val) => {
3605
+ reject(val);
3606
+ });
3607
+ }
3608
+ else {
3609
+ setTimeout(() => {
3610
+ reject(reason);
3611
+ }, 1);
3612
+ }
3613
+ });
3614
+ return retVal;
3615
+ }
3616
+ static resolve(reason) {
3617
+ let retVal = new Promise((resolve, reject) => {
3618
+ //not really doable without a hack
3619
+ if (reason instanceof Promise) {
3620
+ reason.then((val) => resolve(val));
3621
+ }
3622
+ else {
3623
+ setTimeout(() => {
3624
+ resolve(reason);
3625
+ }, 1);
3626
+ }
3627
+ });
3628
+ return retVal;
3629
+ }
3630
+ then(executorFunc, catchfunc) {
3631
+ this.allFuncs.push({ "then": executorFunc });
3632
+ if (catchfunc) {
3633
+ this.allFuncs.push({ "catch": catchfunc });
3634
+ }
3635
+ this.spliceLastFuncs();
3636
+ return this;
3637
+ }
3638
+ catch(executorFunc) {
3639
+ this.allFuncs.push({ "catch": executorFunc });
3640
+ this.spliceLastFuncs();
3641
+ return this;
3642
+ }
3643
+ finally(executorFunc) {
3644
+ if (this.__reason__) {
3645
+ this.__reason__.finally(executorFunc);
3646
+ return undefined;
3647
+ }
3648
+ this.allFuncs.push({ "finally": executorFunc });
3649
+ this.spliceLastFuncs();
3650
+ return this;
3651
+ }
3652
+ resolve(val) {
3653
+ while (this.allFuncs.length) {
3654
+ if (!this.allFuncs[0].then) {
3655
+ break;
3656
+ }
3657
+ let fn = this.allFuncs.shift();
3658
+ let funcResult = _Monad__WEBPACK_IMPORTED_MODULE_0__.Optional.fromNullable(fn.then(val));
3659
+ if (funcResult.isPresent()) {
3660
+ funcResult = funcResult.flatMap();
3661
+ val = funcResult.value;
3662
+ if (val instanceof Promise) {
3663
+ //let func = (newVal: any) => {this.resolve(newVal)};
3664
+ //func.__last__ = true;
3665
+ //val.then(func);
3666
+ this.transferIntoNewPromise(val);
3667
+ return;
3668
+ }
3669
+ }
3670
+ else {
3671
+ break;
3672
+ }
3673
+ }
3674
+ this.appyFinally();
3675
+ this.status = PromiseStatus.FULFILLED;
3676
+ }
3677
+ reject(val) {
3678
+ while (this.allFuncs.length) {
3679
+ if (this.allFuncs[0].finally) {
3680
+ break;
3681
+ }
3682
+ let fn = this.allFuncs.shift();
3683
+ if (fn.catch) {
3684
+ let funcResult = _Monad__WEBPACK_IMPORTED_MODULE_0__.Optional.fromNullable(fn.catch(val));
3685
+ if (funcResult.isPresent()) {
3686
+ funcResult = funcResult.flatMap();
3687
+ val = funcResult.value;
3688
+ if (val instanceof Promise) {
3689
+ //val.then((newVal: any) => {this.resolve(newVal)});
3690
+ this.transferIntoNewPromise(val);
3691
+ return;
3692
+ }
3693
+ this.status = PromiseStatus.REJECTED;
3694
+ break;
3695
+ }
3696
+ else {
3697
+ break;
3698
+ }
3699
+ }
3700
+ }
3701
+ this.status = PromiseStatus.REJECTED;
3702
+ this.appyFinally();
3703
+ }
3704
+ appyFinally() {
3705
+ while (this.allFuncs.length) {
3706
+ let fn = this.allFuncs.shift();
3707
+ if (fn.finally) {
3708
+ fn.finally();
3709
+ }
3710
+ }
3711
+ }
3712
+ spliceLastFuncs() {
3713
+ let lastFuncs = [];
3714
+ let rest = [];
3715
+ for (let cnt = 0; cnt < this.allFuncs.length; cnt++) {
3716
+ for (let key in this.allFuncs[cnt]) {
3717
+ if (this.allFuncs[cnt][key].__last__) {
3718
+ lastFuncs.push(this.allFuncs[cnt]);
3719
+ }
3720
+ else {
3721
+ rest.push(this.allFuncs[cnt]);
3722
+ }
3723
+ }
3724
+ }
3725
+ this.allFuncs = rest.concat(lastFuncs);
3726
+ }
3727
+ transferIntoNewPromise(val) {
3728
+ for (let cnt = 0; cnt < this.allFuncs.length; cnt++) {
3729
+ for (let key in this.allFuncs[cnt]) {
3730
+ val[key](this.allFuncs[cnt][key]);
3731
+ }
3732
+ }
3733
+ }
3734
+ }
3735
+ /**
3736
+ * a cancellable promise
3737
+ * a Promise with a cancel function, which can be cancellend any time
3738
+ * this is useful for promises which use cancellable asynchronous operations
3739
+ * note, even in a cancel state, the finally of the promise is executed, however
3740
+ * subsequent thens are not anymore.
3741
+ * The current then however is fished or a catch is called depending on how the outer
3742
+ * operation reacts to a cancel order.
3743
+ */
3744
+ class CancellablePromise extends Promise {
3745
+ /**
3746
+ * @param executor asynchronous callback operation which triggers the callback
3747
+ * @param cancellator cancel operation, separate from the trigger operation
3748
+ */
3749
+ constructor(executor, cancellator) {
3750
+ super(executor);
3751
+ this.cancellator = () => {
3752
+ };
3753
+ this.cancellator = cancellator;
3754
+ }
3755
+ cancel() {
3756
+ this.status = PromiseStatus.REJECTED;
3757
+ this.appyFinally();
3758
+ //lets terminate it once and for all, the finally has been applied
3759
+ this.allFuncs = [];
3760
+ }
3761
+ then(executorFunc, catchfunc) {
3762
+ return super.then(executorFunc, catchfunc);
3763
+ }
3764
+ catch(executorFunc) {
3765
+ return super.catch(executorFunc);
3766
+ }
3767
+ finally(executorFunc) {
3768
+ return super.finally(executorFunc);
3769
+ }
3770
+ }
3771
+
3772
+
3344
3773
  /***/ },
3345
3774
 
3346
3775
  /***/ "./node_modules/mona-dish/src/main/typescript/SourcesCollectors.ts"
@@ -3420,7 +3849,17 @@ class MultiStreamDatasource {
3420
3849
  constructor(first, ...strms) {
3421
3850
  this.first = first;
3422
3851
  this.selectedPos = 0;
3423
- this.strms = [first].concat(...strms);
3852
+ // callers may pass single data sources or entire arrays of them,
3853
+ // we flatten one level here (chunk-safe, no spread into a call)
3854
+ this.strms = [first];
3855
+ strms.forEach(strm => {
3856
+ if (Array.isArray(strm)) {
3857
+ (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_0__.pushChunked)(this.strms, strm);
3858
+ }
3859
+ else {
3860
+ this.strms.push(strm);
3861
+ }
3862
+ });
3424
3863
  this.activeStrm = this.strms[this.selectedPos];
3425
3864
  }
3426
3865
  current() {
@@ -3522,6 +3961,18 @@ class ArrayStreamDataSource {
3522
3961
  this.dataPos = -1;
3523
3962
  this.value = value;
3524
3963
  }
3964
+ /**
3965
+ * chunk-safe factory, takes the backing array directly instead
3966
+ * of spreading it into the constructor call (spreading large arrays
3967
+ * overflows the argument stack)
3968
+ *
3969
+ * @param data the array to stream over
3970
+ */
3971
+ static ofArray(data) {
3972
+ const ret = new ArrayStreamDataSource();
3973
+ ret.value = data !== null && data !== void 0 ? data : [];
3974
+ return ret;
3975
+ }
3525
3976
  lookAhead(cnt = 1) {
3526
3977
  if ((this.dataPos + cnt) > this.value.length - 1) {
3527
3978
  return ITERATION_STATUS.EO_STRM;
@@ -3612,7 +4063,7 @@ class FilteredStreamDatasource {
3612
4063
  */
3613
4064
  lookAhead(cnt = 1) {
3614
4065
  var _a;
3615
- let lookupVal;
4066
+ let lookupVal = ITERATION_STATUS.EO_STRM;
3616
4067
  for (let loop = 1; cnt > 0 && (lookupVal = this.inputDataSource.lookAhead(loop)) != ITERATION_STATUS.EO_STRM; loop++) {
3617
4068
  let inCache = (_a = this._filterIdx) === null || _a === void 0 ? void 0 : _a[this._unfilteredPos + loop];
3618
4069
  if (inCache || this.filterFunc(lookupVal)) {
@@ -3775,8 +4226,8 @@ class QueryFormStringCollector {
3775
4226
  }
3776
4227
  }
3777
4228
  get finalValue() {
3778
- return new _Es2019Array__WEBPACK_IMPORTED_MODULE_0__.Es2019Array(...this.formData)
3779
- .map(keyVal => keyVal.join("="))
4229
+ return (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_0__.Es2019ArrayFrom)(this.formData)
4230
+ .map((keyVal) => keyVal.join("="))
3780
4231
  .reduce((item1, item2) => [item1, item2].join("&"));
3781
4232
  }
3782
4233
  }
@@ -3788,11 +4239,805 @@ class ArrayCollector {
3788
4239
  constructor() {
3789
4240
  this.data = [];
3790
4241
  }
3791
- collect(element) {
3792
- this.data.push(element);
4242
+ collect(element) {
4243
+ this.data.push(element);
4244
+ }
4245
+ get finalValue() {
4246
+ return this.data;
4247
+ }
4248
+ }
4249
+
4250
+
4251
+ /***/ },
4252
+
4253
+ /***/ "./node_modules/mona-dish/src/main/typescript/Stream.ts"
4254
+ /*!**************************************************************!*\
4255
+ !*** ./node_modules/mona-dish/src/main/typescript/Stream.ts ***!
4256
+ \**************************************************************/
4257
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
4258
+
4259
+ __webpack_require__.r(__webpack_exports__);
4260
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4261
+ /* harmony export */ FlatMapStreamDataSource: () => (/* binding */ FlatMapStreamDataSource),
4262
+ /* harmony export */ LazyStream: () => (/* binding */ LazyStream),
4263
+ /* harmony export */ Stream: () => (/* binding */ Stream)
4264
+ /* harmony export */ });
4265
+ /* harmony import */ var _Monad__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Monad */ "./node_modules/mona-dish/src/main/typescript/Monad.ts");
4266
+ /* harmony import */ var _SourcesCollectors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SourcesCollectors */ "./node_modules/mona-dish/src/main/typescript/SourcesCollectors.ts");
4267
+ /* harmony import */ var _DomQuery__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./DomQuery */ "./node_modules/mona-dish/src/main/typescript/DomQuery.ts");
4268
+ /*!
4269
+ * Licensed to the Apache Software Foundation (ASF) under one or more
4270
+ * contributor license agreements. See the NOTICE file distributed with
4271
+ * this work for additional information regarding copyright ownership.
4272
+ * The ASF licenses this file to you under the Apache License, Version 2.0
4273
+ * (the "License"); you may not use this file except in compliance with
4274
+ * the License. You may obtain a copy of the License at
4275
+ *
4276
+ * http://www.apache.org/licenses/LICENSE-2.0
4277
+ *
4278
+ * Unless required by applicable law or agreed to in writing, software
4279
+ * distributed under the License is distributed on an "AS IS" BASIS,
4280
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4281
+ * See the License for the specific language governing permissions and
4282
+ * limitations under the License.
4283
+ */
4284
+ /*
4285
+ * A small stream implementation
4286
+ */
4287
+
4288
+
4289
+
4290
+ /**
4291
+ * Same for flatmap to deal with element -> stream mappings
4292
+ */
4293
+ class FlatMapStreamDataSource {
4294
+ constructor(func, parent) {
4295
+ /**
4296
+ * the currently active stream
4297
+ * coming from an incoming element
4298
+ * once the end of this one is reached
4299
+ * it is swapped out by another one
4300
+ * from the next element
4301
+ */
4302
+ this.activeDataSource = null;
4303
+ this.walkedDataSources = [];
4304
+ this._currPos = 0;
4305
+ this.mapFunc = func;
4306
+ this.inputDataSource = parent;
4307
+ }
4308
+ hasNext() {
4309
+ return this.resolveActiveHasNext() || this.resolveNextHasNext();
4310
+ }
4311
+ resolveActiveHasNext() {
4312
+ let next = false;
4313
+ if (this.activeDataSource) {
4314
+ next = this.activeDataSource.hasNext();
4315
+ }
4316
+ return next;
4317
+ }
4318
+ lookAhead(cnt = 1) {
4319
+ var _a;
4320
+ let lookAhead = (_a = this === null || this === void 0 ? void 0 : this.activeDataSource) === null || _a === void 0 ? void 0 : _a.lookAhead(cnt);
4321
+ if ((this === null || this === void 0 ? void 0 : this.activeDataSource) && lookAhead != _SourcesCollectors__WEBPACK_IMPORTED_MODULE_1__.ITERATION_STATUS.EO_STRM) {
4322
+ //this should cover 95% of all cases
4323
+ return lookAhead;
4324
+ }
4325
+ if (this.activeDataSource) {
4326
+ cnt -= (0,_SourcesCollectors__WEBPACK_IMPORTED_MODULE_1__.calculateSkips)(this.activeDataSource);
4327
+ }
4328
+ //the idea is basically to look into the streams sub-sequentially for a match
4329
+ //after each stream we have to take into consideration that the skipCnt is
4330
+ //reduced by the number of datasets we already have looked into in the previous stream/datasource
4331
+ //unfortunately for now we have to loop into them, so we introduce a small o2 here
4332
+ for (let dsLoop = 1; true; dsLoop++) {
4333
+ let datasourceData = this.inputDataSource.lookAhead(dsLoop);
4334
+ //we have looped out
4335
+ //no embedded data anymore? we are done, data
4336
+ //can either be a scalar an array or another datasource
4337
+ if (datasourceData === _SourcesCollectors__WEBPACK_IMPORTED_MODULE_1__.ITERATION_STATUS.EO_STRM) {
4338
+ return _SourcesCollectors__WEBPACK_IMPORTED_MODULE_1__.ITERATION_STATUS.EO_STRM;
4339
+ }
4340
+ let mappedData = this.mapFunc(datasourceData);
4341
+ //it either comes in as datasource or as array
4342
+ //both cases must be unified into a datasource
4343
+ let currentDataSource = this.toDatasource(mappedData);
4344
+ //we now run again a lookahead
4345
+ let ret = currentDataSource.lookAhead(cnt);
4346
+ //if the value is found then we are set
4347
+ if (ret != _SourcesCollectors__WEBPACK_IMPORTED_MODULE_1__.ITERATION_STATUS.EO_STRM) {
4348
+ return ret;
4349
+ }
4350
+ //reduce the next lookahead by the number of elements
4351
+ //we are now skipping in the current data source
4352
+ cnt -= (0,_SourcesCollectors__WEBPACK_IMPORTED_MODULE_1__.calculateSkips)(currentDataSource);
4353
+ }
4354
+ }
4355
+ toDatasource(mapped) {
4356
+ let ds = Array.isArray(mapped) ? _SourcesCollectors__WEBPACK_IMPORTED_MODULE_1__.ArrayStreamDataSource.ofArray(mapped) : mapped;
4357
+ this.walkedDataSources.push(ds);
4358
+ return ds;
4359
+ }
4360
+ resolveNextHasNext() {
4361
+ let next = false;
4362
+ while (!next && this.inputDataSource.hasNext()) {
4363
+ let mapped = this.mapFunc(this.inputDataSource.next());
4364
+ this.activeDataSource = this.toDatasource(mapped);
4365
+ next = this.activeDataSource.hasNext();
4366
+ }
4367
+ return next;
4368
+ }
4369
+ next() {
4370
+ if (this.hasNext()) {
4371
+ this._currPos++;
4372
+ return this.activeDataSource.next();
4373
+ }
4374
+ return undefined;
4375
+ }
4376
+ reset() {
4377
+ this.inputDataSource.reset();
4378
+ this.walkedDataSources.forEach(ds => ds.reset());
4379
+ this.walkedDataSources = [];
4380
+ this._currPos = 0;
4381
+ this.activeDataSource = null;
4382
+ }
4383
+ current() {
4384
+ if (!this.activeDataSource) {
4385
+ this.hasNext();
4386
+ }
4387
+ return this.activeDataSource.current();
4388
+ }
4389
+ }
4390
+ /**
4391
+ * A simple typescript based reimplementation of streams
4392
+ *
4393
+ * This is the early eval version
4394
+ * for a lazy eval version check, LazyStream, which is api compatible
4395
+ * to this implementation, however with the benefit of being able
4396
+ * to provide infinite data sources and generic data providers, the downside
4397
+ * is, it might be a tad slower in some situations
4398
+ */
4399
+ class Stream {
4400
+ constructor(...value) {
4401
+ this._limits = -1;
4402
+ this.pos = -1;
4403
+ this.value = value;
4404
+ }
4405
+ static of(...data) {
4406
+ return Stream.ofArr(data);
4407
+ }
4408
+ /**
4409
+ * chunk-safe factory, takes the backing array directly instead of
4410
+ * spreading it into the call (Stream.of(...largeArray) overflows the
4411
+ * argument stack on large arrays)
4412
+ *
4413
+ * @param data the array to stream over
4414
+ */
4415
+ static ofArr(data) {
4416
+ const ret = new Stream();
4417
+ ret.value = data !== null && data !== void 0 ? data : [];
4418
+ return ret;
4419
+ }
4420
+ static ofAssoc(data) {
4421
+ return this.ofArr(Object.keys(data)).map(key => [key, data[key]]);
4422
+ }
4423
+ static ofDataSource(dataSource) {
4424
+ let value = [];
4425
+ while (dataSource.hasNext()) {
4426
+ value.push(dataSource.next());
4427
+ }
4428
+ return Stream.ofArr(value);
4429
+ }
4430
+ static ofDomQuery(value) {
4431
+ return Stream.ofArr(value.asArray);
4432
+ }
4433
+ static ofConfig(value) {
4434
+ return Stream.ofArr(Object.keys(value.value)).map(key => [key, value.value[key]]);
4435
+ }
4436
+ current() {
4437
+ if (this.pos == -1) {
4438
+ return _SourcesCollectors__WEBPACK_IMPORTED_MODULE_1__.ITERATION_STATUS.BEF_STRM;
4439
+ }
4440
+ if (this.pos >= this.value.length) {
4441
+ return _SourcesCollectors__WEBPACK_IMPORTED_MODULE_1__.ITERATION_STATUS.EO_STRM;
4442
+ }
4443
+ return this.value[this.pos];
4444
+ }
4445
+ limits(end) {
4446
+ this._limits = end;
4447
+ return this;
4448
+ }
4449
+ /**
4450
+ * concat for streams, so that you can concat two streams together
4451
+ * @param toAppend
4452
+ */
4453
+ concat(...toAppend) {
4454
+ let toConcat = [this].concat(toAppend);
4455
+ return Stream.ofArr(toConcat).flatMap(item => item);
4456
+ }
4457
+ onElem(fn) {
4458
+ for (let cnt = 0; cnt < this.value.length && (this._limits == -1 || cnt < this._limits); cnt++) {
4459
+ if (fn(this.value[cnt], cnt) === false) {
4460
+ break;
4461
+ }
4462
+ }
4463
+ return this;
4464
+ }
4465
+ each(fn) {
4466
+ this.onElem(fn);
4467
+ this.reset();
4468
+ }
4469
+ map(fn) {
4470
+ if (!fn) {
4471
+ fn = (inval) => inval;
4472
+ }
4473
+ let res = [];
4474
+ this.each((item) => {
4475
+ res.push(fn(item));
4476
+ });
4477
+ return Stream.ofArr(res);
4478
+ }
4479
+ /*
4480
+ * we need to implement it to fulfill the contract, although it is used only internally
4481
+ * all values are flattened when accessed anyway, so there is no need to call this method
4482
+ */
4483
+ flatMap(fn) {
4484
+ let ret = [];
4485
+ this.each(item => {
4486
+ let strmR = fn(item);
4487
+ ret = Array.isArray(strmR) ? ret.concat(strmR) : ret.concat(strmR.value);
4488
+ });
4489
+ return Stream.ofArr(ret);
4490
+ }
4491
+ filter(fn) {
4492
+ let res = [];
4493
+ this.each((data) => {
4494
+ if (fn(data)) {
4495
+ res.push(data);
4496
+ }
4497
+ });
4498
+ return Stream.ofArr(res);
4499
+ }
4500
+ reduce(fn, startVal = null) {
4501
+ let offset = startVal != null ? 0 : 1;
4502
+ let val1 = startVal != null ? startVal : this.value.length ? this.value[0] : null;
4503
+ for (let cnt = offset; cnt < this.value.length && (this._limits == -1 || cnt < this._limits); cnt++) {
4504
+ val1 = fn(val1, this.value[cnt]);
4505
+ }
4506
+ this.reset();
4507
+ return _Monad__WEBPACK_IMPORTED_MODULE_0__.Optional.fromNullable(val1);
4508
+ }
4509
+ first() {
4510
+ this.reset();
4511
+ return this.value && this.value.length ? _Monad__WEBPACK_IMPORTED_MODULE_0__.Optional.fromNullable(this.value[0]) : _Monad__WEBPACK_IMPORTED_MODULE_0__.Optional.absent;
4512
+ }
4513
+ last() {
4514
+ //could be done via reduce, but is faster this way
4515
+ let length = this._limits > 0 ? Math.min(this._limits, this.value.length) : this.value.length;
4516
+ this.reset();
4517
+ return _Monad__WEBPACK_IMPORTED_MODULE_0__.Optional.fromNullable(length ? this.value[length - 1] : null);
4518
+ }
4519
+ anyMatch(fn) {
4520
+ for (let cnt = 0; cnt < this.value.length && (this._limits == -1 || cnt < this._limits); cnt++) {
4521
+ if (fn(this.value[cnt])) {
4522
+ return true;
4523
+ }
4524
+ }
4525
+ this.reset();
4526
+ return false;
4527
+ }
4528
+ allMatch(fn) {
4529
+ if (!this.value.length) {
4530
+ return false;
4531
+ }
4532
+ let matches = 0;
4533
+ for (let cnt = 0; cnt < this.value.length; cnt++) {
4534
+ if (fn(this.value[cnt])) {
4535
+ matches++;
4536
+ }
4537
+ }
4538
+ this.reset();
4539
+ return matches == this.value.length;
4540
+ }
4541
+ noneMatch(fn) {
4542
+ let matches = 0;
4543
+ for (let cnt = 0; cnt < this.value.length; cnt++) {
4544
+ if (!fn(this.value[cnt])) {
4545
+ matches++;
4546
+ }
4547
+ }
4548
+ this.reset();
4549
+ return matches == this.value.length;
4550
+ }
4551
+ sort(comparator) {
4552
+ let newArr = this.value.slice().sort(comparator);
4553
+ return Stream.ofArr(newArr);
4554
+ }
4555
+ collect(collector) {
4556
+ this.each(data => collector.collect(data));
4557
+ this.reset();
4558
+ return collector.finalValue;
4559
+ }
4560
+ //-- internally exposed methods needed for the interconnectivity
4561
+ hasNext() {
4562
+ let isLimitsReached = this._limits != -1 && this.pos >= this._limits - 1;
4563
+ let isEndOfArray = this.pos >= this.value.length - 1;
4564
+ return !(isLimitsReached || isEndOfArray);
4565
+ }
4566
+ next() {
4567
+ if (!this.hasNext()) {
4568
+ return null;
4569
+ }
4570
+ this.pos++;
4571
+ return this.value[this.pos];
4572
+ }
4573
+ lookAhead(cnt = 1) {
4574
+ if ((this.pos + cnt) >= this.value.length) {
4575
+ return _SourcesCollectors__WEBPACK_IMPORTED_MODULE_1__.ITERATION_STATUS.EO_STRM;
4576
+ }
4577
+ return this.value[this.pos + cnt];
4578
+ }
4579
+ [Symbol.iterator]() {
4580
+ return {
4581
+ next: () => {
4582
+ let done = !this.hasNext();
4583
+ let val = this.next();
4584
+ return {
4585
+ done: done,
4586
+ value: val
4587
+ };
4588
+ }
4589
+ };
4590
+ }
4591
+ /*get observable(): Observable<T> {
4592
+ return from(this);
4593
+ }*/
4594
+ reset() {
4595
+ this.pos = -1;
4596
+ }
4597
+ }
4598
+ /**
4599
+ * Lazy implementation of a Stream
4600
+ * The idea is to connect the intermediate
4601
+ * streams as datasources like a linked list
4602
+ * with reverse referencing and for special
4603
+ * operations like filtering flatmapping
4604
+ * have intermediate datasources in the list
4605
+ * with specialized functions.
4606
+ *
4607
+ * Sort of a modified pipe valve pattern
4608
+ * the streams are the pipes the intermediate
4609
+ * data sources are the valves
4610
+ *
4611
+ * We then can use passed in functions to control
4612
+ * the flow in the valves
4613
+ *
4614
+ * That way we can have a lazy evaluating stream
4615
+ *
4616
+ * So if an endpoint requests data
4617
+ * a callback trace goes back the stream list
4618
+ * which triggers an operation upwards
4619
+ * which sends data down the drain which then is processed
4620
+ * and filtered until one element hits the endpoint.
4621
+ *
4622
+ * That is repeated, until all elements are processed
4623
+ * or an internal limit is hit.
4624
+ *
4625
+ */
4626
+ class LazyStream {
4627
+ static of(...values) {
4628
+ return LazyStream.ofArr(values);
4629
+ }
4630
+ /**
4631
+ * chunk-safe factory, takes the backing array directly instead of
4632
+ * spreading it into the call (LazyStream.of(...largeArray) overflows
4633
+ * the argument stack on large arrays)
4634
+ *
4635
+ * @param data the array to stream over
4636
+ */
4637
+ static ofArr(data) {
4638
+ return new LazyStream(_SourcesCollectors__WEBPACK_IMPORTED_MODULE_1__.ArrayStreamDataSource.ofArray(data));
4639
+ }
4640
+ static ofAssoc(data) {
4641
+ return this.ofArr(Object.keys(data)).map(key => [key, data[key]]);
4642
+ }
4643
+ static ofStreamDataSource(value) {
4644
+ return new LazyStream(value);
4645
+ }
4646
+ static ofDomQuery(value) {
4647
+ return LazyStream.ofArr(value.asArray);
4648
+ }
4649
+ static ofConfig(value) {
4650
+ return LazyStream.ofArr(Object.keys(value.value)).map(key => [key, value.value[key]]);
4651
+ }
4652
+ constructor(parent) {
4653
+ this._limits = -1;
4654
+ /*
4655
+ * needed to have the limits check working
4656
+ * we need to keep track of the current position
4657
+ * in the stream
4658
+ */
4659
+ this.pos = -1;
4660
+ this.dataSource = parent;
4661
+ }
4662
+ hasNext() {
4663
+ if (this.isOverLimits()) {
4664
+ return false;
4665
+ }
4666
+ return this.dataSource.hasNext();
4667
+ }
4668
+ next() {
4669
+ let next = this.dataSource.next();
4670
+ // @ts-ignore
4671
+ this.pos++;
4672
+ return next;
4673
+ }
4674
+ lookAhead(cnt = 1) {
4675
+ return this.dataSource.lookAhead(cnt);
4676
+ }
4677
+ current() {
4678
+ return this.dataSource.current();
4679
+ }
4680
+ reset() {
4681
+ this.dataSource.reset();
4682
+ this.pos = -1;
4683
+ this._limits = -1;
4684
+ }
4685
+ /**
4686
+ * concat for streams, so that you can concat two streams together
4687
+ * @param toAppend
4688
+ */
4689
+ concat(...toAppend) {
4690
+ //this.dataSource = new MultiStreamDatasource<T>(this, ... toAppend);
4691
+ //return this;
4692
+ return LazyStream.ofStreamDataSource(new _SourcesCollectors__WEBPACK_IMPORTED_MODULE_1__.MultiStreamDatasource(this, toAppend));
4693
+ //return LazyStream.of(<IStream<T>>this, ...toAppend).flatMap(item => item);
4694
+ }
4695
+ nextFilter(fn) {
4696
+ if (this.hasNext()) {
4697
+ let newVal = this.next();
4698
+ if (!fn(newVal)) {
4699
+ return this.nextFilter(fn);
4700
+ }
4701
+ return newVal;
4702
+ }
4703
+ return null;
4704
+ }
4705
+ limits(max) {
4706
+ this._limits = max;
4707
+ return this;
4708
+ }
4709
+ //main stream methods
4710
+ collect(collector) {
4711
+ while (this.hasNext()) {
4712
+ let t = this.next();
4713
+ collector.collect(t);
4714
+ }
4715
+ this.reset();
4716
+ return collector.finalValue;
4717
+ }
4718
+ onElem(fn) {
4719
+ return new LazyStream(new _SourcesCollectors__WEBPACK_IMPORTED_MODULE_1__.MappedStreamDataSource((el) => {
4720
+ if (fn(el, this.pos) === false) {
4721
+ this.stop();
4722
+ }
4723
+ return el;
4724
+ }, this));
4725
+ }
4726
+ filter(fn) {
4727
+ return new LazyStream(new _SourcesCollectors__WEBPACK_IMPORTED_MODULE_1__.FilteredStreamDatasource(fn, this));
4728
+ }
4729
+ map(fn) {
4730
+ return new LazyStream(new _SourcesCollectors__WEBPACK_IMPORTED_MODULE_1__.MappedStreamDataSource(fn, this));
4731
+ }
4732
+ flatMap(fn) {
4733
+ return new LazyStream(new FlatMapStreamDataSource(fn, this));
4734
+ }
4735
+ //endpoint
4736
+ each(fn) {
4737
+ while (this.hasNext()) {
4738
+ if (fn(this.next()) === false) {
4739
+ this.stop();
4740
+ }
4741
+ }
4742
+ this.reset();
4743
+ }
4744
+ reduce(fn, startVal = null) {
4745
+ if (!this.hasNext()) {
4746
+ return _Monad__WEBPACK_IMPORTED_MODULE_0__.Optional.absent;
4747
+ }
4748
+ let value1;
4749
+ let value2 = _SourcesCollectors__WEBPACK_IMPORTED_MODULE_1__.ITERATION_STATUS.EO_STRM;
4750
+ if (startVal != null) {
4751
+ value1 = startVal;
4752
+ value2 = this.next();
4753
+ }
4754
+ else {
4755
+ value1 = this.next();
4756
+ if (!this.hasNext()) {
4757
+ return _Monad__WEBPACK_IMPORTED_MODULE_0__.Optional.fromNullable(value1);
4758
+ }
4759
+ value2 = this.next();
4760
+ }
4761
+ value1 = fn(value1, value2);
4762
+ while (this.hasNext()) {
4763
+ value2 = this.next();
4764
+ value1 = fn(value1, value2);
4765
+ }
4766
+ this.reset();
4767
+ return _Monad__WEBPACK_IMPORTED_MODULE_0__.Optional.fromNullable(value1);
4768
+ }
4769
+ last() {
4770
+ if (!this.hasNext()) {
4771
+ return _Monad__WEBPACK_IMPORTED_MODULE_0__.Optional.absent;
4772
+ }
4773
+ return this.reduce((el1, el2) => el2);
4774
+ }
4775
+ first() {
4776
+ this.reset();
4777
+ if (!this.hasNext()) {
4778
+ return _Monad__WEBPACK_IMPORTED_MODULE_0__.Optional.absent;
4779
+ }
4780
+ return _Monad__WEBPACK_IMPORTED_MODULE_0__.Optional.fromNullable(this.next());
4781
+ }
4782
+ anyMatch(fn) {
4783
+ while (this.hasNext()) {
4784
+ if (fn(this.next())) {
4785
+ return true;
4786
+ }
4787
+ }
4788
+ return false;
4789
+ }
4790
+ allMatch(fn) {
4791
+ while (this.hasNext()) {
4792
+ if (!fn(this.next())) {
4793
+ return false;
4794
+ }
4795
+ }
4796
+ return true;
4797
+ }
4798
+ noneMatch(fn) {
4799
+ while (this.hasNext()) {
4800
+ if (fn(this.next())) {
4801
+ return false;
4802
+ }
4803
+ }
4804
+ return true;
4805
+ }
4806
+ sort(comparator) {
4807
+ let arr = this.collect(new _SourcesCollectors__WEBPACK_IMPORTED_MODULE_1__.ArrayCollector());
4808
+ arr = arr.sort(comparator);
4809
+ return LazyStream.ofArr(arr);
4810
+ }
4811
+ get value() {
4812
+ return this.collect(new _SourcesCollectors__WEBPACK_IMPORTED_MODULE_1__.ArrayCollector());
4813
+ }
4814
+ [Symbol.iterator]() {
4815
+ return {
4816
+ next: () => {
4817
+ let done = !this.hasNext();
4818
+ let val = this.next();
4819
+ return {
4820
+ done: done,
4821
+ value: val
4822
+ };
4823
+ }
4824
+ };
4825
+ }
4826
+ /*get observable(): Observable<T> {
4827
+ return from(this);
4828
+ }*/
4829
+ stop() {
4830
+ this.pos = this._limits + 1000000000;
4831
+ this._limits = 0;
4832
+ }
4833
+ isOverLimits() {
4834
+ return this._limits != -1 && this.pos >= this._limits - 1;
4835
+ }
4836
+ }
4837
+ /**
4838
+ * 1.0 backwards compatibility functions
4839
+ *
4840
+ * this restores the stream and lazy stream
4841
+ * property on DomQuery on prototype level
4842
+ *
4843
+ */
4844
+ Object.defineProperty(_DomQuery__WEBPACK_IMPORTED_MODULE_2__.DomQuery.prototype, "stream", {
4845
+ get: function stream() {
4846
+ return Stream.ofDomQuery(this);
4847
+ }
4848
+ });
4849
+ Object.defineProperty(_DomQuery__WEBPACK_IMPORTED_MODULE_2__.DomQuery.prototype, "lazyStream", {
4850
+ get: function lazyStream() {
4851
+ return LazyStream.ofDomQuery(this);
4852
+ }
4853
+ });
4854
+
4855
+
4856
+ /***/ },
4857
+
4858
+ /***/ "./node_modules/mona-dish/src/main/typescript/TagBuilder.ts"
4859
+ /*!******************************************************************!*\
4860
+ !*** ./node_modules/mona-dish/src/main/typescript/TagBuilder.ts ***!
4861
+ \******************************************************************/
4862
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
4863
+
4864
+ __webpack_require__.r(__webpack_exports__);
4865
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4866
+ /* harmony export */ TagBuilder: () => (/* binding */ TagBuilder)
4867
+ /* harmony export */ });
4868
+ /* harmony import */ var _DomQuery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DomQuery */ "./node_modules/mona-dish/src/main/typescript/DomQuery.ts");
4869
+ /* harmony import */ var _Global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Global */ "./node_modules/mona-dish/src/main/typescript/Global.ts");
4870
+ /*!
4871
+ * Licensed to the Apache Software Foundation (ASF) under one or more
4872
+ * contributor license agreements. See the NOTICE file distributed with
4873
+ * this work for additional information regarding copyright ownership.
4874
+ * The ASF licenses this file to you under the Apache License, Version 2.0
4875
+ * (the "License"); you may not use this file except in compliance with
4876
+ * the License. You may obtain a copy of the License at
4877
+ *
4878
+ * http://www.apache.org/licenses/LICENSE-2.0
4879
+ *
4880
+ * Unless required by applicable law or agreed to in writing, software
4881
+ * distributed under the License is distributed on an "AS IS" BASIS,
4882
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4883
+ * See the License for the specific language governing permissions and
4884
+ * limitations under the License.
4885
+ */
4886
+ //poliyfill from @webcomponents/webcomponentsjs
4887
+
4888
+
4889
+ if ("undefined" != typeof _Global__WEBPACK_IMPORTED_MODULE_1__._global$) {
4890
+ (function () {
4891
+ if (void 0 === (0,_Global__WEBPACK_IMPORTED_MODULE_1__._global$)().Reflect || void 0 === (0,_Global__WEBPACK_IMPORTED_MODULE_1__._global$)().customElements || ((0,_Global__WEBPACK_IMPORTED_MODULE_1__._global$)().customElements).polyfillWrapFlushCallback)
4892
+ return;
4893
+ const a = HTMLElement;
4894
+ (0,_Global__WEBPACK_IMPORTED_MODULE_1__._global$)().HTMLElement = {
4895
+ HTMLElement: function HTMLElement() {
4896
+ return Reflect.construct(a, [], this.constructor);
4897
+ }
4898
+ }.HTMLElement, HTMLElement.prototype = a.prototype, HTMLElement.prototype.constructor = HTMLElement, Object.setPrototypeOf(HTMLElement, a);
4899
+ })();
4900
+ }
4901
+ /**
4902
+ * beginning custom tag support
4903
+ *
4904
+ * This api is still experimental
4905
+ * and might be interwoven with DomQuery
4906
+ * so it is bound to change
4907
+ *
4908
+ * it follows a builder pattern to allow easier creations
4909
+ * with less code of custom tags
4910
+ */
4911
+ class TagBuilder {
4912
+ // noinspection JSUnusedGlobalSymbols
4913
+ static withTagName(tagName) {
4914
+ return new TagBuilder(tagName);
4915
+ }
4916
+ // noinspection JSUnusedGlobalSymbols
4917
+ constructor(tagName) {
4918
+ this.extendsType = HTMLElement;
4919
+ this.observedAttrs = [];
4920
+ this.tagName = tagName;
4921
+ }
4922
+ // noinspection JSUnusedGlobalSymbols
4923
+ withObservedAttributes(...oAttrs) {
4924
+ this.observedAttrs = oAttrs;
4925
+ }
4926
+ // noinspection JSUnusedGlobalSymbols
4927
+ withConnectedCallback(callback) {
4928
+ this.connectedCallback = callback;
4929
+ return this;
4930
+ }
4931
+ // noinspection JSUnusedGlobalSymbols
4932
+ withDisconnectedCallback(callback) {
4933
+ this.disconnectedCallback = callback;
4934
+ return this;
4935
+ }
4936
+ // noinspection JSUnusedGlobalSymbols
4937
+ withAdoptedCallback(callback) {
4938
+ this.adoptedCallback = callback;
4939
+ return this;
4940
+ }
4941
+ // noinspection JSUnusedGlobalSymbols
4942
+ withAttributeChangedCallback(callback) {
4943
+ this.attributeChangedCallback = callback;
4944
+ return this;
4945
+ }
4946
+ // noinspection JSUnusedGlobalSymbols
4947
+ withExtendsType(extendsType) {
4948
+ this.extendsType = extendsType;
4949
+ return this;
4950
+ }
4951
+ // noinspection JSUnusedGlobalSymbols
4952
+ withOptions(theOptions) {
4953
+ this.theOptions = theOptions;
4954
+ return this;
3793
4955
  }
3794
- get finalValue() {
3795
- return this.data;
4956
+ // noinspection JSUnusedGlobalSymbols
4957
+ withClass(clazz) {
4958
+ if (this.markup) {
4959
+ throw Error("Markup already defined, markup must be set in the class");
4960
+ }
4961
+ this.clazz = clazz;
4962
+ return this;
4963
+ }
4964
+ // noinspection JSUnusedGlobalSymbols
4965
+ withMarkup(markup) {
4966
+ if (this.clazz) {
4967
+ throw Error("Class already defined, markup must be set in the class");
4968
+ }
4969
+ this.markup = markup;
4970
+ return this;
4971
+ }
4972
+ // noinspection JSUnusedGlobalSymbols
4973
+ register() {
4974
+ if (!this.clazz && !this.markup) {
4975
+ throw Error("Class or markup must be defined");
4976
+ }
4977
+ if (this.clazz) {
4978
+ let applyCallback = (name) => {
4979
+ let outerCallback = this[name];
4980
+ let protoCallback = this.clazz.prototype[name];
4981
+ let finalCallback = outerCallback || protoCallback;
4982
+ if (finalCallback) {
4983
+ this.clazz.prototype[name] = function () {
4984
+ if (outerCallback) {
4985
+ finalCallback.apply(_DomQuery__WEBPACK_IMPORTED_MODULE_0__.DomQuery.byId(this));
4986
+ }
4987
+ else {
4988
+ protoCallback.apply(this);
4989
+ }
4990
+ };
4991
+ }
4992
+ };
4993
+ applyCallback("connectedCallback");
4994
+ applyCallback("disconnectedCallback");
4995
+ applyCallback("adoptedCallback");
4996
+ applyCallback("attributeChangedCallback");
4997
+ //TODO how do we handle the oAttrs?
4998
+ if (this.observedAttrs.length) {
4999
+ Object.defineProperty(this.clazz.prototype, "observedAttributes", {
5000
+ get() {
5001
+ return this.observedAttrs;
5002
+ }
5003
+ });
5004
+ }
5005
+ (0,_Global__WEBPACK_IMPORTED_MODULE_1__._global$)().customElements.define(this.tagName, this.clazz, this.theOptions || null);
5006
+ }
5007
+ else {
5008
+ let _t_ = this;
5009
+ let applyCallback = (name, scope) => {
5010
+ if (_t_[name]) {
5011
+ _t_[name].apply(_DomQuery__WEBPACK_IMPORTED_MODULE_0__.DomQuery.byId(scope));
5012
+ }
5013
+ };
5014
+ (0,_Global__WEBPACK_IMPORTED_MODULE_1__._global$)().customElements.define(this.tagName, class extends this.extendsType {
5015
+ constructor() {
5016
+ super();
5017
+ this.innerHTML = _t_.markup;
5018
+ }
5019
+ // noinspection JSUnusedGlobalSymbols
5020
+ static get observedAttributes() {
5021
+ return _t_.observedAttrs;
5022
+ }
5023
+ // noinspection JSUnusedGlobalSymbols
5024
+ connectedCallback() {
5025
+ applyCallback("connectedCallback", this);
5026
+ }
5027
+ // noinspection JSUnusedGlobalSymbols
5028
+ disconnectedCallback() {
5029
+ applyCallback("disconnectedCallback", this);
5030
+ }
5031
+ // noinspection JSUnusedGlobalSymbols
5032
+ adoptedCallback() {
5033
+ applyCallback("adoptedCallback", this);
5034
+ }
5035
+ // noinspection JSUnusedGlobalSymbols
5036
+ attributeChangedCallback() {
5037
+ applyCallback("attributeChangedCallback", this);
5038
+ }
5039
+ }, this.theOptions || null);
5040
+ }
3796
5041
  }
3797
5042
  }
3798
5043
 
@@ -3904,36 +5149,57 @@ const XQ = XMLQuery;
3904
5149
 
3905
5150
  __webpack_require__.r(__webpack_exports__);
3906
5151
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3907
- /* harmony export */ Assoc: () => (/* reexport module object */ _AssocArray__WEBPACK_IMPORTED_MODULE_4__),
3908
- /* harmony export */ CONFIG_ANY: () => (/* reexport safe */ _Config__WEBPACK_IMPORTED_MODULE_5__.CONFIG_ANY),
3909
- /* harmony export */ CONFIG_VALUE: () => (/* reexport safe */ _Config__WEBPACK_IMPORTED_MODULE_5__.CONFIG_VALUE),
3910
- /* harmony export */ Config: () => (/* reexport safe */ _Config__WEBPACK_IMPORTED_MODULE_5__.Config),
5152
+ /* harmony export */ ArrayCollector: () => (/* reexport safe */ _SourcesCollectors__WEBPACK_IMPORTED_MODULE_6__.ArrayCollector),
5153
+ /* harmony export */ ArrayStreamDataSource: () => (/* reexport safe */ _SourcesCollectors__WEBPACK_IMPORTED_MODULE_6__.ArrayStreamDataSource),
5154
+ /* harmony export */ Assoc: () => (/* reexport module object */ _AssocArray__WEBPACK_IMPORTED_MODULE_7__),
5155
+ /* harmony export */ AssocArrayCollector: () => (/* reexport safe */ _SourcesCollectors__WEBPACK_IMPORTED_MODULE_6__.AssocArrayCollector),
5156
+ /* harmony export */ CONFIG_ANY: () => (/* reexport safe */ _Config__WEBPACK_IMPORTED_MODULE_8__.CONFIG_ANY),
5157
+ /* harmony export */ CONFIG_VALUE: () => (/* reexport safe */ _Config__WEBPACK_IMPORTED_MODULE_8__.CONFIG_VALUE),
5158
+ /* harmony export */ CancellablePromise: () => (/* reexport safe */ _Promise__WEBPACK_IMPORTED_MODULE_3__.CancellablePromise),
5159
+ /* harmony export */ Config: () => (/* reexport safe */ _Config__WEBPACK_IMPORTED_MODULE_8__.Config),
5160
+ /* harmony export */ ConfigCollector: () => (/* reexport safe */ _SourcesCollectors__WEBPACK_IMPORTED_MODULE_6__.ConfigCollector),
3911
5161
  /* harmony export */ DQ: () => (/* reexport safe */ _DomQuery__WEBPACK_IMPORTED_MODULE_0__.DQ),
3912
5162
  /* harmony export */ DQ$: () => (/* reexport safe */ _DomQuery__WEBPACK_IMPORTED_MODULE_0__.DQ$),
3913
5163
  /* harmony export */ DomQuery: () => (/* reexport safe */ _DomQuery__WEBPACK_IMPORTED_MODULE_0__.DomQuery),
3914
5164
  /* harmony export */ DomQueryCollector: () => (/* reexport safe */ _DomQuery__WEBPACK_IMPORTED_MODULE_0__.DomQueryCollector),
3915
5165
  /* harmony export */ ElementAttribute: () => (/* reexport safe */ _DomQuery__WEBPACK_IMPORTED_MODULE_0__.ElementAttribute),
3916
- /* harmony export */ Es2019Array: () => (/* reexport safe */ _Es2019Array__WEBPACK_IMPORTED_MODULE_6__.Es2019Array),
5166
+ /* harmony export */ Es2019Array: () => (/* reexport safe */ _Es2019Array__WEBPACK_IMPORTED_MODULE_9__.Es2019Array),
5167
+ /* harmony export */ FilteredStreamDatasource: () => (/* reexport safe */ _SourcesCollectors__WEBPACK_IMPORTED_MODULE_6__.FilteredStreamDatasource),
5168
+ /* harmony export */ FlatMapStreamDataSource: () => (/* reexport safe */ _Stream__WEBPACK_IMPORTED_MODULE_5__.FlatMapStreamDataSource),
5169
+ /* harmony export */ FormDataCollector: () => (/* reexport safe */ _SourcesCollectors__WEBPACK_IMPORTED_MODULE_6__.FormDataCollector),
3917
5170
  /* harmony export */ Lang: () => (/* reexport safe */ _Lang__WEBPACK_IMPORTED_MODULE_1__.Lang),
5171
+ /* harmony export */ LazyStream: () => (/* reexport safe */ _Stream__WEBPACK_IMPORTED_MODULE_5__.LazyStream),
5172
+ /* harmony export */ MappedStreamDataSource: () => (/* reexport safe */ _SourcesCollectors__WEBPACK_IMPORTED_MODULE_6__.MappedStreamDataSource),
3918
5173
  /* harmony export */ Monad: () => (/* reexport safe */ _Monad__WEBPACK_IMPORTED_MODULE_2__.Monad),
5174
+ /* harmony export */ MultiStreamDatasource: () => (/* reexport safe */ _SourcesCollectors__WEBPACK_IMPORTED_MODULE_6__.MultiStreamDatasource),
3919
5175
  /* harmony export */ Optional: () => (/* reexport safe */ _Monad__WEBPACK_IMPORTED_MODULE_2__.Optional),
5176
+ /* harmony export */ PromiseStatus: () => (/* reexport safe */ _Promise__WEBPACK_IMPORTED_MODULE_3__.PromiseStatus),
5177
+ /* harmony export */ QueryFormDataCollector: () => (/* reexport safe */ _SourcesCollectors__WEBPACK_IMPORTED_MODULE_6__.QueryFormDataCollector),
5178
+ /* harmony export */ QueryFormStringCollector: () => (/* reexport safe */ _SourcesCollectors__WEBPACK_IMPORTED_MODULE_6__.QueryFormStringCollector),
5179
+ /* harmony export */ SequenceDataSource: () => (/* reexport safe */ _SourcesCollectors__WEBPACK_IMPORTED_MODULE_6__.SequenceDataSource),
5180
+ /* harmony export */ Stream: () => (/* reexport safe */ _Stream__WEBPACK_IMPORTED_MODULE_5__.Stream),
5181
+ /* harmony export */ TagBuilder: () => (/* reexport safe */ _TagBuilder__WEBPACK_IMPORTED_MODULE_10__.TagBuilder),
3920
5182
  /* harmony export */ ValueEmbedder: () => (/* reexport safe */ _Monad__WEBPACK_IMPORTED_MODULE_2__.ValueEmbedder),
3921
- /* harmony export */ XMLQuery: () => (/* reexport safe */ _XmlQuery__WEBPACK_IMPORTED_MODULE_3__.XMLQuery),
3922
- /* harmony export */ XQ: () => (/* reexport safe */ _XmlQuery__WEBPACK_IMPORTED_MODULE_3__.XQ),
3923
- /* harmony export */ _Es2019Array: () => (/* reexport safe */ _Es2019Array__WEBPACK_IMPORTED_MODULE_6__._Es2019Array),
3924
- /* harmony export */ append: () => (/* reexport safe */ _AssocArray__WEBPACK_IMPORTED_MODULE_4__.append),
3925
- /* harmony export */ assign: () => (/* reexport safe */ _AssocArray__WEBPACK_IMPORTED_MODULE_4__.assign),
3926
- /* harmony export */ assignIf: () => (/* reexport safe */ _AssocArray__WEBPACK_IMPORTED_MODULE_4__.assignIf),
3927
- /* harmony export */ shallowMerge: () => (/* reexport safe */ _AssocArray__WEBPACK_IMPORTED_MODULE_4__.shallowMerge),
3928
- /* harmony export */ simpleShallowMerge: () => (/* reexport safe */ _AssocArray__WEBPACK_IMPORTED_MODULE_4__.simpleShallowMerge)
5183
+ /* harmony export */ XMLQuery: () => (/* reexport safe */ _XmlQuery__WEBPACK_IMPORTED_MODULE_4__.XMLQuery),
5184
+ /* harmony export */ XQ: () => (/* reexport safe */ _XmlQuery__WEBPACK_IMPORTED_MODULE_4__.XQ),
5185
+ /* harmony export */ _Es2019Array: () => (/* reexport safe */ _Es2019Array__WEBPACK_IMPORTED_MODULE_9__._Es2019Array),
5186
+ /* harmony export */ append: () => (/* reexport safe */ _AssocArray__WEBPACK_IMPORTED_MODULE_7__.append),
5187
+ /* harmony export */ assign: () => (/* reexport safe */ _AssocArray__WEBPACK_IMPORTED_MODULE_7__.assign),
5188
+ /* harmony export */ assignIf: () => (/* reexport safe */ _AssocArray__WEBPACK_IMPORTED_MODULE_7__.assignIf),
5189
+ /* harmony export */ shallowMerge: () => (/* reexport safe */ _AssocArray__WEBPACK_IMPORTED_MODULE_7__.shallowMerge),
5190
+ /* harmony export */ simpleShallowMerge: () => (/* reexport safe */ _AssocArray__WEBPACK_IMPORTED_MODULE_7__.simpleShallowMerge)
3929
5191
  /* harmony export */ });
3930
5192
  /* harmony import */ var _DomQuery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DomQuery */ "./node_modules/mona-dish/src/main/typescript/DomQuery.ts");
3931
5193
  /* harmony import */ var _Lang__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Lang */ "./node_modules/mona-dish/src/main/typescript/Lang.ts");
3932
5194
  /* harmony import */ var _Monad__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Monad */ "./node_modules/mona-dish/src/main/typescript/Monad.ts");
3933
- /* harmony import */ var _XmlQuery__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./XmlQuery */ "./node_modules/mona-dish/src/main/typescript/XmlQuery.ts");
3934
- /* harmony import */ var _AssocArray__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./AssocArray */ "./node_modules/mona-dish/src/main/typescript/AssocArray.ts");
3935
- /* harmony import */ var _Config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Config */ "./node_modules/mona-dish/src/main/typescript/Config.ts");
3936
- /* harmony import */ var _Es2019Array__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Es2019Array */ "./node_modules/mona-dish/src/main/typescript/Es2019Array.ts");
5195
+ /* harmony import */ var _Promise__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Promise */ "./node_modules/mona-dish/src/main/typescript/Promise.ts");
5196
+ /* harmony import */ var _XmlQuery__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./XmlQuery */ "./node_modules/mona-dish/src/main/typescript/XmlQuery.ts");
5197
+ /* harmony import */ var _Stream__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Stream */ "./node_modules/mona-dish/src/main/typescript/Stream.ts");
5198
+ /* harmony import */ var _SourcesCollectors__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./SourcesCollectors */ "./node_modules/mona-dish/src/main/typescript/SourcesCollectors.ts");
5199
+ /* harmony import */ var _AssocArray__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./AssocArray */ "./node_modules/mona-dish/src/main/typescript/AssocArray.ts");
5200
+ /* harmony import */ var _Config__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Config */ "./node_modules/mona-dish/src/main/typescript/Config.ts");
5201
+ /* harmony import */ var _Es2019Array__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Es2019Array */ "./node_modules/mona-dish/src/main/typescript/Es2019Array.ts");
5202
+ /* harmony import */ var _TagBuilder__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./TagBuilder */ "./node_modules/mona-dish/src/main/typescript/TagBuilder.ts");
3937
5203
  /*!
3938
5204
  * Licensed to the Apache Software Foundation (ASF) under one
3939
5205
  * or more contributor license agreements. See the NOTICE file
@@ -3964,6 +5230,10 @@ __webpack_require__.r(__webpack_exports__);
3964
5230
 
3965
5231
 
3966
5232
 
5233
+
5234
+
5235
+
5236
+
3967
5237
  /***/ },
3968
5238
 
3969
5239
  /***/ "./src/main/typescript/api/_api.ts"
@@ -4159,7 +5429,7 @@ var faces;
4159
5429
  * @returns true if the chain has succeeded false otherwise
4160
5430
  */
4161
5431
  function chain(source, event, ...funcs) {
4162
- return _impl_AjaxImpl__WEBPACK_IMPORTED_MODULE_0__.Implementation.chain(source, event, ...funcs);
5432
+ return _impl_AjaxImpl__WEBPACK_IMPORTED_MODULE_0__.Implementation.chain(source, event !== null && event !== void 0 ? event : null, ...funcs);
4163
5433
  }
4164
5434
  util.chain = chain;
4165
5435
  })(util = faces.util || (faces.util = {}));
@@ -4687,7 +5957,7 @@ var Implementation;
4687
5957
  }
4688
5958
  finally {
4689
5959
  if (clearRequestQueue) {
4690
- Implementation.requestQueue.clear();
5960
+ Implementation.requestQueue === null || Implementation.requestQueue === void 0 ? void 0 : Implementation.requestQueue.clear();
4691
5961
  }
4692
5962
  }
4693
5963
  }
@@ -4927,7 +6197,7 @@ var Implementation;
4927
6197
  * apparently the RI does not, so we have to follow the RI behavior here)
4928
6198
  * @param componentIdToTransform the componentId which needs post-processing
4929
6199
  */
4930
- const remapNamingContainer = componentIdToTransform => {
6200
+ const remapNamingContainer = (componentIdToTransform) => {
4931
6201
  // pattern :<anything> must be prepended by viewRoot if there is one,
4932
6202
  // otherwise we are in a not namespaced then only the id has to match
4933
6203
  const rootNamingContainerPrefix = (rootNamingContainerId.length) ? rootNamingContainerId + SEP : _core_Const__WEBPACK_IMPORTED_MODULE_7__.EMPTY_STR;
@@ -5013,7 +6283,7 @@ var Implementation;
5013
6283
  //we now can use the full code reduction given by our stream api
5014
6284
  //to filter
5015
6285
  return ofAssoc(mappedOpts)
5016
- .filter((item => !(item[0] in BlockFilter)))
6286
+ .filter(((item) => !(item[0] in BlockFilter)))
5017
6287
  .reduce(collectAssoc, {});
5018
6288
  }
5019
6289
  /**
@@ -5028,7 +6298,7 @@ var Implementation;
5028
6298
  //we now can use the full code reduction given by our stream api
5029
6299
  //to filter
5030
6300
  return (_a = ofAssoc(mappedOpts)
5031
- .filter((item => (item[0] == "myfaces")))
6301
+ .filter(((item) => (item[0] == "myfaces")))
5032
6302
  .reduce(collectAssoc, {})) === null || _a === void 0 ? void 0 : _a[_core_Const__WEBPACK_IMPORTED_MODULE_7__.MYFACES];
5033
6303
  }
5034
6304
  function remapArrayToAssocArr(arrayedParams) {
@@ -5110,16 +6380,21 @@ var PushImpl;
5110
6380
  // @deprecated because we can assume at least for the newer versions
5111
6381
  // that the protocol is properly set!
5112
6382
  const URL_PROTOCOL = mona_dish__WEBPACK_IMPORTED_MODULE_1__.DQ.global().location.protocol.replace("http", "ws") + "//";
5113
- // we expose the member variables for testing purposes
5114
- // they are not directly touched outside of tests
5115
- /* socket map by token */
6383
+ /** @internal */
5116
6384
  PushImpl.sockets = {};
5117
6385
  /* component attributes by clientId */
6386
+ /** @internal */
5118
6387
  PushImpl.components = {};
5119
6388
  /* client ids by token (share websocket connection) */
6389
+ /** @internal */
5120
6390
  PushImpl.clientIdsByTokens = {};
5121
6391
  // needed for testing
6392
+ /** @internal */
5122
6393
  function reset() {
6394
+ Object.values(PushImpl.sockets).forEach(s => { try {
6395
+ s.close();
6396
+ }
6397
+ catch (e) { /* ignore */ } });
5123
6398
  PushImpl.sockets = {};
5124
6399
  PushImpl.components = {};
5125
6400
  PushImpl.clientIdsByTokens = {};
@@ -5195,55 +6470,36 @@ var PushImpl;
5195
6470
  this.channelToken = channelToken;
5196
6471
  this.url = url;
5197
6472
  this.channel = channel;
6473
+ this.socket = null;
5198
6474
  this.reconnectAttempts = 0;
6475
+ this.hasEverConnected = false;
6476
+ this.hasNotifiedInitialOpenAttempt = false;
5199
6477
  }
5200
6478
  open() {
5201
- if (this.socket && this.socket.readyState == 1) {
6479
+ if (this.socket && this.socket.readyState === 1) {
5202
6480
  return;
5203
6481
  }
5204
6482
  this.socket = new WebSocket(this.url);
5205
6483
  this.bindCallbacks();
6484
+ this.notifyInitialOpenAttempt();
5206
6485
  }
5207
6486
  // noinspection JSUnusedLocalSymbols
5208
6487
  onopen(event) {
5209
- var _a, _b;
5210
- if (!this.reconnectAttempts) {
5211
- let clientIds = PushImpl.clientIdsByTokens[this.channelToken];
5212
- for (let i = clientIds.length - 1; i >= 0; i--) {
5213
- let socketClientId = clientIds[i];
5214
- (_b = (_a = PushImpl.components[socketClientId]) === null || _a === void 0 ? void 0 : _a['onopen']) === null || _b === void 0 ? void 0 : _b.call(_a, this.channel);
5215
- }
5216
- }
6488
+ this.hasEverConnected = true;
5217
6489
  this.reconnectAttempts = 0;
5218
6490
  }
5219
6491
  onerror(event) {
5220
- var _a, _b, _c;
5221
- let message = JSON.parse((_a = event === null || event === void 0 ? void 0 : event.data) !== null && _a !== void 0 ? _a : null);
5222
- //TODO replace this with a more readable Stream code
5223
- for (let i = PushImpl.clientIdsByTokens[this.channelToken].length - 1; i >= 0; i--) {
5224
- let socketClientId = PushImpl.clientIdsByTokens[this.channelToken][i];
5225
- if (document.getElementById(socketClientId)) {
5226
- try {
5227
- (_c = (_b = PushImpl.components[socketClientId]) === null || _b === void 0 ? void 0 : _b['onerror']) === null || _c === void 0 ? void 0 : _c.call(_b, message, this.channel, event);
5228
- }
5229
- catch (e) {
5230
- //Ignore
5231
- }
5232
- }
5233
- else {
5234
- PushImpl.clientIdsByTokens[this.channelToken].splice(i, 1);
5235
- }
5236
- }
5237
- if (PushImpl.clientIdsByTokens[this.channelToken].length == 0) {
5238
- // tag disappeared
5239
- this.close();
5240
- }
6492
+ // Native WebSocket error events do not expose the close reason code.
6493
+ // Faces onerror is fired from onclose only when a reconnect is attempted.
5241
6494
  }
5242
- onmmessage(event) {
6495
+ onmessage(event) {
5243
6496
  var _a, _b, _c;
5244
6497
  let message = JSON.parse(event.data);
5245
- for (let i = PushImpl.clientIdsByTokens[this.channelToken].length - 1; i >= 0; i--) {
5246
- let socketClientId = PushImpl.clientIdsByTokens[this.channelToken][i];
6498
+ let clientIds = PushImpl.clientIdsByTokens[this.channelToken];
6499
+ if (!clientIds)
6500
+ return; // socket was torn down (reset()) while message was pending
6501
+ for (let i = clientIds.length - 1; i >= 0; i--) {
6502
+ let socketClientId = clientIds[i];
5247
6503
  if (document.getElementById(socketClientId)) {
5248
6504
  try {
5249
6505
  (_b = (_a = PushImpl.components[socketClientId]) === null || _a === void 0 ? void 0 : _a['onmessage']) === null || _b === void 0 ? void 0 : _b.call(_a, message, this.channel, event);
@@ -5265,30 +6521,25 @@ var PushImpl;
5265
6521
  }
5266
6522
  }
5267
6523
  else {
5268
- PushImpl.clientIdsByTokens[this.channelToken].splice(i, 1);
6524
+ clientIds.splice(i, 1);
5269
6525
  }
5270
6526
  }
5271
- if (PushImpl.clientIdsByTokens[this.channelToken].length == 0) {
6527
+ if (clientIds.length === 0) {
5272
6528
  // tag disappeared
5273
6529
  this.close();
5274
6530
  }
5275
6531
  }
5276
6532
  onclose(event) {
5277
- var _a, _b;
5278
- if (!this.socket
5279
- || (event.code == 1000 && event.reason == _core_Const__WEBPACK_IMPORTED_MODULE_0__.REASON_EXPIRED)
5280
- || (event.code == 1008)
5281
- || (!this.reconnectAttempts)
5282
- || (this.reconnectAttempts >= _core_Const__WEBPACK_IMPORTED_MODULE_0__.MAX_RECONNECT_ATTEMPTS)) {
5283
- let clientIds = PushImpl.clientIdsByTokens[this.channelToken];
5284
- for (let i = clientIds.length - 1; i >= 0; i--) {
5285
- let socketClientId = clientIds[i];
5286
- (_b = (_a = PushImpl.components === null || PushImpl.components === void 0 ? void 0 : PushImpl.components[socketClientId]) === null || _a === void 0 ? void 0 : _a['onclose']) === null || _b === void 0 ? void 0 : _b.call(_a, event === null || event === void 0 ? void 0 : event.code, this === null || this === void 0 ? void 0 : this.channel, event);
5287
- }
5288
- }
5289
- else {
5290
- setTimeout(this.open, _core_Const__WEBPACK_IMPORTED_MODULE_0__.RECONNECT_INTERVAL * this.reconnectAttempts++);
6533
+ if (this.isTerminalClose(event)) {
6534
+ this.notifyClose(event);
6535
+ this.resetConnectionState();
6536
+ return;
5291
6537
  }
6538
+ if (!this.notifyErrorAndPruneMissingComponents(event))
6539
+ return;
6540
+ if (this.closeIfChannelHasNoComponents())
6541
+ return;
6542
+ this.scheduleReconnect();
5292
6543
  }
5293
6544
  ;
5294
6545
  close() {
@@ -5298,12 +6549,85 @@ var PushImpl;
5298
6549
  s.close();
5299
6550
  }
5300
6551
  }
6552
+ notifyInitialOpenAttempt() {
6553
+ var _a, _b;
6554
+ if (this.reconnectAttempts || this.hasNotifiedInitialOpenAttempt)
6555
+ return;
6556
+ this.hasNotifiedInitialOpenAttempt = true;
6557
+ let clientIds = PushImpl.clientIdsByTokens[this.channelToken];
6558
+ if (!clientIds)
6559
+ return; // socket was torn down (reset()) while timer was pending
6560
+ for (let i = clientIds.length - 1; i >= 0; i--) {
6561
+ let socketClientId = clientIds[i];
6562
+ (_b = (_a = PushImpl.components[socketClientId]) === null || _a === void 0 ? void 0 : _a['onopen']) === null || _b === void 0 ? void 0 : _b.call(_a, this.channel);
6563
+ }
6564
+ }
6565
+ isTerminalClose(event) {
6566
+ return !this.socket
6567
+ // Spec: no reconnect when the very first connection attempt fails.
6568
+ // onerror must also not be invoked in this case, only onclose.
6569
+ || !this.hasEverConnected
6570
+ // Spec: code 1000 (normal closure) is always terminal, regardless of reason.
6571
+ || event.code === 1000
6572
+ // 1008 = Policy Violation. Reconnecting would hit the same rejection again.
6573
+ || event.code === 1008
6574
+ || this.reconnectAttempts >= _core_Const__WEBPACK_IMPORTED_MODULE_0__.MAX_RECONNECT_ATTEMPTS;
6575
+ }
6576
+ notifyClose(event) {
6577
+ var _a, _b;
6578
+ let clientIds = PushImpl.clientIdsByTokens[this.channelToken];
6579
+ if (!clientIds)
6580
+ return; // already torn down (reset() called while socket was open)
6581
+ for (let i = clientIds.length - 1; i >= 0; i--) {
6582
+ let socketClientId = clientIds[i];
6583
+ (_b = (_a = PushImpl.components === null || PushImpl.components === void 0 ? void 0 : PushImpl.components[socketClientId]) === null || _a === void 0 ? void 0 : _a['onclose']) === null || _b === void 0 ? void 0 : _b.call(_a, event === null || event === void 0 ? void 0 : event.code, this === null || this === void 0 ? void 0 : this.channel, event);
6584
+ }
6585
+ }
6586
+ resetConnectionState() {
6587
+ this.reconnectAttempts = 0;
6588
+ this.hasEverConnected = false;
6589
+ this.hasNotifiedInitialOpenAttempt = false;
6590
+ }
6591
+ notifyErrorAndPruneMissingComponents(event) {
6592
+ var _a, _b;
6593
+ let clientIds = PushImpl.clientIdsByTokens[this.channelToken];
6594
+ if (!clientIds)
6595
+ return false; // already torn down (reset() called while socket was open)
6596
+ for (let i = clientIds.length - 1; i >= 0; i--) {
6597
+ let socketClientId = clientIds[i];
6598
+ if (document.getElementById(socketClientId)) {
6599
+ try {
6600
+ (_b = (_a = PushImpl.components === null || PushImpl.components === void 0 ? void 0 : PushImpl.components[socketClientId]) === null || _a === void 0 ? void 0 : _a['onerror']) === null || _b === void 0 ? void 0 : _b.call(_a, event === null || event === void 0 ? void 0 : event.code, this === null || this === void 0 ? void 0 : this.channel, event);
6601
+ }
6602
+ catch (e) {
6603
+ //Ignore
6604
+ }
6605
+ }
6606
+ else {
6607
+ clientIds.splice(i, 1);
6608
+ }
6609
+ }
6610
+ return true;
6611
+ }
6612
+ closeIfChannelHasNoComponents() {
6613
+ var _a;
6614
+ if (((_a = PushImpl.clientIdsByTokens[this.channelToken]) === null || _a === void 0 ? void 0 : _a.length) !== 0)
6615
+ return false;
6616
+ // tag disappeared
6617
+ this.close();
6618
+ return true;
6619
+ }
6620
+ scheduleReconnect() {
6621
+ const reconnectAttempt = ++this.reconnectAttempts;
6622
+ this.socket = null;
6623
+ setTimeout(() => this.open(), _core_Const__WEBPACK_IMPORTED_MODULE_0__.RECONNECT_INTERVAL * reconnectAttempt);
6624
+ }
5301
6625
  /**
5302
6626
  * bind the callbacks to the socket callbacks
5303
6627
  */
5304
6628
  bindCallbacks() {
5305
6629
  this.socket.onopen = (event) => this.onopen(event);
5306
- this.socket.onmessage = (event) => this.onmmessage(event);
6630
+ this.socket.onmessage = (event) => this.onmessage(event);
5307
6631
  this.socket.onclose = (event) => this.onclose(event);
5308
6632
  this.socket.onerror = (event) => this.onerror(event);
5309
6633
  }
@@ -5338,9 +6662,12 @@ var PushImpl;
5338
6662
  throw new Error("Unknown channelToken: " + channelToken);
5339
6663
  }
5340
6664
  }
5341
- function resolveFunction(fn = () => {
5342
- }) {
5343
- return ((typeof fn !== "function") && (fn = mona_dish__WEBPACK_IMPORTED_MODULE_1__.DQ.global()[fn]), fn);
6665
+ function resolveFunction(fn) {
6666
+ if (typeof fn === "function")
6667
+ return fn;
6668
+ if (typeof fn === "string" && typeof mona_dish__WEBPACK_IMPORTED_MODULE_1__.DQ.global()[fn] === "function")
6669
+ return mona_dish__WEBPACK_IMPORTED_MODULE_1__.DQ.global()[fn];
6670
+ return (() => { });
5344
6671
  }
5345
6672
  })(PushImpl || (PushImpl = {}));
5346
6673
 
@@ -5641,7 +6968,7 @@ const UNKNOWN = "UNKNOWN";
5641
6968
  */
5642
6969
  function $faces() {
5643
6970
  var _a;
5644
- return ((_a = window === null || window === void 0 ? void 0 : window.faces) !== null && _a !== void 0 ? _a : window === null || window === void 0 ? void 0 : window.jsf);
6971
+ return (_a = window === null || window === void 0 ? void 0 : window.faces) !== null && _a !== void 0 ? _a : window === null || window === void 0 ? void 0 : window.jsf;
5645
6972
  }
5646
6973
  function $nsp(inputNamespace) {
5647
6974
  if ((!inputNamespace) || !(inputNamespace === null || inputNamespace === void 0 ? void 0 : inputNamespace.replace)) {
@@ -5757,7 +7084,7 @@ class Messages {
5757
7084
  /** @constant */
5758
7085
  this.ERR_TRANSPORT = "Transport type {0} does not exist";
5759
7086
  /** @constant */
5760
- this.ERR_EVT_PASS = "an event must be passed down (either a an event object null or undefined) ";
7087
+ this.ERR_EVT_PASS = "an event must be passed down (either an event object null or undefined) ";
5761
7088
  /** @constant */
5762
7089
  this.ERR_CONSTRUCT = "Parts of the response couldn't be retrieved when constructing the event data= {0} ";
5763
7090
  /** @constant */
@@ -5873,7 +7200,7 @@ var Assertions;
5873
7200
  Assertions.assertRequestIntegrity = assertRequestIntegrity;
5874
7201
  function assertUrlExists(node) {
5875
7202
  if (node.attr(_core_Const__WEBPACK_IMPORTED_MODULE_1__.ATTR_URL).isAbsent()) {
5876
- throw Assertions.raiseError(new Error(), _Lang__WEBPACK_IMPORTED_MODULE_2__.ExtLang.getMessage("ERR_RED_URL", null, "processRedirect"), "processRedirect");
7203
+ throw Assertions.raiseError(new Error(), _Lang__WEBPACK_IMPORTED_MODULE_2__.ExtLang.getMessage("ERR_RED_URL", undefined, "processRedirect"), "processRedirect");
5877
7204
  }
5878
7205
  }
5879
7206
  Assertions.assertUrlExists = assertUrlExists;
@@ -6004,7 +7331,7 @@ class AsyncRunnable {
6004
7331
  }
6005
7332
  /**
6006
7333
  * registers a finally functor
6007
- * @param func the functor for the finally handling chanin
7334
+ * @param func the functor for the finally handling chain
6008
7335
  */
6009
7336
  finally(func) {
6010
7337
  // no ie11 support we probably are going to revert to shims for that one
@@ -6064,7 +7391,7 @@ __webpack_require__.r(__webpack_exports__);
6064
7391
  */
6065
7392
  const IS_FACES_SOURCE = (source) => {
6066
7393
  //spec version smaller 4 we have to deal with the jsf namespace
6067
- return source && !!((source === null || source === void 0 ? void 0 : source.search(/\/jakarta\.faces\.resource.*\/faces\.js.*/)) != -1 ||
7394
+ return !!source && !!(source.search(/\/jakarta\.faces\.resource.*\/faces\.js.*/) != -1 ||
6068
7395
  (source === null || source === void 0 ? void 0 : source.search(/\/faces-development\.js.*/)) != -1 ||
6069
7396
  (source === null || source === void 0 ? void 0 : source.search(/\/faces-uncompressed\.js.*/)) != -1 ||
6070
7397
  (source === null || source === void 0 ? void 0 : source.search(/\/faces[^.]*\.js.*ln=jakarta.faces.*/gi)) != -1 ||
@@ -6089,6 +7416,9 @@ const IS_INTERNAL_SOURCE = (source) => {
6089
7416
  return source.search(/\/faces[^.]*\.js.*ln=myfaces.testscripts.*/gi) != -1 || source.search(/\/jsf[^.]*\.js.*ln=myfaces.testscripts.*/gi) != -1;
6090
7417
  };
6091
7418
  const ATTR_SRC = 'src';
7419
+ function isRegExpMatchArray(value) {
7420
+ return value != null && value.length > 1;
7421
+ }
6092
7422
  /**
6093
7423
  * Extension which adds implementation specific
6094
7424
  * meta-data to our dom query
@@ -6151,8 +7481,8 @@ class ExtDomQuery extends mona_dish__WEBPACK_IMPORTED_MODULE_0__.DQ {
6151
7481
  // the last possibility
6152
7482
  let nonceScript = mona_dish__WEBPACK_IMPORTED_MODULE_0__.Optional.fromNullable((_a = mona_dish__WEBPACK_IMPORTED_MODULE_0__.DQ
6153
7483
  .querySelectorAll("script[src], link[src]").asArray
6154
- .filter((item) => item.nonce.isPresent() && item.attr(ATTR_SRC) != null)
6155
- .filter(item => IS_FACES_SOURCE(item.attr(ATTR_SRC).value))) === null || _a === void 0 ? void 0 : _a[0]);
7484
+ .filter((item) => item.nonce.isPresent() && item.attr(ATTR_SRC).value != null)
7485
+ .filter(item => { var _a; return IS_FACES_SOURCE((_a = item.attr(ATTR_SRC).value) !== null && _a !== void 0 ? _a : undefined); })) === null || _a === void 0 ? void 0 : _a[0]);
6156
7486
  if (!(nonceScript === null || nonceScript === void 0 ? void 0 : nonceScript.value)) {
6157
7487
  return mona_dish__WEBPACK_IMPORTED_MODULE_0__.ValueEmbedder.absent;
6158
7488
  }
@@ -6170,16 +7500,13 @@ class ExtDomQuery extends mona_dish__WEBPACK_IMPORTED_MODULE_0__.DQ {
6170
7500
  var _a;
6171
7501
  //perfect application for lazy stream
6172
7502
  return mona_dish__WEBPACK_IMPORTED_MODULE_0__.Optional.fromNullable((_a = mona_dish__WEBPACK_IMPORTED_MODULE_0__.DQ.querySelectorAll("script[src], link[src]").asArray
6173
- .filter(item => IS_FACES_SOURCE(item.attr(ATTR_SRC).value))
6174
- .map(item => item.attr(ATTR_SRC).value.match(regExp))
6175
- .filter(item => item != null && item.length > 1)
7503
+ .filter(item => { var _a; return IS_FACES_SOURCE((_a = item.attr(ATTR_SRC).value) !== null && _a !== void 0 ? _a : undefined); })
7504
+ .map(item => { var _a; return ((_a = item.attr(ATTR_SRC).value) !== null && _a !== void 0 ? _a : "").match(regExp); })
7505
+ .filter(isRegExpMatchArray)
6176
7506
  .map((result) => {
6177
7507
  return decodeURIComponent(result[1]);
6178
7508
  })) === null || _a === void 0 ? void 0 : _a[0]);
6179
7509
  }
6180
- globalEval(code, nonce) {
6181
- return new ExtDomQuery(super.globalEval(code, nonce !== null && nonce !== void 0 ? nonce : this.nonce.value));
6182
- }
6183
7510
  // called from base class runScripts, do not delete
6184
7511
  // noinspection JSUnusedGlobalSymbols
6185
7512
  globalEvalSticky(code, nonce) {
@@ -6335,7 +7662,7 @@ class ExtConfig extends mona_dish__WEBPACK_IMPORTED_MODULE_0__.Config {
6335
7662
  if (!this.$nspEnabled) {
6336
7663
  return accessPath;
6337
7664
  }
6338
- return new mona_dish__WEBPACK_IMPORTED_MODULE_0__.Es2019Array(...accessPath).map(key => (0,_core_Const__WEBPACK_IMPORTED_MODULE_1__.$nsp)(key));
7665
+ return new mona_dish__WEBPACK_IMPORTED_MODULE_0__.Es2019Array(...accessPath).map((key) => (0,_core_Const__WEBPACK_IMPORTED_MODULE_1__.$nsp)(key));
6339
7666
  }
6340
7667
  }
6341
7668
 
@@ -6359,6 +7686,21 @@ __webpack_require__.r(__webpack_exports__);
6359
7686
  /* harmony import */ var mona_dish__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! mona-dish */ "./node_modules/mona-dish/src/main/typescript/index_core.ts");
6360
7687
  /* harmony import */ var _ExtDomQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ExtDomQuery */ "./src/main/typescript/impl/util/ExtDomQuery.ts");
6361
7688
  /* harmony import */ var _core_Const__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/Const */ "./src/main/typescript/impl/core/Const.ts");
7689
+ /*! Licensed to the Apache Software Foundation (ASF) under one or more
7690
+ * contributor license agreements. See the NOTICE file distributed with
7691
+ * this work for additional information regarding copyright ownership.
7692
+ * The ASF licenses this file to you under the Apache License, Version 2.0
7693
+ * (the "License"); you may not use this file except in compliance with
7694
+ * the License. You may obtain a copy of the License at
7695
+ *
7696
+ * http://www.apache.org/licenses/LICENSE-2.0
7697
+ *
7698
+ * Unless required by applicable law or agreed to in writing, software
7699
+ * distributed under the License is distributed on an "AS IS" BASIS,
7700
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7701
+ * See the License for the specific language governing permissions and
7702
+ * limitations under the License.
7703
+ */
6362
7704
 
6363
7705
 
6364
7706
 
@@ -6377,10 +7719,10 @@ function encodeFormData(formData, paramsMapper = (inStr, inVal) => [inStr, inVal
6377
7719
  return defaultStr;
6378
7720
  }
6379
7721
  const assocValues = formData.value;
6380
- const expandValueArrAndRename = key => assocValues[key].map(val => paramsMapper(key, val));
6381
- const isPropertyKey = key => assocValues.hasOwnProperty(key);
7722
+ const expandValueArrAndRename = (key) => assocValues[key].map((val) => paramsMapper(key, val));
7723
+ const isPropertyKey = (key) => assocValues.hasOwnProperty(key);
6382
7724
  const isNotFile = ([, value]) => !(value instanceof _ExtDomQuery__WEBPACK_IMPORTED_MODULE_1__.ExtDomQuery.global().File);
6383
- const mapIntoUrlParam = keyVal => `${encodeURIComponent(keyVal[0])}=${encodeURIComponent(keyVal[1])}`;
7725
+ const mapIntoUrlParam = (keyVal) => `${encodeURIComponent(keyVal[0])}=${encodeURIComponent(keyVal[1])}`;
6384
7726
  return new mona_dish__WEBPACK_IMPORTED_MODULE_0__.Es2019Array(...Object.keys(assocValues))
6385
7727
  .filter(isPropertyKey)
6386
7728
  .flatMap(expandValueArrAndRename)
@@ -6393,16 +7735,16 @@ function encodeFormData(formData, paramsMapper = (inStr, inVal) => [inStr, inVal
6393
7735
  * @param encoded encoded string
6394
7736
  */
6395
7737
  function decodeEncodedValues(encoded) {
6396
- const filterBlanks = item => !!(item || '').replace(/\s+/g, '');
6397
- const splitKeyValuePair = _line => {
7738
+ const filterBlanks = (item) => !!(item || '').replace(/\s+/g, '');
7739
+ const splitKeyValuePair = (_line) => {
6398
7740
  let line = decodeURIComponent(_line);
6399
7741
  let index = line.indexOf("=");
6400
- if (index == -1) {
7742
+ if (index === -1) {
6401
7743
  return [line];
6402
7744
  }
6403
7745
  return [line.substring(0, index), line.substring(index + 1)];
6404
7746
  };
6405
- let requestParamEntries = encoded.split(/&/gi);
7747
+ let requestParamEntries = encoded.split("&");
6406
7748
  return requestParamEntries.filter(filterBlanks).map(splitKeyValuePair);
6407
7749
  }
6408
7750
  /**
@@ -6411,9 +7753,9 @@ function decodeEncodedValues(encoded) {
6411
7753
  */
6412
7754
  function resolveFiles(dataSource) {
6413
7755
  const expandFilesArr = ([key, files]) => {
6414
- return [...files].map(file => [key, file]);
7756
+ return [...files].map((file) => [key, file]);
6415
7757
  };
6416
- const remapFileInput = fileInput => {
7758
+ const remapFileInput = (fileInput) => {
6417
7759
  return [fileInput.name.value || fileInput.id.value, fileInput.filesFromElem(0)];
6418
7760
  };
6419
7761
  const files = dataSource
@@ -6492,9 +7834,8 @@ __webpack_require__.r(__webpack_exports__);
6492
7834
  */
6493
7835
  class HiddenInputBuilder {
6494
7836
  constructor(selector) {
6495
- this.selector = selector;
6496
7837
  this.namedViewRoot = false;
6497
- const isViewState = selector.indexOf((0,_core_Const__WEBPACK_IMPORTED_MODULE_1__.$nsp)(_core_Const__WEBPACK_IMPORTED_MODULE_1__.P_VIEWSTATE)) != -1;
7838
+ const isViewState = selector.includes((0,_core_Const__WEBPACK_IMPORTED_MODULE_1__.$nsp)(_core_Const__WEBPACK_IMPORTED_MODULE_1__.P_VIEWSTATE));
6498
7839
  this.name = isViewState ? _core_Const__WEBPACK_IMPORTED_MODULE_1__.P_VIEWSTATE : _core_Const__WEBPACK_IMPORTED_MODULE_1__.P_CLIENT_WINDOW;
6499
7840
  this.template = isViewState ? _core_Const__WEBPACK_IMPORTED_MODULE_1__.HTML_VIEWSTATE : _core_Const__WEBPACK_IMPORTED_MODULE_1__.HTML_CLIENT_WINDOW;
6500
7841
  }
@@ -6511,37 +7852,39 @@ class HiddenInputBuilder {
6511
7852
  return this;
6512
7853
  }
6513
7854
  build() {
6514
- var _a, _b, _c;
6515
- const SEP = (0,_core_Const__WEBPACK_IMPORTED_MODULE_1__.$faces)().separatorchar;
6516
- let existingStates = (0,mona_dish__WEBPACK_IMPORTED_MODULE_0__.DQ$)(`[name*='${(0,_core_Const__WEBPACK_IMPORTED_MODULE_1__.$nsp)(this.name)}']`);
6517
- let cnt = existingStates.asArray.map(state => {
6518
- let ident = state.id.orElse("0").value;
6519
- ident = ident.substring(ident.lastIndexOf(SEP) + 1);
6520
- return parseInt(ident);
6521
- })
6522
- .filter(item => {
6523
- return !isNaN(item);
6524
- })
6525
- .reduce((item1, item2) => {
6526
- return Math.max(item1, item2);
6527
- }, 0); //we start with 1 (see cnt++)
6528
- //the maximum new ident is the current max + 1
6529
- cnt++;
7855
+ var _a;
6530
7856
  const newElement = mona_dish__WEBPACK_IMPORTED_MODULE_0__.DQ.fromMarkup((0,_core_Const__WEBPACK_IMPORTED_MODULE_1__.$nsp)(this.template));
6531
- newElement.id.value = (((_a = this.namingContainerId) === null || _a === void 0 ? void 0 : _a.length) ?
6532
- [this.namingContainerId, (0,_core_Const__WEBPACK_IMPORTED_MODULE_1__.$nsp)(this.name), cnt] :
6533
- [(0,_core_Const__WEBPACK_IMPORTED_MODULE_1__.$nsp)(this.name), cnt]).join(SEP);
6534
- //name must be prefixed with the naming container id as well according to the jsdocs
6535
- if (this.namedViewRoot) {
6536
- newElement.name.value = ((_b = this.namingContainerId) === null || _b === void 0 ? void 0 : _b.length) ?
6537
- [this.namingContainerId, (0,_core_Const__WEBPACK_IMPORTED_MODULE_1__.$nsp)(this.name)].join(SEP) : (0,_core_Const__WEBPACK_IMPORTED_MODULE_1__.$nsp)(this.name);
6538
- }
6539
- else {
6540
- newElement.name.value = (0,_core_Const__WEBPACK_IMPORTED_MODULE_1__.$nsp)(this.name);
6541
- }
6542
- (_c = this === null || this === void 0 ? void 0 : this.parent) === null || _c === void 0 ? void 0 : _c.append(newElement);
7857
+ newElement.id.value = this.buildId();
7858
+ newElement.name.value = this.buildName();
7859
+ (_a = this.parent) === null || _a === void 0 ? void 0 : _a.append(newElement);
6543
7860
  return newElement;
6544
7861
  }
7862
+ buildId() {
7863
+ var _a;
7864
+ const separator = (0,_core_Const__WEBPACK_IMPORTED_MODULE_1__.$faces)().separatorchar;
7865
+ const parts = ((_a = this.namingContainerId) === null || _a === void 0 ? void 0 : _a.length) ?
7866
+ [this.namingContainerId, (0,_core_Const__WEBPACK_IMPORTED_MODULE_1__.$nsp)(this.name), this.nextIndex()] :
7867
+ [(0,_core_Const__WEBPACK_IMPORTED_MODULE_1__.$nsp)(this.name), this.nextIndex()];
7868
+ return parts.join(separator);
7869
+ }
7870
+ buildName() {
7871
+ var _a;
7872
+ if (!this.namedViewRoot) {
7873
+ return (0,_core_Const__WEBPACK_IMPORTED_MODULE_1__.$nsp)(this.name);
7874
+ }
7875
+ return ((_a = this.namingContainerId) === null || _a === void 0 ? void 0 : _a.length) ?
7876
+ [this.namingContainerId, (0,_core_Const__WEBPACK_IMPORTED_MODULE_1__.$nsp)(this.name)].join((0,_core_Const__WEBPACK_IMPORTED_MODULE_1__.$faces)().separatorchar) :
7877
+ (0,_core_Const__WEBPACK_IMPORTED_MODULE_1__.$nsp)(this.name);
7878
+ }
7879
+ nextIndex() {
7880
+ const separator = (0,_core_Const__WEBPACK_IMPORTED_MODULE_1__.$faces)().separatorchar;
7881
+ return (0,mona_dish__WEBPACK_IMPORTED_MODULE_0__.DQ$)(`[name*='${(0,_core_Const__WEBPACK_IMPORTED_MODULE_1__.$nsp)(this.name)}']`).asArray
7882
+ .map(state => state.id.orElse("0").value)
7883
+ .map(id => id.substring(id.lastIndexOf(separator) + 1))
7884
+ .map(idSuffix => parseInt(idSuffix))
7885
+ .filter(idSuffix => !isNaN(idSuffix))
7886
+ .reduce((max, idSuffix) => Math.max(max, idSuffix), 0) + 1;
7887
+ }
6545
7888
  }
6546
7889
 
6547
7890
 
@@ -6585,13 +7928,12 @@ __webpack_require__.r(__webpack_exports__);
6585
7928
  var ExtLang;
6586
7929
  (function (ExtLang) {
6587
7930
  let installedLocale;
6588
- let nameSpace = "impl/util/Lang/";
7931
+ const nameSpace = "impl/util/Lang/";
6589
7932
  function getLanguage() {
6590
7933
  //TODO global config override
6591
- var _a, _b;
6592
- let language = (_b = (_a = navigator.languages) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : navigator === null || navigator === void 0 ? void 0 : navigator.language;
6593
- language = language.split("-")[0];
6594
- return language;
7934
+ var _a, _b, _c;
7935
+ const language = (_c = (_b = (_a = navigator.languages) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : navigator === null || navigator === void 0 ? void 0 : navigator.language) !== null && _c !== void 0 ? _c : "en";
7936
+ return language.split("-")[0];
6595
7937
  }
6596
7938
  ExtLang.getLanguage = getLanguage;
6597
7939
  //should be in lang, but for now here to avoid recursive imports, not sure if typescript still has a problem with those
@@ -6713,15 +8055,15 @@ var ExtLang;
6713
8055
  * @param event
6714
8056
  */
6715
8057
  function getForm(elem, event) {
6716
- let queryElem = new mona_dish__WEBPACK_IMPORTED_MODULE_0__.DQ(elem);
6717
- let eventTarget = (event) ? new mona_dish__WEBPACK_IMPORTED_MODULE_0__.DQ((0,_xhrCore_RequestDataResolver__WEBPACK_IMPORTED_MODULE_3__.getEventTarget)(event)) : mona_dish__WEBPACK_IMPORTED_MODULE_0__.DomQuery.absent;
8058
+ const queryElem = new mona_dish__WEBPACK_IMPORTED_MODULE_0__.DQ(elem);
8059
+ const eventTarget = (event) ? new mona_dish__WEBPACK_IMPORTED_MODULE_0__.DQ((0,_xhrCore_RequestDataResolver__WEBPACK_IMPORTED_MODULE_3__.getEventTarget)(event)) : mona_dish__WEBPACK_IMPORTED_MODULE_0__.DomQuery.absent;
6718
8060
  if (queryElem.isTag(_core_Const__WEBPACK_IMPORTED_MODULE_2__.HTML_TAG_FORM)) {
6719
8061
  return queryElem;
6720
8062
  }
6721
8063
  //html 5 for handling
6722
8064
  if (queryElem.attr(_core_Const__WEBPACK_IMPORTED_MODULE_2__.HTML_TAG_FORM).isPresent()) {
6723
- let formId = queryElem.attr(_core_Const__WEBPACK_IMPORTED_MODULE_2__.HTML_TAG_FORM).value;
6724
- let foundForm = mona_dish__WEBPACK_IMPORTED_MODULE_0__.DQ.byId(formId, true);
8065
+ const formId = queryElem.attr(_core_Const__WEBPACK_IMPORTED_MODULE_2__.HTML_TAG_FORM).value;
8066
+ const foundForm = mona_dish__WEBPACK_IMPORTED_MODULE_0__.DQ.byId(formId, true);
6725
8067
  if (foundForm.isPresent()) {
6726
8068
  return foundForm;
6727
8069
  }
@@ -6764,7 +8106,7 @@ var ExtLang;
6764
8106
  */
6765
8107
  function ofAssoc(value) {
6766
8108
  return new mona_dish__WEBPACK_IMPORTED_MODULE_0__.Es2019Array(...Object.keys(value))
6767
- .map(key => [key, value[key]]);
8109
+ .map((key) => [key, value[key]]);
6768
8110
  }
6769
8111
  ExtLang.ofAssoc = ofAssoc;
6770
8112
  function collectAssoc(target, item) {
@@ -6835,6 +8177,21 @@ __webpack_require__.r(__webpack_exports__);
6835
8177
  /* harmony export */ XhrQueueController: () => (/* binding */ XhrQueueController)
6836
8178
  /* harmony export */ });
6837
8179
  /* harmony import */ var _Lang__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Lang */ "./src/main/typescript/impl/util/Lang.ts");
8180
+ /*! Licensed to the Apache Software Foundation (ASF) under one or more
8181
+ * contributor license agreements. See the NOTICE file distributed with
8182
+ * this work for additional information regarding copyright ownership.
8183
+ * The ASF licenses this file to you under the Apache License, Version 2.0
8184
+ * (the "License"); you may not use this file except in compliance with
8185
+ * the License. You may obtain a copy of the License at
8186
+ *
8187
+ * http://www.apache.org/licenses/LICENSE-2.0
8188
+ *
8189
+ * Unless required by applicable law or agreed to in writing, software
8190
+ * distributed under the License is distributed on an "AS IS" BASIS,
8191
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8192
+ * See the License for the specific language governing permissions and
8193
+ * limitations under the License.
8194
+ */
6838
8195
 
6839
8196
  const debounce = _Lang__WEBPACK_IMPORTED_MODULE_0__.ExtLang.debounce;
6840
8197
  /**
@@ -6846,6 +8203,7 @@ class XhrQueueController {
6846
8203
  constructor() {
6847
8204
  this.queue = [];
6848
8205
  this.taskRunning = false;
8206
+ this.debounceKey = `xhrQueue_${XhrQueueController.instanceCount++}`;
6849
8207
  }
6850
8208
  /**
6851
8209
  * executes or enqueues an element
@@ -6854,7 +8212,7 @@ class XhrQueueController {
6854
8212
  * until the debounce window for the timeout is closed.
6855
8213
  */
6856
8214
  enqueue(runnable, timeOut = 0) {
6857
- debounce("xhrQueue", () => {
8215
+ debounce(this.debounceKey, () => {
6858
8216
  const requestHandler = this.enrichRunnable(runnable);
6859
8217
  if (!this.taskRunning) {
6860
8218
  this.signalTaskRunning();
@@ -6922,6 +8280,9 @@ class XhrQueueController {
6922
8280
  this.taskRunning = !this.isEmpty;
6923
8281
  }
6924
8282
  }
8283
+ // Each instance needs its own debounce key: a shared key would cause enqueues
8284
+ // on separate instances to cancel each other's debounce window.
8285
+ XhrQueueController.instanceCount = 0;
6925
8286
 
6926
8287
 
6927
8288
  /***/ },
@@ -6978,6 +8339,7 @@ var ErrorType;
6978
8339
  * I will add deprecated myfaces backwards compatibility attributes as well
6979
8340
  */
6980
8341
  class ErrorData extends _EventData__WEBPACK_IMPORTED_MODULE_2__.EventData {
8342
+ /** @internal */
6981
8343
  constructor(source, errorName, errorMessage, responseText = null, responseXML = null, responseCode = -1, statusOverride = null, type = ErrorType.CLIENT_ERROR) {
6982
8344
  super();
6983
8345
  this.type = "error";
@@ -6999,13 +8361,16 @@ class ErrorData extends _EventData__WEBPACK_IMPORTED_MODULE_2__.EventData {
6999
8361
  this.serverErrorMessage = this.errorMessage;
7000
8362
  }
7001
8363
  }
8364
+ /** @internal */
7002
8365
  static fromClient(e) {
7003
8366
  var _a, _b, _c, _d;
7004
8367
  return new ErrorData((_a = e === null || e === void 0 ? void 0 : e.source) !== null && _a !== void 0 ? _a : "client", (_b = e === null || e === void 0 ? void 0 : e.name) !== null && _b !== void 0 ? _b : _core_Const__WEBPACK_IMPORTED_MODULE_0__.EMPTY_STR, (_c = e === null || e === void 0 ? void 0 : e.message) !== null && _c !== void 0 ? _c : _core_Const__WEBPACK_IMPORTED_MODULE_0__.EMPTY_STR, (_d = e === null || e === void 0 ? void 0 : e.stack) !== null && _d !== void 0 ? _d : _core_Const__WEBPACK_IMPORTED_MODULE_0__.EMPTY_STR);
7005
8368
  }
8369
+ /** @internal */
7006
8370
  static fromHttpConnection(source, name, message, responseText, responseXML, responseCode, status = _core_Const__WEBPACK_IMPORTED_MODULE_0__.EMPTY_STR) {
7007
8371
  return new ErrorData(source, name, message, responseText, responseXML, responseCode, status, ErrorType.HTTP_ERROR);
7008
8372
  }
8373
+ /** @internal */
7009
8374
  static fromGeneric(context, errorCode, errorType = ErrorType.SERVER_ERROR) {
7010
8375
  let getMsg = this.getMsg;
7011
8376
  let source = getMsg(context, _core_Const__WEBPACK_IMPORTED_MODULE_0__.SOURCE);
@@ -7019,6 +8384,7 @@ class ErrorData extends _EventData__WEBPACK_IMPORTED_MODULE_2__.EventData {
7019
8384
  static getMsg(context, param) {
7020
8385
  return getMessage(context.getIf(param).orElse(_core_Const__WEBPACK_IMPORTED_MODULE_0__.EMPTY_STR).value);
7021
8386
  }
8387
+ /** @internal */
7022
8388
  static fromServerError(context) {
7023
8389
  return this.fromGeneric(context, -1);
7024
8390
  }
@@ -7057,6 +8423,7 @@ __webpack_require__.r(__webpack_exports__);
7057
8423
 
7058
8424
 
7059
8425
  class EventData {
8426
+ /** @internal */
7060
8427
  static createFromRequest(request, internalContext, context, /*event name*/ name) {
7061
8428
  let eventData = new EventData();
7062
8429
  let internalSource = "_internal._source";
@@ -7157,9 +8524,10 @@ function resolveHandlerFunc(requestContext, responseContext, funcName) {
7157
8524
  .orElse(_core_Const__WEBPACK_IMPORTED_MODULE_1__.EMPTY_FUNC).value;
7158
8525
  }
7159
8526
  function resolveTargetUrl(srcFormElement) {
7160
- return (typeof srcFormElement.elements[_core_Const__WEBPACK_IMPORTED_MODULE_1__.ENCODED_URL] == 'undefined') ?
8527
+ const formElements = srcFormElement.elements;
8528
+ return (typeof formElements[_core_Const__WEBPACK_IMPORTED_MODULE_1__.ENCODED_URL] == 'undefined') ?
7161
8529
  srcFormElement.action :
7162
- srcFormElement.elements[_core_Const__WEBPACK_IMPORTED_MODULE_1__.ENCODED_URL].value;
8530
+ formElements[_core_Const__WEBPACK_IMPORTED_MODULE_1__.ENCODED_URL].value;
7163
8531
  }
7164
8532
  function resolveFinalUrl(sourceForm, formData, ajaxType = _core_Const__WEBPACK_IMPORTED_MODULE_1__.REQ_TYPE_POST) {
7165
8533
  let targetUrl = resolveTargetUrl(sourceForm.getAsElem(0).value);
@@ -7501,9 +8869,7 @@ var Response;
7501
8869
  __webpack_require__.r(__webpack_exports__);
7502
8870
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7503
8871
  /* harmony export */ resolveContexts: () => (/* binding */ resolveContexts),
7504
- /* harmony export */ resolveResponseXML: () => (/* binding */ resolveResponseXML),
7505
- /* harmony export */ resolveSourceElement: () => (/* binding */ resolveSourceElement),
7506
- /* harmony export */ resolveSourceForm: () => (/* binding */ resolveSourceForm)
8872
+ /* harmony export */ resolveResponseXML: () => (/* binding */ resolveResponseXML)
7507
8873
  /* harmony export */ });
7508
8874
  /* harmony import */ var mona_dish__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! mona-dish */ "./node_modules/mona-dish/src/main/typescript/index_core.ts");
7509
8875
  /* harmony import */ var _util_Assertions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/Assertions */ "./src/main/typescript/impl/util/Assertions.ts");
@@ -7528,7 +8894,6 @@ __webpack_require__.r(__webpack_exports__);
7528
8894
 
7529
8895
 
7530
8896
 
7531
-
7532
8897
  /**
7533
8898
  * Resolver functions for various aspects of the response data
7534
8899
  *
@@ -7574,38 +8939,6 @@ function resolveContexts(context) {
7574
8939
  internalContext.assign(_core_Const__WEBPACK_IMPORTED_MODULE_2__.UPDATE_ELEMS).value = [];
7575
8940
  return { externalContext, internalContext };
7576
8941
  }
7577
- /**
7578
- * fetches the source element out of our contexts
7579
- *
7580
- * @param context the external context which should host the source id
7581
- * @param internalContext internal pass-through fall back
7582
- *
7583
- */
7584
- function resolveSourceElement(context, internalContext) {
7585
- let elemId = resolveSourceElementId(context, internalContext);
7586
- return mona_dish__WEBPACK_IMPORTED_MODULE_0__.DQ.byId(elemId.value, true);
7587
- }
7588
- /**
7589
- * fetches the source form if it still exists
7590
- * also embedded forms and parent forms are taken into consideration
7591
- * as fallbacks
7592
- *
7593
- * @param internalContext
7594
- * @param elem
7595
- */
7596
- function resolveSourceForm(internalContext, elem) {
7597
- let sourceFormId = internalContext.getIf(_core_Const__WEBPACK_IMPORTED_MODULE_2__.CTX_PARAM_SRC_FRM_ID);
7598
- let sourceForm = new mona_dish__WEBPACK_IMPORTED_MODULE_0__.DQ(sourceFormId.isPresent() ? document.forms[sourceFormId.value] : null);
7599
- sourceForm = sourceForm.orElseLazy(() => elem.firstParent(_core_Const__WEBPACK_IMPORTED_MODULE_2__.HTML_TAG_FORM))
7600
- .orElseLazy(() => elem.querySelectorAll(_core_Const__WEBPACK_IMPORTED_MODULE_2__.HTML_TAG_FORM))
7601
- .orElseLazy(() => mona_dish__WEBPACK_IMPORTED_MODULE_0__.DQ.querySelectorAll(_core_Const__WEBPACK_IMPORTED_MODULE_2__.HTML_TAG_FORM));
7602
- return sourceForm;
7603
- }
7604
- function resolveSourceElementId(context, internalContext) {
7605
- //?internal context?? used to be external one
7606
- return internalContext.getIf(_core_Const__WEBPACK_IMPORTED_MODULE_2__.CTX_PARAM_SRC_CTL_ID)
7607
- .orElseLazy(() => context.getIf(_core_Const__WEBPACK_IMPORTED_MODULE_2__.SOURCE, "id").value);
7608
- }
7609
8942
 
7610
8943
 
7611
8944
  /***/ },
@@ -7881,6 +9214,7 @@ class ResponseProcessor {
7881
9214
  this.internalContext.assign(_core_Const__WEBPACK_IMPORTED_MODULE_6__.APPLIED_CLIENT_WINDOW, node.id.value).value = new _core_ImplTypes__WEBPACK_IMPORTED_MODULE_4__.StateHolder((0,_core_Const__WEBPACK_IMPORTED_MODULE_6__.$nsp)(node.id.value), state);
7882
9215
  return true;
7883
9216
  }
9217
+ return false;
7884
9218
  }
7885
9219
  /**
7886
9220
  * generic global eval which runs the embedded css and scripts
@@ -7949,6 +9283,7 @@ class ResponseProcessor {
7949
9283
  * proper viewState -> form assignment
7950
9284
  *
7951
9285
  * @param forms the forms to append the viewState to
9286
+ * @param namedViewRoot if set to true, the name is also prefixed
7952
9287
  * @param viewState the final viewState
7953
9288
  * @param namingContainerId
7954
9289
  */
@@ -7959,6 +9294,7 @@ class ResponseProcessor {
7959
9294
  * proper clientWindow -> form assignment
7960
9295
  *
7961
9296
  * @param forms the forms to append the viewState to
9297
+ * @param namedViewRoot if set to true, the name is also prefixed
7962
9298
  * @param clientWindow the final viewState
7963
9299
  * @param namingContainerId
7964
9300
  */
@@ -8060,7 +9396,7 @@ class ResponseProcessor {
8060
9396
  .orElseLazy(() => this.externalContext.getIf((0,_core_Const__WEBPACK_IMPORTED_MODULE_6__.$nsp)(_core_Const__WEBPACK_IMPORTED_MODULE_6__.P_RENDER)).value)
8061
9397
  .orElse(_core_Const__WEBPACK_IMPORTED_MODULE_6__.IDENT_NONE).value.split(/\s+/gi);
8062
9398
  const executeAndRenders = executes.concat(...renders);
8063
- return [...executeAndRenders].filter(nameOrId => {
9399
+ return [...executeAndRenders].filter((nameOrId) => {
8064
9400
  if ([_core_Const__WEBPACK_IMPORTED_MODULE_6__.IDENT_ALL, _core_Const__WEBPACK_IMPORTED_MODULE_6__.IDENT_NONE].indexOf(nameOrId) != -1) {
8065
9401
  return true;
8066
9402
  }
@@ -8157,9 +9493,7 @@ class XhrFormData extends mona_dish__WEBPACK_IMPORTED_MODULE_0__.Config {
8157
9493
  */
8158
9494
  constructor(dataSource, paramsMapper = defaultParamsMapper, executes, partialIds) {
8159
9495
  super({});
8160
- this.dataSource = dataSource;
8161
9496
  this.paramsMapper = paramsMapper;
8162
- this.partialIds = partialIds;
8163
9497
  /**
8164
9498
  * Checks if the given datasource is a multipart request source
8165
9499
  * multipart is only needed if one of the executes is a file input
@@ -8168,51 +9502,17 @@ class XhrFormData extends mona_dish__WEBPACK_IMPORTED_MODULE_0__.Config {
8168
9502
  * instead of an encoded string files cannot be sent that way
8169
9503
  */
8170
9504
  this.isMultipartRequest = false;
8171
- //encode and append the issuing item if not a partial ids array of ids is passed
8172
9505
  /*
8173
- * Spec. 13.3.1
8174
- * Collect and encode input elements.
8175
- * Additionally the hidden element jakarta.faces.ViewState
8176
- * Enhancement partial page submit
9506
+ * Spec. 13.3.1 — order matters: detect multipart first, encode fields second,
9507
+ * apply view state last (so it is not double-counted if already present in fields).
8177
9508
  */
8178
- this.resolveRequestType(this.dataSource, executes);
8179
- this.encodeSubmittableFields(this.dataSource, this.partialIds);
8180
- this.applyViewState(this.dataSource);
9509
+ this.initFormData(dataSource, executes, partialIds);
8181
9510
  }
8182
9511
  /**
8183
9512
  * @returns a Form data representation, this is needed for file submits
8184
9513
  */
8185
9514
  toFormData() {
8186
- /*
8187
- * expands key: [item1, item2]
8188
- * to: [{key: key, value: item1}, {key: key, value: item2}]
8189
- */
8190
- let expandValueArrays = ([key, item]) => {
8191
- if (Array.isArray(item)) {
8192
- return new mona_dish__WEBPACK_IMPORTED_MODULE_0__.Es2019Array(...item).map(value => {
8193
- return { key, value };
8194
- });
8195
- }
8196
- return [{ key, value: item }];
8197
- };
8198
- /*
8199
- * remaps the incoming {key, value} tuples
8200
- * to naming container prefixed keys and values
8201
- */
8202
- let remapForNamingContainer = ({ key, value }) => {
8203
- key = this.remapKeyForNamingContainer(key);
8204
- return { key, value };
8205
- };
8206
- /*
8207
- * collects everything into a FormData object
8208
- */
8209
- return ofAssoc(this.value)
8210
- .flatMap(expandValueArrays)
8211
- .map(remapForNamingContainer)
8212
- .reduce((formData, { key, value }) => {
8213
- formData.append(key, value);
8214
- return formData;
8215
- }, new FormData());
9515
+ return this.buildFormData();
8216
9516
  }
8217
9517
  /**
8218
9518
  * returns an encoded string representation of our xhr form data
@@ -8223,13 +9523,18 @@ class XhrFormData extends mona_dish__WEBPACK_IMPORTED_MODULE_0__.Config {
8223
9523
  return (0,_util_FileUtils__WEBPACK_IMPORTED_MODULE_2__.encodeFormData)(this, this.paramsMapper, defaultStr);
8224
9524
  }
8225
9525
  /**
8226
- * generic post init code, for now, this performs some post assign data post-processing
8227
- * @param rootElement the root element which knows the request type (usually a form)
8228
- * @param executes the executable dom nodes which need to be processed into the form data, which we can send
8229
- * in our ajax request
9526
+ * Drives the three-phase form data initialisation in the required order.
9527
+ */
9528
+ initFormData(dataSource, executes, partialIds) {
9529
+ this.detectMultipartRequest(dataSource, executes);
9530
+ this.encodeSubmittableFields(dataSource, partialIds);
9531
+ this.applyViewState(dataSource);
9532
+ }
9533
+ /**
9534
+ * Sets isMultipartRequest when any of the executed elements is a file input.
8230
9535
  */
8231
- resolveRequestType(rootElement, executes) {
8232
- if (!executes || executes.indexOf(_core_Const__WEBPACK_IMPORTED_MODULE_1__.IDENT_NONE) != -1) {
9536
+ detectMultipartRequest(rootElement, executes) {
9537
+ if (!executes || executes.includes(_core_Const__WEBPACK_IMPORTED_MODULE_1__.IDENT_NONE)) {
8233
9538
  return;
8234
9539
  }
8235
9540
  this.isMultipartRequest = rootElement.isMultipartCandidate(true);
@@ -8243,8 +9548,8 @@ class XhrFormData extends mona_dish__WEBPACK_IMPORTED_MODULE_0__.Config {
8243
9548
  if (this.getIf((0,_core_Const__WEBPACK_IMPORTED_MODULE_1__.$nsp)(_core_Const__WEBPACK_IMPORTED_MODULE_1__.P_VIEWSTATE)).isPresent()) {
8244
9549
  return;
8245
9550
  }
8246
- let viewStateElement = form.querySelectorAllDeep(`[name*='${(0,_core_Const__WEBPACK_IMPORTED_MODULE_1__.$nsp)(_core_Const__WEBPACK_IMPORTED_MODULE_1__.P_VIEWSTATE)}'`);
8247
- let viewState = viewStateElement.inputValue;
9551
+ const viewStateElement = form.querySelectorAllDeep(`[name*='${(0,_core_Const__WEBPACK_IMPORTED_MODULE_1__.$nsp)(_core_Const__WEBPACK_IMPORTED_MODULE_1__.P_VIEWSTATE)}'`);
9552
+ const viewState = viewStateElement.inputValue;
8248
9553
  this.appendIf(viewState.isPresent(), this.remapKeyForNamingContainer(viewStateElement.name.value)).value = viewState.value;
8249
9554
  }
8250
9555
  /**
@@ -8255,18 +9560,54 @@ class XhrFormData extends mona_dish__WEBPACK_IMPORTED_MODULE_0__.Config {
8255
9560
  encodeSubmittableFields(parentItem, partialIds = []) {
8256
9561
  const mergeIntoThis = ([key, value]) => this.append(key).value = value;
8257
9562
  const namingContainerRemap = ([key, value]) => this.paramsMapper(key, value);
8258
- const remappedPartialIds = partialIds.map(partialId => this.remapKeyForNamingContainer(partialId));
8259
- const partialIdsFilter = ([key, value]) => (!remappedPartialIds.length || key.indexOf("@") == 0) ? true :
8260
- remappedPartialIds.indexOf(key) != -1;
8261
- let inputs = (0,_util_FileUtils__WEBPACK_IMPORTED_MODULE_2__.getFormInputsAsArr)(parentItem);
8262
- inputs
9563
+ const remappedPartialIds = partialIds.map(id => this.remapKeyForNamingContainer(id));
9564
+ (0,_util_FileUtils__WEBPACK_IMPORTED_MODULE_2__.getFormInputsAsArr)(parentItem)
8263
9565
  .map(_util_FileUtils__WEBPACK_IMPORTED_MODULE_2__.fixEmptyParameters)
8264
9566
  .map(namingContainerRemap)
8265
- .filter(partialIdsFilter)
9567
+ .filter(([key]) => this.isFieldIncluded(key, remappedPartialIds))
8266
9568
  .forEach(mergeIntoThis);
8267
9569
  }
9570
+ /**
9571
+ * Returns true when the field should be included in the submission.
9572
+ * Special "@"-prefixed keys (internal markers) are always included.
9573
+ * When no partial ids are specified, everything passes through.
9574
+ */
9575
+ isFieldIncluded(key, remappedPartialIds) {
9576
+ if (!remappedPartialIds.length || key.startsWith("@")) {
9577
+ return true;
9578
+ }
9579
+ return remappedPartialIds.includes(key);
9580
+ }
9581
+ /**
9582
+ * Builds the FormData object from the internal key→value[] map.
9583
+ * Arrays are expanded so each value becomes a separate FormData entry.
9584
+ */
9585
+ buildFormData() {
9586
+ const expandValueArrays = ([key, item]) => {
9587
+ if (Array.isArray(item)) {
9588
+ return new mona_dish__WEBPACK_IMPORTED_MODULE_0__.Es2019Array(...item).map((value) => ({ key, value }));
9589
+ }
9590
+ return [{ key, value: item }];
9591
+ };
9592
+ const remapForNamingContainer = ({ key, value }) => ({
9593
+ key: this.remapKeyForNamingContainer(key),
9594
+ value
9595
+ });
9596
+ return ofAssoc(this.value)
9597
+ .flatMap(expandValueArrays)
9598
+ .map(remapForNamingContainer)
9599
+ .reduce((formData, { key, value }) => {
9600
+ formData.append(key, value);
9601
+ return formData;
9602
+ }, new FormData());
9603
+ }
9604
+ /**
9605
+ * Applies paramsMapper to remap only the key, ignoring the value transformation.
9606
+ * EMPTY_STR is passed as a placeholder since only the remapped key is used.
9607
+ */
8268
9608
  remapKeyForNamingContainer(key) {
8269
- return this.paramsMapper(key, "")[0];
9609
+ const [remappedKey] = this.paramsMapper(key, _core_Const__WEBPACK_IMPORTED_MODULE_1__.EMPTY_STR); // value is a required arg but irrelevant here; only the remapped key is used
9610
+ return remappedKey;
8270
9611
  }
8271
9612
  }
8272
9613
 
@@ -8351,6 +9692,8 @@ class XhrRequest extends _util_AsyncRunnable__WEBPACK_IMPORTED_MODULE_0__.AsyncR
8351
9692
  this.timeout = timeout;
8352
9693
  this.ajaxType = ajaxType;
8353
9694
  this.contentType = contentType;
9695
+ this.ERR_INVALID_RESPONSE = "Invalid Response";
9696
+ this.ERR_EMPTY_RESPONSE = "Empty Response";
8354
9697
  this.stopProgress = false;
8355
9698
  this.xhrObject = new XMLHttpRequest();
8356
9699
  // we omit promises here because we have to deal with cancel functionality,
@@ -8359,12 +9702,9 @@ class XhrRequest extends _util_AsyncRunnable__WEBPACK_IMPORTED_MODULE_0__.AsyncR
8359
9702
  this.registerXhrCallbacks((data) => this.resolve(data), (data) => this.reject(data));
8360
9703
  }
8361
9704
  start() {
8362
- let ignoreErr = failSaveExecute;
8363
- let xhrObject = this.xhrObject;
8364
- let sourceForm = mona_dish__WEBPACK_IMPORTED_MODULE_1__.DQ.byId(this.internalContext.getIf(_core_Const__WEBPACK_IMPORTED_MODULE_7__.CTX_PARAM_SRC_FRM_ID).value);
8365
- let executesArr = () => {
8366
- return this.requestContext.getIf(_core_Const__WEBPACK_IMPORTED_MODULE_7__.CTX_PARAM_REQ_PASS_THR, _core_Const__WEBPACK_IMPORTED_MODULE_7__.P_EXECUTE).get(_core_Const__WEBPACK_IMPORTED_MODULE_7__.IDENT_NONE).value.split(/\s+/gi);
8367
- };
9705
+ const ignoreErr = failSaveExecute;
9706
+ const xhrObject = this.xhrObject;
9707
+ const sourceForm = mona_dish__WEBPACK_IMPORTED_MODULE_1__.DQ.byId(this.internalContext.getIf(_core_Const__WEBPACK_IMPORTED_MODULE_7__.CTX_PARAM_SRC_FRM_ID).value);
8368
9708
  try {
8369
9709
  // encoded we need to decode
8370
9710
  // We generated a base representation of the current form
@@ -8374,10 +9714,9 @@ class XhrRequest extends _util_AsyncRunnable__WEBPACK_IMPORTED_MODULE_0__.AsyncR
8374
9714
  // whatever the formData object delivers
8375
9715
  // the partialIdsArray arr is almost deprecated legacy code where we allowed to send a separate list of partial
8376
9716
  // ids for reduced load and server processing, this will be removed soon, we can handle the same via execute
8377
- const executes = executesArr();
9717
+ const executes = this.requestContext.getIf(_core_Const__WEBPACK_IMPORTED_MODULE_7__.CTX_PARAM_REQ_PASS_THR, _core_Const__WEBPACK_IMPORTED_MODULE_7__.P_EXECUTE).get(_core_Const__WEBPACK_IMPORTED_MODULE_7__.IDENT_NONE).value.split(/\s+/gi);
8378
9718
  const partialIdsArray = this.internalContext.getIf(_core_Const__WEBPACK_IMPORTED_MODULE_7__.CTX_PARAM_PPS).value === true ? executes : [];
8379
9719
  const formData = new _XhrFormData__WEBPACK_IMPORTED_MODULE_3__.XhrFormData(sourceForm, (0,_RequestDataResolver__WEBPACK_IMPORTED_MODULE_8__.resoveNamingContainerMapper)(this.internalContext), executes, partialIdsArray);
8380
- this.contentType = formData.isMultipartRequest ? "undefined" : this.contentType;
8381
9720
  // next step the pass through parameters are merged in for post params
8382
9721
  this.requestContext.$nspEnabled = false;
8383
9722
  const requestContext = this.requestContext;
@@ -8407,18 +9746,16 @@ class XhrRequest extends _util_AsyncRunnable__WEBPACK_IMPORTED_MODULE_0__.AsyncR
8407
9746
  responseContext.assign(_core_Const__WEBPACK_IMPORTED_MODULE_7__.ON_EVENT).value = requestContext.getIf(_core_Const__WEBPACK_IMPORTED_MODULE_7__.ON_EVENT).value;
8408
9747
  responseContext.assign(_core_Const__WEBPACK_IMPORTED_MODULE_7__.ON_ERROR).value = requestContext.getIf(_core_Const__WEBPACK_IMPORTED_MODULE_7__.ON_ERROR).value;
8409
9748
  xhrObject.open(this.ajaxType, (0,_RequestDataResolver__WEBPACK_IMPORTED_MODULE_8__.resolveFinalUrl)(sourceForm, formData, this.ajaxType), true);
8410
- // adding timeout
8411
- this.timeout ? xhrObject.timeout = this.timeout : null;
9749
+ if (this.timeout)
9750
+ xhrObject.timeout = this.timeout;
8412
9751
  // a bug in the xhr stub library prevents the setRequestHeader to be properly executed on fake xhr objects
8413
9752
  // normal browsers should resolve this
8414
9753
  // tests can quietly fail on this one
8415
- if (this.contentType != "undefined") {
9754
+ if (!formData.isMultipartRequest) {
8416
9755
  ignoreErr(() => xhrObject.setRequestHeader(_core_Const__WEBPACK_IMPORTED_MODULE_7__.CONTENT_TYPE, `${this.contentType}; charset=utf-8`));
8417
9756
  }
8418
9757
  ignoreErr(() => xhrObject.setRequestHeader(_core_Const__WEBPACK_IMPORTED_MODULE_7__.HEAD_FACES_REQ, _core_Const__WEBPACK_IMPORTED_MODULE_7__.VAL_AJAX));
8419
- // probably not needed anymore, will test this
8420
- // some webkit based mobile browsers do not follow the w3c spec of
8421
- // setting, they accept headers automatically
9758
+ // some webkit based mobile browsers do not follow the w3c spec for Accept headers
8422
9759
  ignoreErr(() => xhrObject.setRequestHeader(_core_Const__WEBPACK_IMPORTED_MODULE_7__.REQ_ACCEPT, _core_Const__WEBPACK_IMPORTED_MODULE_7__.STD_ACCEPT));
8423
9760
  this.sendEvent(_core_Const__WEBPACK_IMPORTED_MODULE_7__.BEGIN);
8424
9761
  this.sendRequest(formData);
@@ -8449,7 +9786,6 @@ class XhrRequest extends _util_AsyncRunnable__WEBPACK_IMPORTED_MODULE_0__.AsyncR
8449
9786
  * @param reject
8450
9787
  */
8451
9788
  registerXhrCallbacks(resolve, reject) {
8452
- var _a, _b;
8453
9789
  const xhrObject = this.xhrObject;
8454
9790
  xhrObject.onabort = () => {
8455
9791
  this.onAbort(resolve, reject);
@@ -8463,50 +9799,11 @@ class XhrRequest extends _util_AsyncRunnable__WEBPACK_IMPORTED_MODULE_0__.AsyncR
8463
9799
  xhrObject.onloadend = () => {
8464
9800
  this.onResponseProcessed(this.xhrObject, resolve);
8465
9801
  };
8466
- if (xhrObject === null || xhrObject === void 0 ? void 0 : xhrObject.upload) {
8467
- //this is an extension so that we can send the upload object of the current
8468
- //request before any operation
8469
- (_b = (_a = this.internalContext.getIf(_core_Const__WEBPACK_IMPORTED_MODULE_7__.CTX_PARAM_UPLOAD_PREINIT)).value) === null || _b === void 0 ? void 0 : _b.call(_a, xhrObject.upload);
8470
- //now we hook in the upload events
8471
- xhrObject.upload.addEventListener("progress", (event) => {
8472
- var _a, _b;
8473
- (_b = (_a = this.internalContext.getIf(_core_Const__WEBPACK_IMPORTED_MODULE_7__.CTX_PARAM_UPLOAD_ON_PROGRESS)).value) === null || _b === void 0 ? void 0 : _b.call(_a, xhrObject.upload, event);
8474
- });
8475
- xhrObject.upload.addEventListener("load", (event) => {
8476
- var _a, _b;
8477
- (_b = (_a = this.internalContext.getIf(_core_Const__WEBPACK_IMPORTED_MODULE_7__.CTX_PARAM_UPLOAD_LOAD)).value) === null || _b === void 0 ? void 0 : _b.call(_a, xhrObject.upload, event);
8478
- });
8479
- xhrObject.upload.addEventListener("loadstart", (event) => {
8480
- var _a, _b;
8481
- (_b = (_a = this.internalContext.getIf(_core_Const__WEBPACK_IMPORTED_MODULE_7__.CTX_PARAM_UPLOAD_LOADSTART)).value) === null || _b === void 0 ? void 0 : _b.call(_a, xhrObject.upload, event);
8482
- });
8483
- xhrObject.upload.addEventListener("loadend", (event) => {
8484
- var _a, _b;
8485
- (_b = (_a = this.internalContext.getIf(_core_Const__WEBPACK_IMPORTED_MODULE_7__.CTX_PARAM_UPLOAD_LOADEND)).value) === null || _b === void 0 ? void 0 : _b.call(_a, xhrObject.upload, event);
8486
- });
8487
- xhrObject.upload.addEventListener("abort", (event) => {
8488
- var _a, _b;
8489
- (_b = (_a = this.internalContext.getIf(_core_Const__WEBPACK_IMPORTED_MODULE_7__.CTX_PARAM_UPLOAD_ABORT)).value) === null || _b === void 0 ? void 0 : _b.call(_a, xhrObject.upload, event);
8490
- });
8491
- xhrObject.upload.addEventListener("timeout", (event) => {
8492
- var _a, _b;
8493
- (_b = (_a = this.internalContext.getIf(_core_Const__WEBPACK_IMPORTED_MODULE_7__.CTX_PARAM_UPLOAD_TIMEOUT)).value) === null || _b === void 0 ? void 0 : _b.call(_a, xhrObject.upload, event);
8494
- });
8495
- xhrObject.upload.addEventListener("error", (event) => {
8496
- var _a, _b;
8497
- (_b = (_a = this.internalContext.getIf(_core_Const__WEBPACK_IMPORTED_MODULE_7__.CTX_PARAM_UPLOAD_ERROR)).value) === null || _b === void 0 ? void 0 : _b.call(_a, xhrObject.upload, event);
8498
- });
8499
- }
9802
+ this.registerUploadCallbacks(xhrObject);
8500
9803
  xhrObject.onerror = (errorData) => {
8501
- // Safari in rare cases triggers an error when cancelling a request internally, or when
8502
- // in this case we simply ignore the request and clear up the queue, because
8503
- // it is not safe anymore to proceed with the current queue
8504
- // This bypasses a Safari issue where it keeps requests hanging after page unload
8505
- // and then triggers a cancel error on then instead of just stopping
8506
- // and clearing the code
8507
- // in a page unload case it is safe to clear the queue
8508
- // in the exact safari case any request after this one in the queue is invalid
8509
- // because the queue references xhr requests to a page which already is gone!
9804
+ // Older Safari/WebKit and Chrome/Chromium versions can cancel XHRs during
9805
+ // navigation or download handoff by triggering onerror with status=0/readyState=4.
9806
+ // Treat that as queue cleanup rather than reporting a user-facing Ajax error.
8510
9807
  if (this.isCancelledResponse(this.xhrObject)) {
8511
9808
  /*
8512
9809
  * this triggers the catch chain and after that finally
@@ -8522,6 +9819,42 @@ class XhrRequest extends _util_AsyncRunnable__WEBPACK_IMPORTED_MODULE_0__.AsyncR
8522
9819
  this.handleError(errorData);
8523
9820
  };
8524
9821
  }
9822
+ registerUploadCallbacks(xhrObject) {
9823
+ var _a, _b;
9824
+ if (!(xhrObject === null || xhrObject === void 0 ? void 0 : xhrObject.upload)) {
9825
+ return;
9826
+ }
9827
+ // fire the pre-init hook so callers can inspect the upload object before any transfer starts
9828
+ (_b = (_a = this.internalContext.getIf(_core_Const__WEBPACK_IMPORTED_MODULE_7__.CTX_PARAM_UPLOAD_PREINIT)).value) === null || _b === void 0 ? void 0 : _b.call(_a, xhrObject.upload);
9829
+ xhrObject.upload.addEventListener("progress", (event) => {
9830
+ var _a, _b;
9831
+ (_b = (_a = this.internalContext.getIf(_core_Const__WEBPACK_IMPORTED_MODULE_7__.CTX_PARAM_UPLOAD_ON_PROGRESS)).value) === null || _b === void 0 ? void 0 : _b.call(_a, xhrObject.upload, event);
9832
+ });
9833
+ xhrObject.upload.addEventListener("load", (event) => {
9834
+ var _a, _b;
9835
+ (_b = (_a = this.internalContext.getIf(_core_Const__WEBPACK_IMPORTED_MODULE_7__.CTX_PARAM_UPLOAD_LOAD)).value) === null || _b === void 0 ? void 0 : _b.call(_a, xhrObject.upload, event);
9836
+ });
9837
+ xhrObject.upload.addEventListener("loadstart", (event) => {
9838
+ var _a, _b;
9839
+ (_b = (_a = this.internalContext.getIf(_core_Const__WEBPACK_IMPORTED_MODULE_7__.CTX_PARAM_UPLOAD_LOADSTART)).value) === null || _b === void 0 ? void 0 : _b.call(_a, xhrObject.upload, event);
9840
+ });
9841
+ xhrObject.upload.addEventListener("loadend", (event) => {
9842
+ var _a, _b;
9843
+ (_b = (_a = this.internalContext.getIf(_core_Const__WEBPACK_IMPORTED_MODULE_7__.CTX_PARAM_UPLOAD_LOADEND)).value) === null || _b === void 0 ? void 0 : _b.call(_a, xhrObject.upload, event);
9844
+ });
9845
+ xhrObject.upload.addEventListener("abort", (event) => {
9846
+ var _a, _b;
9847
+ (_b = (_a = this.internalContext.getIf(_core_Const__WEBPACK_IMPORTED_MODULE_7__.CTX_PARAM_UPLOAD_ABORT)).value) === null || _b === void 0 ? void 0 : _b.call(_a, xhrObject.upload, event);
9848
+ });
9849
+ xhrObject.upload.addEventListener("timeout", (event) => {
9850
+ var _a, _b;
9851
+ (_b = (_a = this.internalContext.getIf(_core_Const__WEBPACK_IMPORTED_MODULE_7__.CTX_PARAM_UPLOAD_TIMEOUT)).value) === null || _b === void 0 ? void 0 : _b.call(_a, xhrObject.upload, event);
9852
+ });
9853
+ xhrObject.upload.addEventListener("error", (event) => {
9854
+ var _a, _b;
9855
+ (_b = (_a = this.internalContext.getIf(_core_Const__WEBPACK_IMPORTED_MODULE_7__.CTX_PARAM_UPLOAD_ERROR)).value) === null || _b === void 0 ? void 0 : _b.call(_a, xhrObject.upload, event);
9856
+ });
9857
+ }
8525
9858
  isCancelledResponse(currentTarget) {
8526
9859
  return (currentTarget === null || currentTarget === void 0 ? void 0 : currentTarget.status) === 0 && // cancelled internally by browser
8527
9860
  (currentTarget === null || currentTarget === void 0 ? void 0 : currentTarget.readyState) === 4 &&
@@ -8534,29 +9867,10 @@ class XhrRequest extends _util_AsyncRunnable__WEBPACK_IMPORTED_MODULE_0__.AsyncR
8534
9867
  * Those methods are the callbacks called by
8535
9868
  * the xhr object depending on its own state
8536
9869
  */
8537
- /**
8538
- * client side abort... also here for now we clean the queue
8539
- *
8540
- * @param resolve
8541
- * @param reject
8542
- * @private
8543
- */
8544
- onAbort(resolve, reject) {
8545
- // reject means clear queue, in this case we abort entirely the processing
8546
- // does not happen yet, we have to probably rethink this strategy in the future
8547
- // when we introduce cancel functionality
9870
+ onAbort(_resolve, reject) {
8548
9871
  this.handleHttpError(reject);
8549
9872
  }
8550
- /**
8551
- * request timeout, this must be handled like a generic server error per spec
8552
- * unfortunately, so we have to jump to the next item (we cancelled before)
8553
- * @param resolve
8554
- * @param reject
8555
- * @private
8556
- */
8557
- onTimeout(resolve, reject) {
8558
- // timeout also means we we probably should clear the queue,
8559
- // the state is unsafe for the next requests
9873
+ onTimeout(resolve, _reject) {
8560
9874
  this.sendEvent(_core_Const__WEBPACK_IMPORTED_MODULE_7__.STATE_EVT_TIMEOUT);
8561
9875
  this.handleHttpError(resolve);
8562
9876
  }
@@ -8581,29 +9895,26 @@ class XhrRequest extends _util_AsyncRunnable__WEBPACK_IMPORTED_MODULE_0__.AsyncR
8581
9895
  const responseXML = new mona_dish__WEBPACK_IMPORTED_MODULE_1__.XMLQuery((_a = this.xhrObject) === null || _a === void 0 ? void 0 : _a.responseXML);
8582
9896
  const responseText = (_c = (_b = this.xhrObject) === null || _b === void 0 ? void 0 : _b.responseText) !== null && _c !== void 0 ? _c : "";
8583
9897
  const responseCode = (_e = (_d = this.xhrObject) === null || _d === void 0 ? void 0 : _d.status) !== null && _e !== void 0 ? _e : -1;
9898
+ // HTTP status takes priority: a non-2xx response is always an HTTP error,
9899
+ // regardless of what the body contains (e.g. an HTML error page from a 404
9900
+ // must not be misreported as malformedXML).
9901
+ if (responseCode >= 300 || responseCode < 200) {
9902
+ this.handleHttpError(resolve);
9903
+ return true;
9904
+ }
8584
9905
  if (responseXML.isXMLParserError()) {
8585
9906
  // Firefox: malformed XML produces a Document with <parsererror>
8586
- const errorName = "Invalid Response";
8587
- const errorMessage = "The response xml is invalid";
8588
- this.handleGenericResponseError(errorName, errorMessage, _core_Const__WEBPACK_IMPORTED_MODULE_7__.MALFORMEDXML, resolve);
9907
+ this.handleGenericResponseError(this.ERR_INVALID_RESPONSE, "The response xml is invalid", _core_Const__WEBPACK_IMPORTED_MODULE_7__.MALFORMEDXML, resolve);
8589
9908
  return true;
8590
9909
  }
8591
9910
  else if (responseXML.isAbsent() && responseText.trim().length > 0) {
8592
9911
  // Chrome: responseXML is null for unparseable XML, but responseText has content
8593
- const errorName = "Invalid Response";
8594
- const errorMessage = "The response xml is invalid";
8595
- this.handleGenericResponseError(errorName, errorMessage, _core_Const__WEBPACK_IMPORTED_MODULE_7__.MALFORMEDXML, resolve);
9912
+ this.handleGenericResponseError(this.ERR_INVALID_RESPONSE, "The response xml is invalid", _core_Const__WEBPACK_IMPORTED_MODULE_7__.MALFORMEDXML, resolve);
8596
9913
  return true;
8597
9914
  }
8598
9915
  else if (responseXML.isAbsent()) {
8599
9916
  // Truly empty response
8600
- const errorName = "Empty Response";
8601
- const errorMessage = "The response has provided no data";
8602
- this.handleGenericResponseError(errorName, errorMessage, _core_Const__WEBPACK_IMPORTED_MODULE_7__.EMPTY_RESPONSE, resolve);
8603
- return true;
8604
- }
8605
- else if (responseCode >= 300 || responseCode < 200) {
8606
- this.handleHttpError(resolve);
9917
+ this.handleGenericResponseError(this.ERR_EMPTY_RESPONSE, "The response has provided no data", _core_Const__WEBPACK_IMPORTED_MODULE_7__.EMPTY_RESPONSE, resolve);
8607
9918
  return true;
8608
9919
  }
8609
9920
  return false;
@@ -8613,7 +9924,7 @@ class XhrRequest extends _util_AsyncRunnable__WEBPACK_IMPORTED_MODULE_0__.AsyncR
8613
9924
  const errorData = new _ErrorData__WEBPACK_IMPORTED_MODULE_4__.ErrorData(this.internalContext.getIf(_core_Const__WEBPACK_IMPORTED_MODULE_7__.CTX_PARAM_SRC_CTL_ID).value, errorName, errorMessage, (_b = (_a = this.xhrObject) === null || _a === void 0 ? void 0 : _a.responseText) !== null && _b !== void 0 ? _b : "", (_d = (_c = this.xhrObject) === null || _c === void 0 ? void 0 : _c.responseXML) !== null && _d !== void 0 ? _d : null, this.xhrObject.status, responseStatus);
8614
9925
  this.finalizeError(errorData, resolve);
8615
9926
  }
8616
- handleHttpError(resolveOrReject, errorMessage = "Generic HTTP Serror") {
9927
+ handleHttpError(resolveOrReject, errorMessage = "Generic HTTP Error") {
8617
9928
  var _a, _b, _c, _d, _e, _f;
8618
9929
  this.stopProgress = true;
8619
9930
  const errorData = new _ErrorData__WEBPACK_IMPORTED_MODULE_4__.ErrorData(this.internalContext.getIf(_core_Const__WEBPACK_IMPORTED_MODULE_7__.CTX_PARAM_SRC_CTL_ID).value, _core_Const__WEBPACK_IMPORTED_MODULE_7__.HTTP_ERROR, errorMessage, (_b = (_a = this.xhrObject) === null || _a === void 0 ? void 0 : _a.responseText) !== null && _b !== void 0 ? _b : "", (_d = (_c = this.xhrObject) === null || _c === void 0 ? void 0 : _c.responseXML) !== null && _d !== void 0 ? _d : null, (_f = (_e = this.xhrObject) === null || _e === void 0 ? void 0 : _e.status) !== null && _f !== void 0 ? _f : -1, _core_Const__WEBPACK_IMPORTED_MODULE_7__.HTTP_ERROR);
@@ -8631,33 +9942,17 @@ class XhrRequest extends _util_AsyncRunnable__WEBPACK_IMPORTED_MODULE_0__.AsyncR
8631
9942
  this.stopProgress = true;
8632
9943
  }
8633
9944
  }
8634
- /**
8635
- * last minute cleanup, the request now either is fully done
8636
- * or not by having had a cancel or error event be
8637
- * @param data
8638
- * @param resolve
8639
- * @private
8640
- */
8641
9945
  onResponseProcessed(data, resolve) {
8642
- // if stop progress true, the cleanup already has been performed
8643
- if (this.stopProgress) {
8644
- return;
9946
+ if (!this.stopProgress) {
9947
+ resolve(data);
8645
9948
  }
8646
- /*
8647
- * normal case, cleanup == next item if possible
8648
- */
8649
- resolve(data);
8650
9949
  }
8651
9950
  sendRequest(formData) {
8652
- const isPost = this.ajaxType != _core_Const__WEBPACK_IMPORTED_MODULE_7__.REQ_TYPE_GET;
8653
- if (formData.isMultipartRequest) {
8654
- // in case of a multipart request we send in a formData object as body
8655
- this.xhrObject.send((isPost) ? formData.toFormData() : null);
8656
- }
8657
- else {
8658
- // in case of a normal request we send it normally
8659
- this.xhrObject.send((isPost) ? formData.toString() : null);
9951
+ if (this.ajaxType === _core_Const__WEBPACK_IMPORTED_MODULE_7__.REQ_TYPE_GET) {
9952
+ this.xhrObject.send(null);
9953
+ return;
8660
9954
  }
9955
+ this.xhrObject.send(formData.isMultipartRequest ? formData.toFormData() : formData.toString());
8661
9956
  }
8662
9957
  /*
8663
9958
  * other helpers
@@ -8670,7 +9965,7 @@ class XhrRequest extends _util_AsyncRunnable__WEBPACK_IMPORTED_MODULE_0__.AsyncR
8670
9965
  // this in onError, but also we cannot swallow it.
8671
9966
  // We need to resolve the local handlers lazily,
8672
9967
  // because some frameworks might decorate them over the context in the response
8673
- let eventHandler = (0,_RequestDataResolver__WEBPACK_IMPORTED_MODULE_8__.resolveHandlerFunc)(this.requestContext, this.responseContext, _core_Const__WEBPACK_IMPORTED_MODULE_7__.ON_EVENT);
9968
+ const eventHandler = (0,_RequestDataResolver__WEBPACK_IMPORTED_MODULE_8__.resolveHandlerFunc)(this.requestContext, this.responseContext, _core_Const__WEBPACK_IMPORTED_MODULE_7__.ON_EVENT);
8674
9969
  _AjaxImpl__WEBPACK_IMPORTED_MODULE_2__.Implementation.sendEvent(eventData, eventHandler);
8675
9970
  }
8676
9971
  catch (e) {
@@ -8687,17 +9982,19 @@ class XhrRequest extends _util_AsyncRunnable__WEBPACK_IMPORTED_MODULE_0__.AsyncR
8687
9982
  }
8688
9983
  handleError(exception, responseFormatError = false) {
8689
9984
  var _a;
8690
- const errorData = (responseFormatError) ? _ErrorData__WEBPACK_IMPORTED_MODULE_4__.ErrorData.fromHttpConnection(exception.source, exception.type, (_a = exception.message) !== null && _a !== void 0 ? _a : _core_Const__WEBPACK_IMPORTED_MODULE_7__.EMPTY_STR, exception.responseText, exception.responseXML, exception.responseCode, exception.status) : _ErrorData__WEBPACK_IMPORTED_MODULE_4__.ErrorData.fromClient(exception);
9985
+ const errorData = responseFormatError
9986
+ ? _ErrorData__WEBPACK_IMPORTED_MODULE_4__.ErrorData.fromHttpConnection(exception.source, exception.type, (_a = exception.message) !== null && _a !== void 0 ? _a : _core_Const__WEBPACK_IMPORTED_MODULE_7__.EMPTY_STR, exception.responseText, exception.responseXML, exception.responseCode, exception.status)
9987
+ : _ErrorData__WEBPACK_IMPORTED_MODULE_4__.ErrorData.fromClient(exception);
8691
9988
  const eventHandler = (0,_RequestDataResolver__WEBPACK_IMPORTED_MODULE_8__.resolveHandlerFunc)(this.requestContext, this.responseContext, _core_Const__WEBPACK_IMPORTED_MODULE_7__.ON_ERROR);
8692
9989
  _AjaxImpl__WEBPACK_IMPORTED_MODULE_2__.Implementation.sendError(errorData, eventHandler);
8693
9990
  }
8694
9991
  appendIssuingItem(formData) {
8695
9992
  var _a, _b;
8696
9993
  const issuingItemId = this.internalContext.getIf(_core_Const__WEBPACK_IMPORTED_MODULE_7__.CTX_PARAM_SRC_CTL_ID).value;
8697
- //to avoid sideffects with buttons we only can append the issuing item if no behavior event is set
9994
+ //to avoid side effects with buttons we only can append the issuing item if no behavior event is set
8698
9995
  //MYFACES-4679!
8699
9996
  const eventType = (_b = (_a = formData.getIf((0,_core_Const__WEBPACK_IMPORTED_MODULE_7__.$nsp)(_core_Const__WEBPACK_IMPORTED_MODULE_7__.P_BEHAVIOR_EVENT)).value) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : null;
8700
- const isBehaviorEvent = (!!eventType) && eventType != 'click';
9997
+ const isBehaviorEvent = !!eventType && eventType !== 'click';
8701
9998
  //not encoded
8702
9999
  if (issuingItemId && formData.getIf(issuingItemId).isAbsent() && !isBehaviorEvent) {
8703
10000
  const issuingItem = mona_dish__WEBPACK_IMPORTED_MODULE_1__.DQ.byId(issuingItemId);
@@ -8706,10 +10003,11 @@ class XhrRequest extends _util_AsyncRunnable__WEBPACK_IMPORTED_MODULE_0__.AsyncR
8706
10003
  const type = issuingItem.type.orElse("").value.toLowerCase();
8707
10004
  //Checkbox and radio only value pass if checked is set, otherwise they should not show
8708
10005
  //up at all, and if checked is set, they either can have a value or simply being boolean
8709
- if ((type == XhrRequest.TYPE_CHECKBOX || type == XhrRequest.TYPE_RADIO) && !issuingItem.checked) {
10006
+ const isCheckable = type === XhrRequest.TYPE_CHECKBOX || type === XhrRequest.TYPE_RADIO;
10007
+ if (isCheckable && !issuingItem.checked) {
8710
10008
  return;
8711
10009
  }
8712
- else if ((type == XhrRequest.TYPE_CHECKBOX || type == XhrRequest.TYPE_RADIO)) {
10010
+ else if (isCheckable) {
8713
10011
  arr.assign(issuingItemId).value = itemValue.orElse(true).value;
8714
10012
  }
8715
10013
  else if (itemValue.isPresent()) {
@@ -8775,7 +10073,8 @@ var oam;
8775
10073
  * @param value the value to be rendered
8776
10074
  */
8777
10075
  oam.setHiddenInput = function (formName, name, value) {
8778
- mona_dish__WEBPACK_IMPORTED_MODULE_0__.DQ.byId(document.forms[formName])
10076
+ const forms = document.forms;
10077
+ mona_dish__WEBPACK_IMPORTED_MODULE_0__.DQ.byId(forms[formName])
8779
10078
  .each(form => {
8780
10079
  const input = form.querySelectorAll(`input[type='hidden'][name='${name}']`);
8781
10080
  if (input.isPresent()) {
@@ -8795,8 +10094,10 @@ var oam;
8795
10094
  * @param name the name of the input field
8796
10095
  */
8797
10096
  oam.clearHiddenInput = function (formName, name) {
8798
- var _a, _b, _c;
8799
- let element = (_c = (_b = (_a = document.forms) === null || _a === void 0 ? void 0 : _a[formName]) === null || _b === void 0 ? void 0 : _b.elements) === null || _c === void 0 ? void 0 : _c[name];
10097
+ var _a;
10098
+ const forms = document.forms;
10099
+ const elements = (_a = forms === null || forms === void 0 ? void 0 : forms[formName]) === null || _a === void 0 ? void 0 : _a.elements;
10100
+ let element = elements === null || elements === void 0 ? void 0 : elements[name];
8800
10101
  if (!element) {
8801
10102
  return;
8802
10103
  }
@@ -8814,7 +10115,7 @@ var oam;
8814
10115
  * @param params
8815
10116
  */
8816
10117
  oam.submitForm = function (formName, linkId = null, target = null, params = {}) {
8817
- var _a, _b, _c, _d, _e, _f;
10118
+ var _a, _b, _c, _d, _e;
8818
10119
  //handle a possible incoming null, not sure if this is used that way anywhere, but we allow it
8819
10120
  params = (!params) ? {} : params;
8820
10121
  let clearFn = 'clearFormHiddenParams_' + formName.replace(/-/g, '\$:').replace(/:/g, '_');
@@ -8827,7 +10128,8 @@ var oam;
8827
10128
  paramsStream.forEach(([key, data]) => myfaces.oam.setHiddenInput(formName, key, data));
8828
10129
  //we call the namespaced function, to allow decoration, via a direct call we would
8829
10130
  myfaces.oam.setHiddenInput(formName, `${formName}:_idcl`, linkId !== null && linkId !== void 0 ? linkId : '');
8830
- mona_dish__WEBPACK_IMPORTED_MODULE_0__.DQ.byId((_f = (_e = document.forms) === null || _e === void 0 ? void 0 : _e[formName]) !== null && _f !== void 0 ? _f : document.getElementById(formName)).each(form => {
10131
+ const forms = document.forms;
10132
+ mona_dish__WEBPACK_IMPORTED_MODULE_0__.DQ.byId((_e = forms === null || forms === void 0 ? void 0 : forms[formName]) !== null && _e !== void 0 ? _e : document.getElementById(formName)).each(form => {
8831
10133
  var _a;
8832
10134
  const ATTR_TARGET = "target";
8833
10135
  const formElement = form.getAsElem(0).value;
@@ -8966,7 +10268,7 @@ __webpack_require__.r(__webpack_exports__);
8966
10268
  * limitations under the License.
8967
10269
  */
8968
10270
 
8969
- var _a, _b, _c, _d, _e;
10271
+ var _a, _b, _c;
8970
10272
  /**
8971
10273
  * jsf.js init layer which provides as per spec the proper
8972
10274
  * window namespace if it does not exist already
@@ -8974,32 +10276,23 @@ var _a, _b, _c, _d, _e;
8974
10276
  * on jsf2.3 or earlier level, for 4.0+ please include faces.js
8975
10277
  */
8976
10278
  if (!(window === null || window === void 0 ? void 0 : window.jsf)) {
8977
- const faces = (__webpack_require__(/*! ./_api */ "./src/main/typescript/api/_api.ts").faces);
8978
- window['jsf'] = (_a = window === null || window === void 0 ? void 0 : window.jsf) !== null && _a !== void 0 ? _a : faces;
10279
+ const myfacesApi = (__webpack_require__(/*! ./_api */ "./src/main/typescript/api/_api.ts").faces);
10280
+ window['jsf'] = (_a = window === null || window === void 0 ? void 0 : window.jsf) !== null && _a !== void 0 ? _a : Object.assign(Object.assign({}, myfacesApi), { push: Object.assign({}, myfacesApi.push) });
8979
10281
  window.jsf.specversion = 230000;
8980
10282
  delete window.jsf.contextpath;
8981
- let faces4Init = faces.push.init;
8982
10283
  /*
8983
10284
  * we shim back the breaking api change from 3.0 to 4.0
8984
- * onerror is gone
10285
+ * JSF 2.3 did not expose a websocket onerror callback.
8985
10286
  */
8986
- faces.push.init = (socketClientId, url, channel, onopen, onmessage,
8987
- // no on error api change for 4.0
8988
- //onerror: Function,
8989
- onclose, behaviors, autoConnect) => {
8990
- faces4Init(socketClientId, url, channel, onopen, onmessage, null, onclose, behaviors, autoConnect);
10287
+ window.jsf.push.init = (socketClientId, url, channel, onopen, onmessage, onclose, behaviors, autoConnect) => {
10288
+ myfacesApi.push.init(socketClientId, url, channel, onopen, onmessage, null, onclose, behaviors, autoConnect);
8991
10289
  };
8992
10290
  }
8993
10291
  if (!((_b = window === null || window === void 0 ? void 0 : window.myfaces) === null || _b === void 0 ? void 0 : _b.ab)) {
8994
10292
  const myfaces = (__webpack_require__(/*! ./_api */ "./src/main/typescript/api/_api.ts").myfaces);
8995
10293
  //namespace might be extended is not exclusively reserved so we merge
8996
10294
  window["myfaces"] = (_c = window === null || window === void 0 ? void 0 : window.myfaces) !== null && _c !== void 0 ? _c : {};
8997
- if (!((_d = window === null || window === void 0 ? void 0 : window.myfaces) === null || _d === void 0 ? void 0 : _d.ab)) {
8998
- const myfaces = (__webpack_require__(/*! ./_api */ "./src/main/typescript/api/_api.ts").myfaces);
8999
- //namespace might be extended is not exclusively reserved so we merge
9000
- window["myfaces"] = (_e = window === null || window === void 0 ? void 0 : window.myfaces) !== null && _e !== void 0 ? _e : {};
9001
- Object.keys(myfaces).forEach(key => { var _a, _b; return window.myfaces[key] = (_b = (_a = window.myfaces) === null || _a === void 0 ? void 0 : _a[key]) !== null && _b !== void 0 ? _b : myfaces[key]; });
9002
- }
10295
+ Object.keys(myfaces).forEach(key => { var _a, _b; return window.myfaces[key] = (_b = (_a = window.myfaces) === null || _a === void 0 ? void 0 : _a[key]) !== null && _b !== void 0 ? _b : myfaces[key]; });
9003
10296
  }
9004
10297
  var jsf = window.jsf;
9005
10298
  var myfaces = window.myfaces;