udp-stencil-component-library 26.9.0-beta.2 → 26.9.0-beta.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (968) hide show
  1. package/dist/cjs/{SearchBuilder-CyR7DyPc.js → SearchBuilder-Ca9_ur9o.js} +1 -1
  2. package/dist/cjs/add-map-feature-popup_4.cjs.entry.js +8 -8
  3. package/dist/cjs/address-search_6.cjs.entry.js +19 -19
  4. package/dist/cjs/advanced-search_12.cjs.entry.js +20 -20
  5. package/dist/cjs/{ag-grid-base_65.cjs.entry.js → ag-grid-base_66.cjs.entry.js} +458 -183
  6. package/dist/cjs/ambient-template-grid.cjs.entry.js +20 -20
  7. package/dist/cjs/api-method-instance-grid.cjs.entry.js +11 -10
  8. package/dist/cjs/{apiMethodInstance-D65NIw8S.js → apiMethodInstance-DTeNcmNq.js} +3 -32
  9. package/dist/cjs/{apiUtils-0pkNuvqf.js → apiUtils-tzjwn5aw.js} +29 -28
  10. package/dist/cjs/app-bar.cjs.entry.js +1 -1
  11. package/dist/cjs/{catalog-store-B_YMkXRh.js → catalog-store-CzG8hINB.js} +1 -1
  12. package/dist/cjs/chart-container_3.cjs.entry.js +2 -2
  13. package/dist/cjs/check-box.cjs.entry.js +2 -2
  14. package/dist/cjs/chip-section.cjs.entry.js +2 -2
  15. package/dist/cjs/{codecs-ClSB_OaD.js → codecs-Dyka7kpz.js} +407 -7
  16. package/dist/cjs/{configService-N6ke1_s4.js → configService-DbfLqId2.js} +2 -6
  17. package/dist/cjs/{configureUdpColumnMods-BT7UbQPh.js → configureUdpColumnMods-Cqxn_OaF.js} +23 -7
  18. package/dist/cjs/convertBackendTypeToAgGridType-CZEQIj7A.js +33 -0
  19. package/dist/cjs/{createAzureMapsProviders-b1fKbjhG.js → createAzureMapsProviders-CURScysk.js} +14 -0
  20. package/dist/cjs/custom-button.cjs.entry.js +1 -1
  21. package/dist/cjs/date-time-renderer_9.cjs.entry.js +21 -21
  22. package/dist/cjs/domain-table-snapshot-DXs9ceFE.js +339 -0
  23. package/dist/cjs/extraFields-CNvT2Qyf.js +109 -0
  24. package/dist/cjs/extraFieldsHelper-Clk9u_FW.js +211 -0
  25. package/dist/cjs/feature-details-card_2.cjs.entry.js +5 -5
  26. package/dist/cjs/file-upload_2.cjs.entry.js +7 -7
  27. package/dist/cjs/filter-conditions_7.cjs.entry.js +7 -7
  28. package/dist/cjs/{fluent-icons-DLY_DCOh.js → fluent-icons-Cs6J6uVm.js} +20 -0
  29. package/dist/cjs/form-metadata-display_2.cjs.entry.js +3 -3
  30. package/dist/cjs/getCurrentApiCatalogId-D7xHCEzs.js +7 -0
  31. package/dist/cjs/icon-grid.cjs.entry.js +2 -2
  32. package/dist/cjs/image-upload_8.cjs.entry.js +7 -7
  33. package/dist/cjs/index-CZB9dMeB.js +12 -8
  34. package/dist/cjs/index.cjs.js +26 -23
  35. package/dist/cjs/{load-icons-BAAH3v1o.js → load-icons-JeRXx4O7.js} +1 -1
  36. package/dist/cjs/loader.cjs.js +1 -1
  37. package/dist/cjs/logical-search-indicator.cjs.entry.js +1 -1
  38. package/dist/cjs/lookupHelper-DACjrAcP.js +694 -0
  39. package/dist/cjs/map-component_2.cjs.entry.js +2 -2
  40. package/dist/cjs/primary-action-header_2.cjs.entry.js +4 -4
  41. package/dist/cjs/question-configs-renderer_4.cjs.entry.js +15 -15
  42. package/dist/cjs/resource-timeline-calendar.cjs.entry.js +1 -1
  43. package/dist/cjs/resource-timeline-primary-bar.cjs.entry.js +3 -3
  44. package/dist/cjs/rich-text-schema-Dhani4hA.js +58 -0
  45. package/dist/cjs/search-method-grid.cjs.entry.js +121 -264
  46. package/dist/cjs/server-side-grid.cjs.entry.js +85 -3
  47. package/dist/cjs/side-sheet-container.cjs.entry.js +1 -1
  48. package/dist/cjs/simple-card.cjs.entry.js +1 -1
  49. package/dist/cjs/status-chip_2.cjs.entry.js +2 -2
  50. package/dist/cjs/{status-renderer-9CQ-hhq8.js → status-renderer-be4boc5r.js} +83 -55
  51. package/dist/cjs/stencil-chip.cjs.entry.js +2 -2
  52. package/dist/cjs/stencil-library.cjs.js +1 -1
  53. package/dist/cjs/stencil-toggle.cjs.entry.js +4 -4
  54. package/dist/cjs/text-field_2.cjs.entry.js +7 -7
  55. package/dist/cjs/udp-adornment.cjs.entry.js +1 -1
  56. package/dist/cjs/udp-advanced-search-builder.cjs.entry.js +102 -5
  57. package/dist/cjs/udp-advanced-search-field-picker_3.cjs.entry.js +3 -3
  58. package/dist/cjs/udp-ag-area-chart.cjs.entry.js +2 -2
  59. package/dist/cjs/udp-ag-bar-chart_4.cjs.entry.js +5 -5
  60. package/dist/cjs/udp-ag-bubble-chart.cjs.entry.js +2 -2
  61. package/dist/cjs/udp-ag-combo-chart.cjs.entry.js +2 -2
  62. package/dist/cjs/udp-ag-donut-chart.cjs.entry.js +2 -2
  63. package/dist/cjs/udp-ag-line-chart.cjs.entry.js +2 -2
  64. package/dist/cjs/udp-ag-pie-chart.cjs.entry.js +2 -2
  65. package/dist/cjs/udp-ag-scatter-chart.cjs.entry.js +2 -2
  66. package/dist/cjs/udp-attachment-item_2.cjs.entry.js +1 -1
  67. package/dist/cjs/udp-attachment-list.cjs.entry.js +1 -1
  68. package/dist/cjs/udp-bar-chart.cjs.entry.js +1 -1
  69. package/dist/cjs/udp-calendar-base.cjs.entry.js +1 -1
  70. package/dist/cjs/udp-calendar-day.cjs.entry.js +1 -1
  71. package/dist/cjs/udp-calendar-month.cjs.entry.js +1 -1
  72. package/dist/cjs/udp-calendar-week.cjs.entry.js +1 -1
  73. package/dist/cjs/udp-calendar-year.cjs.entry.js +1 -1
  74. package/dist/cjs/udp-card-action-area.cjs.entry.js +1 -1
  75. package/dist/cjs/udp-card_6.cjs.entry.js +7 -7
  76. package/dist/cjs/udp-charts-example.cjs.entry.js +1 -1
  77. package/dist/cjs/udp-container-query-grid-item.cjs.entry.js +1 -1
  78. package/dist/cjs/udp-container-query-grid.cjs.entry.js +1 -1
  79. package/dist/cjs/udp-container-query.cjs.entry.js +2 -2
  80. package/dist/cjs/udp-container.cjs.entry.js +2 -2
  81. package/dist/cjs/{udp-detail-list_9.cjs.entry.js → udp-detail-list_10.cjs.entry.js} +606 -73
  82. package/dist/cjs/{udp-drive-utils-DM1l6XMm.js → udp-drive-utils-BuTLI35n.js} +1 -1
  83. package/dist/cjs/udp-dynamic-container-with-menu.cjs.entry.js +1 -1
  84. package/dist/cjs/udp-dynamic-form.cjs.entry.js +1 -1
  85. package/dist/cjs/udp-fluent-icon-picker.cjs.entry.js +2 -2
  86. package/dist/cjs/udp-fluent-inline-edit_5.cjs.entry.js +494 -45
  87. package/dist/cjs/udp-fluent-link.cjs.entry.js +1 -1
  88. package/dist/cjs/udp-fluent-list-item_2.cjs.entry.js +3 -3
  89. package/dist/cjs/{udp-form-api-utils-zMPk_IT1.js → udp-form-api-utils-ZY88igvH.js} +1 -1
  90. package/dist/cjs/udp-forms-builder-style-override.cjs.entry.js +1 -1
  91. package/dist/cjs/udp-forms-builder.cjs.entry.js +1 -1
  92. package/dist/cjs/udp-forms-follow-up-list-card.cjs.entry.js +2 -2
  93. package/dist/cjs/udp-forms-list-card.cjs.entry.js +4 -4
  94. package/dist/cjs/udp-forms-list.cjs.entry.js +3 -3
  95. package/dist/cjs/udp-forms-renderer.cjs.entry.js +4 -4
  96. package/dist/cjs/udp-import-sheet.cjs.entry.js +244 -0
  97. package/dist/cjs/udp-kpi-card.cjs.entry.js +1 -1
  98. package/dist/cjs/udp-kpi-cards.cjs.entry.js +2 -2
  99. package/dist/cjs/udp-map.cjs.entry.js +3 -3
  100. package/dist/cjs/udp-menu.cjs.entry.js +1 -1
  101. package/dist/cjs/udp-page.cjs.entry.js +1 -1
  102. package/dist/cjs/udp-question-form-builder.cjs.entry.js +35 -258
  103. package/dist/cjs/udp-rich-text-field.cjs.entry.js +28 -53
  104. package/dist/cjs/udp-rich-text.cjs.entry.js +61 -0
  105. package/dist/cjs/udp-sankey-chart.cjs.entry.js +1 -1
  106. package/dist/cjs/udp-sidebar-layout.cjs.entry.js +3 -3
  107. package/dist/cjs/udp-skeleton-loading.cjs.entry.js +1 -1
  108. package/dist/cjs/udp-split-screen.cjs.entry.js +1 -1
  109. package/dist/cjs/udp-stepper-actions.cjs.entry.js +1 -1
  110. package/dist/cjs/udp-stepper-content.cjs.entry.js +2 -2
  111. package/dist/cjs/udp-stepper-demo.cjs.entry.js +1 -1
  112. package/dist/cjs/udp-stepper-nav.cjs.entry.js +1 -1
  113. package/dist/cjs/udp-tab.cjs.entry.js +1 -1
  114. package/dist/cjs/udp-timeline-connector.cjs.entry.js +1 -1
  115. package/dist/cjs/udp-timeline-dot.cjs.entry.js +1 -1
  116. package/dist/cjs/udp-timeline-item.cjs.entry.js +2 -2
  117. package/dist/cjs/udp-timeline-separator.cjs.entry.js +1 -1
  118. package/dist/cjs/udp-timeline.cjs.entry.js +1 -1
  119. package/dist/cjs/udp-vertical-timeline-connector.cjs.entry.js +1 -1
  120. package/dist/cjs/udp-vertical-timeline-dot.cjs.entry.js +1 -1
  121. package/dist/cjs/udp-vertical-timeline-item.cjs.entry.js +2 -2
  122. package/dist/cjs/udp-vertical-timeline-separator.cjs.entry.js +1 -1
  123. package/dist/cjs/udp-vertical-timeline.cjs.entry.js +1 -1
  124. package/dist/cjs/udp-xy-chart.cjs.entry.js +1 -1
  125. package/dist/cjs/udp-xy-multi-series-chart.cjs.entry.js +1 -1
  126. package/dist/cjs/valueFormatters-CUoOypK3.js +17 -0
  127. package/dist/collection/__mocks__/jest-setup.js +3 -0
  128. package/dist/collection/collection-manifest.json +3 -0
  129. package/dist/collection/components/advanced-search/advanced-search-grouped.js +2 -2
  130. package/dist/collection/components/advanced-search/advanced-search.js +2 -2
  131. package/dist/collection/components/advanced-search/filter-conditions/filter-conditions.js +1 -1
  132. package/dist/collection/components/advanced-search/ui/logical-search-indicator/logical-search-indicator.js +1 -1
  133. package/dist/collection/components/advanced-search-builder/field-picker/field-picker.js +1 -1
  134. package/dist/collection/components/advanced-search-builder/field-picker-tree/field-picker-tree.js +2 -2
  135. package/dist/collection/components/advanced-search-builder/udp-advanced-search-builder.js +125 -2
  136. package/dist/collection/components/attachment-list/udp-attachment-list.js +1 -1
  137. package/dist/collection/components/buttons/icon-button/function-button/udp-function-button.js +1 -1
  138. package/dist/collection/components/buttons/icon-button/primary-button/custom-button.js +1 -1
  139. package/dist/collection/components/buttons/icon-button/radio-button/udp-radio-button.js +1 -1
  140. package/dist/collection/components/buttons/udp-button/udp-button.js +1 -1
  141. package/dist/collection/components/calendar/udp-calendar-base.js +1 -1
  142. package/dist/collection/components/calendar/udp-calendar-day.js +1 -1
  143. package/dist/collection/components/calendar/udp-calendar-month.js +1 -1
  144. package/dist/collection/components/calendar/udp-calendar-week.js +1 -1
  145. package/dist/collection/components/calendar/udp-calendar-year.js +1 -1
  146. package/dist/collection/components/charts/chart-kpi/chart-kpi.js +1 -1
  147. package/dist/collection/components/charts/udp-ag-area-chart/udp-ag-area-chart.js +2 -2
  148. package/dist/collection/components/charts/udp-ag-bar-chart/udp-ag-bar-chart.js +2 -2
  149. package/dist/collection/components/charts/udp-ag-bubble-chart/udp-ag-bubble-chart.js +2 -2
  150. package/dist/collection/components/charts/udp-ag-combo-chart/udp-ag-combo-chart.js +2 -2
  151. package/dist/collection/components/charts/udp-ag-donut-chart/udp-ag-donut-chart.js +2 -2
  152. package/dist/collection/components/charts/udp-ag-line-chart/udp-ag-line-chart.js +2 -2
  153. package/dist/collection/components/charts/udp-ag-pie-chart/udp-ag-pie-chart.js +2 -2
  154. package/dist/collection/components/charts/udp-ag-scatter-chart/udp-ag-scatter-chart.js +2 -2
  155. package/dist/collection/components/charts/udp-bar-chart/udp-bar-chart.js +1 -1
  156. package/dist/collection/components/charts/udp-charts-example.js +1 -1
  157. package/dist/collection/components/charts/udp-distribution-chart/udp-distribution-chart.js +1 -1
  158. package/dist/collection/components/charts/udp-donut-chart/udp-donut-chart.js +1 -1
  159. package/dist/collection/components/charts/udp-line-chart/udp-line-chart.js +1 -1
  160. package/dist/collection/components/charts/udp-sankey-chart/udp-sankey-chart.js +1 -1
  161. package/dist/collection/components/charts/udp-xy-chart/udp-xy-chart.js +1 -1
  162. package/dist/collection/components/charts/udp-xy-multi-series-chart/udp-xy-multi-series-chart.js +1 -1
  163. package/dist/collection/components/data-display/adornment/udp-adornment/udp-adornment.js +1 -1
  164. package/dist/collection/components/data-display/badge/udp-badge.js +1 -1
  165. package/dist/collection/components/data-display/cards/udp-ambient-card/udp-ambient-card.js +1 -1
  166. package/dist/collection/components/data-display/cards/udp-card/udp-card-action-area/udp-card-action-area.js +1 -1
  167. package/dist/collection/components/data-display/cards/udp-card/udp-card-actions/udp-card-actions.js +1 -1
  168. package/dist/collection/components/data-display/cards/udp-card/udp-card-content/udp-card-content.js +1 -1
  169. package/dist/collection/components/data-display/cards/udp-card/udp-card-header/udp-card-header.js +1 -1
  170. package/dist/collection/components/data-display/cards/udp-card/udp-card-media/udp-card-media.js +1 -1
  171. package/dist/collection/components/data-display/cards/udp-card/udp-card.js +3 -3
  172. package/dist/collection/components/data-display/chips/stencil-chip/status-chip/status-chip.js +1 -1
  173. package/dist/collection/components/data-display/chips/stencil-chip/stencil-chip.js +2 -2
  174. package/dist/collection/components/data-display/chips/udp-chip.js +1 -1
  175. package/dist/collection/components/data-display/detail-list-item/udp-detail-list-item.js +1 -1
  176. package/dist/collection/components/data-display/divider/udp-divider.js +1 -1
  177. package/dist/collection/components/data-display/empty-state-display/udp-empty-state-display.js +1 -1
  178. package/dist/collection/components/data-display/headers/udp-column-header.js +1 -1
  179. package/dist/collection/components/data-display/headers/udp-page-header/udp-page-header.js +1 -1
  180. package/dist/collection/components/data-display/hint-panel/hint-panel.js +1 -1
  181. package/dist/collection/components/data-display/kpi/kpi-list.js +1 -1
  182. package/dist/collection/components/data-display/kpi/udp-kpi-card.js +1 -1
  183. package/dist/collection/components/data-display/kpi/udp-kpi-cards.js +2 -2
  184. package/dist/collection/components/data-display/list-item/list-item.js +2 -2
  185. package/dist/collection/components/data-display/pop-over/udp-pop-over.js +1 -1
  186. package/dist/collection/components/data-display/pop-over-grid-action-header/udp-pop-over-grid-action-header.js +1 -1
  187. package/dist/collection/components/data-display/primary-action-header/primary-action-header.js +2 -2
  188. package/dist/collection/components/data-display/simple-card/simple-card.js +1 -1
  189. package/dist/collection/components/data-display/tool-tip/udp-ambient-tool-tip.js +2 -2
  190. package/dist/collection/components/data-display/tree/tree-list-item/search-item/search-list-item.js +1 -1
  191. package/dist/collection/components/data-display/udp-avatar/udp-avatar.js +1 -1
  192. package/dist/collection/components/dialogs/udp-dialog.js +1 -1
  193. package/dist/collection/components/drawers/udp-side-sheet/udp-side-sheet.js +9 -9
  194. package/dist/collection/components/export/udp-export-sheet/udp-export-sheet.css +0 -1
  195. package/dist/collection/components/export/udp-export-sheet/udp-export-sheet.js +10 -5
  196. package/dist/collection/components/feedback/udp-notification/alerts/upd-alert-banner.js +1 -1
  197. package/dist/collection/components/feedback/udp-notification/udp-notification.js +2 -2
  198. package/dist/collection/components/fluent-ui/autocomplete/udp-autocomplete.js +8 -8
  199. package/dist/collection/components/fluent-ui/avatar/udp-fluent-avatar.js +1 -1
  200. package/dist/collection/components/fluent-ui/badge/udp-fluent-badge.js +1 -1
  201. package/dist/collection/components/fluent-ui/button/udp-fluent-button.css +10 -0
  202. package/dist/collection/components/fluent-ui/button/udp-fluent-button.js +26 -1
  203. package/dist/collection/components/fluent-ui/card/udp-fluent-card.js +3 -3
  204. package/dist/collection/components/fluent-ui/checkbox/udp-fluent-checkbox.js +1 -1
  205. package/dist/collection/components/fluent-ui/compound-button/udp-compound-button.js +1 -1
  206. package/dist/collection/components/fluent-ui/counter-badge/udp-fluent-counter-badge.js +1 -1
  207. package/dist/collection/components/fluent-ui/date-time-input/udp-date-time-input.js +1 -1
  208. package/dist/collection/components/fluent-ui/dialog/udp-fluent-dialog.js +1 -1
  209. package/dist/collection/components/fluent-ui/divider/udp-fluent-divider.js +1 -1
  210. package/dist/collection/components/fluent-ui/domain-table-input/domain-table-snapshot.js +78 -0
  211. package/dist/collection/components/fluent-ui/domain-table-input/udp-fluent-domain-table-input.css +67 -0
  212. package/dist/collection/components/fluent-ui/domain-table-input/udp-fluent-domain-table-input.js +871 -0
  213. package/dist/collection/components/fluent-ui/domain-table-input/udp-fluent-domain-table-input.types.js +1 -0
  214. package/dist/collection/components/fluent-ui/drawer/udp-fluent-drawer.css +4 -0
  215. package/dist/collection/components/fluent-ui/drawer/udp-fluent-drawer.js +26 -1
  216. package/dist/collection/components/fluent-ui/dropdown/udp-fluent-dropdown.js +28 -10
  217. package/dist/collection/components/fluent-ui/empty-state/udp-empty-state.js +1 -1
  218. package/dist/collection/components/fluent-ui/file-input/udp-fluent-file-input.js +4 -4
  219. package/dist/collection/components/fluent-ui/icon/icon-grid/icon-grid.js +1 -1
  220. package/dist/collection/components/fluent-ui/icon/udp-fluent-icon.js +1 -1
  221. package/dist/collection/components/fluent-ui/icon-picker/udp-fluent-icon-picker.js +2 -2
  222. package/dist/collection/components/fluent-ui/image/udp-fluent-image.js +1 -1
  223. package/dist/collection/components/fluent-ui/inline-edit/udp-fluent-inline-edit.js +2 -2
  224. package/dist/collection/components/fluent-ui/link/udp-fluent-link.js +1 -1
  225. package/dist/collection/components/fluent-ui/list/udp-list.js +1 -1
  226. package/dist/collection/components/fluent-ui/list-input/udp-fluent-list-input.js +1 -1
  227. package/dist/collection/components/fluent-ui/list-item/udp-list-item.js +2 -2
  228. package/dist/collection/components/fluent-ui/location-input/udp-fluent-location-input.js +3 -3
  229. package/dist/collection/components/fluent-ui/menu/udp-fluent-menu.js +2 -2
  230. package/dist/collection/components/fluent-ui/message-bar/udp-message-bar.js +1 -1
  231. package/dist/collection/components/fluent-ui/number-input/udp-fluent-number-input.js +1 -1
  232. package/dist/collection/components/fluent-ui/popover/udp-popover.js +4 -4
  233. package/dist/collection/components/fluent-ui/progress-bar/udp-progress-bar.js +1 -1
  234. package/dist/collection/components/fluent-ui/radio-group/udp-fluent-radio-group.js +21 -8
  235. package/dist/collection/components/fluent-ui/rich-text/udp-rich-text.css +9 -0
  236. package/dist/collection/components/fluent-ui/rich-text/udp-rich-text.js +81 -0
  237. package/dist/collection/components/fluent-ui/rich-text-field/rich-text-content.css +97 -0
  238. package/dist/collection/components/fluent-ui/rich-text-field/rich-text-schema.js +39 -0
  239. package/dist/collection/components/fluent-ui/rich-text-field/udp-rich-text-field.css +1 -92
  240. package/dist/collection/components/fluent-ui/rich-text-field/udp-rich-text-field.js +12 -39
  241. package/dist/collection/components/fluent-ui/search-input/udp-search-input.css +6 -0
  242. package/dist/collection/components/fluent-ui/search-input/udp-search-input.js +3 -3
  243. package/dist/collection/components/fluent-ui/signature-input/udp-fluent-signature-input.js +4 -4
  244. package/dist/collection/components/fluent-ui/slider/udp-slider.js +1 -1
  245. package/dist/collection/components/fluent-ui/spinner/udp-spinner.js +1 -1
  246. package/dist/collection/components/fluent-ui/swatch-picker/udp-swatch-picker.js +1 -1
  247. package/dist/collection/components/fluent-ui/switch/udp-fluent-switch.js +1 -1
  248. package/dist/collection/components/fluent-ui/table-input/table-aggregates.js +57 -0
  249. package/dist/collection/components/fluent-ui/table-input/udp-fluent-table-input.js +12 -56
  250. package/dist/collection/components/fluent-ui/tablist/udp-fluent-tablist.js +13 -2
  251. package/dist/collection/components/fluent-ui/text/udp-text.js +1 -1
  252. package/dist/collection/components/fluent-ui/text-input/udp-fluent-text-input.js +2 -2
  253. package/dist/collection/components/fluent-ui/textarea/udp-textarea.js +2 -2
  254. package/dist/collection/components/fluent-ui/time-input/udp-time-input.js +7 -2
  255. package/dist/collection/components/fluent-ui/toggle-button/udp-fluent-toggle-button.js +1 -1
  256. package/dist/collection/components/fluent-ui/tooltip/udp-tooltip.js +2 -2
  257. package/dist/collection/components/fluent-ui/tree/udp-tree.js +1 -1
  258. package/dist/collection/components/forms/dynamic-form/udp-dynamic-form.js +1 -1
  259. package/dist/collection/components/forms/edit-view-form/edit-view-form.js +2 -2
  260. package/dist/collection/components/forms/form/stencil-form.js +1 -1
  261. package/dist/collection/components/forms/save-view-form/save-view-form.js +2 -2
  262. package/dist/collection/components/forms/udp-forms/udp-forms-builder/forms-question-item/udp-forms-builder-question-item.js +2 -2
  263. package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/file-upload-renderer/file-upload-renderer.js +4 -4
  264. package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/form-metadata-display-renderer/form-metadata-display-renderer.js +3 -3
  265. package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/list-option-renderer/list-options-renderer.js +3 -3
  266. package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/location-renderer/location-renderer.js +6 -6
  267. package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/question-configs-renderer/question-configs-renderer.js +7 -7
  268. package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/section-configs-renderer/section-configs-renderer.js +4 -4
  269. package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/signature-renderer/signature-renderer.js +1 -1
  270. package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/table-columns-renderer/table-columns-renderer.js +2 -2
  271. package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/text-input-renderer/text-input-renderer.js +2 -2
  272. package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-menu/udp-forms-builder-menu.js +2 -2
  273. package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-style-override/udp-forms-builder-style-override.js +1 -1
  274. package/dist/collection/components/forms/udp-forms/udp-forms-list/udp-forms-list-card/udp-forms-list-card.js +4 -4
  275. package/dist/collection/components/forms/udp-forms/udp-forms-list/udp-forms-list.js +1 -1
  276. package/dist/collection/components/forms/udp-forms/udp-forms-renderer/udp-forms-renderer-follow-up-list-card/udp-forms-follow-up-list-card.js +2 -2
  277. package/dist/collection/components/forms/udp-forms/udp-forms-renderer/udp-forms-renderer.js +1 -1
  278. package/dist/collection/components/forms/udp-forms/udp-question/table-input/table-input.js +1 -1
  279. package/dist/collection/components/forms/udp-question-form/__forms-harness__/fixtures/table-domain.fixtures.js +200 -0
  280. package/dist/collection/components/forms/udp-question-form/builder/components/configure-question-drawer.js +7 -1
  281. package/dist/collection/components/forms/udp-question-form/builder/components/questionConfig/typeSpecific/DomainTableConfig.js +309 -0
  282. package/dist/collection/components/forms/udp-question-form/builder/components/questionConfig/typeSpecific/TableConfig.js +32 -1
  283. package/dist/collection/components/forms/udp-question-form/builder/components/questionConfig/udp-question-config-fluent.css +50 -0
  284. package/dist/collection/components/forms/udp-question-form/builder/components/questionConfig/udp-question-config-fluent.js +33 -3
  285. package/dist/collection/components/forms/udp-question-form/builder/udp-question-form-builder.js +7 -1
  286. package/dist/collection/components/forms/udp-question-form/builder/utils/builder-api.js +85 -0
  287. package/dist/collection/components/forms/udp-question-form/core/field-properties-schemas/per-type/table.js +9 -1
  288. package/dist/collection/components/forms/udp-question-form/core/field-properties.js +6 -1
  289. package/dist/collection/components/forms/udp-question-form/core/validation/intrinsic.js +52 -3
  290. package/dist/collection/components/forms/udp-question-form/renderer/runtime/codecs.js +10 -4
  291. package/dist/collection/components/forms/udp-question-form/renderer/runtime/domain-table-snapshot.js +50 -0
  292. package/dist/collection/components/forms/udp-question-form/renderer/runtime/index.js +1 -0
  293. package/dist/collection/components/forms/udp-question-form/renderer/udp-question-form-renderer.js +62 -16
  294. package/dist/collection/components/forms/udp-question-form/renderer/ui/adapters/udp-question-tally-adapter.js +1 -1
  295. package/dist/collection/components/forms/udp-question-form/renderer/ui/form-shell.js +2 -1
  296. package/dist/collection/components/forms/udp-question-form/renderer/ui/question-renderer.js +7 -3
  297. package/dist/collection/components/forms/udp-question-form/renderer/ui/question-view-renderer.js +17 -11
  298. package/dist/collection/components/forms/udp-question-form/version-drawer/udp-form-version-drawer.js +1 -1
  299. package/dist/collection/components/grid/ambient-template-grid/ambient-template-grid.js +16 -16
  300. package/dist/collection/components/grid/grid-primary-bar/grid-primary-bar.js +2 -2
  301. package/dist/collection/components/grid/hotlists/udp-hotlist-form/udp-hotlist-form.js +1 -1
  302. package/dist/collection/components/grid/new-grid/ag-grid-base.css +7 -0
  303. package/dist/collection/components/grid/new-grid/ag-grid-base.js +13 -4
  304. package/dist/collection/components/grid/new-grid/api-method-instance-grid.js +27 -3
  305. package/dist/collection/components/grid/new-grid/client-side-grid.js +2 -2
  306. package/dist/collection/components/grid/new-grid/datasources/searchMethodDatasource.js +20 -6
  307. package/dist/collection/components/grid/new-grid/gridFunctions/advancedSearch.js +3 -2
  308. package/dist/collection/components/grid/new-grid/gridFunctions/savedViews.js +7 -5
  309. package/dist/collection/components/grid/new-grid/gridFunctions/udpExport.js +12 -1
  310. package/dist/collection/components/grid/new-grid/helperFunctions/buildSearchObject.js +17 -16
  311. package/dist/collection/components/grid/new-grid/helperFunctions/configureUdpColumnMods.js +23 -7
  312. package/dist/collection/components/grid/new-grid/helperFunctions/domainRowsHelper.js +177 -0
  313. package/dist/collection/components/grid/new-grid/helperFunctions/extraFieldsHelper.js +203 -0
  314. package/dist/collection/components/grid/new-grid/helperFunctions/lookupHelper.js +256 -16
  315. package/dist/collection/components/grid/new-grid/search-method-grid.js +124 -11
  316. package/dist/collection/components/grid/new-grid/server-side-grid.js +107 -4
  317. package/dist/collection/components/grid/renderers/actions-renderer.js +83 -55
  318. package/dist/collection/components/grid/renderers/input-renderer.js +66 -0
  319. package/dist/collection/components/grid/resource-timeline-calendar/resource-timeline-calendar.js +1 -1
  320. package/dist/collection/components/grid/resource-timeline-calendar/resource-timeline-primary-bar.js +3 -3
  321. package/dist/collection/components/import/udp-import-sheet/udp-import-sheet.css +38 -0
  322. package/dist/collection/components/import/udp-import-sheet/udp-import-sheet.js +425 -0
  323. package/dist/collection/components/inputs/address-search/address-search.js +3 -3
  324. package/dist/collection/components/inputs/checkbox/check-box.js +2 -2
  325. package/dist/collection/components/inputs/date-range-selector/udp-date-range-selector.js +2 -2
  326. package/dist/collection/components/inputs/date-selector/udp-date-selector.js +3 -3
  327. package/dist/collection/components/inputs/date-time-selector/udp-datetime-selector.js +3 -3
  328. package/dist/collection/components/inputs/file-upload/file-upload.js +4 -4
  329. package/dist/collection/components/inputs/form metadata display/form-metadata-display.js +1 -1
  330. package/dist/collection/components/inputs/image-upload/image-upload.js +1 -1
  331. package/dist/collection/components/inputs/numeric-field/numeric-field.js +3 -3
  332. package/dist/collection/components/inputs/signature-input/signature-input.js +2 -2
  333. package/dist/collection/components/inputs/tally/tally.js +2 -2
  334. package/dist/collection/components/inputs/text-area/text-area.js +3 -3
  335. package/dist/collection/components/inputs/text-field/text-field.js +3 -3
  336. package/dist/collection/components/inputs/time-selector/udp-time-selector.js +3 -3
  337. package/dist/collection/components/inputs/toggle/stencil-toggle.js +4 -4
  338. package/dist/collection/components/inputs/udp-selector/udp-selector.js +4 -4
  339. package/dist/collection/components/layout/primary-action-header/udp-primary-action-header.js +1 -1
  340. package/dist/collection/components/layout/udp-container/udp-container.js +2 -2
  341. package/dist/collection/components/layout/udp-container-query/udp-container-query.js +2 -2
  342. package/dist/collection/components/layout/udp-container-query-grid/udp-container-query-grid.js +1 -1
  343. package/dist/collection/components/layout/udp-container-query-grid-item/udp-container-query-grid-item.js +1 -1
  344. package/dist/collection/components/layout/udp-page/udp-page.js +1 -1
  345. package/dist/collection/components/layout/udp-sidebar-layout/udp-sidebar-layout.js +3 -3
  346. package/dist/collection/components/layout/udp-split-screen/udp-split-screen.js +1 -1
  347. package/dist/collection/components/layout/udp-vertical-spacer.js +1 -1
  348. package/dist/collection/components/loaders/udp-grid-loader/udp-grid-loader.js +2 -2
  349. package/dist/collection/components/loaders/udp-linear-loader/udp-linear-loader.js +1 -1
  350. package/dist/collection/components/loaders/udp-skeleton-loading.js +1 -1
  351. package/dist/collection/components/map/udp-map/map-component.js +1 -1
  352. package/dist/collection/components/map/udp-map/popups/add-map-feature-popup.js +3 -3
  353. package/dist/collection/components/map/udp-map/popups/feature-details-card/feature-details-card.js +4 -4
  354. package/dist/collection/components/map/udp-map/popups/feature-details-popup.js +1 -1
  355. package/dist/collection/components/map/udp-map/popups/select-layer-popup.js +2 -2
  356. package/dist/collection/components/map/udp-map/popups/split-line-popup.js +1 -1
  357. package/dist/collection/components/map/udp-map/toolbar/map-toolbar.js +2 -2
  358. package/dist/collection/components/map/udp-map/udp-map-toolbar.js +1 -1
  359. package/dist/collection/components/map/udp-map/udp-map.js +3 -3
  360. package/dist/collection/components/menu/menu-item/udp-menu-item.js +1 -1
  361. package/dist/collection/components/menu/udp-menu.js +1 -1
  362. package/dist/collection/components/new-form/field/udp-field.js +1 -1
  363. package/dist/collection/components/new-form/form/udp-form-component.js +2 -2
  364. package/dist/collection/components/stepper/udp-stepper-actions/udp-stepper-actions.js +1 -1
  365. package/dist/collection/components/stepper/udp-stepper-content/udp-stepper-content.js +2 -2
  366. package/dist/collection/components/stepper/udp-stepper-demo.js +1 -1
  367. package/dist/collection/components/stepper/udp-stepper-nav/udp-stepper-nav.js +1 -1
  368. package/dist/collection/components/tabs/tab/tabs/udp-tabs.js +2 -2
  369. package/dist/collection/components/tabs/tab/udp-tab.js +1 -1
  370. package/dist/collection/components/tabs/udp-tab-panel/udp-tab-panel.js +1 -2
  371. package/dist/collection/components/timeline/udp-timeline-connector.js +1 -1
  372. package/dist/collection/components/timeline/udp-timeline-dot.js +1 -1
  373. package/dist/collection/components/timeline/udp-timeline-item.js +2 -2
  374. package/dist/collection/components/timeline/udp-timeline-separator.js +1 -1
  375. package/dist/collection/components/timeline/udp-timeline.js +1 -1
  376. package/dist/collection/components/toolbars/app-bar/app-bar.js +1 -1
  377. package/dist/collection/components/util/ghost-render/ghost-render.js +1 -1
  378. package/dist/collection/components/util/lazy-loader/udp-lazy-loader.js +1 -1
  379. package/dist/collection/components/vertical-timeline/udp-vertical-timeline-connector.js +1 -1
  380. package/dist/collection/components/vertical-timeline/udp-vertical-timeline-dot.js +1 -1
  381. package/dist/collection/components/vertical-timeline/udp-vertical-timeline-item.js +2 -2
  382. package/dist/collection/components/vertical-timeline/udp-vertical-timeline-separator.js +1 -1
  383. package/dist/collection/components/vertical-timeline/udp-vertical-timeline.js +1 -1
  384. package/dist/collection/deprecated/components/side-sheet/side-sheet-container.js +1 -1
  385. package/dist/collection/deprecated/components/side-sheet/side-sheet.js +1 -1
  386. package/dist/collection/icons/fluent-icons.js +16 -0
  387. package/dist/collection/index.js +2 -0
  388. package/dist/collection/store/execution-store.js +6 -5
  389. package/dist/collection/test-pages/test-components-page.js +28 -28
  390. package/dist/collection/test-pages/test-form.js +4 -4
  391. package/dist/collection/udp-utilities/api-config/configService.js +0 -4
  392. package/dist/collection/udp-utilities/extra-fields/extraFields.js +94 -0
  393. package/dist/collection/udp-utilities/extra-fields/index.js +1 -0
  394. package/dist/collection/udp-utilities/layout/udp-dynamic-container-with-menu/chip-section/chip-section.js +2 -2
  395. package/dist/collection/udp-utilities/layout/udp-dynamic-container-with-menu/udp-dynamic-container-with-menu.js +1 -1
  396. package/dist/components/add-map-feature-popup2.js +1 -1
  397. package/dist/components/address-search2.js +1 -1
  398. package/dist/components/advanced-search-grouped2.js +1 -1
  399. package/dist/components/advanced-search2.js +1 -1
  400. package/dist/components/ag-grid-base2.js +1 -1
  401. package/dist/components/ambient-template-grid.js +1 -1
  402. package/dist/components/api-method-instance-grid.js +1 -1
  403. package/dist/components/apiMethodInstance.js +1 -1
  404. package/dist/components/apiUtils.js +1 -1
  405. package/dist/components/app-bar.js +1 -1
  406. package/dist/components/chart-kpi2.js +1 -1
  407. package/dist/components/check-box.js +1 -1
  408. package/dist/components/chip-section.js +1 -1
  409. package/dist/components/client-side-grid2.js +1 -1
  410. package/dist/components/configService.js +1 -1
  411. package/dist/components/configureUdpColumnMods.js +1 -1
  412. package/dist/components/convertBackendTypeToAgGridType.js +1 -0
  413. package/dist/components/custom-button2.js +1 -1
  414. package/dist/components/edit-view-form.js +1 -1
  415. package/dist/components/extraFields.js +1 -0
  416. package/dist/components/feature-details-card2.js +1 -1
  417. package/dist/components/feature-details-popup2.js +1 -1
  418. package/dist/components/field-picker-tree.js +1 -1
  419. package/dist/components/field-picker.js +1 -1
  420. package/dist/components/file-upload-renderer2.js +1 -1
  421. package/dist/components/file-upload2.js +1 -1
  422. package/dist/components/filter-conditions2.js +1 -1
  423. package/dist/components/fluent-icons.js +1 -1
  424. package/dist/components/form-metadata-display-renderer2.js +1 -1
  425. package/dist/components/form-metadata-display2.js +1 -1
  426. package/dist/components/getCachedAzureMapsProviders.js +1 -1
  427. package/dist/components/ghost-render2.js +1 -1
  428. package/dist/components/grid-primary-bar2.js +1 -1
  429. package/dist/components/hint-panel2.js +1 -1
  430. package/dist/components/icon-grid2.js +1 -1
  431. package/dist/components/image-upload2.js +1 -1
  432. package/dist/components/index.js +1 -1
  433. package/dist/components/kpi-list2.js +1 -1
  434. package/dist/components/list-item.js +1 -1
  435. package/dist/components/list-options-renderer2.js +1 -1
  436. package/dist/components/location-renderer2.js +1 -1
  437. package/dist/components/logical-search-indicator.js +1 -1
  438. package/dist/components/lookup.js +1 -0
  439. package/dist/components/map-component2.js +1 -1
  440. package/dist/components/map-toolbar2.js +1 -1
  441. package/dist/components/numeric-field2.js +1 -1
  442. package/dist/components/primary-action-header2.js +1 -1
  443. package/dist/components/question-configs-renderer2.js +1 -1
  444. package/dist/components/resource-timeline-calendar.js +1 -1
  445. package/dist/components/resource-timeline-primary-bar2.js +1 -1
  446. package/dist/components/rich-text-schema.js +1 -0
  447. package/dist/components/save-view-form.js +1 -1
  448. package/dist/components/search-list-item2.js +1 -1
  449. package/dist/components/search-method-grid2.js +1 -1
  450. package/dist/components/section-configs-renderer2.js +1 -1
  451. package/dist/components/select-layer-popup2.js +1 -1
  452. package/dist/components/server-side-grid2.js +1 -1
  453. package/dist/components/side-sheet-container2.js +1 -1
  454. package/dist/components/side-sheet2.js +1 -1
  455. package/dist/components/signature-input2.js +1 -1
  456. package/dist/components/signature-renderer2.js +1 -1
  457. package/dist/components/simple-card.js +1 -1
  458. package/dist/components/split-line-popup2.js +1 -1
  459. package/dist/components/status-chip2.js +1 -1
  460. package/dist/components/status-renderer.js +1 -1
  461. package/dist/components/stencil-chip2.js +1 -1
  462. package/dist/components/stencil-form2.js +1 -1
  463. package/dist/components/stencil-toggle2.js +1 -1
  464. package/dist/components/table-aggregates.js +1 -0
  465. package/dist/components/table-columns-renderer2.js +1 -1
  466. package/dist/components/table-input2.js +1 -1
  467. package/dist/components/tally.js +1 -1
  468. package/dist/components/test-components-page.js +1 -1
  469. package/dist/components/test-form2.js +1 -1
  470. package/dist/components/text-area2.js +1 -1
  471. package/dist/components/text-field2.js +1 -1
  472. package/dist/components/text-input-renderer2.js +1 -1
  473. package/dist/components/types.js +1 -1
  474. package/dist/components/udp-adornment2.js +1 -1
  475. package/dist/components/udp-advanced-search-builder.js +1 -1
  476. package/dist/components/udp-ag-area-chart.js +1 -1
  477. package/dist/components/udp-ag-bar-chart2.js +1 -1
  478. package/dist/components/udp-ag-bubble-chart.js +1 -1
  479. package/dist/components/udp-ag-combo-chart.js +1 -1
  480. package/dist/components/udp-ag-donut-chart.js +1 -1
  481. package/dist/components/udp-ag-line-chart.js +1 -1
  482. package/dist/components/udp-ag-pie-chart.js +1 -1
  483. package/dist/components/udp-ag-scatter-chart.js +1 -1
  484. package/dist/components/udp-ambient-card2.js +1 -1
  485. package/dist/components/udp-ambient-tool-tip2.js +1 -1
  486. package/dist/components/udp-attachment-list.js +1 -1
  487. package/dist/components/udp-autocomplete2.js +1 -1
  488. package/dist/components/udp-avatar2.js +1 -1
  489. package/dist/components/udp-badge2.js +1 -1
  490. package/dist/components/udp-bar-chart.js +1 -1
  491. package/dist/components/udp-button2.js +1 -1
  492. package/dist/components/udp-calendar-base2.js +1 -1
  493. package/dist/components/udp-calendar-day.js +1 -1
  494. package/dist/components/udp-calendar-month.js +1 -1
  495. package/dist/components/udp-calendar-week.js +1 -1
  496. package/dist/components/udp-calendar-year.js +1 -1
  497. package/dist/components/udp-card-action-area.js +1 -1
  498. package/dist/components/udp-card-actions2.js +1 -1
  499. package/dist/components/udp-card-content2.js +1 -1
  500. package/dist/components/udp-card-header2.js +1 -1
  501. package/dist/components/udp-card-media2.js +1 -1
  502. package/dist/components/udp-card2.js +1 -1
  503. package/dist/components/udp-charts-example.js +1 -1
  504. package/dist/components/udp-chip2.js +1 -1
  505. package/dist/components/udp-column-header2.js +1 -1
  506. package/dist/components/udp-compound-button2.js +1 -1
  507. package/dist/components/udp-container-query-grid-item.js +1 -1
  508. package/dist/components/udp-container-query-grid2.js +1 -1
  509. package/dist/components/udp-container-query2.js +1 -1
  510. package/dist/components/udp-container2.js +1 -1
  511. package/dist/components/udp-date-range-selector2.js +1 -1
  512. package/dist/components/udp-date-selector2.js +1 -1
  513. package/dist/components/udp-date-time-input2.js +1 -1
  514. package/dist/components/udp-datetime-selector2.js +1 -1
  515. package/dist/components/udp-detail-list-item2.js +1 -1
  516. package/dist/components/udp-dialog2.js +1 -1
  517. package/dist/components/udp-distribution-chart2.js +1 -1
  518. package/dist/components/udp-divider2.js +1 -1
  519. package/dist/components/udp-donut-chart2.js +1 -1
  520. package/dist/components/udp-dynamic-container-with-menu2.js +1 -1
  521. package/dist/components/udp-dynamic-form.js +1 -1
  522. package/dist/components/udp-empty-state-display2.js +1 -1
  523. package/dist/components/udp-empty-state2.js +1 -1
  524. package/dist/components/udp-export-sheet2.js +1 -1
  525. package/dist/components/udp-field2.js +1 -1
  526. package/dist/components/udp-fluent-avatar2.js +1 -1
  527. package/dist/components/udp-fluent-badge2.js +1 -1
  528. package/dist/components/udp-fluent-button2.js +1 -1
  529. package/dist/components/udp-fluent-card2.js +1 -1
  530. package/dist/components/udp-fluent-checkbox2.js +1 -1
  531. package/dist/components/udp-fluent-counter-badge2.js +1 -1
  532. package/dist/components/udp-fluent-dialog2.js +1 -1
  533. package/dist/components/udp-fluent-divider2.js +1 -1
  534. package/dist/components/udp-fluent-domain-table-input.d.ts +11 -0
  535. package/dist/components/udp-fluent-domain-table-input.js +2 -0
  536. package/dist/components/udp-fluent-domain-table-input2.js +1 -0
  537. package/dist/components/udp-fluent-drawer2.js +1 -1
  538. package/dist/components/udp-fluent-dropdown2.js +1 -1
  539. package/dist/components/udp-fluent-file-input2.js +1 -1
  540. package/dist/components/udp-fluent-icon-picker.js +1 -1
  541. package/dist/components/udp-fluent-icon2.js +1 -1
  542. package/dist/components/udp-fluent-image2.js +1 -1
  543. package/dist/components/udp-fluent-inline-edit2.js +1 -1
  544. package/dist/components/udp-fluent-link.js +1 -1
  545. package/dist/components/udp-fluent-list-input2.js +1 -1
  546. package/dist/components/udp-fluent-location-input2.js +1 -1
  547. package/dist/components/udp-fluent-menu2.js +1 -1
  548. package/dist/components/udp-fluent-number-input.js +1 -1
  549. package/dist/components/udp-fluent-number-input2.js +1 -0
  550. package/dist/components/udp-fluent-radio-group2.js +1 -1
  551. package/dist/components/udp-fluent-signature-input2.js +1 -1
  552. package/dist/components/udp-fluent-switch2.js +1 -1
  553. package/dist/components/udp-fluent-table-input2.js +1 -1
  554. package/dist/components/udp-fluent-tablist2.js +1 -1
  555. package/dist/components/udp-fluent-text-input2.js +1 -1
  556. package/dist/components/udp-fluent-toggle-button2.js +1 -1
  557. package/dist/components/udp-form-component2.js +1 -1
  558. package/dist/components/udp-form-version-drawer2.js +1 -1
  559. package/dist/components/udp-forms-builder-menu2.js +1 -1
  560. package/dist/components/udp-forms-builder-question-item2.js +1 -1
  561. package/dist/components/udp-forms-builder-style-override.js +1 -1
  562. package/dist/components/udp-forms-follow-up-list-card.js +1 -1
  563. package/dist/components/udp-forms-list-card2.js +1 -1
  564. package/dist/components/udp-forms-list.js +1 -1
  565. package/dist/components/udp-forms-renderer.js +1 -1
  566. package/dist/components/udp-forms-ui2.js +1 -1
  567. package/dist/components/udp-function-button2.js +1 -1
  568. package/dist/components/udp-grid-loader2.js +1 -1
  569. package/dist/components/udp-hotlist-form2.js +1 -1
  570. package/dist/components/udp-import-sheet.d.ts +11 -0
  571. package/dist/components/udp-import-sheet.js +2 -0
  572. package/dist/components/udp-kpi-card2.js +1 -1
  573. package/dist/components/udp-kpi-cards.js +1 -1
  574. package/dist/components/udp-lazy-loader2.js +1 -1
  575. package/dist/components/udp-line-chart2.js +1 -1
  576. package/dist/components/udp-linear-loader2.js +1 -1
  577. package/dist/components/udp-list-item2.js +1 -1
  578. package/dist/components/udp-list2.js +1 -1
  579. package/dist/components/udp-map-toolbar2.js +1 -1
  580. package/dist/components/udp-map.js +1 -1
  581. package/dist/components/udp-menu-item2.js +1 -1
  582. package/dist/components/udp-menu.js +1 -1
  583. package/dist/components/udp-message-bar2.js +1 -1
  584. package/dist/components/udp-notification2.js +1 -1
  585. package/dist/components/udp-page-header2.js +1 -1
  586. package/dist/components/udp-page.js +1 -1
  587. package/dist/components/udp-pop-over-grid-action-header2.js +1 -1
  588. package/dist/components/udp-pop-over2.js +1 -1
  589. package/dist/components/udp-popover2.js +1 -1
  590. package/dist/components/udp-primary-action-header2.js +1 -1
  591. package/dist/components/udp-progress-bar2.js +1 -1
  592. package/dist/components/udp-question-config-fluent2.js +1 -1
  593. package/dist/components/udp-question-form-builder.js +1 -1
  594. package/dist/components/udp-question-form-renderer2.js +1 -1
  595. package/dist/components/udp-question-tally-adapter2.js +1 -1
  596. package/dist/components/udp-question2.js +1 -1
  597. package/dist/components/udp-radio-button2.js +1 -1
  598. package/dist/components/udp-rich-text-field.js +1 -1
  599. package/dist/components/udp-rich-text.d.ts +11 -0
  600. package/dist/components/udp-rich-text.js +2 -0
  601. package/dist/components/udp-sankey-chart.js +1 -1
  602. package/dist/components/udp-search-input2.js +1 -1
  603. package/dist/components/udp-selector2.js +1 -1
  604. package/dist/components/udp-side-sheet2.js +1 -1
  605. package/dist/components/udp-sidebar-layout2.js +1 -1
  606. package/dist/components/udp-skeleton-loading2.js +1 -1
  607. package/dist/components/udp-slider2.js +1 -1
  608. package/dist/components/udp-spinner2.js +1 -1
  609. package/dist/components/udp-split-screen.js +1 -1
  610. package/dist/components/udp-stepper-actions.js +1 -1
  611. package/dist/components/udp-stepper-content.js +1 -1
  612. package/dist/components/udp-stepper-demo.js +1 -1
  613. package/dist/components/udp-stepper-nav.js +1 -1
  614. package/dist/components/udp-swatch-picker2.js +1 -1
  615. package/dist/components/udp-tab-panel2.js +1 -1
  616. package/dist/components/udp-tab.js +1 -1
  617. package/dist/components/udp-tabs2.js +1 -1
  618. package/dist/components/udp-text2.js +1 -1
  619. package/dist/components/udp-textarea2.js +1 -1
  620. package/dist/components/udp-time-input2.js +1 -1
  621. package/dist/components/udp-time-selector2.js +1 -1
  622. package/dist/components/udp-timeline-connector.js +1 -1
  623. package/dist/components/udp-timeline-dot.js +1 -1
  624. package/dist/components/udp-timeline-item.js +1 -1
  625. package/dist/components/udp-timeline-separator.js +1 -1
  626. package/dist/components/udp-timeline.js +1 -1
  627. package/dist/components/udp-tooltip2.js +1 -1
  628. package/dist/components/udp-tree2.js +1 -1
  629. package/dist/components/udp-vertical-spacer2.js +1 -1
  630. package/dist/components/udp-vertical-timeline-connector.js +1 -1
  631. package/dist/components/udp-vertical-timeline-dot.js +1 -1
  632. package/dist/components/udp-vertical-timeline-item.js +1 -1
  633. package/dist/components/udp-vertical-timeline-separator.js +1 -1
  634. package/dist/components/udp-vertical-timeline.js +1 -1
  635. package/dist/components/udp-xy-chart2.js +1 -1
  636. package/dist/components/udp-xy-multi-series-chart.js +1 -1
  637. package/dist/components/upd-alert-banner2.js +1 -1
  638. package/dist/docs.json +1805 -112
  639. package/dist/esm/{SearchBuilder-BmqrJvtz.js → SearchBuilder-BxLXFEeR.js} +1 -1
  640. package/dist/esm/add-map-feature-popup_4.entry.js +8 -8
  641. package/dist/esm/address-search_6.entry.js +19 -19
  642. package/dist/esm/advanced-search_12.entry.js +20 -20
  643. package/dist/esm/{ag-grid-base_65.entry.js → ag-grid-base_66.entry.js} +450 -176
  644. package/dist/esm/ambient-template-grid.entry.js +20 -20
  645. package/dist/esm/api-method-instance-grid.entry.js +10 -9
  646. package/dist/esm/{apiMethodInstance-BunReWfq.js → apiMethodInstance-qaGbXDNr.js} +2 -31
  647. package/dist/esm/{apiUtils-Cq-WuEqc.js → apiUtils-CXqsYwOQ.js} +29 -28
  648. package/dist/esm/app-bar.entry.js +1 -1
  649. package/dist/esm/{catalog-store-CLsDGUEl.js → catalog-store-BOpo_zaC.js} +1 -1
  650. package/dist/esm/chart-container_3.entry.js +2 -2
  651. package/dist/esm/check-box.entry.js +2 -2
  652. package/dist/esm/chip-section.entry.js +2 -2
  653. package/dist/esm/{codecs-CI_fHfY1.js → codecs-BWyrM561.js} +400 -9
  654. package/dist/esm/{configService-D_9j963S.js → configService-CehZzjhw.js} +0 -4
  655. package/dist/esm/{configureUdpColumnMods-UWccWlH6.js → configureUdpColumnMods-bMO0_--H.js} +23 -7
  656. package/dist/esm/convertBackendTypeToAgGridType-B8xfl_wR.js +31 -0
  657. package/dist/esm/{createAzureMapsProviders-CLLCmr8f.js → createAzureMapsProviders-CtQryp1H.js} +13 -1
  658. package/dist/esm/custom-button.entry.js +1 -1
  659. package/dist/esm/date-time-renderer_9.entry.js +21 -21
  660. package/dist/esm/domain-table-snapshot-H3o5mjFB.js +331 -0
  661. package/dist/esm/extraFields-Cnpy_Bm7.js +97 -0
  662. package/dist/esm/extraFieldsHelper-CaBMA4HJ.js +205 -0
  663. package/dist/esm/feature-details-card_2.entry.js +5 -5
  664. package/dist/esm/file-upload_2.entry.js +7 -7
  665. package/dist/esm/filter-conditions_7.entry.js +7 -7
  666. package/dist/esm/{fluent-icons-pWFJyrRm.js → fluent-icons-wRyOZqj2.js} +20 -0
  667. package/dist/esm/form-metadata-display_2.entry.js +3 -3
  668. package/dist/esm/getCurrentApiCatalogId-DeurXd9l.js +5 -0
  669. package/dist/esm/icon-grid.entry.js +2 -2
  670. package/dist/esm/image-upload_8.entry.js +7 -7
  671. package/dist/esm/index-15aY63VA.js +12 -8
  672. package/dist/esm/index.js +13 -22
  673. package/dist/esm/{load-icons-BHSNRRRA.js → load-icons-D2ZhiHp6.js} +1 -1
  674. package/dist/esm/loader.js +1 -1
  675. package/dist/esm/logical-search-indicator.entry.js +1 -1
  676. package/dist/esm/lookupHelper-D3LSjaES.js +682 -0
  677. package/dist/esm/map-component_2.entry.js +2 -2
  678. package/dist/esm/primary-action-header_2.entry.js +4 -4
  679. package/dist/esm/question-configs-renderer_4.entry.js +15 -15
  680. package/dist/esm/resource-timeline-calendar.entry.js +1 -1
  681. package/dist/esm/resource-timeline-primary-bar.entry.js +3 -3
  682. package/dist/esm/rich-text-schema-DCUYo610.js +42 -0
  683. package/dist/esm/search-method-grid.entry.js +120 -263
  684. package/dist/esm/server-side-grid.entry.js +85 -3
  685. package/dist/esm/side-sheet-container.entry.js +1 -1
  686. package/dist/esm/simple-card.entry.js +1 -1
  687. package/dist/esm/status-chip_2.entry.js +2 -2
  688. package/dist/esm/{status-renderer-BoY7sar9.js → status-renderer-Evo0rTNU.js} +83 -55
  689. package/dist/esm/stencil-chip.entry.js +2 -2
  690. package/dist/esm/stencil-library.js +1 -1
  691. package/dist/esm/stencil-toggle.entry.js +4 -4
  692. package/dist/esm/text-field_2.entry.js +7 -7
  693. package/dist/esm/{types-C9Z-dgvN.js → types-NqFGtWPW.js} +1 -1
  694. package/dist/esm/udp-adornment.entry.js +1 -1
  695. package/dist/esm/udp-advanced-search-builder.entry.js +102 -5
  696. package/dist/esm/udp-advanced-search-field-picker_3.entry.js +3 -3
  697. package/dist/esm/udp-ag-area-chart.entry.js +2 -2
  698. package/dist/esm/udp-ag-bar-chart_4.entry.js +5 -5
  699. package/dist/esm/udp-ag-bubble-chart.entry.js +2 -2
  700. package/dist/esm/udp-ag-combo-chart.entry.js +2 -2
  701. package/dist/esm/udp-ag-donut-chart.entry.js +2 -2
  702. package/dist/esm/udp-ag-line-chart.entry.js +2 -2
  703. package/dist/esm/udp-ag-pie-chart.entry.js +2 -2
  704. package/dist/esm/udp-ag-scatter-chart.entry.js +2 -2
  705. package/dist/esm/udp-attachment-item_2.entry.js +1 -1
  706. package/dist/esm/udp-attachment-list.entry.js +1 -1
  707. package/dist/esm/udp-bar-chart.entry.js +1 -1
  708. package/dist/esm/udp-calendar-base.entry.js +1 -1
  709. package/dist/esm/udp-calendar-day.entry.js +1 -1
  710. package/dist/esm/udp-calendar-month.entry.js +1 -1
  711. package/dist/esm/udp-calendar-week.entry.js +1 -1
  712. package/dist/esm/udp-calendar-year.entry.js +1 -1
  713. package/dist/esm/udp-card-action-area.entry.js +1 -1
  714. package/dist/esm/udp-card_6.entry.js +7 -7
  715. package/dist/esm/udp-charts-example.entry.js +1 -1
  716. package/dist/esm/udp-container-query-grid-item.entry.js +1 -1
  717. package/dist/esm/udp-container-query-grid.entry.js +1 -1
  718. package/dist/esm/udp-container-query.entry.js +2 -2
  719. package/dist/esm/udp-container.entry.js +2 -2
  720. package/dist/esm/{udp-detail-list_9.entry.js → udp-detail-list_10.entry.js} +606 -74
  721. package/dist/esm/{udp-drive-utils-DCivw3gq.js → udp-drive-utils-BVTuKAND.js} +1 -1
  722. package/dist/esm/udp-dynamic-container-with-menu.entry.js +1 -1
  723. package/dist/esm/udp-dynamic-form.entry.js +1 -1
  724. package/dist/esm/udp-fluent-icon-picker.entry.js +2 -2
  725. package/dist/esm/udp-fluent-inline-edit_5.entry.js +491 -42
  726. package/dist/esm/udp-fluent-link.entry.js +1 -1
  727. package/dist/esm/udp-fluent-list-item_2.entry.js +3 -3
  728. package/dist/esm/{udp-form-api-utils-HJ_eUZkX.js → udp-form-api-utils-Bq7Txu0h.js} +1 -1
  729. package/dist/esm/udp-forms-builder-style-override.entry.js +1 -1
  730. package/dist/esm/udp-forms-builder.entry.js +1 -1
  731. package/dist/esm/udp-forms-follow-up-list-card.entry.js +2 -2
  732. package/dist/esm/udp-forms-list-card.entry.js +4 -4
  733. package/dist/esm/udp-forms-list.entry.js +3 -3
  734. package/dist/esm/udp-forms-renderer.entry.js +4 -4
  735. package/dist/esm/udp-import-sheet.entry.js +242 -0
  736. package/dist/esm/udp-kpi-card.entry.js +1 -1
  737. package/dist/esm/udp-kpi-cards.entry.js +2 -2
  738. package/dist/esm/udp-map.entry.js +3 -3
  739. package/dist/esm/udp-menu.entry.js +1 -1
  740. package/dist/esm/udp-page.entry.js +1 -1
  741. package/dist/esm/udp-question-form-builder.entry.js +28 -251
  742. package/dist/esm/udp-rich-text-field.entry.js +28 -39
  743. package/dist/esm/udp-rich-text.entry.js +59 -0
  744. package/dist/esm/udp-sankey-chart.entry.js +1 -1
  745. package/dist/esm/udp-sidebar-layout.entry.js +3 -3
  746. package/dist/esm/udp-skeleton-loading.entry.js +1 -1
  747. package/dist/esm/udp-split-screen.entry.js +1 -1
  748. package/dist/esm/udp-stepper-actions.entry.js +1 -1
  749. package/dist/esm/udp-stepper-content.entry.js +2 -2
  750. package/dist/esm/udp-stepper-demo.entry.js +1 -1
  751. package/dist/esm/udp-stepper-nav.entry.js +1 -1
  752. package/dist/esm/udp-tab.entry.js +1 -1
  753. package/dist/esm/udp-timeline-connector.entry.js +1 -1
  754. package/dist/esm/udp-timeline-dot.entry.js +1 -1
  755. package/dist/esm/udp-timeline-item.entry.js +2 -2
  756. package/dist/esm/udp-timeline-separator.entry.js +1 -1
  757. package/dist/esm/udp-timeline.entry.js +1 -1
  758. package/dist/esm/udp-vertical-timeline-connector.entry.js +1 -1
  759. package/dist/esm/udp-vertical-timeline-dot.entry.js +1 -1
  760. package/dist/esm/udp-vertical-timeline-item.entry.js +2 -2
  761. package/dist/esm/udp-vertical-timeline-separator.entry.js +1 -1
  762. package/dist/esm/udp-vertical-timeline.entry.js +1 -1
  763. package/dist/esm/udp-xy-chart.entry.js +1 -1
  764. package/dist/esm/udp-xy-multi-series-chart.entry.js +1 -1
  765. package/dist/esm/valueFormatters-BbY_Q8IE.js +15 -0
  766. package/dist/stencil-library/{SearchBuilder-BmqrJvtz.js → SearchBuilder-BxLXFEeR.js} +1 -1
  767. package/dist/stencil-library/add-map-feature-popup_4.entry.js +1 -1
  768. package/dist/stencil-library/address-search_6.entry.js +1 -1
  769. package/dist/stencil-library/advanced-search_12.entry.js +1 -1
  770. package/dist/stencil-library/ag-grid-base_66.entry.js +1 -0
  771. package/dist/stencil-library/ambient-template-grid.entry.js +1 -1
  772. package/dist/stencil-library/api-method-instance-grid.entry.js +1 -1
  773. package/dist/stencil-library/apiMethodInstance-qaGbXDNr.js +1 -0
  774. package/dist/stencil-library/apiUtils-CXqsYwOQ.js +1 -0
  775. package/dist/stencil-library/app-bar.entry.js +1 -1
  776. package/dist/stencil-library/{catalog-store-CLsDGUEl.js → catalog-store-BOpo_zaC.js} +1 -1
  777. package/dist/stencil-library/chart-container_3.entry.js +1 -1
  778. package/dist/stencil-library/check-box.entry.js +1 -1
  779. package/dist/stencil-library/chip-section.entry.js +1 -1
  780. package/dist/stencil-library/codecs-BWyrM561.js +1 -0
  781. package/dist/stencil-library/configService-CehZzjhw.js +1 -0
  782. package/dist/stencil-library/configureUdpColumnMods-bMO0_--H.js +1 -0
  783. package/dist/stencil-library/convertBackendTypeToAgGridType-B8xfl_wR.js +1 -0
  784. package/dist/stencil-library/createAzureMapsProviders-CtQryp1H.js +1 -0
  785. package/dist/stencil-library/custom-button.entry.js +1 -1
  786. package/dist/stencil-library/date-time-renderer_9.entry.js +1 -1
  787. package/dist/stencil-library/domain-table-snapshot-H3o5mjFB.js +1 -0
  788. package/dist/stencil-library/extraFields-Cnpy_Bm7.js +1 -0
  789. package/dist/stencil-library/extraFieldsHelper-CaBMA4HJ.js +1 -0
  790. package/dist/stencil-library/feature-details-card_2.entry.js +1 -1
  791. package/dist/stencil-library/file-upload_2.entry.js +1 -1
  792. package/dist/stencil-library/filter-conditions_7.entry.js +1 -1
  793. package/dist/stencil-library/fluent-icons-wRyOZqj2.js +1 -0
  794. package/dist/stencil-library/form-metadata-display_2.entry.js +1 -1
  795. package/dist/stencil-library/getCurrentApiCatalogId-DeurXd9l.js +1 -0
  796. package/dist/stencil-library/icon-grid.entry.js +1 -1
  797. package/dist/stencil-library/image-upload_8.entry.js +1 -1
  798. package/dist/stencil-library/index.esm.js +1 -1
  799. package/dist/stencil-library/load-icons-D2ZhiHp6.js +1 -0
  800. package/dist/stencil-library/logical-search-indicator.entry.js +1 -1
  801. package/dist/stencil-library/lookupHelper-D3LSjaES.js +1 -0
  802. package/dist/stencil-library/map-component_2.entry.js +1 -1
  803. package/dist/stencil-library/primary-action-header_2.entry.js +1 -1
  804. package/dist/stencil-library/question-configs-renderer_4.entry.js +1 -1
  805. package/dist/stencil-library/resource-timeline-calendar.entry.js +1 -1
  806. package/dist/stencil-library/resource-timeline-primary-bar.entry.js +1 -1
  807. package/dist/stencil-library/rich-text-schema-DCUYo610.js +1 -0
  808. package/dist/stencil-library/search-method-grid.entry.js +1 -1
  809. package/dist/stencil-library/server-side-grid.entry.js +1 -1
  810. package/dist/stencil-library/side-sheet-container.entry.js +1 -1
  811. package/dist/stencil-library/simple-card.entry.js +1 -1
  812. package/dist/stencil-library/status-chip_2.entry.js +1 -1
  813. package/dist/stencil-library/status-renderer-Evo0rTNU.js +1 -0
  814. package/dist/stencil-library/stencil-chip.entry.js +1 -1
  815. package/dist/stencil-library/stencil-library.esm.js +1 -1
  816. package/dist/stencil-library/stencil-toggle.entry.js +1 -1
  817. package/dist/stencil-library/text-field_2.entry.js +1 -1
  818. package/dist/stencil-library/{types-C9Z-dgvN.js → types-NqFGtWPW.js} +1 -1
  819. package/dist/stencil-library/udp-adornment.entry.js +1 -1
  820. package/dist/stencil-library/udp-advanced-search-builder.entry.js +1 -1
  821. package/dist/stencil-library/udp-advanced-search-field-picker_3.entry.js +1 -1
  822. package/dist/stencil-library/udp-ag-area-chart.entry.js +1 -1
  823. package/dist/stencil-library/udp-ag-bar-chart_4.entry.js +1 -1
  824. package/dist/stencil-library/udp-ag-bubble-chart.entry.js +1 -1
  825. package/dist/stencil-library/udp-ag-combo-chart.entry.js +1 -1
  826. package/dist/stencil-library/udp-ag-donut-chart.entry.js +1 -1
  827. package/dist/stencil-library/udp-ag-line-chart.entry.js +1 -1
  828. package/dist/stencil-library/udp-ag-pie-chart.entry.js +1 -1
  829. package/dist/stencil-library/udp-ag-scatter-chart.entry.js +1 -1
  830. package/dist/stencil-library/udp-attachment-item_2.entry.js +1 -1
  831. package/dist/stencil-library/udp-attachment-list.entry.js +1 -1
  832. package/dist/stencil-library/udp-bar-chart.entry.js +1 -1
  833. package/dist/stencil-library/udp-calendar-base.entry.js +1 -1
  834. package/dist/stencil-library/udp-calendar-day.entry.js +1 -1
  835. package/dist/stencil-library/udp-calendar-month.entry.js +1 -1
  836. package/dist/stencil-library/udp-calendar-week.entry.js +1 -1
  837. package/dist/stencil-library/udp-calendar-year.entry.js +1 -1
  838. package/dist/stencil-library/udp-card-action-area.entry.js +1 -1
  839. package/dist/stencil-library/udp-card_6.entry.js +1 -1
  840. package/dist/stencil-library/udp-charts-example.entry.js +1 -1
  841. package/dist/stencil-library/udp-container-query-grid-item.entry.js +1 -1
  842. package/dist/stencil-library/udp-container-query-grid.entry.js +1 -1
  843. package/dist/stencil-library/udp-container-query.entry.js +1 -1
  844. package/dist/stencil-library/udp-container.entry.js +1 -1
  845. package/dist/stencil-library/udp-detail-list_10.entry.js +1 -0
  846. package/dist/stencil-library/{udp-drive-utils-DCivw3gq.js → udp-drive-utils-BVTuKAND.js} +1 -1
  847. package/dist/stencil-library/udp-dynamic-container-with-menu.entry.js +1 -1
  848. package/dist/stencil-library/udp-dynamic-form.entry.js +1 -1
  849. package/dist/stencil-library/udp-fluent-icon-picker.entry.js +1 -1
  850. package/dist/stencil-library/udp-fluent-inline-edit_5.entry.js +1 -1
  851. package/dist/stencil-library/udp-fluent-link.entry.js +1 -1
  852. package/dist/stencil-library/udp-fluent-list-item_2.entry.js +1 -1
  853. package/dist/stencil-library/{udp-form-api-utils-HJ_eUZkX.js → udp-form-api-utils-Bq7Txu0h.js} +1 -1
  854. package/dist/stencil-library/udp-forms-builder-style-override.entry.js +1 -1
  855. package/dist/stencil-library/udp-forms-builder.entry.js +1 -1
  856. package/dist/stencil-library/udp-forms-follow-up-list-card.entry.js +1 -1
  857. package/dist/stencil-library/udp-forms-list-card.entry.js +1 -1
  858. package/dist/stencil-library/udp-forms-list.entry.js +1 -1
  859. package/dist/stencil-library/udp-forms-renderer.entry.js +1 -1
  860. package/dist/stencil-library/udp-import-sheet.entry.js +1 -0
  861. package/dist/stencil-library/udp-kpi-card.entry.js +1 -1
  862. package/dist/stencil-library/udp-kpi-cards.entry.js +1 -1
  863. package/dist/stencil-library/udp-map.entry.js +1 -1
  864. package/dist/stencil-library/udp-menu.entry.js +1 -1
  865. package/dist/stencil-library/udp-page.entry.js +1 -1
  866. package/dist/stencil-library/udp-question-form-builder.entry.js +1 -1
  867. package/dist/stencil-library/udp-rich-text-field.entry.js +1 -1
  868. package/dist/stencil-library/udp-rich-text.entry.js +1 -0
  869. package/dist/stencil-library/udp-sankey-chart.entry.js +1 -1
  870. package/dist/stencil-library/udp-sidebar-layout.entry.js +1 -1
  871. package/dist/stencil-library/udp-skeleton-loading.entry.js +1 -1
  872. package/dist/stencil-library/udp-split-screen.entry.js +1 -1
  873. package/dist/stencil-library/udp-stepper-actions.entry.js +1 -1
  874. package/dist/stencil-library/udp-stepper-content.entry.js +1 -1
  875. package/dist/stencil-library/udp-stepper-demo.entry.js +1 -1
  876. package/dist/stencil-library/udp-stepper-nav.entry.js +1 -1
  877. package/dist/stencil-library/udp-tab.entry.js +1 -1
  878. package/dist/stencil-library/udp-timeline-connector.entry.js +1 -1
  879. package/dist/stencil-library/udp-timeline-dot.entry.js +1 -1
  880. package/dist/stencil-library/udp-timeline-item.entry.js +1 -1
  881. package/dist/stencil-library/udp-timeline-separator.entry.js +1 -1
  882. package/dist/stencil-library/udp-timeline.entry.js +1 -1
  883. package/dist/stencil-library/udp-vertical-timeline-connector.entry.js +1 -1
  884. package/dist/stencil-library/udp-vertical-timeline-dot.entry.js +1 -1
  885. package/dist/stencil-library/udp-vertical-timeline-item.entry.js +1 -1
  886. package/dist/stencil-library/udp-vertical-timeline-separator.entry.js +1 -1
  887. package/dist/stencil-library/udp-vertical-timeline.entry.js +1 -1
  888. package/dist/stencil-library/udp-xy-chart.entry.js +1 -1
  889. package/dist/stencil-library/udp-xy-multi-series-chart.entry.js +1 -1
  890. package/dist/stencil-library/valueFormatters-BbY_Q8IE.js +1 -0
  891. package/dist/types/components/advanced-search-builder/udp-advanced-search-builder.d.ts +25 -0
  892. package/dist/types/components/fluent-ui/button/udp-fluent-button.d.ts +5 -0
  893. package/dist/types/components/fluent-ui/domain-table-input/domain-table-snapshot.d.ts +32 -0
  894. package/dist/types/components/fluent-ui/domain-table-input/udp-fluent-domain-table-input.d.ts +137 -0
  895. package/dist/types/components/fluent-ui/domain-table-input/udp-fluent-domain-table-input.types.d.ts +46 -0
  896. package/dist/types/components/fluent-ui/drawer/udp-fluent-drawer.d.ts +5 -0
  897. package/dist/types/components/fluent-ui/dropdown/udp-fluent-dropdown.d.ts +12 -1
  898. package/dist/types/components/fluent-ui/radio-group/udp-fluent-radio-group.d.ts +6 -0
  899. package/dist/types/components/fluent-ui/rich-text/udp-rich-text.d.ts +19 -0
  900. package/dist/types/components/fluent-ui/rich-text-field/rich-text-schema.d.ts +6 -0
  901. package/dist/types/components/fluent-ui/table-input/table-aggregates.d.ts +16 -0
  902. package/dist/types/components/fluent-ui/table-input/udp-fluent-table-input.d.ts +0 -8
  903. package/dist/types/components/fluent-ui/tablist/udp-fluent-tablist.d.ts +3 -0
  904. package/dist/types/components/forms/udp-question-form/__forms-harness__/fixtures/table-domain.fixtures.d.ts +22 -0
  905. package/dist/types/components/forms/udp-question-form/builder/components/configure-question-drawer.d.ts +2 -1
  906. package/dist/types/components/forms/udp-question-form/builder/components/questionConfig/typeSpecific/DomainTableConfig.d.ts +2 -0
  907. package/dist/types/components/forms/udp-question-form/builder/components/questionConfig/types.d.ts +17 -0
  908. package/dist/types/components/forms/udp-question-form/builder/components/questionConfig/udp-question-config-fluent.d.ts +9 -0
  909. package/dist/types/components/forms/udp-question-form/builder/udp-question-form-builder.d.ts +1 -0
  910. package/dist/types/components/forms/udp-question-form/builder/utils/builder-api.d.ts +37 -0
  911. package/dist/types/components/forms/udp-question-form/core/field-properties-schemas/per-type/table.d.ts +5 -0
  912. package/dist/types/components/forms/udp-question-form/core/field-properties.d.ts +31 -1
  913. package/dist/types/components/forms/udp-question-form/core/validation/intrinsic.d.ts +15 -3
  914. package/dist/types/components/forms/udp-question-form/renderer/runtime/codecs.d.ts +12 -1
  915. package/dist/types/components/forms/udp-question-form/renderer/runtime/domain-table-snapshot.d.ts +20 -0
  916. package/dist/types/components/forms/udp-question-form/renderer/runtime/index.d.ts +1 -0
  917. package/dist/types/components/forms/udp-question-form/renderer/udp-question-form-renderer.d.ts +9 -0
  918. package/dist/types/components/forms/udp-question-form/renderer/ui/form-shell.d.ts +3 -0
  919. package/dist/types/components/forms/udp-question-form/renderer/ui/question-renderer.d.ts +7 -0
  920. package/dist/types/components/grid/new-grid/ag-grid-base.d.ts +3 -1
  921. package/dist/types/components/grid/new-grid/api-method-instance-grid.d.ts +9 -1
  922. package/dist/types/components/grid/new-grid/client-side-grid.d.ts +3 -1
  923. package/dist/types/components/grid/new-grid/datasources/searchMethodDatasource.d.ts +3 -0
  924. package/dist/types/components/grid/new-grid/gridFunctions/advancedSearch.d.ts +6 -3
  925. package/dist/types/components/grid/new-grid/gridFunctions/savedViews.d.ts +1 -0
  926. package/dist/types/components/grid/new-grid/gridFunctions/udpExport.d.ts +6 -0
  927. package/dist/types/components/grid/new-grid/helperFunctions/buildSearchObject.d.ts +13 -3
  928. package/dist/types/components/grid/new-grid/helperFunctions/domainRowsHelper.d.ts +60 -0
  929. package/dist/types/components/grid/new-grid/helperFunctions/extraFieldsHelper.d.ts +49 -0
  930. package/dist/types/components/grid/new-grid/helperFunctions/lookupHelper.d.ts +57 -0
  931. package/dist/types/components/grid/new-grid/helperFunctions/savedViewsHelpers.d.ts +2 -0
  932. package/dist/types/components/grid/new-grid/search-method-grid.d.ts +35 -1
  933. package/dist/types/components/grid/new-grid/server-side-grid.d.ts +27 -1
  934. package/dist/types/components/grid/renderers/actions-renderer.d.ts +15 -0
  935. package/dist/types/components/grid/renderers/input-renderer.d.ts +36 -0
  936. package/dist/types/components/import/udp-import-sheet/udp-import-sheet.d.ts +85 -0
  937. package/dist/types/components.d.ts +411 -12
  938. package/dist/types/icons/fluent-icons.d.ts +1 -1
  939. package/dist/types/index.d.ts +3 -0
  940. package/dist/types/store/execution-store.d.ts +4 -5
  941. package/dist/types/udp-utilities/api-config/configService.d.ts +0 -2
  942. package/dist/types/udp-utilities/extra-fields/extraFields.d.ts +105 -0
  943. package/dist/types/udp-utilities/extra-fields/index.d.ts +1 -0
  944. package/dist/types/udp-utilities/search/searchObject.d.ts +2 -0
  945. package/package.json +3 -3
  946. package/dist/cjs/lookupHelper-ClpMWN_g.js +0 -101
  947. package/dist/cjs/searchObjectHelper-DYpPEIzz.js +0 -110
  948. package/dist/cjs/slot-index-Dzl7Zum5.js +0 -77
  949. package/dist/cjs/udp-fluent-number-input.cjs.entry.js +0 -146
  950. package/dist/esm/lookupHelper-CSo9DNLr.js +0 -96
  951. package/dist/esm/searchObjectHelper-BjA6OHxg.js +0 -107
  952. package/dist/esm/slot-index-aYrr8BJl.js +0 -74
  953. package/dist/esm/udp-fluent-number-input.entry.js +0 -144
  954. package/dist/stencil-library/ag-grid-base_65.entry.js +0 -1
  955. package/dist/stencil-library/apiMethodInstance-BunReWfq.js +0 -1
  956. package/dist/stencil-library/apiUtils-Cq-WuEqc.js +0 -1
  957. package/dist/stencil-library/codecs-CI_fHfY1.js +0 -1
  958. package/dist/stencil-library/configService-D_9j963S.js +0 -1
  959. package/dist/stencil-library/configureUdpColumnMods-UWccWlH6.js +0 -1
  960. package/dist/stencil-library/createAzureMapsProviders-CLLCmr8f.js +0 -1
  961. package/dist/stencil-library/fluent-icons-pWFJyrRm.js +0 -1
  962. package/dist/stencil-library/load-icons-BHSNRRRA.js +0 -1
  963. package/dist/stencil-library/lookupHelper-CSo9DNLr.js +0 -1
  964. package/dist/stencil-library/searchObjectHelper-BjA6OHxg.js +0 -1
  965. package/dist/stencil-library/slot-index-aYrr8BJl.js +0 -1
  966. package/dist/stencil-library/status-renderer-BoY7sar9.js +0 -1
  967. package/dist/stencil-library/udp-detail-list_9.entry.js +0 -1
  968. package/dist/stencil-library/udp-fluent-number-input.entry.js +0 -1
@@ -1 +1 @@
1
- import{h as t,p as e,H as n,c as i,d as o,t as l}from"./index2.js";import{d as r}from"./udp-drive-utils.js";import{m as s}from"./makeApiCall.js";import{g as u}from"./tenantUtils.js";import{C as a}from"./configService.js";import{F as d,i as c,a as m}from"./types.js";import{f as p}from"./form-registry.js";import{v4 as f}from"uuid";import{i as h,c as v,a as b,g}from"./getCachedAzureMapsProviders.js";import{g as y,s as w,d as x}from"./udp-question-tally-adapter2.js";import{d as S}from"./ag-grid-base2.js";import{d as k}from"./client-side-grid2.js";import{d as _}from"./form-metadata-display2.js";import{d as j}from"./ghost-render2.js";import{d as O}from"./grid-header2.js";import{d as I}from"./hint-panel2.js";import{d as q}from"./stencil-icon-button2.js";import{d as F}from"./tally.js";import{d as C}from"./udp-ambient-tool-tip2.js";import{d as E}from"./udp-avatar2.js";import{d as D}from"./udp-badge2.js";import{d as N}from"./udp-button2.js";import{d as $}from"./udp-container2.js";import{d as U}from"./udp-container-query2.js";import{d as A}from"./udp-date-input2.js";import{d as L}from"./udp-date-range-selector2.js";import{d as V}from"./udp-date-time-input2.js";import{d as T}from"./udp-detail-list2.js";import{d as P}from"./udp-detail-list-item2.js";import{d as R}from"./udp-dialog2.js";import{d as B}from"./udp-empty-state2.js";import{d as z}from"./udp-export-sheet2.js";import{d as M}from"./udp-field2.js";import{d as Q}from"./udp-flexbox2.js";import{d as H}from"./udp-fluent-avatar2.js";import{d as X}from"./udp-fluent-badge2.js";import{d as K}from"./udp-fluent-button2.js";import{d as G}from"./udp-fluent-card2.js";import{d as J}from"./udp-fluent-checkbox2.js";import{d as W}from"./udp-fluent-dialog2.js";import{d as Y}from"./udp-fluent-drawer2.js";import{d as Z}from"./udp-fluent-dropdown2.js";import{d as tt}from"./udp-fluent-file-input2.js";import{d as et}from"./udp-fluent-icon2.js";import{d as nt}from"./udp-fluent-icon-button2.js";import{d as it}from"./udp-fluent-image2.js";import{d as ot}from"./udp-fluent-list-input2.js";import{d as lt}from"./udp-list-item2.js";import{d as rt}from"./udp-fluent-location-input2.js";import{d as st}from"./udp-fluent-menu2.js";import{d as ut}from"./udp-fluent-radio-group2.js";import{d as at}from"./udp-fluent-signature-input2.js";import{d as dt}from"./udp-fluent-switch2.js";import{d as ct}from"./udp-fluent-table-input2.js";import{d as mt}from"./udp-fluent-text-input2.js";import{d as pt}from"./udp-form-component2.js";import{d as ft}from"./udp-icon2.js";import{d as ht}from"./udp-linear-loader2.js";import{d as vt}from"./udp-list2.js";import{d as bt}from"./list-item.js";import{d as gt}from"./udp-menu-item2.js";import{d as yt}from"./udp-message-bar2.js";import{d as wt}from"./udp-pop-over2.js";import{d as xt}from"./udp-popover2.js";import{d as St}from"./udp-primary-action-header2.js";import{d as kt}from"./udp-progress-bar2.js";import{d as _t}from"./udp-search-input2.js";import{d as jt}from"./udp-side-sheet2.js";import{d as Ot}from"./udp-spinner2.js";import{d as It}from"./udp-text2.js";import{d as qt}from"./udp-textarea2.js";import{d as Ft}from"./udp-time-input2.js";import{d as Ct}from"./udp-tooltip2.js";import{d as Et}from"./unity-typography2.js";function Dt(t){const e=t.fieldProperties;return Array.isArray(e.items)?e.items:Array.isArray(t.lookupItems)?t.lookupItems:[]}var Nt;class $t extends Error{constructor(t,e){super(t),this.questionId=e,this.name="FormParseError"}}function Ut(t){var e,n;const i={id:t.id,version:t.version,type:t.type,isPrivate:t.isPrivate,isActive:t.isActive,name:t.name,description:null!==(e=t.description)&&void 0!==e?e:null,tenantId:t.tenantId,styleOverrides:Vt(t.styleOverrides),createdOn:t.createdOn},o=t.udpFormUdpFormSection.map(At).sort(((t,e)=>t.order-e.order)),l=new Map;for(const e of t.formQuestions){const t=Lt(e);if(null==t.formSectionId)continue;const i=null!==(n=l.get(t.formSectionId))&&void 0!==n?n:[];i.push(t),l.set(t.formSectionId,i)}for(const t of l.values())t.sort(((t,e)=>t.questionOrder-e.questionOrder));const r=o.map((t=>{var e;return Object.assign(Object.assign({},t),{questions:null!==(e=l.get(t.id))&&void 0!==e?e:[]})}));return{form:i,sections:r}}function At(t){var e,n,i;return{id:t.id,formId:t.formId,formVersion:t.formVersion,title:null!==(e=t.title)&&void 0!==e?e:null,sectionText:null!==(n=t.sectionText)&&void 0!==n?n:null,order:t.order,sectionProperties:Tt(t.sectionProperties),name:t.name,referenceCode:null!==(i=t.referenceCode)&&void 0!==i?i:null}}function Lt(t){var e,n,i;if(!Object.prototype.hasOwnProperty.call(d,String(t.fieldTypeId)))throw new $t(`Question ${t.id}: unknown fieldTypeId ${t.fieldTypeId}. The schema may be from a newer form version than this renderer supports.`,t.id);const o=t.fieldProperties;if(null!=o&&("object"!=typeof o||Array.isArray(o)))throw new $t(`Question ${t.id}: fieldProperties must be an object, got ${Array.isArray(o)?"array":typeof o}.`,t.id);const{fieldProperties:l,lookupItems:r}=function(t){const e=t.lookupId;if(!("string"==typeof e&&e.length>0&&Array.isArray(t.items)))return{fieldProperties:t};const{items:n}=t;return{fieldProperties:function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(n[i[o]]=t[i[o]])}return n}(t,["items"]),lookupItems:n}}(null!=o?o:{});return Object.assign({id:t.id,formId:t.formId,formVersion:t.formVersion,formSectionId:null!==(e=t.formSectionId)&&void 0!==e?e:null,name:t.name,questionText:t.questionText,fieldTypeId:t.fieldTypeId,fieldProperties:l,helperText:null!==(n=t.helperText)&&void 0!==n?n:null,questionOrder:t.questionOrder,required:t.required,referenceCode:null!==(i=t.referenceCode)&&void 0!==i?i:null},r?{lookupItems:r}:{})}function Vt(t){if(!t)return null;try{return JSON.parse(t)}catch(e){return console.warn("[udp-question-form] Failed to parse form.styleOverrides JSON; defaulting to null.",{raw:t,err:e}),null}}function Tt(t){if(!t)return{};try{return JSON.parse(t)}catch(e){return console.warn("[udp-question-form] Failed to parse section.sectionProperties JSON; defaulting to {}.",{raw:t,err:e}),{}}}function Pt(t,e,n){var i,o;if(c(t.fieldTypeId))return[];const l=[],r=h(e);for(const o of v(t.fieldTypeId)){if(r&&!o.runOnEmpty)continue;const s=o.check(e,t,n);s&&l.push({ruleType:o.ruleType,message:s.message,severity:null!==(i=s.severity)&&void 0!==i?i:"error"})}for(const i of b(t.fieldTypeId)){const s=i.readParams(t);if(null===s)continue;if(r&&!i.runOnEmpty)continue;const u=i.check(e,s,t,n);u&&l.push({ruleType:i.ruleType,message:u.message,severity:null!==(o=u.severity)&&void 0!==o?o:"error"})}return l}async function Rt(){try{const t=u();return function(t){if(Array.isArray(t))return t;if(t&&"object"==typeof t){if("pageList"in t&&Array.isArray(t.pageList))return t.pageList;if("data"in t){const e=t.data;if(Array.isArray(e))return e;if(e&&"object"==typeof e&&"pageList"in e){const t=e.pageList;if(Array.isArray(t))return t}}}return[]}(await s("POST",`${a.productV1ApiUrl}/UdpFormLatestVersionView/search`,{eagerLoad:!1,pageNumber:1,pageSize:200,filterElements:[{searchField:"type",searchOperator:"=",searchValue:m.FollowUp},{searchField:"tenantId",searchOperator:"=",searchValue:t}],orderElements:[{sortColumn:"name",sortDirection:"ASC"}]})).filter((t=>"string"==typeof(null==t?void 0:t.id)&&t.id.length>0)).map((t=>{var e;return{value:t.id,label:(null===(e=t.name)||void 0===e?void 0:e.trim())||"(untitled form)"}}))}catch(t){return[]}}function Bt(t){if(!(t instanceof File))return null;const e=t.driveFileId;return"string"==typeof e&&e.length>0?e:null}function zt(t,e){return t.legacyValueToken=e,t}function Mt(t){const e=null==t?void 0:t.legacyValueToken;return"string"==typeof e&&e.length>0?e:null}!function(t){t[t.InProgress=1]="InProgress",t[t.Submitted=2]="Submitted",t[t.Created=3]="Created"}(Nt||(Nt={}));const Qt={decode:()=>null,encode:()=>""},Ht={decode:t=>null==t||""===t?null:t,encode:t=>null!=t?t:""},Xt={decode:t=>{if(null==t||""===t)return null;const e=Number(t);return Number.isFinite(e)?e:null},encode:t=>null==t?"":String(t)},Kt={decode:t=>null==t||""===t?null:t.split(",").map((t=>t.trim())).filter((t=>t.length>0)),encode:t=>null==t||0===t.length?"":t.join(",")};function Gt(t){var e,n,i,o,l,r,s;const u=null!==(e=t.address)&&void 0!==e?e:"";return u.length>0||null!=t.streetNumber||null!=t.streetName||null!=t.municipality||null!=t.countrySubdivisionName||null!=t.postalCode||null!=t.country?{freeformAddress:u,streetNumber:null!==(n=t.streetNumber)&&void 0!==n?n:void 0,streetName:null!==(i=t.streetName)&&void 0!==i?i:void 0,municipality:null!==(o=t.municipality)&&void 0!==o?o:void 0,countrySubdivisionName:null!==(l=t.countrySubdivisionName)&&void 0!==l?l:void 0,postalCode:null!==(r=t.postalCode)&&void 0!==r?r:void 0,country:null!==(s=t.country)&&void 0!==s?s:void 0}:null}const Jt={decode:t=>{var e,n,i;if(null==t||""===t)return null;let o;try{o=JSON.parse(t)}catch(e){return zt({latitude:null,longitude:null,address:null,timestamp:null},t)}return{latitude:null!==(e=o.latitude)&&void 0!==e?e:null,longitude:null!==(n=o.longitude)&&void 0!==n?n:null,address:Gt(o),timestamp:null!==(i=o.timestamp)&&void 0!==i?i:null}},encode:t=>{var e,n,i,o,l,r,s,u,a,d,c;if(null==t)return"";const m=Mt(t);if(null!=m)return m;if(null==t.latitude&&null==t.longitude&&!t.address)return"";const p={latitude:null!==(e=t.latitude)&&void 0!==e?e:null,longitude:null!==(n=t.longitude)&&void 0!==n?n:null,address:null!==(o=null===(i=t.address)||void 0===i?void 0:i.freeformAddress)&&void 0!==o?o:null,streetNumber:null===(l=t.address)||void 0===l?void 0:l.streetNumber,streetName:null===(r=t.address)||void 0===r?void 0:r.streetName,municipality:null===(s=t.address)||void 0===s?void 0:s.municipality,countrySubdivisionName:null===(u=t.address)||void 0===u?void 0:u.countrySubdivisionName,postalCode:null===(a=t.address)||void 0===a?void 0:a.postalCode,country:null===(d=t.address)||void 0===d?void 0:d.country,timestamp:null!==(c=t.timestamp)&&void 0!==c?c:null};return JSON.stringify(p)}},Wt={decode:t=>{if(null==t||""===t)return null;const e=t.split(",").map((t=>t.trim())).filter((t=>t.length>0));if(0===e.length)return null;const n=[];for(const t of e){const e=Yt(t);e&&n.push(e)}return n.length>0?n:null},encode:t=>null==t||0===t.length?"":t.map((t=>"pending"===t.kind?encodeURIComponent(t.file.name):`${encodeURIComponent(t.name)}|udp:${t.driveFileId}`)).join(",")};function Yt(t){const e=t.indexOf("|");if(e<0){let e=t;try{e=decodeURIComponent(t)}catch(t){}return{kind:"stored",name:e,driveFileId:""}}const n=t.slice(0,e),i=t.slice(e+1);let o=n;try{o=decodeURIComponent(n)}catch(t){o=n}return i.startsWith("udp:")?{kind:"stored",name:o,driveFileId:i.slice(4)}:i.startsWith("b64:")?{kind:"stored",name:o,driveFileId:""}:null}const Zt={decode:t=>{if(null==t||""===t)return null;const e=function(t){const e=t.indexOf("|");let n=t,i="";if(e>=0){n=t.slice(0,e);const o=t.slice(e+1);o.startsWith("udp:")&&(i=o.slice(4))}let o=n;try{o=decodeURIComponent(n)}catch(t){o=n}const l=new Blob([""],{type:"image/png"}),r=new File([l],o,{type:"image/png"});return i&&(r.driveFileId=i),r}(t);return{file:e,fullName:null,metadata:null}},encode:t=>{if(null==t)return"";if(!(t.file instanceof File))return"";const e=Bt(t.file);return e?`${encodeURIComponent(t.file.name)}|udp:${e}`:encodeURIComponent(t.file.name)}},te={decode:t=>{var e;if(null==t||""===t)return{rows:[]};let n;try{n=JSON.parse(t)}catch(t){return{rows:[]}}const i=null!==(e=null==n?void 0:n.rows)&&void 0!==e?e:null==n?void 0:n.Rows;return Array.isArray(i)?{rows:i.filter((t=>null!=t&&"object"==typeof t&&!Array.isArray(t)))}:{rows:[]}},encode:t=>t&&Array.isArray(t.rows)&&0!==t.rows.length?JSON.stringify({rows:t.rows}):""},ee={[d.Hidden]:Ht,[d.Paragraph]:Qt,[d.Tally]:Qt,[d.FormMetadataDisplay]:Qt,[d.SingleLineText]:Ht,[d.MultiLineText]:Ht,[d.RadioButton]:Ht,[d.DropdownSingleSelect]:Ht,[d.YesNo]:{decode:t=>"true"===t||"false"===t||"na"===t?t:null,encode:t=>null==t?"":"boolean"==typeof t?t?"true":"false":"true"===t||"false"===t||"na"===t?t:""},[d.Checkbox]:Kt,[d.DropdownMultipleSelect]:Kt,[d.ListMultiSelect]:Kt,[d.Number]:Xt,[d.DateSelector]:Ht,[d.TimeSelector]:Ht,[d.DateTimeSelector]:Ht,[d.Location]:Jt,[d.FileUpload]:Wt,[d.ImageUpload]:Wt,[d.Signature]:Zt,[d.Table]:te};function ne(t,e){const n=ee[t];return n?n.decode(e):null}function ie(t,e){const n=ee[t];return n?n.encode(e):""}function oe(t,e,n){var i,o,l,r,s,u,a,c,m;if(t===d.Signature){const t=null!==(i=null==n?void 0:n.signature)&&void 0!==i?i:null,d=null!=e?e:null;return t||d?{file:null!==(o=null==d?void 0:d.file)&&void 0!==o?o:null,fullName:null!==(r=null!==(l=null==t?void 0:t.fullName)&&void 0!==l?l:null==d?void 0:d.fullName)&&void 0!==r?r:null,metadata:null!=t?{timestamp:null!==(s=t.timestamp)&&void 0!==s?s:null,latitude:null!==(u=t.latitude)&&void 0!==u?u:null,longitude:null!==(a=t.longitude)&&void 0!==a?a:null}:null!==(c=null==d?void 0:d.metadata)&&void 0!==c?c:null}:null}return t===d.Location?function(t,e){var n,i,o;if(t&&(null!=t.latitude||null!=t.longitude||null!=t.address))return t;if(!e)return t;const l={latitude:null!==(n=e.latitude)&&void 0!==n?n:null,longitude:null!==(i=e.longitude)&&void 0!==i?i:null,address:Gt(e),timestamp:null!==(o=e.timestamp)&&void 0!==o?o:null},r=Mt(t);return null!=r?zt(l,r):l}(e,null!==(m=null==n?void 0:n.location)&&void 0!==m?m:null):e}function le(t){const e=[];for(const{fieldTypeId:n,value:i}of t)switch(n){case d.FileUpload:case d.ImageUpload:if(!Array.isArray(i))break;for(const t of i)"pending"===(null==t?void 0:t.kind)&&t.file instanceof File&&e.push(t.file);break;case d.Signature:{const t=i;(null==t?void 0:t.file)instanceof File&&null==Bt(t.file)&&e.push(t.file);break}}return e}function re(t,e,n){var i,o,l,r,s;if(t===d.Signature){const t=(null==e?void 0:e.file)instanceof File,u=null!==(i=null==e?void 0:e.fullName)&&void 0!==i?i:null,a=null!==(o=null==e?void 0:e.metadata)&&void 0!==o?o:null;return t||null!=u&&""!==u||null!=a?Object.assign(Object.assign({},null!=n&&"object"==typeof n?n:{}),{signature:{latitude:null!==(l=null==a?void 0:a.latitude)&&void 0!==l?l:null,longitude:null!==(r=null==a?void 0:a.longitude)&&void 0!==r?r:null,timestamp:null!==(s=null==a?void 0:a.timestamp)&&void 0!==s?s:null,fullName:u}}):n}return t===d.Location?function(t,e){var n,i,o,l,r,s,u,a,d,c,m,p,f,h,v,b,g;if(null!=Mt(t))return e;const y=null!=e&&"object"==typeof e?e:{};return null==t||null==t.latitude&&null==t.longitude&&null==t.address?null==y.location?e:Object.assign(Object.assign({},y),{location:null}):Object.assign(Object.assign({},y),{location:{latitude:null!==(n=t.latitude)&&void 0!==n?n:null,longitude:null!==(i=t.longitude)&&void 0!==i?i:null,timestamp:null!==(o=t.timestamp)&&void 0!==o?o:null,address:null!==(r=null===(l=t.address)||void 0===l?void 0:l.freeformAddress)&&void 0!==r?r:null,streetNumber:null!==(u=null===(s=t.address)||void 0===s?void 0:s.streetNumber)&&void 0!==u?u:null,streetName:null!==(d=null===(a=t.address)||void 0===a?void 0:a.streetName)&&void 0!==d?d:null,municipality:null!==(m=null===(c=t.address)||void 0===c?void 0:c.municipality)&&void 0!==m?m:null,countrySubdivisionName:null!==(f=null===(p=t.address)||void 0===p?void 0:p.countrySubdivisionName)&&void 0!==f?f:null,country:null!==(v=null===(h=t.address)||void 0===h?void 0:h.country)&&void 0!==v?v:null,postalCode:null!==(g=null===(b=t.address)||void 0===b?void 0:b.postalCode)&&void 0!==g?g:null}})}(e,n):n}function se(t,e){var n,i,o,l,r,s,u,a,d,c,m,p,f,h,v;const b=y(e),g={},x=null!==(i=null===(n=t.data)||void 0===n?void 0:n.submissionResponseData)&&void 0!==i?i:{};for(const[t,e]of Object.entries(x)){const n={};for(const[i,o]of Object.entries(e)){let e=b.byExact(t,i);if(!e){const n=w(t);n!==t&&(e=b.byExact(n,i))}n[i]=ue(o,null==e?void 0:e.fieldTypeId)}g[t]=n}const S={metadata:de(null!==(l=null===(o=t.data)||void 0===o?void 0:o.submissionMetadata)&&void 0!==l?l:null),responses:g,templateOverrides:ce(null!==(s=null===(r=t.data)||void 0===r?void 0:r.formTemplateOverrides)&&void 0!==s?s:null)};return{id:t.id,formId:t.formId,formVersion:t.formVersion,status:t.status,unityUserId:null!==(u=t.unityUserId)&&void 0!==u?u:null,userDisplayName:null!==(a=t.userDisplayName)&&void 0!==a?a:null,userEmail:null!==(d=t.userEmail)&&void 0!==d?d:null,initialCreatedOn:t.initialCreatedOn,lastModifiedOn:t.lastModifiedOn,submittedOn:null!==(c=t.submittedOn)&&void 0!==c?c:null,dueDate:null!==(m=t.dueDate)&&void 0!==m?m:null,generic1:null!==(p=t.generic1)&&void 0!==p?p:null,generic2:null!==(f=t.generic2)&&void 0!==f?f:null,generic3:null!==(h=t.generic3)&&void 0!==h?h:null,data:S,wireResponseData:null!==(v=x)&&void 0!==v?v:{}}}function ue(t,e){var n,i;const o=function(t){var e,n,i,o,l;return null==t?null:{signature:null!==(e=t.signature)&&void 0!==e?e:null,location:null!==(n=t.location)&&void 0!==n?n:null,image:null!==(i=t.image)&&void 0!==i?i:null,file:null!==(o=t.file)&&void 0!==o?o:null,followUpFormSubmissionId:null!==(l=t.followUpFormSubmissionId)&&void 0!==l?l:null}}(null!==(n=t.metadata)&&void 0!==n?n:null),l=null==e?null:ne(e,t.value);return{value:null==e?null:oe(e,l,o),comments:(null!==(i=t.comments)&&void 0!==i?i:[]).map(ae),metadata:o}}function ae(t){var e,n,i,o;return{commentId:t.commentId,userDisplayName:null!==(e=t.userDisplayName)&&void 0!==e?e:null,userId:t.userId,timestamp:t.timestamp,editedTimestamp:null!==(n=t.editedTimestamp)&&void 0!==n?n:null,isDeleted:null!==(i=t.isDeleted)&&void 0!==i?i:null,value:null!==(o=t.value)&&void 0!==o?o:null}}function de(t){return null==t?null:t.parentSubmission?{parentSubmission:{submissionId:t.parentSubmission.submissionId,formId:t.parentSubmission.formId,formVersion:t.parentSubmission.formVersion}}:{}}function ce(t){var e,n;return null==t?null:{formName:null!==(e=t.formName)&&void 0!==e?e:null,formDescription:null!==(n=t.formDescription)&&void 0!==n?n:null}}function me(t){const{loadedForm:e,submission:n,urlContext:i}=t,o=[];for(const t of e.sections){const e=he(t.name,n,i);for(let n=1;n<=e;n++)o.push(pe(t,n))}return o}function pe(t,e){const n=1===e,i=f();return{schemaSection:t,instanceId:i,suffix:e,isOriginal:n,slotName:n?t.name:`${t.name}_${e}`,questions:t.questions.map((t=>({schemaQuestion:t,fieldKey:fe(t.id,i,n)})))}}function fe(t,e,n){return n?t:`${t}__${e}`}function he(t,e,n){var i;let o=1;if(null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.responses)for(const n of Object.keys(e.data.responses)){const e=be(n,t);null!=e&&e>o&&(o=e)}if(n){const e=ve.length;for(const i of Object.keys(n)){const n=i.toLowerCase();if(!n.startsWith(ve))continue;const l=n.slice(e),r=l.indexOf(".");if(r<=0)continue;const s=be(l.slice(0,r),t.toLowerCase());null!=s&&s>o&&(o=s)}}return o}const ve="seed_";function be(t,e){if(t===e)return 1;const n=`${e}_`;if(!t.startsWith(n))return null;const i=t.slice(n.length),o=Number(i);return!Number.isInteger(o)||o<2?null:o}function ge(t,e,n){const i=e.toLowerCase(),o=n.toLowerCase();for(const e of t)if(e.slotName.toLowerCase()===i)for(const t of e.questions)if(t.schemaQuestion.name.toLowerCase()===o)return{section:e,question:t};return null}function ye(t){if(t.fieldTypeId===d.Location){const e=t.fieldProperties;if(e.defaultLocation)return ne(d.Location,e.defaultLocation)}return null}function we(t,e){var n,i,o,l;const r={},s=null!==(i=null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.responses)&&void 0!==i?i:{};for(const e of t){const t=null!==(o=s[e.slotName])&&void 0!==o?o:null;for(const n of e.questions){const e=null===(l=null==t?void 0:t[n.schemaQuestion.name])||void 0===l?void 0:l.value;r[n.fieldKey]=void 0!==e?e:ye(n.schemaQuestion)}}return r}function xe(t,e=[]){const n=new FormData;n.append("FormId",String(t.FormId)),n.append("FormVersion",String(t.FormVersion)),n.append("Status",String(t.Status)),n.append("InitialCreatedOn",t.InitialCreatedOn),n.append("LastModifiedOn",t.LastModifiedOn),t.Id&&n.append("Id",String(t.Id)),t.submittedOn&&n.append("submittedOn",t.submittedOn),t.generic1&&n.append("generic1",t.generic1),t.generic2&&n.append("generic2",t.generic2),t.generic3&&n.append("generic3",t.generic3),n.append("Data",JSON.stringify(t.Data));for(const t of e)n.append("FormFiles",t);return n}async function Se(t){var e,n;if(t.isPublicMode){if(!t.tenantId)throw new Error("submitSubmission: public mode requires a tenantId.");if(t.status!==Nt.Submitted)throw new Error("submitSubmission: public mode is single-shot — only `SubmissionStatus.Submitted` is allowed.")}const i=null!==(e=t.dynamicSections)&&void 0!==e?e:me({loadedForm:t.loadedForm,submission:t.current}),o=xe(function(t){var e,n,i,o,l,r,s;const{loadedForm:u,values:a,current:c,status:m,generic:p,commentsByQuestionId:f}=t,h=null!==(e=t.dynamicSections)&&void 0!==e?e:me({loadedForm:u,submission:c}),v=(new Date).toISOString(),b=function(t,e,n,i){var o,l,r,s;const u={},a=null!==(o=null==n?void 0:n.wireResponseData)&&void 0!==o?o:{};for(const n of t){const t={},o=a[n.slotName];for(const u of n.questions){const n=u.schemaQuestion,a=null==o?void 0:o[n.name],c=void 0!==ee[n.fieldTypeId],m=e[u.fieldKey];let p;p=n.fieldTypeId===d.Paragraph?null!==(l=n.fieldProperties.paragraphText)&&void 0!==l?l:"string"==typeof(null==a?void 0:a.value)?a.value:"":c?ie(n.fieldTypeId,m):null!==(r=null==a?void 0:a.value)&&void 0!==r?r:"";const f=c?re(n.fieldTypeId,m,null==a?void 0:a.metadata):null==a?void 0:a.metadata,h={value:null!=p?p:"",comments:i&&u.fieldKey in i?i[u.fieldKey]:null!==(s=null==a?void 0:a.comments)&&void 0!==s?s:[]};null!=f&&(h.metadata=f),t[n.name]=h}u[n.slotName]=t}return u}(h,a,c,f),g={FormId:u.form.id,FormVersion:u.form.version,Status:m,InitialCreatedOn:null!==(n=null==c?void 0:c.initialCreatedOn)&&void 0!==n?n:v,LastModifiedOn:v,Data:{submissionResponseData:b,submissionMetadata:null!==(i=null==c?void 0:c.data.metadata)&&void 0!==i?i:null,formTemplateOverrides:void 0!==t.templateOverrides?t.templateOverrides:null!==(o=null==c?void 0:c.data.templateOverrides)&&void 0!==o?o:null}};(null==c?void 0:c.id)&&(g.Id=c.id),(null==c?void 0:c.submittedOn)&&(g.submittedOn=c.submittedOn);const y=null!==(l=null==p?void 0:p.generic1)&&void 0!==l?l:null==c?void 0:c.generic1,w=null!==(r=null==p?void 0:p.generic2)&&void 0!==r?r:null==c?void 0:c.generic2,x=null!==(s=null==p?void 0:p.generic3)&&void 0!==s?s:null==c?void 0:c.generic3;return y&&(g.generic1=y),w&&(g.generic2=w),x&&(g.generic3=x),g}({loadedForm:t.loadedForm,dynamicSections:i,values:t.values,current:t.current,status:t.status,generic:t.generic,templateOverrides:t.templateOverrides,commentsByQuestionId:t.commentsByQuestionId}),t.dynamicSections?le(i.flatMap((e=>e.questions.map((e=>({fieldTypeId:e.schemaQuestion.fieldTypeId,value:t.values[e.fieldKey]})))))):function(t,e){const n=[];for(const i of t.sections)for(const t of i.questions)n.push({fieldTypeId:t.fieldTypeId,value:e[t.id]});return le(n)}(t.loadedForm,t.values)),{method:l,url:r}=function(t){var e,n;const i=`${a.productV1ApiUrl}/UdpFormSubmission`;return t.isPublicMode?{method:"POST",url:`${i}/public?tenantId=${encodeURIComponent(String(null!==(e=t.tenantId)&&void 0!==e?e:""))}`}:(null===(n=t.current)||void 0===n?void 0:n.id)?{method:"PUT",url:`${i}/private`}:{method:"POST",url:`${i}/private`}}(t),u=await s(l,r,o,!0);if(""===u||null==u){if(!(null===(n=t.current)||void 0===n?void 0:n.id))throw new Error("Submit returned no body but there is no submission id to refetch.");return await async function(t,e){const n=`${a.productV1ApiUrl}/UdpFormSubmission/${t}/Full`;return se(await s("GET",n),e)}(t.current.id,t.loadedForm)}return se(u,t.loadedForm)}function ke(t,e){var n,i,o,l,r,s;const u={},a={},d={},c=null!==(n=null==e?void 0:e.wireResponseData)&&void 0!==n?n:{},m=null!==(o=null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.responses)&&void 0!==o?o:{};for(const e of t){const t=m[e.slotName],n=c[e.slotName];for(const i of e.questions){const e=i.fieldKey,o=i.schemaQuestion.name;u[e]=(null!==(r=null===(l=null==t?void 0:t[o])||void 0===l?void 0:l.comments)&&void 0!==r?r:[]).map((t=>Object.assign({},t)));const c=null==n?void 0:n[o],m=(c&&Array.isArray(c.draftComments)?c.draftComments:[]).find((t=>t&&"string"==typeof t.value));a[e]=null!==(s=null==m?void 0:m.value)&&void 0!==s?s:null,d[e]=null}}return{byQuestionId:u,draftByQuestionId:a,editingCommentIdByQuestionId:d}}function _e(t){return(null!=t?t:[]).filter((t=>!0!==t.isDeleted))}function je(t,e,n,i=null){return Object.assign(Object.assign({},t),{draftByQuestionId:Object.assign(Object.assign({},t.draftByQuestionId),{[e]:n}),editingCommentIdByQuestionId:Object.assign(Object.assign({},t.editingCommentIdByQuestionId),{[e]:null==n?null:i})})}function Oe(t,e,n,i){var o;const l=(null!==(o=t.byQuestionId[e])&&void 0!==o?o:[]).map((t=>t.commentId===n?Object.assign(Object.assign({},t),i):t));return Object.assign(Object.assign({},t),{byQuestionId:Object.assign(Object.assign({},t.byQuestionId),{[e]:l})})}function Ie(t,e){const n=Array.isArray(t)?t:me({loadedForm:t,submission:null});for(const t of n)for(const n of t.questions)if(n.fieldKey===e)return{sectionKey:t.slotName,questionKey:n.schemaQuestion.name,question:n.schemaQuestion};return null}function qe(t){const e=t.fieldProperties;return!0===(null==e?void 0:e.allowComments)}const Fe=new WeakMap;function Ce(t){return`${a.productV1ApiUrl}/UdpFormSubmission/${t.submissionId}/comments`}function Ee(t){const e=t.fieldProperties;return!0===(null==e?void 0:e.allowFollowUpForms)}function De(t,e,n,i){var o,l;const r=Object.assign({},t),s=Object.assign({},null!==(o=r[e])&&void 0!==o?o:{}),u=null!==(l=s[n])&&void 0!==l?l:{value:null},a=null!=u.metadata&&"object"==typeof u.metadata?u.metadata:{};return s[n]=Object.assign(Object.assign({},u),{metadata:Object.assign(Object.assign({},a),i)}),r[e]=s,r}function Ne(t){const{currentPathname:e,parentFormId:n,childFormId:i,childSubmissionId:o}=t;let l=e;return e.includes(String(n))?l=e.replace(String(n),String(i)):console.warn("[udp-question-form] follow-up URL: parent form id not found in path; the new tab may load the wrong form. Path:",e),`${l}?udpf_submissionId=${encodeURIComponent(String(o))}`}function $e(t,e){let n=0,i=0;for(const o of t)for(const t of o.questions)c(t.schemaQuestion.fieldTypeId)||(i+=1,h(e[t.fieldKey])||(n+=1));return{answered:n,total:i}}const Ue=["#264f78","#0078d4","#107c10","#bf4080","#8764b8","#ca5010","#005b70","#d83b01"];function Ae(t){const e=(null!=t?t:"").trim();if(0===e.length)return"#707070";let n=0;for(let t=0;t<e.length;t++)n=31*n+e.charCodeAt(t)|0;return Ue[Math.abs(n)%Ue.length]}function Le(t,e){return n=>{var i;const o=null!==(i=n.detail)&&void 0!==i?i:"";e(t,o)}}function Ve(e){const{question:n,fieldKey:i,comments:o,draft:l,currentUserId:r,isReadOnly:s,hideHeader:u,onOpenDraft:a,onChangeDraft:d,onSaveDraft:c,onCancelDraft:m,onEdit:p,onDelete:f}=e,h=_e(o),v=null!==l,b=v&&null!=l&&l.trim().length>0;return t("section",{class:"comment-thread","data-question-thread":i},!u&&t("header",{class:"comment-thread__header"},t("udp-text",{variant:"caption1Strong",class:"comment-thread__label"},n.questionText||"Untitled question")),0===h.length&&!v&&t("udp-text",{variant:"caption2",class:"comment-thread__empty"},"No comments yet."),t("div",{class:"comment-thread__items"},h.map((e=>function(e){var n,i,o;const{comment:l,currentUserId:r,onEdit:s,onDelete:u}=e,a=null!=r&&l.userId===r,d=l.editedTimestamp&&l.timestamp&&l.editedTimestamp!==l.timestamp,c=null!==(n=l.userDisplayName)&&void 0!==n?n:"Unknown user",m=null!==(i=l.userId)&&void 0!==i?i:c;return t("div",{class:"comment-item",key:l.commentId},t("span",{class:"comment-item__avatar",style:{backgroundColor:Ae(m)},"aria-hidden":"true"},function(t){const e=(null!=t?t:"").trim();return 0===e.length?"?":e[0].toUpperCase()}(c)),t("div",{class:"comment-item__header"},t("udp-text",{variant:"caption1Strong"},c),t("udp-text",{variant:"caption2",class:"comment-item__timestamp"},function(t){if(!t)return"";try{return new Date(t).toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch(e){return t}}(l.timestamp),d?" · edited":""),a&&t("div",{class:"comment-item__actions"},t("udp-fluent-icon-button",{appearance:"transparent",size:"small",iconName:"edit",ariaLabel:"Edit comment",onClick:()=>s(l.commentId)}),t("udp-fluent-icon-button",{appearance:"transparent",size:"small",iconName:"delete",ariaLabel:"Delete comment",onClick:()=>u(l.commentId)}))),t("udp-text",{variant:"body2",class:"comment-item__body"},null!==(o=l.value)&&void 0!==o?o:""))}({comment:e,currentUserId:r,onEdit:t=>p(i,t),onDelete:t=>f(i,t)})))),v&&t("div",{class:"comment-thread__draft",onKeyDown:t=>{"Escape"===t.key&&(t.stopPropagation(),m(i))}},t("udp-textarea",{placeholder:"Add a comment",value:null!=l?l:"",autoResize:!0,required:!1,disabled:s,onValueChanged:Le(i,d)}),t("div",{class:"comment-thread__draft-actions"},t("udp-fluent-button",{appearance:"transparent",size:"small",onClick:()=>m(i)},"Cancel"),t("udp-fluent-button",{appearance:"primary",size:"small",disabled:!b,onClick:()=>c(i)},"Save"))),!v&&!s&&t("udp-fluent-button",{class:"comment-thread__compose-placeholder",appearance:"subtle",size:"small",startIconName:"add",onClick:t=>{t.stopPropagation(),a(i)}},"Add a comment"))}const Te=t=>r({driveFileId:t.driveFileId,name:t.name,extension:t.extension});function Pe(t,e){var n;if(null==e||""===e)return"";const i=t.find((t=>t.value===e));return null!==(n=null==i?void 0:i.display)&&void 0!==n?n:String(e)}function Re(t,e){const n=t.map((t=>({display:t.display||String(t.value),selected:e.includes(t.value)})));for(const i of e)"string"==typeof i&&""!==i&&(t.some((t=>t.value===i))||n.push({display:i,selected:!0}));return n}function Be(e,n){return t("div",{class:"question-view__options",role:"list"},e.map((e=>t("div",{class:{"question-view__option":!0,"question-view__option--selected":e.selected},role:"listitem"},t("udp-fluent-icon",{class:"question-view__option-mark",name:"single"===n?"radio-button":e.selected?"checkbox-checked":"checkbox-unchecked",variant:e.selected?"filled":"regular",size:"sm"}),t("udp-text",{variant:"body1"},e.display)))))}function ze(t){if("string"!=typeof t||""===t)return"";const e=new Date(t);return Number.isNaN(e.getTime())?t:e.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function Me(e){return t("udp-text",{variant:"body1"},""===e?"—":e)}function Qe(t){var e;const n=null!==(e=t.maxDate)&&void 0!==e?e:void 0;if(!0!==t.noFutureDate)return n;const i=(new Date).toISOString().slice(0,10);return n&&n<i?n:i}function He(t){if(t)return t.length>5?t.slice(0,5):t}const Xe=[{label:"Yes",value:"true"},{label:"No",value:"false"},{label:"Not Applicable",value:"na"}];function Ke(t,e){return!0===e.formReadOnly||!0===t.readOnly}function Ge(t,e){return Ke(t,e)||!0===e.previewMode}function Je(e,n,i,o){return null==o?null:t("div",Object.assign({key:n},function(t,e,n){return{"data-question-id":t.id,"data-field-key":e,class:n.highlightedQuestionId===t.id?"question-card question-card--highlighted":"question-card"}}(e,n,i)),function(e,n,i){const o=function(e,n,i){if(!i.commentsAdapter)return null;if(!qe(e))return null;const o=i.commentsAdapter.getCount(n),l=o>0;return t("udp-fluent-button",{appearance:"transparent",size:"small",startIconName:"comment","aria-label":`Comments on ${e.questionText||"this question"}${l?` (${o})`:""}`,onClick:t=>{var e;t.stopPropagation(),null===(e=i.commentsAdapter)||void 0===e||e.onToggle(n)}},l?`Comments (${o})`:"Add comment")}(e,n,i),l=function(e,n,i){if(!i.followUpFormsAdapter)return null;if(!Ee(e))return null;const o=null!=i.followUpFormsAdapter.getStampedChildId(n);return t("div",{class:"question-card__follow-up-toggle"},t("udp-fluent-icon-button",{iconName:"link",iconVariant:o?"filled":"regular",size:"small",appearance:"transparent",ariaLabel:o?`Linked follow-up form for ${e.questionText||"this question"}`:`Link a follow-up form to ${e.questionText||"this question"}`,onClick:t=>{var e;t.stopPropagation(),null===(e=i.followUpFormsAdapter)||void 0===e||e.onLaunch(n)}}))}(e,n,i);return o||l?t("div",{class:"question-card__toggles"},l,o):null}(e,n,i),o,function(e,n,i){var o,l,r;const s=i.comments;if(!s)return null;if(!qe(e))return null;if(!(null===(o=i.commentsAdapter)||void 0===o?void 0:o.isExpanded(n)))return null;const u=null!==(l=s.state.byQuestionId[n])&&void 0!==l?l:[],a=null!==(r=s.state.draftByQuestionId[n])&&void 0!==r?r:null;return t("div",{class:"question-card__inline-comments"},Ve({question:e,fieldKey:n,comments:u,draft:a,currentUserId:s.currentUserId,isReadOnly:!0===i.formReadOnly||!0===i.previewMode,hideHeader:!0,onOpenDraft:s.handlers.onOpenDraft,onChangeDraft:s.handlers.onChangeDraft,onSaveDraft:s.handlers.onSaveDraft,onCancelDraft:s.handlers.onCancelDraft,onEdit:s.handlers.onEdit,onDelete:s.handlers.onDelete}))}(e,n,i))}function We(e){var n,i,o,l,r,s,u,a,c,m,p,f,h,v,b,y,w,x,S,k,_,j,O,I,q,F,C,E,D,N;const{question:$,context:U}=e,A=null!==(n=e.fieldKey)&&void 0!==n?n:$.id,L=A;if(!0===U.formReadOnly)return function(e){var n,i,o,l,r,s,u,a,c,m,p,f,h,v,b,y;const{question:w,context:x,fieldKey:S,value:k}=e,_=null!==(n=w.questionText)&&void 0!==n?n:"",j=w.required&&_?`${_} *`:_,O=function(e,n,i){var o,l,r;const s=i.comments;if(!s)return null;if(!qe(e))return null;const u=null!==(o=s.state.byQuestionId[n])&&void 0!==o?o:[],a=null!==(l=s.state.draftByQuestionId[n])&&void 0!==l?l:null,d=null!==(r=i.commentsAdapter)&&void 0!==r?r:null,c=_e(u).length,m=d?t("udp-fluent-button",{class:"question-view__comment-toggle",appearance:"transparent",size:"small",startIconName:"comment","aria-label":`Comments on ${e.questionText||"this question"}${c>0?` (${c})`:""}`,onClick:t=>{t.stopPropagation(),d.onToggle(n)}},c>0?`Comments (${c})`:"Add comment"):null,p=d?d.isExpanded(n):c>0||null!=a;return m||p?t("div",{class:"question-view__inline-comments"},m,p&&Ve({question:e,fieldKey:n,comments:u,draft:a,currentUserId:s.currentUserId,isReadOnly:!0===i.previewMode,hideHeader:!0,onOpenDraft:s.handlers.onOpenDraft,onChangeDraft:s.handlers.onChangeDraft,onSaveDraft:s.handlers.onSaveDraft,onCancelDraft:s.handlers.onCancelDraft,onEdit:s.handlers.onEdit,onDelete:s.handlers.onDelete})):null}(w,S,x);let I;switch(w.fieldTypeId){case d.Hidden:return null;case d.Paragraph:{const e=w.fieldProperties;I=e.paragraphText?t("udp-text",{variant:"body1"},e.paragraphText):null;break}case d.FormMetadataDisplay:{const e=w.fieldProperties,n=x.submission,u=x.currentUser,a=null!==(o=null!==(i=null==n?void 0:n.userDisplayName)&&void 0!==i?i:null==u?void 0:u.displayName)&&void 0!==o?o:"",d=null!==(r=null!==(l=null==n?void 0:n.userEmail)&&void 0!==l?l:null==u?void 0:u.email)&&void 0!==r?r:"",c=null!==(s=null==n?void 0:n.submittedOn)&&void 0!==s?s:null;I=t("form-metadata-display",{userDisplayName:a,userEmail:d,submittedOn:c,displayOwnerFullName:!0===e.displayOwnerFullName,displayOwnerEmail:!0===e.displayOwnerEmail,displaySubmissionDate:!0===e.displaySubmissionDate});break}case d.Tally:{const e=w.fieldProperties;I=t("udp-question-tally-adapter",{loadedForm:x.loadedForm,questionId:w.id,label:j||"Response Tally",tallyMode:null!==(u=e.tallyMode)&&void 0!==u?u:"all",includeFields:null!==(a=e.includeFields)&&void 0!==a?a:[],excludeFields:null!==(c=e.excludeFields)&&void 0!==c?c:[]});break}case d.SingleLineText:case d.MultiLineText:case d.Number:I=Me(null==k||""===k?"":String(k));break;case d.YesNo:I=Be([{display:"Yes",selected:"true"===k||!0===k},{display:"No",selected:"false"===k||!1===k},{display:"Not Applicable",selected:"na"===k}],"single");break;case d.RadioButton:case d.DropdownSingleSelect:{const t=Dt(w),e=null==k||""===k?[]:[k];I=0===t.length?Me(Pe(t,k)):Be(Re(t,e),"single");break}case d.Checkbox:case d.DropdownMultipleSelect:case d.ListMultiSelect:{const t=Dt(w),e=Array.isArray(k)?k:[];I=0===t.length?Me(e.map((e=>Pe(t,e))).filter(Boolean).join(", ")):Be(Re(t,e),"multi");break}case d.DateSelector:I=Me(function(t){if("string"!=typeof t||""===t)return"";const e=new Date(10===t.length?`${t}T00:00:00`:t);return Number.isNaN(e.getTime())?t:e.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}(k));break;case d.TimeSelector:I=Me(function(t){if("string"!=typeof t||""===t)return"";const[e,n]=t.split(":"),i=Number(e),o=Number(n);if(!Number.isFinite(i)||!Number.isFinite(o))return t;const l=new Date;return l.setHours(i,o,0,0),l.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}(k));break;case d.DateTimeSelector:I=Me(ze(k));break;case d.Location:{const e=w.fieldProperties,n=null!=k?k:null,i=g(),o="string"==typeof e.mapZoom?Number(e.mapZoom):e.mapZoom,l=null!=n&&"number"==typeof n.latitude&&"number"==typeof n.longitude&&!!(null==i?void 0:i.tileUrlTemplate),r=null!==(p=null===(m=null==n?void 0:n.address)||void 0===m?void 0:m.freeformAddress)&&void 0!==p?p:"";I=t("div",{class:"question-view__location"},Me(r),l&&t("udp-fluent-location-input",{value:k,readonly:!0,disabled:!0,showMap:!0,hideAddressSearch:!0,defaultZoom:Number.isFinite(o)?o:void 0,tileUrlTemplate:null==i?void 0:i.tileUrlTemplate,searchAddresses:null==i?void 0:i.searchAddresses,reverseGeocode:null==i?void 0:i.reverseGeocode}));break}case d.FileUpload:I=t("udp-fluent-file-input",{view:"list",value:k,readonly:!0,hideDragAndDrop:!0,hideButton:!0,loadStoredFile:Te});break;case d.ImageUpload:I=t("udp-fluent-file-input",{view:"gallery",accept:"image/*",value:k,readonly:!0,hideDragAndDrop:!0,hideButton:!0,loadStoredFile:Te});break;case d.Signature:{const e=null!=k?k:null,n=null!==(f=null==e?void 0:e.fullName)&&void 0!==f?f:"",i=ze(null!==(v=null===(h=null==e?void 0:e.metadata)||void 0===h?void 0:h.timestamp)&&void 0!==v?v:""),o=null===(b=x.signaturePreviewUrls)||void 0===b?void 0:b[S];I=o?t("div",{class:"question-view__signature"},t("udp-fluent-image",{bordered:!0,fit:"contain"},t("img",{class:"question-view__signature-img",src:o,alt:n?`Signature of ${n}`:"Signature"})),(n||i)&&t("div",{class:"question-view__signature-meta"},n&&t("udp-text",{variant:"body1"},n),i&&t("udp-text",{variant:"caption1"},"Signed ",i))):Me(n);break}case d.Table:{const e=(null!==(y=w.fieldProperties.columns)&&void 0!==y?y:[]).filter((t=>"string"==typeof t.id&&t.id.length>0&&"string"==typeof t.name)).map((t=>({id:t.id,name:t.name,type:"number"===t.type?"number":"text",required:!0===t.required,aggregate:t.aggregate,aggregateDecimalPlaces:t.aggregateDecimalPlaces})));I=t("udp-fluent-table-input",{value:k,readonly:!0,disabled:!0,columns:e});break}default:I=Me(null==k?"":String(k))}return t("udp-detail-list-item",{label:j,emptyState:"hide"},I,O)}({question:$,context:U,fieldKey:A,value:null===(i=U.values)||void 0===i?void 0:i[A]});switch($.fieldTypeId){case d.Hidden:return null;case d.Paragraph:{const e=$.fieldProperties;return Je($,A,U,t("udp-flexbox",{display:"flex",direction:"column",gap:"xs"},$.questionText&&t("udp-text",{variant:"body1Strong"},$.questionText),e.paragraphText&&t("udp-text",{variant:"body1"},e.paragraphText)))}case d.SingleLineText:return Je($,A,U,t("udp-field",{name:L},t("udp-fluent-text-input",{label:$.questionText,hint:null!==(o=$.helperText)&&void 0!==o?o:void 0,required:$.required,disabled:Ke($.fieldProperties,U)})));case d.MultiLineText:return Je($,A,U,t("udp-field",{name:L},t("udp-textarea",{label:$.questionText,hint:null!==(l=$.helperText)&&void 0!==l?l:void 0,required:$.required,disabled:Ke($.fieldProperties,U),autoResize:!0})));case d.Number:return Je($,A,U,t("udp-field",{name:L},t("udp-fluent-text-input",{label:$.questionText,hint:null!==(r=$.helperText)&&void 0!==r?r:void 0,required:$.required,type:"number",disabled:Ke($.fieldProperties,U)})));case d.YesNo:return Je($,A,U,t("udp-field",{name:L},t("udp-fluent-radio-group",{label:$.questionText,hint:null!==(s=$.helperText)&&void 0!==s?s:void 0,items:Xe,disabled:Ke($.fieldProperties,U)})));case d.Checkbox:{const e=$.fieldProperties;return Je($,A,U,t("udp-field",{name:L},t("udp-fluent-list-input",{label:$.questionText,hint:null!==(u=$.helperText)&&void 0!==u?u:void 0,required:$.required,options:Dt($),disabled:Ke(e,U)})))}case d.RadioButton:{const e=$.fieldProperties,n=Dt($).map((t=>({label:t.display,value:t.value})));return Je($,A,U,t("udp-field",{name:L},t("udp-fluent-radio-group",{label:$.questionText,hint:null!==(a=$.helperText)&&void 0!==a?a:void 0,items:n,disabled:Ke(e,U)})))}case d.DropdownSingleSelect:{const e=$.fieldProperties;return Je($,A,U,t("udp-field",{name:L},t("udp-fluent-dropdown",{label:$.questionText,hint:null!==(c=$.helperText)&&void 0!==c?c:void 0,required:$.required,options:Dt($),optionLabel:"display",optionValue:"value",valueAs:"value",disabled:Ke(e,U)})))}case d.DropdownMultipleSelect:{const e=$.fieldProperties;return Je($,A,U,t("udp-field",{name:L},t("udp-fluent-dropdown",{label:$.questionText,hint:null!==(m=$.helperText)&&void 0!==m?m:void 0,required:$.required,options:Dt($),optionLabel:"display",optionValue:"value",multiple:!0,valueAs:"value",disabled:Ke(e,U)})))}case d.ListMultiSelect:{const e=$.fieldProperties;return Je($,A,U,t("udp-field",{name:L},t("udp-fluent-list-input",{label:$.questionText,hint:null!==(p=$.helperText)&&void 0!==p?p:void 0,required:$.required,options:Dt($),disabled:Ke(e,U)})))}case d.DateSelector:{const e=$.fieldProperties;return Je($,A,U,t("udp-field",{name:L},t("udp-date-input",{label:$.questionText,hint:null!==(f=$.helperText)&&void 0!==f?f:void 0,required:$.required,minDate:null!==(h=e.minDate)&&void 0!==h?h:void 0,maxDate:Qe(e),disabled:Ke(e,U)})))}case d.TimeSelector:{const e=$.fieldProperties;return Je($,A,U,t("udp-field",{name:L},t("udp-time-input",{label:$.questionText,hint:null!==(v=$.helperText)&&void 0!==v?v:void 0,required:$.required,min:He(e.minTime),max:He(e.maxTime),disabled:Ke(e,U)})))}case d.DateTimeSelector:{const e=$.fieldProperties;return Je($,A,U,t("udp-field",{name:L},t("udp-date-time-input",{label:$.questionText,hint:null!==(b=$.helperText)&&void 0!==b?b:void 0,required:$.required,minDate:null!==(y=e.minDateTime)&&void 0!==y?y:void 0,maxDate:Qe({maxDate:e.maxDateTime,noFutureDate:e.noFutureDate}),disabled:Ke(e,U)})))}case d.FormMetadataDisplay:{const e=$.fieldProperties,n=U.submission,i=U.currentUser,o=null!==(x=null!==(w=null==n?void 0:n.userDisplayName)&&void 0!==w?w:null==i?void 0:i.displayName)&&void 0!==x?x:"",l=null!==(k=null!==(S=null==n?void 0:n.userEmail)&&void 0!==S?S:null==i?void 0:i.email)&&void 0!==k?k:"",r=null!==(_=null==n?void 0:n.submittedOn)&&void 0!==_?_:null;return Je($,A,U,t("udp-flexbox",{display:"flex",direction:"column",gap:"xs"},$.questionText&&t("udp-text",{variant:"body1Strong"},$.questionText),t("form-metadata-display",{userDisplayName:o,userEmail:l,submittedOn:r,displayOwnerFullName:!0===e.displayOwnerFullName,displayOwnerEmail:!0===e.displayOwnerEmail,displaySubmissionDate:!0===e.displaySubmissionDate})))}case d.Tally:{const e=$.fieldProperties;return Je($,A,U,t("udp-question-tally-adapter",{loadedForm:U.loadedForm,questionId:$.id,label:$.questionText||"Response Tally",tallyMode:null!==(j=e.tallyMode)&&void 0!==j?j:"all",includeFields:null!==(O=e.includeFields)&&void 0!==O?O:[],excludeFields:null!==(I=e.excludeFields)&&void 0!==I?I:[]}))}case d.Location:{const e=$.fieldProperties,n=g(),i="string"==typeof e.mapZoom?Number(e.mapZoom):e.mapZoom;return Je($,A,U,t("udp-field",{name:L},t("udp-fluent-location-input",{label:$.questionText,hint:null!==(q=$.helperText)&&void 0!==q?q:void 0,required:$.required,disabled:Ke(e,U),showMap:!0===e.showMap,hideAddressSearch:!0===e.hideAddressSearch,defaultZoom:Number.isFinite(i)?i:void 0,tileUrlTemplate:null==n?void 0:n.tileUrlTemplate,searchAddresses:null==n?void 0:n.searchAddresses,reverseGeocode:null==n?void 0:n.reverseGeocode})))}case d.FileUpload:{const e=$.fieldProperties;return Je($,A,U,t("udp-field",{name:L},t("udp-fluent-file-input",{view:"list",label:$.questionText,hint:null!==(F=$.helperText)&&void 0!==F?F:void 0,required:$.required,disabled:Ge(e,U),hideDragAndDrop:!0===e.hideDragAndDrop,hideButton:!0===e.hideButton,displayUploadTime:!0===e.displayUploadTime,maxFiles:!0===e.allowMultiple?void 0:1})))}case d.ImageUpload:{const e=$.fieldProperties;return Je($,A,U,t("udp-field",{name:L},t("udp-fluent-file-input",{view:"gallery",accept:"image/*",label:$.questionText,hint:null!==(C=$.helperText)&&void 0!==C?C:void 0,required:$.required,disabled:Ge(e,U),hideDragAndDrop:!0===e.hideDragAndDrop,hideButton:!0===e.hideButton,displayUploadTime:!0===e.displayUploadTime,maxFiles:!0===e.allowMultiple?void 0:1})))}case d.Signature:{const e=$.fieldProperties;return Je($,A,U,t("udp-field",{name:L},t("udp-fluent-signature-input",{label:$.questionText,hint:null!==(E=$.helperText)&&void 0!==E?E:void 0,required:$.required,disabled:Ge(e,U),includeLocation:!0===e.includeLocation})))}case d.Table:{const e=$.fieldProperties,n=(null!==(D=e.columns)&&void 0!==D?D:[]).filter((t=>"string"==typeof t.id&&t.id.length>0&&"string"==typeof t.name)).map((t=>({id:t.id,name:t.name,type:"number"===t.type?"number":"text",required:!0===t.required,aggregate:t.aggregate,aggregateDecimalPlaces:t.aggregateDecimalPlaces})));return Je($,A,U,t("udp-field",{name:L},t("udp-fluent-table-input",{label:$.questionText,hint:null!==(N=$.helperText)&&void 0!==N?N:void 0,required:$.required,disabled:Ke(e,U),columns:n})))}default:return function(e,n,i){return Je(e,n,i,t("udp-flexbox",{display:"flex",direction:"column",gap:"xs"},t("udp-text",{variant:"body1Strong"},e.questionText),t("udp-text",{variant:"caption1",color:"muted"},"FieldType ",e.fieldTypeId," not yet supported in pass 1",e.helperText?` — ${e.helperText}`:"")))}($,A,U)}}function Ye(e){const{isOpen:n,options:i,selectedFormId:o,isLoading:l,isLaunching:r,onSelect:s,onLaunch:u,onClose:a}=e,d=()=>{r||a()};return t("udp-fluent-dialog",{open:n,dialogTitle:"Link a follow-up form",maxHeight:"60vh",onDialogClose:d},function(e,n,i){return i?t("udp-text",{variant:"body1"},"Loading follow-up forms…"):0===e.length?t("udp-text",{variant:"body1"},"No follow-up forms are available for this question."):t("udp-list",{selectionMode:"single",showDivider:!0,selectedItems:n?[n]:[],onListSelectionChange:t=>{t.stopPropagation();const e=t.detail.selectedItems[0];"string"==typeof e&&s(e)}},e.map((e=>t("udp-fluent-list-item",{key:e.value,value:e.value,label:e.label}))))}(i,o,l),t("udp-fluent-button",{slot:"action",appearance:"secondary",disabled:r,onClick:d},"Cancel"),t("udp-fluent-button",{slot:"action",appearance:"primary",disabled:!o||r||l,onClick:()=>u()},r?"Creating…":"Create"))}const Ze="udp-question-form-renderer-form";const tn=e(class extends n{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.submitted=i(this,"submitted",7),this.tenantId=null,this.isPublicMode=!1,this.history=null,this.urlContext={},this.autoSaveDelay=2e3,this.previewMode=!1,this.highlightedQuestionId=null,this.readOnly=!1,this.resolvedForm=null,this.submission=null,this.initialValues={},this.signaturePreviewUrls={},this.isLoading=!0,this.dynamicSections=[],this.publicModeError=null,this.loadError=null,this.currentUser=null,this.templateOverrides=null,this.commentsState={byQuestionId:{},draftByQuestionId:{},editingCommentIdByQuestionId:{}},this.expandedCommentPanels={},this.followUpPickerOpen=!1,this.followUpPickerQuestionId=null,this.followUpPickerSelectedFormId=null,this.followUpFormsList=[],this.followUpFormsListLoaded=!1,this.followUpFormsListLoading=!1,this.followUpLaunching=!1,this.hostResizeObserver=null,this.hostBoundsUpdateListener=null,this.submitInFlight=!1,this.pendingResave=!1,this.prevSubmitFailed=!1,this.formApi=null,this.autosaveTimer=null,this.lastSavedValues=null,this.formComponentEl=null,this.autosaveStatus="idle",this.lastSavedAt=null,this.progress={answered:0,total:0},this.handleFormComponentRef=t=>{this.formComponentEl=t},this.runAutosave=async()=>{if(this.autosaveTimer=null,!this.formApi)return;if(this.submitInFlight)return void(this.pendingResave=!0);const t=this.formApi.getState().values;await this.submitToBackend(t,Nt.InProgress,{rebuildComments:!1,showErrorSnackbar:!1})},this.handleSubmitClick=()=>{this.clearAutosaveTimer()},this.handleSubmit=async t=>{var e;this.clearAutosaveTimer(),this.previewMode?this.notifyPreviewNotSaved("Preview only — submission not saved."):(await this.flushOpenDrafts(),await this.submitToBackend(t,Nt.Submitted,{rebuildComments:!0,showErrorSnackbar:!0})&&(null===(e=this.submission)||void 0===e?void 0:e.id)&&this.submitted.emit(this.submission.id))},this.handleAddSection=t=>{if(!this.resolvedForm||!this.formApi)return;if(this.isReadOnly||this.previewMode)return;let e;try{e=function(t,e){var n;const i=t.filter((t=>t.schemaSection.id===e));if(0===i.length)throw new Error(`duplicateSection: no instances found for schema section ${e}`);const o=i[0].schemaSection;if(!0!==(null===(n=o.sectionProperties)||void 0===n?void 0:n.isRepeatable))throw new Error(`duplicateSection: schema section ${e} is not marked repeatable`);const l=pe(o,Math.max(...i.map((t=>t.suffix)))+1),r=t.lastIndexOf(i[i.length-1]);return{next:[...t.slice(0,r+1),l,...t.slice(r+1)],newInstance:l}}(this.dynamicSections,t)}catch(t){return void console.warn("[udp-question-form-renderer] duplicateSection refused:",t)}const n=we([e.newInstance],null),i=this.formApi;i.batch((()=>{for(const[t,e]of Object.entries(n))i.change(t,e)})),this.dynamicSections=e.next},this.handleDeleteSection=t=>{if(!this.resolvedForm||!this.formApi)return;if(this.isReadOnly||this.previewMode)return;const e=this.dynamicSections.find((e=>e.instanceId===t));if(!e||e.isOriginal)return;const n=e.questions.map((t=>t.fieldKey)),i=this.formApi;i.batch((()=>{for(const t of n)i.change(t,void 0)}));try{this.dynamicSections=function(t,e){const n=t.findIndex((t=>t.instanceId===e));if(n<0)return t;const i=t[n];if(i.isOriginal)throw new Error("deleteSection: refusing to delete the original copy of a section (legacy invariant).");const o=i.schemaSection.id,l=t.filter(((t,e)=>e!==n));let r=2;return l.map((t=>{if(t.schemaSection.id!==o||t.isOriginal)return t;const e=r++;return e===t.suffix?t:Object.assign(Object.assign({},t),{suffix:e,slotName:`${t.schemaSection.name}_${e}`})}))}(this.dynamicSections,t)}catch(t){return void console.warn("[udp-question-form-renderer] deleteSection refused:",t)}this.commentsState=function(t,e){if(0===e.length)return t;const n=new Set(e),i=t=>{const e={};for(const i of Object.keys(t))n.has(i)||(e[i]=t[i]);return e};return{byQuestionId:i(t.byQuestionId),draftByQuestionId:i(t.draftByQuestionId),editingCommentIdByQuestionId:i(t.editingCommentIdByQuestionId)}}(this.commentsState,n)},this.toggleQuestionComments=t=>{var e;const n=!0===this.expandedCommentPanels[t];if(this.expandedCommentPanels=Object.assign(Object.assign({},this.expandedCommentPanels),{[t]:!n}),!n){_e(null!==(e=this.commentsState.byQuestionId[t])&&void 0!==e?e:[]).length>0||null!=this.commentsState.draftByQuestionId[t]||(this.commentsState=je(this.commentsState,t,""))}},this.isCommentsPanelExpanded=t=>!0===this.expandedCommentPanels[t],this.openDraft=t=>{this.commentsState=je(this.commentsState,t,"")},this.changeDraft=(t,e)=>{var n;const i=null!==(n=this.commentsState.editingCommentIdByQuestionId[t])&&void 0!==n?n:null;this.commentsState=je(this.commentsState,t,e,i)},this.cancelDraft=t=>{this.commentsState=je(this.commentsState,t,null)},this.saveDraft=async t=>{var e,n,i,o;if(this.previewMode)return null;const l=this.commentsState.draftByQuestionId[t];if(null==l||0===l.trim().length)return null;if(!this.resolvedForm)return null;const r=null!==(e=this.commentsState.editingCommentIdByQuestionId[t])&&void 0!==e?e:null,u=null===(n=this.submission)||void 0===n?void 0:n.id,a={submissionId:u,isPublicMode:this.isPublicMode},d=Ie(this.dynamicSections,t);if(r){const e=(null!==(i=this.commentsState.byQuestionId[t])&&void 0!==i?i:[]).find((t=>t.commentId===r));if(!e)return this.saveDraftAsNew(t,l);const n=Object.assign(Object.assign({},e),{value:l,editedTimestamp:(new Date).toISOString(),isDeleted:!1}),c=e;if(this.commentsState=Oe(this.commentsState,t,r,n),this.commentsState=je(this.commentsState,t,null),!u||!d)return n;try{return await async function(t,e,n){if(t.isPublicMode)throw new Error("Comment updates are not supported in public mode.");const i=`${Ce(t)}/${e}`;await s("PUT",i,n,!0)}(a,r,{sectionKey:d.sectionKey,questionKey:d.questionKey,value:l}),n}catch(e){return console.error("[udp-question-form-renderer] putComment failed:",e),this.commentsState=Oe(this.commentsState,t,r,c),null===(o=this.enqueueSnackbar)||void 0===o||o.call(this,"Failed to update comment.",{variant:"error"}),null}}return this.saveDraftAsNew(t,l)},this.editComment=(t,e)=>{var n,i;const o=(null!==(n=this.commentsState.byQuestionId[t])&&void 0!==n?n:[]).find((t=>t.commentId===e));o&&(this.commentsState=je(this.commentsState,t,null!==(i=o.value)&&void 0!==i?i:"",e))},this.deleteComment=async(t,e)=>{var n,i,o;if(this.previewMode)return;if(!(null!==(n=this.commentsState.byQuestionId[t])&&void 0!==n?n:[]).find((t=>t.commentId===e)))return;this.commentsState=function(t,e,n){return Oe(t,e,n,{isDeleted:!0,value:"",editedTimestamp:(new Date).toISOString()})}(this.commentsState,t,e);const l=null===(i=this.submission)||void 0===i?void 0:i.id;if(l)try{await async function(t,e){if(t.isPublicMode)throw new Error("Comment deletion is not supported in public mode.");const n=`${Ce(t)}/${e}`;await s("DELETE",n,null,!0)}({submissionId:l,isPublicMode:this.isPublicMode},e)}catch(n){console.error("[udp-question-form-renderer] deleteComment failed:",n),this.commentsState=Oe(this.commentsState,t,e,{isDeleted:!1}),null===(o=this.enqueueSnackbar)||void 0===o||o.call(this,"Failed to delete comment.",{variant:"error"})}},this.getCommentCount=t=>_e(this.commentsState.byQuestionId[t]).length,this.getFollowUpStampedChildId=t=>{var e,n,i,o;if(!this.resolvedForm||!this.submission)return null;const l=Ie(this.dynamicSections,t);if(!l)return null;const r=null===(e=this.submission.data.responses[l.sectionKey])||void 0===e?void 0:e[l.questionKey];return null!==(o=null!==(i=null===(n=null==r?void 0:r.metadata)||void 0===n?void 0:n.followUpFormSubmissionId)&&void 0!==i?i:null)&&void 0!==o?o:null},this.handleLaunchFollowUpForm=async t=>{if(this.isPublicMode)return;if(this.previewMode)return void this.notifyPreviewNotSaved("Preview only — this action is not saved.");const e=this.getFollowUpStampedChildId(t);if(e)await this.openStampedFollowUp(e);else if(this.followUpPickerQuestionId=t,this.followUpPickerSelectedFormId=null,this.followUpPickerOpen=!0,!this.followUpFormsListLoaded&&!this.followUpFormsListLoading){this.followUpFormsListLoading=!0;try{this.followUpFormsList=await Rt(),this.followUpFormsListLoaded=!0}finally{this.followUpFormsListLoading=!1}}},this.handleFollowUpSelect=t=>{this.followUpPickerSelectedFormId=t},this.handleFollowUpClose=()=>{this.followUpLaunching||(this.followUpPickerOpen=!1,this.followUpPickerQuestionId=null,this.followUpPickerSelectedFormId=null)},this.handleFollowUpLaunch=async()=>{var t,e,n,i,o,l,r;if(!this.resolvedForm)return;const u=this.followUpPickerQuestionId,d=this.followUpPickerSelectedFormId;if(u&&d&&!this.followUpLaunching){this.followUpLaunching=!0;try{if(!(null===(t=this.submission)||void 0===t?void 0:t.id)&&(await this.runAutosave(),!(null===(e=this.submission)||void 0===e?void 0:e.id)))return void(null===(n=this.enqueueSnackbar)||void 0===n||n.call(this,"Could not save the form before launching the follow-up. Try again.",{variant:"error"}));const r=this.submission,c=await this.fetchLatestFormVersion(d);if(null==c)return void(null===(i=this.enqueueSnackbar)||void 0===i||i.call(this,"Could not load the selected follow-up form.",{variant:"error"}));const m=await async function(t){const e=`${a.productV1ApiUrl}/UdpForm/${t.childFormId}/describe?formVersion=${t.childFormVersion}`,n=Ut(await s("GET",e)),i=(new Date).toISOString(),o={};for(const t of n.sections){o[t.name]={};for(const e of t.questions)o[t.name][e.name]={value:"",comments:[]}}const l=xe({FormId:t.childFormId,FormVersion:t.childFormVersion,Status:Nt.InProgress,InitialCreatedOn:i,LastModifiedOn:i,Data:{submissionResponseData:o,submissionMetadata:{parentSubmission:{submissionId:t.parentSubmissionId,formId:t.parentFormId,formVersion:t.parentFormVersion}},formTemplateOverrides:null}}),r=`${a.productV1ApiUrl}/UdpFormSubmission/private`;return se(await s("POST",r,l,!0),n)}({childFormId:d,childFormVersion:c,parentSubmissionId:r.id,parentFormId:r.formId,parentFormVersion:r.formVersion}),p=null!==(l=null===(o=this.formApi)||void 0===o?void 0:o.getState().values)&&void 0!==l?l:{},f=await async function(t){const{loadedForm:e,parent:n,dynamicSections:i,values:o,questionId:l,childSubmissionId:r}=t,s=Ie(i||e,l);if(!s)throw new Error(`stampFollowUpOnParent: question ${l} not in schema.`);return Se({loadedForm:e,dynamicSections:i,current:Object.assign(Object.assign({},n),{wireResponseData:De(n.wireResponseData,s.sectionKey,s.questionKey,{followUpFormSubmissionId:r})}),values:o,status:n.status,isPublicMode:!1})}({loadedForm:this.resolvedForm,dynamicSections:this.dynamicSections,parent:r,values:p,questionId:u,childSubmissionId:m.id});if(this.submission=f,"undefined"!=typeof window){const t=Ne({currentPathname:window.location.pathname,parentFormId:r.formId,childFormId:d,childSubmissionId:m.id});window.open(t,"_blank")}this.followUpPickerOpen=!1,this.followUpPickerQuestionId=null,this.followUpPickerSelectedFormId=null}catch(t){console.error("[udp-question-form-renderer] follow-up launch failed:",t),null===(r=this.enqueueSnackbar)||void 0===r||r.call(this,"Could not launch follow-up form.",{variant:"error"})}finally{this.followUpLaunching=!1}}}}async componentWillLoad(){var t;if(this.loadedForm&&(this.resolvedForm=this.loadedForm),this.isPublicMode&&!this.previewMode&&!this.tenantId)return this.publicModeError="Public forms require a tenantId.",void(this.isLoading=!1);const e=this.submissionId&&!this.previewMode&&!this.isPublicMode,n=!!e&&!this.formId&&!this.loadedForm;let i=null;n&&(i=await this.fetchAndLogSubmissionRaw(),(null==i?void 0:i.formId)&&(this.formId=i.formId,this.formVersion=null!==(t=i.formVersion)&&void 0!==t?t:null));const o=!this.loadedForm&&!!this.formId,[l,r]=await Promise.all([o?this.fetchAndLogDescribe():Promise.resolve(null),e&&!n?this.fetchAndLogSubmissionRaw():Promise.resolve(i)]);try{if(l&&(this.resolvedForm=l),r&&this.resolvedForm?this.submission=this.parseAndLogSubmission(r,this.resolvedForm):r&&!this.resolvedForm&&console.warn("[udp-question-form-renderer] cannot parse submission without form schema"),this.isPublicMode&&!this.previewMode&&this.resolvedForm&&!0===this.resolvedForm.form.isPrivate)return this.publicModeError="This form is not available publicly.",this.resolvedForm=null,void(this.isLoading=!1);if(this.resolvedForm){this.dynamicSections=me({loadedForm:this.resolvedForm,submission:this.submission,urlContext:this.previewMode?null:this.urlContext});const t=we(this.dynamicSections,this.submission);this.initialValues=this.previewMode?t:function(t,e,n,i){var o;if(i.hasExistingSubmission)return e;if(!n)return e;const l=function(t){const e=[];for(const n of Object.keys(t)){const i=n.toLowerCase();if(!i.startsWith("seed_"))continue;const o=i.slice(5),l=o.indexOf(".");if(l<=0||l===o.length-1)continue;const r=o.slice(0,l),s=o.slice(l+1),u=t[n];"string"==typeof u&&e.push({sectionSlot:r,questionSlot:s,rawValue:u})}return e}(n);if(0===l.length)return e;const r=null!==(o=i.dynamicSections)&&void 0!==o?o:me({loadedForm:t,submission:null,urlContext:n}),s=Object.assign({},e);for(const{sectionSlot:t,questionSlot:e,rawValue:n}of l){const i=ge(r,t,e);if(!i)continue;if(!h(s[i.question.fieldKey]))continue;const o=ne(i.question.schemaQuestion.fieldTypeId,n);null!=o&&(s[i.question.fieldKey]=o)}return s}(this.resolvedForm,t,this.urlContext,{hasExistingSubmission:null!=this.submission&&this.submission.status!==Nt.Created,dynamicSections:this.dynamicSections}),this.lastSavedValues=this.initialValues,this.commentsState=ke(this.dynamicSections,this.submission);const e={};for(const t of Object.keys(this.commentsState.byQuestionId))_e(this.commentsState.byQuestionId[t]).length>0&&(e[t]=!0);this.expandedCommentPanels=e,this.progress=$e(this.dynamicSections,this.initialValues)}this.currentUser=this.resolveCurrentUser(),this.templateOverrides=this.resolveTemplateOverrides()}catch(t){console.error("[udp-question-form-renderer] failed to initialize form:",t),this.loadError="Could not load this form. Please refresh and try again.",this.resolvedForm=null,this.submission=null,this.dynamicSections=[]}this.isLoading=!1,this.loadSignaturePreviews()}async loadSignaturePreviews(){var t,e,n;if(!this.isReadOnly)return;const i={};for(const o of this.dynamicSections)for(const l of o.questions){if(l.schemaQuestion.fieldTypeId!==d.Signature)continue;const o=this.initialValues[l.fieldKey],s=Bt(null!==(t=null==o?void 0:o.file)&&void 0!==t?t:null);if(s)try{const t=await r({driveFileId:s,name:null!==(n=null===(e=null==o?void 0:o.file)||void 0===e?void 0:e.name)&&void 0!==n?n:"signature.png",extension:"png"});t&&t.size>0&&(i[l.fieldKey]=URL.createObjectURL(t))}catch(t){}}Object.keys(i).length>0&&(this.revokeSignaturePreviews(),this.signaturePreviewUrls=i)}revokeSignaturePreviews(){for(const t of Object.values(this.signaturePreviewUrls))URL.revokeObjectURL(t)}urlContextValue(t){const e=this.urlContext;if(!e||"object"!=typeof e)return null;const n=t.toLowerCase();for(const t of Object.keys(e))if(t.toLowerCase()===n){const n=e[t];if(null==n)return null;if("string"!=typeof n&&"number"!=typeof n&&"boolean"!=typeof n)return null;const i=String(n).trim();return i.length>0?i:null}return null}resolveTemplateOverrides(){var t,e,n,i;const o=null!==(e=null===(t=this.submission)||void 0===t?void 0:t.data.templateOverrides)&&void 0!==e?e:null;if(o&&(o.formName||o.formDescription))return{formName:null!==(n=o.formName)&&void 0!==n?n:null,formDescription:null!==(i=o.formDescription)&&void 0!==i?i:null};if(this.previewMode)return null;const l=this.urlContextValue("override_formname"),r=this.urlContextValue("override_formdescription");return l||r?this.submission&&this.submission.status!==Nt.Created?null:{formName:l,formDescription:r}:null}resolveGenericContext(){const t=this.urlContextValue("generic1"),e=this.urlContextValue("generic2"),n=this.urlContextValue("generic3");if(t||e||n)return{generic1:t,generic2:e,generic3:n}}resolveCurrentUser(){var t,e,n,i;if("function"!=typeof this.getUserCallback)return null;try{const o=this.getUserCallback();return o?{id:null!==(t=o.id)&&void 0!==t?t:null,displayName:null!==(n=null!==(e=o.displayName)&&void 0!==e?e:o.name)&&void 0!==n?n:null,email:null!==(i=o.email)&&void 0!==i?i:null}:null}catch(t){return null}}handleLoadedFormChange(t){t&&(this.resolvedForm=t,this.dynamicSections=me({loadedForm:t,submission:this.submission,urlContext:this.previewMode?null:this.urlContext}),this.initialValues=we(this.dynamicSections,this.submission),this.commentsState=ke(this.dynamicSections,this.submission),this.progress=$e(this.dynamicSections,this.initialValues))}handleHighlightedQuestionIdChange(){this.scrollHighlightedIntoView()}handleGetUserCallbackChange(){this.currentUser=this.resolveCurrentUser()}componentDidLoad(){this.highlightedQuestionId&&this.scrollHighlightedIntoView(),this.installHostBoundsTracker()}installHostBoundsTracker(){if(!this.el)return;const t=()=>{const t=this.el.getBoundingClientRect();this.el.style.setProperty("--udpqf-host-left",`${t.left}px`),this.el.style.setProperty("--udpqf-host-width",`${t.width}px`)};t(),"undefined"!=typeof ResizeObserver&&(this.hostResizeObserver=new ResizeObserver(t),this.hostResizeObserver.observe(this.el)),this.hostBoundsUpdateListener=t,window.addEventListener("resize",this.hostBoundsUpdateListener),window.addEventListener("scroll",this.hostBoundsUpdateListener,{passive:!0,capture:!0})}teardownHostBoundsTracker(){this.hostResizeObserver&&(this.hostResizeObserver.disconnect(),this.hostResizeObserver=null),this.hostBoundsUpdateListener&&(window.removeEventListener("resize",this.hostBoundsUpdateListener),window.removeEventListener("scroll",this.hostBoundsUpdateListener,{capture:!0}),this.hostBoundsUpdateListener=null)}scrollHighlightedIntoView(){const t=this.highlightedQuestionId;t&&requestAnimationFrame((()=>{var e;const n=null===(e=this.el)||void 0===e?void 0:e.shadowRoot;if(!n)return;const i=n.querySelector(`[data-question-id="${t}"]`);null==i||i.scrollIntoView({block:"nearest",behavior:"smooth"})}))}buildDescribeUrl(){const t=a.productV1ApiUrl,e=new URLSearchParams;if(null!=this.formVersion&&e.set("formVersion",String(this.formVersion)),this.isPublicMode){this.tenantId&&e.set("tenantId",String(this.tenantId));const n=e.toString();return`${t}/UdpForm/${this.formId}/describe/public${n?`?${n}`:""}`}const n=e.toString();return`${t}/UdpForm/${this.formId}/describe${n?`?${n}`:""}`}async fetchAndLogDescribe(){const t=this.buildDescribeUrl();try{return Ut(await s("GET",t))}catch(t){return console.error("[udp-question-form-renderer] /describe failed:",t),null}}async fetchAndLogSubmissionRaw(){const t=`${a.productV1ApiUrl}/UdpFormSubmission/${this.submissionId}/Full`;try{return await s("GET",t)}catch(t){return console.error("[udp-question-form-renderer] /UdpFormSubmission failed:",t),null}}parseAndLogSubmission(t,e){return se(t,e)}handleFormReady(t){this.isFromRendererForm(t)&&(this.formApi=t.detail)}isFromRendererForm(t){var e,n;return(null!==(n=null===(e=t.composedPath)||void 0===e?void 0:e.call(t)[0])&&void 0!==n?n:t.target)===this.formComponentEl}get isReadOnly(){var t;return!(!this.readOnly&&(null===(t=this.submission)||void 0===t?void 0:t.status)!==Nt.Submitted)||this.isViewedByNonOwner}get isViewedByNonOwner(){var t,e,n,i;if(this.isPublicMode)return!1;const o=null!==(e=null===(t=this.submission)||void 0===t?void 0:t.unityUserId)&&void 0!==e?e:null,l=null!==(i=null===(n=this.currentUser)||void 0===n?void 0:n.id)&&void 0!==i?i:null;return null!=o&&null!=l&&String(o).toLowerCase()!==String(l).toLowerCase()}clearAutosaveTimer(){null!=this.autosaveTimer&&(clearTimeout(this.autosaveTimer),this.autosaveTimer=null)}async submitToBackend(t,e,n){var i,o,l,r;if(!this.resolvedForm||this.submitInFlight)return!1;if(this.previewMode||this.isReadOnly)return!1;this.submitInFlight=!0,this.autosaveStatus="saving";const s=!(null===(i=this.submission)||void 0===i?void 0:i.id);let u=!1;try{const i=await Se({loadedForm:this.resolvedForm,dynamicSections:this.dynamicSections,current:this.submission,values:t,status:e,isPublicMode:this.isPublicMode,tenantId:this.tenantId,generic:this.resolveGenericContext(),templateOverrides:null!==(o=this.templateOverrides)&&void 0!==o?o:void 0,commentsByQuestionId:this.commentsState.byQuestionId});return this.submission=i,this.lastSavedValues=t,n.rebuildComments&&(this.commentsState=ke(this.dynamicSections,i)),e===Nt.Submitted&&(this.initialValues=we(this.dynamicSections,i),this.loadSignaturePreviews()),s&&i.id&&(null===(l=this.el)||void 0===l?void 0:l.isConnected)&&function(t,e){if("undefined"==typeof window)return;const n=`${window.location.pathname}?udpf_submissionId=${t}${window.location.hash}`;if(e){if(function(t){return"object"==typeof t&&null!==t&&"replace"in t&&"function"==typeof t.replace}(e))return void e.replace(n);if(function(t){return"object"==typeof t&&null!==t&&"push"in t&&"function"==typeof t.push}(e))return void e.push(n);if("function"==typeof e){try{e(n,{replace:!0})}catch(t){console.debug("[udp-question-form] history(url, opts) threw; retrying with (url) only.",t);try{e(n)}catch(t){console.warn("[udp-question-form] host history callable rejected both signatures; using native window.history.replaceState as a fallback.",t)}}return}}window.history.replaceState({},"",n)}(i.id,this.history),this.lastSavedAt=new Date,this.autosaveStatus="saved",u=!0,!0}catch(t){return console.error("[udp-question-form-renderer] submit failed:",t),this.autosaveStatus="error",n.showErrorSnackbar&&(null===(r=this.enqueueSnackbar)||void 0===r||r.call(this,"There was an error submitting this form.",{variant:"error"})),!1}finally{this.submitInFlight=!1;const t=this.pendingResave;this.pendingResave=!1,(u||t)&&this.resaveIfStale()}}resaveIfStale(){this.formApi&&null!=this.lastSavedValues&&(en(this.formApi.getState().values,this.lastSavedValues)||this.runAutosave())}getValidator(){if(this.resolvedForm&&0!==this.dynamicSections.length)return this.cachedValidatorFor!==this.dynamicSections&&(this.cachedValidator=function(t){const e=Array.isArray(t)?t:me({loadedForm:t,submission:null});return t=>{const n=function(t={}){return Object.assign({now:()=>new Date,resolveLookupOptions:()=>null,allValues:{}},t)}({allValues:t});return function(t,e){const n=[],i=[],o={};for(const l of t){const t=Pt(l.question,l.value,e);for(const e of t){const t={fieldKey:l.fieldKey,questionId:l.question.id,sectionName:l.sectionName,questionName:l.question.name,questionText:l.question.questionText,ruleType:e.ruleType,message:e.message,severity:e.severity};"warning"===e.severity?i.push(t):(n.push(t),null==o[l.fieldKey]&&(o[l.fieldKey]=e.message))}}return{ok:0===n.length,errors:n,warnings:i,errorsByFieldKey:o}}(function(t,e){const n=[];for(const i of t)for(const t of i.questions)n.push({fieldKey:t.fieldKey,sectionName:i.slotName,question:t.schemaQuestion,value:e[t.fieldKey]});return n}(e,t),n).errorsByFieldKey}}(this.dynamicSections),this.cachedValidatorFor=this.dynamicSections),this.cachedValidator}notifyPreviewNotSaved(t){var e;null===(e=this.enqueueSnackbar)||void 0===e||e.call(this,t,{variant:"info"})}handleFormStateUpdated(t){var e,n;if(!this.isFromRendererForm(t))return;const i=t.detail;if(i.submitFailed&&!this.prevSubmitFailed){const t=Object.keys(null!==(e=i.errors)&&void 0!==e?e:{}).length;null===(n=this.enqueueSnackbar)||void 0===n||n.call(this,`Please fix ${t} issue${1===t?"":"s"} before submitting.`,{variant:"error"}),this.scrollToFirstError(i.errors)}this.prevSubmitFailed=i.submitFailed,this.progress=$e(this.dynamicSections,i.values),this.maybeScheduleAutosave(i)}scrollToFirstError(t){if(!t||0===Object.keys(t).length)return;const e=function(t,e){for(const n of t)for(const t of n.questions)if(e[t.fieldKey])return t.fieldKey;return null}(this.dynamicSections,t);e&&requestAnimationFrame((()=>{var t;const n=null===(t=this.el)||void 0===t?void 0:t.shadowRoot;if(!n)return;const i=n.querySelector(`[data-field-key="${e}"]`);i&&(i.scrollIntoView({block:"center",behavior:"smooth"}),function(t){const e=t.querySelector("udp-field"),n=null==e?void 0:e.firstElementChild;if(n&&"function"==typeof n.focus)return void n.focus({preventScroll:!0});const i=t.querySelector('input, textarea, select, [tabindex]:not([tabindex="-1"])');null==i||i.focus({preventScroll:!0})}(i))}))}maybeScheduleAutosave(t){if(this.previewMode||this.isReadOnly)return;if(this.isPublicMode)return;if(t.submitting)return;if(null==this.lastSavedValues)return;if(en(t.values,this.lastSavedValues))return void this.clearAutosaveTimer();if(!this.resolvedForm||!this.formApi)return;const e=Math.max(0,this.autoSaveDelay);this.clearAutosaveTimer(),this.autosaveTimer=setTimeout((()=>{this.runAutosave()}),e)}disconnectedCallback(){queueMicrotask((()=>{var t;if(null===(t=this.el)||void 0===t?void 0:t.isConnected)return;const e=null!=this.autosaveTimer;this.clearAutosaveTimer(),e&&this.runAutosave(),this.teardownHostBoundsTracker(),this.revokeSignaturePreviews()}))}async saveDraftAsNew(t,e){var n,i,o,l,r,u,a;if(this.previewMode)return null;if(!this.resolvedForm)return null;const d=function(t,e){var n,i;const o=(new Date).toISOString();return{commentId:f(),userDisplayName:null!==(n=e.displayName)&&void 0!==n?n:null,userId:null!==(i=e.id)&&void 0!==i?i:null,timestamp:o,editedTimestamp:o,isDeleted:!1,value:null!=t?t:""}}(e,{id:null!==(i=null===(n=this.currentUser)||void 0===n?void 0:n.id)&&void 0!==i?i:null,displayName:null!==(l=null===(o=this.currentUser)||void 0===o?void 0:o.displayName)&&void 0!==l?l:null});this.commentsState=function(t,e,n){var i;const o=null!==(i=t.byQuestionId[e])&&void 0!==i?i:[];return Object.assign(Object.assign({},t),{byQuestionId:Object.assign(Object.assign({},t.byQuestionId),{[e]:[...o,n]}),draftByQuestionId:Object.assign(Object.assign({},t.draftByQuestionId),{[e]:null}),editingCommentIdByQuestionId:Object.assign(Object.assign({},t.editingCommentIdByQuestionId),{[e]:null})})}(this.commentsState,t,d);const c=null===(r=this.submission)||void 0===r?void 0:r.id;if(!c)return d;const m=Ie(this.dynamicSections,t);if(!m)return d;try{return await async function(t,e){const n=function(t,e){if(!e.isPublicMode||!e.tenantId)return t;const[n,i=""]=t.split("?",2),o=new URLSearchParams(i);return o.set("tenantId",String(e.tenantId)),`${n}?${o.toString()}`}(`${Ce(t)}/${t.isPublicMode?"public":"private"}`,t);await s("POST",n,e,!0)}({submissionId:c,isPublicMode:this.isPublicMode,tenantId:this.tenantId},{sectionKey:m.sectionKey,questionKey:m.questionKey,value:null!==(u=d.value)&&void 0!==u?u:"",commentId:d.commentId}),d}catch(e){return console.error("[udp-question-form-renderer] postComment failed:",e),this.commentsState=Oe(this.commentsState,t,d.commentId,{isDeleted:!0}),null===(a=this.enqueueSnackbar)||void 0===a||a.call(this,"Failed to save comment.",{variant:"error"}),null}}async flushOpenDrafts(){const t=Object.entries(this.commentsState.draftByQuestionId);for(const[e,n]of t)null!=n&&(0!==n.trim().length?await this.saveDraft(e):this.commentsState=je(this.commentsState,e,null))}getFollowUpOptionsForQuestion(t){if(!t||!this.resolvedForm)return this.followUpFormsList;const e=Ie(this.dynamicSections,t);if(!e)return this.followUpFormsList;const n=function(t){const e=t.fieldProperties;return Array.isArray(null==e?void 0:e.followUpFormIds)?e.followUpFormIds.map((t=>{if("string"==typeof t)return t;if(t&&"object"==typeof t){if("string"==typeof t.value)return t.value;if("string"==typeof t.id)return t.id}return""})).filter((t=>t.length>0)):[]}(e.question);if(0===n.length)return this.followUpFormsList;const i=new Set(n.map(String));return this.followUpFormsList.filter((t=>i.has(t.value)))}async openStampedFollowUp(t){var e,n;try{const n=`${a.productV1ApiUrl}/UdpFormSubmission/${t}/Full`,i=await s("GET",n);if(!(null==i?void 0:i.formId))return void(null===(e=this.enqueueSnackbar)||void 0===e||e.call(this,"Could not open the linked follow-up form.",{variant:"error"}));if("undefined"!=typeof window&&this.submission){const e=Ne({currentPathname:window.location.pathname,parentFormId:this.submission.formId,childFormId:i.formId,childSubmissionId:t});window.open(e,"_blank")}}catch(t){console.error("[udp-question-form-renderer] open follow-up failed:",t),null===(n=this.enqueueSnackbar)||void 0===n||n.call(this,"Could not open the linked follow-up form.",{variant:"error"})}}async fetchLatestFormVersion(t){var e;try{const n=`${a.productV1ApiUrl}/UdpForm/${t}/describe`,i=await s("GET",n);return null!==(e=null==i?void 0:i.version)&&void 0!==e?e:null}catch(t){return null}}render(){var e;if(this.isLoading)return t(o,null,t("udp-container",{"max-width":"md"},t("udp-text",{variant:"body1"},"Loading form…")));if(this.publicModeError)return t(o,null,t("udp-container",{"max-width":"md"},t("udp-text",{variant:"body1"},this.publicModeError)));if(this.loadError)return t(o,null,t("udp-container",{"max-width":"md"},t("udp-text",{variant:"body1"},this.loadError)));if(!this.resolvedForm)return t(o,null,t("udp-container",{"max-width":"md"},t("udp-text",{variant:"body1"},"No form to render. Pass ",t("code",null,"udpf_formId")," and ",t("code",null,"udpf_formVersion")," ","in the URL.")));const n=!this.isPublicMode&&function(t){for(const e of t.sections)for(const t of e.questions)if(Ee(t))return!0;return!1}(this.resolvedForm)?{adapter:{onLaunch:this.handleLaunchFollowUpForm,getStampedChildId:this.getFollowUpStampedChildId},dialog:{isOpen:this.followUpPickerOpen,options:this.getFollowUpOptionsForQuestion(this.followUpPickerQuestionId),selectedFormId:this.followUpPickerSelectedFormId,isLoading:this.followUpFormsListLoading,isLaunching:this.followUpLaunching,onSelect:this.handleFollowUpSelect,onLaunch:()=>{this.handleFollowUpLaunch()},onClose:this.handleFollowUpClose}}:null,i=function(t){const e=Fe.get(t);if(e)return e;const n=[];for(const e of t.sections)for(const t of e.questions)qe(t)&&n.push({section:e,question:t});return Fe.set(t,n),n}(this.resolvedForm).length>0?{state:this.commentsState,adapter:{getCount:this.getCommentCount,isExpanded:this.isCommentsPanelExpanded,onToggle:this.toggleQuestionComments},handlers:{onOpenDraft:this.openDraft,onChangeDraft:this.changeDraft,onSaveDraft:t=>{this.saveDraft(t)},onCancelDraft:this.cancelDraft,onEdit:this.editComment,onDelete:(t,e)=>{this.deleteComment(t,e)}}}:null;return t(o,null,function(e){var n,i,o,l,r,s,u;const{loadedForm:a,templateOverrides:d,initialValues:c,onSubmit:m,validate:f,onFormComponentRef:h,submission:v,currentUser:b,highlightedQuestionId:g,formReadOnly:y,previewMode:w,signaturePreviewUrls:x,autosaveStatus:S="idle",lastSavedAt:k=null,progress:_,onSubmitClick:j,comments:O,followUpForms:I,onAddSection:q,onDeleteSection:F}=e,C=null!==(n=e.dynamicSections)&&void 0!==n?n:me({loadedForm:a,submission:v}),E={loadedForm:a,submission:v,currentUser:b,highlightedQuestionId:null!=g?g:null,formReadOnly:!0===y,previewMode:!0===w,values:!0===y?c:void 0,signaturePreviewUrls:x,commentsAdapter:null!==(i=null==O?void 0:O.adapter)&&void 0!==i?i:null,comments:O?{state:O.state,currentUserId:null!==(o=null==b?void 0:b.id)&&void 0!==o?o:null,handlers:O.handlers}:null,followUpFormsAdapter:null!==(l=null==I?void 0:I.adapter)&&void 0!==l?l:null},D=(null!==(r=null==d?void 0:d.formName)&&void 0!==r?r:"").trim()||a.form.name,N=(null!==(s=null==d?void 0:d.formDescription)&&void 0!==s?s:"").trim()||a.form.description,$=a.form.styleOverrides,U={};(null===(u=null==$?void 0:$.background)||void 0===u?void 0:u.backgroundColor)&&(U.backgroundColor=$.background.backgroundColor);const A={};return(null==$?void 0:$.headerBackgroundColor)&&(A.backgroundColor=$.headerBackgroundColor),t("div",{class:"renderer-layout",style:U},t("div",{class:"renderer-layout__form"},t("udp-form-component",{ref:h,formId:Ze,initialValues:c,submitHandler:m,validate:f,deriveFieldValidators:!1,errorDisplay:"submitFailed"},t("udp-flexbox",{display:"flex",direction:"column",wrap:"nowrap",gap:"lg"},D&&t("udp-fluent-card",{appearance:"filled",class:"form-title-card",style:A},t("udp-flexbox",{display:"flex",direction:"column",gap:"sm",class:"form-title-card__content"},t("udp-text",{variant:"title2"},D),N&&t("udp-text",{variant:"body1"},N))),C.map(((e,n)=>{const i=C[n+1];return function(e){var n,i;const{section:o,context:l,isLastInGroup:r,onAddSection:s,onDeleteSection:u}=e,a=o.schemaSection,d=!0===(null===(n=a.sectionProperties)||void 0===n?void 0:n.isRepeatable),c=d&&!0===r&&null!=s&&!0!==l.formReadOnly&&!0!==l.previewMode,m=d&&!o.isOriginal&&null!=u&&!0!==l.formReadOnly&&!0!==l.previewMode;return t("udp-fluent-card",{key:o.instanceId,appearance:"filled"},t("udp-flexbox",{slot:"header",display:"flex",direction:"row",align:"center",gap:"sm"},t("udp-flexbox",{display:"flex",direction:"column",gap:"xs",grow:"1"},a.title&&t("udp-flexbox",{display:"flex",direction:"row",gap:"xs",align:"center"},t("udp-text",{variant:"subtitle1"},a.title),!o.isOriginal&&t("udp-fluent-badge",{appearance:"outline",color:"subtle",size:"small"},"Copy ",o.suffix)),a.sectionText&&t("udp-text",{variant:"body2"},a.sectionText)),m&&t("udp-tooltip",{content:"Delete this copy",positioning:"below"},t("udp-fluent-icon-button",{iconName:"delete",size:"small",appearance:"subtle",ariaLabel:`Delete copy ${o.suffix} of ${null!==(i=a.title)&&void 0!==i?i:"section"}`,onClick:()=>null==u?void 0:u(o.instanceId)}))),!0===l.formReadOnly?t("udp-detail-list",{layout:"stack",dividers:"row",density:"default"},o.questions.map((t=>We({question:t.schemaQuestion,context:l,fieldKey:t.fieldKey})))):t("udp-flexbox",{display:"flex",direction:"column",wrap:"nowrap",gap:"md"},o.questions.map((t=>We({question:t.schemaQuestion,context:l,fieldKey:t.fieldKey})))),c&&t("udp-flexbox",{slot:"footer",display:"flex",direction:"row",justify:"flex-start"},t("udp-fluent-button",{appearance:"subtle",startIconName:"add",onClick:()=>null==s?void 0:s(a.id)},"Repeat Section")))}({section:e,context:E,isLastInGroup:!i||i.schemaSection.id!==e.schemaSection.id,onAddSection:q,onDeleteSection:F})})))),!y&&function(e){var n,i;const{progress:o,autosaveStatus:l,lastSavedAt:r,onSubmitClick:s}=e,u=null!==(n=null==o?void 0:o.answered)&&void 0!==n?n:0,a=null!==(i=null==o?void 0:o.total)&&void 0!==i?i:0,d=a>0?a:1,c=a>0&&u===a?"success":"info";return t("div",{class:"form-footer"},t("div",{class:"form-footer__inner"},t("div",{class:"form-footer__progress"},t("udp-text",{variant:"caption1",class:"form-footer__progress-label"},u," of ",a," answered"),t("udp-progress-bar",{class:"form-footer__progress-bar",thickness:"medium",shape:"rounded",validationState:c,value:u,min:0,max:d})),t("div",{class:"form-footer__actions"},function(e,n){return"saving"===e?t("udp-text",{variant:"caption1"},"Saving…"):"error"===e?t("udp-text",{variant:"caption1"},"Save failed — will retry on next change."):"saved"===e&&n?t("udp-text",{variant:"caption1"},"Saved at ",(i=n,`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}`)):t("span",null);var i}(l,r),t("udp-fluent-button",{appearance:"primary",onClick:s},"Submit"))))}({progress:_,autosaveStatus:S,lastSavedAt:k,onSubmitClick:()=>{var t;null==j||j(),null===(t=p.get(Ze))||void 0===t||t.requestSubmit()}}),y&&t("div",{class:"form-footer form-footer--read-only"},t("div",{class:"form-footer__inner"},function(e){return t("udp-text",{variant:"caption1"},(null==e?void 0:e.status)===Nt.Submitted?"Submitted — read-only.":"Read-only.")}(v)))),I&&Ye({isOpen:I.dialog.isOpen,options:I.dialog.options,selectedFormId:I.dialog.selectedFormId,isLoading:I.dialog.isLoading,isLaunching:I.dialog.isLaunching,onSelect:I.dialog.onSelect,onLaunch:I.dialog.onLaunch,onClose:I.dialog.onClose}))}({loadedForm:this.resolvedForm,templateOverrides:this.templateOverrides,dynamicSections:this.dynamicSections,initialValues:this.initialValues,onSubmit:this.handleSubmit,validate:this.getValidator(),onFormComponentRef:this.handleFormComponentRef,submission:this.submission,currentUser:this.currentUser,highlightedQuestionId:null!==(e=this.highlightedQuestionId)&&void 0!==e?e:null,formReadOnly:this.isReadOnly,previewMode:this.previewMode,signaturePreviewUrls:this.signaturePreviewUrls,autosaveStatus:this.autosaveStatus,lastSavedAt:this.lastSavedAt,progress:this.progress,onSubmitClick:this.handleSubmitClick,comments:i,followUpForms:n,onAddSection:this.handleAddSection,onDeleteSection:this.handleDeleteSection}))}get el(){return this}static get watchers(){return{loadedForm:[{handleLoadedFormChange:0}],highlightedQuestionId:[{handleHighlightedQuestionIdChange:0}],getUserCallback:[{handleGetUserCallbackChange:0}]}}static get style(){return":host{display:block;padding:var(--spacingVerticalM) var(--spacingHorizontalL, 16px);padding-bottom:96px}.renderer-layout__form udp-form-component{display:block}.renderer-layout{width:100%;max-width:720px;margin:0 auto}.renderer-layout__form{width:100%}.form-title-card{border-left:4px solid var(--colorBrandStroke1, #2899f5)}.form-title-card__content{padding-block:var(--spacingVerticalS, 8px)}.question-card{position:relative;transition:background-color 160ms ease-out, box-shadow 160ms ease-out;border-radius:var(--borderRadiusMedium, 4px)}.question-card--highlighted{background-color:var(--colorBrandBackground2, rgba(38, 79, 120, 0.08));box-shadow:inset 3px 0 0 0 var(--colorBrandStroke1, #2899f5);animation:udpqf-highlight-pulse 800ms ease-out 1}.question-card__toggles{position:absolute;top:0;right:0;display:inline-flex;align-items:center;gap:var(--spacingHorizontalXS, 4px);z-index:1}.question-card__follow-up-toggle{display:inline-flex;align-items:center;gap:var(--spacingHorizontalXXS, 2px)}.question-card__inline-comments{margin-top:var(--spacingVerticalS, 8px);padding:var(--spacingVerticalS, 8px) var(--spacingHorizontalM, 12px);background-color:var(--colorNeutralBackground2, #fafafa);border-left:2px solid var(--colorNeutralStroke2, #e0e0e0);border-radius:0 var(--borderRadiusMedium, 4px) var(--borderRadiusMedium, 4px) 0}.question-card__inline-comments .comment-thread{cursor:default;padding:0;gap:var(--spacingVerticalXS, 4px)}.question-card__inline-comments .comment-thread:hover,.question-card__inline-comments .comment-thread--focused{background-color:transparent}udp-detail-list-item:has(.question-view__comment-toggle){position:relative}.question-view__comment-toggle{position:absolute;top:0;right:0;z-index:1}@media print{.question-card__toggles,.question-view__comment-toggle,.comment-thread__compose-placeholder,.comment-thread__draft,.comment-item__actions{display:none !important}}@keyframes udpqf-highlight-pulse{0%{background-color:var(--colorBrandBackground2Hover, rgba(38, 79, 120, 0.16))}100%{background-color:var(--colorBrandBackground2, rgba(38, 79, 120, 0.08))}}@media (prefers-reduced-motion: reduce){.question-card,.question-card--highlighted{animation:none;transition:none}}.comment-thread{position:relative;display:flex;flex-direction:column;gap:var(--spacingVerticalXS, 4px);padding:var(--spacingVerticalS, 8px) var(--spacingHorizontalS, 10px);border-radius:var(--borderRadiusSmall, 2px);cursor:pointer;transition:background-color 120ms ease-out}.comment-thread:hover{background-color:var(--colorNeutralBackground1Hover, rgba(0, 0, 0, 0.02))}.comment-thread--focused{background-color:var(--colorBrandBackground2, rgba(38, 79, 120, 0.06))}.comment-thread__header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--spacingVerticalXXS, 2px)}.comment-thread__label{color:var(--colorNeutralForeground3, #707070);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.comment-thread__empty{color:var(--colorNeutralForeground3, #707070);font-style:italic}.comment-thread__items{display:flex;flex-direction:column}.comment-thread__draft{display:flex;flex-direction:column;gap:var(--spacingVerticalXXS, 2px)}.comment-thread__draft-actions{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;gap:var(--spacingHorizontalXXS, 2px)}.comment-thread__compose-placeholder{align-self:flex-start;margin-top:var(--spacingVerticalXS, 4px)}.comment-item{display:grid;grid-template-columns:24px 1fr;column-gap:var(--spacingHorizontalS, 8px);row-gap:var(--spacingVerticalXXS, 2px);padding:var(--spacingVerticalXS, 4px) 0}.comment-item+.comment-item{padding-top:var(--spacingVerticalS, 8px);margin-top:var(--spacingVerticalXS, 4px);border-top:1px solid var(--colorNeutralStroke3, #f0f0f0)}.comment-item__avatar{grid-column:1;grid-row:1;align-self:start;width:24px;height:24px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;color:var(--colorNeutralForegroundOnBrand, #fff);font-size:var(--fontSizeBase100, 10px);font-weight:var(--fontWeightSemibold, 600);line-height:1;user-select:none}.comment-item__actions{margin-left:auto;display:flex;flex-direction:row;gap:var(--spacingHorizontalXXS, 2px);opacity:0;transition:opacity 120ms ease-out}.comment-item__header{grid-column:2;display:flex;flex-direction:row;align-items:center;gap:var(--spacingHorizontalXS, 4px);min-height:24px}.comment-item__timestamp{color:var(--colorNeutralForeground3, #707070)}.comment-item__body{grid-column:2;white-space:pre-wrap;word-break:break-word}.comment-item:hover .comment-item__actions,.comment-item:focus-within .comment-item__actions{opacity:1}@media (hover: none){.comment-item__actions{opacity:1}}.form-footer{position:fixed;bottom:0;left:var(--udpqf-host-left, 0);width:var(--udpqf-host-width, 100%);z-index:2;background-color:var(--colorNeutralBackground1, #ffffff);border-top:1px solid transparent;box-shadow:var(--shadow4, 0 2px 4px rgba(0, 0, 0, 0.14), 0 0 2px rgba(0, 0, 0, 0.12))}.form-footer__inner{display:flex;flex-direction:row;align-items:center;gap:var(--spacingHorizontalM, 12px);width:100%;max-width:720px;margin:0 auto;padding:var(--spacingVerticalS, 8px) var(--spacingHorizontalL, 16px);box-sizing:border-box}.form-footer--read-only .form-footer__inner{justify-content:center}.form-footer__progress{display:flex;flex-direction:column;gap:var(--spacingVerticalXXS, 2px);flex:1 1 auto;min-width:0}.form-footer__progress-label{color:var(--colorNeutralForeground2, #424242)}.form-footer__progress-bar{display:block;width:100%}.form-footer__actions{display:flex;flex-direction:row;align-items:center;gap:var(--spacingHorizontalM, 12px);flex:0 0 auto}@media print{.form-footer{display:none !important}}.question-view__options{display:flex;flex-direction:column;gap:var(--spacingVerticalXXS, 2px)}.question-view__option{display:flex;flex-direction:row;align-items:center;gap:var(--spacingHorizontalS, 8px);color:var(--colorNeutralForeground3, #616161)}.question-view__option--selected{color:var(--colorNeutralForeground1, #242424);font-weight:var(--fontWeightSemibold, 600)}.question-view__option-mark{flex:0 0 auto;color:var(--colorNeutralForeground4, #707070)}.question-view__option--selected .question-view__option-mark{color:var(--colorCompoundBrandForeground1, #0f6cbd)}.question-view__location{display:flex;flex-direction:column;gap:var(--spacingVerticalS, 8px)}.question-view__signature{display:flex;flex-direction:column;gap:var(--spacingVerticalS, 8px)}.question-view__signature-img{display:block;max-width:360px;max-height:160px;object-fit:contain}.question-view__signature-meta{display:flex;flex-direction:column;gap:0}"}},[1,"udp-question-form-renderer",{formId:[1040],formVersion:[1026,"form-version"],submissionId:[16],tenantId:[16],isPublicMode:[4,"is-public-mode"],getUserCallback:[16],enqueueSnackbar:[16],closeSnackbar:[16],history:[16],urlContext:[16],autoSaveDelay:[2,"auto-save-delay"],loadedForm:[16],previewMode:[4,"preview-mode"],highlightedQuestionId:[16],readOnly:[4,"read-only"],resolvedForm:[32],submission:[32],initialValues:[32],signaturePreviewUrls:[32],isLoading:[32],dynamicSections:[32],publicModeError:[32],loadError:[32],currentUser:[32],templateOverrides:[32],commentsState:[32],expandedCommentPanels:[32],followUpPickerOpen:[32],followUpPickerQuestionId:[32],followUpPickerSelectedFormId:[32],followUpFormsList:[32],followUpFormsListLoaded:[32],followUpFormsListLoading:[32],followUpLaunching:[32],autosaveStatus:[32],lastSavedAt:[32],progress:[32]},[[0,"formReady","handleFormReady"],[0,"formStateUpdated","handleFormStateUpdated"]],{loadedForm:[{handleLoadedFormChange:0}],highlightedQuestionId:[{handleHighlightedQuestionIdChange:0}],getUserCallback:[{handleGetUserCallbackChange:0}]}]);function en(t,e){if(Object.is(t,e))return!0;if(null==t||null==e)return!1;if(Array.isArray(t)||Array.isArray(e))return Array.isArray(t)&&Array.isArray(e)&&t.length===e.length&&t.every(((t,n)=>en(t,e[n])));const n=t=>"object"==typeof t&&t.constructor===Object;if(!n(t)||!n(e))return!1;const i=Object.keys(t),o=Object.keys(e);return i.length===o.length&&i.every((n=>Object.prototype.hasOwnProperty.call(e,n)&&en(t[n],e[n])))}function nn(){"undefined"!=typeof customElements&&["udp-question-form-renderer","ag-grid-base","client-side-grid","form-metadata-display","ghost-render","grid-header","hint-panel","stencil-icon-button","tally-display","udp-ambient-tool-tip","udp-avatar","udp-badge","udp-button","udp-container","udp-container-query","udp-date-input","udp-date-range-selector","udp-date-time-input","udp-detail-list","udp-detail-list-item","udp-dialog","udp-empty-state","udp-export-sheet","udp-field","udp-flexbox","udp-fluent-avatar","udp-fluent-badge","udp-fluent-button","udp-fluent-card","udp-fluent-checkbox","udp-fluent-dialog","udp-fluent-drawer","udp-fluent-dropdown","udp-fluent-file-input","udp-fluent-icon","udp-fluent-icon-button","udp-fluent-image","udp-fluent-list-input","udp-fluent-list-item","udp-fluent-location-input","udp-fluent-menu","udp-fluent-radio-group","udp-fluent-signature-input","udp-fluent-switch","udp-fluent-table-input","udp-fluent-text-input","udp-form-component","udp-icon","udp-linear-loader","udp-list","udp-list-item","udp-menu-item","udp-message-bar","udp-pop-over","udp-popover","udp-primary-action-header","udp-progress-bar","udp-question-tally-adapter","udp-search-input","udp-side-sheet","udp-spinner","udp-text","udp-textarea","udp-time-input","udp-tooltip","unity-typography"].forEach((t=>{switch(t){case"udp-question-form-renderer":customElements.get(l(t))||customElements.define(l(t),tn);break;case"ag-grid-base":customElements.get(l(t))||S();break;case"client-side-grid":customElements.get(l(t))||k();break;case"form-metadata-display":customElements.get(l(t))||_();break;case"ghost-render":customElements.get(l(t))||j();break;case"grid-header":customElements.get(l(t))||O();break;case"hint-panel":customElements.get(l(t))||I();break;case"stencil-icon-button":customElements.get(l(t))||q();break;case"tally-display":customElements.get(l(t))||F();break;case"udp-ambient-tool-tip":customElements.get(l(t))||C();break;case"udp-avatar":customElements.get(l(t))||E();break;case"udp-badge":customElements.get(l(t))||D();break;case"udp-button":customElements.get(l(t))||N();break;case"udp-container":customElements.get(l(t))||$();break;case"udp-container-query":customElements.get(l(t))||U();break;case"udp-date-input":customElements.get(l(t))||A();break;case"udp-date-range-selector":customElements.get(l(t))||L();break;case"udp-date-time-input":customElements.get(l(t))||V();break;case"udp-detail-list":customElements.get(l(t))||T();break;case"udp-detail-list-item":customElements.get(l(t))||P();break;case"udp-dialog":customElements.get(l(t))||R();break;case"udp-empty-state":customElements.get(l(t))||B();break;case"udp-export-sheet":customElements.get(l(t))||z();break;case"udp-field":customElements.get(l(t))||M();break;case"udp-flexbox":customElements.get(l(t))||Q();break;case"udp-fluent-avatar":customElements.get(l(t))||H();break;case"udp-fluent-badge":customElements.get(l(t))||X();break;case"udp-fluent-button":customElements.get(l(t))||K();break;case"udp-fluent-card":customElements.get(l(t))||G();break;case"udp-fluent-checkbox":customElements.get(l(t))||J();break;case"udp-fluent-dialog":customElements.get(l(t))||W();break;case"udp-fluent-drawer":customElements.get(l(t))||Y();break;case"udp-fluent-dropdown":customElements.get(l(t))||Z();break;case"udp-fluent-file-input":customElements.get(l(t))||tt();break;case"udp-fluent-icon":customElements.get(l(t))||et();break;case"udp-fluent-icon-button":customElements.get(l(t))||nt();break;case"udp-fluent-image":customElements.get(l(t))||it();break;case"udp-fluent-list-input":customElements.get(l(t))||ot();break;case"udp-fluent-list-item":customElements.get(l(t))||lt();break;case"udp-fluent-location-input":customElements.get(l(t))||rt();break;case"udp-fluent-menu":customElements.get(l(t))||st();break;case"udp-fluent-radio-group":customElements.get(l(t))||ut();break;case"udp-fluent-signature-input":customElements.get(l(t))||at();break;case"udp-fluent-switch":customElements.get(l(t))||dt();break;case"udp-fluent-table-input":customElements.get(l(t))||ct();break;case"udp-fluent-text-input":customElements.get(l(t))||mt();break;case"udp-form-component":customElements.get(l(t))||pt();break;case"udp-icon":customElements.get(l(t))||ft();break;case"udp-linear-loader":customElements.get(l(t))||ht();break;case"udp-list":customElements.get(l(t))||vt();break;case"udp-list-item":customElements.get(l(t))||bt();break;case"udp-menu-item":customElements.get(l(t))||gt();break;case"udp-message-bar":customElements.get(l(t))||yt();break;case"udp-pop-over":customElements.get(l(t))||wt();break;case"udp-popover":customElements.get(l(t))||xt();break;case"udp-primary-action-header":customElements.get(l(t))||St();break;case"udp-progress-bar":customElements.get(l(t))||kt();break;case"udp-question-tally-adapter":customElements.get(l(t))||x();break;case"udp-search-input":customElements.get(l(t))||_t();break;case"udp-side-sheet":customElements.get(l(t))||jt();break;case"udp-spinner":customElements.get(l(t))||Ot();break;case"udp-text":customElements.get(l(t))||It();break;case"udp-textarea":customElements.get(l(t))||qt();break;case"udp-time-input":customElements.get(l(t))||Ft();break;case"udp-tooltip":customElements.get(l(t))||Ct();break;case"unity-typography":customElements.get(l(t))||Et()}}))}export{tn as U,nn as a,ne as d,ie as e,Rt as f,Ut as p}
1
+ import{h as t,p as e,H as n,c as i,d as o,t as l}from"./index2.js";import{d as r}from"./udp-drive-utils.js";import{m as s}from"./makeApiCall.js";import{g as u}from"./tenantUtils.js";import{i as a,F as d,a as c}from"./types.js";import{C as m}from"./configService.js";import{f as p}from"./form-registry.js";import{v4 as f}from"uuid";import{i as h,c as v,a as b,p as g,d as y,g as w}from"./getCachedAzureMapsProviders.js";import{i as x,g as S,b as k,d as _}from"./udp-fluent-domain-table-input2.js";import{g as j,s as F,d as q}from"./udp-question-tally-adapter2.js";import{d as I}from"./ag-grid-base2.js";import{d as O}from"./client-side-grid2.js";import{d as C}from"./form-metadata-display2.js";import{d as E}from"./ghost-render2.js";import{d as D}from"./grid-header2.js";import{d as N}from"./hint-panel2.js";import{d as $}from"./stencil-icon-button2.js";import{d as U}from"./tally.js";import{d as A}from"./udp-accordion2.js";import{d as L}from"./udp-ambient-tool-tip2.js";import{d as V}from"./udp-avatar2.js";import{d as T}from"./udp-badge2.js";import{d as P}from"./udp-button2.js";import{d as R}from"./udp-container2.js";import{d as B}from"./udp-container-query2.js";import{d as z}from"./udp-date-input2.js";import{d as M}from"./udp-date-range-selector2.js";import{d as Q}from"./udp-date-time-input2.js";import{d as H}from"./udp-detail-list2.js";import{d as X}from"./udp-detail-list-item2.js";import{d as K}from"./udp-dialog2.js";import{d as G}from"./udp-empty-state2.js";import{d as J}from"./udp-export-sheet2.js";import{d as W}from"./udp-field2.js";import{d as Y}from"./udp-flexbox2.js";import{d as Z}from"./udp-fluent-avatar2.js";import{d as tt}from"./udp-fluent-badge2.js";import{d as et}from"./udp-fluent-button2.js";import{d as nt}from"./udp-fluent-card2.js";import{d as it}from"./udp-fluent-checkbox2.js";import{d as ot}from"./udp-fluent-dialog2.js";import{d as lt}from"./udp-fluent-drawer2.js";import{d as rt}from"./udp-fluent-dropdown2.js";import{d as st}from"./udp-fluent-file-input2.js";import{d as ut}from"./udp-fluent-icon2.js";import{d as at}from"./udp-fluent-icon-button2.js";import{d as dt}from"./udp-fluent-image2.js";import{d as ct}from"./udp-fluent-list-input2.js";import{d as mt}from"./udp-list-item2.js";import{d as pt}from"./udp-fluent-location-input2.js";import{d as ft}from"./udp-fluent-menu2.js";import{d as ht}from"./udp-fluent-number-input2.js";import{d as vt}from"./udp-fluent-radio-group2.js";import{d as bt}from"./udp-fluent-signature-input2.js";import{d as gt}from"./udp-fluent-switch2.js";import{d as yt}from"./udp-fluent-table-input2.js";import{d as wt}from"./udp-fluent-text-input2.js";import{d as xt}from"./udp-form-component2.js";import{d as St}from"./udp-icon2.js";import{d as kt}from"./udp-linear-loader2.js";import{d as _t}from"./udp-list2.js";import{d as jt}from"./list-item.js";import{d as Ft}from"./udp-menu-item2.js";import{d as qt}from"./udp-message-bar2.js";import{d as It}from"./udp-pop-over2.js";import{d as Ot}from"./udp-popover2.js";import{d as Ct}from"./udp-primary-action-header2.js";import{d as Et}from"./udp-progress-bar2.js";import{d as Dt}from"./udp-search-input2.js";import{d as Nt}from"./udp-side-sheet2.js";import{d as $t}from"./udp-spinner2.js";import{d as Ut}from"./udp-text2.js";import{d as At}from"./udp-textarea2.js";import{d as Lt}from"./udp-time-input2.js";import{d as Vt}from"./udp-tooltip2.js";import{d as Tt}from"./unity-typography2.js";function Pt(t){const e=t.fieldProperties;return Array.isArray(e.items)?e.items:Array.isArray(t.lookupItems)?t.lookupItems:[]}function Rt(t,e,n){var i,o;if(a(t.fieldTypeId))return[];const l=[],r=h(e);for(const o of v(t.fieldTypeId)){if(r&&!o.runOnEmpty)continue;const s=o.check(e,t,n);s&&l.push({ruleType:o.ruleType,message:s.message,severity:null!==(i=s.severity)&&void 0!==i?i:"error"})}for(const i of b(t.fieldTypeId)){const s=i.readParams(t);if(null===s)continue;if(r&&!i.runOnEmpty)continue;const u=i.check(e,s,t,n);u&&l.push({ruleType:i.ruleType,message:u.message,severity:null!==(o=u.severity)&&void 0!==o?o:"error"})}return l}async function Bt(){try{const t=u();return function(t){if(Array.isArray(t))return t;if(t&&"object"==typeof t){if("pageList"in t&&Array.isArray(t.pageList))return t.pageList;if("data"in t){const e=t.data;if(Array.isArray(e))return e;if(e&&"object"==typeof e&&"pageList"in e){const t=e.pageList;if(Array.isArray(t))return t}}}return[]}(await s("POST",`${m.productV1ApiUrl}/UdpFormLatestVersionView/search`,{eagerLoad:!1,pageNumber:1,pageSize:200,filterElements:[{searchField:"type",searchOperator:"=",searchValue:d.FollowUp},{searchField:"tenantId",searchOperator:"=",searchValue:t}],orderElements:[{sortColumn:"name",sortDirection:"ASC"}]})).filter((t=>"string"==typeof(null==t?void 0:t.id)&&t.id.length>0)).map((t=>{var e;return{value:t.id,label:(null===(e=t.name)||void 0===e?void 0:e.trim())||"(untitled form)"}}))}catch(t){return[]}}function zt(t){if(!(t instanceof File))return null;const e=t.driveFileId;return"string"==typeof e&&e.length>0?e:null}function Mt(t,e){return t.legacyValueToken=e,t}function Qt(t){const e=null==t?void 0:t.legacyValueToken;return"string"==typeof e&&e.length>0?e:null}var Ht;!function(t){t[t.InProgress=1]="InProgress",t[t.Submitted=2]="Submitted",t[t.Created=3]="Created"}(Ht||(Ht={}));const Xt={decode:()=>null,encode:()=>""},Kt={decode:t=>null==t||""===t?null:t,encode:t=>null!=t?t:""},Gt={decode:t=>{if(null==t||""===t)return null;const e=Number(t);return Number.isFinite(e)?e:null},encode:t=>null==t?"":String(t)},Jt={decode:t=>null==t||""===t?null:t.split(",").map((t=>t.trim())).filter((t=>t.length>0)),encode:t=>null==t||0===t.length?"":t.join(",")};function Wt(t){var e,n,i,o,l,r,s;const u=null!==(e=t.address)&&void 0!==e?e:"";return u.length>0||null!=t.streetNumber||null!=t.streetName||null!=t.municipality||null!=t.countrySubdivisionName||null!=t.postalCode||null!=t.country?{freeformAddress:u,streetNumber:null!==(n=t.streetNumber)&&void 0!==n?n:void 0,streetName:null!==(i=t.streetName)&&void 0!==i?i:void 0,municipality:null!==(o=t.municipality)&&void 0!==o?o:void 0,countrySubdivisionName:null!==(l=t.countrySubdivisionName)&&void 0!==l?l:void 0,postalCode:null!==(r=t.postalCode)&&void 0!==r?r:void 0,country:null!==(s=t.country)&&void 0!==s?s:void 0}:null}const Yt={decode:t=>{var e,n,i;if(null==t||""===t)return null;let o;try{o=JSON.parse(t)}catch(e){return Mt({latitude:null,longitude:null,address:null,timestamp:null},t)}return{latitude:null!==(e=o.latitude)&&void 0!==e?e:null,longitude:null!==(n=o.longitude)&&void 0!==n?n:null,address:Wt(o),timestamp:null!==(i=o.timestamp)&&void 0!==i?i:null}},encode:t=>{var e,n,i,o,l,r,s,u,a,d,c;if(null==t)return"";const m=Qt(t);if(null!=m)return m;if(null==t.latitude&&null==t.longitude&&!t.address)return"";const p={latitude:null!==(e=t.latitude)&&void 0!==e?e:null,longitude:null!==(n=t.longitude)&&void 0!==n?n:null,address:null!==(o=null===(i=t.address)||void 0===i?void 0:i.freeformAddress)&&void 0!==o?o:null,streetNumber:null===(l=t.address)||void 0===l?void 0:l.streetNumber,streetName:null===(r=t.address)||void 0===r?void 0:r.streetName,municipality:null===(s=t.address)||void 0===s?void 0:s.municipality,countrySubdivisionName:null===(u=t.address)||void 0===u?void 0:u.countrySubdivisionName,postalCode:null===(a=t.address)||void 0===a?void 0:a.postalCode,country:null===(d=t.address)||void 0===d?void 0:d.country,timestamp:null!==(c=t.timestamp)&&void 0!==c?c:null};return JSON.stringify(p)}},Zt={decode:t=>{if(null==t||""===t)return null;const e=t.split(",").map((t=>t.trim())).filter((t=>t.length>0));if(0===e.length)return null;const n=[];for(const t of e){const e=te(t);e&&n.push(e)}return n.length>0?n:null},encode:t=>null==t||0===t.length?"":t.map((t=>"pending"===t.kind?encodeURIComponent(t.file.name):`${encodeURIComponent(t.name)}|udp:${t.driveFileId}`)).join(",")};function te(t){const e=t.indexOf("|");if(e<0){let e=t;try{e=decodeURIComponent(t)}catch(t){}return{kind:"stored",name:e,driveFileId:""}}const n=t.slice(0,e),i=t.slice(e+1);let o=n;try{o=decodeURIComponent(n)}catch(t){o=n}return i.startsWith("udp:")?{kind:"stored",name:o,driveFileId:i.slice(4)}:i.startsWith("b64:")?{kind:"stored",name:o,driveFileId:""}:null}const ee={decode:t=>{if(null==t||""===t)return null;const e=function(t){const e=t.indexOf("|");let n=t,i="";if(e>=0){n=t.slice(0,e);const o=t.slice(e+1);o.startsWith("udp:")&&(i=o.slice(4))}let o=n;try{o=decodeURIComponent(n)}catch(t){o=n}const l=new Blob([""],{type:"image/png"}),r=new File([l],o,{type:"image/png"});return i&&(r.driveFileId=i),r}(t);return{file:e,fullName:null,metadata:null}},encode:t=>{if(null==t)return"";if(!(t.file instanceof File))return"";const e=zt(t.file);return e?`${encodeURIComponent(t.file.name)}|udp:${e}`:encodeURIComponent(t.file.name)}},ne={decode:t=>{var e;if(null==t||""===t)return{rows:[]};let n;try{n=JSON.parse(t)}catch(t){return{rows:[]}}const i=n,o=null!==(e=null==i?void 0:i.rows)&&void 0!==e?e:null==i?void 0:i.Rows;if(!Array.isArray(o))return{rows:[]};const l={rows:o.filter((t=>null!=t&&"object"==typeof t&&!Array.isArray(t)))};return!0===(null==i?void 0:i.snapshot)&&(l.snapshot=!0),l},encode:t=>t&&Array.isArray(t.rows)?0===t.rows.length&&!0!==t.snapshot?"":JSON.stringify(Object.assign({rows:t.rows},t.snapshot?{snapshot:!0}:{})):""},ie={[c.Hidden]:Kt,[c.Paragraph]:Xt,[c.Tally]:Xt,[c.FormMetadataDisplay]:Xt,[c.SingleLineText]:Kt,[c.MultiLineText]:Kt,[c.RadioButton]:Kt,[c.DropdownSingleSelect]:Kt,[c.YesNo]:{decode:t=>"true"===t||"false"===t||"na"===t?t:null,encode:t=>null==t?"":"boolean"==typeof t?t?"true":"false":"true"===t||"false"===t||"na"===t?t:""},[c.Checkbox]:Jt,[c.DropdownMultipleSelect]:Jt,[c.ListMultiSelect]:Jt,[c.Number]:Gt,[c.DateSelector]:Kt,[c.TimeSelector]:Kt,[c.DateTimeSelector]:Kt,[c.Location]:Yt,[c.FileUpload]:Zt,[c.ImageUpload]:Zt,[c.Signature]:ee,[c.Table]:ne};function oe(t,e){const n=ie[t];return n?n.decode(e):null}function le(t,e){const n=ie[t];return n?n.encode(e):""}function re(t,e,n){var i,o,l,r,s,u,a,d,m;if(t===c.Signature){const t=null!==(i=null==n?void 0:n.signature)&&void 0!==i?i:null,c=null!=e?e:null;return t||c?{file:null!==(o=null==c?void 0:c.file)&&void 0!==o?o:null,fullName:null!==(r=null!==(l=null==t?void 0:t.fullName)&&void 0!==l?l:null==c?void 0:c.fullName)&&void 0!==r?r:null,metadata:null!=t?{timestamp:null!==(s=t.timestamp)&&void 0!==s?s:null,latitude:null!==(u=t.latitude)&&void 0!==u?u:null,longitude:null!==(a=t.longitude)&&void 0!==a?a:null}:null!==(d=null==c?void 0:c.metadata)&&void 0!==d?d:null}:null}return t===c.Location?function(t,e){var n,i,o;if(t&&(null!=t.latitude||null!=t.longitude||null!=t.address))return t;if(!e)return t;const l={latitude:null!==(n=e.latitude)&&void 0!==n?n:null,longitude:null!==(i=e.longitude)&&void 0!==i?i:null,address:Wt(e),timestamp:null!==(o=e.timestamp)&&void 0!==o?o:null},r=Qt(t);return null!=r?Mt(l,r):l}(e,null!==(m=null==n?void 0:n.location)&&void 0!==m?m:null):e}function se(t){const e=[];for(const{fieldTypeId:n,value:i}of t)switch(n){case c.FileUpload:case c.ImageUpload:if(!Array.isArray(i))break;for(const t of i)"pending"===(null==t?void 0:t.kind)&&t.file instanceof File&&e.push(t.file);break;case c.Signature:{const t=i;(null==t?void 0:t.file)instanceof File&&null==zt(t.file)&&e.push(t.file);break}}return e}function ue(t,e,n){var i,o,l,r,s;if(t===c.Signature){const t=(null==e?void 0:e.file)instanceof File,u=null!==(i=null==e?void 0:e.fullName)&&void 0!==i?i:null,a=null!==(o=null==e?void 0:e.metadata)&&void 0!==o?o:null;return t||null!=u&&""!==u||null!=a?Object.assign(Object.assign({},null!=n&&"object"==typeof n?n:{}),{signature:{latitude:null!==(l=null==a?void 0:a.latitude)&&void 0!==l?l:null,longitude:null!==(r=null==a?void 0:a.longitude)&&void 0!==r?r:null,timestamp:null!==(s=null==a?void 0:a.timestamp)&&void 0!==s?s:null,fullName:u}}):n}return t===c.Location?function(t,e){var n,i,o,l,r,s,u,a,d,c,m,p,f,h,v,b,g;if(null!=Qt(t))return e;const y=null!=e&&"object"==typeof e?e:{};return null==t||null==t.latitude&&null==t.longitude&&null==t.address?null==y.location?e:Object.assign(Object.assign({},y),{location:null}):Object.assign(Object.assign({},y),{location:{latitude:null!==(n=t.latitude)&&void 0!==n?n:null,longitude:null!==(i=t.longitude)&&void 0!==i?i:null,timestamp:null!==(o=t.timestamp)&&void 0!==o?o:null,address:null!==(r=null===(l=t.address)||void 0===l?void 0:l.freeformAddress)&&void 0!==r?r:null,streetNumber:null!==(u=null===(s=t.address)||void 0===s?void 0:s.streetNumber)&&void 0!==u?u:null,streetName:null!==(d=null===(a=t.address)||void 0===a?void 0:a.streetName)&&void 0!==d?d:null,municipality:null!==(m=null===(c=t.address)||void 0===c?void 0:c.municipality)&&void 0!==m?m:null,countrySubdivisionName:null!==(f=null===(p=t.address)||void 0===p?void 0:p.countrySubdivisionName)&&void 0!==f?f:null,country:null!==(v=null===(h=t.address)||void 0===h?void 0:h.country)&&void 0!==v?v:null,postalCode:null!==(g=null===(b=t.address)||void 0===b?void 0:b.postalCode)&&void 0!==g?g:null}})}(e,n):n}function ae(t,e){var n,i,o,l,r,s,u,a,d,c,m,p,f,h,v;const b=j(e),g={},y=null!==(i=null===(n=t.data)||void 0===n?void 0:n.submissionResponseData)&&void 0!==i?i:{};for(const[t,e]of Object.entries(y)){const n={};for(const[i,o]of Object.entries(e)){let e=b.byExact(t,i);if(!e){const n=F(t);n!==t&&(e=b.byExact(n,i))}n[i]=de(o,null==e?void 0:e.fieldTypeId)}g[t]=n}const w={metadata:me(null!==(l=null===(o=t.data)||void 0===o?void 0:o.submissionMetadata)&&void 0!==l?l:null),responses:g,templateOverrides:pe(null!==(s=null===(r=t.data)||void 0===r?void 0:r.formTemplateOverrides)&&void 0!==s?s:null)};return{id:t.id,formId:t.formId,formVersion:t.formVersion,status:t.status,unityUserId:null!==(u=t.unityUserId)&&void 0!==u?u:null,userDisplayName:null!==(a=t.userDisplayName)&&void 0!==a?a:null,userEmail:null!==(d=t.userEmail)&&void 0!==d?d:null,initialCreatedOn:t.initialCreatedOn,lastModifiedOn:t.lastModifiedOn,submittedOn:null!==(c=t.submittedOn)&&void 0!==c?c:null,dueDate:null!==(m=t.dueDate)&&void 0!==m?m:null,generic1:null!==(p=t.generic1)&&void 0!==p?p:null,generic2:null!==(f=t.generic2)&&void 0!==f?f:null,generic3:null!==(h=t.generic3)&&void 0!==h?h:null,data:w,wireResponseData:null!==(v=y)&&void 0!==v?v:{}}}function de(t,e){var n,i;const o=function(t){var e,n,i,o,l;return null==t?null:{signature:null!==(e=t.signature)&&void 0!==e?e:null,location:null!==(n=t.location)&&void 0!==n?n:null,image:null!==(i=t.image)&&void 0!==i?i:null,file:null!==(o=t.file)&&void 0!==o?o:null,followUpFormSubmissionId:null!==(l=t.followUpFormSubmissionId)&&void 0!==l?l:null}}(null!==(n=t.metadata)&&void 0!==n?n:null),l=null==e?null:oe(e,t.value);return{value:null==e?null:re(e,l,o),comments:(null!==(i=t.comments)&&void 0!==i?i:[]).map(ce),metadata:o}}function ce(t){var e,n,i,o;return{commentId:t.commentId,userDisplayName:null!==(e=t.userDisplayName)&&void 0!==e?e:null,userId:t.userId,timestamp:t.timestamp,editedTimestamp:null!==(n=t.editedTimestamp)&&void 0!==n?n:null,isDeleted:null!==(i=t.isDeleted)&&void 0!==i?i:null,value:null!==(o=t.value)&&void 0!==o?o:null}}function me(t){return null==t?null:t.parentSubmission?{parentSubmission:{submissionId:t.parentSubmission.submissionId,formId:t.parentSubmission.formId,formVersion:t.parentSubmission.formVersion}}:{}}function pe(t){var e,n;return null==t?null:{formName:null!==(e=t.formName)&&void 0!==e?e:null,formDescription:null!==(n=t.formDescription)&&void 0!==n?n:null}}function fe(t){const{loadedForm:e,submission:n,urlContext:i}=t,o=[];for(const t of e.sections){const e=be(t.name,n,i);for(let n=1;n<=e;n++)o.push(he(t,n))}return o}function he(t,e){const n=1===e,i=f();return{schemaSection:t,instanceId:i,suffix:e,isOriginal:n,slotName:n?t.name:`${t.name}_${e}`,questions:t.questions.map((t=>({schemaQuestion:t,fieldKey:ve(t.id,i,n)})))}}function ve(t,e,n){return n?t:`${t}__${e}`}function be(t,e,n){var i;let o=1;if(null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.responses)for(const n of Object.keys(e.data.responses)){const e=ye(n,t);null!=e&&e>o&&(o=e)}if(n){const e=ge.length;for(const i of Object.keys(n)){const n=i.toLowerCase();if(!n.startsWith(ge))continue;const l=n.slice(e),r=l.indexOf(".");if(r<=0)continue;const s=ye(l.slice(0,r),t.toLowerCase());null!=s&&s>o&&(o=s)}}return o}const ge="seed_";function ye(t,e){if(t===e)return 1;const n=`${e}_`;if(!t.startsWith(n))return null;const i=t.slice(n.length),o=Number(i);return!Number.isInteger(o)||o<2?null:o}function we(t,e,n){const i=e.toLowerCase(),o=n.toLowerCase();for(const e of t)if(e.slotName.toLowerCase()===i)for(const t of e.questions)if(t.schemaQuestion.name.toLowerCase()===o)return{section:e,question:t};return null}function xe(t){if(t.fieldTypeId===c.Location){const e=t.fieldProperties;if(e.defaultLocation)return oe(c.Location,e.defaultLocation)}return null}function Se(t,e){var n,i,o,l;const r={},s=null!==(i=null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.responses)&&void 0!==i?i:{};for(const e of t){const t=null!==(o=s[e.slotName])&&void 0!==o?o:null;for(const n of e.questions){const e=null===(l=null==t?void 0:t[n.schemaQuestion.name])||void 0===l?void 0:l.value;r[n.fieldKey]=void 0!==e?e:xe(n.schemaQuestion)}}return r}function ke(t,e=[]){const n=new FormData;n.append("FormId",String(t.FormId)),n.append("FormVersion",String(t.FormVersion)),n.append("Status",String(t.Status)),n.append("InitialCreatedOn",t.InitialCreatedOn),n.append("LastModifiedOn",t.LastModifiedOn),t.Id&&n.append("Id",String(t.Id)),t.submittedOn&&n.append("submittedOn",t.submittedOn),t.generic1&&n.append("generic1",t.generic1),t.generic2&&n.append("generic2",t.generic2),t.generic3&&n.append("generic3",t.generic3),n.append("Data",JSON.stringify(t.Data));for(const t of e)n.append("FormFiles",t);return n}async function _e(t){var e,n;if(t.isPublicMode){if(!t.tenantId)throw new Error("submitSubmission: public mode requires a tenantId.");if(t.status!==Ht.Submitted)throw new Error("submitSubmission: public mode is single-shot — only `SubmissionStatus.Submitted` is allowed.")}const i=null!==(e=t.dynamicSections)&&void 0!==e?e:fe({loadedForm:t.loadedForm,submission:t.current}),o=ke(function(t){var e,n,i,o,l,r,s;const{loadedForm:u,values:a,current:d,status:m,generic:p,commentsByQuestionId:f}=t,h=null!==(e=t.dynamicSections)&&void 0!==e?e:fe({loadedForm:u,submission:d}),v=(new Date).toISOString(),b=function(t,e,n,i){var o,l,r,s;const u={},a=null!==(o=null==n?void 0:n.wireResponseData)&&void 0!==o?o:{};for(const n of t){const t={},o=a[n.slotName];for(const u of n.questions){const n=u.schemaQuestion,a=null==o?void 0:o[n.name],d=void 0!==ie[n.fieldTypeId],m=e[u.fieldKey];let p;p=n.fieldTypeId===c.Paragraph?null!==(l=n.fieldProperties.paragraphText)&&void 0!==l?l:"string"==typeof(null==a?void 0:a.value)?a.value:"":d?le(n.fieldTypeId,m):null!==(r=null==a?void 0:a.value)&&void 0!==r?r:"";const f=d?ue(n.fieldTypeId,m,null==a?void 0:a.metadata):null==a?void 0:a.metadata,h={value:null!=p?p:"",comments:i&&u.fieldKey in i?i[u.fieldKey]:null!==(s=null==a?void 0:a.comments)&&void 0!==s?s:[]};null!=f&&(h.metadata=f),t[n.name]=h}u[n.slotName]=t}return u}(h,a,d,f),g={FormId:u.form.id,FormVersion:u.form.version,Status:m,InitialCreatedOn:null!==(n=null==d?void 0:d.initialCreatedOn)&&void 0!==n?n:v,LastModifiedOn:v,Data:{submissionResponseData:b,submissionMetadata:null!==(i=null==d?void 0:d.data.metadata)&&void 0!==i?i:null,formTemplateOverrides:void 0!==t.templateOverrides?t.templateOverrides:null!==(o=null==d?void 0:d.data.templateOverrides)&&void 0!==o?o:null}};(null==d?void 0:d.id)&&(g.Id=d.id),(null==d?void 0:d.submittedOn)&&(g.submittedOn=d.submittedOn);const y=null!==(l=null==p?void 0:p.generic1)&&void 0!==l?l:null==d?void 0:d.generic1,w=null!==(r=null==p?void 0:p.generic2)&&void 0!==r?r:null==d?void 0:d.generic2,x=null!==(s=null==p?void 0:p.generic3)&&void 0!==s?s:null==d?void 0:d.generic3;return y&&(g.generic1=y),w&&(g.generic2=w),x&&(g.generic3=x),g}({loadedForm:t.loadedForm,dynamicSections:i,values:t.values,current:t.current,status:t.status,generic:t.generic,templateOverrides:t.templateOverrides,commentsByQuestionId:t.commentsByQuestionId}),t.dynamicSections?se(i.flatMap((e=>e.questions.map((e=>({fieldTypeId:e.schemaQuestion.fieldTypeId,value:t.values[e.fieldKey]})))))):function(t,e){const n=[];for(const i of t.sections)for(const t of i.questions)n.push({fieldTypeId:t.fieldTypeId,value:e[t.id]});return se(n)}(t.loadedForm,t.values)),{method:l,url:r}=function(t){var e,n;const i=`${m.productV1ApiUrl}/UdpFormSubmission`;return t.isPublicMode?{method:"POST",url:`${i}/public?tenantId=${encodeURIComponent(String(null!==(e=t.tenantId)&&void 0!==e?e:""))}`}:(null===(n=t.current)||void 0===n?void 0:n.id)?{method:"PUT",url:`${i}/private`}:{method:"POST",url:`${i}/private`}}(t),u=await s(l,r,o,!0);if(""===u||null==u){if(!(null===(n=t.current)||void 0===n?void 0:n.id))throw new Error("Submit returned no body but there is no submission id to refetch.");return await async function(t,e){const n=`${m.productV1ApiUrl}/UdpFormSubmission/${t}/Full`;return ae(await s("GET",n),e)}(t.current.id,t.loadedForm)}return ae(u,t.loadedForm)}function je(t,e){var n,i,o,l,r,s;const u={},a={},d={},c=null!==(n=null==e?void 0:e.wireResponseData)&&void 0!==n?n:{},m=null!==(o=null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.responses)&&void 0!==o?o:{};for(const e of t){const t=m[e.slotName],n=c[e.slotName];for(const i of e.questions){const e=i.fieldKey,o=i.schemaQuestion.name;u[e]=(null!==(r=null===(l=null==t?void 0:t[o])||void 0===l?void 0:l.comments)&&void 0!==r?r:[]).map((t=>Object.assign({},t)));const c=null==n?void 0:n[o],m=(c&&Array.isArray(c.draftComments)?c.draftComments:[]).find((t=>t&&"string"==typeof t.value));a[e]=null!==(s=null==m?void 0:m.value)&&void 0!==s?s:null,d[e]=null}}return{byQuestionId:u,draftByQuestionId:a,editingCommentIdByQuestionId:d}}function Fe(t){return(null!=t?t:[]).filter((t=>!0!==t.isDeleted))}function qe(t,e,n,i=null){return Object.assign(Object.assign({},t),{draftByQuestionId:Object.assign(Object.assign({},t.draftByQuestionId),{[e]:n}),editingCommentIdByQuestionId:Object.assign(Object.assign({},t.editingCommentIdByQuestionId),{[e]:null==n?null:i})})}function Ie(t,e,n,i){var o;const l=(null!==(o=t.byQuestionId[e])&&void 0!==o?o:[]).map((t=>t.commentId===n?Object.assign(Object.assign({},t),i):t));return Object.assign(Object.assign({},t),{byQuestionId:Object.assign(Object.assign({},t.byQuestionId),{[e]:l})})}function Oe(t,e){const n=Array.isArray(t)?t:fe({loadedForm:t,submission:null});for(const t of n)for(const n of t.questions)if(n.fieldKey===e)return{sectionKey:t.slotName,questionKey:n.schemaQuestion.name,question:n.schemaQuestion};return null}function Ce(t){const e=t.fieldProperties;return!0===(null==e?void 0:e.allowComments)}const Ee=new WeakMap;function De(t){return`${m.productV1ApiUrl}/UdpFormSubmission/${t.submissionId}/comments`}function Ne(t){const e=t.fieldProperties;return!0===(null==e?void 0:e.allowFollowUpForms)}function $e(t,e,n,i){var o,l;const r=Object.assign({},t),s=Object.assign({},null!==(o=r[e])&&void 0!==o?o:{}),u=null!==(l=s[n])&&void 0!==l?l:{value:null},a=null!=u.metadata&&"object"==typeof u.metadata?u.metadata:{};return s[n]=Object.assign(Object.assign({},u),{metadata:Object.assign(Object.assign({},a),i)}),r[e]=s,r}function Ue(t){const{currentPathname:e,parentFormId:n,childFormId:i,childSubmissionId:o}=t;let l=e;return e.includes(String(n))?l=e.replace(String(n),String(i)):console.warn("[udp-question-form] follow-up URL: parent form id not found in path; the new tab may load the wrong form. Path:",e),`${l}?udpf_submissionId=${encodeURIComponent(String(o))}`}function Ae(t,e){let n=0,i=0;for(const o of t)for(const t of o.questions)a(t.schemaQuestion.fieldTypeId)||(i+=1,h(e[t.fieldKey])||(n+=1));return{answered:n,total:i}}function Le(t){return(null!=t?t:[]).filter((t=>!0===t.show)).map((t=>({key:t.key,displayName:t.displayName||t.key,isKey:t.isKey,type:t.type,lookupId:t.lookupId,editable:!0===t.editable&&!t.isKey,required:!0===t.required&&!t.isKey,locked:!0===t.isKey||!0===t.locked,aggregate:t.isKey?void 0:t.aggregate,aggregateDecimalPlaces:t.isKey?void 0:t.aggregateDecimalPlaces,custom:t.custom})))}const Ve=["#264f78","#0078d4","#107c10","#bf4080","#8764b8","#ca5010","#005b70","#d83b01"];function Te(t){const e=(null!=t?t:"").trim();if(0===e.length)return"#707070";let n=0;for(let t=0;t<e.length;t++)n=31*n+e.charCodeAt(t)|0;return Ve[Math.abs(n)%Ve.length]}function Pe(t,e){return n=>{var i;const o=null!==(i=n.detail)&&void 0!==i?i:"";e(t,o)}}function Re(e){const{question:n,fieldKey:i,comments:o,draft:l,currentUserId:r,isReadOnly:s,hideHeader:u,onOpenDraft:a,onChangeDraft:d,onSaveDraft:c,onCancelDraft:m,onEdit:p,onDelete:f}=e,h=Fe(o),v=null!==l,b=v&&null!=l&&l.trim().length>0;return t("section",{class:"comment-thread","data-question-thread":i},!u&&t("header",{class:"comment-thread__header"},t("udp-text",{variant:"caption1Strong",class:"comment-thread__label"},n.questionText||"Untitled question")),0===h.length&&!v&&t("udp-text",{variant:"caption2",class:"comment-thread__empty"},"No comments yet."),t("div",{class:"comment-thread__items"},h.map((e=>function(e){var n,i,o;const{comment:l,currentUserId:r,onEdit:s,onDelete:u}=e,a=null!=r&&l.userId===r,d=l.editedTimestamp&&l.timestamp&&l.editedTimestamp!==l.timestamp,c=null!==(n=l.userDisplayName)&&void 0!==n?n:"Unknown user",m=null!==(i=l.userId)&&void 0!==i?i:c;return t("div",{class:"comment-item",key:l.commentId},t("span",{class:"comment-item__avatar",style:{backgroundColor:Te(m)},"aria-hidden":"true"},function(t){const e=(null!=t?t:"").trim();return 0===e.length?"?":e[0].toUpperCase()}(c)),t("div",{class:"comment-item__header"},t("udp-text",{variant:"caption1Strong"},c),t("udp-text",{variant:"caption2",class:"comment-item__timestamp"},function(t){if(!t)return"";try{return new Date(t).toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch(e){return t}}(l.timestamp),d?" · edited":""),a&&t("div",{class:"comment-item__actions"},t("udp-fluent-icon-button",{appearance:"transparent",size:"small",iconName:"edit",ariaLabel:"Edit comment",onClick:()=>s(l.commentId)}),t("udp-fluent-icon-button",{appearance:"transparent",size:"small",iconName:"delete",ariaLabel:"Delete comment",onClick:()=>u(l.commentId)}))),t("udp-text",{variant:"body2",class:"comment-item__body"},null!==(o=l.value)&&void 0!==o?o:""))}({comment:e,currentUserId:r,onEdit:t=>p(i,t),onDelete:t=>f(i,t)})))),v&&t("div",{class:"comment-thread__draft",onKeyDown:t=>{"Escape"===t.key&&(t.stopPropagation(),m(i))}},t("udp-textarea",{placeholder:"Add a comment",value:null!=l?l:"",autoResize:!0,required:!1,disabled:s,onValueChanged:Pe(i,d)}),t("div",{class:"comment-thread__draft-actions"},t("udp-fluent-button",{appearance:"transparent",size:"small",onClick:()=>m(i)},"Cancel"),t("udp-fluent-button",{appearance:"primary",size:"small",disabled:!b,onClick:()=>c(i)},"Save"))),!v&&!s&&t("udp-fluent-button",{class:"comment-thread__compose-placeholder",appearance:"subtle",size:"small",startIconName:"add",onClick:t=>{t.stopPropagation(),a(i)}},"Add a comment"))}const Be=t=>r({driveFileId:t.driveFileId,name:t.name,extension:t.extension});function ze(t,e){var n;if(null==e||""===e)return"";const i=t.find((t=>t.value===e));return null!==(n=null==i?void 0:i.display)&&void 0!==n?n:String(e)}function Me(t,e){const n=t.map((t=>({display:t.display||String(t.value),selected:e.includes(t.value)})));for(const i of e)"string"==typeof i&&""!==i&&(t.some((t=>t.value===i))||n.push({display:i,selected:!0}));return n}function Qe(e,n){return t("div",{class:"question-view__options",role:"list"},e.map((e=>t("div",{class:{"question-view__option":!0,"question-view__option--selected":e.selected},role:"listitem"},t("udp-fluent-icon",{class:"question-view__option-mark",name:"single"===n?"radio-button":e.selected?"checkbox-checked":"checkbox-unchecked",variant:e.selected?"filled":"regular",size:"sm"}),t("udp-text",{variant:"body1"},e.display)))))}function He(t){if("string"!=typeof t||""===t)return"";const e=new Date(t);return Number.isNaN(e.getTime())?t:e.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function Xe(e){return t("udp-text",{variant:"body1"},""===e?"—":e)}function Ke(t){var e;const n=null!==(e=t.maxDate)&&void 0!==e?e:void 0;if(!0!==t.noFutureDate)return n;const i=(new Date).toISOString().slice(0,10);return n&&n<i?n:i}function Ge(t){if(t)return t.length>5?t.slice(0,5):t}const Je=[{label:"Yes",value:"true"},{label:"No",value:"false"},{label:"Not Applicable",value:"na"}];function We(t,e){return!0===e.formReadOnly||!0===t.readOnly}function Ye(t,e){return We(t,e)||!0===e.previewMode}function Ze(e,n,i,o){return null==o?null:t("div",Object.assign({key:n},function(t,e,n){return{"data-question-id":t.id,"data-field-key":e,class:n.highlightedQuestionId===t.id?"question-card question-card--highlighted":"question-card"}}(e,n,i)),function(e,n,i){const o=function(e,n,i){if(!i.commentsAdapter)return null;if(!Ce(e))return null;const o=i.commentsAdapter.getCount(n),l=o>0;return t("udp-fluent-button",{appearance:"transparent",size:"small",startIconName:"comment","aria-label":`Comments on ${e.questionText||"this question"}${l?` (${o})`:""}`,onClick:t=>{var e;t.stopPropagation(),null===(e=i.commentsAdapter)||void 0===e||e.onToggle(n)}},l?`Comments (${o})`:"Add comment")}(e,n,i),l=function(e,n,i){if(!i.followUpFormsAdapter)return null;if(!Ne(e))return null;const o=null!=i.followUpFormsAdapter.getStampedChildId(n);return t("div",{class:"question-card__follow-up-toggle"},t("udp-fluent-icon-button",{iconName:"link",iconVariant:o?"filled":"regular",size:"small",appearance:"transparent",ariaLabel:o?`Linked follow-up form for ${e.questionText||"this question"}`:`Link a follow-up form to ${e.questionText||"this question"}`,onClick:t=>{var e;t.stopPropagation(),null===(e=i.followUpFormsAdapter)||void 0===e||e.onLaunch(n)}}))}(e,n,i);return o||l?t("div",{class:"question-card__toggles"},l,o):null}(e,n,i),o,function(e,n,i){var o,l,r;const s=i.comments;if(!s)return null;if(!Ce(e))return null;if(!(null===(o=i.commentsAdapter)||void 0===o?void 0:o.isExpanded(n)))return null;const u=null!==(l=s.state.byQuestionId[n])&&void 0!==l?l:[],a=null!==(r=s.state.draftByQuestionId[n])&&void 0!==r?r:null;return t("div",{class:"question-card__inline-comments"},Re({question:e,fieldKey:n,comments:u,draft:a,currentUserId:s.currentUserId,isReadOnly:!0===i.formReadOnly||!0===i.previewMode,hideHeader:!0,onOpenDraft:s.handlers.onOpenDraft,onChangeDraft:s.handlers.onChangeDraft,onSaveDraft:s.handlers.onSaveDraft,onCancelDraft:s.handlers.onCancelDraft,onEdit:s.handlers.onEdit,onDelete:s.handlers.onDelete}))}(e,n,i))}function tn(e){var n,i,o,l,r,s,u,a,d,m,p,f,h,v,b,g,y,x,S,k,_,j,F,q,I,O,C,E,D,N,$,U;const{question:A,context:L}=e,V=null!==(n=e.fieldKey)&&void 0!==n?n:A.id,T=V;if(!0===L.formReadOnly)return function(e){var n,i,o,l,r,s,u,a,d,m,p,f,h,v,b,g;const{question:y,context:x,fieldKey:S,value:k}=e,_=null!==(n=y.questionText)&&void 0!==n?n:"",j=y.required&&_?`${_} *`:_,F=function(e,n,i){var o,l,r;const s=i.comments;if(!s)return null;if(!Ce(e))return null;const u=null!==(o=s.state.byQuestionId[n])&&void 0!==o?o:[],a=null!==(l=s.state.draftByQuestionId[n])&&void 0!==l?l:null,d=null!==(r=i.commentsAdapter)&&void 0!==r?r:null,c=Fe(u).length,m=d?t("udp-fluent-button",{class:"question-view__comment-toggle",appearance:"transparent",size:"small",startIconName:"comment","aria-label":`Comments on ${e.questionText||"this question"}${c>0?` (${c})`:""}`,onClick:t=>{t.stopPropagation(),d.onToggle(n)}},c>0?`Comments (${c})`:"Add comment"):null,p=d?d.isExpanded(n):c>0||null!=a;return m||p?t("div",{class:"question-view__inline-comments"},m,p&&Re({question:e,fieldKey:n,comments:u,draft:a,currentUserId:s.currentUserId,isReadOnly:!0===i.previewMode,hideHeader:!0,onOpenDraft:s.handlers.onOpenDraft,onChangeDraft:s.handlers.onChangeDraft,onSaveDraft:s.handlers.onSaveDraft,onCancelDraft:s.handlers.onCancelDraft,onEdit:s.handlers.onEdit,onDelete:s.handlers.onDelete})):null}(y,S,x);let q;switch(y.fieldTypeId){case c.Hidden:return null;case c.Paragraph:{const e=y.fieldProperties;q=e.paragraphText?t("udp-text",{variant:"body1"},e.paragraphText):null;break}case c.FormMetadataDisplay:{const e=y.fieldProperties,n=x.submission,u=x.currentUser,a=null!==(o=null!==(i=null==n?void 0:n.userDisplayName)&&void 0!==i?i:null==u?void 0:u.displayName)&&void 0!==o?o:"",d=null!==(r=null!==(l=null==n?void 0:n.userEmail)&&void 0!==l?l:null==u?void 0:u.email)&&void 0!==r?r:"",c=null!==(s=null==n?void 0:n.submittedOn)&&void 0!==s?s:null;q=t("form-metadata-display",{userDisplayName:a,userEmail:d,submittedOn:c,displayOwnerFullName:!0===e.displayOwnerFullName,displayOwnerEmail:!0===e.displayOwnerEmail,displaySubmissionDate:!0===e.displaySubmissionDate});break}case c.Tally:{const e=y.fieldProperties;q=t("udp-question-tally-adapter",{loadedForm:x.loadedForm,questionId:y.id,label:j||"Response Tally",tallyMode:null!==(u=e.tallyMode)&&void 0!==u?u:"all",includeFields:null!==(a=e.includeFields)&&void 0!==a?a:[],excludeFields:null!==(d=e.excludeFields)&&void 0!==d?d:[]});break}case c.SingleLineText:case c.MultiLineText:case c.Number:q=Xe(null==k||""===k?"":String(k));break;case c.YesNo:q=Qe([{display:"Yes",selected:"true"===k||!0===k},{display:"No",selected:"false"===k||!1===k},{display:"Not Applicable",selected:"na"===k}],"single");break;case c.RadioButton:case c.DropdownSingleSelect:{const t=Pt(y),e=null==k||""===k?[]:[k];q=0===t.length?Xe(ze(t,k)):Qe(Me(t,e),"single");break}case c.Checkbox:case c.DropdownMultipleSelect:case c.ListMultiSelect:{const t=Pt(y),e=Array.isArray(k)?k:[];q=0===t.length?Xe(e.map((e=>ze(t,e))).filter(Boolean).join(", ")):Qe(Me(t,e),"multi");break}case c.DateSelector:q=Xe(function(t){if("string"!=typeof t||""===t)return"";const e=new Date(10===t.length?`${t}T00:00:00`:t);return Number.isNaN(e.getTime())?t:e.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}(k));break;case c.TimeSelector:q=Xe(function(t){if("string"!=typeof t||""===t)return"";const[e,n]=t.split(":"),i=Number(e),o=Number(n);if(!Number.isFinite(i)||!Number.isFinite(o))return t;const l=new Date;return l.setHours(i,o,0,0),l.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}(k));break;case c.DateTimeSelector:q=Xe(He(k));break;case c.Location:{const e=y.fieldProperties,n=null!=k?k:null,i=w(),o="string"==typeof e.mapZoom?Number(e.mapZoom):e.mapZoom,l=null!=n&&"number"==typeof n.latitude&&"number"==typeof n.longitude&&!!(null==i?void 0:i.tileUrlTemplate),r=null!==(p=null===(m=null==n?void 0:n.address)||void 0===m?void 0:m.freeformAddress)&&void 0!==p?p:"";q=t("div",{class:"question-view__location"},Xe(r),l&&t("udp-fluent-location-input",{value:k,readonly:!0,disabled:!0,showMap:!0,hideAddressSearch:!0,defaultZoom:Number.isFinite(o)?o:void 0,tileUrlTemplate:null==i?void 0:i.tileUrlTemplate,searchAddresses:null==i?void 0:i.searchAddresses,reverseGeocode:null==i?void 0:i.reverseGeocode}));break}case c.FileUpload:q=t("udp-fluent-file-input",{view:"list",value:k,readonly:!0,hideDragAndDrop:!0,hideButton:!0,loadStoredFile:Be});break;case c.ImageUpload:q=t("udp-fluent-file-input",{view:"gallery",accept:"image/*",value:k,readonly:!0,hideDragAndDrop:!0,hideButton:!0,loadStoredFile:Be});break;case c.Signature:{const e=null!=k?k:null,n=null!==(f=null==e?void 0:e.fullName)&&void 0!==f?f:"",i=He(null!==(v=null===(h=null==e?void 0:e.metadata)||void 0===h?void 0:h.timestamp)&&void 0!==v?v:""),o=null===(b=x.signaturePreviewUrls)||void 0===b?void 0:b[S];q=o?t("div",{class:"question-view__signature"},t("udp-fluent-image",{bordered:!0,fit:"contain"},t("img",{class:"question-view__signature-img",src:o,alt:n?`Signature of ${n}`:"Signature"})),(n||i)&&t("div",{class:"question-view__signature-meta"},n&&t("udp-text",{variant:"body1"},n),i&&t("udp-text",{variant:"caption1"},"Signed ",i))):Xe(n);break}case c.Table:{const e=y.fieldProperties;if("domain"===e.dataSource)q=t("udp-fluent-domain-table-input",{value:k,readonly:!0,disabled:!0,columns:Le(e.columns)});else{const n=(null!==(g=e.columns)&&void 0!==g?g:[]).filter((t=>"string"==typeof t.id&&t.id.length>0&&"string"==typeof t.name)).map((t=>({id:t.id,name:t.name,type:"number"===t.type?"number":"text",required:!0===t.required,aggregate:t.aggregate,aggregateDecimalPlaces:t.aggregateDecimalPlaces})));q=t("udp-fluent-table-input",{value:k,readonly:!0,disabled:!0,columns:n})}break}default:q=Xe(null==k?"":String(k))}return t("udp-detail-list-item",{label:j,emptyState:"hide"},q,F)}({question:A,context:L,fieldKey:V,value:null===(i=L.values)||void 0===i?void 0:i[V]});switch(A.fieldTypeId){case c.Hidden:return null;case c.Paragraph:{const e=A.fieldProperties;return Ze(A,V,L,t("udp-flexbox",{display:"flex",direction:"column",gap:"xs"},A.questionText&&t("udp-text",{variant:"body1Strong"},A.questionText),e.paragraphText&&t("udp-text",{variant:"body1"},e.paragraphText)))}case c.SingleLineText:return Ze(A,V,L,t("udp-field",{name:T},t("udp-fluent-text-input",{label:A.questionText,hint:null!==(o=A.helperText)&&void 0!==o?o:void 0,required:A.required,disabled:We(A.fieldProperties,L)})));case c.MultiLineText:return Ze(A,V,L,t("udp-field",{name:T},t("udp-textarea",{label:A.questionText,hint:null!==(l=A.helperText)&&void 0!==l?l:void 0,required:A.required,disabled:We(A.fieldProperties,L),autoResize:!0})));case c.Number:return Ze(A,V,L,t("udp-field",{name:T},t("udp-fluent-text-input",{label:A.questionText,hint:null!==(r=A.helperText)&&void 0!==r?r:void 0,required:A.required,type:"number",disabled:We(A.fieldProperties,L)})));case c.YesNo:return Ze(A,V,L,t("udp-field",{name:T},t("udp-fluent-radio-group",{label:A.questionText,hint:null!==(s=A.helperText)&&void 0!==s?s:void 0,items:Je,disabled:We(A.fieldProperties,L)})));case c.Checkbox:{const e=A.fieldProperties;return Ze(A,V,L,t("udp-field",{name:T},t("udp-fluent-list-input",{label:A.questionText,hint:null!==(u=A.helperText)&&void 0!==u?u:void 0,required:A.required,options:Pt(A),disabled:We(e,L)})))}case c.RadioButton:{const e=A.fieldProperties,n=Pt(A).map((t=>({label:t.display,value:t.value})));return Ze(A,V,L,t("udp-field",{name:T},t("udp-fluent-radio-group",{label:A.questionText,hint:null!==(a=A.helperText)&&void 0!==a?a:void 0,items:n,disabled:We(e,L)})))}case c.DropdownSingleSelect:{const e=A.fieldProperties;return Ze(A,V,L,t("udp-field",{name:T},t("udp-fluent-dropdown",{label:A.questionText,hint:null!==(d=A.helperText)&&void 0!==d?d:void 0,required:A.required,options:Pt(A),optionLabel:"display",optionValue:"value",valueAs:"value",disabled:We(e,L)})))}case c.DropdownMultipleSelect:{const e=A.fieldProperties;return Ze(A,V,L,t("udp-field",{name:T},t("udp-fluent-dropdown",{label:A.questionText,hint:null!==(m=A.helperText)&&void 0!==m?m:void 0,required:A.required,options:Pt(A),optionLabel:"display",optionValue:"value",multiple:!0,valueAs:"value",disabled:We(e,L)})))}case c.ListMultiSelect:{const e=A.fieldProperties;return Ze(A,V,L,t("udp-field",{name:T},t("udp-fluent-list-input",{label:A.questionText,hint:null!==(p=A.helperText)&&void 0!==p?p:void 0,required:A.required,options:Pt(A),disabled:We(e,L)})))}case c.DateSelector:{const e=A.fieldProperties;return Ze(A,V,L,t("udp-field",{name:T},t("udp-date-input",{label:A.questionText,hint:null!==(f=A.helperText)&&void 0!==f?f:void 0,required:A.required,minDate:null!==(h=e.minDate)&&void 0!==h?h:void 0,maxDate:Ke(e),disabled:We(e,L)})))}case c.TimeSelector:{const e=A.fieldProperties;return Ze(A,V,L,t("udp-field",{name:T},t("udp-time-input",{label:A.questionText,hint:null!==(v=A.helperText)&&void 0!==v?v:void 0,required:A.required,min:Ge(e.minTime),max:Ge(e.maxTime),disabled:We(e,L)})))}case c.DateTimeSelector:{const e=A.fieldProperties;return Ze(A,V,L,t("udp-field",{name:T},t("udp-date-time-input",{label:A.questionText,hint:null!==(b=A.helperText)&&void 0!==b?b:void 0,required:A.required,minDate:null!==(g=e.minDateTime)&&void 0!==g?g:void 0,maxDate:Ke({maxDate:e.maxDateTime,noFutureDate:e.noFutureDate}),disabled:We(e,L)})))}case c.FormMetadataDisplay:{const e=A.fieldProperties,n=L.submission,i=L.currentUser,o=null!==(x=null!==(y=null==n?void 0:n.userDisplayName)&&void 0!==y?y:null==i?void 0:i.displayName)&&void 0!==x?x:"",l=null!==(k=null!==(S=null==n?void 0:n.userEmail)&&void 0!==S?S:null==i?void 0:i.email)&&void 0!==k?k:"",r=null!==(_=null==n?void 0:n.submittedOn)&&void 0!==_?_:null;return Ze(A,V,L,t("udp-flexbox",{display:"flex",direction:"column",gap:"xs"},A.questionText&&t("udp-text",{variant:"body1Strong"},A.questionText),t("form-metadata-display",{userDisplayName:o,userEmail:l,submittedOn:r,displayOwnerFullName:!0===e.displayOwnerFullName,displayOwnerEmail:!0===e.displayOwnerEmail,displaySubmissionDate:!0===e.displaySubmissionDate})))}case c.Tally:{const e=A.fieldProperties;return Ze(A,V,L,t("udp-question-tally-adapter",{loadedForm:L.loadedForm,questionId:A.id,label:A.questionText||"Response Tally",tallyMode:null!==(j=e.tallyMode)&&void 0!==j?j:"all",includeFields:null!==(F=e.includeFields)&&void 0!==F?F:[],excludeFields:null!==(q=e.excludeFields)&&void 0!==q?q:[]}))}case c.Location:{const e=A.fieldProperties,n=w(),i="string"==typeof e.mapZoom?Number(e.mapZoom):e.mapZoom;return Ze(A,V,L,t("udp-field",{name:T},t("udp-fluent-location-input",{label:A.questionText,hint:null!==(I=A.helperText)&&void 0!==I?I:void 0,required:A.required,disabled:We(e,L),showMap:!0===e.showMap,hideAddressSearch:!0===e.hideAddressSearch,defaultZoom:Number.isFinite(i)?i:void 0,tileUrlTemplate:null==n?void 0:n.tileUrlTemplate,searchAddresses:null==n?void 0:n.searchAddresses,reverseGeocode:null==n?void 0:n.reverseGeocode})))}case c.FileUpload:{const e=A.fieldProperties;return Ze(A,V,L,t("udp-field",{name:T},t("udp-fluent-file-input",{view:"list",label:A.questionText,hint:null!==(O=A.helperText)&&void 0!==O?O:void 0,required:A.required,disabled:Ye(e,L),hideDragAndDrop:!0===e.hideDragAndDrop,hideButton:!0===e.hideButton,displayUploadTime:!0===e.displayUploadTime,maxFiles:!0===e.allowMultiple?void 0:1})))}case c.ImageUpload:{const e=A.fieldProperties;return Ze(A,V,L,t("udp-field",{name:T},t("udp-fluent-file-input",{view:"gallery",accept:"image/*",label:A.questionText,hint:null!==(C=A.helperText)&&void 0!==C?C:void 0,required:A.required,disabled:Ye(e,L),hideDragAndDrop:!0===e.hideDragAndDrop,hideButton:!0===e.hideButton,displayUploadTime:!0===e.displayUploadTime,maxFiles:!0===e.allowMultiple?void 0:1})))}case c.Signature:{const e=A.fieldProperties;return Ze(A,V,L,t("udp-field",{name:T},t("udp-fluent-signature-input",{label:A.questionText,hint:null!==(E=A.helperText)&&void 0!==E?E:void 0,required:A.required,disabled:Ye(e,L),includeLocation:!0===e.includeLocation})))}case c.Table:{const e=A.fieldProperties;if("domain"===e.dataSource)return Ze(A,V,L,t("udp-field",{name:T},t("udp-fluent-domain-table-input",{label:A.questionText,hint:null!==(D=A.helperText)&&void 0!==D?D:void 0,required:A.required,disabled:We(e,L),columns:Le(e.columns),domainLookupId:e.domainLookupId,filters:null!==(N=L.domainFilters)&&void 0!==N?N:[],allowAddRows:!0===e.allowAddRows})));const n=(null!==($=e.columns)&&void 0!==$?$:[]).filter((t=>"string"==typeof t.id&&t.id.length>0&&"string"==typeof t.name)).map((t=>({id:t.id,name:t.name,type:"number"===t.type?"number":"text",required:!0===t.required,aggregate:t.aggregate,aggregateDecimalPlaces:t.aggregateDecimalPlaces})));return Ze(A,V,L,t("udp-field",{name:T},t("udp-fluent-table-input",{label:A.questionText,hint:null!==(U=A.helperText)&&void 0!==U?U:void 0,required:A.required,disabled:We(e,L),columns:n})))}default:return function(e,n,i){return Ze(e,n,i,t("udp-flexbox",{display:"flex",direction:"column",gap:"xs"},t("udp-text",{variant:"body1Strong"},e.questionText),t("udp-text",{variant:"caption1",color:"muted"},"FieldType ",e.fieldTypeId," not yet supported in pass 1",e.helperText?` — ${e.helperText}`:"")))}(A,V,L)}}function en(e){const{isOpen:n,options:i,selectedFormId:o,isLoading:l,isLaunching:r,onSelect:s,onLaunch:u,onClose:a}=e,d=()=>{r||a()};return t("udp-fluent-dialog",{open:n,dialogTitle:"Link a follow-up form",maxHeight:"60vh",onDialogClose:d},function(e,n,i){return i?t("udp-text",{variant:"body1"},"Loading follow-up forms…"):0===e.length?t("udp-text",{variant:"body1"},"No follow-up forms are available for this question."):t("udp-list",{selectionMode:"single",showDivider:!0,selectedItems:n?[n]:[],onListSelectionChange:t=>{t.stopPropagation();const e=t.detail.selectedItems[0];"string"==typeof e&&s(e)}},e.map((e=>t("udp-fluent-list-item",{key:e.value,value:e.value,label:e.label}))))}(i,o,l),t("udp-fluent-button",{slot:"action",appearance:"secondary",disabled:r,onClick:d},"Cancel"),t("udp-fluent-button",{slot:"action",appearance:"primary",disabled:!o||r||l,onClick:()=>u()},r?"Creating…":"Create"))}const nn="udp-question-form-renderer-form";const on=e(class extends n{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.submitted=i(this,"submitted",7),this.tenantId=null,this.isPublicMode=!1,this.history=null,this.urlContext={},this.domainTableFilters=null,this.autoSaveDelay=2e3,this.previewMode=!1,this.highlightedQuestionId=null,this.readOnly=!1,this.resolvedForm=null,this.submission=null,this.initialValues={},this.signaturePreviewUrls={},this.isLoading=!0,this.dynamicSections=[],this.publicModeError=null,this.loadError=null,this.currentUser=null,this.templateOverrides=null,this.commentsState={byQuestionId:{},draftByQuestionId:{},editingCommentIdByQuestionId:{}},this.expandedCommentPanels={},this.followUpPickerOpen=!1,this.followUpPickerQuestionId=null,this.followUpPickerSelectedFormId=null,this.followUpFormsList=[],this.followUpFormsListLoaded=!1,this.followUpFormsListLoading=!1,this.followUpLaunching=!1,this.hostResizeObserver=null,this.hostBoundsUpdateListener=null,this.submitInFlight=!1,this.pendingResave=!1,this.prevSubmitFailed=!1,this.formApi=null,this.autosaveTimer=null,this.lastSavedValues=null,this.formComponentEl=null,this.autosaveStatus="idle",this.lastSavedAt=null,this.progress={answered:0,total:0},this.handleFormComponentRef=t=>{this.formComponentEl=t},this.runAutosave=async()=>{if(this.autosaveTimer=null,!this.formApi)return;if(this.submitInFlight)return void(this.pendingResave=!0);const t=this.formApi.getState().values;await this.submitToBackend(t,Ht.InProgress,{rebuildComments:!1,showErrorSnackbar:!1})},this.handleSubmitClick=()=>{this.clearAutosaveTimer()},this.handleSubmit=async t=>{var e;this.clearAutosaveTimer(),this.previewMode?this.notifyPreviewNotSaved("Preview only — submission not saved."):(await this.flushOpenDrafts(),await this.submitToBackend(t,Ht.Submitted,{rebuildComments:!0,showErrorSnackbar:!0})&&(null===(e=this.submission)||void 0===e?void 0:e.id)&&this.submitted.emit(this.submission.id))},this.handleAddSection=t=>{if(!this.resolvedForm||!this.formApi)return;if(this.isReadOnly||this.previewMode)return;let e;try{e=function(t,e){var n;const i=t.filter((t=>t.schemaSection.id===e));if(0===i.length)throw new Error(`duplicateSection: no instances found for schema section ${e}`);const o=i[0].schemaSection;if(!0!==(null===(n=o.sectionProperties)||void 0===n?void 0:n.isRepeatable))throw new Error(`duplicateSection: schema section ${e} is not marked repeatable`);const l=he(o,Math.max(...i.map((t=>t.suffix)))+1),r=t.lastIndexOf(i[i.length-1]);return{next:[...t.slice(0,r+1),l,...t.slice(r+1)],newInstance:l}}(this.dynamicSections,t)}catch(t){return void console.warn("[udp-question-form-renderer] duplicateSection refused:",t)}const n=Se([e.newInstance],null),i=this.formApi;i.batch((()=>{for(const[t,e]of Object.entries(n))i.change(t,e)})),this.dynamicSections=e.next},this.handleDeleteSection=t=>{if(!this.resolvedForm||!this.formApi)return;if(this.isReadOnly||this.previewMode)return;const e=this.dynamicSections.find((e=>e.instanceId===t));if(!e||e.isOriginal)return;const n=e.questions.map((t=>t.fieldKey)),i=this.formApi;i.batch((()=>{for(const t of n)i.change(t,void 0)}));try{this.dynamicSections=function(t,e){const n=t.findIndex((t=>t.instanceId===e));if(n<0)return t;const i=t[n];if(i.isOriginal)throw new Error("deleteSection: refusing to delete the original copy of a section (legacy invariant).");const o=i.schemaSection.id,l=t.filter(((t,e)=>e!==n));let r=2;return l.map((t=>{if(t.schemaSection.id!==o||t.isOriginal)return t;const e=r++;return e===t.suffix?t:Object.assign(Object.assign({},t),{suffix:e,slotName:`${t.schemaSection.name}_${e}`})}))}(this.dynamicSections,t)}catch(t){return void console.warn("[udp-question-form-renderer] deleteSection refused:",t)}this.commentsState=function(t,e){if(0===e.length)return t;const n=new Set(e),i=t=>{const e={};for(const i of Object.keys(t))n.has(i)||(e[i]=t[i]);return e};return{byQuestionId:i(t.byQuestionId),draftByQuestionId:i(t.draftByQuestionId),editingCommentIdByQuestionId:i(t.editingCommentIdByQuestionId)}}(this.commentsState,n)},this.toggleQuestionComments=t=>{var e;const n=!0===this.expandedCommentPanels[t];if(this.expandedCommentPanels=Object.assign(Object.assign({},this.expandedCommentPanels),{[t]:!n}),!n){Fe(null!==(e=this.commentsState.byQuestionId[t])&&void 0!==e?e:[]).length>0||null!=this.commentsState.draftByQuestionId[t]||(this.commentsState=qe(this.commentsState,t,""))}},this.isCommentsPanelExpanded=t=>!0===this.expandedCommentPanels[t],this.openDraft=t=>{this.commentsState=qe(this.commentsState,t,"")},this.changeDraft=(t,e)=>{var n;const i=null!==(n=this.commentsState.editingCommentIdByQuestionId[t])&&void 0!==n?n:null;this.commentsState=qe(this.commentsState,t,e,i)},this.cancelDraft=t=>{this.commentsState=qe(this.commentsState,t,null)},this.saveDraft=async t=>{var e,n,i,o;if(this.previewMode)return null;const l=this.commentsState.draftByQuestionId[t];if(null==l||0===l.trim().length)return null;if(!this.resolvedForm)return null;const r=null!==(e=this.commentsState.editingCommentIdByQuestionId[t])&&void 0!==e?e:null,u=null===(n=this.submission)||void 0===n?void 0:n.id,a={submissionId:u,isPublicMode:this.isPublicMode},d=Oe(this.dynamicSections,t);if(r){const e=(null!==(i=this.commentsState.byQuestionId[t])&&void 0!==i?i:[]).find((t=>t.commentId===r));if(!e)return this.saveDraftAsNew(t,l);const n=Object.assign(Object.assign({},e),{value:l,editedTimestamp:(new Date).toISOString(),isDeleted:!1}),c=e;if(this.commentsState=Ie(this.commentsState,t,r,n),this.commentsState=qe(this.commentsState,t,null),!u||!d)return n;try{return await async function(t,e,n){if(t.isPublicMode)throw new Error("Comment updates are not supported in public mode.");const i=`${De(t)}/${e}`;await s("PUT",i,n,!0)}(a,r,{sectionKey:d.sectionKey,questionKey:d.questionKey,value:l}),n}catch(e){return console.error("[udp-question-form-renderer] putComment failed:",e),this.commentsState=Ie(this.commentsState,t,r,c),null===(o=this.enqueueSnackbar)||void 0===o||o.call(this,"Failed to update comment.",{variant:"error"}),null}}return this.saveDraftAsNew(t,l)},this.editComment=(t,e)=>{var n,i;const o=(null!==(n=this.commentsState.byQuestionId[t])&&void 0!==n?n:[]).find((t=>t.commentId===e));o&&(this.commentsState=qe(this.commentsState,t,null!==(i=o.value)&&void 0!==i?i:"",e))},this.deleteComment=async(t,e)=>{var n,i,o;if(this.previewMode)return;if(!(null!==(n=this.commentsState.byQuestionId[t])&&void 0!==n?n:[]).find((t=>t.commentId===e)))return;this.commentsState=function(t,e,n){return Ie(t,e,n,{isDeleted:!0,value:"",editedTimestamp:(new Date).toISOString()})}(this.commentsState,t,e);const l=null===(i=this.submission)||void 0===i?void 0:i.id;if(l)try{await async function(t,e){if(t.isPublicMode)throw new Error("Comment deletion is not supported in public mode.");const n=`${De(t)}/${e}`;await s("DELETE",n,null,!0)}({submissionId:l,isPublicMode:this.isPublicMode},e)}catch(n){console.error("[udp-question-form-renderer] deleteComment failed:",n),this.commentsState=Ie(this.commentsState,t,e,{isDeleted:!1}),null===(o=this.enqueueSnackbar)||void 0===o||o.call(this,"Failed to delete comment.",{variant:"error"})}},this.getCommentCount=t=>Fe(this.commentsState.byQuestionId[t]).length,this.getFollowUpStampedChildId=t=>{var e,n,i,o;if(!this.resolvedForm||!this.submission)return null;const l=Oe(this.dynamicSections,t);if(!l)return null;const r=null===(e=this.submission.data.responses[l.sectionKey])||void 0===e?void 0:e[l.questionKey];return null!==(o=null!==(i=null===(n=null==r?void 0:r.metadata)||void 0===n?void 0:n.followUpFormSubmissionId)&&void 0!==i?i:null)&&void 0!==o?o:null},this.handleLaunchFollowUpForm=async t=>{if(this.isPublicMode)return;if(this.previewMode)return void this.notifyPreviewNotSaved("Preview only — this action is not saved.");const e=this.getFollowUpStampedChildId(t);if(e)await this.openStampedFollowUp(e);else if(this.followUpPickerQuestionId=t,this.followUpPickerSelectedFormId=null,this.followUpPickerOpen=!0,!this.followUpFormsListLoaded&&!this.followUpFormsListLoading){this.followUpFormsListLoading=!0;try{this.followUpFormsList=await Bt(),this.followUpFormsListLoaded=!0}finally{this.followUpFormsListLoading=!1}}},this.handleFollowUpSelect=t=>{this.followUpPickerSelectedFormId=t},this.handleFollowUpClose=()=>{this.followUpLaunching||(this.followUpPickerOpen=!1,this.followUpPickerQuestionId=null,this.followUpPickerSelectedFormId=null)},this.handleFollowUpLaunch=async()=>{var t,e,n,i,o,l,r;if(!this.resolvedForm)return;const u=this.followUpPickerQuestionId,a=this.followUpPickerSelectedFormId;if(u&&a&&!this.followUpLaunching){this.followUpLaunching=!0;try{if(!(null===(t=this.submission)||void 0===t?void 0:t.id)&&(await this.runAutosave(),!(null===(e=this.submission)||void 0===e?void 0:e.id)))return void(null===(n=this.enqueueSnackbar)||void 0===n||n.call(this,"Could not save the form before launching the follow-up. Try again.",{variant:"error"}));const r=this.submission,d=await this.fetchLatestFormVersion(a);if(null==d)return void(null===(i=this.enqueueSnackbar)||void 0===i||i.call(this,"Could not load the selected follow-up form.",{variant:"error"}));const c=await async function(t){const e=`${m.productV1ApiUrl}/UdpForm/${t.childFormId}/describe?formVersion=${t.childFormVersion}`,n=await s("GET",e),i=g(n),o=(new Date).toISOString(),l={};for(const t of i.sections){l[t.name]={};for(const e of t.questions)l[t.name][e.name]={value:"",comments:[]}}const r=ke({FormId:t.childFormId,FormVersion:t.childFormVersion,Status:Ht.InProgress,InitialCreatedOn:o,LastModifiedOn:o,Data:{submissionResponseData:l,submissionMetadata:{parentSubmission:{submissionId:t.parentSubmissionId,formId:t.parentFormId,formVersion:t.parentFormVersion}},formTemplateOverrides:null}}),u=`${m.productV1ApiUrl}/UdpFormSubmission/private`;return ae(await s("POST",u,r,!0),i)}({childFormId:a,childFormVersion:d,parentSubmissionId:r.id,parentFormId:r.formId,parentFormVersion:r.formVersion}),p=null!==(l=null===(o=this.formApi)||void 0===o?void 0:o.getState().values)&&void 0!==l?l:{},f=await async function(t){const{loadedForm:e,parent:n,dynamicSections:i,values:o,questionId:l,childSubmissionId:r}=t,s=Oe(i||e,l);if(!s)throw new Error(`stampFollowUpOnParent: question ${l} not in schema.`);return _e({loadedForm:e,dynamicSections:i,current:Object.assign(Object.assign({},n),{wireResponseData:$e(n.wireResponseData,s.sectionKey,s.questionKey,{followUpFormSubmissionId:r})}),values:o,status:n.status,isPublicMode:!1})}({loadedForm:this.resolvedForm,dynamicSections:this.dynamicSections,parent:r,values:p,questionId:u,childSubmissionId:c.id});if(this.submission=f,"undefined"!=typeof window){const t=Ue({currentPathname:window.location.pathname,parentFormId:r.formId,childFormId:a,childSubmissionId:c.id});window.open(t,"_blank")}this.followUpPickerOpen=!1,this.followUpPickerQuestionId=null,this.followUpPickerSelectedFormId=null}catch(t){console.error("[udp-question-form-renderer] follow-up launch failed:",t),null===(r=this.enqueueSnackbar)||void 0===r||r.call(this,"Could not launch follow-up form.",{variant:"error"})}finally{this.followUpLaunching=!1}}}}async componentWillLoad(){var t;if(this.loadedForm&&(this.resolvedForm=this.loadedForm),this.isPublicMode&&!this.previewMode&&!this.tenantId)return this.publicModeError="Public forms require a tenantId.",void(this.isLoading=!1);const e=this.submissionId&&!this.previewMode&&!this.isPublicMode,n=!(!e||this.loadedForm||this.formId&&null!=this.formVersion);let i=null;n&&(i=await this.fetchAndLogSubmissionRaw(),(null==i?void 0:i.formId)&&(this.formId=i.formId,this.formVersion=null!==(t=i.formVersion)&&void 0!==t?t:null));const o=!this.loadedForm&&!!this.formId,[l,r]=await Promise.all([o?this.fetchAndLogDescribe():Promise.resolve(null),e&&!n?this.fetchAndLogSubmissionRaw():Promise.resolve(i)]);try{if(l&&(this.resolvedForm=l),r&&this.resolvedForm?this.submission=this.parseAndLogSubmission(r,this.resolvedForm):r&&!this.resolvedForm&&console.warn("[udp-question-form-renderer] cannot parse submission without form schema"),this.isPublicMode&&!this.previewMode&&this.resolvedForm&&!0===this.resolvedForm.form.isPrivate)return this.publicModeError="This form is not available publicly.",this.resolvedForm=null,void(this.isLoading=!1);if(this.resolvedForm){this.dynamicSections=fe({loadedForm:this.resolvedForm,submission:this.submission,urlContext:this.previewMode?null:this.urlContext});const t=Se(this.dynamicSections,this.submission);this.initialValues=this.previewMode?t:function(t,e,n,i){var o;if(i.hasExistingSubmission)return e;if(!n)return e;const l=function(t){const e=[];for(const n of Object.keys(t)){const i=n.toLowerCase();if(!i.startsWith("seed_"))continue;const o=i.slice(5),l=o.indexOf(".");if(l<=0||l===o.length-1)continue;const r=o.slice(0,l),s=o.slice(l+1),u=t[n];"string"==typeof u&&e.push({sectionSlot:r,questionSlot:s,rawValue:u})}return e}(n);if(0===l.length)return e;const r=null!==(o=i.dynamicSections)&&void 0!==o?o:fe({loadedForm:t,submission:null,urlContext:n}),s=Object.assign({},e);for(const{sectionSlot:t,questionSlot:e,rawValue:n}of l){const i=we(r,t,e);if(!i)continue;if(!h(s[i.question.fieldKey]))continue;const o=oe(i.question.schemaQuestion.fieldTypeId,n);null!=o&&(s[i.question.fieldKey]=o)}return s}(this.resolvedForm,t,this.urlContext,{hasExistingSubmission:null!=this.submission&&this.submission.status!==Ht.Created,dynamicSections:this.dynamicSections}),this.lastSavedValues=this.initialValues,this.commentsState=je(this.dynamicSections,this.submission);const e={};for(const t of Object.keys(this.commentsState.byQuestionId))Fe(this.commentsState.byQuestionId[t]).length>0&&(e[t]=!0);this.expandedCommentPanels=e,this.progress=Ae(this.dynamicSections,this.initialValues)}this.currentUser=this.resolveCurrentUser(),this.templateOverrides=this.resolveTemplateOverrides()}catch(t){console.error("[udp-question-form-renderer] failed to initialize form:",t),this.loadError="Could not load this form. Please refresh and try again.",this.resolvedForm=null,this.submission=null,this.dynamicSections=[]}!this.resolvedForm||this.previewMode||this.isReadOnly||(this.initialValues=await async function(t,e,n){const i=t.flatMap((t=>t.questions.filter((t=>y(t.schemaQuestion.fieldTypeId,t.schemaQuestion.fieldProperties))))),o=Object.assign({},e);return await Promise.all(i.map((async({schemaQuestion:t,fieldKey:e})=>{const i=o[e];if(x(i))return;const l=t.fieldProperties;if(!(null==l?void 0:l.domainLookupId))return;const r=await S(l.domainLookupId,n);r&&0!==r.length&&(o[e]=k(r,i,Le(l.columns)))}))),o}(this.dynamicSections,this.initialValues,this.domainFilters),this.lastSavedValues=this.initialValues,this.progress=Ae(this.dynamicSections,this.initialValues)),this.isLoading=!1,this.loadSignaturePreviews()}async loadSignaturePreviews(){var t,e,n;if(!this.isReadOnly)return;const i={};for(const o of this.dynamicSections)for(const l of o.questions){if(l.schemaQuestion.fieldTypeId!==c.Signature)continue;const o=this.initialValues[l.fieldKey],s=zt(null!==(t=null==o?void 0:o.file)&&void 0!==t?t:null);if(s)try{const t=await r({driveFileId:s,name:null!==(n=null===(e=null==o?void 0:o.file)||void 0===e?void 0:e.name)&&void 0!==n?n:"signature.png",extension:"png"});t&&t.size>0&&(i[l.fieldKey]=URL.createObjectURL(t))}catch(t){}}Object.keys(i).length>0&&(this.revokeSignaturePreviews(),this.signaturePreviewUrls=i)}revokeSignaturePreviews(){for(const t of Object.values(this.signaturePreviewUrls))URL.revokeObjectURL(t)}get domainFilters(){var t;return this.previewMode?[]:null!==(t=this.domainTableFilters)&&void 0!==t?t:[]}urlContextValue(t){const e=this.urlContext;if(!e||"object"!=typeof e)return null;const n=t.toLowerCase();for(const t of Object.keys(e))if(t.toLowerCase()===n){const n=e[t];if(null==n)return null;if("string"!=typeof n&&"number"!=typeof n&&"boolean"!=typeof n)return null;const i=String(n).trim();return i.length>0?i:null}return null}resolveTemplateOverrides(){var t,e,n,i;const o=null!==(e=null===(t=this.submission)||void 0===t?void 0:t.data.templateOverrides)&&void 0!==e?e:null;if(o&&(o.formName||o.formDescription))return{formName:null!==(n=o.formName)&&void 0!==n?n:null,formDescription:null!==(i=o.formDescription)&&void 0!==i?i:null};if(this.previewMode)return null;const l=this.urlContextValue("override_formname"),r=this.urlContextValue("override_formdescription");return l||r?this.submission&&this.submission.status!==Ht.Created?null:{formName:l,formDescription:r}:null}resolveGenericContext(){const t=this.urlContextValue("generic1"),e=this.urlContextValue("generic2"),n=this.urlContextValue("generic3");if(t||e||n)return{generic1:t,generic2:e,generic3:n}}resolveCurrentUser(){var t,e,n,i;if("function"!=typeof this.getUserCallback)return null;try{const o=this.getUserCallback();return o?{id:null!==(t=o.id)&&void 0!==t?t:null,displayName:null!==(n=null!==(e=o.displayName)&&void 0!==e?e:o.name)&&void 0!==n?n:null,email:null!==(i=o.email)&&void 0!==i?i:null}:null}catch(t){return null}}handleLoadedFormChange(t){t&&(this.resolvedForm=t,this.dynamicSections=fe({loadedForm:t,submission:this.submission,urlContext:this.previewMode?null:this.urlContext}),this.initialValues=Se(this.dynamicSections,this.submission),this.commentsState=je(this.dynamicSections,this.submission),this.progress=Ae(this.dynamicSections,this.initialValues))}handleHighlightedQuestionIdChange(){this.scrollHighlightedIntoView()}handleGetUserCallbackChange(){this.currentUser=this.resolveCurrentUser()}componentDidLoad(){this.highlightedQuestionId&&this.scrollHighlightedIntoView(),this.installHostBoundsTracker()}installHostBoundsTracker(){if(!this.el)return;const t=()=>{const t=this.el.getBoundingClientRect();this.el.style.setProperty("--udpqf-host-left",`${t.left}px`),this.el.style.setProperty("--udpqf-host-width",`${t.width}px`)};t(),"undefined"!=typeof ResizeObserver&&(this.hostResizeObserver=new ResizeObserver(t),this.hostResizeObserver.observe(this.el)),this.hostBoundsUpdateListener=t,window.addEventListener("resize",this.hostBoundsUpdateListener),window.addEventListener("scroll",this.hostBoundsUpdateListener,{passive:!0,capture:!0})}teardownHostBoundsTracker(){this.hostResizeObserver&&(this.hostResizeObserver.disconnect(),this.hostResizeObserver=null),this.hostBoundsUpdateListener&&(window.removeEventListener("resize",this.hostBoundsUpdateListener),window.removeEventListener("scroll",this.hostBoundsUpdateListener,{capture:!0}),this.hostBoundsUpdateListener=null)}scrollHighlightedIntoView(){const t=this.highlightedQuestionId;t&&requestAnimationFrame((()=>{var e;const n=null===(e=this.el)||void 0===e?void 0:e.shadowRoot;if(!n)return;const i=n.querySelector(`[data-question-id="${t}"]`);null==i||i.scrollIntoView({block:"nearest",behavior:"smooth"})}))}buildDescribeUrl(){const t=m.productV1ApiUrl,e=new URLSearchParams;if(null!=this.formVersion&&e.set("formVersion",String(this.formVersion)),this.isPublicMode){this.tenantId&&e.set("tenantId",String(this.tenantId));const n=e.toString();return`${t}/UdpForm/${this.formId}/describe/public${n?`?${n}`:""}`}const n=e.toString();return`${t}/UdpForm/${this.formId}/describe${n?`?${n}`:""}`}async fetchAndLogDescribe(){const t=this.buildDescribeUrl();try{const e=await s("GET",t);return g(e)}catch(t){return console.error("[udp-question-form-renderer] /describe failed:",t),null}}async fetchAndLogSubmissionRaw(){const t=`${m.productV1ApiUrl}/UdpFormSubmission/${this.submissionId}/Full`;try{return await s("GET",t)}catch(t){return console.error("[udp-question-form-renderer] /UdpFormSubmission failed:",t),null}}parseAndLogSubmission(t,e){return ae(t,e)}handleFormReady(t){this.isFromRendererForm(t)&&(this.formApi=t.detail)}isFromRendererForm(t){var e,n;return(null!==(n=null===(e=t.composedPath)||void 0===e?void 0:e.call(t)[0])&&void 0!==n?n:t.target)===this.formComponentEl}get isReadOnly(){var t;return!(!this.readOnly&&(null===(t=this.submission)||void 0===t?void 0:t.status)!==Ht.Submitted)||this.isViewedByNonOwner}get isViewedByNonOwner(){var t,e,n,i;if(this.isPublicMode)return!1;const o=null!==(e=null===(t=this.submission)||void 0===t?void 0:t.unityUserId)&&void 0!==e?e:null,l=null!==(i=null===(n=this.currentUser)||void 0===n?void 0:n.id)&&void 0!==i?i:null;return null!=o&&null!=l&&String(o).toLowerCase()!==String(l).toLowerCase()}clearAutosaveTimer(){null!=this.autosaveTimer&&(clearTimeout(this.autosaveTimer),this.autosaveTimer=null)}async submitToBackend(t,e,n){var i,o,l,r;if(!this.resolvedForm||this.submitInFlight)return!1;if(this.previewMode||this.isReadOnly)return!1;this.submitInFlight=!0,this.autosaveStatus="saving";const s=!(null===(i=this.submission)||void 0===i?void 0:i.id);let u=!1;try{const i=await _e({loadedForm:this.resolvedForm,dynamicSections:this.dynamicSections,current:this.submission,values:t,status:e,isPublicMode:this.isPublicMode,tenantId:this.tenantId,generic:this.resolveGenericContext(),templateOverrides:null!==(o=this.templateOverrides)&&void 0!==o?o:void 0,commentsByQuestionId:this.commentsState.byQuestionId});return this.submission=i,this.lastSavedValues=t,n.rebuildComments&&(this.commentsState=je(this.dynamicSections,i)),e===Ht.Submitted&&(this.initialValues=Se(this.dynamicSections,i),this.loadSignaturePreviews()),s&&i.id&&(null===(l=this.el)||void 0===l?void 0:l.isConnected)&&function(t,e){if("undefined"==typeof window)return;const n=`${window.location.pathname}?udpf_submissionId=${t}${window.location.hash}`;if(e){if(function(t){return"object"==typeof t&&null!==t&&"replace"in t&&"function"==typeof t.replace}(e))return void e.replace(n);if(function(t){return"object"==typeof t&&null!==t&&"push"in t&&"function"==typeof t.push}(e))return void e.push(n);if("function"==typeof e){try{e(n,{replace:!0})}catch(t){console.debug("[udp-question-form] history(url, opts) threw; retrying with (url) only.",t);try{e(n)}catch(t){console.warn("[udp-question-form] host history callable rejected both signatures; using native window.history.replaceState as a fallback.",t)}}return}}window.history.replaceState({},"",n)}(i.id,this.history),this.lastSavedAt=new Date,this.autosaveStatus="saved",u=!0,!0}catch(t){return console.error("[udp-question-form-renderer] submit failed:",t),this.autosaveStatus="error",n.showErrorSnackbar&&(null===(r=this.enqueueSnackbar)||void 0===r||r.call(this,"There was an error submitting this form.",{variant:"error"})),!1}finally{this.submitInFlight=!1;const t=this.pendingResave;this.pendingResave=!1,(u||t)&&this.resaveIfStale()}}resaveIfStale(){this.formApi&&null!=this.lastSavedValues&&(ln(this.formApi.getState().values,this.lastSavedValues)||this.runAutosave())}getValidator(){if(this.resolvedForm&&0!==this.dynamicSections.length)return this.cachedValidatorFor!==this.dynamicSections&&(this.cachedValidator=function(t){const e=Array.isArray(t)?t:fe({loadedForm:t,submission:null});return t=>{const n=function(t={}){return Object.assign({now:()=>new Date,resolveLookupOptions:()=>null,allValues:{}},t)}({allValues:t});return function(t,e){const n=[],i=[],o={};for(const l of t){const t=Rt(l.question,l.value,e);for(const e of t){const t={fieldKey:l.fieldKey,questionId:l.question.id,sectionName:l.sectionName,questionName:l.question.name,questionText:l.question.questionText,ruleType:e.ruleType,message:e.message,severity:e.severity};"warning"===e.severity?i.push(t):(n.push(t),null==o[l.fieldKey]&&(o[l.fieldKey]=e.message))}}return{ok:0===n.length,errors:n,warnings:i,errorsByFieldKey:o}}(function(t,e){const n=[];for(const i of t)for(const t of i.questions)n.push({fieldKey:t.fieldKey,sectionName:i.slotName,question:t.schemaQuestion,value:e[t.fieldKey]});return n}(e,t),n).errorsByFieldKey}}(this.dynamicSections),this.cachedValidatorFor=this.dynamicSections),this.cachedValidator}notifyPreviewNotSaved(t){var e;null===(e=this.enqueueSnackbar)||void 0===e||e.call(this,t,{variant:"info"})}handleFormStateUpdated(t){var e,n;if(!this.isFromRendererForm(t))return;const i=t.detail;if(i.submitFailed&&!this.prevSubmitFailed){const t=Object.keys(null!==(e=i.errors)&&void 0!==e?e:{}).length;null===(n=this.enqueueSnackbar)||void 0===n||n.call(this,`Please fix ${t} issue${1===t?"":"s"} before submitting.`,{variant:"error"}),this.scrollToFirstError(i.errors)}this.prevSubmitFailed=i.submitFailed,this.progress=Ae(this.dynamicSections,i.values),this.maybeScheduleAutosave(i)}scrollToFirstError(t){if(!t||0===Object.keys(t).length)return;const e=function(t,e){for(const n of t)for(const t of n.questions)if(e[t.fieldKey])return t.fieldKey;return null}(this.dynamicSections,t);e&&requestAnimationFrame((()=>{var t;const n=null===(t=this.el)||void 0===t?void 0:t.shadowRoot;if(!n)return;const i=n.querySelector(`[data-field-key="${e}"]`);i&&(i.scrollIntoView({block:"center",behavior:"smooth"}),function(t){const e=t.querySelector("udp-field"),n=null==e?void 0:e.firstElementChild;if(n&&"function"==typeof n.focus)return void n.focus({preventScroll:!0});const i=t.querySelector('input, textarea, select, [tabindex]:not([tabindex="-1"])');null==i||i.focus({preventScroll:!0})}(i))}))}maybeScheduleAutosave(t){if(this.previewMode||this.isReadOnly)return;if(this.isPublicMode)return;if(t.submitting)return;if(null==this.lastSavedValues)return;if(ln(t.values,this.lastSavedValues))return void this.clearAutosaveTimer();if(!this.resolvedForm||!this.formApi)return;const e=Math.max(0,this.autoSaveDelay);this.clearAutosaveTimer(),this.autosaveTimer=setTimeout((()=>{this.runAutosave()}),e)}disconnectedCallback(){queueMicrotask((()=>{var t;if(null===(t=this.el)||void 0===t?void 0:t.isConnected)return;const e=null!=this.autosaveTimer;this.clearAutosaveTimer(),e&&this.runAutosave(),this.teardownHostBoundsTracker(),this.revokeSignaturePreviews()}))}async saveDraftAsNew(t,e){var n,i,o,l,r,u,a;if(this.previewMode)return null;if(!this.resolvedForm)return null;const d=function(t,e){var n,i;const o=(new Date).toISOString();return{commentId:f(),userDisplayName:null!==(n=e.displayName)&&void 0!==n?n:null,userId:null!==(i=e.id)&&void 0!==i?i:null,timestamp:o,editedTimestamp:o,isDeleted:!1,value:null!=t?t:""}}(e,{id:null!==(i=null===(n=this.currentUser)||void 0===n?void 0:n.id)&&void 0!==i?i:null,displayName:null!==(l=null===(o=this.currentUser)||void 0===o?void 0:o.displayName)&&void 0!==l?l:null});this.commentsState=function(t,e,n){var i;const o=null!==(i=t.byQuestionId[e])&&void 0!==i?i:[];return Object.assign(Object.assign({},t),{byQuestionId:Object.assign(Object.assign({},t.byQuestionId),{[e]:[...o,n]}),draftByQuestionId:Object.assign(Object.assign({},t.draftByQuestionId),{[e]:null}),editingCommentIdByQuestionId:Object.assign(Object.assign({},t.editingCommentIdByQuestionId),{[e]:null})})}(this.commentsState,t,d);const c=null===(r=this.submission)||void 0===r?void 0:r.id;if(!c)return d;const m=Oe(this.dynamicSections,t);if(!m)return d;try{return await async function(t,e){const n=function(t,e){if(!e.isPublicMode||!e.tenantId)return t;const[n,i=""]=t.split("?",2),o=new URLSearchParams(i);return o.set("tenantId",String(e.tenantId)),`${n}?${o.toString()}`}(`${De(t)}/${t.isPublicMode?"public":"private"}`,t);await s("POST",n,e,!0)}({submissionId:c,isPublicMode:this.isPublicMode,tenantId:this.tenantId},{sectionKey:m.sectionKey,questionKey:m.questionKey,value:null!==(u=d.value)&&void 0!==u?u:"",commentId:d.commentId}),d}catch(e){return console.error("[udp-question-form-renderer] postComment failed:",e),this.commentsState=Ie(this.commentsState,t,d.commentId,{isDeleted:!0}),null===(a=this.enqueueSnackbar)||void 0===a||a.call(this,"Failed to save comment.",{variant:"error"}),null}}async flushOpenDrafts(){const t=Object.entries(this.commentsState.draftByQuestionId);for(const[e,n]of t)null!=n&&(0!==n.trim().length?await this.saveDraft(e):this.commentsState=qe(this.commentsState,e,null))}getFollowUpOptionsForQuestion(t){if(!t||!this.resolvedForm)return this.followUpFormsList;const e=Oe(this.dynamicSections,t);if(!e)return this.followUpFormsList;const n=function(t){const e=t.fieldProperties;return Array.isArray(null==e?void 0:e.followUpFormIds)?e.followUpFormIds.map((t=>{if("string"==typeof t)return t;if(t&&"object"==typeof t){if("string"==typeof t.value)return t.value;if("string"==typeof t.id)return t.id}return""})).filter((t=>t.length>0)):[]}(e.question);if(0===n.length)return this.followUpFormsList;const i=new Set(n.map(String));return this.followUpFormsList.filter((t=>i.has(t.value)))}async openStampedFollowUp(t){var e,n;try{const n=`${m.productV1ApiUrl}/UdpFormSubmission/${t}/Full`,i=await s("GET",n);if(!(null==i?void 0:i.formId))return void(null===(e=this.enqueueSnackbar)||void 0===e||e.call(this,"Could not open the linked follow-up form.",{variant:"error"}));if("undefined"!=typeof window&&this.submission){const e=Ue({currentPathname:window.location.pathname,parentFormId:this.submission.formId,childFormId:i.formId,childSubmissionId:t});window.open(e,"_blank")}}catch(t){console.error("[udp-question-form-renderer] open follow-up failed:",t),null===(n=this.enqueueSnackbar)||void 0===n||n.call(this,"Could not open the linked follow-up form.",{variant:"error"})}}async fetchLatestFormVersion(t){var e;try{const n=`${m.productV1ApiUrl}/UdpForm/${t}/describe`,i=await s("GET",n);return null!==(e=null==i?void 0:i.version)&&void 0!==e?e:null}catch(t){return null}}render(){var e;if(this.isLoading)return t(o,null,t("udp-container",{"max-width":"md"},t("udp-text",{variant:"body1"},"Loading form…")));if(this.publicModeError)return t(o,null,t("udp-container",{"max-width":"md"},t("udp-text",{variant:"body1"},this.publicModeError)));if(this.loadError)return t(o,null,t("udp-container",{"max-width":"md"},t("udp-text",{variant:"body1"},this.loadError)));if(!this.resolvedForm)return t(o,null,t("udp-container",{"max-width":"md"},t("udp-text",{variant:"body1"},"No form to render. Pass ",t("code",null,"udpf_formId")," and ",t("code",null,"udpf_formVersion")," ","in the URL.")));const n=!this.isPublicMode&&function(t){for(const e of t.sections)for(const t of e.questions)if(Ne(t))return!0;return!1}(this.resolvedForm)?{adapter:{onLaunch:this.handleLaunchFollowUpForm,getStampedChildId:this.getFollowUpStampedChildId},dialog:{isOpen:this.followUpPickerOpen,options:this.getFollowUpOptionsForQuestion(this.followUpPickerQuestionId),selectedFormId:this.followUpPickerSelectedFormId,isLoading:this.followUpFormsListLoading,isLaunching:this.followUpLaunching,onSelect:this.handleFollowUpSelect,onLaunch:()=>{this.handleFollowUpLaunch()},onClose:this.handleFollowUpClose}}:null,i=function(t){const e=Ee.get(t);if(e)return e;const n=[];for(const e of t.sections)for(const t of e.questions)Ce(t)&&n.push({section:e,question:t});return Ee.set(t,n),n}(this.resolvedForm).length>0?{state:this.commentsState,adapter:{getCount:this.getCommentCount,isExpanded:this.isCommentsPanelExpanded,onToggle:this.toggleQuestionComments},handlers:{onOpenDraft:this.openDraft,onChangeDraft:this.changeDraft,onSaveDraft:t=>{this.saveDraft(t)},onCancelDraft:this.cancelDraft,onEdit:this.editComment,onDelete:(t,e)=>{this.deleteComment(t,e)}}}:null;return t(o,null,function(e){var n,i,o,l,r,s,u;const{loadedForm:a,templateOverrides:d,initialValues:c,onSubmit:m,validate:f,onFormComponentRef:h,submission:v,currentUser:b,highlightedQuestionId:g,formReadOnly:y,previewMode:w,signaturePreviewUrls:x,autosaveStatus:S="idle",lastSavedAt:k=null,progress:_,onSubmitClick:j,comments:F,followUpForms:q,onAddSection:I,onDeleteSection:O,domainFilters:C}=e,E=null!==(n=e.dynamicSections)&&void 0!==n?n:fe({loadedForm:a,submission:v}),D={loadedForm:a,submission:v,currentUser:b,highlightedQuestionId:null!=g?g:null,formReadOnly:!0===y,previewMode:!0===w,values:!0===y?c:void 0,signaturePreviewUrls:x,commentsAdapter:null!==(i=null==F?void 0:F.adapter)&&void 0!==i?i:null,comments:F?{state:F.state,currentUserId:null!==(o=null==b?void 0:b.id)&&void 0!==o?o:null,handlers:F.handlers}:null,followUpFormsAdapter:null!==(l=null==q?void 0:q.adapter)&&void 0!==l?l:null,domainFilters:C},N=(null!==(r=null==d?void 0:d.formName)&&void 0!==r?r:"").trim()||a.form.name,$=(null!==(s=null==d?void 0:d.formDescription)&&void 0!==s?s:"").trim()||a.form.description,U=a.form.styleOverrides,A={};(null===(u=null==U?void 0:U.background)||void 0===u?void 0:u.backgroundColor)&&(A.backgroundColor=U.background.backgroundColor);const L={};return(null==U?void 0:U.headerBackgroundColor)&&(L.backgroundColor=U.headerBackgroundColor),t("div",{class:"renderer-layout",style:A},t("div",{class:"renderer-layout__form"},t("udp-form-component",{ref:h,formId:nn,initialValues:c,submitHandler:m,validate:f,deriveFieldValidators:!1,errorDisplay:"submitFailed"},t("udp-flexbox",{display:"flex",direction:"column",wrap:"nowrap",gap:"lg"},N&&t("udp-fluent-card",{appearance:"filled",class:"form-title-card",style:L},t("udp-flexbox",{display:"flex",direction:"column",gap:"sm",class:"form-title-card__content"},t("udp-text",{variant:"title2"},N),$&&t("udp-text",{variant:"body1"},$))),E.map(((e,n)=>{const i=E[n+1];return function(e){var n,i;const{section:o,context:l,isLastInGroup:r,onAddSection:s,onDeleteSection:u}=e,a=o.schemaSection,d=!0===(null===(n=a.sectionProperties)||void 0===n?void 0:n.isRepeatable),c=d&&!0===r&&null!=s&&!0!==l.formReadOnly&&!0!==l.previewMode,m=d&&!o.isOriginal&&null!=u&&!0!==l.formReadOnly&&!0!==l.previewMode;return t("udp-fluent-card",{key:o.instanceId,appearance:"filled"},t("udp-flexbox",{slot:"header",display:"flex",direction:"row",align:"center",gap:"sm"},t("udp-flexbox",{display:"flex",direction:"column",gap:"xs",grow:"1"},a.title&&t("udp-flexbox",{display:"flex",direction:"row",gap:"xs",align:"center"},t("udp-text",{variant:"subtitle1"},a.title),!o.isOriginal&&t("udp-fluent-badge",{appearance:"outline",color:"subtle",size:"small"},"Copy ",o.suffix)),a.sectionText&&t("udp-text",{variant:"body2"},a.sectionText)),m&&t("udp-tooltip",{content:"Delete this copy",positioning:"below"},t("udp-fluent-icon-button",{iconName:"delete",size:"small",appearance:"subtle",ariaLabel:`Delete copy ${o.suffix} of ${null!==(i=a.title)&&void 0!==i?i:"section"}`,onClick:()=>null==u?void 0:u(o.instanceId)}))),!0===l.formReadOnly?t("udp-detail-list",{layout:"stack",dividers:"row",density:"default"},o.questions.map((t=>tn({question:t.schemaQuestion,context:l,fieldKey:t.fieldKey})))):t("udp-flexbox",{display:"flex",direction:"column",wrap:"nowrap",gap:"md"},o.questions.map((t=>tn({question:t.schemaQuestion,context:l,fieldKey:t.fieldKey})))),c&&t("udp-flexbox",{slot:"footer",display:"flex",direction:"row",justify:"flex-start"},t("udp-fluent-button",{appearance:"subtle",startIconName:"add",onClick:()=>null==s?void 0:s(a.id)},"Repeat Section")))}({section:e,context:D,isLastInGroup:!i||i.schemaSection.id!==e.schemaSection.id,onAddSection:I,onDeleteSection:O})})))),!y&&function(e){var n,i;const{progress:o,autosaveStatus:l,lastSavedAt:r,onSubmitClick:s}=e,u=null!==(n=null==o?void 0:o.answered)&&void 0!==n?n:0,a=null!==(i=null==o?void 0:o.total)&&void 0!==i?i:0,d=a>0?a:1,c=a>0&&u===a?"success":"info";return t("div",{class:"form-footer"},t("div",{class:"form-footer__inner"},t("div",{class:"form-footer__progress"},t("udp-text",{variant:"caption1",class:"form-footer__progress-label"},u," of ",a," answered"),t("udp-progress-bar",{class:"form-footer__progress-bar",thickness:"medium",shape:"rounded",validationState:c,value:u,min:0,max:d})),t("div",{class:"form-footer__actions"},function(e,n){return"saving"===e?t("udp-text",{variant:"caption1"},"Saving…"):"error"===e?t("udp-text",{variant:"caption1"},"Save failed — will retry on next change."):"saved"===e&&n?t("udp-text",{variant:"caption1"},"Saved at ",(i=n,`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}`)):t("span",null);var i}(l,r),t("udp-fluent-button",{appearance:"primary",onClick:s},"Submit"))))}({progress:_,autosaveStatus:S,lastSavedAt:k,onSubmitClick:()=>{var t;null==j||j(),null===(t=p.get(nn))||void 0===t||t.requestSubmit()}}),y&&t("div",{class:"form-footer form-footer--read-only"},t("div",{class:"form-footer__inner"},function(e){return t("udp-text",{variant:"caption1"},(null==e?void 0:e.status)===Ht.Submitted?"Submitted — read-only.":"Read-only.")}(v)))),q&&en({isOpen:q.dialog.isOpen,options:q.dialog.options,selectedFormId:q.dialog.selectedFormId,isLoading:q.dialog.isLoading,isLaunching:q.dialog.isLaunching,onSelect:q.dialog.onSelect,onLaunch:q.dialog.onLaunch,onClose:q.dialog.onClose}))}({loadedForm:this.resolvedForm,templateOverrides:this.templateOverrides,dynamicSections:this.dynamicSections,initialValues:this.initialValues,onSubmit:this.handleSubmit,validate:this.getValidator(),onFormComponentRef:this.handleFormComponentRef,submission:this.submission,currentUser:this.currentUser,highlightedQuestionId:null!==(e=this.highlightedQuestionId)&&void 0!==e?e:null,formReadOnly:this.isReadOnly,previewMode:this.previewMode,signaturePreviewUrls:this.signaturePreviewUrls,autosaveStatus:this.autosaveStatus,lastSavedAt:this.lastSavedAt,progress:this.progress,onSubmitClick:this.handleSubmitClick,comments:i,followUpForms:n,onAddSection:this.handleAddSection,onDeleteSection:this.handleDeleteSection,domainFilters:this.domainFilters}))}get el(){return this}static get watchers(){return{loadedForm:[{handleLoadedFormChange:0}],highlightedQuestionId:[{handleHighlightedQuestionIdChange:0}],getUserCallback:[{handleGetUserCallbackChange:0}]}}static get style(){return":host{display:block;padding:var(--spacingVerticalM) var(--spacingHorizontalL, 16px);padding-bottom:96px}.renderer-layout__form udp-form-component{display:block}.renderer-layout{width:100%;max-width:720px;margin:0 auto}.renderer-layout__form{width:100%}.form-title-card{border-left:4px solid var(--colorBrandStroke1, #2899f5)}.form-title-card__content{padding-block:var(--spacingVerticalS, 8px)}.question-card{position:relative;transition:background-color 160ms ease-out, box-shadow 160ms ease-out;border-radius:var(--borderRadiusMedium, 4px)}.question-card--highlighted{background-color:var(--colorBrandBackground2, rgba(38, 79, 120, 0.08));box-shadow:inset 3px 0 0 0 var(--colorBrandStroke1, #2899f5);animation:udpqf-highlight-pulse 800ms ease-out 1}.question-card__toggles{position:absolute;top:0;right:0;display:inline-flex;align-items:center;gap:var(--spacingHorizontalXS, 4px);z-index:1}.question-card__follow-up-toggle{display:inline-flex;align-items:center;gap:var(--spacingHorizontalXXS, 2px)}.question-card__inline-comments{margin-top:var(--spacingVerticalS, 8px);padding:var(--spacingVerticalS, 8px) var(--spacingHorizontalM, 12px);background-color:var(--colorNeutralBackground2, #fafafa);border-left:2px solid var(--colorNeutralStroke2, #e0e0e0);border-radius:0 var(--borderRadiusMedium, 4px) var(--borderRadiusMedium, 4px) 0}.question-card__inline-comments .comment-thread{cursor:default;padding:0;gap:var(--spacingVerticalXS, 4px)}.question-card__inline-comments .comment-thread:hover,.question-card__inline-comments .comment-thread--focused{background-color:transparent}udp-detail-list-item:has(.question-view__comment-toggle){position:relative}.question-view__comment-toggle{position:absolute;top:0;right:0;z-index:1}@media print{.question-card__toggles,.question-view__comment-toggle,.comment-thread__compose-placeholder,.comment-thread__draft,.comment-item__actions{display:none !important}}@keyframes udpqf-highlight-pulse{0%{background-color:var(--colorBrandBackground2Hover, rgba(38, 79, 120, 0.16))}100%{background-color:var(--colorBrandBackground2, rgba(38, 79, 120, 0.08))}}@media (prefers-reduced-motion: reduce){.question-card,.question-card--highlighted{animation:none;transition:none}}.comment-thread{position:relative;display:flex;flex-direction:column;gap:var(--spacingVerticalXS, 4px);padding:var(--spacingVerticalS, 8px) var(--spacingHorizontalS, 10px);border-radius:var(--borderRadiusSmall, 2px);cursor:pointer;transition:background-color 120ms ease-out}.comment-thread:hover{background-color:var(--colorNeutralBackground1Hover, rgba(0, 0, 0, 0.02))}.comment-thread--focused{background-color:var(--colorBrandBackground2, rgba(38, 79, 120, 0.06))}.comment-thread__header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--spacingVerticalXXS, 2px)}.comment-thread__label{color:var(--colorNeutralForeground3, #707070);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.comment-thread__empty{color:var(--colorNeutralForeground3, #707070);font-style:italic}.comment-thread__items{display:flex;flex-direction:column}.comment-thread__draft{display:flex;flex-direction:column;gap:var(--spacingVerticalXXS, 2px)}.comment-thread__draft-actions{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;gap:var(--spacingHorizontalXXS, 2px)}.comment-thread__compose-placeholder{align-self:flex-start;margin-top:var(--spacingVerticalXS, 4px)}.comment-item{display:grid;grid-template-columns:24px 1fr;column-gap:var(--spacingHorizontalS, 8px);row-gap:var(--spacingVerticalXXS, 2px);padding:var(--spacingVerticalXS, 4px) 0}.comment-item+.comment-item{padding-top:var(--spacingVerticalS, 8px);margin-top:var(--spacingVerticalXS, 4px);border-top:1px solid var(--colorNeutralStroke3, #f0f0f0)}.comment-item__avatar{grid-column:1;grid-row:1;align-self:start;width:24px;height:24px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;color:var(--colorNeutralForegroundOnBrand, #fff);font-size:var(--fontSizeBase100, 10px);font-weight:var(--fontWeightSemibold, 600);line-height:1;user-select:none}.comment-item__actions{margin-left:auto;display:flex;flex-direction:row;gap:var(--spacingHorizontalXXS, 2px);opacity:0;transition:opacity 120ms ease-out}.comment-item__header{grid-column:2;display:flex;flex-direction:row;align-items:center;gap:var(--spacingHorizontalXS, 4px);min-height:24px}.comment-item__timestamp{color:var(--colorNeutralForeground3, #707070)}.comment-item__body{grid-column:2;white-space:pre-wrap;word-break:break-word}.comment-item:hover .comment-item__actions,.comment-item:focus-within .comment-item__actions{opacity:1}@media (hover: none){.comment-item__actions{opacity:1}}.form-footer{position:fixed;bottom:0;left:var(--udpqf-host-left, 0);width:var(--udpqf-host-width, 100%);z-index:2;background-color:var(--colorNeutralBackground1, #ffffff);border-top:1px solid transparent;box-shadow:var(--shadow4, 0 2px 4px rgba(0, 0, 0, 0.14), 0 0 2px rgba(0, 0, 0, 0.12))}.form-footer__inner{display:flex;flex-direction:row;align-items:center;gap:var(--spacingHorizontalM, 12px);width:100%;max-width:720px;margin:0 auto;padding:var(--spacingVerticalS, 8px) var(--spacingHorizontalL, 16px);box-sizing:border-box}.form-footer--read-only .form-footer__inner{justify-content:center}.form-footer__progress{display:flex;flex-direction:column;gap:var(--spacingVerticalXXS, 2px);flex:1 1 auto;min-width:0}.form-footer__progress-label{color:var(--colorNeutralForeground2, #424242)}.form-footer__progress-bar{display:block;width:100%}.form-footer__actions{display:flex;flex-direction:row;align-items:center;gap:var(--spacingHorizontalM, 12px);flex:0 0 auto}@media print{.form-footer{display:none !important}}.question-view__options{display:flex;flex-direction:column;gap:var(--spacingVerticalXXS, 2px)}.question-view__option{display:flex;flex-direction:row;align-items:center;gap:var(--spacingHorizontalS, 8px);color:var(--colorNeutralForeground3, #616161)}.question-view__option--selected{color:var(--colorNeutralForeground1, #242424);font-weight:var(--fontWeightSemibold, 600)}.question-view__option-mark{flex:0 0 auto;color:var(--colorNeutralForeground4, #707070)}.question-view__option--selected .question-view__option-mark{color:var(--colorCompoundBrandForeground1, #0f6cbd)}.question-view__location{display:flex;flex-direction:column;gap:var(--spacingVerticalS, 8px)}.question-view__signature{display:flex;flex-direction:column;gap:var(--spacingVerticalS, 8px)}.question-view__signature-img{display:block;max-width:360px;max-height:160px;object-fit:contain}.question-view__signature-meta{display:flex;flex-direction:column;gap:0}"}},[1,"udp-question-form-renderer",{formId:[1040],formVersion:[1026,"form-version"],submissionId:[16],tenantId:[16],isPublicMode:[4,"is-public-mode"],getUserCallback:[16],enqueueSnackbar:[16],closeSnackbar:[16],history:[16],urlContext:[16],domainTableFilters:[16],autoSaveDelay:[2,"auto-save-delay"],loadedForm:[16],previewMode:[4,"preview-mode"],highlightedQuestionId:[16],readOnly:[4,"read-only"],resolvedForm:[32],submission:[32],initialValues:[32],signaturePreviewUrls:[32],isLoading:[32],dynamicSections:[32],publicModeError:[32],loadError:[32],currentUser:[32],templateOverrides:[32],commentsState:[32],expandedCommentPanels:[32],followUpPickerOpen:[32],followUpPickerQuestionId:[32],followUpPickerSelectedFormId:[32],followUpFormsList:[32],followUpFormsListLoaded:[32],followUpFormsListLoading:[32],followUpLaunching:[32],autosaveStatus:[32],lastSavedAt:[32],progress:[32]},[[0,"formReady","handleFormReady"],[0,"formStateUpdated","handleFormStateUpdated"]],{loadedForm:[{handleLoadedFormChange:0}],highlightedQuestionId:[{handleHighlightedQuestionIdChange:0}],getUserCallback:[{handleGetUserCallbackChange:0}]}]);function ln(t,e){if(Object.is(t,e))return!0;if(null==t||null==e)return!1;if(Array.isArray(t)||Array.isArray(e))return Array.isArray(t)&&Array.isArray(e)&&t.length===e.length&&t.every(((t,n)=>ln(t,e[n])));const n=t=>"object"==typeof t&&t.constructor===Object;if(!n(t)||!n(e))return!1;const i=Object.keys(t),o=Object.keys(e);return i.length===o.length&&i.every((n=>Object.prototype.hasOwnProperty.call(e,n)&&ln(t[n],e[n])))}function rn(){"undefined"!=typeof customElements&&["udp-question-form-renderer","ag-grid-base","client-side-grid","form-metadata-display","ghost-render","grid-header","hint-panel","stencil-icon-button","tally-display","udp-accordion","udp-ambient-tool-tip","udp-avatar","udp-badge","udp-button","udp-container","udp-container-query","udp-date-input","udp-date-range-selector","udp-date-time-input","udp-detail-list","udp-detail-list-item","udp-dialog","udp-empty-state","udp-export-sheet","udp-field","udp-flexbox","udp-fluent-avatar","udp-fluent-badge","udp-fluent-button","udp-fluent-card","udp-fluent-checkbox","udp-fluent-dialog","udp-fluent-domain-table-input","udp-fluent-drawer","udp-fluent-dropdown","udp-fluent-file-input","udp-fluent-icon","udp-fluent-icon-button","udp-fluent-image","udp-fluent-list-input","udp-fluent-list-item","udp-fluent-location-input","udp-fluent-menu","udp-fluent-number-input","udp-fluent-radio-group","udp-fluent-signature-input","udp-fluent-switch","udp-fluent-table-input","udp-fluent-text-input","udp-form-component","udp-icon","udp-linear-loader","udp-list","udp-list-item","udp-menu-item","udp-message-bar","udp-pop-over","udp-popover","udp-primary-action-header","udp-progress-bar","udp-question-tally-adapter","udp-search-input","udp-side-sheet","udp-spinner","udp-text","udp-textarea","udp-time-input","udp-tooltip","unity-typography"].forEach((t=>{switch(t){case"udp-question-form-renderer":customElements.get(l(t))||customElements.define(l(t),on);break;case"ag-grid-base":customElements.get(l(t))||I();break;case"client-side-grid":customElements.get(l(t))||O();break;case"form-metadata-display":customElements.get(l(t))||C();break;case"ghost-render":customElements.get(l(t))||E();break;case"grid-header":customElements.get(l(t))||D();break;case"hint-panel":customElements.get(l(t))||N();break;case"stencil-icon-button":customElements.get(l(t))||$();break;case"tally-display":customElements.get(l(t))||U();break;case"udp-accordion":customElements.get(l(t))||A();break;case"udp-ambient-tool-tip":customElements.get(l(t))||L();break;case"udp-avatar":customElements.get(l(t))||V();break;case"udp-badge":customElements.get(l(t))||T();break;case"udp-button":customElements.get(l(t))||P();break;case"udp-container":customElements.get(l(t))||R();break;case"udp-container-query":customElements.get(l(t))||B();break;case"udp-date-input":customElements.get(l(t))||z();break;case"udp-date-range-selector":customElements.get(l(t))||M();break;case"udp-date-time-input":customElements.get(l(t))||Q();break;case"udp-detail-list":customElements.get(l(t))||H();break;case"udp-detail-list-item":customElements.get(l(t))||X();break;case"udp-dialog":customElements.get(l(t))||K();break;case"udp-empty-state":customElements.get(l(t))||G();break;case"udp-export-sheet":customElements.get(l(t))||J();break;case"udp-field":customElements.get(l(t))||W();break;case"udp-flexbox":customElements.get(l(t))||Y();break;case"udp-fluent-avatar":customElements.get(l(t))||Z();break;case"udp-fluent-badge":customElements.get(l(t))||tt();break;case"udp-fluent-button":customElements.get(l(t))||et();break;case"udp-fluent-card":customElements.get(l(t))||nt();break;case"udp-fluent-checkbox":customElements.get(l(t))||it();break;case"udp-fluent-dialog":customElements.get(l(t))||ot();break;case"udp-fluent-domain-table-input":customElements.get(l(t))||_();break;case"udp-fluent-drawer":customElements.get(l(t))||lt();break;case"udp-fluent-dropdown":customElements.get(l(t))||rt();break;case"udp-fluent-file-input":customElements.get(l(t))||st();break;case"udp-fluent-icon":customElements.get(l(t))||ut();break;case"udp-fluent-icon-button":customElements.get(l(t))||at();break;case"udp-fluent-image":customElements.get(l(t))||dt();break;case"udp-fluent-list-input":customElements.get(l(t))||ct();break;case"udp-fluent-list-item":customElements.get(l(t))||mt();break;case"udp-fluent-location-input":customElements.get(l(t))||pt();break;case"udp-fluent-menu":customElements.get(l(t))||ft();break;case"udp-fluent-number-input":customElements.get(l(t))||ht();break;case"udp-fluent-radio-group":customElements.get(l(t))||vt();break;case"udp-fluent-signature-input":customElements.get(l(t))||bt();break;case"udp-fluent-switch":customElements.get(l(t))||gt();break;case"udp-fluent-table-input":customElements.get(l(t))||yt();break;case"udp-fluent-text-input":customElements.get(l(t))||wt();break;case"udp-form-component":customElements.get(l(t))||xt();break;case"udp-icon":customElements.get(l(t))||St();break;case"udp-linear-loader":customElements.get(l(t))||kt();break;case"udp-list":customElements.get(l(t))||_t();break;case"udp-list-item":customElements.get(l(t))||jt();break;case"udp-menu-item":customElements.get(l(t))||Ft();break;case"udp-message-bar":customElements.get(l(t))||qt();break;case"udp-pop-over":customElements.get(l(t))||It();break;case"udp-popover":customElements.get(l(t))||Ot();break;case"udp-primary-action-header":customElements.get(l(t))||Ct();break;case"udp-progress-bar":customElements.get(l(t))||Et();break;case"udp-question-tally-adapter":customElements.get(l(t))||q();break;case"udp-search-input":customElements.get(l(t))||Dt();break;case"udp-side-sheet":customElements.get(l(t))||Nt();break;case"udp-spinner":customElements.get(l(t))||$t();break;case"udp-text":customElements.get(l(t))||Ut();break;case"udp-textarea":customElements.get(l(t))||At();break;case"udp-time-input":customElements.get(l(t))||Lt();break;case"udp-tooltip":customElements.get(l(t))||Vt();break;case"unity-typography":customElements.get(l(t))||Tt()}}))}export{on as U,rn as a,oe as d,le as e,Bt as f}
@@ -1 +1 @@
1
- import{p as t,H as s,h as e,d as n,t as o}from"./index2.js";import{d as l}from"./tally.js";import{d as i}from"./unity-typography2.js";import{F as a}from"./types.js";function d(t){return t.replace(/_\d+$/,"")}const u="\0",c=new WeakMap;function r(t){const s=c.get(t);if(s)return s;const e=function(t){const s=new Map,e=new Map;for(const n of t.sections)if(n.name)for(const t of n.questions){if(!t.name)continue;s.set(`${n.name}${u}${t.name}`,t);const o=`${n.name.toLowerCase()}${u}${t.name.toLowerCase()}`;e.has(o)?console.warn(`[udp-question-form] Slot collision under lowercased key "${o.replace(u,".")}". Two questions share the same case-insensitive slot path; URL seeds and other case-insensitive lookups will land on the first-indexed question.`):e.set(o,t)}return{byExact:(t,e)=>s.get(`${t}${u}${e}`),byLowercased:(t,s)=>e.get(`${t.toLowerCase()}${u}${s.toLowerCase()}`)}}(t);return c.set(t,e),e}const h=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.label="Response Tally",this.tallyMode="all",this.includeFields=[],this.excludeFields=[],this.yesCount=0,this.noCount=0,this.naCount=0,this.totalFields=0,this.yesNoQuestions=[]}componentWillLoad(){this.rebuildYesNoQuestions()}onTallyInputsChanged(){this.rebuildYesNoQuestions()}rebuildYesNoQuestions(){this.yesNoQuestions=this.collectYesNoQuestions(this.loadedForm),this.totalFields=this.yesNoQuestions.length}componentDidLoad(){this.el.dispatchEvent(new CustomEvent("fetchFormInstance",{bubbles:!0,composed:!0,detail:t=>this.subscribe(t)}))}disconnectedCallback(){this.unsubscribe&&this.unsubscribe()}normalizeTallyEntries(t){const s=new Set;for(const e of null!=t?t:[]){const t=String(e);if(!t.includes(".")){s.add(t);continue}const n=t.split("."),o=n[0],l=n[1],i=d(o),a=this.loadedForm.sections.find((t=>t.name===i||t.name===o)),u=null==a?void 0:a.questions.find((t=>t.name===l));u&&s.add(u.id)}return s}collectYesNoQuestions(t){var s,e;const n=[];for(const s of t.sections)for(const t of s.questions)t.fieldTypeId===a.YesNo&&t.id!==this.questionId&&n.push(t);if("include"===this.tallyMode){const t=this.normalizeTallyEntries(null!==(s=this.includeFields)&&void 0!==s?s:[]);return n.filter((s=>t.has(s.id)))}if("exclude"===this.tallyMode){const t=this.normalizeTallyEntries(null!==(e=this.excludeFields)&&void 0!==e?e:[]);return n.filter((s=>!t.has(s.id)))}return n}subscribe(t){this.unsubscribe=t.subscribe((t=>{const s=t.values;let e=0,n=0,o=0;for(const t of this.yesNoQuestions){const l=null==s?void 0:s[t.id];"true"===l||!0===l?e++:"false"===l||!1===l?n++:"na"===l&&o++}this.yesCount=e,this.noCount=n,this.naCount=o}),{values:!0})}render(){return e(n,{key:"88e7aecadccc319d7479fc9c9e196f2ae7ff0871"},e("tally-display",{key:"58902762f239c2d583ffd38af896537235049c8f",label:this.label,yesCount:this.yesCount,noCount:this.noCount,naCount:this.naCount,totalFields:this.totalFields}))}get el(){return this}static get watchers(){return{loadedForm:[{onTallyInputsChanged:0}],tallyMode:[{onTallyInputsChanged:0}],includeFields:[{onTallyInputsChanged:0}],excludeFields:[{onTallyInputsChanged:0}],questionId:[{onTallyInputsChanged:0}]}}},[0,"udp-question-tally-adapter",{loadedForm:[16],questionId:[1,"question-id"],label:[1],tallyMode:[1,"tally-mode"],includeFields:[16],excludeFields:[16],yesCount:[32],noCount:[32],naCount:[32],totalFields:[32]},void 0,{loadedForm:[{onTallyInputsChanged:0}],tallyMode:[{onTallyInputsChanged:0}],includeFields:[{onTallyInputsChanged:0}],excludeFields:[{onTallyInputsChanged:0}],questionId:[{onTallyInputsChanged:0}]}]);function p(){"undefined"!=typeof customElements&&["udp-question-tally-adapter","tally-display","unity-typography"].forEach((t=>{switch(t){case"udp-question-tally-adapter":customElements.get(o(t))||customElements.define(o(t),h);break;case"tally-display":customElements.get(o(t))||l();break;case"unity-typography":customElements.get(o(t))||i()}}))}export{h as U,p as d,r as g,d as s}
1
+ import{p as t,H as s,h as e,d as n,t as o}from"./index2.js";import{d as l}from"./tally.js";import{d as i}from"./unity-typography2.js";import{a}from"./types.js";function d(t){return t.replace(/_\d+$/,"")}const u="\0",r=new WeakMap;function c(t){const s=r.get(t);if(s)return s;const e=function(t){const s=new Map,e=new Map;for(const n of t.sections)if(n.name)for(const t of n.questions){if(!t.name)continue;s.set(`${n.name}${u}${t.name}`,t);const o=`${n.name.toLowerCase()}${u}${t.name.toLowerCase()}`;e.has(o)?console.warn(`[udp-question-form] Slot collision under lowercased key "${o.replace(u,".")}". Two questions share the same case-insensitive slot path; URL seeds and other case-insensitive lookups will land on the first-indexed question.`):e.set(o,t)}return{byExact:(t,e)=>s.get(`${t}${u}${e}`),byLowercased:(t,s)=>e.get(`${t.toLowerCase()}${u}${s.toLowerCase()}`)}}(t);return r.set(t,e),e}const h=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.label="Response Tally",this.tallyMode="all",this.includeFields=[],this.excludeFields=[],this.yesCount=0,this.noCount=0,this.naCount=0,this.totalFields=0,this.yesNoQuestions=[]}componentWillLoad(){this.rebuildYesNoQuestions()}onTallyInputsChanged(){this.rebuildYesNoQuestions()}rebuildYesNoQuestions(){this.yesNoQuestions=this.collectYesNoQuestions(this.loadedForm),this.totalFields=this.yesNoQuestions.length}componentDidLoad(){this.el.dispatchEvent(new CustomEvent("fetchFormInstance",{bubbles:!0,composed:!0,detail:t=>this.subscribe(t)}))}disconnectedCallback(){this.unsubscribe&&this.unsubscribe()}normalizeTallyEntries(t){const s=new Set;for(const e of null!=t?t:[]){const t=String(e);if(!t.includes(".")){s.add(t);continue}const n=t.split("."),o=n[0],l=n[1],i=d(o),a=this.loadedForm.sections.find((t=>t.name===i||t.name===o)),u=null==a?void 0:a.questions.find((t=>t.name===l));u&&s.add(u.id)}return s}collectYesNoQuestions(t){var s,e;const n=[];for(const s of t.sections)for(const t of s.questions)t.fieldTypeId===a.YesNo&&t.id!==this.questionId&&n.push(t);if("include"===this.tallyMode){const t=this.normalizeTallyEntries(null!==(s=this.includeFields)&&void 0!==s?s:[]);return n.filter((s=>t.has(s.id)))}if("exclude"===this.tallyMode){const t=this.normalizeTallyEntries(null!==(e=this.excludeFields)&&void 0!==e?e:[]);return n.filter((s=>!t.has(s.id)))}return n}subscribe(t){this.unsubscribe=t.subscribe((t=>{const s=t.values;let e=0,n=0,o=0;for(const t of this.yesNoQuestions){const l=null==s?void 0:s[t.id];"true"===l||!0===l?e++:"false"===l||!1===l?n++:"na"===l&&o++}this.yesCount=e,this.noCount=n,this.naCount=o}),{values:!0})}render(){return e(n,{key:"7317cd336d702a5766364a04702f1b8f34551d18"},e("tally-display",{key:"88763661a5f972b741e5a4d4687e97058cb5ea7b",label:this.label,yesCount:this.yesCount,noCount:this.noCount,naCount:this.naCount,totalFields:this.totalFields}))}get el(){return this}static get watchers(){return{loadedForm:[{onTallyInputsChanged:0}],tallyMode:[{onTallyInputsChanged:0}],includeFields:[{onTallyInputsChanged:0}],excludeFields:[{onTallyInputsChanged:0}],questionId:[{onTallyInputsChanged:0}]}}},[0,"udp-question-tally-adapter",{loadedForm:[16],questionId:[1,"question-id"],label:[1],tallyMode:[1,"tally-mode"],includeFields:[16],excludeFields:[16],yesCount:[32],noCount:[32],naCount:[32],totalFields:[32]},void 0,{loadedForm:[{onTallyInputsChanged:0}],tallyMode:[{onTallyInputsChanged:0}],includeFields:[{onTallyInputsChanged:0}],excludeFields:[{onTallyInputsChanged:0}],questionId:[{onTallyInputsChanged:0}]}]);function p(){"undefined"!=typeof customElements&&["udp-question-tally-adapter","tally-display","unity-typography"].forEach((t=>{switch(t){case"udp-question-tally-adapter":customElements.get(o(t))||customElements.define(o(t),h);break;case"tally-display":customElements.get(o(t))||l();break;case"unity-typography":customElements.get(o(t))||i()}}))}export{h as U,p as d,c as g,d as s}