@wise/dynamic-flow-client 5.15.1 → 5.17.0

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 (186) hide show
  1. package/build/i18n/cs.json +3 -0
  2. package/build/i18n/de.json +3 -0
  3. package/build/i18n/en.json +3 -0
  4. package/build/i18n/es.json +3 -0
  5. package/build/i18n/fr.json +3 -0
  6. package/build/i18n/hu.json +3 -0
  7. package/build/i18n/id.json +3 -0
  8. package/build/i18n/it.json +3 -0
  9. package/build/i18n/ja.json +3 -0
  10. package/build/i18n/nl.json +3 -0
  11. package/build/i18n/pl.json +3 -0
  12. package/build/i18n/pt.json +3 -0
  13. package/build/i18n/ro.json +3 -0
  14. package/build/i18n/ru.json +3 -0
  15. package/build/i18n/th.json +3 -0
  16. package/build/i18n/tr.json +3 -0
  17. package/build/i18n/uk.json +3 -0
  18. package/build/i18n/zh_CN.json +5 -2
  19. package/build/i18n/zh_HK.json +3 -0
  20. package/build/main.js +1058 -857
  21. package/build/main.mjs +1057 -856
  22. package/build/tsconfig.types.tsbuildinfo +1 -1
  23. package/build/types/common/messages/download.messages.d.ts +19 -0
  24. package/build/types/common/messages/download.messages.d.ts.map +1 -0
  25. package/build/types/controller/FlowController.d.ts +32 -3
  26. package/build/types/controller/FlowController.d.ts.map +1 -1
  27. package/build/types/controller/executeDownload.d.ts +11 -0
  28. package/build/types/controller/executeDownload.d.ts.map +1 -0
  29. package/build/types/controller/executeRequest.d.ts.map +1 -1
  30. package/build/types/controller/getFilenameFromContentDisposition.d.ts +2 -0
  31. package/build/types/controller/getFilenameFromContentDisposition.d.ts.map +1 -0
  32. package/build/types/domain/components/AlertComponent.d.ts +1 -1
  33. package/build/types/domain/components/AlertComponent.d.ts.map +1 -1
  34. package/build/types/domain/components/AllOfComponent.d.ts +1 -1
  35. package/build/types/domain/components/AllOfComponent.d.ts.map +1 -1
  36. package/build/types/domain/components/BooleanInputComponent.d.ts +2 -2
  37. package/build/types/domain/components/BooleanInputComponent.d.ts.map +1 -1
  38. package/build/types/domain/components/BoxComponent.d.ts +1 -1
  39. package/build/types/domain/components/BoxComponent.d.ts.map +1 -1
  40. package/build/types/domain/components/ButtonComponent.d.ts +1 -1
  41. package/build/types/domain/components/ButtonComponent.d.ts.map +1 -1
  42. package/build/types/domain/components/ColumnsComponent.d.ts +1 -1
  43. package/build/types/domain/components/ColumnsComponent.d.ts.map +1 -1
  44. package/build/types/domain/components/ConstComponent.d.ts +1 -1
  45. package/build/types/domain/components/ConstComponent.d.ts.map +1 -1
  46. package/build/types/domain/components/ContainerComponent.d.ts +1 -1
  47. package/build/types/domain/components/ContainerComponent.d.ts.map +1 -1
  48. package/build/types/domain/components/DateInputComponent.d.ts +4 -3
  49. package/build/types/domain/components/DateInputComponent.d.ts.map +1 -1
  50. package/build/types/domain/components/DecisionComponent.d.ts +3 -2
  51. package/build/types/domain/components/DecisionComponent.d.ts.map +1 -1
  52. package/build/types/domain/components/FormComponent.d.ts +1 -1
  53. package/build/types/domain/components/FormComponent.d.ts.map +1 -1
  54. package/build/types/domain/components/FormattedValueComponent.d.ts +1 -1
  55. package/build/types/domain/components/FormattedValueComponent.d.ts.map +1 -1
  56. package/build/types/domain/components/HeadingComponent.d.ts +1 -1
  57. package/build/types/domain/components/HeadingComponent.d.ts.map +1 -1
  58. package/build/types/domain/components/ImageComponent.d.ts +1 -1
  59. package/build/types/domain/components/ImageComponent.d.ts.map +1 -1
  60. package/build/types/domain/components/InstructionsComponent.d.ts +1 -1
  61. package/build/types/domain/components/InstructionsComponent.d.ts.map +1 -1
  62. package/build/types/domain/components/IntegerInputComponent.d.ts +4 -3
  63. package/build/types/domain/components/IntegerInputComponent.d.ts.map +1 -1
  64. package/build/types/domain/components/ListComponent.d.ts +1 -1
  65. package/build/types/domain/components/ListComponent.d.ts.map +1 -1
  66. package/build/types/domain/components/LoadingIndicatorComponent.d.ts +1 -1
  67. package/build/types/domain/components/LoadingIndicatorComponent.d.ts.map +1 -1
  68. package/build/types/domain/components/MarkdownComponent.d.ts +1 -1
  69. package/build/types/domain/components/MarkdownComponent.d.ts.map +1 -1
  70. package/build/types/domain/components/ModalComponent.d.ts +1 -1
  71. package/build/types/domain/components/ModalComponent.d.ts.map +1 -1
  72. package/build/types/domain/components/ModalLayoutComponent.d.ts +1 -1
  73. package/build/types/domain/components/ModalLayoutComponent.d.ts.map +1 -1
  74. package/build/types/domain/components/MoneyInputComponent.d.ts +1 -1
  75. package/build/types/domain/components/MoneyInputComponent.d.ts.map +1 -1
  76. package/build/types/domain/components/MultiSelectInputComponent.d.ts +2 -2
  77. package/build/types/domain/components/MultiSelectInputComponent.d.ts.map +1 -1
  78. package/build/types/domain/components/MultiUploadInputComponent.d.ts +3 -3
  79. package/build/types/domain/components/MultiUploadInputComponent.d.ts.map +1 -1
  80. package/build/types/domain/components/NumberInputComponent.d.ts +4 -3
  81. package/build/types/domain/components/NumberInputComponent.d.ts.map +1 -1
  82. package/build/types/domain/components/ObjectComponent.d.ts +1 -1
  83. package/build/types/domain/components/ObjectComponent.d.ts.map +1 -1
  84. package/build/types/domain/components/ParagraphComponent.d.ts +1 -1
  85. package/build/types/domain/components/ParagraphComponent.d.ts.map +1 -1
  86. package/build/types/domain/components/PersistAsyncComponent.d.ts +1 -0
  87. package/build/types/domain/components/PersistAsyncComponent.d.ts.map +1 -1
  88. package/build/types/domain/components/ProgressComponent.d.ts +1 -1
  89. package/build/types/domain/components/ProgressComponent.d.ts.map +1 -1
  90. package/build/types/domain/components/RepeatableComponent.d.ts +5 -5
  91. package/build/types/domain/components/RepeatableComponent.d.ts.map +1 -1
  92. package/build/types/domain/components/ReviewComponent.d.ts +1 -1
  93. package/build/types/domain/components/ReviewComponent.d.ts.map +1 -1
  94. package/build/types/domain/components/RootDomainComponent.d.ts.map +1 -1
  95. package/build/types/domain/components/SectionComponent.d.ts.map +1 -1
  96. package/build/types/domain/components/SelectInputComponent.d.ts +2 -2
  97. package/build/types/domain/components/SelectInputComponent.d.ts.map +1 -1
  98. package/build/types/domain/components/StatusListComponent.d.ts +1 -1
  99. package/build/types/domain/components/StatusListComponent.d.ts.map +1 -1
  100. package/build/types/domain/components/SubflowComponent.d.ts +1 -1
  101. package/build/types/domain/components/SubflowComponent.d.ts.map +1 -1
  102. package/build/types/domain/components/TabsComponent.d.ts +1 -1
  103. package/build/types/domain/components/TabsComponent.d.ts.map +1 -1
  104. package/build/types/domain/components/TextInputComponent.d.ts +4 -3
  105. package/build/types/domain/components/TextInputComponent.d.ts.map +1 -1
  106. package/build/types/domain/components/TupleComponent.d.ts +1 -1
  107. package/build/types/domain/components/TupleComponent.d.ts.map +1 -1
  108. package/build/types/domain/components/UploadInputComponent.d.ts +2 -2
  109. package/build/types/domain/components/UploadInputComponent.d.ts.map +1 -1
  110. package/build/types/domain/components/UpsellComponent.d.ts +2 -2
  111. package/build/types/domain/components/UpsellComponent.d.ts.map +1 -1
  112. package/build/types/domain/components/searchComponent/SearchComponent.d.ts +3 -3
  113. package/build/types/domain/components/searchComponent/SearchComponent.d.ts.map +1 -1
  114. package/build/types/domain/components/step/ExternalConfirmationComponent.d.ts.map +1 -1
  115. package/build/types/domain/components/step/StepDomainComponent.d.ts +7 -2
  116. package/build/types/domain/components/step/StepDomainComponent.d.ts.map +1 -1
  117. package/build/types/domain/features/eventNames.d.ts +1 -1
  118. package/build/types/domain/features/eventNames.d.ts.map +1 -1
  119. package/build/types/domain/features/events.d.ts +2 -0
  120. package/build/types/domain/features/events.d.ts.map +1 -1
  121. package/build/types/domain/features/validation/spec-utils.d.ts.map +1 -1
  122. package/build/types/domain/features/validationAsync/getComponentValidationAsync.d.ts.map +1 -1
  123. package/build/types/domain/features/validationAsync/getInitialValidationAsyncState.d.ts.map +1 -1
  124. package/build/types/domain/features/validationAsync/getPerformValidationAsync.d.ts.map +1 -1
  125. package/build/types/domain/mappers/layout/decisionLayoutToComponent.d.ts.map +1 -1
  126. package/build/types/domain/mappers/layout/reviewLayoutToComponent.d.ts.map +1 -1
  127. package/build/types/domain/mappers/mapStepToComponent.d.ts.map +1 -1
  128. package/build/types/domain/mappers/schema/persistAsyncSchemaToComponent.d.ts +29 -15
  129. package/build/types/domain/mappers/schema/persistAsyncSchemaToComponent.d.ts.map +1 -1
  130. package/build/types/domain/mappers/schema/utils/mapCommonSchemaProps.d.ts +1 -0
  131. package/build/types/domain/mappers/schema/utils/mapCommonSchemaProps.d.ts.map +1 -1
  132. package/build/types/domain/mappers/types.d.ts +3 -0
  133. package/build/types/domain/mappers/types.d.ts.map +1 -1
  134. package/build/types/domain/mappers/utils/FeatureFlags.d.ts +1 -1
  135. package/build/types/domain/mappers/utils/FeatureFlags.d.ts.map +1 -1
  136. package/build/types/domain/mappers/utils/behavior-utils.d.ts.map +1 -1
  137. package/build/types/domain/mappers/utils/call-to-action-utils.d.ts.map +1 -1
  138. package/build/types/domain/mappers/utils/getHrefWithTracking.d.ts +8 -0
  139. package/build/types/domain/mappers/utils/getHrefWithTracking.d.ts.map +1 -0
  140. package/build/types/domain/mappers/utils/utils.d.ts.map +1 -1
  141. package/build/types/domain/types.d.ts +17 -2
  142. package/build/types/domain/types.d.ts.map +1 -1
  143. package/build/types/renderers/getSchemaErrorMessageFunction.d.ts.map +1 -1
  144. package/build/types/renderers/mappers/alertComponentToProps.d.ts.map +1 -1
  145. package/build/types/renderers/mappers/booleanInputComponentToProps.d.ts.map +1 -1
  146. package/build/types/renderers/mappers/columnsComponentToProps.d.ts +1 -1
  147. package/build/types/renderers/mappers/columnsComponentToProps.d.ts.map +1 -1
  148. package/build/types/renderers/mappers/containerComponentToProps.d.ts.map +1 -1
  149. package/build/types/renderers/mappers/dateInputComponentToProps.d.ts.map +1 -1
  150. package/build/types/renderers/mappers/decisionComponentToProps.d.ts.map +1 -1
  151. package/build/types/renderers/mappers/externalComponentToProps.d.ts.map +1 -1
  152. package/build/types/renderers/mappers/formComponentToProps.d.ts.map +1 -1
  153. package/build/types/renderers/mappers/integerInputComponentToProps.d.ts.map +1 -1
  154. package/build/types/renderers/mappers/listComponentToProps.d.ts.map +1 -1
  155. package/build/types/renderers/mappers/modalComponentToProps.d.ts.map +1 -1
  156. package/build/types/renderers/mappers/modalLayoutComponentToProps.d.ts.map +1 -1
  157. package/build/types/renderers/mappers/multiSelectComponentToProps.d.ts.map +1 -1
  158. package/build/types/renderers/mappers/multiUploadInputComponentToProps.d.ts.map +1 -1
  159. package/build/types/renderers/mappers/numberInputComponentToProps.d.ts.map +1 -1
  160. package/build/types/renderers/mappers/persistAsyncComponentToProps.d.ts +2 -1
  161. package/build/types/renderers/mappers/persistAsyncComponentToProps.d.ts.map +1 -1
  162. package/build/types/renderers/mappers/repeatableComponentToProps.d.ts.map +1 -1
  163. package/build/types/renderers/mappers/reviewComponentToProps.d.ts.map +1 -1
  164. package/build/types/renderers/mappers/searchComponentToProps.d.ts.map +1 -1
  165. package/build/types/renderers/mappers/sectionComponentToProps.d.ts.map +1 -1
  166. package/build/types/renderers/mappers/selectInputComponentToProps.d.ts.map +1 -1
  167. package/build/types/renderers/mappers/statusListComponentToProps.d.ts.map +1 -1
  168. package/build/types/renderers/mappers/textInputComponentToProps.d.ts.map +1 -1
  169. package/build/types/renderers/mappers/uploadInputComponentToProps.d.ts.map +1 -1
  170. package/build/types/renderers/mappers/upsellComponentToProps.d.ts.map +1 -1
  171. package/build/types/renderers/mappers/utils/inputComponentToProps.d.ts +14 -12
  172. package/build/types/renderers/mappers/utils/inputComponentToProps.d.ts.map +1 -1
  173. package/build/types/renderers/mappers/utils/mapCallToAction.d.ts +6 -0
  174. package/build/types/renderers/mappers/utils/mapCallToAction.d.ts.map +1 -0
  175. package/build/types/renderers/subflow/getDynamicSubflowRenderer.d.ts +1 -0
  176. package/build/types/renderers/subflow/getDynamicSubflowRenderer.d.ts.map +1 -1
  177. package/build/types/stories/utils/render-utils.d.ts.map +1 -1
  178. package/build/types/test-utils/DynamicFlowWise.d.ts.map +1 -1
  179. package/build/types/test-utils/useSnackBar.d.ts +9 -0
  180. package/build/types/test-utils/useSnackBar.d.ts.map +1 -0
  181. package/build/types/types.d.ts +3 -29
  182. package/build/types/types.d.ts.map +1 -1
  183. package/build/types/useDynamicFlow.d.ts.map +1 -1
  184. package/package.json +25 -25
  185. package/build/types/domain/components/utils/WithUpdate.d.ts +0 -5
  186. package/build/types/domain/components/utils/WithUpdate.d.ts.map +0 -1
package/build/main.js CHANGED
@@ -110,6 +110,9 @@ var cs_default = {
110
110
  "dynamicFlows.ControlFeedback.patternDate": "Zadejte pros\xEDm datum ve spr\xE1vn\xE9m form\xE1tu.",
111
111
  "dynamicFlows.ControlFeedback.required": "Vypl\u0148te pros\xEDm toto pole.",
112
112
  "dynamicFlows.ControlFeedback.type": "Nespr\xE1vn\xFD typ",
113
+ "dynamicFlows.DownloadFeedback.failed": "Stahov\xE1n\xED se nezda\u0159ilo",
114
+ "dynamicFlows.DownloadFeedback.started": "Stahov\xE1n\xED...",
115
+ "dynamicFlows.DownloadFeedback.successful": "Stahov\xE1n\xED prob\u011Bhlo \xFAsp\u011B\u0161n\u011B",
113
116
  "dynamicFlows.DynamicParagraph.copied": "Zkop\xEDrov\xE1no do schr\xE1nky",
114
117
  "dynamicFlows.DynamicParagraph.copy": "Kop\xEDrovat",
115
118
  "dynamicFlows.ErrorBoundary.errorAlert": "N\u011Bco se pokazilo.",
@@ -147,6 +150,9 @@ var de_default = {
147
150
  "dynamicFlows.ControlFeedback.patternDate": "Bitte gib ein Datum im richtigen Format ein.",
148
151
  "dynamicFlows.ControlFeedback.required": "Bitte f\xFClle dieses Feld aus.",
149
152
  "dynamicFlows.ControlFeedback.type": "Falscher Typ",
153
+ "dynamicFlows.DownloadFeedback.failed": "Download fehlgeschlagenen",
154
+ "dynamicFlows.DownloadFeedback.started": "Wird heruntergeladen...",
155
+ "dynamicFlows.DownloadFeedback.successful": "Erfolgreich heruntergeladen",
150
156
  "dynamicFlows.DynamicParagraph.copied": "In Zwischenablage kopiert",
151
157
  "dynamicFlows.DynamicParagraph.copy": "Kopieren",
152
158
  "dynamicFlows.ErrorBoundary.errorAlert": "Da ist etwas schiefgegangen.",
@@ -184,6 +190,9 @@ var en_default = {
184
190
  "dynamicFlows.ControlFeedback.patternDate": "Please enter a date in the corrrect format.",
185
191
  "dynamicFlows.ControlFeedback.required": "Please fill out this field.",
186
192
  "dynamicFlows.ControlFeedback.type": "Incorrect type",
193
+ "dynamicFlows.DownloadFeedback.failed": "Download failed",
194
+ "dynamicFlows.DownloadFeedback.started": "Downloading...",
195
+ "dynamicFlows.DownloadFeedback.successful": "Download successful",
187
196
  "dynamicFlows.DynamicParagraph.copied": "Copied to clipboard",
188
197
  "dynamicFlows.DynamicParagraph.copy": "Copy",
189
198
  "dynamicFlows.ErrorBoundary.errorAlert": "Something went wrong.",
@@ -221,6 +230,9 @@ var es_default = {
221
230
  "dynamicFlows.ControlFeedback.patternDate": "Introduce la fecha en un formato correcto.",
222
231
  "dynamicFlows.ControlFeedback.required": "Completa este campo.",
223
232
  "dynamicFlows.ControlFeedback.type": "Tipo incorrecto",
233
+ "dynamicFlows.DownloadFeedback.failed": "Descarga fallida",
234
+ "dynamicFlows.DownloadFeedback.started": "Descargando...",
235
+ "dynamicFlows.DownloadFeedback.successful": "Descarga correcta",
224
236
  "dynamicFlows.DynamicParagraph.copied": "Copiado al portapapeles",
225
237
  "dynamicFlows.DynamicParagraph.copy": "Copiar",
226
238
  "dynamicFlows.ErrorBoundary.errorAlert": "Ha habido un error.",
@@ -258,6 +270,9 @@ var fr_default = {
258
270
  "dynamicFlows.ControlFeedback.patternDate": "Veuillez saisir une date au format correct.",
259
271
  "dynamicFlows.ControlFeedback.required": "Champ obligatoire.",
260
272
  "dynamicFlows.ControlFeedback.type": "Type incorrect",
273
+ "dynamicFlows.DownloadFeedback.failed": "\xC9chec du t\xE9l\xE9chargement",
274
+ "dynamicFlows.DownloadFeedback.started": "T\xE9l\xE9chargement...",
275
+ "dynamicFlows.DownloadFeedback.successful": "T\xE9l\xE9chargement r\xE9ussi",
261
276
  "dynamicFlows.DynamicParagraph.copied": "Copi\xE9 dans le presse-papier",
262
277
  "dynamicFlows.DynamicParagraph.copy": "Copier",
263
278
  "dynamicFlows.ErrorBoundary.errorAlert": "Une erreur s'est produite.",
@@ -295,6 +310,9 @@ var hu_default = {
295
310
  "dynamicFlows.ControlFeedback.patternDate": "K\xE9r\xFCnk, hogy a d\xE1tumot helyes form\xE1tumban add meg.",
296
311
  "dynamicFlows.ControlFeedback.required": "K\xE9r\xFCnk, t\xF6ltsd ki ezt a mez\u0151t.",
297
312
  "dynamicFlows.ControlFeedback.type": "Helytelen t\xEDpus",
313
+ "dynamicFlows.DownloadFeedback.failed": "Sikertelen let\xF6lt\xE9s",
314
+ "dynamicFlows.DownloadFeedback.started": "Let\xF6lt\xE9s...",
315
+ "dynamicFlows.DownloadFeedback.successful": "Let\xF6lt\xE9s sikeres",
298
316
  "dynamicFlows.DynamicParagraph.copied": "V\xE1g\xF3lapra m\xE1solva",
299
317
  "dynamicFlows.DynamicParagraph.copy": "M\xE1sol\xE1s",
300
318
  "dynamicFlows.ErrorBoundary.errorAlert": "Valami hiba t\xF6rt\xE9nt.",
@@ -332,6 +350,9 @@ var id_default = {
332
350
  "dynamicFlows.ControlFeedback.patternDate": "Harap masukkan tanggal dalam format yang benar.",
333
351
  "dynamicFlows.ControlFeedback.required": "Harap isi kolom ini.",
334
352
  "dynamicFlows.ControlFeedback.type": "Tipe salah",
353
+ "dynamicFlows.DownloadFeedback.failed": "Pengunduhan gagal",
354
+ "dynamicFlows.DownloadFeedback.started": "Mengunduh...",
355
+ "dynamicFlows.DownloadFeedback.successful": "Pengunduhan berhasil",
335
356
  "dynamicFlows.DynamicParagraph.copied": "Disalin ke clipboard",
336
357
  "dynamicFlows.DynamicParagraph.copy": "Salin",
337
358
  "dynamicFlows.ErrorBoundary.errorAlert": "Terjadi kesalahan.",
@@ -369,6 +390,9 @@ var it_default = {
369
390
  "dynamicFlows.ControlFeedback.patternDate": "Inserisci la data in un formato corretto.",
370
391
  "dynamicFlows.ControlFeedback.required": "Compila questo campo.",
371
392
  "dynamicFlows.ControlFeedback.type": "Tipo errato",
393
+ "dynamicFlows.DownloadFeedback.failed": "Download non riuscito",
394
+ "dynamicFlows.DownloadFeedback.started": "Download in corso...",
395
+ "dynamicFlows.DownloadFeedback.successful": "Download completato",
372
396
  "dynamicFlows.DynamicParagraph.copied": "Copiato negli appunti",
373
397
  "dynamicFlows.DynamicParagraph.copy": "Copia",
374
398
  "dynamicFlows.ErrorBoundary.errorAlert": "Qualcosa non ha funzionato.",
@@ -406,6 +430,9 @@ var ja_default = {
406
430
  "dynamicFlows.ControlFeedback.patternDate": "\u6B63\u3057\u3044\u5F62\u5F0F\u3067\u65E5\u4ED8\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
407
431
  "dynamicFlows.ControlFeedback.required": "\u3053\u306E\u9805\u76EE\u306F\u5165\u529B\u5FC5\u9808\u3067\u3059\u3002",
408
432
  "dynamicFlows.ControlFeedback.type": "\u4E0D\u6B63\u306A\u30BF\u30A4\u30D7",
433
+ "dynamicFlows.DownloadFeedback.failed": "\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
434
+ "dynamicFlows.DownloadFeedback.started": "\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u4E2D...",
435
+ "dynamicFlows.DownloadFeedback.successful": "\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u304C\u5B8C\u4E86\u3057\u307E\u3057\u305F",
409
436
  "dynamicFlows.DynamicParagraph.copied": "\u30AF\u30EA\u30C3\u30D7\u30DC\u30FC\u30C9\u3078\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F",
410
437
  "dynamicFlows.DynamicParagraph.copy": "\u30B3\u30D4\u30FC\u3059\u308B",
411
438
  "dynamicFlows.ErrorBoundary.errorAlert": "\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002",
@@ -443,6 +470,9 @@ var nl_default = {
443
470
  "dynamicFlows.ControlFeedback.patternDate": "Voer een datum in de juiste indeling in.",
444
471
  "dynamicFlows.ControlFeedback.required": "Vul dit veld in.",
445
472
  "dynamicFlows.ControlFeedback.type": "Onjuist type",
473
+ "dynamicFlows.DownloadFeedback.failed": "Downloaden mislukt",
474
+ "dynamicFlows.DownloadFeedback.started": "Downloaden...",
475
+ "dynamicFlows.DownloadFeedback.successful": "Downloaden gelukt",
446
476
  "dynamicFlows.DynamicParagraph.copied": "Naar klembord gekopieerd",
447
477
  "dynamicFlows.DynamicParagraph.copy": "Kopi\xEBren",
448
478
  "dynamicFlows.ErrorBoundary.errorAlert": "Er is iets misgegaan.",
@@ -480,6 +510,9 @@ var pl_default = {
480
510
  "dynamicFlows.ControlFeedback.patternDate": "Wprowad\u017A dat\u0119 w prawid\u0142owym formacie.",
481
511
  "dynamicFlows.ControlFeedback.required": "Prosz\u0119 wype\u0142ni\u0107 to pole.",
482
512
  "dynamicFlows.ControlFeedback.type": "Nieprawid\u0142owy typ",
513
+ "dynamicFlows.DownloadFeedback.failed": "Pobieranie nieudane",
514
+ "dynamicFlows.DownloadFeedback.started": "Pobieranie...",
515
+ "dynamicFlows.DownloadFeedback.successful": "Pobieranie zako\u0144czone powodzeniem",
483
516
  "dynamicFlows.DynamicParagraph.copied": "Skopiowano do schowka",
484
517
  "dynamicFlows.DynamicParagraph.copy": "Kopiuj",
485
518
  "dynamicFlows.ErrorBoundary.errorAlert": "Co\u015B posz\u0142o nie tak.",
@@ -517,6 +550,9 @@ var pt_default = {
517
550
  "dynamicFlows.ControlFeedback.patternDate": "Por favor, insira a data no formato correto.",
518
551
  "dynamicFlows.ControlFeedback.required": "Por favor, preencha o campo.",
519
552
  "dynamicFlows.ControlFeedback.type": "Tipo incorreto",
553
+ "dynamicFlows.DownloadFeedback.failed": "Falha no envio",
554
+ "dynamicFlows.DownloadFeedback.started": "Baixando...",
555
+ "dynamicFlows.DownloadFeedback.successful": "Download realizado",
520
556
  "dynamicFlows.DynamicParagraph.copied": "Copiado",
521
557
  "dynamicFlows.DynamicParagraph.copy": "Copiar",
522
558
  "dynamicFlows.ErrorBoundary.errorAlert": "Algo deu errado.",
@@ -554,6 +590,9 @@ var ro_default = {
554
590
  "dynamicFlows.ControlFeedback.patternDate": "Te rug\u0103m s\u0103 introduci o dat\u0103 \xEEn formatul corect.",
555
591
  "dynamicFlows.ControlFeedback.required": "Te rug\u0103m s\u0103 completezi acest spa\u021Biu.",
556
592
  "dynamicFlows.ControlFeedback.type": "Tip incorect",
593
+ "dynamicFlows.DownloadFeedback.failed": "Desc\u0103rcare e\u0219uat\u0103",
594
+ "dynamicFlows.DownloadFeedback.started": "Se descarc\u0103...",
595
+ "dynamicFlows.DownloadFeedback.successful": "Desc\u0103rcare reu\u0219it\u0103",
557
596
  "dynamicFlows.DynamicParagraph.copied": "Copiat \xEEn clipboard",
558
597
  "dynamicFlows.DynamicParagraph.copy": "Copiaz\u0103",
559
598
  "dynamicFlows.ErrorBoundary.errorAlert": "Ceva nu a mers bine.",
@@ -591,6 +630,9 @@ var ru_default = {
591
630
  "dynamicFlows.ControlFeedback.patternDate": "\u041F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u0434\u0430\u0442\u0443 \u0432 \u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u043E\u043C \u0444\u043E\u0440\u043C\u0430\u0442\u0435.",
592
631
  "dynamicFlows.ControlFeedback.required": "\u041F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u0437\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u0435 \u0434\u0430\u043D\u043D\u043E\u0435 \u043F\u043E\u043B\u0435.",
593
632
  "dynamicFlows.ControlFeedback.type": "\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0442\u0438\u043F",
633
+ "dynamicFlows.DownloadFeedback.failed": "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043A\u0430\u0447\u0430\u0442\u044C",
634
+ "dynamicFlows.DownloadFeedback.started": "\u0421\u043A\u0430\u0447\u0438\u0432\u0430\u043D\u0438\u0435...",
635
+ "dynamicFlows.DownloadFeedback.successful": "\u0421\u043A\u0430\u0447\u0438\u0432\u0430\u043D\u0438\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043E",
594
636
  "dynamicFlows.DynamicParagraph.copied": "\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043E \u0432 \u0431\u0443\u0444\u0435\u0440 \u043E\u0431\u043C\u0435\u043D\u0430",
595
637
  "dynamicFlows.DynamicParagraph.copy": "\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C",
596
638
  "dynamicFlows.ErrorBoundary.errorAlert": "\u0427\u0442\u043E-\u0442\u043E \u043F\u043E\u0448\u043B\u043E \u043D\u0435 \u0442\u0430\u043A.",
@@ -628,6 +670,9 @@ var th_default = {
628
670
  "dynamicFlows.ControlFeedback.patternDate": "\u0E42\u0E1B\u0E23\u0E14\u0E1B\u0E49\u0E2D\u0E19\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E43\u0E19\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
629
671
  "dynamicFlows.ControlFeedback.required": "\u0E42\u0E1B\u0E23\u0E14\u0E43\u0E2A\u0E48\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E43\u0E19\u0E0A\u0E48\u0E2D\u0E07\u0E19\u0E35\u0E49",
630
672
  "dynamicFlows.ControlFeedback.type": "\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
673
+ "dynamicFlows.DownloadFeedback.failed": "\u0E14\u0E32\u0E27\u0E19\u0E4C\u0E42\u0E2B\u0E25\u0E14\u0E25\u0E49\u0E21\u0E40\u0E2B\u0E25\u0E27",
674
+ "dynamicFlows.DownloadFeedback.started": "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E14\u0E32\u0E27\u0E19\u0E4C\u0E42\u0E2B\u0E25\u0E14...",
675
+ "dynamicFlows.DownloadFeedback.successful": "\u0E14\u0E32\u0E27\u0E19\u0E4C\u0E42\u0E2B\u0E25\u0E14\u0E40\u0E23\u0E35\u0E22\u0E1A\u0E23\u0E49\u0E2D\u0E22\u0E41\u0E25\u0E49\u0E27",
631
676
  "dynamicFlows.DynamicParagraph.copied": "\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01\u0E44\u0E1B\u0E22\u0E31\u0E07\u0E04\u0E25\u0E34\u0E1B\u0E1A\u0E2D\u0E23\u0E4C\u0E14",
632
677
  "dynamicFlows.DynamicParagraph.copy": "\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01",
633
678
  "dynamicFlows.ErrorBoundary.errorAlert": "\u0E40\u0E01\u0E34\u0E14\u0E02\u0E49\u0E2D\u0E1C\u0E34\u0E14\u0E1E\u0E25\u0E32\u0E14\u0E1A\u0E32\u0E07\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E02\u0E36\u0E49\u0E19",
@@ -665,6 +710,9 @@ var tr_default = {
665
710
  "dynamicFlows.ControlFeedback.patternDate": "L\xFCtfen tarihi do\u011Fru bi\xE7imde girin.",
666
711
  "dynamicFlows.ControlFeedback.required": "L\xFCtfen bu alan\u0131 doldurun.",
667
712
  "dynamicFlows.ControlFeedback.type": "Ge\xE7ersiz se\xE7im",
713
+ "dynamicFlows.DownloadFeedback.failed": "\u0130ndirme ba\u015Far\u0131s\u0131z",
714
+ "dynamicFlows.DownloadFeedback.started": "\u0130ndiriliyor...",
715
+ "dynamicFlows.DownloadFeedback.successful": "\u0130ndirme ba\u015Far\u0131l\u0131",
668
716
  "dynamicFlows.DynamicParagraph.copied": "Panoya kopyaland\u0131",
669
717
  "dynamicFlows.DynamicParagraph.copy": "Kopyala",
670
718
  "dynamicFlows.ErrorBoundary.errorAlert": "Bir sorun olu\u015Ftu.",
@@ -702,6 +750,9 @@ var zh_CN_default = {
702
750
  "dynamicFlows.ControlFeedback.patternDate": "\u8BF7\u4EE5\u6B63\u786E\u7684\u683C\u5F0F\u8F93\u5165\u65E5\u671F",
703
751
  "dynamicFlows.ControlFeedback.required": "\u8BF7\u586B\u5199\u6B64\u5B57\u6BB5\u3002",
704
752
  "dynamicFlows.ControlFeedback.type": "\u7C7B\u578B\u9519\u8BEF",
753
+ "dynamicFlows.DownloadFeedback.failed": "\u4E0B\u8F7D\u5931\u8D25",
754
+ "dynamicFlows.DownloadFeedback.started": "\u6B63\u5728\u4E0B\u8F7D\u2026\u2026",
755
+ "dynamicFlows.DownloadFeedback.successful": "\u4E0B\u8F7D\u6210\u529F",
705
756
  "dynamicFlows.DynamicParagraph.copied": "\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F",
706
757
  "dynamicFlows.DynamicParagraph.copy": "\u590D\u5236",
707
758
  "dynamicFlows.ErrorBoundary.errorAlert": "\u51FA\u9519\u4E86\u3002",
@@ -711,14 +762,14 @@ var zh_CN_default = {
711
762
  "dynamicFlows.ExternalConfirmation.open": "\u5728\u65B0\u6807\u7B7E\u9875\u4E2D\u6253\u5F00",
712
763
  "dynamicFlows.ExternalConfirmation.title": "\u8BF7\u786E\u8BA4",
713
764
  "dynamicFlows.FileUploadSchema.maxFileSizeError": "\u62B1\u6B49\uFF0C\u8BE5\u6587\u4EF6\u592A\u5927\u3002\u8BF7\u4E0A\u4F20\u4E00\u4E2A\u66F4\u5C0F\u7684\u6587\u4EF6\u3002",
714
- "dynamicFlows.FileUploadSchema.wrongFileTypeError": "\u62B1\u6B49\uFF0C\u4E0D\u652F\u6301\u8BE5\u6587\u4EF6\u683C\u5F0F\u3002\u8BF7\u4E0A\u4F20\u5176\u4ED6\u6587\u4EF6\u3002",
765
+ "dynamicFlows.FileUploadSchema.wrongFileTypeError": "\u62B1\u6B49\uFF0C\u7CFB\u7EDF\u6682\u4E0D\u652F\u6301\u8BE5\u6587\u4EF6\u683C\u5F0F\u3002\u8BF7\u4E0A\u4F20\u5176\u4ED6\u6587\u4EF6\u3002",
715
766
  "dynamicFlows.Help.ariaLabel": "\u70B9\u51FB\u6B64\u5904\u83B7\u53D6\u66F4\u591A\u4FE1\u606F\u3002",
716
767
  "dynamicFlows.MultiSelect.summary": "{first} \u548C\u5176\u4ED6 {count} \u4E2A",
717
768
  "dynamicFlows.MultipleFileUploadSchema.maxFileSizeError": "\u62B1\u6B49\uFF0C\u8BE5\u6587\u4EF6\u592A\u5927\u3002\u8BF7\u4E0A\u4F20\u4E00\u4E2A\u66F4\u5C0F\u7684\u6587\u4EF6\u3002",
718
769
  "dynamicFlows.MultipleFileUploadSchema.maxItemsError": "\u8BF7\u4E0A\u4F20\u4E0D\u8D85\u8FC7 {maxItems} \u4E2A\u6587\u4EF6\u3002",
719
770
  "dynamicFlows.MultipleFileUploadSchema.minItemsError": "\u8BF7\u4E0A\u4F20\u81F3\u5C11 {minItems} \u4E2A\u6587\u4EF6\u3002",
720
771
  "dynamicFlows.PersistAsyncSchema.genericError": "\u51FA\u9519\u4E86\uFF0C\u8BF7\u91CD\u8BD5\u3002",
721
- "dynamicFlows.SearchLayout.loading": "\u6B63\u5728\u52A0\u8F7D\u2026"
772
+ "dynamicFlows.SearchLayout.loading": "\u6B63\u5728\u52A0\u8F7D\u2026\u2026"
722
773
  };
723
774
 
724
775
  // src/i18n/zh_HK.json
@@ -739,6 +790,9 @@ var zh_HK_default = {
739
790
  "dynamicFlows.ControlFeedback.patternDate": "\u8ACB\u4EE5\u6B63\u78BA\u683C\u5F0F\u8F38\u5165\u65E5\u671F\u3002",
740
791
  "dynamicFlows.ControlFeedback.required": "\u8ACB\u586B\u5BEB\u6B64\u6B04\u4F4D\u3002",
741
792
  "dynamicFlows.ControlFeedback.type": "\u932F\u8AA4\u7684\u985E\u578B",
793
+ "dynamicFlows.DownloadFeedback.failed": "\u4E0B\u8F09\u5931\u6557",
794
+ "dynamicFlows.DownloadFeedback.started": "\u4E0B\u8F09\u4E2D...",
795
+ "dynamicFlows.DownloadFeedback.successful": "\u4E0B\u8F09\u6210\u529F",
742
796
  "dynamicFlows.DynamicParagraph.copied": "\u8907\u88FD\u5230\u526A\u8CBC\u677F",
743
797
  "dynamicFlows.DynamicParagraph.copy": "\u8907\u88FD",
744
798
  "dynamicFlows.ErrorBoundary.errorAlert": "\u51FA\u4E86\u4E9B\u554F\u984C\u3002",
@@ -865,7 +919,7 @@ var getChildren = (node) => {
865
919
 
866
920
  // src/useDynamicFlow.tsx
867
921
  var import_react3 = require("react");
868
- var import_react_intl7 = require("react-intl");
922
+ var import_react_intl8 = require("react-intl");
869
923
 
870
924
  // src/common/errorBoundary/ErrorBoundary.tsx
871
925
  var import_react = require("react");
@@ -995,7 +1049,7 @@ var getInputUpdateFunction = (onComponentUpdate) => {
995
1049
  // src/domain/components/RootDomainComponent.ts
996
1050
  var createRootDomainComponent = (onComponentUpdate, scrollToTop, backConfig, requestCache) => {
997
1051
  const update = getInputUpdateFunction(onComponentUpdate);
998
- const rootComponent = {
1052
+ const component = {
999
1053
  type: "root",
1000
1054
  kind: "step",
1001
1055
  uid: "root",
@@ -1003,107 +1057,104 @@ var createRootDomainComponent = (onComponentUpdate, scrollToTop, backConfig, req
1003
1057
  stepStack: [],
1004
1058
  backConfig,
1005
1059
  requestCache,
1006
- _update(updateFn) {
1007
- update(this, updateFn);
1008
- },
1009
1060
  dismissAllModals() {
1010
1061
  var _a;
1011
- (_a = this.getStep()) == null ? void 0 : _a.dismissAllModals();
1062
+ (_a = component.getStep()) == null ? void 0 : _a.dismissAllModals();
1012
1063
  },
1013
1064
  dismissModal() {
1014
1065
  var _a;
1015
- (_a = this.getStep()) == null ? void 0 : _a.dismissModal();
1066
+ (_a = component.getStep()) == null ? void 0 : _a.dismissModal();
1016
1067
  },
1017
1068
  showModal(modal) {
1018
1069
  var _a;
1019
- (_a = this.getStep()) == null ? void 0 : _a.showModal(modal);
1070
+ (_a = component.getStep()) == null ? void 0 : _a.showModal(modal);
1020
1071
  },
1021
1072
  getChildren() {
1022
- const step = this.getStep();
1073
+ const step = component.getStep();
1023
1074
  return step ? [step, ...step.getModals()] : [];
1024
1075
  },
1025
1076
  getLocalValue() {
1026
1077
  var _a, _b;
1027
- return (_b = (_a = this.getStep()) == null ? void 0 : _a.getLocalValue()) != null ? _b : null;
1078
+ return (_b = (_a = component.getStep()) == null ? void 0 : _a.getLocalValue()) != null ? _b : null;
1028
1079
  },
1029
1080
  async getSubmittableValue() {
1030
1081
  var _a, _b;
1031
- return (_b = (_a = this.getStep()) == null ? void 0 : _a.getSubmittableValue()) != null ? _b : null;
1082
+ return (_b = (_a = component.getStep()) == null ? void 0 : _a.getSubmittableValue()) != null ? _b : null;
1032
1083
  },
1033
1084
  getSubmittableValueSync() {
1034
1085
  var _a, _b;
1035
- return (_b = (_a = this.getStep()) == null ? void 0 : _a.getSubmittableValueSync()) != null ? _b : null;
1086
+ return (_b = (_a = component.getStep()) == null ? void 0 : _a.getSubmittableValueSync()) != null ? _b : null;
1036
1087
  },
1037
1088
  validate() {
1038
1089
  var _a, _b;
1039
- return (_b = (_a = this.getStep()) == null ? void 0 : _a.validate()) != null ? _b : false;
1090
+ return (_b = (_a = component.getStep()) == null ? void 0 : _a.validate()) != null ? _b : false;
1040
1091
  },
1041
1092
  setLoadingState(loadingState) {
1042
1093
  var _a;
1043
- (_a = this.getStep()) == null ? void 0 : _a.setLoadingState(loadingState);
1094
+ (_a = component.getStep()) == null ? void 0 : _a.setLoadingState(loadingState);
1044
1095
  },
1045
1096
  getLoadingState() {
1046
1097
  var _a, _b;
1047
- return (_b = (_a = this.getStep()) == null ? void 0 : _a.loadingState) != null ? _b : "initial";
1098
+ return (_b = (_a = component.getStep()) == null ? void 0 : _a.loadingState) != null ? _b : "initial";
1048
1099
  },
1049
1100
  getSchemaComponents() {
1050
1101
  var _a, _b;
1051
- return (_b = (_a = this.getStep()) == null ? void 0 : _a.schemaComponents) != null ? _b : [];
1102
+ return (_b = (_a = component.getStep()) == null ? void 0 : _a.schemaComponents) != null ? _b : [];
1052
1103
  },
1053
1104
  getTrackEvent() {
1054
1105
  var _a, _b;
1055
- return (_b = (_a = this.getStep()) == null ? void 0 : _a.trackEvent) != null ? _b : null;
1106
+ return (_b = (_a = component.getStep()) == null ? void 0 : _a.trackEvent) != null ? _b : null;
1056
1107
  },
1057
1108
  isBusy() {
1058
- const loadingState = this.getLoadingState();
1109
+ const loadingState = component.getLoadingState();
1059
1110
  return loadingState === "submitting" || loadingState === "refreshing";
1060
1111
  },
1061
1112
  hasStep() {
1062
- return Boolean(this.stepStack.length > 0);
1113
+ return Boolean(component.stepStack.length > 0);
1063
1114
  },
1064
1115
  getStep() {
1065
1116
  var _a;
1066
- return (_a = this.stepStack[this.stepStack.length - 1]) != null ? _a : null;
1117
+ return (_a = component.stepStack[component.stepStack.length - 1]) != null ? _a : null;
1067
1118
  },
1068
1119
  addSubflow(subflow) {
1069
1120
  var _a;
1070
- (_a = this.getStep()) == null ? void 0 : _a.addSubflow(subflow);
1121
+ (_a = component.getStep()) == null ? void 0 : _a.addSubflow(subflow);
1071
1122
  },
1072
1123
  closeSubflow() {
1073
1124
  var _a;
1074
- (_a = this.getStep()) == null ? void 0 : _a.closeSubflow();
1125
+ (_a = component.getStep()) == null ? void 0 : _a.closeSubflow();
1075
1126
  },
1076
1127
  getSubflow() {
1077
1128
  var _a, _b;
1078
- return (_b = (_a = this.getStep()) == null ? void 0 : _a.subflow) != null ? _b : null;
1129
+ return (_b = (_a = component.getStep()) == null ? void 0 : _a.subflow) != null ? _b : null;
1079
1130
  },
1080
1131
  start() {
1081
1132
  var _a;
1082
- (_a = this.getStep()) == null ? void 0 : _a.start();
1133
+ (_a = component.getStep()) == null ? void 0 : _a.start();
1083
1134
  },
1084
1135
  stop() {
1085
1136
  var _a;
1086
- (_a = this.getStep()) == null ? void 0 : _a.stop();
1137
+ (_a = component.getStep()) == null ? void 0 : _a.stop();
1087
1138
  },
1088
1139
  updateStep(stepComponent) {
1089
1140
  var _a;
1090
- this.closeSubflow();
1091
- const shouldScroll = shouldScrollOnStepUpdate(stepComponent, this.getStep());
1092
- this._update((draft) => {
1141
+ component.closeSubflow();
1142
+ const shouldScroll = shouldScrollOnStepUpdate(stepComponent, component.getStep());
1143
+ update(component, (draft) => {
1093
1144
  draft.stepStack = draft.stepStack.slice(0, -1);
1094
1145
  draft.stepStack.push(stepComponent);
1095
1146
  });
1096
1147
  if (shouldScroll) {
1097
1148
  scrollToTop == null ? void 0 : scrollToTop("smooth");
1098
1149
  }
1099
- (_a = this.getStep()) == null ? void 0 : _a.start();
1150
+ (_a = component.getStep()) == null ? void 0 : _a.start();
1100
1151
  },
1101
1152
  pushStep(stepComponent) {
1102
1153
  var _a;
1103
- this.closeSubflow();
1104
- const previousStep = this.getStep();
1154
+ component.closeSubflow();
1155
+ const previousStep = component.getStep();
1105
1156
  const previousStepHasPolling = previousStep == null ? void 0 : previousStep.step.polling;
1106
- this._update((draft) => {
1157
+ update(component, (draft) => {
1107
1158
  switch (stepComponent.stackBehavior) {
1108
1159
  case "remove-previous":
1109
1160
  case "replace-current":
@@ -1120,41 +1171,41 @@ var createRootDomainComponent = (onComponentUpdate, scrollToTop, backConfig, req
1120
1171
  }
1121
1172
  });
1122
1173
  if (previousStep != null) {
1123
- (_a = this.getStep()) == null ? void 0 : _a.start();
1174
+ (_a = component.getStep()) == null ? void 0 : _a.start();
1124
1175
  scrollToTop == null ? void 0 : scrollToTop("instant");
1125
1176
  }
1126
1177
  },
1127
1178
  clearStack() {
1128
- const currentStep = this.getStep();
1179
+ const currentStep = component.getStep();
1129
1180
  if (currentStep) {
1130
- this._update((draft) => {
1181
+ update(component, (draft) => {
1131
1182
  draft.stepStack = [currentStep];
1132
1183
  });
1133
1184
  }
1134
1185
  },
1135
1186
  getRefreshUrl() {
1136
1187
  var _a, _b, _c, _d;
1137
- return (_d = (_c = (_a = this.getStep()) == null ? void 0 : _a.step.refreshUrl) != null ? _c : (_b = this.getStep()) == null ? void 0 : _b.step.refreshFormUrl) != null ? _d : null;
1188
+ return (_d = (_c = (_a = component.getStep()) == null ? void 0 : _a.step.refreshUrl) != null ? _c : (_b = component.getStep()) == null ? void 0 : _b.step.refreshFormUrl) != null ? _d : null;
1138
1189
  },
1139
1190
  navigateBack() {
1140
1191
  var _a;
1141
- this.closeSubflow();
1142
- if (this.stepStack.length === 1) {
1192
+ component.closeSubflow();
1193
+ if (component.stepStack.length === 1) {
1143
1194
  return;
1144
1195
  }
1145
- this._update((draft) => {
1196
+ update(component, (draft) => {
1146
1197
  draft.stepStack = draft.stepStack.slice(0, -1);
1147
1198
  });
1148
- (_a = this.getStep()) == null ? void 0 : _a.start();
1199
+ (_a = component.getStep()) == null ? void 0 : _a.start();
1149
1200
  },
1150
1201
  canPerformBack() {
1151
1202
  var _a, _b;
1152
- const navigation = (_a = this.getStep()) == null ? void 0 : _a.step.navigation;
1203
+ const navigation = (_a = component.getStep()) == null ? void 0 : _a.step.navigation;
1153
1204
  const stepHasBehavior = Boolean((_b = navigation == null ? void 0 : navigation.back) != null ? _b : navigation == null ? void 0 : navigation.backButton);
1154
- return this.backConfig.isFlowCancellable || this.stepStack.length > 1 && this.backConfig.isNativeBackEnabled || stepHasBehavior;
1205
+ return component.backConfig.isFlowCancellable || component.stepStack.length > 1 && component.backConfig.isNativeBackEnabled || stepHasBehavior;
1155
1206
  }
1156
1207
  };
1157
- return rootComponent;
1208
+ return component;
1158
1209
  };
1159
1210
  var shouldScrollOnStepUpdate = (newStep, currentStep) => {
1160
1211
  if (!currentStep) {
@@ -1163,6 +1214,15 @@ var shouldScrollOnStepUpdate = (newStep, currentStep) => {
1163
1214
  return newStep.error != null && newStep.error !== currentStep.error;
1164
1215
  };
1165
1216
 
1217
+ // src/domain/features/events.ts
1218
+ var trackBehaviorTriggered = (trackEvent, behavior) => {
1219
+ if (behavior.track) {
1220
+ trackEvent("Behavior Triggered", __spreadProps(__spreadValues({}, behavior.analytics), {
1221
+ behaviorType: behavior.type
1222
+ }));
1223
+ }
1224
+ };
1225
+
1166
1226
  // src/domain/features/prefetch/request-cache.ts
1167
1227
  var makeRequestCacheWithParent = (parent) => {
1168
1228
  const map = /* @__PURE__ */ new Map();
@@ -1213,36 +1273,33 @@ var makeRequestCacheKey = (requestParams) => {
1213
1273
  };
1214
1274
 
1215
1275
  // src/domain/components/ModalComponent.ts
1216
- var createModalContentComponent = (modalProps, onComponentUpdate) => {
1276
+ var createModalContentComponent = (props, onComponentUpdate) => {
1217
1277
  const update = getInputUpdateFunction(onComponentUpdate);
1218
- const modalContentComponent = __spreadProps(__spreadValues({
1278
+ const component = __spreadProps(__spreadValues({
1219
1279
  type: "modal",
1220
1280
  kind: "layout",
1221
1281
  open: true
1222
- }, modalProps), {
1223
- _update(updateFn) {
1224
- update(this, updateFn);
1225
- },
1282
+ }, props), {
1226
1283
  getChildren() {
1227
- return this.components;
1284
+ return component.components;
1228
1285
  },
1229
1286
  close() {
1230
- update(this, (draft) => {
1287
+ update(component, (draft) => {
1231
1288
  draft.open = false;
1232
1289
  });
1233
1290
  }
1234
1291
  });
1235
- return modalContentComponent;
1292
+ return component;
1236
1293
  };
1237
1294
 
1238
1295
  // src/domain/components/utils/getRandomId.ts
1239
1296
  var getRandomId = () => Math.random().toString(36).substring(2);
1240
1297
 
1241
1298
  // src/domain/components/AlertComponent.ts
1242
- var createAlertComponent = (alertProps) => __spreadValues({
1299
+ var createAlertComponent = (props) => __spreadValues({
1243
1300
  type: "alert",
1244
1301
  kind: "layout"
1245
- }, alertProps);
1302
+ }, props);
1246
1303
 
1247
1304
  // src/domain/mappers/utils/behavior-utils.ts
1248
1305
  var getDomainLayerBehavior = ({ action, behavior: specBehavior }, stepActions, registerSubmissionBehavior) => {
@@ -1256,29 +1313,31 @@ var getDomainLayerBehavior = ({ action, behavior: specBehavior }, stepActions, r
1256
1313
  registerSubmissionBehavior == null ? void 0 : registerSubmissionBehavior(behavior);
1257
1314
  return behavior;
1258
1315
  }
1259
- return { type: "none" };
1316
+ return { type: "none", track: false };
1260
1317
  };
1261
1318
  var normaliseBehavior = (behavior, stepActions) => {
1262
1319
  if ("type" in behavior) {
1263
1320
  if (behavior.type === "subflow") {
1264
1321
  return __spreadProps(__spreadValues({}, behavior), {
1322
+ track: true,
1265
1323
  onCompletion: behavior.onCompletion ? normaliseBehavior(behavior.onCompletion, stepActions) : void 0,
1266
1324
  onError: behavior.onError ? normaliseBehavior(behavior.onError, stepActions) : void 0
1267
1325
  });
1268
1326
  }
1269
- return behavior;
1327
+ return __spreadProps(__spreadValues({}, behavior), { track: true });
1270
1328
  }
1271
1329
  if ("action" in behavior && behavior.action) {
1272
1330
  return actionToBehavior(behavior.action, stepActions);
1273
1331
  }
1274
1332
  if ("link" in behavior && behavior.link) {
1275
- return { type: "link", url: behavior.link.url };
1333
+ return { type: "link", url: behavior.link.url, track: true };
1276
1334
  }
1277
- return { type: "none" };
1335
+ return { type: "none", track: false };
1278
1336
  };
1279
1337
  var actionToBehavior = (action, stepActions) => ({
1280
1338
  type: "action",
1281
- action: inlineAction(action, stepActions)
1339
+ action: inlineAction(action, stepActions),
1340
+ track: false
1282
1341
  });
1283
1342
  var inlineAction = (action, stepActions = []) => action.$ref ? __spreadValues(__spreadValues({}, getActionByReference(action.$ref, stepActions)), action) : action;
1284
1343
  var getActionByReference = ($ref, actions = []) => {
@@ -1289,6 +1348,30 @@ var getActionByReference = ($ref, actions = []) => {
1289
1348
  return action;
1290
1349
  };
1291
1350
 
1351
+ // src/domain/mappers/utils/getHrefWithTracking.ts
1352
+ var getHrefWithTracking = ({
1353
+ behavior,
1354
+ onBehavior,
1355
+ trackEvent
1356
+ }) => {
1357
+ if (behavior.type === "link" && behavior.url) {
1358
+ return () => ({
1359
+ href: behavior.url,
1360
+ target: "_blank",
1361
+ onClick: () => {
1362
+ trackEvent("Behavior Triggered", __spreadProps(__spreadValues({}, behavior.analytics), {
1363
+ behaviorType: behavior.type
1364
+ }));
1365
+ }
1366
+ });
1367
+ }
1368
+ return () => ({
1369
+ onClick: () => {
1370
+ void onBehavior(behavior);
1371
+ }
1372
+ });
1373
+ };
1374
+
1292
1375
  // src/domain/mappers/utils/legacy-utils.ts
1293
1376
  var mapLegacyContext = (context) => {
1294
1377
  switch (context) {
@@ -1346,15 +1429,17 @@ function getDomainLayerCallToAction(cta, mapperProps) {
1346
1429
  if (!cta) {
1347
1430
  return void 0;
1348
1431
  }
1349
- const { step, onBehavior, registerSubmissionBehavior } = mapperProps;
1432
+ const { step, onBehavior, trackEvent, registerSubmissionBehavior } = mapperProps;
1350
1433
  const stepActions = (_a = step.actions) != null ? _a : [];
1351
1434
  const behavior = getDomainLayerBehavior(cta, stepActions, registerSubmissionBehavior);
1435
+ const isLink = behavior.type === "link";
1352
1436
  return {
1353
1437
  type: behavior.type,
1354
1438
  title: (_b = cta.title) != null ? _b : "",
1355
1439
  context: cta.context ? mapLegacyContext(cta.context) : void 0,
1356
1440
  accessibilityDescription: cta.accessibilityDescription,
1357
- href: behavior.type === "link" ? behavior.url : void 0,
1441
+ href: isLink ? behavior.url : void 0,
1442
+ hrefWithTracking: getHrefWithTracking({ behavior, onBehavior, trackEvent }),
1358
1443
  onClick: () => {
1359
1444
  void onBehavior(behavior);
1360
1445
  }
@@ -1385,11 +1470,11 @@ var alertLayoutToComponent = (uid, {
1385
1470
  };
1386
1471
 
1387
1472
  // src/domain/components/BoxComponent.ts
1388
- var createBoxComponent = (boxProps) => __spreadProps(__spreadValues({}, boxProps), {
1473
+ var createBoxComponent = (props) => __spreadProps(__spreadValues({}, props), {
1389
1474
  type: "box",
1390
1475
  kind: "layout",
1391
1476
  getChildren() {
1392
- return this.components;
1477
+ return props.components;
1393
1478
  }
1394
1479
  });
1395
1480
 
@@ -1416,10 +1501,10 @@ var boxLayoutToComponent = (uid, { border = false, components, control, margin,
1416
1501
  });
1417
1502
 
1418
1503
  // src/domain/components/ButtonComponent.ts
1419
- var createButtonComponent = (buttonProps) => __spreadValues({
1504
+ var createButtonComponent = (props) => __spreadValues({
1420
1505
  type: "button",
1421
1506
  kind: "layout"
1422
- }, buttonProps);
1507
+ }, props);
1423
1508
 
1424
1509
  // src/domain/mappers/utils/image.ts
1425
1510
  var mapSpecImage = (image) => {
@@ -1503,7 +1588,7 @@ var buttonLayoutToComponentWithAction = (uid, button, mapperProps) => {
1503
1588
  const { action } = button;
1504
1589
  const inlinedAction = action ? inlineAction(action, step == null ? void 0 : step.actions) : {};
1505
1590
  const onClick = () => {
1506
- void onBehavior({ type: "action", action: inlinedAction });
1591
+ void onBehavior({ type: "action", action: inlinedAction, track: false });
1507
1592
  };
1508
1593
  return createButtonComponent({
1509
1594
  uid,
@@ -1545,11 +1630,11 @@ var getButtonContext = ({ context, action }) => {
1545
1630
  };
1546
1631
 
1547
1632
  // src/domain/components/ColumnsComponent.ts
1548
- var createColumnsComponent = (columnsProps) => __spreadProps(__spreadValues({}, columnsProps), {
1633
+ var createColumnsComponent = (props) => __spreadProps(__spreadValues({}, props), {
1549
1634
  type: "columns",
1550
1635
  kind: "layout",
1551
1636
  getChildren() {
1552
- return [...this.startComponents, ...this.endComponents];
1637
+ return [...props.startComponents, ...props.endComponents];
1553
1638
  }
1554
1639
  });
1555
1640
 
@@ -1575,10 +1660,10 @@ var columnsLayoutToComponent = (uid, { control, left, right, bias, margin, analy
1575
1660
  });
1576
1661
 
1577
1662
  // src/domain/components/DecisionComponent.ts
1578
- var createDecisionComponent = (decisionProps) => __spreadValues({
1663
+ var createDecisionComponent = (props) => __spreadValues({
1579
1664
  type: "decision",
1580
1665
  kind: "layout"
1581
- }, decisionProps);
1666
+ }, props);
1582
1667
 
1583
1668
  // src/domain/mappers/utils/tags-utils.ts
1584
1669
  var mapTags = ({ tag, tags }) => tags != null ? tags : tag != null ? [tag] : void 0;
@@ -1591,12 +1676,18 @@ var mapInlineAlert = (alert) => {
1591
1676
  } : void 0;
1592
1677
  };
1593
1678
  var mapAdditionalInfo = (info, mapperProps) => {
1594
- const { onBehavior, registerSubmissionBehavior } = mapperProps;
1679
+ const { onBehavior, trackEvent, registerSubmissionBehavior } = mapperProps;
1595
1680
  if (info) {
1596
1681
  const behavior = getDomainLayerBehavior(info, [], registerSubmissionBehavior);
1682
+ const isLink = behavior.type === "link";
1597
1683
  return {
1598
1684
  text: info.text,
1599
- href: behavior.type === "link" ? behavior.url : void 0,
1685
+ href: isLink ? behavior.url : void 0,
1686
+ hrefWithTracking: getHrefWithTracking({
1687
+ behavior,
1688
+ onBehavior,
1689
+ trackEvent
1690
+ }),
1600
1691
  accessibilityDescription: info.accessibilityDescription,
1601
1692
  onClick: behavior.type === "none" ? void 0 : () => {
1602
1693
  void onBehavior(behavior);
@@ -1631,14 +1722,16 @@ var decisionLayoutToComponent = (uid, {
1631
1722
  });
1632
1723
  var mapOption = (option, mapperProps) => {
1633
1724
  var _a, _b;
1634
- const { step, onBehavior, registerSubmissionBehavior } = mapperProps;
1725
+ const { step, onBehavior, trackEvent, registerSubmissionBehavior } = mapperProps;
1635
1726
  const behavior = getDomainLayerBehavior(option, (_a = step.actions) != null ? _a : [], registerSubmissionBehavior);
1727
+ const isLink = behavior.type === "link";
1636
1728
  return __spreadProps(__spreadValues({}, option), {
1637
1729
  disabled: (_b = option.disabled) != null ? _b : false,
1638
- href: behavior.type === "link" ? behavior.url : void 0,
1730
+ href: isLink ? behavior.url : void 0,
1639
1731
  media: getDomainLayerMedia(option),
1640
1732
  inlineAlert: mapInlineAlert(option.inlineAlert),
1641
1733
  tags: mapTags(option),
1734
+ hrefWithTracking: getHrefWithTracking({ behavior, onBehavior, trackEvent }),
1642
1735
  onClick: () => {
1643
1736
  void onBehavior(behavior);
1644
1737
  }
@@ -1646,10 +1739,10 @@ var mapOption = (option, mapperProps) => {
1646
1739
  };
1647
1740
 
1648
1741
  // src/domain/components/StatusListComponent.ts
1649
- var createStatusListComponent = (statusListProps) => __spreadValues({
1742
+ var createStatusListComponent = (props) => __spreadValues({
1650
1743
  type: "status-list",
1651
1744
  kind: "layout"
1652
- }, statusListProps);
1745
+ }, props);
1653
1746
 
1654
1747
  // src/domain/mappers/layout/deprecatedListLayoutToComponent.ts
1655
1748
  var isDeprecatedListLayout = (layout) => {
@@ -1692,11 +1785,11 @@ var createDividerComponent = (props) => __spreadValues({
1692
1785
  var dividerLayoutToComponent = (uid, { control, margin, analyticsId, tags }) => createDividerComponent({ uid, analyticsId, control, margin: margin != null ? margin : "md", tags });
1693
1786
 
1694
1787
  // src/domain/components/FormComponent.ts
1695
- var createFormComponent = (formProps) => __spreadProps(__spreadValues({}, formProps), {
1788
+ var createFormComponent = (props) => __spreadProps(__spreadValues({}, props), {
1696
1789
  type: "form",
1697
1790
  kind: "layout",
1698
1791
  getChildren() {
1699
- return [this.schemaComponent];
1792
+ return [props.schemaComponent];
1700
1793
  }
1701
1794
  });
1702
1795
 
@@ -1725,10 +1818,10 @@ var formLayoutToComponent = (uid, { analyticsId, schemaId, schema: schemaRef, co
1725
1818
  };
1726
1819
 
1727
1820
  // src/domain/components/HeadingComponent.ts
1728
- var createHeadingComponent = (headingProps) => __spreadValues({
1821
+ var createHeadingComponent = (props) => __spreadValues({
1729
1822
  type: "heading",
1730
1823
  kind: "layout"
1731
- }, headingProps);
1824
+ }, props);
1732
1825
 
1733
1826
  // src/domain/mappers/layout/headingLayoutToComponent.ts
1734
1827
  var headingLayoutToComponent = (uid, { analyticsId, align, margin, size, control, tags, text }) => createHeadingComponent({
@@ -1743,10 +1836,10 @@ var headingLayoutToComponent = (uid, { analyticsId, align, margin, size, control
1743
1836
  });
1744
1837
 
1745
1838
  // src/domain/components/ImageComponent.ts
1746
- var createImageComponent = (imageProps) => __spreadValues({
1839
+ var createImageComponent = (props) => __spreadValues({
1747
1840
  type: "image",
1748
1841
  kind: "layout"
1749
- }, imageProps);
1842
+ }, props);
1750
1843
 
1751
1844
  // src/domain/mappers/layout/imageLayoutToComponent.ts
1752
1845
  var imageLayoutToComponent = (uid, {
@@ -1778,10 +1871,10 @@ var imageLayoutToComponent = (uid, {
1778
1871
  };
1779
1872
 
1780
1873
  // src/domain/components/MarkdownComponent.ts
1781
- var createMarkdownComponent = (markdownProps) => __spreadValues({
1874
+ var createMarkdownComponent = (props) => __spreadValues({
1782
1875
  type: "markdown",
1783
1876
  kind: "layout"
1784
- }, markdownProps);
1877
+ }, props);
1785
1878
 
1786
1879
  // src/domain/mappers/layout/infoLayoutToComponent.ts
1787
1880
  var infoLayoutToComponent = (uid, { analyticsId, align, control, margin, markdown: content, tags }) => createMarkdownComponent({
@@ -1796,10 +1889,10 @@ var infoLayoutToComponent = (uid, { analyticsId, align, control, margin, markdow
1796
1889
  });
1797
1890
 
1798
1891
  // src/domain/components/InstructionsComponent.ts
1799
- var createInstructionsComponent = (instructionsProps) => __spreadValues({
1892
+ var createInstructionsComponent = (props) => __spreadValues({
1800
1893
  type: "instructions",
1801
1894
  kind: "layout"
1802
- }, instructionsProps);
1895
+ }, props);
1803
1896
 
1804
1897
  // src/domain/mappers/layout/instructionsLayoutToComponent.ts
1805
1898
  var instructionsLayoutToComponent = (uid, { analyticsId, control, items, margin, tags, title }) => createInstructionsComponent({
@@ -1816,10 +1909,10 @@ var instructionsLayoutToComponent = (uid, { analyticsId, control, items, margin,
1816
1909
  });
1817
1910
 
1818
1911
  // src/domain/components/ListComponent.ts
1819
- var createListComponent = (listProps) => __spreadValues({
1912
+ var createListComponent = (props) => __spreadValues({
1820
1913
  type: "list",
1821
1914
  kind: "layout"
1822
- }, listProps);
1915
+ }, props);
1823
1916
 
1824
1917
  // src/domain/mappers/layout/listLayoutToComponent.ts
1825
1918
  var listLayoutToComponent = (uid, { analyticsId, callToAction, control, items, margin, tags, title }, mapperProps) => {
@@ -1877,10 +1970,10 @@ var mapSupportingValues = (item) => {
1877
1970
  };
1878
1971
 
1879
1972
  // src/domain/components/LoadingIndicatorComponent.ts
1880
- var createLoadingIndicatorComponent = (loadingIndicatorProps) => __spreadValues({
1973
+ var createLoadingIndicatorComponent = (props) => __spreadValues({
1881
1974
  type: "loading-indicator",
1882
1975
  kind: "layout"
1883
- }, loadingIndicatorProps);
1976
+ }, props);
1884
1977
 
1885
1978
  // src/domain/mappers/layout/loadingIndicatorLayoutToComponent.ts
1886
1979
  var loadingIndicatorLayoutToComponent = (uid, { analyticsId, control, margin, size, tags }) => createLoadingIndicatorComponent({
@@ -1931,12 +2024,12 @@ var mediaLayoutToComponent = (uid, { analyticsId, align, control, margin, media,
1931
2024
  });
1932
2025
 
1933
2026
  // src/domain/components/ModalLayoutComponent.ts
1934
- var createModalComponent = (modalProps) => __spreadProps(__spreadValues({
2027
+ var createModalComponent = (props) => __spreadProps(__spreadValues({
1935
2028
  type: "modal-layout",
1936
2029
  kind: "layout"
1937
- }, modalProps), {
2030
+ }, props), {
1938
2031
  getChildren() {
1939
- return this.content.components;
2032
+ return props.content.components;
1940
2033
  }
1941
2034
  });
1942
2035
 
@@ -1960,10 +2053,10 @@ var modalLayoutToComponent = (uid, { analyticsId, content, control, margin, tags
1960
2053
  };
1961
2054
 
1962
2055
  // src/domain/components/ParagraphComponent.ts
1963
- var createParagraphComponent = (paragraphProps) => __spreadValues({
2056
+ var createParagraphComponent = (props) => __spreadValues({
1964
2057
  type: "paragraph",
1965
2058
  kind: "layout"
1966
- }, paragraphProps);
2059
+ }, props);
1967
2060
 
1968
2061
  // src/domain/mappers/layout/paragraphLayoutToComponent.ts
1969
2062
  var paragraphLayoutToComponent = (uid, { analyticsId, align, control, margin, size, tags, text }) => createParagraphComponent({
@@ -1978,10 +2071,10 @@ var paragraphLayoutToComponent = (uid, { analyticsId, align, control, margin, si
1978
2071
  });
1979
2072
 
1980
2073
  // src/domain/components/ProgressComponent.ts
1981
- var createProgressComponent = (progressProps) => __spreadValues({
2074
+ var createProgressComponent = (props) => __spreadValues({
1982
2075
  type: "progress",
1983
2076
  kind: "layout"
1984
- }, progressProps);
2077
+ }, props);
1985
2078
 
1986
2079
  // src/domain/mappers/layout/progressLayoutToComponent.ts
1987
2080
  var progressLayoutToComponent = (uid, {
@@ -2010,10 +2103,10 @@ var progressLayoutToComponent = (uid, {
2010
2103
  });
2011
2104
 
2012
2105
  // src/domain/components/ReviewComponent.ts
2013
- var createReviewComponent = (reviewProps) => __spreadValues({
2106
+ var createReviewComponent = (props) => __spreadValues({
2014
2107
  type: "review",
2015
2108
  kind: "layout"
2016
- }, reviewProps);
2109
+ }, props);
2017
2110
 
2018
2111
  // src/domain/mappers/layout/reviewLayoutToComponent.ts
2019
2112
  var reviewLayoutToComponent = (uid, {
@@ -2045,12 +2138,15 @@ var getCallToAction = ({
2045
2138
  return getDomainLayerCallToAction(callToAction, mapperProps);
2046
2139
  }
2047
2140
  if (action == null ? void 0 : action.title) {
2141
+ const behavior = { type: "action", action, track: true };
2142
+ const { onBehavior, trackEvent } = mapperProps;
2048
2143
  return {
2049
2144
  type: "action",
2050
2145
  title: action.title,
2051
2146
  onClick: () => {
2052
- void mapperProps.onBehavior({ type: "action", action });
2053
- }
2147
+ void onBehavior(behavior);
2148
+ },
2149
+ hrefWithTracking: getHrefWithTracking({ behavior, onBehavior, trackEvent })
2054
2150
  };
2055
2151
  }
2056
2152
  return void 0;
@@ -2120,8 +2216,8 @@ var debounce = (callback, waitMs) => {
2120
2216
 
2121
2217
  // src/domain/components/searchComponent/SearchComponent.ts
2122
2218
  var DEBOUNCE_TIME = 400;
2123
- var createSearchComponent = (searchProps, performSearch, onBehavior, onComponentUpdate) => {
2124
- const { uid, analyticsId, control, emptyMessage, initialState, hint, margin, tags, title } = searchProps;
2219
+ var createSearchComponent = (props, performSearch, onBehavior, onComponentUpdate) => {
2220
+ const { uid, analyticsId, control, emptyMessage, initialState, hint, margin, tags, title } = props;
2125
2221
  const update = getInputUpdateFunction(onComponentUpdate);
2126
2222
  let abortController = new AbortController();
2127
2223
  const search = (component2, query, searchConfig) => {
@@ -2165,16 +2261,13 @@ var createSearchComponent = (searchProps, performSearch, onBehavior, onComponent
2165
2261
  title,
2166
2262
  isLoading: false,
2167
2263
  query: "",
2168
- _update(updateFn) {
2169
- update(this, updateFn);
2170
- },
2171
- onChange(query) {
2264
+ setQuery(query) {
2172
2265
  if (query.trim()) {
2173
- this._update((draft) => {
2266
+ update(component, (draft) => {
2174
2267
  draft.query = query;
2175
2268
  draft.isLoading = true;
2176
2269
  });
2177
- debouncedSearch(this, query.trim());
2270
+ debouncedSearch(component, query.trim());
2178
2271
  } else {
2179
2272
  abortController.abort();
2180
2273
  debouncedSearch.cancel();
@@ -2186,15 +2279,15 @@ var createSearchComponent = (searchProps, performSearch, onBehavior, onComponent
2186
2279
  });
2187
2280
  }
2188
2281
  },
2189
- onSelect({ type, value }) {
2282
+ selectResult({ type, value }) {
2190
2283
  if (type === "action") {
2191
- void onBehavior({ type: "action", action: value });
2284
+ void onBehavior({ type: "action", action: value, track: false });
2192
2285
  } else {
2193
- this._update((draft) => {
2286
+ update(component, (draft) => {
2194
2287
  draft.query = value.query;
2195
2288
  draft.isLoading = true;
2196
2289
  });
2197
- search(this, value.query, {
2290
+ search(component, value.query, {
2198
2291
  method: value.method,
2199
2292
  param: value.param,
2200
2293
  url: value.url
@@ -2345,15 +2438,13 @@ var emptyInitialState = {
2345
2438
  };
2346
2439
 
2347
2440
  // src/domain/components/SectionComponent.ts
2348
- var createSectionComponent = (props) => {
2349
- return __spreadProps(__spreadValues({}, props), {
2350
- type: "section",
2351
- kind: "layout",
2352
- getChildren() {
2353
- return this.components;
2354
- }
2355
- });
2356
- };
2441
+ var createSectionComponent = (props) => __spreadProps(__spreadValues({}, props), {
2442
+ type: "section",
2443
+ kind: "layout",
2444
+ getChildren() {
2445
+ return props.components;
2446
+ }
2447
+ });
2357
2448
 
2358
2449
  // src/domain/mappers/layout/sectionLayoutToComponent.ts
2359
2450
  var sectionLayoutToComponent = (uid, { analyticsId, control, title, components, callToAction, margin, tags }, mapperProps, schemaComponents) => {
@@ -2386,7 +2477,7 @@ var statusListLayoutToComponent = (uid, { analyticsId, control, items, margin, t
2386
2477
  });
2387
2478
 
2388
2479
  // src/domain/components/TabsComponent.ts
2389
- var createTabsComponent = (tabsProps) => __spreadProps(__spreadValues({}, tabsProps), {
2480
+ var createTabsComponent = (props) => __spreadProps(__spreadValues({}, props), {
2390
2481
  type: "tabs",
2391
2482
  kind: "layout"
2392
2483
  });
@@ -2414,19 +2505,19 @@ var mapTabs = (tabs, uid, mapperProps, schemaComponents) => tabs.map(({ componen
2414
2505
  }));
2415
2506
 
2416
2507
  // src/domain/components/UpsellComponent.ts
2417
- var createUpsellComponent = (upsellProps, onComponentUpdate) => {
2508
+ var createUpsellComponent = (props, onComponentUpdate) => {
2418
2509
  const update = getInputUpdateFunction(onComponentUpdate);
2419
- const _a = upsellProps, { onDismiss: propsOnDismiss } = _a, restProps = __objRest(_a, ["onDismiss"]);
2510
+ const _a = props, { dismiss } = _a, restProps = __objRest(_a, ["dismiss"]);
2420
2511
  const component = __spreadProps(__spreadValues({
2421
2512
  type: "upsell",
2422
2513
  kind: "layout"
2423
2514
  }, restProps), {
2424
2515
  visible: true,
2425
- onDismiss: propsOnDismiss ? () => {
2516
+ dismiss: dismiss ? () => {
2426
2517
  update(component, (draft) => {
2427
2518
  draft.visible = false;
2428
2519
  });
2429
- propsOnDismiss();
2520
+ dismiss();
2430
2521
  } : void 0
2431
2522
  });
2432
2523
  return component;
@@ -2445,7 +2536,7 @@ var upsellLayoutToComponent = (uid, { analyticsId, callToAction, control, margin
2445
2536
  media: getDomainLayerMedia({ media }),
2446
2537
  tags,
2447
2538
  text,
2448
- onDismiss: onDismiss ? () => {
2539
+ dismiss: onDismiss ? () => {
2449
2540
  const { url, method } = onDismiss;
2450
2541
  const body = method === "GET" ? void 0 : JSON.stringify(onDismiss.body);
2451
2542
  void mapperProps.httpClient(url, { method, body }).catch(() => {
@@ -2527,26 +2618,27 @@ var modalToComponent = (uid, { content, title }, mapperProps, schemaComponents)
2527
2618
  // src/domain/components/step/ExternalConfirmationComponent.ts
2528
2619
  var createExternalConfirmation = (uid, url, onLink, onComponentUpdate) => {
2529
2620
  const update = getInputUpdateFunction(onComponentUpdate);
2530
- return {
2621
+ const component = {
2531
2622
  type: "external-confirmation",
2532
2623
  kind: "layout",
2533
2624
  uid,
2534
2625
  url,
2535
2626
  status: "initial",
2536
2627
  open() {
2537
- if (this.status === "initial" || this.status === "failure") {
2538
- const success = onLink(this.url);
2539
- update(this, (draft) => {
2628
+ if (component.status === "initial" || component.status === "failure") {
2629
+ const success = onLink(component.url);
2630
+ update(component, (draft) => {
2540
2631
  draft.status = success ? "success" : "failure";
2541
2632
  });
2542
2633
  }
2543
2634
  },
2544
2635
  onCancel() {
2545
- update(this, (draft) => {
2636
+ update(component, (draft) => {
2546
2637
  draft.status = "dismissed";
2547
2638
  });
2548
2639
  }
2549
2640
  };
2641
+ return component;
2550
2642
  };
2551
2643
 
2552
2644
  // src/utils/recursiveMerge.ts
@@ -2596,91 +2688,128 @@ var getSubmittableDataSync = (components) => components.map((component) => compo
2596
2688
  var getLocalValues = (components) => components.map((component) => component.getLocalValue()).reduce((acc, value) => recursiveMerge(acc, value), null);
2597
2689
 
2598
2690
  // src/domain/components/step/StepDomainComponent.ts
2599
- var createStepComponent = (stepProps) => {
2600
- const _a = stepProps, { uid, stepPolling, stepRefreshAfter, stepPrefetch, onComponentUpdate } = _a, rest = __objRest(_a, ["uid", "stepPolling", "stepRefreshAfter", "stepPrefetch", "onComponentUpdate"]);
2691
+ var createStepComponent = (props) => {
2692
+ const _a = props, {
2693
+ uid,
2694
+ stepPolling,
2695
+ stepRefreshAfter,
2696
+ stepPrefetch,
2697
+ features,
2698
+ logEvent,
2699
+ onComponentUpdate,
2700
+ onLoad
2701
+ } = _a, rest = __objRest(_a, [
2702
+ "uid",
2703
+ "stepPolling",
2704
+ "stepRefreshAfter",
2705
+ "stepPrefetch",
2706
+ "features",
2707
+ "logEvent",
2708
+ "onComponentUpdate",
2709
+ "onLoad"
2710
+ ]);
2601
2711
  const update = getInputUpdateFunction(onComponentUpdate);
2602
2712
  const component = __spreadProps(__spreadValues({
2603
2713
  uid
2604
2714
  }, rest), {
2605
2715
  type: "step",
2606
2716
  kind: "step",
2717
+ state: "initial",
2607
2718
  modals: [],
2608
2719
  requestCache: stepPrefetch.requestCache,
2609
2720
  subflow: null,
2610
2721
  dismissModal() {
2611
2722
  var _a2;
2612
- (_a2 = this.modals.at(-1)) == null ? void 0 : _a2.close();
2723
+ (_a2 = component.modals.at(-1)) == null ? void 0 : _a2.close();
2613
2724
  },
2614
2725
  dismissAllModals() {
2615
- this._update((draft) => {
2726
+ update(component, (draft) => {
2616
2727
  draft.modals = draft.modals.map((m) => __spreadProps(__spreadValues({}, m), { open: false }));
2617
2728
  });
2618
2729
  },
2619
2730
  showModal(modal) {
2620
- this._update((draft) => {
2731
+ update(component, (draft) => {
2621
2732
  draft.modals = [...draft.modals, modal];
2622
2733
  });
2623
2734
  },
2624
- _update(updateFn) {
2625
- update(this, updateFn);
2626
- },
2627
2735
  getChildren() {
2628
- return this.externalConfirmation ? [...this.layoutComponents, this.externalConfirmation] : this.layoutComponents;
2736
+ return component.externalConfirmation ? [...component.layoutComponents, component.externalConfirmation] : component.layoutComponents;
2629
2737
  },
2630
2738
  getModals() {
2631
- return this.modals;
2739
+ return component.modals;
2632
2740
  },
2633
2741
  async getSubmittableValue() {
2634
- return getSubmittableData(this.schemaComponents);
2742
+ return getSubmittableData(component.schemaComponents);
2635
2743
  },
2636
2744
  getSubmittableValueSync() {
2637
- return getSubmittableDataSync(this.schemaComponents);
2745
+ return getSubmittableDataSync(component.schemaComponents);
2638
2746
  },
2639
2747
  getLocalValue() {
2640
- return getLocalValues(this.schemaComponents);
2748
+ return getLocalValues(component.schemaComponents);
2641
2749
  },
2642
2750
  validate() {
2643
- return this.schemaComponents.every(
2644
- (inputComponent) => {
2645
- var _a2;
2646
- return this.referencedSchemaIds.includes((_a2 = inputComponent.schemaId) != null ? _a2 : "") ? inputComponent.validate() : true;
2647
- }
2648
- );
2751
+ const isStrict = features.isEnabled("validateUnreferencedSchemas");
2752
+ return component.schemaComponents.map(
2753
+ (inputComponent) => validateInputComponent(component, inputComponent, isStrict, logEvent)
2754
+ ).every(Boolean);
2649
2755
  },
2650
2756
  setLoadingState(loadingState) {
2651
- this._update((draft) => {
2757
+ update(component, (draft) => {
2652
2758
  draft.loadingState = loadingState;
2653
2759
  });
2654
2760
  },
2655
2761
  addSubflow(subflow) {
2656
- this._update((draft) => {
2762
+ update(component, (draft) => {
2657
2763
  draft.subflow = subflow;
2658
2764
  });
2659
2765
  },
2660
2766
  closeSubflow() {
2661
- if (!this.subflow) {
2767
+ if (!component.subflow) {
2662
2768
  return;
2663
2769
  }
2664
- this._update((draft) => {
2770
+ update(component, (draft) => {
2665
2771
  draft.subflow = null;
2666
2772
  });
2667
2773
  },
2668
2774
  start() {
2775
+ if (component.state === "initial") {
2776
+ onLoad == null ? void 0 : onLoad();
2777
+ }
2778
+ update(component, (draft) => {
2779
+ draft.state = "started";
2780
+ });
2669
2781
  stepPolling == null ? void 0 : stepPolling.start();
2670
2782
  stepRefreshAfter == null ? void 0 : stepRefreshAfter.start();
2671
- stepPrefetch.start(this.getSubmittableValueSync());
2783
+ stepPrefetch.start(component.getSubmittableValueSync());
2672
2784
  },
2673
2785
  stop() {
2674
2786
  stepPolling == null ? void 0 : stepPolling.stop();
2675
2787
  stepRefreshAfter == null ? void 0 : stepRefreshAfter.stop();
2676
2788
  stepPrefetch.stop();
2677
- this._update((draft) => {
2789
+ update(component, (draft) => {
2790
+ draft.state = "stopped";
2678
2791
  draft.modals = [];
2679
2792
  });
2680
2793
  }
2681
2794
  });
2682
2795
  return component;
2683
2796
  };
2797
+ var validateInputComponent = (component, inputComponent, isStrict, logEvent) => {
2798
+ var _a;
2799
+ const isSchemaReferenced = component.referencedSchemaIds.includes((_a = inputComponent.schemaId) != null ? _a : "");
2800
+ const isValid = inputComponent.validate();
2801
+ if (!isSchemaReferenced && !isValid) {
2802
+ logEvent(
2803
+ isStrict ? "error" : "warning",
2804
+ isStrict ? "Unreferenced schema does not pass validation. This blocks submission. You must fix your step." : "Unreferenced schema does not pass validation. This blocks submission on iOS and Android, and soon it will on web. You should fix your step.",
2805
+ {
2806
+ unreferencedSchemaId: inputComponent.schemaId,
2807
+ componentUid: component.uid
2808
+ }
2809
+ );
2810
+ }
2811
+ return isSchemaReferenced || isStrict ? isValid : true;
2812
+ };
2684
2813
 
2685
2814
  // src/domain/features/polling/getStepPolling.ts
2686
2815
  var getStepPolling = ({
@@ -2919,7 +3048,8 @@ var executeRequest = async (props) => {
2919
3048
  type: "behavior",
2920
3049
  behavior: {
2921
3050
  type: "action",
2922
- action: responseBody.action
3051
+ action: responseBody.action,
3052
+ track: false
2923
3053
  }
2924
3054
  };
2925
3055
  }
@@ -2930,7 +3060,8 @@ var executeRequest = async (props) => {
2930
3060
  behavior: __spreadProps(__spreadValues({}, responseBody), {
2931
3061
  type: "subflow",
2932
3062
  onCompletion: responseBody.onCompletion ? normaliseBehavior(responseBody.onCompletion, []) : void 0,
2933
- onError: responseBody.onError ? normaliseBehavior(responseBody.onError, []) : void 0
3063
+ onError: responseBody.onError ? normaliseBehavior(responseBody.onError, []) : void 0,
3064
+ track: false
2934
3065
  })
2935
3066
  } : {
2936
3067
  type: "error",
@@ -2939,7 +3070,7 @@ var executeRequest = async (props) => {
2939
3070
  }
2940
3071
  case "modal": {
2941
3072
  assertModalResponseBody(responseBody);
2942
- return !isInitial ? { type: "behavior", behavior: __spreadProps(__spreadValues({}, responseBody), { type: "modal" }) } : {
3073
+ return !isInitial ? { type: "behavior", behavior: __spreadProps(__spreadValues({}, responseBody), { type: "modal", track: false }) } : {
2943
3074
  type: "error",
2944
3075
  body: { errors: { error: "Cannot show modal without a current step" } }
2945
3076
  };
@@ -3101,7 +3232,7 @@ var getStepRefreshAfter = ({
3101
3232
  const start = () => {
3102
3233
  const timeLeft = Math.max(targetTime - Date.now(), ONE_SECOND);
3103
3234
  timeout = setTimeout(() => {
3104
- void onBehavior({ type: "refresh", analytics: { schema: "refreshAfter" } });
3235
+ void onBehavior({ type: "refresh", analytics: { schema: "refreshAfter" }, track: false });
3105
3236
  }, timeLeft);
3106
3237
  };
3107
3238
  return {
@@ -3216,7 +3347,8 @@ var getComponentValidationAsync = (update, performValidationAsync) => (
3216
3347
  draft.validationAsyncState = {
3217
3348
  abortController: newAbortController,
3218
3349
  lastSubmitted: currentValue,
3219
- messages: {}
3350
+ messages: {},
3351
+ loadingState: "idle"
3220
3352
  };
3221
3353
  });
3222
3354
  return;
@@ -3227,6 +3359,7 @@ var getComponentValidationAsync = (update, performValidationAsync) => (
3227
3359
  if (message) {
3228
3360
  draft.validationAsyncState.messages.success = message;
3229
3361
  }
3362
+ draft.validationAsyncState.loadingState = "idle";
3230
3363
  });
3231
3364
  return message;
3232
3365
  }).catch((error) => {
@@ -3235,13 +3368,15 @@ var getComponentValidationAsync = (update, performValidationAsync) => (
3235
3368
  }
3236
3369
  update(component, (draft) => {
3237
3370
  draft.validationAsyncState.messages.error = error.message;
3371
+ draft.validationAsyncState.loadingState = "idle";
3238
3372
  });
3239
3373
  });
3240
3374
  update(component, (draft) => {
3241
3375
  draft.validationAsyncState = {
3242
3376
  abortController: newAbortController,
3243
3377
  lastSubmitted: currentValue,
3244
- messages: {}
3378
+ messages: {},
3379
+ loadingState: "pending"
3245
3380
  };
3246
3381
  });
3247
3382
  return newSubmission;
@@ -3250,8 +3385,8 @@ var getComponentValidationAsync = (update, performValidationAsync) => (
3250
3385
  var getDebouncedComponentValidationAsync = (update, performValidationAsync) => debounce(getComponentValidationAsync(update, performValidationAsync), 1e3);
3251
3386
 
3252
3387
  // src/domain/components/NumberInputComponent.ts
3253
- var createNumberInputComponent = (numberInputProps, onComponentUpdate) => {
3254
- const _a = numberInputProps, {
3388
+ var createNumberInputComponent = (props, onComponentUpdate) => {
3389
+ const _a = props, {
3255
3390
  uid,
3256
3391
  id,
3257
3392
  checks,
@@ -3274,16 +3409,13 @@ var createNumberInputComponent = (numberInputProps, onComponentUpdate) => {
3274
3409
  const getValidationErrors = getLocalValueValidator(checks);
3275
3410
  const performOnChange = getDebouncedSchemaOnChange(schemaOnChange, getValidationErrors);
3276
3411
  const validateAsync = performValidationAsync ? getDebouncedComponentValidationAsync(update, performValidationAsync) : void 0;
3277
- const numberComponent = __spreadValues({
3412
+ const component = __spreadValues({
3278
3413
  type: "number",
3279
3414
  kind: "input",
3280
3415
  uid,
3281
3416
  id,
3282
- _update(updateFn) {
3283
- update(this, updateFn);
3284
- },
3285
3417
  onBlur() {
3286
- const isValid = this.validate();
3418
+ const isValid = component.validate();
3287
3419
  performOnChange == null ? void 0 : performOnChange.flush();
3288
3420
  if (isValid) {
3289
3421
  void (onPersistAsync == null ? void 0 : onPersistAsync().catch(() => {
@@ -3294,9 +3426,9 @@ var createNumberInputComponent = (numberInputProps, onComponentUpdate) => {
3294
3426
  onFocus() {
3295
3427
  },
3296
3428
  // Noop
3297
- onChange(updatedValue) {
3298
- const prevValue = this.value;
3299
- this._update((draft) => {
3429
+ setValue(updatedValue) {
3430
+ const prevValue = component.value;
3431
+ update(component, (draft) => {
3300
3432
  draft.errors = [];
3301
3433
  draft.validationAsyncState.messages = {};
3302
3434
  draft.value = updatedValue;
@@ -3304,32 +3436,32 @@ var createNumberInputComponent = (numberInputProps, onComponentUpdate) => {
3304
3436
  performOnChange == null ? void 0 : performOnChange(prevValue, updatedValue);
3305
3437
  const isValid = getValidationErrors(updatedValue).length === 0;
3306
3438
  if (isValid) {
3307
- validateAsync == null ? void 0 : validateAsync(this, updatedValue);
3439
+ validateAsync == null ? void 0 : validateAsync(component, updatedValue);
3308
3440
  }
3309
3441
  onValueChange();
3310
3442
  },
3311
3443
  async getSubmittableValue() {
3312
- return this.getSubmittableValueSync();
3444
+ return component.getSubmittableValueSync();
3313
3445
  },
3314
3446
  getSubmittableValueSync() {
3315
3447
  var _a2;
3316
- return (_a2 = this.getLocalValue()) != null ? _a2 : null;
3448
+ return (_a2 = component.getLocalValue()) != null ? _a2 : null;
3317
3449
  },
3318
3450
  getSummary() {
3319
- return summariser(this.getLocalValue());
3451
+ return summariser(component.getLocalValue());
3320
3452
  },
3321
3453
  getLocalValue() {
3322
- return this.value;
3454
+ return component.value;
3323
3455
  },
3324
3456
  validate() {
3325
- const errors = getValidationErrors(this.getLocalValue());
3326
- this._update((draft) => {
3457
+ const errors = getValidationErrors(component.getLocalValue());
3458
+ update(component, (draft) => {
3327
3459
  draft.errors = errors;
3328
3460
  });
3329
3461
  return errors.length === 0;
3330
3462
  }
3331
3463
  }, rest);
3332
- return numberComponent;
3464
+ return component;
3333
3465
  };
3334
3466
 
3335
3467
  // src/domain/features/schema-on-change/getSchemaOnChange.ts
@@ -3344,23 +3476,25 @@ var getSchemaOnChange = (schema, onBehavior) => {
3344
3476
  return void 0;
3345
3477
  };
3346
3478
  var getBehaviorFromSchemaOnChange = (schema) => {
3479
+ var _a;
3347
3480
  if ("onChange" in schema && schema.onChange) {
3348
3481
  const { $id, analyticsId, onChange } = schema;
3349
3482
  const behavior = __spreadProps(__spreadValues({}, normaliseBehavior(onChange, [])), {
3350
- analytics: { schema: analyticsId != null ? analyticsId : $id }
3483
+ analytics: { schema: (_a = analyticsId != null ? analyticsId : $id) != null ? _a : "" }
3351
3484
  });
3352
3485
  return behavior;
3353
3486
  }
3354
3487
  return void 0;
3355
3488
  };
3356
3489
  var getBehaviorFromSchemaRefreshStepOnChange = (schema) => {
3357
- var _a, _b;
3490
+ var _a, _b, _c;
3358
3491
  if ("refreshStepOnChange" in schema && ((_a = schema.refreshStepOnChange) != null ? _a : false) || "refreshFormOnChange" in schema && ((_b = schema.refreshFormOnChange) != null ? _b : false)) {
3359
3492
  const { $id, analyticsId, refreshUrl, refreshFormUrl } = schema;
3360
3493
  const behavior = {
3361
3494
  type: "refresh",
3362
- analytics: { schema: analyticsId != null ? analyticsId : $id },
3363
- url: refreshUrl != null ? refreshUrl : refreshFormUrl
3495
+ analytics: { schema: (_c = analyticsId != null ? analyticsId : $id) != null ? _c : "" },
3496
+ url: refreshUrl != null ? refreshUrl : refreshFormUrl,
3497
+ track: false
3364
3498
  };
3365
3499
  return behavior;
3366
3500
  }
@@ -3591,7 +3725,8 @@ var autocompleteTokenMap = {
3591
3725
  var getInitialValidationAsyncState = () => ({
3592
3726
  abortController: new AbortController(),
3593
3727
  lastSubmitted: null,
3594
- messages: {}
3728
+ messages: {},
3729
+ loadingState: "idle"
3595
3730
  });
3596
3731
 
3597
3732
  // src/domain/features/utils/response-utils.ts
@@ -3611,10 +3746,9 @@ var getPerformValidationAsync = ({
3611
3746
  trackEvent
3612
3747
  }) => {
3613
3748
  const { method, param, url } = validationAsyncConfig;
3614
- const trackFailureAndReturn = (json) => {
3749
+ const trackFailure = (json) => {
3615
3750
  const analytics = getAnalyticsFromErrorResponse(json);
3616
3751
  trackEvent("ValidationAsync Failed", __spreadValues({ schema: schemaId }, analytics));
3617
- return null;
3618
3752
  };
3619
3753
  return async function performValidationAsync({ value, signal }) {
3620
3754
  let response;
@@ -3624,8 +3758,9 @@ var getPerformValidationAsync = ({
3624
3758
  url,
3625
3759
  constructPayload({ value, signal, requestConfig: { method, param } })
3626
3760
  );
3627
- } catch (e) {
3628
- return trackFailureAndReturn();
3761
+ } catch (error) {
3762
+ trackFailure();
3763
+ throw error;
3629
3764
  }
3630
3765
  const json = await response.json().catch(() => null);
3631
3766
  const message = getValidationMessage(json);
@@ -3639,7 +3774,8 @@ var getPerformValidationAsync = ({
3639
3774
  throw new Error(message);
3640
3775
  }
3641
3776
  }
3642
- return trackFailureAndReturn(json);
3777
+ trackFailure(json);
3778
+ return null;
3643
3779
  };
3644
3780
  };
3645
3781
  var getValidationMessage = (json) => {
@@ -3736,7 +3872,7 @@ var mapCommonSchemaProps = (schemaMapperProps) => {
3736
3872
  title,
3737
3873
  hidden
3738
3874
  } = schema;
3739
- return __spreadValues(__spreadValues(__spreadValues({
3875
+ return __spreadValues(__spreadValues(__spreadValues(__spreadValues({
3740
3876
  uid,
3741
3877
  id: $id != null ? $id : uid,
3742
3878
  schemaId,
@@ -3753,7 +3889,7 @@ var mapCommonSchemaProps = (schemaMapperProps) => {
3753
3889
  title,
3754
3890
  onPersistAsync,
3755
3891
  summariser: getSummariser(schema)
3756
- }, schemaHasHelp(schema) ? { help: schema.help.markdown } : {}), schemaHasPlaceholder(schema) ? { placeholder: schema.placeholder } : {}), schema.alert ? { alert: mapSchemaAlert(schema.alert) } : {});
3892
+ }, schemaHasHelp(schema) ? { help: schema.help.markdown } : {}), schemaHasPlaceholder(schema) ? { placeholder: schema.placeholder } : {}), schema.alert ? { alert: mapSchemaAlert(schema.alert) } : {}), schema.inlineAlert ? { inlineAlert: mapInlineAlert(schema.inlineAlert) } : {});
3757
3893
  };
3758
3894
  var schemaHasDisabled = (schema) => Boolean("disabled" in schema && schema.disabled !== void 0);
3759
3895
  var schemaHasHelp = (schema) => Boolean("help" in schema && schema.help);
@@ -3814,7 +3950,7 @@ var isStringSchemaWithUpload = (schema) => isStringSchema(schema) && schema.form
3814
3950
  var isSchemaWithPersistAsync = (schema) => "persistAsync" in schema && !isNullish(schema.persistAsync);
3815
3951
 
3816
3952
  // src/domain/components/AllOfComponent.ts
3817
- var createAllOfComponent = (allOfProps) => {
3953
+ var createAllOfComponent = (props) => {
3818
3954
  const {
3819
3955
  uid,
3820
3956
  schemaId,
@@ -3828,8 +3964,8 @@ var createAllOfComponent = (allOfProps) => {
3828
3964
  media,
3829
3965
  title,
3830
3966
  tags
3831
- } = allOfProps;
3832
- return {
3967
+ } = props;
3968
+ const component = {
3833
3969
  type: "all-of",
3834
3970
  kind: "input",
3835
3971
  uid,
@@ -3845,24 +3981,25 @@ var createAllOfComponent = (allOfProps) => {
3845
3981
  title,
3846
3982
  tags,
3847
3983
  getChildren() {
3848
- return this.components;
3984
+ return component.components;
3849
3985
  },
3850
3986
  getSummary() {
3851
- return summariseFromChildren(this.getChildren());
3987
+ return summariseFromChildren(component.getChildren());
3852
3988
  },
3853
3989
  async getSubmittableValue() {
3854
- return getSubmittableData(this.components);
3990
+ return getSubmittableData(component.components);
3855
3991
  },
3856
3992
  getSubmittableValueSync() {
3857
- return getSubmittableDataSync(this.components);
3993
+ return getSubmittableDataSync(component.components);
3858
3994
  },
3859
3995
  getLocalValue() {
3860
- return getLocalValues(this.components);
3996
+ return getLocalValues(component.components);
3861
3997
  },
3862
3998
  validate() {
3863
- return hidden ? true : validateComponents(this.getChildren());
3999
+ return hidden ? true : validateComponents(component.getChildren());
3864
4000
  }
3865
4001
  };
4002
+ return component;
3866
4003
  };
3867
4004
 
3868
4005
  // src/domain/mappers/schema/allOfSchemaToComponent.ts
@@ -3888,8 +4025,8 @@ var allOfSchemaToComponent = (schemaMapperProps, mapperProps) => {
3888
4025
  };
3889
4026
 
3890
4027
  // src/domain/components/RepeatableComponent.ts
3891
- var createRepeatableComponent = (repeatableProps, onComponentUpdate) => {
3892
- const _a = repeatableProps, {
4028
+ var createRepeatableComponent = (props, onComponentUpdate) => {
4029
+ const _a = props, {
3893
4030
  uid,
3894
4031
  schemaId,
3895
4032
  analyticsId,
@@ -3912,7 +4049,7 @@ var createRepeatableComponent = (repeatableProps, onComponentUpdate) => {
3912
4049
  ]);
3913
4050
  const update = getInputUpdateFunction(onComponentUpdate);
3914
4051
  const getValidationErrors = getLocalValueValidator(checks);
3915
- const repeatableComponent = __spreadProps(__spreadValues({
4052
+ const component = __spreadProps(__spreadValues({
3916
4053
  uid,
3917
4054
  schemaId,
3918
4055
  analyticsId,
@@ -3927,37 +4064,34 @@ var createRepeatableComponent = (repeatableProps, onComponentUpdate) => {
3927
4064
  media: summary == null ? void 0 : summary.defaultMedia
3928
4065
  }
3929
4066
  }, componentProps), {
3930
- _update(updateFn) {
3931
- update(this, updateFn);
3932
- },
3933
- onEdit(itemIndex) {
3934
- this._update((draft) => {
4067
+ editComponent(itemIndex) {
4068
+ update(component, (draft) => {
3935
4069
  draft.editableComponent = createEditableComponent(
3936
4070
  draft.components[itemIndex].getLocalValue()
3937
4071
  );
3938
4072
  draft.editableIndex = itemIndex;
3939
4073
  });
3940
4074
  },
3941
- onAdd() {
3942
- this._update((draft) => {
4075
+ addComponent() {
4076
+ update(component, (draft) => {
3943
4077
  draft.editableComponent = createEditableComponent(null);
3944
4078
  draft.editableIndex = null;
3945
4079
  draft.errors = [];
3946
4080
  });
3947
4081
  },
3948
- onSave() {
4082
+ saveComponent() {
3949
4083
  var _a2;
3950
- const isValid = (_a2 = this.editableComponent) == null ? void 0 : _a2.validate();
4084
+ const isValid = (_a2 = component.editableComponent) == null ? void 0 : _a2.validate();
3951
4085
  if (!isValid) {
3952
4086
  return false;
3953
4087
  }
3954
- this._update((draft) => {
4088
+ update(component, (draft) => {
3955
4089
  if (draft.editableComponent === null) {
3956
4090
  return;
3957
4091
  }
3958
4092
  if (draft.editableIndex === null) {
3959
4093
  const newComponent = __spreadValues({}, draft.editableComponent);
3960
- draft.components = [...this.components, newComponent];
4094
+ draft.components = [...component.components, newComponent];
3961
4095
  } else {
3962
4096
  draft.components[draft.editableIndex] = __spreadProps(__spreadValues({}, draft.editableComponent), {
3963
4097
  uid: draft.components[draft.editableIndex].uid
@@ -3969,8 +4103,8 @@ var createRepeatableComponent = (repeatableProps, onComponentUpdate) => {
3969
4103
  onValueChange();
3970
4104
  return true;
3971
4105
  },
3972
- onRemove() {
3973
- this._update((draft) => {
4106
+ removeComponent() {
4107
+ update(component, (draft) => {
3974
4108
  if (draft.editableIndex === null) {
3975
4109
  return;
3976
4110
  }
@@ -3981,30 +4115,32 @@ var createRepeatableComponent = (repeatableProps, onComponentUpdate) => {
3981
4115
  onValueChange();
3982
4116
  },
3983
4117
  getChildren() {
3984
- return this.editableComponent !== null ? [...this.components, this.editableComponent] : this.components;
4118
+ return component.editableComponent !== null ? [...component.components, component.editableComponent] : component.components;
3985
4119
  },
3986
4120
  async getSubmittableValue() {
3987
- return Promise.all(this.components.map(async (component) => component.getSubmittableValue()));
4121
+ return Promise.all(
4122
+ component.components.map(async (childComponent) => childComponent.getSubmittableValue())
4123
+ );
3988
4124
  },
3989
4125
  getSubmittableValueSync() {
3990
- return this.components.map((component) => component.getSubmittableValueSync());
4126
+ return component.components.map((childComponent) => childComponent.getSubmittableValueSync());
3991
4127
  },
3992
4128
  getSummary() {
3993
4129
  return summariser(null);
3994
4130
  },
3995
4131
  getLocalValue() {
3996
- return this.components.map((component) => component.getLocalValue());
4132
+ return component.components.map((childComponent) => childComponent.getLocalValue());
3997
4133
  },
3998
4134
  validate() {
3999
- const messages = getValidationErrors(this.getLocalValue());
4000
- const childComponentsValid = validateComponents(this.getChildren());
4001
- this._update((draft) => {
4135
+ const messages = getValidationErrors(component.getLocalValue());
4136
+ const childComponentsValid = validateComponents(component.getChildren());
4137
+ update(component, (draft) => {
4002
4138
  draft.errors = messages;
4003
4139
  });
4004
4140
  return messages.length === 0 && childComponentsValid;
4005
4141
  }
4006
4142
  });
4007
- return repeatableComponent;
4143
+ return component;
4008
4144
  };
4009
4145
 
4010
4146
  // src/domain/mappers/schema/arraySchemaToComponent/arraySchemaToRepeatableComponent.ts
@@ -4154,8 +4290,8 @@ var base64ToBytes = (base64) => {
4154
4290
  };
4155
4291
 
4156
4292
  // src/domain/components/MultiUploadInputComponent.ts
4157
- var createMultiUploadInputComponent = (uploadInputProps, onComponentUpdate) => {
4158
- const _a = uploadInputProps, {
4293
+ var createMultiUploadInputComponent = (props, onComponentUpdate) => {
4294
+ const _a = props, {
4159
4295
  uid,
4160
4296
  id,
4161
4297
  checks,
@@ -4178,77 +4314,74 @@ var createMultiUploadInputComponent = (uploadInputProps, onComponentUpdate) => {
4178
4314
  const getValidationErrors = getLocalValueValidator(checks);
4179
4315
  const getFileValidationErrors = getLocalValueValidator(fileChecks);
4180
4316
  const persist = performPersistAsync ? getComponentMultiPersistAsync(update, performPersistAsync) : void 0;
4181
- const uploadComponent = __spreadValues({
4317
+ const component = __spreadValues({
4182
4318
  type: "multi-upload",
4183
4319
  kind: "input",
4184
4320
  uid,
4185
4321
  id,
4186
4322
  format,
4187
4323
  files: [],
4188
- _update(updateFn) {
4189
- update(this, updateFn);
4190
- },
4191
4324
  onBlur() {
4192
- this.validate();
4325
+ component.validate();
4193
4326
  },
4194
4327
  onFocus() {
4195
4328
  },
4196
4329
  // Noop
4197
- async onRemoveFile(index) {
4330
+ async removeFile(index) {
4198
4331
  var _a2;
4199
- this._update((draft) => {
4332
+ update(component, (draft) => {
4200
4333
  draft.value.splice(index, 1);
4201
4334
  draft.files.splice(index, 1);
4202
4335
  });
4203
4336
  if (persist) {
4204
- (_a2 = this.persistedState[index]) == null ? void 0 : _a2.abortController.abort();
4205
- this._update((draft) => {
4337
+ (_a2 = component.persistedState[index]) == null ? void 0 : _a2.abortController.abort();
4338
+ update(component, (draft) => {
4206
4339
  draft.persistedState.splice(index, 1);
4207
4340
  });
4208
4341
  }
4209
4342
  },
4210
- async onInsertFile(index, file) {
4343
+ async insertFile(index, file) {
4211
4344
  const fileErrors = getFileValidationErrors(file);
4212
4345
  const fileId = getRandomId();
4213
4346
  const base64Value = format === "base64" ? await toBase64(file) : null;
4214
- this._update((draft) => {
4347
+ update(component, (draft) => {
4215
4348
  draft.value.splice(index, 0, file);
4216
4349
  draft.files.splice(index, 0, { file, id: fileId, errors: fileErrors, base64Value });
4217
4350
  draft.errors = [];
4218
4351
  });
4219
4352
  if (persist) {
4220
- await persist(this, index, format === "blob" ? file : base64Value);
4353
+ await persist(component, index, format === "blob" ? file : base64Value);
4221
4354
  }
4222
4355
  onValueChange();
4223
4356
  return fileId;
4224
4357
  },
4225
4358
  async getSubmittableValue() {
4226
4359
  if (persist) {
4227
- return Promise.all(this.persistedState.map(async ({ submission }) => submission));
4360
+ return Promise.all(component.persistedState.map(async ({ submission }) => submission));
4228
4361
  }
4229
- return this.files.map(({ base64Value }) => base64Value);
4362
+ return component.files.map(({ base64Value }) => base64Value);
4230
4363
  },
4231
4364
  getSubmittableValueSync() {
4232
4365
  if (persist) {
4233
- return this.persistedState.map(({ lastResponse }) => lastResponse);
4366
+ return component.persistedState.map(({ lastResponse }) => lastResponse);
4234
4367
  }
4235
- return this.files.map(({ base64Value }) => base64Value);
4368
+ return component.files.map(({ base64Value }) => base64Value);
4236
4369
  },
4237
4370
  getSummary() {
4238
- return summariser(this.getLocalValue().map(({ name }) => name));
4371
+ return summariser(component.getLocalValue().map(({ name }) => name));
4239
4372
  },
4240
4373
  getLocalValue() {
4241
- return this.value;
4374
+ return component.value;
4242
4375
  },
4243
4376
  validate() {
4244
- const errorMsgs = getValidationErrors(this.getLocalValue());
4245
- this._update((draft) => {
4377
+ const errorMsgs = getValidationErrors(component.getLocalValue());
4378
+ update(component, (draft) => {
4246
4379
  draft.errors = errorMsgs;
4247
4380
  });
4248
- return errorMsgs.length === 0 && this.files.every(({ errors }) => errors.length === 0);
4381
+ return errorMsgs.length === 0 && component.files.every(({ errors }) => errors.length === 0);
4249
4382
  }
4250
4383
  }, rest);
4251
- return uploadComponent;
4384
+ return component;
4252
4385
  };
4253
4386
 
4254
4387
  // src/domain/features/persistAsync/getInitialPersistedState.ts
@@ -4402,8 +4535,8 @@ var getPersistAsyncConfig = (schema) => {
4402
4535
  var getValueForPersistAsync = (localValue) => isArray(localValue) && localValue.every(isFile) ? localValue : [];
4403
4536
 
4404
4537
  // src/domain/components/MultiSelectInputComponent.ts
4405
- var createMultiSelectComponent = (multiSelectProps, onComponentUpdate) => {
4406
- const _a = multiSelectProps, {
4538
+ var createMultiSelectComponent = (props, onComponentUpdate) => {
4539
+ const _a = props, {
4407
4540
  uid,
4408
4541
  checks,
4409
4542
  options,
@@ -4434,21 +4567,18 @@ var createMultiSelectComponent = (multiSelectProps, onComponentUpdate) => {
4434
4567
  selectedIndices,
4435
4568
  value: null
4436
4569
  }, rest), {
4437
- _update(updateFn) {
4438
- update(this, updateFn);
4439
- },
4440
- onSelect(indices) {
4441
- this._update((draft) => {
4570
+ selectIndices(indices) {
4571
+ update(component, (draft) => {
4442
4572
  draft.selectedIndices = indices;
4443
4573
  draft.errors = [];
4444
4574
  });
4445
4575
  void (schemaOnChange == null ? void 0 : schemaOnChange());
4446
- const errors = getValidationErrors(this.getLocalValue());
4447
- this._update((draft) => {
4576
+ const errors = getValidationErrors(component.getLocalValue());
4577
+ update(component, (draft) => {
4448
4578
  draft.errors = errors;
4449
4579
  });
4450
- if (this.validate()) {
4451
- validateAsync == null ? void 0 : validateAsync(this, this.getLocalValue()).catch(() => {
4580
+ if (component.validate()) {
4581
+ validateAsync == null ? void 0 : validateAsync(component, component.getLocalValue()).catch(() => {
4452
4582
  });
4453
4583
  }
4454
4584
  onValueChange();
@@ -4461,17 +4591,17 @@ var createMultiSelectComponent = (multiSelectProps, onComponentUpdate) => {
4461
4591
  // Noop
4462
4592
  getLocalValue() {
4463
4593
  var _a2, _b;
4464
- return (_b = (_a2 = this.getSelectedChildren()) == null ? void 0 : _a2.map((child) => child.getLocalValue())) != null ? _b : null;
4594
+ return (_b = (_a2 = component.getSelectedChildren()) == null ? void 0 : _a2.map((child) => child.getLocalValue())) != null ? _b : null;
4465
4595
  },
4466
4596
  validate() {
4467
- const errors = getValidationErrors(this.getLocalValue());
4468
- this._update((draft) => {
4597
+ const errors = getValidationErrors(component.getLocalValue());
4598
+ update(component, (draft) => {
4469
4599
  draft.errors = errors;
4470
4600
  });
4471
4601
  return errors.length === 0;
4472
4602
  },
4473
4603
  async getSubmittableValue() {
4474
- const selected = this.getSelectedChildren();
4604
+ const selected = component.getSelectedChildren();
4475
4605
  if (selected) {
4476
4606
  return Promise.all(selected.map(async (child) => child.getSubmittableValue()));
4477
4607
  }
@@ -4479,14 +4609,14 @@ var createMultiSelectComponent = (multiSelectProps, onComponentUpdate) => {
4479
4609
  },
4480
4610
  getSubmittableValueSync() {
4481
4611
  var _a2, _b;
4482
- return (_b = (_a2 = this.getSelectedChildren()) == null ? void 0 : _a2.map((child) => child.getSubmittableValueSync())) != null ? _b : null;
4612
+ return (_b = (_a2 = component.getSelectedChildren()) == null ? void 0 : _a2.map((child) => child.getSubmittableValueSync())) != null ? _b : null;
4483
4613
  },
4484
4614
  getSummary: () => ({}),
4485
4615
  getChildren() {
4486
- return this.children;
4616
+ return component.children;
4487
4617
  },
4488
4618
  getSelectedChildren() {
4489
- return this.selectedIndices.map((i) => this.children[i]);
4619
+ return component.selectedIndices.map((i) => component.children[i]);
4490
4620
  }
4491
4621
  });
4492
4622
  return component;
@@ -4568,7 +4698,7 @@ var arraySchemaToMultiSelectComponent = (schemaMapperProps, mapperProps) => {
4568
4698
  };
4569
4699
 
4570
4700
  // src/domain/components/TupleComponent.ts
4571
- var createTupleComponent = (tupleProps) => {
4701
+ var createTupleComponent = (props) => {
4572
4702
  const {
4573
4703
  uid,
4574
4704
  schemaId,
@@ -4583,8 +4713,8 @@ var createTupleComponent = (tupleProps) => {
4583
4713
  summariser,
4584
4714
  title,
4585
4715
  tags
4586
- } = tupleProps;
4587
- return {
4716
+ } = props;
4717
+ const component = {
4588
4718
  type: "tuple",
4589
4719
  kind: "input",
4590
4720
  uid,
@@ -4600,26 +4730,27 @@ var createTupleComponent = (tupleProps) => {
4600
4730
  title,
4601
4731
  tags,
4602
4732
  getChildren() {
4603
- return this.components;
4733
+ return component.components;
4604
4734
  },
4605
4735
  async getSubmittableValue() {
4606
- return Promise.all(this.components.map(async (child) => child.getSubmittableValue()));
4736
+ return Promise.all(component.components.map(async (child) => child.getSubmittableValue()));
4607
4737
  },
4608
4738
  getSubmittableValueSync() {
4609
- return this.components.map((child) => child.getSubmittableValueSync());
4739
+ return component.components.map((child) => child.getSubmittableValueSync());
4610
4740
  },
4611
4741
  getSummary() {
4612
- const summary = summariser(this.getLocalValue());
4613
- const childSummary = summariseFromChildren(this.getChildren());
4742
+ const summary = summariser(component.getLocalValue());
4743
+ const childSummary = summariseFromChildren(component.getChildren());
4614
4744
  return mergeSummaries(summary, childSummary);
4615
4745
  },
4616
4746
  getLocalValue() {
4617
- return this.components.map((child) => child.getLocalValue());
4747
+ return component.components.map((child) => child.getLocalValue());
4618
4748
  },
4619
4749
  validate() {
4620
- return hidden ? true : validateComponents(this.getChildren());
4750
+ return hidden ? true : validateComponents(component.getChildren());
4621
4751
  }
4622
4752
  };
4753
+ return component;
4623
4754
  };
4624
4755
 
4625
4756
  // src/domain/mappers/schema/arraySchemaToComponent/arraySchemaToTupleComponent.ts
@@ -4674,8 +4805,8 @@ var isPersistAsyncWithUploadSchema = (schema) => isSchemaWithPersistAsync(schema
4674
4805
  var isArraySchemaListWithMultiSelect = (schema) => isArrayListSchema(schema) && "oneOf" in schema.items && schema.items.oneOf.every(isConstSchema);
4675
4806
 
4676
4807
  // src/domain/components/UploadInputComponent.ts
4677
- var createUploadInputComponent = (uploadInputProps, onComponentUpdate) => {
4678
- const _a = uploadInputProps, {
4808
+ var createUploadInputComponent = (props, onComponentUpdate) => {
4809
+ const _a = props, {
4679
4810
  uid,
4680
4811
  id,
4681
4812
  checks,
@@ -4698,7 +4829,7 @@ var createUploadInputComponent = (uploadInputProps, onComponentUpdate) => {
4698
4829
  ]);
4699
4830
  const update = getInputUpdateFunction(onComponentUpdate);
4700
4831
  const getValidationErrors = getLocalValueValidator(checks);
4701
- const uploadComponent = __spreadValues({
4832
+ const component = __spreadValues({
4702
4833
  type: "upload",
4703
4834
  kind: "input",
4704
4835
  uid,
@@ -4706,18 +4837,15 @@ var createUploadInputComponent = (uploadInputProps, onComponentUpdate) => {
4706
4837
  format,
4707
4838
  value,
4708
4839
  base64Value: null,
4709
- _update(updateFn) {
4710
- update(this, updateFn);
4711
- },
4712
4840
  onBlur() {
4713
- this.validate();
4841
+ component.validate();
4714
4842
  },
4715
4843
  onFocus() {
4716
4844
  },
4717
4845
  // Noop
4718
- async onUpload(updatedValue) {
4719
- const base64Value = this.format === "base64" && updatedValue ? await toBase64(updatedValue) : null;
4720
- this._update((draft) => {
4846
+ async setValue(updatedValue) {
4847
+ const base64Value = component.format === "base64" && updatedValue ? await toBase64(updatedValue) : null;
4848
+ update(component, (draft) => {
4721
4849
  draft.errors = [];
4722
4850
  draft.value = updatedValue;
4723
4851
  draft.base64Value = base64Value;
@@ -4725,50 +4853,47 @@ var createUploadInputComponent = (uploadInputProps, onComponentUpdate) => {
4725
4853
  void (schemaOnChange == null ? void 0 : schemaOnChange());
4726
4854
  onValueChange();
4727
4855
  await (onPersistAsync == null ? void 0 : onPersistAsync().catch((e) => {
4728
- this._update((draft) => {
4856
+ update(component, (draft) => {
4729
4857
  draft.value = null;
4730
4858
  });
4731
4859
  throw e;
4732
4860
  }));
4733
4861
  },
4734
4862
  async getSubmittableValue() {
4735
- const file = this.getLocalValue();
4736
- if (this.format === "base64" && file) {
4863
+ const file = component.getLocalValue();
4864
+ if (component.format === "base64" && file) {
4737
4865
  return toBase64(file);
4738
4866
  }
4739
4867
  return null;
4740
4868
  },
4741
4869
  getSubmittableValueSync() {
4742
- return this.base64Value;
4870
+ return component.base64Value;
4743
4871
  },
4744
4872
  getSummary() {
4745
4873
  var _a2, _b;
4746
- return summariser((_b = (_a2 = this.getLocalValue()) == null ? void 0 : _a2.name) != null ? _b : null);
4874
+ return summariser((_b = (_a2 = component.getLocalValue()) == null ? void 0 : _a2.name) != null ? _b : null);
4747
4875
  },
4748
4876
  getLocalValue() {
4749
- return this.value;
4877
+ return component.value;
4750
4878
  },
4751
4879
  validate() {
4752
- const errors = getValidationErrors(this.getLocalValue());
4753
- this._update((draft) => {
4880
+ const errors = getValidationErrors(component.getLocalValue());
4881
+ update(component, (draft) => {
4754
4882
  draft.errors = errors;
4755
4883
  });
4756
4884
  return errors.length === 0;
4757
4885
  }
4758
4886
  }, rest);
4759
4887
  if (format === "base64" && value && !onPersistAsync) {
4760
- void initialiseBase64Value(uploadComponent);
4761
- }
4762
- return uploadComponent;
4763
- };
4764
- var initialiseBase64Value = async (uploadComponent) => {
4765
- const { format, value } = uploadComponent;
4766
- const base64Value = format === "base64" && value ? await toBase64(value) : null;
4767
- if (base64Value) {
4768
- uploadComponent._update((draft) => {
4769
- draft.base64Value = base64Value;
4888
+ void toBase64(value).then((base64Value) => {
4889
+ if (base64Value) {
4890
+ update(component, (draft) => {
4891
+ draft.base64Value = base64Value;
4892
+ });
4893
+ }
4770
4894
  });
4771
4895
  }
4896
+ return component;
4772
4897
  };
4773
4898
 
4774
4899
  // src/domain/mappers/schema/blobSchemaToComponent.ts
@@ -4797,8 +4922,8 @@ var blobSchemaToComponent = (schemaMapperProps, mapperProps) => {
4797
4922
  };
4798
4923
 
4799
4924
  // src/domain/components/BooleanInputComponent.ts
4800
- var createBooleanInputComponent = (booleanInputProps, onComponentUpdate) => {
4801
- const _a = booleanInputProps, {
4925
+ var createBooleanInputComponent = (props, onComponentUpdate) => {
4926
+ const _a = props, {
4802
4927
  uid,
4803
4928
  id,
4804
4929
  value,
@@ -4819,49 +4944,46 @@ var createBooleanInputComponent = (booleanInputProps, onComponentUpdate) => {
4819
4944
  ]);
4820
4945
  const update = getInputUpdateFunction(onComponentUpdate);
4821
4946
  const validateAsync = performValidationAsync ? getComponentValidationAsync(update, performValidationAsync) : void 0;
4822
- const booleanComponent = __spreadValues({
4947
+ const component = __spreadValues({
4823
4948
  type: "boolean",
4824
4949
  kind: "input",
4825
4950
  uid,
4826
4951
  id,
4827
4952
  autoComplete: "",
4828
4953
  value,
4829
- _update(updateFn) {
4830
- update(this, updateFn);
4831
- },
4832
4954
  onBlur() {
4833
4955
  },
4834
4956
  // Noop
4835
4957
  onFocus() {
4836
4958
  },
4837
4959
  // Noop
4838
- onChange(updatedValue) {
4839
- this._update((draft) => {
4960
+ setValue(updatedValue) {
4961
+ update(component, (draft) => {
4840
4962
  draft.errors = [];
4841
4963
  draft.value = updatedValue;
4842
4964
  });
4843
4965
  void (schemaOnChange == null ? void 0 : schemaOnChange());
4844
4966
  void (onPersistAsync == null ? void 0 : onPersistAsync().catch(() => {
4845
4967
  }));
4846
- validateAsync == null ? void 0 : validateAsync(this, this.getLocalValue()).catch(() => {
4968
+ validateAsync == null ? void 0 : validateAsync(component, component.getLocalValue()).catch(() => {
4847
4969
  });
4848
4970
  onValueChange();
4849
4971
  },
4850
4972
  async getSubmittableValue() {
4851
- return this.getSubmittableValueSync();
4973
+ return component.getSubmittableValueSync();
4852
4974
  },
4853
4975
  getSubmittableValueSync() {
4854
- return this.getLocalValue();
4976
+ return component.getLocalValue();
4855
4977
  },
4856
4978
  getSummary() {
4857
- return summariser(this.getLocalValue());
4979
+ return summariser(component.getLocalValue());
4858
4980
  },
4859
4981
  getLocalValue() {
4860
- return this.value;
4982
+ return component.value;
4861
4983
  },
4862
4984
  validate: () => true
4863
4985
  }, rest);
4864
- return booleanComponent;
4986
+ return component;
4865
4987
  };
4866
4988
 
4867
4989
  // src/domain/mappers/schema/booleanSchemaToComponent.ts
@@ -4902,8 +5024,8 @@ var getValidModel = (model, defaultValue) => {
4902
5024
  };
4903
5025
 
4904
5026
  // src/domain/components/ConstComponent.ts
4905
- var createConstComponent = (hiddenProps) => {
4906
- const { uid, schemaId, analyticsId, value, summary, layout, hidden, tags } = hiddenProps;
5027
+ var createConstComponent = (props) => {
5028
+ const { uid, schemaId, analyticsId, value, summary, layout, hidden, tags } = props;
4907
5029
  return {
4908
5030
  type: "const",
4909
5031
  kind: "input",
@@ -4946,8 +5068,8 @@ var getConstLayout = (uid, mapperProps, layout, alert) => {
4946
5068
  };
4947
5069
 
4948
5070
  // src/domain/components/IntegerInputComponent.ts
4949
- var createIntegerInputComponent = (integerInputProps, onComponentUpdate) => {
4950
- const _a = integerInputProps, {
5071
+ var createIntegerInputComponent = (props, onComponentUpdate) => {
5072
+ const _a = props, {
4951
5073
  uid,
4952
5074
  id,
4953
5075
  checks,
@@ -4972,17 +5094,14 @@ var createIntegerInputComponent = (integerInputProps, onComponentUpdate) => {
4972
5094
  const getValidationErrors = getLocalValueValidator(checks);
4973
5095
  const performOnChange = getDebouncedSchemaOnChange(schemaOnChange, getValidationErrors);
4974
5096
  const validateAsync = performValidationAsync ? getDebouncedComponentValidationAsync(update, performValidationAsync) : void 0;
4975
- const integerComponent = __spreadValues({
5097
+ const component = __spreadValues({
4976
5098
  type: "integer",
4977
5099
  kind: "input",
4978
5100
  uid,
4979
5101
  id,
4980
5102
  value,
4981
- _update(updateFn) {
4982
- update(this, updateFn);
4983
- },
4984
5103
  onBlur() {
4985
- const isValid = this.validate();
5104
+ const isValid = component.validate();
4986
5105
  performOnChange == null ? void 0 : performOnChange.flush();
4987
5106
  if (isValid) {
4988
5107
  void (onPersistAsync == null ? void 0 : onPersistAsync().catch(() => {
@@ -4993,9 +5112,9 @@ var createIntegerInputComponent = (integerInputProps, onComponentUpdate) => {
4993
5112
  onFocus() {
4994
5113
  },
4995
5114
  // Noop
4996
- onChange(updatedValue) {
4997
- const prevValue = this.value;
4998
- this._update((draft) => {
5115
+ setValue(updatedValue) {
5116
+ const prevValue = component.value;
5117
+ update(component, (draft) => {
4999
5118
  draft.errors = [];
5000
5119
  draft.validationAsyncState.messages = {};
5001
5120
  draft.value = updatedValue;
@@ -5003,32 +5122,32 @@ var createIntegerInputComponent = (integerInputProps, onComponentUpdate) => {
5003
5122
  performOnChange == null ? void 0 : performOnChange(prevValue, updatedValue);
5004
5123
  const isValid = getValidationErrors(updatedValue).length === 0;
5005
5124
  if (isValid) {
5006
- validateAsync == null ? void 0 : validateAsync(this, updatedValue);
5125
+ validateAsync == null ? void 0 : validateAsync(component, updatedValue);
5007
5126
  }
5008
5127
  onValueChange();
5009
5128
  },
5010
5129
  async getSubmittableValue() {
5011
- return this.getSubmittableValueSync();
5130
+ return component.getSubmittableValueSync();
5012
5131
  },
5013
5132
  getSubmittableValueSync() {
5014
5133
  var _a2;
5015
- return (_a2 = this.getLocalValue()) != null ? _a2 : null;
5134
+ return (_a2 = component.getLocalValue()) != null ? _a2 : null;
5016
5135
  },
5017
5136
  getSummary() {
5018
- return summariser(this.getLocalValue());
5137
+ return summariser(component.getLocalValue());
5019
5138
  },
5020
5139
  getLocalValue() {
5021
- return this.value;
5140
+ return component.value;
5022
5141
  },
5023
5142
  validate() {
5024
- const errors = getValidationErrors(this.getLocalValue());
5025
- this._update((draft) => {
5143
+ const errors = getValidationErrors(component.getLocalValue());
5144
+ update(component, (draft) => {
5026
5145
  draft.errors = errors;
5027
5146
  });
5028
5147
  return errors.length === 0;
5029
5148
  }
5030
5149
  }, rest);
5031
- return integerComponent;
5150
+ return component;
5032
5151
  };
5033
5152
 
5034
5153
  // src/domain/mappers/schema/integerSchemaToComponent.ts
@@ -5086,7 +5205,7 @@ var createFormattedValueComponent = (props, onComponentUpdate) => {
5086
5205
  schemaOnChange
5087
5206
  } = props;
5088
5207
  const update = getInputUpdateFunction(onComponentUpdate);
5089
- return {
5208
+ const component = {
5090
5209
  type: "formatted-value",
5091
5210
  kind: "input",
5092
5211
  uid,
@@ -5104,27 +5223,28 @@ var createFormattedValueComponent = (props, onComponentUpdate) => {
5104
5223
  tags,
5105
5224
  value,
5106
5225
  async getSubmittableValue() {
5107
- return this.getSubmittableValueSync();
5226
+ return component.getSubmittableValueSync();
5108
5227
  },
5109
5228
  getSubmittableValueSync() {
5110
- return this.getLocalValue();
5229
+ return component.getLocalValue();
5111
5230
  },
5112
5231
  getSummary() {
5113
- return summariser(this.getLocalValue());
5232
+ return summariser(component.getLocalValue());
5114
5233
  },
5115
5234
  getLocalValue() {
5116
- return this.value;
5235
+ return component.value;
5117
5236
  },
5118
5237
  validate() {
5119
5238
  return true;
5120
5239
  },
5121
- onChange(newValue) {
5122
- update(this, (draft) => {
5240
+ setValue(newValue) {
5241
+ update(component, (draft) => {
5123
5242
  draft.value = newValue;
5124
5243
  });
5125
5244
  void (schemaOnChange == null ? void 0 : schemaOnChange());
5126
5245
  }
5127
5246
  };
5247
+ return component;
5128
5248
  };
5129
5249
 
5130
5250
  // src/domain/mappers/schema/objectSchemaToComponent/objectSchemaToFormattedValueComponent.ts
@@ -5143,8 +5263,8 @@ var objectSchemaToFormattedValueComponent = (schemaMapperProps, mapperProps) =>
5143
5263
  };
5144
5264
 
5145
5265
  // src/domain/components/MoneyInputComponent.ts
5146
- var createMoneyInputComponent = (moneyInputProps, onComponentUpdate) => {
5147
- const _a = moneyInputProps, {
5266
+ var createMoneyInputComponent = (props, onComponentUpdate) => {
5267
+ const _a = props, {
5148
5268
  id,
5149
5269
  uid,
5150
5270
  schemaId,
@@ -5185,7 +5305,7 @@ var createMoneyInputComponent = (moneyInputProps, onComponentUpdate) => {
5185
5305
  ]);
5186
5306
  const getValidationErrors = getLocalValueValidator(checks);
5187
5307
  const update = getInputUpdateFunction(onComponentUpdate);
5188
- const moneyComponent = __spreadValues({
5308
+ const component = __spreadValues({
5189
5309
  type: "money-input",
5190
5310
  kind: "input",
5191
5311
  id,
@@ -5204,9 +5324,6 @@ var createMoneyInputComponent = (moneyInputProps, onComponentUpdate) => {
5204
5324
  [amountKey]: amountComponent.getLocalValue(),
5205
5325
  [currencyKey]: currencyComponent.getLocalValue()
5206
5326
  },
5207
- _update(updateFn) {
5208
- update(this, updateFn);
5209
- },
5210
5327
  components: {
5211
5328
  amount: amountComponent,
5212
5329
  currency: currencyComponent
@@ -5230,11 +5347,11 @@ var createMoneyInputComponent = (moneyInputProps, onComponentUpdate) => {
5230
5347
  }, extraValues);
5231
5348
  },
5232
5349
  getSummary() {
5233
- return summariser(this.getLocalValue());
5350
+ return summariser(component.getLocalValue());
5234
5351
  },
5235
5352
  validate() {
5236
5353
  const errors = getValidationErrors(amountComponent.getLocalValue());
5237
- this._update((draft) => {
5354
+ update(component, (draft) => {
5238
5355
  draft.errors = errors;
5239
5356
  });
5240
5357
  return amountComponent.validate() && currencyComponent.validate() && errors.length === 0;
@@ -5245,11 +5362,11 @@ var createMoneyInputComponent = (moneyInputProps, onComponentUpdate) => {
5245
5362
  onFocus() {
5246
5363
  }
5247
5364
  }, rest);
5248
- return moneyComponent;
5365
+ return component;
5249
5366
  };
5250
5367
 
5251
5368
  // src/domain/components/ObjectComponent.ts
5252
- var createObjectComponent = (objectProps) => {
5369
+ var createObjectComponent = (props) => {
5253
5370
  const {
5254
5371
  uid,
5255
5372
  schemaId,
@@ -5265,8 +5382,8 @@ var createObjectComponent = (objectProps) => {
5265
5382
  summariser,
5266
5383
  title,
5267
5384
  tags
5268
- } = objectProps;
5269
- return {
5385
+ } = props;
5386
+ const component = {
5270
5387
  type: "object",
5271
5388
  kind: "input",
5272
5389
  uid,
@@ -5282,12 +5399,12 @@ var createObjectComponent = (objectProps) => {
5282
5399
  title,
5283
5400
  tags,
5284
5401
  getChildren() {
5285
- return displayOrder.map((propName) => this.componentMap[propName]);
5402
+ return displayOrder.map((propName) => component.componentMap[propName]);
5286
5403
  },
5287
5404
  async getSubmittableValue() {
5288
5405
  return Promise.all(
5289
5406
  displayOrder.map(
5290
- async (propName) => this.componentMap[propName].getSubmittableValue().then((value) => ({ value, propName }))
5407
+ async (propName) => component.componentMap[propName].getSubmittableValue().then((value) => ({ value, propName }))
5291
5408
  )
5292
5409
  ).then(
5293
5410
  (values) => values.reduce(
@@ -5299,24 +5416,25 @@ var createObjectComponent = (objectProps) => {
5299
5416
  getSubmittableValueSync() {
5300
5417
  return mergeChildrenValues(
5301
5418
  displayOrder,
5302
- (propName) => this.componentMap[propName].getSubmittableValueSync()
5419
+ (propName) => component.componentMap[propName].getSubmittableValueSync()
5303
5420
  );
5304
5421
  },
5305
5422
  getSummary() {
5306
- const summary = summariser(this.getLocalValue());
5307
- const childSummary = summariseFromChildren(this.getChildren());
5423
+ const summary = summariser(component.getLocalValue());
5424
+ const childSummary = summariseFromChildren(component.getChildren());
5308
5425
  return mergeSummaries(summary, childSummary);
5309
5426
  },
5310
5427
  getLocalValue() {
5311
5428
  return mergeChildrenValues(
5312
5429
  displayOrder,
5313
- (propName) => this.componentMap[propName].getLocalValue()
5430
+ (propName) => component.componentMap[propName].getLocalValue()
5314
5431
  );
5315
5432
  },
5316
5433
  validate() {
5317
- return hidden ? true : validateComponents(this.getChildren());
5434
+ return hidden ? true : validateComponents(component.getChildren());
5318
5435
  }
5319
5436
  };
5437
+ return component;
5320
5438
  };
5321
5439
  var mergeChildrenValues = (displayOrder, getComponentValue) => displayOrder.reduce((acc, propName) => {
5322
5440
  const componentValue = getComponentValue(propName);
@@ -5502,8 +5620,8 @@ var isPartialModelMatch = (localModel, incomingModel) => {
5502
5620
  var nonNullishKeys = (model) => Object.keys(model).filter((key) => !isNullish(model[key]));
5503
5621
 
5504
5622
  // src/domain/components/SelectInputComponent.ts
5505
- var createSelectInputComponent = (selectProps, onComponentUpdate) => {
5506
- const _a = selectProps, { uid, checks, initialModel, options, schemaOnChange, onValueChange, summariser } = _a, rest = __objRest(_a, ["uid", "checks", "initialModel", "options", "schemaOnChange", "onValueChange", "summariser"]);
5623
+ var createSelectInputComponent = (props, onComponentUpdate) => {
5624
+ const _a = props, { uid, checks, initialModel, options, schemaOnChange, onValueChange, summariser } = _a, rest = __objRest(_a, ["uid", "checks", "initialModel", "options", "schemaOnChange", "onValueChange", "summariser"]);
5507
5625
  const children = options.map((option) => option.component);
5508
5626
  const matchingOptions = options.map(
5509
5627
  (option) => isPartialModelMatch(option.component.getSubmittableValueSync(), initialModel)
@@ -5520,54 +5638,51 @@ var createSelectInputComponent = (selectProps, onComponentUpdate) => {
5520
5638
  selectedIndex,
5521
5639
  value: null
5522
5640
  }, rest), {
5523
- _update(updateFn) {
5524
- update(this, updateFn);
5525
- },
5526
5641
  getChildren() {
5527
- return this.children;
5642
+ return component.children;
5528
5643
  },
5529
5644
  getSelectedChild() {
5530
- return this.selectedIndex !== null ? this.children[this.selectedIndex] : null;
5645
+ return component.selectedIndex !== null ? component.children[component.selectedIndex] : null;
5531
5646
  },
5532
5647
  async getSubmittableValue() {
5533
5648
  var _a2, _b;
5534
- return (_b = await ((_a2 = this.getSelectedChild()) == null ? void 0 : _a2.getSubmittableValue())) != null ? _b : null;
5649
+ return (_b = await ((_a2 = component.getSelectedChild()) == null ? void 0 : _a2.getSubmittableValue())) != null ? _b : null;
5535
5650
  },
5536
5651
  getSubmittableValueSync() {
5537
5652
  var _a2, _b;
5538
- return (_b = (_a2 = this.getSelectedChild()) == null ? void 0 : _a2.getSubmittableValueSync()) != null ? _b : null;
5653
+ return (_b = (_a2 = component.getSelectedChild()) == null ? void 0 : _a2.getSubmittableValueSync()) != null ? _b : null;
5539
5654
  },
5540
5655
  getSummary() {
5541
5656
  var _a2, _b;
5542
- return (_b = (_a2 = this.getSelectedChild()) == null ? void 0 : _a2.getSummary()) != null ? _b : {};
5657
+ return (_b = (_a2 = component.getSelectedChild()) == null ? void 0 : _a2.getSummary()) != null ? _b : {};
5543
5658
  },
5544
5659
  getLocalValue() {
5545
5660
  var _a2, _b;
5546
- return (_b = (_a2 = this.getSelectedChild()) == null ? void 0 : _a2.getLocalValue()) != null ? _b : null;
5661
+ return (_b = (_a2 = component.getSelectedChild()) == null ? void 0 : _a2.getLocalValue()) != null ? _b : null;
5547
5662
  },
5548
5663
  onBlur() {
5549
- this.validate();
5664
+ component.validate();
5550
5665
  },
5551
5666
  onFocus() {
5552
5667
  },
5553
5668
  // noop
5554
- onSelect(updatedIndex) {
5555
- if (updatedIndex === this.selectedIndex) {
5669
+ selectIndex(updatedIndex) {
5670
+ if (updatedIndex === component.selectedIndex) {
5556
5671
  return;
5557
5672
  }
5558
5673
  if (updatedIndex !== null) {
5559
- selectProps.trackEvent("OneOf Option Selected", {
5560
- schema: this.analyticsId,
5561
- selectedOption: this.children[updatedIndex].analyticsId
5674
+ props.trackEvent("OneOf Option Selected", {
5675
+ schema: component.analyticsId,
5676
+ selectedOption: component.children[updatedIndex].analyticsId
5562
5677
  });
5563
- if (this.analyticsId) {
5564
- selectProps.trackEvent("OneOf Selected", {
5565
- oneOfId: this.analyticsId,
5566
- schemaId: this.children[updatedIndex].analyticsId
5678
+ if (component.analyticsId) {
5679
+ props.trackEvent("OneOf Selected", {
5680
+ oneOfId: component.analyticsId,
5681
+ schemaId: component.children[updatedIndex].analyticsId
5567
5682
  });
5568
5683
  }
5569
5684
  }
5570
- this._update((draft) => {
5685
+ update(component, (draft) => {
5571
5686
  draft.errors = [];
5572
5687
  draft.selectedIndex = updatedIndex;
5573
5688
  });
@@ -5576,9 +5691,9 @@ var createSelectInputComponent = (selectProps, onComponentUpdate) => {
5576
5691
  },
5577
5692
  validate() {
5578
5693
  var _a2, _b;
5579
- const validChild = (_b = (_a2 = this.getSelectedChild()) == null ? void 0 : _a2.validate()) != null ? _b : true;
5580
- const errors = getValidationErrors(this.getLocalValue());
5581
- this._update((draft) => {
5694
+ const validChild = (_b = (_a2 = component.getSelectedChild()) == null ? void 0 : _a2.validate()) != null ? _b : true;
5695
+ const errors = getValidationErrors(component.getLocalValue());
5696
+ update(component, (draft) => {
5582
5697
  draft.errors = errors;
5583
5698
  });
5584
5699
  return errors.length === 0 && validChild;
@@ -5674,63 +5789,72 @@ var isExactLocalValueMatch = (valueA, valueB) => {
5674
5789
 
5675
5790
  // src/domain/components/PersistAsyncComponent.ts
5676
5791
  var createPersistAsyncComponent = (props, performPersistAsync, schemaOnChange, onComponentUpdate) => {
5677
- const { uid, analyticsId, schemaId, component, hidden, model, localValue, tags } = props;
5792
+ const {
5793
+ uid,
5794
+ analyticsId,
5795
+ schemaId,
5796
+ component: childComponent,
5797
+ hidden,
5798
+ model,
5799
+ localValue,
5800
+ tags
5801
+ } = props;
5678
5802
  const update = getInputUpdateFunction(onComponentUpdate);
5679
- const paComponent = {
5803
+ const component = {
5680
5804
  type: "persist-async",
5681
5805
  kind: "input",
5682
5806
  uid,
5683
5807
  analyticsId,
5684
5808
  schemaId,
5685
- component,
5809
+ component: childComponent,
5686
5810
  hidden,
5811
+ status: "idle",
5687
5812
  lastSubmitted: model != null ? localValue != null ? localValue : null : null,
5688
5813
  lastResponse: model != null ? model : null,
5689
5814
  submission: Promise.resolve(model != null ? model : null),
5690
5815
  abortController: new AbortController(),
5691
5816
  errors: [],
5692
5817
  tags,
5693
- _update(updateFn) {
5694
- update(this, updateFn);
5695
- },
5696
5818
  validate() {
5697
- return this.component.validate();
5819
+ return component.component.validate();
5698
5820
  },
5699
5821
  getLocalValue() {
5700
- return this.component.getLocalValue();
5822
+ return component.component.getLocalValue();
5701
5823
  },
5702
5824
  async getSubmittableValue() {
5703
- return this.persist();
5825
+ return component.persist();
5704
5826
  },
5705
5827
  getSubmittableValueSync() {
5706
- return this.lastResponse;
5828
+ return component.lastResponse;
5707
5829
  },
5708
5830
  getSummary() {
5709
- return this.component.getSummary();
5831
+ return component.component.getSummary();
5710
5832
  },
5711
5833
  async persist() {
5712
- const childLocalValue = this.component.getLocalValue();
5713
- if (isExactLocalValueMatch(childLocalValue, this.lastSubmitted)) {
5714
- return this.submission;
5834
+ const childLocalValue = component.component.getLocalValue();
5835
+ if (isExactLocalValueMatch(childLocalValue, component.lastSubmitted)) {
5836
+ return component.submission;
5715
5837
  }
5716
- const newAbortController = abortAndResetController(this.abortController);
5838
+ const newAbortController = abortAndResetController(component.abortController);
5717
5839
  if (childLocalValue == null || childLocalValue === "") {
5718
5840
  const resolvedNull = Promise.resolve(null);
5719
- this._update((draft) => {
5841
+ update(component, (draft) => {
5720
5842
  draft.abortController = newAbortController;
5721
5843
  draft.lastResponse = null;
5722
5844
  draft.lastSubmitted = childLocalValue;
5723
5845
  draft.submission = resolvedNull;
5724
5846
  draft.errors = [];
5847
+ draft.status = "idle";
5725
5848
  });
5726
5849
  void (schemaOnChange == null ? void 0 : schemaOnChange());
5727
5850
  return resolvedNull;
5728
5851
  }
5729
5852
  const { signal } = newAbortController;
5730
5853
  const newSubmission = performPersistAsync({ value: childLocalValue, signal }).then((token) => {
5731
- this._update((draft) => {
5854
+ update(component, (draft) => {
5732
5855
  draft.lastResponse = token;
5733
5856
  draft.errors = [];
5857
+ draft.status = "success";
5734
5858
  });
5735
5859
  void (schemaOnChange == null ? void 0 : schemaOnChange());
5736
5860
  return token;
@@ -5738,27 +5862,29 @@ var createPersistAsyncComponent = (props, performPersistAsync, schemaOnChange, o
5738
5862
  if (error instanceof DOMException && error.name === "AbortError") {
5739
5863
  return null;
5740
5864
  }
5741
- this._update((draft) => {
5865
+ update(component, (draft) => {
5742
5866
  draft.lastResponse = null;
5743
5867
  draft.lastSubmitted = null;
5744
5868
  draft.submission = Promise.resolve(null);
5745
- if (this.component.type !== "upload") {
5869
+ draft.status = "error";
5870
+ if (component.component.type !== "upload") {
5746
5871
  draft.errors = error instanceof Error ? [error.message] : [];
5747
5872
  }
5748
5873
  });
5749
5874
  throw error;
5750
5875
  });
5751
- this._update((draft) => {
5876
+ update(component, (draft) => {
5752
5877
  draft.abortController = newAbortController;
5753
5878
  draft.lastSubmitted = childLocalValue;
5754
5879
  draft.lastResponse = null;
5755
5880
  draft.submission = newSubmission;
5756
5881
  draft.errors = [];
5882
+ draft.status = "persisting";
5757
5883
  });
5758
5884
  return newSubmission;
5759
5885
  }
5760
5886
  };
5761
- return paComponent;
5887
+ return component;
5762
5888
  };
5763
5889
 
5764
5890
  // src/domain/mappers/schema/persistAsyncSchemaToComponent.ts
@@ -5797,8 +5923,8 @@ var persistAsyncSchemaToComponent = (schemaMapperProps, mapperProps) => {
5797
5923
  };
5798
5924
 
5799
5925
  // src/domain/components/DateInputComponent.ts
5800
- var createDateInputComponent = (textInputProps, onComponentUpdate) => {
5801
- const _a = textInputProps, {
5926
+ var createDateInputComponent = (props, onComponentUpdate) => {
5927
+ const _a = props, {
5802
5928
  uid,
5803
5929
  id,
5804
5930
  checks,
@@ -5822,28 +5948,25 @@ var createDateInputComponent = (textInputProps, onComponentUpdate) => {
5822
5948
  const update = getInputUpdateFunction(onComponentUpdate);
5823
5949
  const getValidationErrors = getLocalValueValidator(checks);
5824
5950
  const validateAsync = performValidationAsync ? getComponentValidationAsync(update, performValidationAsync) : void 0;
5825
- const dateInputComponent = __spreadValues({
5951
+ const component = __spreadValues({
5826
5952
  type: "date",
5827
5953
  kind: "input",
5828
5954
  uid,
5829
5955
  id,
5830
5956
  value,
5831
- _update(updateFn) {
5832
- update(this, updateFn);
5833
- },
5834
5957
  onBlur() {
5835
- const isValid = this.validate();
5958
+ const isValid = component.validate();
5836
5959
  if (isValid) {
5837
- validateAsync == null ? void 0 : validateAsync(this, this.getLocalValue()).catch(() => {
5960
+ validateAsync == null ? void 0 : validateAsync(component, component.getLocalValue()).catch(() => {
5838
5961
  });
5839
5962
  }
5840
5963
  },
5841
5964
  onFocus() {
5842
5965
  },
5843
5966
  // Noop
5844
- onChange(updatedValue) {
5845
- const prevValue = this.value;
5846
- this._update((draft) => {
5967
+ setValue(updatedValue) {
5968
+ const prevValue = component.value;
5969
+ update(component, (draft) => {
5847
5970
  draft.errors = [];
5848
5971
  draft.validationAsyncState.messages = {};
5849
5972
  draft.value = updatedValue;
@@ -5858,29 +5981,29 @@ var createDateInputComponent = (textInputProps, onComponentUpdate) => {
5858
5981
  }
5859
5982
  },
5860
5983
  async getSubmittableValue() {
5861
- return this.getSubmittableValueSync();
5984
+ return component.getSubmittableValueSync();
5862
5985
  },
5863
5986
  getSubmittableValueSync() {
5864
- if (isValidDate(this.getLocalValue())) {
5865
- return this.getLocalValue();
5987
+ if (isValidDate(component.getLocalValue())) {
5988
+ return component.getLocalValue();
5866
5989
  }
5867
5990
  return null;
5868
5991
  },
5869
5992
  getSummary() {
5870
- return summariser(this.getLocalValue());
5993
+ return summariser(component.getLocalValue());
5871
5994
  },
5872
5995
  getLocalValue() {
5873
- return this.value;
5996
+ return component.value;
5874
5997
  },
5875
5998
  validate() {
5876
- const errors = getValidationErrors(this.getLocalValue());
5877
- this._update((draft) => {
5999
+ const errors = getValidationErrors(component.getLocalValue());
6000
+ update(component, (draft) => {
5878
6001
  draft.errors = errors;
5879
6002
  });
5880
6003
  return errors.length === 0;
5881
6004
  }
5882
6005
  }, rest);
5883
- return dateInputComponent;
6006
+ return component;
5884
6007
  };
5885
6008
 
5886
6009
  // src/domain/mappers/utils/suggestions-utils.ts
@@ -5994,8 +6117,8 @@ var stringSchemaToUploadInputComponent = (schemaMapperProps, mapperProps) => {
5994
6117
  var getFileFromModel = (model) => isString(model) ? base64dataUrltoFile(model, "") : null;
5995
6118
 
5996
6119
  // src/domain/components/TextInputComponent.ts
5997
- var createTextInputComponent = (textInputProps, onComponentUpdate) => {
5998
- const _a = textInputProps, {
6120
+ var createTextInputComponent = (props, onComponentUpdate) => {
6121
+ const _a = props, {
5999
6122
  uid,
6000
6123
  id,
6001
6124
  checks,
@@ -6020,17 +6143,14 @@ var createTextInputComponent = (textInputProps, onComponentUpdate) => {
6020
6143
  const getValidationErrors = getLocalValueValidator(checks);
6021
6144
  const performOnChange = getDebouncedSchemaOnChange(schemaOnChange, getValidationErrors);
6022
6145
  const validateAsync = performValidationAsync ? getDebouncedComponentValidationAsync(update, performValidationAsync) : void 0;
6023
- const inputComponent = __spreadValues({
6146
+ const component = __spreadValues({
6024
6147
  type: "text",
6025
6148
  kind: "input",
6026
6149
  uid,
6027
6150
  id,
6028
6151
  value,
6029
- _update(updateFn) {
6030
- update(this, updateFn);
6031
- },
6032
6152
  onBlur() {
6033
- const isValid = this.validate();
6153
+ const isValid = component.validate();
6034
6154
  performOnChange == null ? void 0 : performOnChange.flush();
6035
6155
  if (isValid) {
6036
6156
  void (onPersistAsync == null ? void 0 : onPersistAsync().catch(() => {
@@ -6041,9 +6161,9 @@ var createTextInputComponent = (textInputProps, onComponentUpdate) => {
6041
6161
  onFocus() {
6042
6162
  },
6043
6163
  // Noop
6044
- onChange(updatedValue) {
6045
- const prevValue = this.value;
6046
- this._update((draft) => {
6164
+ setValue(updatedValue) {
6165
+ const prevValue = component.value;
6166
+ update(component, (draft) => {
6047
6167
  draft.errors = [];
6048
6168
  draft.validationAsyncState.messages = {};
6049
6169
  draft.value = updatedValue;
@@ -6051,7 +6171,7 @@ var createTextInputComponent = (textInputProps, onComponentUpdate) => {
6051
6171
  performOnChange == null ? void 0 : performOnChange(prevValue, updatedValue);
6052
6172
  const isValid = getValidationErrors(updatedValue).length === 0;
6053
6173
  if (isValid) {
6054
- validateAsync == null ? void 0 : validateAsync(this, updatedValue);
6174
+ validateAsync == null ? void 0 : validateAsync(component, updatedValue);
6055
6175
  }
6056
6176
  if (!updatedValue) {
6057
6177
  validateAsync == null ? void 0 : validateAsync.cancel();
@@ -6059,26 +6179,26 @@ var createTextInputComponent = (textInputProps, onComponentUpdate) => {
6059
6179
  onValueChange();
6060
6180
  },
6061
6181
  async getSubmittableValue() {
6062
- return this.getSubmittableValueSync();
6182
+ return component.getSubmittableValueSync();
6063
6183
  },
6064
6184
  getSubmittableValueSync() {
6065
- return this.getLocalValue() || null;
6185
+ return component.getLocalValue() || null;
6066
6186
  },
6067
6187
  getSummary() {
6068
- return summariser(this.getLocalValue());
6188
+ return summariser(component.getLocalValue());
6069
6189
  },
6070
6190
  getLocalValue() {
6071
- return this.value;
6191
+ return component.value;
6072
6192
  },
6073
6193
  validate() {
6074
- const errors = getValidationErrors(this.getLocalValue());
6075
- this._update((draft) => {
6194
+ const errors = getValidationErrors(component.getLocalValue());
6195
+ update(component, (draft) => {
6076
6196
  draft.errors = errors;
6077
6197
  });
6078
6198
  return errors.length === 0;
6079
6199
  }
6080
6200
  }, rest);
6081
- return inputComponent;
6201
+ return component;
6082
6202
  };
6083
6203
 
6084
6204
  // src/domain/mappers/schema/stringSchemaToComponent/stringSchemaToTextInputComponent.ts
@@ -6322,7 +6442,7 @@ var mapStepToComponent = (_a) => {
6322
6442
  "onPoll",
6323
6443
  "onBehavior"
6324
6444
  ]);
6325
- var _a2;
6445
+ var _a2, _b2;
6326
6446
  const { etag, step, stepLocalValue, flowRequestCache, logEvent, onComponentUpdate } = restProps;
6327
6447
  const {
6328
6448
  id,
@@ -6341,6 +6461,12 @@ var mapStepToComponent = (_a) => {
6341
6461
  const registerSubmissionBehavior = (behavior) => {
6342
6462
  submissionBehaviors.push(behavior);
6343
6463
  };
6464
+ const mapperProps = __spreadProps(__spreadValues({}, restProps), {
6465
+ features,
6466
+ trackEvent,
6467
+ onBehavior,
6468
+ registerSubmissionBehavior
6469
+ });
6344
6470
  const back = mapBackNavigation(navigation, onBehavior, features.isEnabled("nativeBack"));
6345
6471
  const stepId = id || key;
6346
6472
  if (stepId === void 0) {
@@ -6356,18 +6482,15 @@ var mapStepToComponent = (_a) => {
6356
6482
  }) : void 0;
6357
6483
  const stepRefreshAfter = refreshAfter ? getStepRefreshAfter({ refreshAfter, logEvent, onBehavior }) : void 0;
6358
6484
  const stepPrefetch = getStepPrefetch(restProps.httpClient, flowRequestCache, submissionBehaviors);
6359
- const externalConfirmation = (external == null ? void 0 : external.url) ? createExternalConfirmation(
6360
- `${uid}-external-confirmation`,
6361
- external == null ? void 0 : external.url,
6362
- restProps.onLink,
6363
- onComponentUpdate
6364
- ) : void 0;
6365
- const mapperProps = __spreadProps(__spreadValues({}, restProps), {
6366
- features,
6367
- trackEvent,
6368
- onBehavior,
6485
+ const onLoadBehavior = getDomainLayerBehavior(
6486
+ { behavior: step.onLoad },
6487
+ (_a2 = step.actions) != null ? _a2 : [],
6369
6488
  registerSubmissionBehavior
6370
- });
6489
+ );
6490
+ const stepOnLoad = onLoadBehavior && onLoadBehavior.type !== "link" ? () => {
6491
+ void onBehavior(onLoadBehavior);
6492
+ } : void 0;
6493
+ const externalConfirmation = getExternalConfiguration(uid, external, onLoadBehavior, mapperProps);
6371
6494
  const referencedSchemaIds = getReferencedSchemaId(step);
6372
6495
  const schemaComponents = mapStepSchemas(uid, step, stepLocalValue, mapperProps);
6373
6496
  const { layout, footer } = getLayoutAndFooter(step, features);
@@ -6395,13 +6518,16 @@ var mapStepToComponent = (_a) => {
6395
6518
  stepRefreshAfter,
6396
6519
  title,
6397
6520
  tags,
6398
- stackBehavior: (_a2 = navigation == null ? void 0 : navigation.stackBehavior) != null ? _a2 : "default",
6521
+ stackBehavior: (_b2 = navigation == null ? void 0 : navigation.stackBehavior) != null ? _b2 : "default",
6399
6522
  stepPrefetch,
6400
6523
  step,
6401
6524
  referencedSchemaIds,
6525
+ features,
6402
6526
  onComponentUpdate,
6403
6527
  trackEvent,
6404
- onBehavior
6528
+ logEvent,
6529
+ onBehavior,
6530
+ onLoad: stepOnLoad
6405
6531
  });
6406
6532
  return stepComponent;
6407
6533
  };
@@ -6415,7 +6541,7 @@ var getReferencedSchemaId = (step) => {
6415
6541
  var mapBackNavigation = (navigation, onBehavior, isNativeBackEnabled) => {
6416
6542
  var _a;
6417
6543
  const backNavigation = (_a = navigation == null ? void 0 : navigation.back) != null ? _a : navigation == null ? void 0 : navigation.backButton;
6418
- const backBehavior = { type: "back", action: backNavigation == null ? void 0 : backNavigation.action };
6544
+ const backBehavior = { type: "back", action: backNavigation == null ? void 0 : backNavigation.action, track: false };
6419
6545
  return backNavigation || isNativeBackEnabled ? {
6420
6546
  title: backNavigation == null ? void 0 : backNavigation.title,
6421
6547
  onClick: () => {
@@ -6423,6 +6549,25 @@ var mapBackNavigation = (navigation, onBehavior, isNativeBackEnabled) => {
6423
6549
  }
6424
6550
  } : void 0;
6425
6551
  };
6552
+ var getExternalConfiguration = (uid, external, onLoad, mapperProps) => {
6553
+ if (onLoad.type === "link") {
6554
+ return createExternalConfirmation(
6555
+ `${uid}-external-confirmation`,
6556
+ onLoad == null ? void 0 : onLoad.url,
6557
+ mapperProps.onLink,
6558
+ mapperProps.onComponentUpdate
6559
+ );
6560
+ }
6561
+ if ((external == null ? void 0 : external.url) && onLoad.type === "none") {
6562
+ return createExternalConfirmation(
6563
+ `${uid}-external-confirmation`,
6564
+ external == null ? void 0 : external.url,
6565
+ mapperProps.onLink,
6566
+ mapperProps.onComponentUpdate
6567
+ );
6568
+ }
6569
+ return void 0;
6570
+ };
6426
6571
  var getLayoutAndFooter = (step, features) => {
6427
6572
  var _a;
6428
6573
  if (step.footer) {
@@ -6453,19 +6598,148 @@ var validateStepTypes = (step, logEvent) => {
6453
6598
  }
6454
6599
  };
6455
6600
 
6456
- // src/controller/executePoll.ts
6457
- var executePoll = async (props) => {
6458
- const { errorBehavior, signal, url, httpClient, trackEvent } = props;
6601
+ // src/controller/getFilenameFromContentDisposition.ts
6602
+ var getFilenameFromContentDisposition = (contentDisposition) => {
6603
+ var _a;
6604
+ if (!contentDisposition) {
6605
+ return "";
6606
+ }
6607
+ const parameters = getFilenames(contentDisposition);
6608
+ const { filename, filenameStar } = parameters;
6609
+ const decodedFilename = decodeFilename(filenameStar);
6610
+ return extractBasename((_a = decodedFilename != null ? decodedFilename : filename) != null ? _a : "");
6611
+ };
6612
+ var filenameRegex = /;\s*(filename\*?)\s*=\s*("[^"]*"|[^;]*)/gi;
6613
+ var getFilenames = (contentDisposition) => {
6614
+ var _a, _b;
6615
+ const params = Array.from(contentDisposition.matchAll(filenameRegex)).map((match) => {
6616
+ var _a2, _b2, _c;
6617
+ return [(_a2 = match[1]) == null ? void 0 : _a2.toLowerCase(), removeQuotes((_c = (_b2 = match[2]) == null ? void 0 : _b2.trim()) != null ? _c : "") || void 0];
6618
+ });
6619
+ return {
6620
+ filename: (_a = params.find(([key]) => key === "filename")) == null ? void 0 : _a[1],
6621
+ filenameStar: (_b = params.find(([key]) => key === "filename*")) == null ? void 0 : _b[1]
6622
+ };
6623
+ };
6624
+ var removeQuotes = (value) => {
6625
+ if (value.startsWith('"') && value.endsWith('"')) {
6626
+ return value.slice(1, -1);
6627
+ }
6628
+ return value;
6629
+ };
6630
+ var decodeFilename = (encodedFilename) => {
6631
+ if (!encodedFilename) {
6632
+ return void 0;
6633
+ }
6634
+ const sections = encodedFilename.split("'");
6635
+ const encodedValue = sections.length >= 3 ? sections.slice(2).join("'") : encodedFilename;
6459
6636
  try {
6460
- const response = await httpClient(url != null ? url : "", {
6461
- method: "GET",
6462
- signal
6463
- });
6464
- if (!response.ok) {
6465
- trackEvent("Polling Failed", { url, statusCode: response.status, variant: "revamp" });
6466
- return { type: "behavior", behavior: errorBehavior };
6467
- }
6468
- const responseType = getResponseTypeFromHeader(response.headers);
6637
+ return decodeURIComponent(encodedValue);
6638
+ } catch (e) {
6639
+ return void 0;
6640
+ }
6641
+ };
6642
+ var extractBasename = (filename) => {
6643
+ var _a;
6644
+ const segments = filename.split(/[\\/]+/).filter(Boolean);
6645
+ return (_a = segments.at(-1)) != null ? _a : "";
6646
+ };
6647
+
6648
+ // src/controller/executeDownload.ts
6649
+ var getExecuteDownload = ({
6650
+ onNotification,
6651
+ getErrorMessageFunctions,
6652
+ trackEvent
6653
+ // TODO: add analytics after aligning with other client platforms
6654
+ }) => {
6655
+ const pendingRequests = createPendingRequestsSet();
6656
+ const executeDownload = async (request, httpClient) => {
6657
+ if (pendingRequests.has(request)) {
6658
+ return;
6659
+ }
6660
+ pendingRequests.add(request);
6661
+ onNotification == null ? void 0 : onNotification({ text: getErrorMessageFunctions().downloadStarted() });
6662
+ return fetchDownloadRequest(request, httpClient).then(saveBlob).then(() => {
6663
+ onNotification == null ? void 0 : onNotification({ text: getErrorMessageFunctions().downloadSuccessful() });
6664
+ }).catch((error) => {
6665
+ onNotification == null ? void 0 : onNotification({ text: getErrorMessageFunctions().downloadFailed() });
6666
+ throw error;
6667
+ }).finally(() => {
6668
+ pendingRequests.remove(request);
6669
+ });
6670
+ };
6671
+ return executeDownload;
6672
+ };
6673
+ var fetchDownloadRequest = async (request, httpClient) => {
6674
+ const { url, method, body, headers } = request;
6675
+ const requestBody = method === "GET" ? void 0 : JSON.stringify(body);
6676
+ const requestHeaders = filterForbiddenHeaders(headers);
6677
+ if (requestBody) {
6678
+ requestHeaders.set("Content-Type", "application/json");
6679
+ }
6680
+ const response = await httpClient(url, { method, body: requestBody, headers: requestHeaders });
6681
+ if (!response.ok) {
6682
+ throw new Error(`Download failed with status ${response.status}`);
6683
+ }
6684
+ const contentDisposition = response.headers.get("Content-Disposition");
6685
+ const filename = getFilenameFromContentDisposition(contentDisposition);
6686
+ const blob = await response.blob();
6687
+ return { filename, blob };
6688
+ };
6689
+ var saveBlob = async ({ blob, filename = "" }) => {
6690
+ const blobUrl = URL.createObjectURL(blob);
6691
+ const link = Object.assign(document.createElement("a"), {
6692
+ href: blobUrl,
6693
+ download: filename
6694
+ });
6695
+ document.body.appendChild(link);
6696
+ link.click();
6697
+ await wait();
6698
+ document.body.removeChild(link);
6699
+ URL.revokeObjectURL(blobUrl);
6700
+ };
6701
+ var filterForbiddenHeaders = (headers) => {
6702
+ const forbiddenHeaders = ["authorization", "cookie", "host"];
6703
+ const filteredHeaders = Object.entries(headers != null ? headers : {}).map(([key, value]) => [
6704
+ key.trim().toLowerCase(),
6705
+ value
6706
+ ]).filter(([key]) => !forbiddenHeaders.includes(key));
6707
+ return new Headers(filteredHeaders);
6708
+ };
6709
+ var wait = async () => new Promise((resolve) => {
6710
+ setTimeout(resolve, 0);
6711
+ });
6712
+ var createPendingRequestsSet = () => {
6713
+ const pendingRequests = /* @__PURE__ */ new Set();
6714
+ return {
6715
+ add: (request) => {
6716
+ const requestKey = JSON.stringify(request);
6717
+ pendingRequests.add(requestKey);
6718
+ },
6719
+ remove: (request) => {
6720
+ const requestKey = JSON.stringify(request);
6721
+ pendingRequests.delete(requestKey);
6722
+ },
6723
+ has: (request) => {
6724
+ const requestKey = JSON.stringify(request);
6725
+ return pendingRequests.has(requestKey);
6726
+ }
6727
+ };
6728
+ };
6729
+
6730
+ // src/controller/executePoll.ts
6731
+ var executePoll = async (props) => {
6732
+ const { errorBehavior, signal, url, httpClient, trackEvent } = props;
6733
+ try {
6734
+ const response = await httpClient(url != null ? url : "", {
6735
+ method: "GET",
6736
+ signal
6737
+ });
6738
+ if (!response.ok) {
6739
+ trackEvent("Polling Failed", { url, statusCode: response.status, variant: "revamp" });
6740
+ return { type: "behavior", behavior: errorBehavior };
6741
+ }
6742
+ const responseType = getResponseTypeFromHeader(response.headers);
6469
6743
  const body = await parseResponseBodyAsJsonElement(response);
6470
6744
  try {
6471
6745
  switch (responseType) {
@@ -6483,10 +6757,10 @@ var executePoll = async (props) => {
6483
6757
  }
6484
6758
  case "modal": {
6485
6759
  assertModalResponseBody(body);
6486
- return { type: "behavior", behavior: __spreadValues({ type: "modal" }, body) };
6760
+ return { type: "behavior", behavior: __spreadProps(__spreadValues({ type: "modal" }, body), { track: false }) };
6487
6761
  }
6488
6762
  case "no-op": {
6489
- return { type: "behavior", behavior: { type: "none" } };
6763
+ return { type: "behavior", behavior: { type: "none", track: false } };
6490
6764
  }
6491
6765
  case "subflow": {
6492
6766
  assertSubflowResponseBody(body);
@@ -6511,7 +6785,8 @@ var executePoll = async (props) => {
6511
6785
  };
6512
6786
  var actionResponseBodyToBehavior = (body) => ({
6513
6787
  type: "non-merging-action",
6514
- action: body.action
6788
+ action: body.action,
6789
+ track: false
6515
6790
  });
6516
6791
 
6517
6792
  // src/controller/executeRefresh.ts
@@ -6566,36 +6841,30 @@ var executeRefresh = async (props) => {
6566
6841
  };
6567
6842
 
6568
6843
  // src/domain/components/SubflowComponent.ts
6569
- var createSubflowComponent = (subflowProps, onComponentUpdate) => {
6570
- switch (subflowProps.subflowType) {
6844
+ var createSubflowComponent = (props, onComponentUpdate) => {
6845
+ switch (props.subflowType) {
6571
6846
  case "dynamic":
6572
- return createDynamicSubflowComponent(subflowProps, onComponentUpdate);
6847
+ return createDynamicSubflowComponent(props, onComponentUpdate);
6573
6848
  case "native":
6574
- return createNativeSubflowComponent(subflowProps);
6849
+ return createNativeSubflowComponent(props);
6575
6850
  }
6576
6851
  };
6577
- var createDynamicSubflowComponent = (subflowProps, onComponentUpdate) => {
6852
+ var createDynamicSubflowComponent = (props, onComponentUpdate) => {
6578
6853
  const update = getInputUpdateFunction(onComponentUpdate);
6579
- const subflowComponent = __spreadProps(__spreadValues({
6854
+ return __spreadValues({
6580
6855
  uid: `subflow-dynamic-${getRandomId()}`,
6581
6856
  type: "subflow",
6582
6857
  subflowType: "dynamic",
6583
6858
  kind: "layout"
6584
- }, subflowProps), {
6585
- _update(updateFn) {
6586
- update(this, updateFn);
6587
- }
6588
- });
6589
- return subflowComponent;
6859
+ }, props);
6590
6860
  };
6591
- var createNativeSubflowComponent = (subflowProps) => {
6592
- const subflowComponent = __spreadValues({
6861
+ var createNativeSubflowComponent = (props) => {
6862
+ return __spreadValues({
6593
6863
  uid: `subflow-native-${getRandomId()}`,
6594
6864
  type: "subflow",
6595
6865
  subflowType: "native",
6596
6866
  kind: "layout"
6597
- }, subflowProps);
6598
- return subflowComponent;
6867
+ }, props);
6599
6868
  };
6600
6869
 
6601
6870
  // src/controller/executeSubflow.ts
@@ -6725,13 +6994,14 @@ var getStepCounter = () => {
6725
6994
 
6726
6995
  // src/controller/FlowController.ts
6727
6996
  var createFlowController = (props) => {
6728
- const _a = props, {
6997
+ const {
6729
6998
  flowId,
6730
6999
  initialAction,
6731
7000
  initialStep,
6732
7001
  backConfig,
6733
7002
  features,
6734
7003
  nativeSubflowHandlers,
7004
+ requestCache,
6735
7005
  getErrorMessageFunctions,
6736
7006
  scrollToTop,
6737
7007
  onChange,
@@ -6739,38 +7009,21 @@ var createFlowController = (props) => {
6739
7009
  onCompletion,
6740
7010
  onCopy,
6741
7011
  onLink,
7012
+ onNotification,
6742
7013
  onError,
6743
7014
  onEvent,
6744
7015
  onLog,
6745
7016
  onValueChange
6746
- } = _a, rest = __objRest(_a, [
6747
- "flowId",
6748
- "initialAction",
6749
- "initialStep",
6750
- "backConfig",
6751
- "features",
6752
- "nativeSubflowHandlers",
6753
- "getErrorMessageFunctions",
6754
- "scrollToTop",
6755
- "onChange",
6756
- "onCancellation",
6757
- "onCompletion",
6758
- "onCopy",
6759
- "onLink",
6760
- "onError",
6761
- "onEvent",
6762
- "onLog",
6763
- "onValueChange"
6764
- ]);
7017
+ } = props;
6765
7018
  const httpClient = getHttpClientWithCapabilities(props.httpClient, nativeSubflowHandlers);
6766
7019
  const rootComponent = createRootDomainComponent(
6767
7020
  onChange,
6768
7021
  scrollToTop,
6769
7022
  backConfig,
6770
- normaliseRequestCache(rest.requestCache)
7023
+ normaliseRequestCache(requestCache)
6771
7024
  );
6772
7025
  const stepCount = getStepCounter();
6773
- const abortController = getRequestAbortController();
7026
+ const refreshAbortController = getRequestAbortController();
6774
7027
  const createStep = (newStep, etag) => {
6775
7028
  if (rootComponent.hasStep()) {
6776
7029
  stepCount.increment();
@@ -6782,8 +7035,8 @@ var createFlowController = (props) => {
6782
7035
  }
6783
7036
  };
6784
7037
  const updateStep = (newStep, etag) => {
6785
- var _a2;
6786
- const component = createStepComponent2(newStep, etag, (_a2 = rootComponent.getLocalValue()) != null ? _a2 : null);
7038
+ var _a;
7039
+ const component = createStepComponent2(newStep, etag, (_a = rootComponent.getLocalValue()) != null ? _a : null);
6787
7040
  if (component) {
6788
7041
  rootComponent.updateStep(component);
6789
7042
  rootComponent.setLoadingState("idle");
@@ -6818,14 +7071,14 @@ var createFlowController = (props) => {
6818
7071
  }
6819
7072
  };
6820
7073
  const getStep = () => {
6821
- var _a2;
7074
+ var _a;
6822
7075
  const stepComponent = rootComponent.getStep();
6823
- return (_a2 = stepComponent == null ? void 0 : stepComponent.step) != null ? _a2 : initialStep;
7076
+ return (_a = stepComponent == null ? void 0 : stepComponent.step) != null ? _a : initialStep;
6824
7077
  };
6825
7078
  const trackEvent = (eventName, properties) => {
6826
- var _a2, _b;
7079
+ var _a, _b;
6827
7080
  const step = getStep();
6828
- const stepId = (_b = (_a2 = step == null ? void 0 : step.id) != null ? _a2 : step == null ? void 0 : step.key) != null ? _b : null;
7081
+ const stepId = (_b = (_a = step == null ? void 0 : step.id) != null ? _a : step == null ? void 0 : step.key) != null ? _b : null;
6829
7082
  const analytics = step == null ? void 0 : step.analytics;
6830
7083
  const metadata = __spreadValues(__spreadValues(__spreadValues(__spreadValues({
6831
7084
  flowId,
@@ -6836,10 +7089,16 @@ var createFlowController = (props) => {
6836
7089
  } catch (e) {
6837
7090
  }
6838
7091
  };
7092
+ const trackCoreEvent = trackEvent;
7093
+ const executeDownload = getExecuteDownload({
7094
+ onNotification,
7095
+ getErrorMessageFunctions,
7096
+ trackEvent
7097
+ });
6839
7098
  const logEvent = (level, message, properties) => {
6840
- var _a2, _b;
7099
+ var _a, _b;
6841
7100
  const step = getStep();
6842
- const stepId = (_b = (_a2 = step == null ? void 0 : step.id) != null ? _a2 : step == null ? void 0 : step.key) != null ? _b : null;
7101
+ const stepId = (_b = (_a = step == null ? void 0 : step.id) != null ? _a : step == null ? void 0 : step.key) != null ? _b : null;
6843
7102
  try {
6844
7103
  onLog == null ? void 0 : onLog(level, message, __spreadValues(__spreadValues(__spreadProps(__spreadValues({}, properties), {
6845
7104
  flowId
@@ -6849,17 +7108,26 @@ var createFlowController = (props) => {
6849
7108
  };
6850
7109
  const closeWithError = (error, analytics, statusCode) => {
6851
7110
  rootComponent.stop();
6852
- trackEvent("Failed", __spreadValues({}, analytics));
7111
+ trackCoreEvent("Failed", __spreadValues({}, analytics));
6853
7112
  logEvent("error", "Dynamic Flow failed", { errorMessage: getErrorMessage(error), analytics });
6854
7113
  onError(error, statusCode);
6855
7114
  };
6856
7115
  const closeWithCancellation = () => {
6857
- trackEvent("Cancelled");
7116
+ trackCoreEvent("Cancelled");
6858
7117
  onCancellation == null ? void 0 : onCancellation();
6859
7118
  };
6860
7119
  const onBehavior = async (behavior) => {
6861
- var _a2;
7120
+ var _a;
7121
+ trackBehaviorTriggered(trackEvent, behavior);
6862
7122
  switch (behavior.type) {
7123
+ case "download": {
7124
+ try {
7125
+ await executeDownload(behavior.request, httpClient);
7126
+ } catch (error) {
7127
+ logEvent("error", "Download failed", { errorMessage: getErrorMessage(error) });
7128
+ }
7129
+ break;
7130
+ }
6863
7131
  case "back": {
6864
7132
  if (behavior.action) {
6865
7133
  onAction(behavior.action, null).then(() => {
@@ -6894,6 +7162,7 @@ var createFlowController = (props) => {
6894
7162
  void onAction(action, model);
6895
7163
  } else {
6896
7164
  rootComponent.setLoadingState("idle");
7165
+ scrollToTop("smooth");
6897
7166
  }
6898
7167
  } catch (e) {
6899
7168
  rootComponent.setLoadingState("idle");
@@ -6916,7 +7185,7 @@ var createFlowController = (props) => {
6916
7185
  void onRefresh({ refreshUrl: behavior.url, analytics: behavior.analytics });
6917
7186
  return {
6918
7187
  abort: () => {
6919
- abortController.abort();
7188
+ refreshAbortController.abort();
6920
7189
  }
6921
7190
  };
6922
7191
  }
@@ -6925,7 +7194,7 @@ var createFlowController = (props) => {
6925
7194
  break;
6926
7195
  }
6927
7196
  case "modal": {
6928
- const currentStep = (_a2 = rootComponent.getStep()) == null ? void 0 : _a2.step;
7197
+ const currentStep = (_a = rootComponent.getStep()) == null ? void 0 : _a.step;
6929
7198
  if (currentStep) {
6930
7199
  rootComponent.showModal(
6931
7200
  modalToComponent(
@@ -6976,14 +7245,14 @@ var createFlowController = (props) => {
6976
7245
  } };
6977
7246
  };
6978
7247
  const onAction = async (action, model) => {
6979
- var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
7248
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
6980
7249
  try {
6981
7250
  rootComponent.setLoadingState("submitting");
6982
7251
  const command = await executeSubmission({
6983
7252
  action,
6984
7253
  model,
6985
7254
  isInitial: !rootComponent.hasStep(),
6986
- requestCache: (_b = (_a2 = rootComponent.getStep()) == null ? void 0 : _a2.requestCache) != null ? _b : rootComponent.requestCache,
7255
+ requestCache: (_b = (_a = rootComponent.getStep()) == null ? void 0 : _a.requestCache) != null ? _b : rootComponent.requestCache,
6987
7256
  httpClient,
6988
7257
  trackEvent,
6989
7258
  logEvent
@@ -6991,7 +7260,7 @@ var createFlowController = (props) => {
6991
7260
  switch (command.type) {
6992
7261
  case "complete": {
6993
7262
  onCompletion(command.result);
6994
- trackEvent("Succeeded");
7263
+ trackCoreEvent("Succeeded");
6995
7264
  if (features.isEnabled("continueAfterCompletion")) {
6996
7265
  rootComponent.setLoadingState("idle");
6997
7266
  } else {
@@ -7003,7 +7272,7 @@ var createFlowController = (props) => {
7003
7272
  const isFirstStep = !rootComponent.hasStep();
7004
7273
  rootComponent.closeSubflow();
7005
7274
  createStep(command.step, command.etag);
7006
- trackEvent("Step Shown", { isFirstStep });
7275
+ trackCoreEvent("Step Shown", { isFirstStep });
7007
7276
  break;
7008
7277
  }
7009
7278
  case "error": {
@@ -7020,8 +7289,10 @@ var createFlowController = (props) => {
7020
7289
  // and the model that was submitted
7021
7290
  polling: void 0,
7022
7291
  // and no polling, to avoid restarting it
7023
- external: void 0
7292
+ external: void 0,
7024
7293
  // and no external, to avoid retriggering it
7294
+ onLoad: void 0
7295
+ // and no onLoad, to avoid retriggering it (how is this still the best we have. Should refactor soon)
7025
7296
  }),
7026
7297
  (_f = (_e = rootComponent.getStep()) == null ? void 0 : _e.etag) != null ? _f : null
7027
7298
  );
@@ -7060,13 +7331,13 @@ var createFlowController = (props) => {
7060
7331
  errorsOverride,
7061
7332
  analytics
7062
7333
  }) => {
7063
- var _a2, _b, _c;
7334
+ var _a, _b, _c;
7064
7335
  try {
7065
7336
  rootComponent.setLoadingState("refreshing");
7066
7337
  const model = rootComponent.getSubmittableValueSync();
7067
7338
  const command = await executeRefresh({
7068
- abortSignal: abortController.abortAndGetNewSignal(),
7069
- url: (_a2 = refreshUrl != null ? refreshUrl : rootComponent.getRefreshUrl()) != null ? _a2 : "",
7339
+ abortSignal: refreshAbortController.abortAndGetNewSignal(),
7340
+ url: (_a = refreshUrl != null ? refreshUrl : rootComponent.getRefreshUrl()) != null ? _a : "",
7070
7341
  model,
7071
7342
  etag: (_c = (_b = rootComponent.getStep()) == null ? void 0 : _b.etag) != null ? _c : null,
7072
7343
  analytics,
@@ -7122,14 +7393,14 @@ var createFlowController = (props) => {
7122
7393
  let initState = "initial";
7123
7394
  if (initialStep) {
7124
7395
  initState = "created";
7125
- trackEvent("Initiated");
7396
+ trackCoreEvent("Initiated");
7126
7397
  createStep(initialStep, null);
7127
- trackEvent("Step Shown", { isFirstStep: true });
7398
+ trackCoreEvent("Step Shown", { isFirstStep: true });
7128
7399
  }
7129
7400
  const start = () => {
7130
7401
  if (initState === "initial" && initialAction) {
7131
7402
  initState = "created";
7132
- trackEvent("Initiated");
7403
+ trackCoreEvent("Initiated");
7133
7404
  rootComponent.setLoadingState("submitting");
7134
7405
  void onAction(__spreadValues({ method: "GET" }, initialAction), null).then(() => {
7135
7406
  initState = "started";
@@ -7328,6 +7599,26 @@ var multi_file_upload_messages_default = (0, import_react_intl6.defineMessages)(
7328
7599
  }
7329
7600
  });
7330
7601
 
7602
+ // src/common/messages/download.messages.ts
7603
+ var import_react_intl7 = require("react-intl");
7604
+ var download_messages_default = (0, import_react_intl7.defineMessages)({
7605
+ downloadStarted: {
7606
+ id: "dynamicFlows.DownloadFeedback.started",
7607
+ defaultMessage: "Downloading...",
7608
+ description: "Appears in a snackbar when a download starts."
7609
+ },
7610
+ downloadSuccessful: {
7611
+ id: "dynamicFlows.DownloadFeedback.successful",
7612
+ defaultMessage: "Download successful",
7613
+ description: "Appears in a snackbar when a download succeeds."
7614
+ },
7615
+ downloadFailed: {
7616
+ id: "dynamicFlows.DownloadFeedback.failed",
7617
+ defaultMessage: "Download failed",
7618
+ description: "Appears in a snackbar when a download fails."
7619
+ }
7620
+ });
7621
+
7331
7622
  // src/renderers/getSchemaErrorMessageFunction.ts
7332
7623
  function getSchemaErrorMessageFunction(formatMessage, locale) {
7333
7624
  return (validationMessages) => createErrorMessageFunctions(validationMessages != null ? validationMessages : {}, formatMessage, locale);
@@ -7414,6 +7705,15 @@ var createErrorMessageFunctions = (validationMessages, formatMessage, locale) =>
7414
7705
  },
7415
7706
  genericErrorWithRetry() {
7416
7707
  return formatMessage(generic_error_messages_default.genericErrorRetryHint);
7708
+ },
7709
+ downloadStarted() {
7710
+ return formatMessage(download_messages_default.downloadStarted);
7711
+ },
7712
+ downloadFailed() {
7713
+ return formatMessage(download_messages_default.downloadFailed);
7714
+ },
7715
+ downloadSuccessful() {
7716
+ return formatMessage(download_messages_default.downloadSuccessful);
7417
7717
  }
7418
7718
  });
7419
7719
  var formatDateOptions = {
@@ -7421,6 +7721,28 @@ var formatDateOptions = {
7421
7721
  dateStyle: "long"
7422
7722
  };
7423
7723
 
7724
+ // src/renderers/mappers/utils/mapCallToAction.ts
7725
+ var mapCallToAction = (_a) => {
7726
+ var _b = _a, {
7727
+ hrefWithTracking
7728
+ } = _b, cta = __objRest(_b, [
7729
+ "hrefWithTracking"
7730
+ ]);
7731
+ return __spreadProps(__spreadValues({}, cta), {
7732
+ getAnchorProps: hrefWithTracking
7733
+ });
7734
+ };
7735
+ var mapCallToActionOptional = (cta) => cta ? mapCallToAction(cta) : void 0;
7736
+ var mapAdditionalInfo2 = (info) => {
7737
+ if (info) {
7738
+ const _a = info, { hrefWithTracking } = _a, rest = __objRest(_a, ["hrefWithTracking"]);
7739
+ return __spreadProps(__spreadValues({}, rest), {
7740
+ getAnchorProps: hrefWithTracking
7741
+ });
7742
+ }
7743
+ return void 0;
7744
+ };
7745
+
7424
7746
  // src/renderers/mappers/utils/pick.ts
7425
7747
  function pick(obj, ...keys) {
7426
7748
  const result = {};
@@ -7431,18 +7753,9 @@ function pick(obj, ...keys) {
7431
7753
  }
7432
7754
 
7433
7755
  // src/renderers/mappers/alertComponentToProps.ts
7434
- var alertComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadValues({}, pick(
7435
- component,
7436
- "uid",
7437
- "analyticsId",
7438
- "type",
7439
- "callToAction",
7440
- "context",
7441
- "control",
7442
- "margin",
7443
- "markdown",
7444
- "tags"
7445
- )), rendererMapperProps);
7756
+ var alertComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadProps(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "context", "control", "margin", "markdown", "tags")), {
7757
+ callToAction: mapCallToActionOptional(component.callToAction)
7758
+ }), rendererMapperProps);
7446
7759
 
7447
7760
  // src/renderers/mappers/allOfComponentToProps.ts
7448
7761
  var allOfComponentToProps = (component, rendererMapperProps) => {
@@ -7494,56 +7807,47 @@ var getValidationState = (errors, validationAsyncState) => {
7494
7807
  // src/renderers/mappers/utils/inputComponentToProps.ts
7495
7808
  var inputComponentToProps = (component, type) => {
7496
7809
  var _a;
7497
- const {
7498
- uid,
7499
- analyticsId,
7500
- control,
7501
- description,
7502
- disabled,
7503
- errors,
7504
- help,
7505
- id,
7506
- media,
7507
- placeholder,
7508
- required,
7509
- title,
7510
- tags,
7511
- validationAsyncState,
7512
- onBlur,
7513
- onFocus
7514
- } = component;
7810
+ const { errors, validationAsyncState } = component;
7515
7811
  const { messages } = validationAsyncState != null ? validationAsyncState : {};
7516
- return {
7517
- uid,
7518
- analyticsId,
7812
+ return __spreadProps(__spreadValues({}, pick(
7813
+ component,
7814
+ "uid",
7815
+ "analyticsId",
7816
+ "control",
7817
+ "description",
7818
+ "disabled",
7819
+ "help",
7820
+ "id",
7821
+ "media",
7822
+ "placeholder",
7823
+ "required",
7824
+ "title",
7825
+ "tags",
7826
+ "inlineAlert",
7827
+ "onBlur",
7828
+ "onFocus"
7829
+ )), {
7519
7830
  type,
7520
- control,
7521
- description,
7522
- disabled,
7523
7831
  error: (_a = messages == null ? void 0 : messages.error) != null ? _a : errors == null ? void 0 : errors[0],
7524
- help,
7525
- id,
7526
- media,
7527
- placeholder,
7528
- required,
7529
- title,
7530
- tags,
7531
- validationState: getValidationState(errors, validationAsyncState),
7532
7832
  value: component.getLocalValue(),
7533
- onBlur: onBlur.bind(component),
7534
- onFocus: onFocus.bind(component)
7535
- };
7833
+ validationState: getValidationState(errors, validationAsyncState),
7834
+ fieldLoadingState: getFieldLoadingState(component)
7835
+ });
7836
+ };
7837
+ var getFieldLoadingState = (component) => {
7838
+ const { validationAsyncState } = component;
7839
+ if (!validationAsyncState) {
7840
+ return "idle";
7841
+ }
7842
+ return validationAsyncState.loadingState === "pending" ? "validating" : "idle";
7536
7843
  };
7537
7844
 
7538
7845
  // src/renderers/mappers/booleanInputComponentToProps.ts
7539
7846
  var booleanInputComponentToProps = (component, rendererMapperProps) => {
7540
7847
  var _a;
7541
- return __spreadProps(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-checkbox")), rendererMapperProps), {
7542
- additionalText: component.additionalText,
7543
- supportingValues: component.supportingValues,
7544
- inlineAlert: component.inlineAlert,
7545
- value: (_a = component.value) != null ? _a : false,
7546
- onChange: component.onChange.bind(component)
7848
+ return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-checkbox")), rendererMapperProps), pick(component, "additionalText", "supportingValues", "inlineAlert")), {
7849
+ onChange: component.setValue,
7850
+ value: (_a = component.value) != null ? _a : false
7547
7851
  });
7548
7852
  };
7549
7853
 
@@ -7592,30 +7896,14 @@ var buttonComponentToProps = (component, rendererMapperProps) => {
7592
7896
  };
7593
7897
 
7594
7898
  // src/renderers/mappers/columnsComponentToProps.ts
7595
- var columnsComponentToProps = ({
7596
- uid,
7597
- analyticsId,
7598
- bias,
7599
- control,
7600
- margin,
7601
- tags,
7602
- startComponents,
7603
- endComponents
7604
- }, rendererMapperProps) => {
7605
- const startChildrenProps = startComponents.map(
7899
+ var columnsComponentToProps = (component, rendererMapperProps) => {
7900
+ const startChildrenProps = component.startComponents.map(
7606
7901
  (c) => componentToRendererProps(c, rendererMapperProps)
7607
7902
  );
7608
- const endChildrenProps = endComponents.map(
7903
+ const endChildrenProps = component.endComponents.map(
7609
7904
  (c) => componentToRendererProps(c, rendererMapperProps)
7610
7905
  );
7611
- return __spreadProps(__spreadValues({}, rendererMapperProps), {
7612
- uid,
7613
- analyticsId,
7614
- type: "columns",
7615
- bias,
7616
- control,
7617
- margin,
7618
- tags,
7906
+ return __spreadProps(__spreadValues(__spreadValues({}, rendererMapperProps), pick(component, "uid", "analyticsId", "type", "bias", "control", "margin", "tags")), {
7619
7907
  startChildren: startChildrenProps.map(rendererMapperProps.render),
7620
7908
  endChildren: endChildrenProps.map(rendererMapperProps.render),
7621
7909
  startChildrenProps,
@@ -7639,29 +7927,24 @@ var constComponentToProps = (component, rendererMapperProps) => {
7639
7927
  // src/renderers/mappers/containerComponentToProps.ts
7640
7928
  var containerComponentToProps = (component, rendererMapperProps) => {
7641
7929
  const childrenProps = component.getChildren().map((c) => componentToRendererProps(c, rendererMapperProps));
7642
- return __spreadValues({
7643
- type: "container",
7644
- uid: component.uid,
7930
+ return __spreadValues(__spreadProps(__spreadValues({}, pick(component, "type", "uid")), {
7645
7931
  children: childrenProps.map(rendererMapperProps.render),
7646
7932
  childrenProps
7647
- }, rendererMapperProps);
7933
+ }), rendererMapperProps);
7648
7934
  };
7649
7935
 
7650
7936
  // src/renderers/mappers/dateInputComponentToProps.ts
7651
- var dateInputComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-date")), rendererMapperProps), {
7652
- autoComplete: component.autoComplete,
7653
- minimumDate: component.minimumDate,
7654
- maximumDate: component.maximumDate,
7655
- suggestions: component.suggestions,
7656
- onChange: component.onChange.bind(component)
7937
+ var dateInputComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-date")), rendererMapperProps), pick(component, "autoComplete", "minimumDate", "maximumDate", "suggestions")), {
7938
+ onChange: component.setValue
7657
7939
  });
7658
7940
 
7659
7941
  // src/renderers/mappers/decisionComponentToProps.ts
7660
7942
  var decisionComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "control", "margin", "title", "tags")), rendererMapperProps), {
7661
7943
  options: component.options.map((_a) => {
7662
- var _b = _a, { disabled } = _b, rest = __objRest(_b, ["disabled"]);
7663
- return __spreadProps(__spreadValues({}, rest), {
7664
- disabled: disabled || rendererMapperProps.stepLoadingState !== "idle"
7944
+ var _b = _a, { disabled } = _b, option = __objRest(_b, ["disabled"]);
7945
+ return __spreadProps(__spreadValues({}, option), {
7946
+ disabled: disabled || rendererMapperProps.stepLoadingState !== "idle",
7947
+ getAnchorProps: option.hrefWithTracking
7665
7948
  });
7666
7949
  })
7667
7950
  });
@@ -7671,14 +7954,11 @@ var dividerComponentToProps = (component, rendererMapperProps) => __spreadValues
7671
7954
 
7672
7955
  // src/renderers/mappers/externalComponentToProps.ts
7673
7956
  var externalComponentToProps = (component, rendererMapperProps) => {
7674
- return __spreadValues({
7675
- type: "external-confirmation",
7676
- uid: component.uid,
7677
- url: component.url,
7678
- visible: component.status === "failure",
7679
- open: component.open.bind(component),
7680
- onCancel: component.onCancel.bind(component)
7681
- }, rendererMapperProps);
7957
+ return __spreadValues(__spreadProps(__spreadValues({
7958
+ type: "external-confirmation"
7959
+ }, pick(component, "uid", "url", "open", "onCancel")), {
7960
+ visible: component.status === "failure"
7961
+ }), rendererMapperProps);
7682
7962
  };
7683
7963
 
7684
7964
  // src/renderers/mappers/formattedValueComponentToProps.ts
@@ -7699,25 +7979,18 @@ var formattedValueComponentToProps = (component, rendererMapperProps) => {
7699
7979
  // for now, we don't want to pass `value` down to the renderer to avoid the "WhateverComponent".
7700
7980
  // 'value',
7701
7981
  )), {
7702
- validationState: getValidationState(component.errors, void 0),
7703
- onChange: component.onChange.bind(component)
7982
+ onChange: component.setValue,
7983
+ validationState: getValidationState(component.errors, void 0)
7704
7984
  }), rendererMapperProps);
7705
7985
  };
7706
7986
 
7707
7987
  // src/renderers/mappers/formComponentToProps.ts
7708
7988
  var formComponentToProps = (component, rendererMapperProps) => {
7709
7989
  const childrenProps = component.getChildren().map((c) => componentToRendererProps(c, rendererMapperProps));
7710
- const { uid, analyticsId, control, margin, tags } = component;
7711
- return __spreadValues({
7712
- uid,
7713
- analyticsId,
7714
- type: "form",
7990
+ return __spreadValues(__spreadProps(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "control", "margin", "tags")), {
7715
7991
  children: childrenProps.map(rendererMapperProps.render),
7716
- childrenProps,
7717
- control,
7718
- margin,
7719
- tags
7720
- }, rendererMapperProps);
7992
+ childrenProps
7993
+ }), rendererMapperProps);
7721
7994
  };
7722
7995
 
7723
7996
  // src/renderers/mappers/headingComponentToProps.ts
@@ -7750,26 +8023,18 @@ var imageComponentToProps = (component, rendererMapperProps) => __spreadProps(__
7750
8023
  var instructionsComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "control", "items", "margin", "title", "tags")), rendererMapperProps);
7751
8024
 
7752
8025
  // src/renderers/mappers/integerInputComponentToProps.ts
7753
- var integerInputComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-integer")), rendererMapperProps), {
7754
- autoComplete: component.autoComplete,
7755
- maximum: component.maximum,
7756
- minimum: component.minimum,
7757
- onChange: component.onChange.bind(component)
8026
+ var integerInputComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-integer")), rendererMapperProps), pick(component, "autoComplete", "maximum", "minimum")), {
8027
+ onChange: component.setValue
7758
8028
  });
7759
8029
 
7760
8030
  // src/renderers/mappers/listComponentToProps.ts
7761
- var listComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadValues({}, pick(
7762
- component,
7763
- "uid",
7764
- "analyticsId",
7765
- "type",
7766
- "callToAction",
7767
- "control",
7768
- "items",
7769
- "margin",
7770
- "title",
7771
- "tags"
7772
- )), rendererMapperProps);
8031
+ var listComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadProps(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "control", "margin", "title", "tags")), {
8032
+ callToAction: mapCallToActionOptional(component.callToAction),
8033
+ items: component.items.map((item) => __spreadProps(__spreadValues({}, item), {
8034
+ callToAction: mapCallToActionOptional(item.callToAction),
8035
+ additionalInfo: mapAdditionalInfo2(item.additionalInfo)
8036
+ }))
8037
+ }), rendererMapperProps);
7773
8038
 
7774
8039
  // src/renderers/mappers/loadingIndicatorComponentToProps.ts
7775
8040
  var loadingIndicatorComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "control", "margin", "size", "tags")), rendererMapperProps);
@@ -7793,39 +8058,25 @@ var mediaComponentToProps = (component, rendererMapperProps) => __spreadValues(_
7793
8058
 
7794
8059
  // src/renderers/mappers/modalComponentToProps.ts
7795
8060
  var modalComponentToProps = (component, rendererMapperProps) => {
7796
- const { uid, analyticsId, open, tags, title, close } = component;
7797
8061
  const childrenProps = component.getChildren().map((c) => componentToRendererProps(c, rendererMapperProps));
7798
- return __spreadValues({
7799
- uid,
7800
- analyticsId,
7801
- type: "modal",
7802
- open,
7803
- tags,
7804
- title,
8062
+ return __spreadValues(__spreadProps(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "open", "tags", "title")), {
7805
8063
  children: childrenProps.map(rendererMapperProps.render),
7806
8064
  childrenProps,
7807
- onClose: close.bind(component)
7808
- }, rendererMapperProps);
8065
+ onClose: component.close
8066
+ }), rendererMapperProps);
7809
8067
  };
7810
8068
 
7811
8069
  // src/renderers/mappers/modalLayoutComponentToProps.ts
7812
8070
  var modalLayoutComponentToProps = (component, rendererMapperProps) => {
7813
- const { uid, analyticsId, content, control, margin, tags, trigger } = component;
8071
+ const { content } = component;
7814
8072
  const childrenProps = component.getChildren().map((c) => componentToRendererProps(c, rendererMapperProps));
7815
- return __spreadValues({
7816
- uid,
7817
- analyticsId,
7818
- type: "modal-layout",
8073
+ return __spreadValues(__spreadProps(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "control", "margin", "tags", "trigger")), {
7819
8074
  content: {
7820
8075
  children: childrenProps.map(rendererMapperProps.render),
7821
8076
  childrenProps,
7822
8077
  title: content.title
7823
- },
7824
- control,
7825
- margin,
7826
- tags,
7827
- trigger
7828
- }, rendererMapperProps);
8078
+ }
8079
+ }), rendererMapperProps);
7829
8080
  };
7830
8081
 
7831
8082
  // src/renderers/mappers/moneyInputComponentToProps.ts
@@ -7852,8 +8103,8 @@ var moneyInputComponentToProps = (component, rendererMapperProps) => {
7852
8103
  return __spreadValues(__spreadProps(__spreadValues({}, inputComponentToProps(component, "money-input")), {
7853
8104
  amountValue: amountComponent.getLocalValue(),
7854
8105
  selectedCurrencyIndex: currencyComponent.selectedIndex,
7855
- onAmountChange: amountComponent.onChange.bind(amountComponent),
7856
- onCurrencyChange: currencyComponent.onSelect.bind(currencyComponent),
8106
+ onAmountChange: amountComponent.setValue,
8107
+ onCurrencyChange: currencyComponent.selectIndex,
7857
8108
  placeholder: amountComponent.placeholder,
7858
8109
  currencies,
7859
8110
  validationState
@@ -7885,47 +8136,42 @@ var selectInputOptionsToProps = (options, children, rendererMapperProps) => {
7885
8136
 
7886
8137
  // src/renderers/mappers/multiSelectComponentToProps.ts
7887
8138
  var multiSelectInputComponentToProps = (component, rendererMapperProps) => {
7888
- const { autoComplete, maxItems, minItems, selectedIndices, onSelect } = component;
7889
8139
  const _a = inputComponentToProps(component, "input-multi-select"), { required, value } = _a, props = __objRest(_a, ["required", "value"]);
7890
8140
  const options = selectInputOptionsToProps(
7891
8141
  component.options,
7892
8142
  component.getChildren(),
7893
8143
  rendererMapperProps
7894
8144
  );
7895
- return __spreadProps(__spreadValues(__spreadValues({}, props), rendererMapperProps), {
7896
- autoComplete,
7897
- maxItems,
7898
- minItems,
7899
- options,
7900
- selectedIndices,
7901
- onSelect: onSelect.bind(component)
8145
+ return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, props), rendererMapperProps), pick(component, "autoComplete", "maxItems", "minItems", "selectedIndices")), {
8146
+ onSelect: component.selectIndices,
8147
+ options
7902
8148
  });
7903
8149
  };
7904
8150
 
7905
8151
  // src/renderers/mappers/multiUploadInputComponentToProps.ts
7906
8152
  var multiUploadInputComponentToProps = (component, rendererMapperProps) => {
7907
- const { accepts, cameraConfig, files, maxSize, minItems, maxItems, source, uploadLabel } = component;
7908
- return __spreadProps(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-upload-multi")), rendererMapperProps), {
7909
- accepts,
7910
- cameraConfig,
7911
- maxSize,
7912
- minItems,
7913
- maxItems,
7914
- source,
7915
- uploadLabel,
8153
+ const { files } = component;
8154
+ return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-upload-multi")), rendererMapperProps), pick(
8155
+ component,
8156
+ "accepts",
8157
+ "cameraConfig",
8158
+ "maxSize",
8159
+ "minItems",
8160
+ "maxItems",
8161
+ "source",
8162
+ "uploadLabel"
8163
+ )), {
7916
8164
  value: files.map((file) => __spreadProps(__spreadValues({}, file), {
7917
8165
  validationState: mapErrorsToValidationState(file.errors)
7918
8166
  })),
7919
- onInsertFile: component.onInsertFile.bind(component),
7920
- onRemoveFile: component.onRemoveFile.bind(component)
8167
+ onInsertFile: component.insertFile,
8168
+ onRemoveFile: component.removeFile
7921
8169
  });
7922
8170
  };
7923
8171
 
7924
8172
  // src/renderers/mappers/numberInputComponentToProps.ts
7925
- var numberInputComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-number")), rendererMapperProps), {
7926
- maximum: component.maximum,
7927
- minimum: component.minimum,
7928
- onChange: component.onChange.bind(component)
8173
+ var numberInputComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-number")), rendererMapperProps), pick(component, "maximum", "minimum")), {
8174
+ onChange: component.setValue
7929
8175
  });
7930
8176
 
7931
8177
  // src/renderers/mappers/objectComponentToProps.ts
@@ -7965,13 +8211,10 @@ var paragraphComponentToProps = (component, rendererMapperProps) => __spreadValu
7965
8211
 
7966
8212
  // src/renderers/mappers/persistAsyncComponentToProps.ts
7967
8213
  var persistAsyncComponentToProps = (component, rendererMapperProps) => {
7968
- const props = componentToRendererProps(component.component, rendererMapperProps);
7969
- if ("validationState" in props && component.errors.length > 0) {
7970
- return __spreadProps(__spreadValues({}, props), {
7971
- validationState: { status: "invalid", message: component.errors[0] }
7972
- });
7973
- }
7974
- return props;
8214
+ const { errors, status } = component;
8215
+ const validationState = errors.length > 0 ? { status: "invalid", message: errors[0] } : void 0;
8216
+ const fieldLoadingState = status === "persisting" ? "persisting" : void 0;
8217
+ return __spreadValues(__spreadValues(__spreadValues({}, componentToRendererProps(component.component, rendererMapperProps)), validationState ? { validationState } : {}), fieldLoadingState ? { fieldLoadingState } : {});
7975
8218
  };
7976
8219
 
7977
8220
  // src/renderers/mappers/progressComponentToProps.ts
@@ -7993,27 +8236,7 @@ var progressComponentToProps = (component, rendererMapperProps) => __spreadValue
7993
8236
 
7994
8237
  // src/renderers/mappers/repeatableComponentToProps.ts
7995
8238
  var repeatableComponentToProps = (component, rendererMapperProps) => {
7996
- const {
7997
- uid,
7998
- analyticsId,
7999
- addItemTitle,
8000
- control,
8001
- components,
8002
- description,
8003
- editableComponent,
8004
- editItemTitle,
8005
- errors,
8006
- maxItems,
8007
- media,
8008
- minItems,
8009
- summaryDefaults,
8010
- title = "",
8011
- tags,
8012
- onEdit,
8013
- onAdd,
8014
- onSave,
8015
- onRemove
8016
- } = component;
8239
+ const { components, editableComponent, errors, summaryDefaults, title = "" } = component;
8017
8240
  const childrenProps = component.getChildren().map((c) => componentToRendererProps(c, rendererMapperProps));
8018
8241
  const editableItemProps = editableComponent ? componentToRendererProps(editableComponent, rendererMapperProps) : null;
8019
8242
  const getSummary = (componentSummary) => {
@@ -8027,75 +8250,63 @@ var repeatableComponentToProps = (component, rendererMapperProps) => {
8027
8250
  const itemProps = components.map((childComponent) => __spreadProps(__spreadValues({}, getSummary(childComponent.getSummary())), {
8028
8251
  id: `${childComponent.uid}-summary`
8029
8252
  }));
8030
- return __spreadValues({
8031
- uid,
8032
- analyticsId,
8253
+ return __spreadValues(__spreadProps(__spreadValues({
8033
8254
  type: "repeatable",
8255
+ title
8256
+ }, pick(
8257
+ component,
8258
+ "control",
8259
+ "description",
8260
+ "media",
8261
+ "tags",
8262
+ "uid",
8263
+ "analyticsId",
8264
+ "editItemTitle",
8265
+ "addItemTitle",
8266
+ "maxItems",
8267
+ "minItems"
8268
+ )), {
8034
8269
  children: childrenProps.map(rendererMapperProps.render),
8035
8270
  childrenProps,
8036
- addItemTitle,
8037
- control,
8038
- description,
8039
8271
  editableItem: rendererMapperProps.render(editableItemProps),
8040
8272
  editableItemProps,
8041
- editItemTitle,
8042
8273
  items: itemProps,
8043
- maxItems,
8044
- media,
8045
- minItems,
8046
- title,
8047
- tags,
8048
8274
  validationState: mapErrorsToValidationState(errors),
8049
- onAdd: onAdd.bind(component),
8050
- onEdit: onEdit.bind(component),
8051
- onSave: onSave.bind(component),
8052
- onRemove: onRemove.bind(component)
8053
- }, rendererMapperProps);
8275
+ onAdd: component.addComponent,
8276
+ onEdit: component.editComponent,
8277
+ onRemove: component.removeComponent,
8278
+ onSave: component.saveComponent
8279
+ }), rendererMapperProps);
8054
8280
  };
8055
8281
 
8056
8282
  // src/renderers/mappers/reviewComponentToProps.ts
8057
- var reviewComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadValues({}, pick(
8058
- component,
8059
- "uid",
8060
- "analyticsId",
8061
- "type",
8062
- "callToAction",
8063
- "control",
8064
- "fields",
8065
- "margin",
8066
- "title",
8067
- "tags"
8068
- )), rendererMapperProps);
8283
+ var reviewComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadProps(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "control", "margin", "title", "tags")), {
8284
+ callToAction: mapCallToActionOptional(component.callToAction),
8285
+ fields: component.fields.map((field) => __spreadProps(__spreadValues({}, field), {
8286
+ callToAction: mapCallToActionOptional(field.callToAction),
8287
+ additionalInfo: mapAdditionalInfo2(field.additionalInfo)
8288
+ }))
8289
+ }), rendererMapperProps);
8069
8290
 
8070
8291
  // src/renderers/mappers/searchComponentToProps.ts
8071
8292
  var searchComponentToProps = (component, rendererMapperProps) => {
8072
- const { uid, control, emptyMessage, error, hint, isLoading, margin, query, title, tags } = component;
8073
- const onChange = component.onChange.bind(component);
8074
- const onSelect = component.onSelect.bind(component);
8293
+ const { uid, emptyMessage, error, query, setQuery, selectResult } = component;
8075
8294
  const state = getSearchState({
8076
8295
  emptyMessage,
8077
8296
  error,
8078
- isLoading,
8297
+ isLoading: component.isLoading,
8079
8298
  query,
8080
8299
  state: component.state,
8081
8300
  rendererMapperProps,
8082
- onChange,
8083
- onSelect
8301
+ setQuery,
8302
+ selectResult
8084
8303
  });
8085
- return __spreadValues({
8086
- uid,
8304
+ return __spreadValues(__spreadProps(__spreadValues({}, pick(component, "uid", "control", "hint", "isLoading", "margin", "query", "title", "tags")), {
8305
+ onChange: setQuery,
8087
8306
  type: "search",
8088
8307
  id: uid,
8089
- control,
8090
- hint,
8091
- isLoading,
8092
- margin,
8093
- query,
8094
- state,
8095
- title,
8096
- tags,
8097
- onChange
8098
- }, rendererMapperProps);
8308
+ state
8309
+ }), rendererMapperProps);
8099
8310
  };
8100
8311
  var getSearchState = ({
8101
8312
  emptyMessage,
@@ -8104,14 +8315,14 @@ var getSearchState = ({
8104
8315
  query,
8105
8316
  state,
8106
8317
  rendererMapperProps,
8107
- onChange,
8108
- onSelect
8318
+ setQuery,
8319
+ selectResult
8109
8320
  }) => {
8110
8321
  if (isLoading) {
8111
8322
  return { type: "pending" };
8112
8323
  }
8113
8324
  if (error) {
8114
- return { type: "error", onRetry: () => onChange(query) };
8325
+ return { type: "error", onRetry: () => setQuery(query) };
8115
8326
  }
8116
8327
  if (!state) {
8117
8328
  return { type: "noResults", message: emptyMessage };
@@ -8138,7 +8349,7 @@ var getSearchState = ({
8138
8349
  id: result.type === "action" ? (_a = result.value.id) != null ? _a : result.value.$id : void 0,
8139
8350
  image: mapSpecImage(result.image),
8140
8351
  media: getDomainLayerMedia(result),
8141
- onClick: () => onSelect(result)
8352
+ onClick: () => selectResult(result)
8142
8353
  });
8143
8354
  })
8144
8355
  };
@@ -8149,17 +8360,9 @@ var sectionComponentToProps = (component, rendererMapperProps) => {
8149
8360
  const childrenProps = component.components.map(
8150
8361
  (c) => componentToRendererProps(c, rendererMapperProps)
8151
8362
  );
8152
- return __spreadProps(__spreadValues(__spreadValues({}, pick(
8153
- component,
8154
- "uid",
8155
- "analyticsId",
8156
- "type",
8157
- "title",
8158
- "margin",
8159
- "control",
8160
- "callToAction",
8161
- "tags"
8162
- )), rendererMapperProps), {
8363
+ return __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "title", "margin", "control", "tags")), {
8364
+ callToAction: mapCallToActionOptional(component.callToAction)
8365
+ }), rendererMapperProps), {
8163
8366
  children: childrenProps.map(rendererMapperProps.render),
8164
8367
  childrenProps
8165
8368
  });
@@ -8168,7 +8371,7 @@ var sectionComponentToProps = (component, rendererMapperProps) => {
8168
8371
  // src/renderers/mappers/selectInputComponentToProps.ts
8169
8372
  var selectInputComponentToProps = (component, rendererMapperProps) => {
8170
8373
  var _b;
8171
- const { autoComplete, selectedIndex, onSelect } = component;
8374
+ const { autoComplete, selectedIndex, selectIndex } = component;
8172
8375
  const selectedChild = component.getSelectedChild();
8173
8376
  const childrenProps = selectedChild ? componentToRendererProps(selectedChild, rendererMapperProps) : null;
8174
8377
  const _a = inputComponentToProps(component, "input-select"), { value } = _a, props = __objRest(_a, ["value"]);
@@ -8180,7 +8383,7 @@ var selectInputComponentToProps = (component, rendererMapperProps) => {
8180
8383
  if (options.length === 1 && ((_b = options[0].childrenProps) == null ? void 0 : _b.type) === "form-section") {
8181
8384
  if (selectedIndex == null) {
8182
8385
  rendererMapperProps.trackEvent("OneOf Option Selected - Auto-select single-option", {});
8183
- onSelect.bind(component)(0);
8386
+ selectIndex(0);
8184
8387
  }
8185
8388
  return options[0].childrenProps;
8186
8389
  }
@@ -8188,14 +8391,18 @@ var selectInputComponentToProps = (component, rendererMapperProps) => {
8188
8391
  autoComplete,
8189
8392
  options,
8190
8393
  selectedIndex,
8191
- onSelect: onSelect.bind(component),
8394
+ onSelect: component.selectIndex,
8192
8395
  children: rendererMapperProps.render(childrenProps),
8193
8396
  childrenProps
8194
8397
  });
8195
8398
  };
8196
8399
 
8197
8400
  // src/renderers/mappers/statusListComponentToProps.ts
8198
- var statusListComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "control", "items", "margin", "title", "tags")), rendererMapperProps);
8401
+ var statusListComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadProps(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "control", "margin", "title", "tags")), {
8402
+ items: component.items.map((item) => __spreadProps(__spreadValues({}, item), {
8403
+ callToAction: mapCallToActionOptional(item.callToAction)
8404
+ }))
8405
+ }), rendererMapperProps);
8199
8406
 
8200
8407
  // src/renderers/mappers/tabsComponentToProps.ts
8201
8408
  var tabsComponentToProps = (component, rendererMapperProps) => {
@@ -8214,15 +8421,17 @@ var tabsComponentToProps = (component, rendererMapperProps) => {
8214
8421
  };
8215
8422
 
8216
8423
  // src/renderers/mappers/textInputComponentToProps.ts
8217
- var textInputComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-text")), rendererMapperProps), {
8218
- autoComplete: component.autoComplete,
8219
- autoCapitalize: component == null ? void 0 : component.autocapitalization,
8220
- displayFormat: component.displayFormat,
8221
- maxLength: component.maxLength,
8222
- minLength: component.minLength,
8223
- pattern: component.pattern,
8224
- suggestions: component.suggestions,
8225
- onChange: component.onChange.bind(component)
8424
+ var textInputComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-text")), rendererMapperProps), pick(
8425
+ component,
8426
+ "autoComplete",
8427
+ "displayFormat",
8428
+ "maxLength",
8429
+ "minLength",
8430
+ "pattern",
8431
+ "suggestions"
8432
+ )), {
8433
+ onChange: component.setValue,
8434
+ autoCapitalize: component == null ? void 0 : component.autocapitalization
8226
8435
  });
8227
8436
 
8228
8437
  // src/renderers/mappers/tupleComponentToProps.ts
@@ -8248,30 +8457,15 @@ var tupleComponentToProps = (component, rendererMapperProps) => {
8248
8457
 
8249
8458
  // src/renderers/mappers/uploadInputComponentToProps.ts
8250
8459
  var uploadInputComponentToProps = (component, rendererMapperProps) => {
8251
- const { accepts, cameraConfig, maxSize, source } = component;
8252
- return __spreadProps(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-upload")), rendererMapperProps), {
8253
- cameraConfig,
8254
- source,
8255
- accepts,
8256
- maxSize,
8257
- onUpload: component.onUpload.bind(component)
8460
+ return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-upload")), rendererMapperProps), pick(component, "accepts", "cameraConfig", "maxSize", "source")), {
8461
+ onUpload: component.setValue
8258
8462
  });
8259
8463
  };
8260
8464
 
8261
8465
  // src/renderers/mappers/upsellComponentToProps.ts
8262
- var upsellComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadProps(__spreadValues({}, pick(
8263
- component,
8264
- "uid",
8265
- "analyticsId",
8266
- "type",
8267
- "callToAction",
8268
- "control",
8269
- "margin",
8270
- "media",
8271
- "tags",
8272
- "text"
8273
- )), {
8274
- onDismiss: component.onDismiss ? component.onDismiss.bind(component) : void 0
8466
+ var upsellComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadProps(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "control", "margin", "media", "tags", "text")), {
8467
+ callToAction: mapCallToAction(component.callToAction),
8468
+ onDismiss: component.dismiss
8275
8469
  }), rendererMapperProps);
8276
8470
 
8277
8471
  // src/renderers/mappers/componentToRendererProps.ts
@@ -8428,7 +8622,7 @@ var stepComponentToProps = (component, rendererMapperProps) => {
8428
8622
  footer: footerProps.map(rendererMapperProps.render),
8429
8623
  footerProps,
8430
8624
  __onAction: (action) => {
8431
- void onBehavior({ type: "action", action });
8625
+ void onBehavior({ type: "action", action, track: false });
8432
8626
  }
8433
8627
  }, restMapperProps);
8434
8628
  };
@@ -8471,27 +8665,33 @@ var subflowComponentToRendererProps = (subflow, rendererMapperProps, nativeSubfl
8471
8665
  }
8472
8666
  };
8473
8667
  var dynamicSubflowComponentToRendererProps = (component, rendererMapperProps) => {
8474
- return __spreadValues(__spreadProps(__spreadValues({
8475
- uid: component.uid,
8668
+ return __spreadValues(__spreadValues({
8476
8669
  type: "subflow-dynamic"
8477
- }, pick(component, "requestCache", "presentation", "initialRequest")), {
8478
- onCancellation: component.onCancellation.bind(component),
8479
- onCompletion: component.onCompletion.bind(component),
8480
- onError: component.onError.bind(component),
8481
- onEvent: component.onEvent.bind(component)
8482
- }), rendererMapperProps);
8670
+ }, pick(
8671
+ component,
8672
+ "uid",
8673
+ "requestCache",
8674
+ "presentation",
8675
+ "initialRequest",
8676
+ "onCancellation",
8677
+ "onCompletion",
8678
+ "onError",
8679
+ "onEvent"
8680
+ )), rendererMapperProps);
8483
8681
  };
8484
8682
  var nativeSubflowComponentToRendererProps = (component, rendererMapperProps) => {
8485
- return __spreadValues({
8486
- uid: component.uid,
8487
- type: "subflow-native",
8488
- id: component.id,
8489
- payload: component.payload,
8490
- onCancellation: component.onCancellation.bind(component),
8491
- onCompletion: component.onCompletion.bind(component),
8492
- onError: component.onError.bind(component),
8493
- onEvent: component.onEvent.bind(component)
8494
- }, rendererMapperProps);
8683
+ return __spreadValues(__spreadValues({
8684
+ type: "subflow-native"
8685
+ }, pick(
8686
+ component,
8687
+ "uid",
8688
+ "id",
8689
+ "payload",
8690
+ "onCancellation",
8691
+ "onCompletion",
8692
+ "onError",
8693
+ "onEvent"
8694
+ )), rendererMapperProps);
8495
8695
  };
8496
8696
 
8497
8697
  // src/renderers/mappers/rootComponentToProps.ts
@@ -8593,7 +8793,7 @@ function useDynamicFlow(props) {
8593
8793
  const onEvent = useStableCallback(props.onEvent);
8594
8794
  const onLog = useStableCallback(props.onLog);
8595
8795
  const onValueChange = noop2;
8596
- const { formatMessage, locale } = (0, import_react_intl7.useIntl)();
8796
+ const { formatMessage, locale } = (0, import_react_intl8.useIntl)();
8597
8797
  const getErrorMessageFunctions = (0, import_react3.useMemo)(
8598
8798
  () => getSchemaErrorMessageFunction(formatMessage, locale),
8599
8799
  [formatMessage, locale]
@@ -8768,7 +8968,8 @@ var eventNames = [
8768
8968
  "Native Subflow Triggered",
8769
8969
  "Native Subflow Succeeded",
8770
8970
  "Native Subflow Failed",
8771
- "Native Subflow Cancelled"
8971
+ "Native Subflow Cancelled",
8972
+ "Behavior Triggered"
8772
8973
  ];
8773
8974
 
8774
8975
  // src/renderers/subflow/getDynamicSubflowRenderer.tsx