@mrfylke/contact-form 0.1.24 → 0.1.26

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 (297) hide show
  1. package/README.md +42 -24
  2. package/lib/ContactFormRoot.d.ts +2 -2
  3. package/lib/ContactFormRoot.d.ts.map +1 -1
  4. package/lib/ContactFormRoot.js +6 -4
  5. package/lib/components/button/link.d.ts +1 -1
  6. package/lib/components/button/link.d.ts.map +1 -1
  7. package/lib/components/button/utils.d.ts +2 -2
  8. package/lib/components/button/utils.d.ts.map +1 -1
  9. package/lib/components/checkbox/checkbox.d.ts +1 -1
  10. package/lib/components/checkbox/checkbox.d.ts.map +1 -1
  11. package/lib/components/error-message/error-message.d.ts +1 -1
  12. package/lib/components/error-message/error-message.d.ts.map +1 -1
  13. package/lib/components/external-link-page.d.ts +1 -1
  14. package/lib/components/external-link-page.d.ts.map +1 -1
  15. package/lib/components/form/date-selector.d.ts +1 -1
  16. package/lib/components/form/date-selector.d.ts.map +1 -1
  17. package/lib/components/form/date-selector.js +2 -2
  18. package/lib/components/form/departure-time-field.d.ts +1 -1
  19. package/lib/components/form/departure-time-field.d.ts.map +1 -1
  20. package/lib/components/form/description-modal.d.ts +1 -1
  21. package/lib/components/form/description-modal.d.ts.map +1 -1
  22. package/lib/components/form/field-wrapper-with-error/index.d.ts +1 -1
  23. package/lib/components/form/field-wrapper-with-error/index.d.ts.map +1 -1
  24. package/lib/components/form/fieldset/index.d.ts +1 -1
  25. package/lib/components/form/fieldset/index.d.ts.map +1 -1
  26. package/lib/components/form/file-input.d.ts +1 -1
  27. package/lib/components/form/file-input.d.ts.map +1 -1
  28. package/lib/components/form/form-component-label/index.d.ts +3 -2
  29. package/lib/components/form/form-component-label/index.d.ts.map +1 -1
  30. package/lib/components/form/form-component-label/index.js +2 -2
  31. package/lib/components/form/input.d.ts +1 -1
  32. package/lib/components/form/input.d.ts.map +1 -1
  33. package/lib/components/form/radio.d.ts +1 -1
  34. package/lib/components/form/radio.d.ts.map +1 -1
  35. package/lib/components/form/searchable-select/searchable-select.d.ts +1 -1
  36. package/lib/components/form/searchable-select/searchable-select.d.ts.map +1 -1
  37. package/lib/components/form/searchable-select/searchable-select.js +1 -1
  38. package/lib/components/form/select.d.ts +1 -1
  39. package/lib/components/form/select.d.ts.map +1 -1
  40. package/lib/components/form/select.js +1 -1
  41. package/lib/components/form/textarea.d.ts +1 -1
  42. package/lib/components/form/textarea.d.ts.map +1 -1
  43. package/lib/components/form/time-selector.d.ts +1 -1
  44. package/lib/components/form/time-selector.d.ts.map +1 -1
  45. package/lib/components/form/time-selector.js +2 -2
  46. package/lib/components/icon/checkbox-icon.d.ts +1 -1
  47. package/lib/components/icon/checkbox-icon.d.ts.map +1 -1
  48. package/lib/components/icon/color-icon.d.ts +1 -1
  49. package/lib/components/icon/color-icon.d.ts.map +1 -1
  50. package/lib/components/icon/generated-icons.d.ts +422 -262
  51. package/lib/components/icon/generated-icons.d.ts.map +1 -1
  52. package/lib/components/icon/generated-icons.js +1931 -1771
  53. package/lib/components/icon/illustration.d.ts +1 -1
  54. package/lib/components/icon/illustration.d.ts.map +1 -1
  55. package/lib/components/icon/image.d.ts +1 -1
  56. package/lib/components/icon/image.d.ts.map +1 -1
  57. package/lib/components/icon/mono-icon.d.ts +1 -1
  58. package/lib/components/icon/mono-icon.d.ts.map +1 -1
  59. package/lib/components/icon/utils.d.ts.map +1 -1
  60. package/lib/components/icon/utils.js +6 -6
  61. package/lib/components/loading/index.d.ts +2 -2
  62. package/lib/components/loading/index.d.ts.map +1 -1
  63. package/lib/components/section-card/section-card.d.ts +1 -1
  64. package/lib/components/section-card/section-card.d.ts.map +1 -1
  65. package/lib/components/typography/index.d.ts +6 -6
  66. package/lib/components/typography/index.d.ts.map +1 -1
  67. package/lib/contact.module.css +0 -9
  68. package/lib/error-content/error-content.d.ts +1 -1
  69. package/lib/error-content/error-content.d.ts.map +1 -1
  70. package/lib/group-travel/index.d.ts +1 -1
  71. package/lib/group-travel/index.d.ts.map +1 -1
  72. package/lib/group-travel/index.js +1 -2
  73. package/lib/index.d.ts +3 -5
  74. package/lib/index.d.ts.map +1 -1
  75. package/lib/index.js +5 -10
  76. package/lib/journey-info/events.d.ts.map +1 -1
  77. package/lib/journey-info/index.d.ts +1 -1
  78. package/lib/journey-info/index.d.ts.map +1 -1
  79. package/lib/journey-info/index.js +10 -8
  80. package/lib/journey-info/journeyInfoStateMachine.d.ts +2 -2
  81. package/lib/journey-info/journeyInfoStateMachine.d.ts.map +1 -1
  82. package/lib/journey-info/journeyInfoStateMachine.js +1 -1
  83. package/lib/layouts/contact-form-container.d.ts +1 -1
  84. package/lib/layouts/contact-form-container.d.ts.map +1 -1
  85. package/lib/layouts/contact-page-layout.d.ts +1 -8
  86. package/lib/layouts/contact-page-layout.d.ts.map +1 -1
  87. package/lib/layouts/contact-page-layout.js +8 -93
  88. package/lib/layouts/contact-pages.d.ts +20 -0
  89. package/lib/layouts/contact-pages.d.ts.map +1 -0
  90. package/lib/layouts/contact-pages.js +124 -0
  91. package/lib/layouts/index.d.ts +2 -1
  92. package/lib/layouts/index.d.ts.map +1 -1
  93. package/lib/layouts/index.js +5 -2
  94. package/lib/lines/use-departures.js +2 -2
  95. package/lib/lines/use-lines.d.ts +2 -2
  96. package/lib/lines/use-lines.js +1 -1
  97. package/lib/lost-property/LostPropertyForm.d.ts +2 -1
  98. package/lib/lost-property/LostPropertyForm.d.ts.map +1 -1
  99. package/lib/lost-property/LostPropertyMachine.d.ts +2 -2
  100. package/lib/lost-property/LostPropertyMachine.d.ts.map +1 -1
  101. package/lib/lost-property/LostPropertyMachine.js +1 -1
  102. package/lib/lost-property/index.d.ts +1 -1
  103. package/lib/lost-property/index.d.ts.map +1 -1
  104. package/lib/lost-property-external/index.d.ts +1 -1
  105. package/lib/lost-property-external/index.d.ts.map +1 -1
  106. package/lib/lost-property-external/index.js +1 -2
  107. package/lib/means-of-transport/events.d.ts.map +1 -1
  108. package/lib/means-of-transport/forms/delayForm.d.ts +1 -1
  109. package/lib/means-of-transport/forms/delayForm.d.ts.map +1 -1
  110. package/lib/means-of-transport/forms/driverForm.d.ts +1 -1
  111. package/lib/means-of-transport/forms/driverForm.d.ts.map +1 -1
  112. package/lib/means-of-transport/forms/injuryForm.d.ts +1 -1
  113. package/lib/means-of-transport/forms/injuryForm.d.ts.map +1 -1
  114. package/lib/means-of-transport/forms/serviceOfferingForm.d.ts +1 -1
  115. package/lib/means-of-transport/forms/serviceOfferingForm.d.ts.map +1 -1
  116. package/lib/means-of-transport/forms/serviceOfferingForm.js +3 -1
  117. package/lib/means-of-transport/forms/stopForm.d.ts +1 -1
  118. package/lib/means-of-transport/forms/stopForm.d.ts.map +1 -1
  119. package/lib/means-of-transport/forms/transportationForm.d.ts +1 -1
  120. package/lib/means-of-transport/forms/transportationForm.d.ts.map +1 -1
  121. package/lib/means-of-transport/index.d.ts +1 -1
  122. package/lib/means-of-transport/index.d.ts.map +1 -1
  123. package/lib/means-of-transport/index.js +8 -2
  124. package/lib/means-of-transport/means-of-transport-form-machine.d.ts +4 -2
  125. package/lib/means-of-transport/means-of-transport-form-machine.d.ts.map +1 -1
  126. package/lib/means-of-transport/means-of-transport-form-machine.js +9 -3
  127. package/lib/modules/config/context.d.ts +13 -38
  128. package/lib/modules/config/context.d.ts.map +1 -1
  129. package/lib/modules/config/context.js +16 -52
  130. package/lib/modules/config/default-submit.d.ts +3 -0
  131. package/lib/modules/config/default-submit.d.ts.map +1 -0
  132. package/lib/modules/config/default-submit.js +13 -0
  133. package/lib/modules/config/index.d.ts +1 -0
  134. package/lib/modules/config/index.d.ts.map +1 -1
  135. package/lib/modules/config/index.js +1 -0
  136. package/lib/modules/config/types.d.ts +60 -78
  137. package/lib/modules/config/types.d.ts.map +1 -1
  138. package/lib/modules/org-data/index.d.ts +1 -2
  139. package/lib/modules/org-data/index.d.ts.map +1 -1
  140. package/lib/modules/org-data/index.js +1 -2
  141. package/lib/modules/theme/theme-context.d.ts +1 -1
  142. package/lib/modules/theme/theme-context.d.ts.map +1 -1
  143. package/lib/modules/transport-mode/filter/filter.d.ts +1 -1
  144. package/lib/modules/transport-mode/filter/filter.d.ts.map +1 -1
  145. package/lib/modules/transport-mode/icon/index.d.ts +4 -4
  146. package/lib/modules/transport-mode/icon/index.d.ts.map +1 -1
  147. package/lib/modules/transport-mode/types.d.ts +3 -5
  148. package/lib/modules/transport-mode/types.d.ts.map +1 -1
  149. package/lib/modules/transport-mode/types.js +3 -138
  150. package/lib/modules/transport-mode/utils.d.ts +2 -2
  151. package/lib/modules/transport-mode/utils.d.ts.map +1 -1
  152. package/lib/modules/transport-mode/utils.js +39 -6
  153. package/lib/refund/forms/refund-and-travel-guarantee/index.d.ts +1 -1
  154. package/lib/refund/forms/refund-and-travel-guarantee/index.d.ts.map +1 -1
  155. package/lib/refund/forms/refund-and-travel-guarantee/index.js +1 -1
  156. package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.d.ts +1 -1
  157. package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.d.ts.map +1 -1
  158. package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.js +1 -1
  159. package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.d.ts +1 -1
  160. package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.d.ts.map +1 -1
  161. package/lib/refund/forms/refund-ticket/appTicketRefund.d.ts +2 -2
  162. package/lib/refund/forms/refund-ticket/appTicketRefund.d.ts.map +1 -1
  163. package/lib/refund/forms/refund-ticket/appTicketRefund.js +18 -2
  164. package/lib/refund/forms/refund-ticket/index.d.ts +1 -1
  165. package/lib/refund/forms/refund-ticket/index.d.ts.map +1 -1
  166. package/lib/refund/forms/refund-ticket/index.js +1 -1
  167. package/lib/refund/forms/refund-ticket/otherTicketRefund.d.ts +1 -1
  168. package/lib/refund/forms/refund-ticket/otherTicketRefund.d.ts.map +1 -1
  169. package/lib/refund/forms/refund-ticket/otherTicketRefund.js +16 -4
  170. package/lib/refund/forms/residualValueOnTravelCard/index.d.ts +1 -1
  171. package/lib/refund/forms/residualValueOnTravelCard/index.d.ts.map +1 -1
  172. package/lib/refund/forms/residualValueOnTravelCard/index.js +1 -2
  173. package/lib/refund/index.d.ts +1 -1
  174. package/lib/refund/index.d.ts.map +1 -1
  175. package/lib/refund/index.js +9 -0
  176. package/lib/refund/refundFormMachine.d.ts +10 -2
  177. package/lib/refund/refundFormMachine.d.ts.map +1 -1
  178. package/lib/refund/refundFormMachine.js +23 -2
  179. package/lib/server/departures-route-handler.d.ts +27 -0
  180. package/lib/server/departures-route-handler.d.ts.map +1 -0
  181. package/lib/server/departures-route-handler.js +93 -0
  182. package/lib/server/index.d.ts +2 -0
  183. package/lib/server/index.d.ts.map +1 -1
  184. package/lib/server/index.js +5 -1
  185. package/lib/server/journey-planner/authority.d.ts +2 -2
  186. package/lib/server/journey-planner/authority.js +3 -3
  187. package/lib/server/journey-planner/index.d.ts.map +1 -1
  188. package/lib/server/journey-planner/index.js +8 -9
  189. package/lib/server/journey-planner/journey-gql/lines.generated.d.ts +1 -0
  190. package/lib/server/journey-planner/journey-gql/lines.generated.d.ts.map +1 -1
  191. package/lib/server/journey-planner/journey-gql/lines.generated.js +1 -0
  192. package/lib/server/journey-planner/validators.d.ts +4 -4
  193. package/lib/server/journey-planner/validators.js +3 -3
  194. package/lib/server/lines-route-handler.d.ts +7 -18
  195. package/lib/server/lines-route-handler.d.ts.map +1 -1
  196. package/lib/server/lines-route-handler.js +15 -17
  197. package/lib/server/submit-route-handler.d.ts +20 -0
  198. package/lib/server/submit-route-handler.d.ts.map +1 -0
  199. package/lib/server/submit-route-handler.js +62 -0
  200. package/lib/success-content/success-content.d.ts +1 -1
  201. package/lib/success-content/success-content.d.ts.map +1 -1
  202. package/lib/ticket-control/events.d.ts +1 -1
  203. package/lib/ticket-control/events.d.ts.map +1 -1
  204. package/lib/ticket-control/forms/feeComplaintForm.d.ts +1 -1
  205. package/lib/ticket-control/forms/feeComplaintForm.d.ts.map +1 -1
  206. package/lib/ticket-control/forms/feeComplaintForm.js +5 -1
  207. package/lib/ticket-control/forms/feedbackForm.d.ts +1 -1
  208. package/lib/ticket-control/forms/feedbackForm.d.ts.map +1 -1
  209. package/lib/ticket-control/forms/postponePayment.d.ts +1 -1
  210. package/lib/ticket-control/forms/postponePayment.d.ts.map +1 -1
  211. package/lib/ticket-control/forms/postponePayment.js +5 -1
  212. package/lib/ticket-control/index.d.ts +1 -1
  213. package/lib/ticket-control/index.d.ts.map +1 -1
  214. package/lib/ticket-control/index.js +2 -0
  215. package/lib/ticket-control/ticket-control-form-machine.d.ts +8 -4
  216. package/lib/ticket-control/ticket-control-form-machine.d.ts.map +1 -1
  217. package/lib/ticket-control/ticket-control-form-machine.js +14 -3
  218. package/lib/ticketing/events.d.ts.map +1 -1
  219. package/lib/ticketing/forms/app/appAccountForm.d.ts +1 -1
  220. package/lib/ticketing/forms/app/appAccountForm.d.ts.map +1 -1
  221. package/lib/ticketing/forms/app/appTicketingForm.d.ts +1 -1
  222. package/lib/ticketing/forms/app/appTicketingForm.d.ts.map +1 -1
  223. package/lib/ticketing/forms/app/appTravelSuggestionForm.d.ts +1 -1
  224. package/lib/ticketing/forms/app/appTravelSuggestionForm.d.ts.map +1 -1
  225. package/lib/ticketing/forms/app/index.d.ts +1 -1
  226. package/lib/ticketing/forms/app/index.d.ts.map +1 -1
  227. package/lib/ticketing/forms/priceAndTicketTypesForm.d.ts +1 -1
  228. package/lib/ticketing/forms/priceAndTicketTypesForm.d.ts.map +1 -1
  229. package/lib/ticketing/forms/travel-card/index.d.ts +1 -1
  230. package/lib/ticketing/forms/travel-card/index.d.ts.map +1 -1
  231. package/lib/ticketing/forms/travel-card/orderTravelCard.d.ts +1 -1
  232. package/lib/ticketing/forms/travel-card/orderTravelCard.d.ts.map +1 -1
  233. package/lib/ticketing/forms/travel-card/orderTravelCard.js +1 -1
  234. package/lib/ticketing/forms/travel-card/travelCardQuestionForm.d.ts +1 -1
  235. package/lib/ticketing/forms/travel-card/travelCardQuestionForm.d.ts.map +1 -1
  236. package/lib/ticketing/forms/webshop/index.d.ts +1 -1
  237. package/lib/ticketing/forms/webshop/index.d.ts.map +1 -1
  238. package/lib/ticketing/forms/webshop/webshopAccountForm.d.ts +1 -1
  239. package/lib/ticketing/forms/webshop/webshopAccountForm.d.ts.map +1 -1
  240. package/lib/ticketing/forms/webshop/webshopTicketingForm.d.ts +1 -1
  241. package/lib/ticketing/forms/webshop/webshopTicketingForm.d.ts.map +1 -1
  242. package/lib/ticketing/index.d.ts +1 -1
  243. package/lib/ticketing/index.d.ts.map +1 -1
  244. package/lib/ticketing/ticketingStateMachine.d.ts +2 -2
  245. package/lib/ticketing/ticketingStateMachine.d.ts.map +1 -1
  246. package/lib/translations/commons.d.ts +1 -0
  247. package/lib/translations/commons.d.ts.map +1 -1
  248. package/lib/translations/commons.js +4 -4
  249. package/lib/translations/index.d.ts +2 -6
  250. package/lib/translations/index.d.ts.map +1 -1
  251. package/lib/translations/index.js +1 -9
  252. package/lib/translations/language-context.d.ts +3 -11
  253. package/lib/translations/language-context.d.ts.map +1 -1
  254. package/lib/translations/language-context.js +1 -31
  255. package/lib/translations/merge-overrides.d.ts +3 -9
  256. package/lib/translations/merge-overrides.d.ts.map +1 -1
  257. package/lib/translations/merge-overrides.js +3 -15
  258. package/lib/translations/pages/contact.d.ts +15 -4
  259. package/lib/translations/pages/contact.d.ts.map +1 -1
  260. package/lib/translations/pages/contact.js +17 -20
  261. package/lib/translations/server/endpoints.d.ts +0 -62
  262. package/lib/translations/server/endpoints.d.ts.map +1 -1
  263. package/lib/translations/server/endpoints.js +1 -139
  264. package/lib/translations/translations-context.d.ts +1 -1
  265. package/lib/translations/translations-context.d.ts.map +1 -1
  266. package/lib/translations/types.d.ts +7 -13
  267. package/lib/translations/types.d.ts.map +1 -1
  268. package/lib/translations/utils.d.ts +0 -7
  269. package/lib/translations/utils.d.ts.map +1 -1
  270. package/lib/translations/utils.js +0 -26
  271. package/lib/types/submit-payloads.d.ts +1 -0
  272. package/lib/types/submit-payloads.d.ts.map +1 -1
  273. package/lib/types.d.ts.map +1 -1
  274. package/lib/validation/validationRules.d.ts.map +1 -1
  275. package/lib/validation/validationRules.js +7 -0
  276. package/package.json +37 -32
  277. package/lib/components/icon/icon-wrapper.d.ts +0 -30
  278. package/lib/components/icon/icon-wrapper.d.ts.map +0 -1
  279. package/lib/components/icon/icon-wrapper.js +0 -39
  280. package/lib/components/icon/mono-icon-new.d.ts +0 -32
  281. package/lib/components/icon/mono-icon-new.d.ts.map +0 -1
  282. package/lib/components/icon/mono-icon-new.js +0 -43
  283. package/lib/translations/common/index.d.ts +0 -3
  284. package/lib/translations/common/index.d.ts.map +0 -1
  285. package/lib/translations/common/index.js +0 -7
  286. package/lib/translations/common/layout.d.ts +0 -8
  287. package/lib/translations/common/layout.d.ts.map +0 -1
  288. package/lib/translations/common/layout.js +0 -39
  289. package/lib/translations/common/titles.d.ts +0 -4
  290. package/lib/translations/common/titles.d.ts.map +0 -1
  291. package/lib/translations/common/titles.js +0 -25
  292. package/lib/translations/json-to-override.d.ts +0 -19
  293. package/lib/translations/json-to-override.d.ts.map +0 -1
  294. package/lib/translations/json-to-override.js +0 -65
  295. package/lib/translations/load-org-translations.d.ts +0 -19
  296. package/lib/translations/load-org-translations.d.ts.map +0 -1
  297. package/lib/translations/load-org-translations.js +0 -23
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.displayPrivacyAndTerms = exports.getContactPages = void 0;
7
+ exports.useVisiblePages = useVisiblePages;
8
+ exports.getVisiblePages = getVisiblePages;
9
+ exports.findMatchedPage = findMatchedPage;
10
+ exports.getPageTitleForPathname = getPageTitleForPathname;
11
+ exports.useActiveContactPageTitle = useActiveContactPageTitle;
12
+ const navigation_1 = require("next/navigation");
13
+ const translations_1 = require("../translations");
14
+ const config_1 = require("../modules/config");
15
+ const ticket_control_1 = __importDefault(require("../ticket-control"));
16
+ const refund_1 = __importDefault(require("../refund"));
17
+ const means_of_transport_1 = __importDefault(require("../means-of-transport"));
18
+ const ticketing_1 = __importDefault(require("../ticketing"));
19
+ const lost_property_1 = __importDefault(require("../lost-property"));
20
+ const lost_property_external_1 = __importDefault(require("../lost-property-external"));
21
+ const group_travel_1 = __importDefault(require("../group-travel"));
22
+ const journey_info_1 = __importDefault(require("../journey-info"));
23
+ /**
24
+ * All contact pages (tabs) the package can render, each paired with the form
25
+ * component it renders. Hosts opt into the ones they want via `pages.enabledPageIds`.
26
+ */
27
+ const getContactPages = (PageText = translations_1.PageText) => [
28
+ {
29
+ id: 'ticket-control',
30
+ title: PageText.Contact.ticketControl.title,
31
+ slug: 'ticket-control',
32
+ icon: 'ticketing/TicketInvalid',
33
+ Component: ticket_control_1.default,
34
+ },
35
+ {
36
+ id: 'refund',
37
+ title: PageText.Contact.refund.title,
38
+ slug: 'refund',
39
+ icon: 'transportation-entur/Taxi',
40
+ Component: refund_1.default,
41
+ },
42
+ {
43
+ id: 'means-of-transport',
44
+ title: PageText.Contact.modeOfTransport.title,
45
+ slug: 'means-of-transport',
46
+ icon: 'transportation/BusFill',
47
+ Component: means_of_transport_1.default,
48
+ },
49
+ {
50
+ id: 'ticketing',
51
+ title: PageText.Contact.ticketing.title,
52
+ slug: 'ticketing',
53
+ icon: 'devices/Phone',
54
+ Component: ticketing_1.default,
55
+ },
56
+ {
57
+ id: 'lost-property',
58
+ title: PageText.Contact.lostProperty.title,
59
+ slug: 'lost-property',
60
+ icon: 'actions/Support',
61
+ Component: lost_property_1.default,
62
+ },
63
+ {
64
+ id: 'lost-property-external',
65
+ title: PageText.Contact.lostProperty.title,
66
+ slug: 'lost-property',
67
+ icon: 'actions/Support',
68
+ Component: lost_property_external_1.default,
69
+ },
70
+ {
71
+ id: 'group-travel',
72
+ title: PageText.Contact.groupTravel.title,
73
+ slug: 'group-travel',
74
+ icon: 'ticketing/TicketMultiple',
75
+ Component: group_travel_1.default,
76
+ },
77
+ {
78
+ id: 'journey-info',
79
+ title: PageText.Contact.journeyInfo.title,
80
+ slug: 'journey-info',
81
+ icon: 'actions/Feedback',
82
+ Component: journey_info_1.default,
83
+ },
84
+ ];
85
+ exports.getContactPages = getContactPages;
86
+ function useVisiblePages() {
87
+ const pageText = (0, translations_1.usePageText)();
88
+ const { pages } = (0, config_1.useContactFormConfig)();
89
+ return getVisiblePages(pages, pageText);
90
+ }
91
+ function getVisiblePages(pages, pageText) {
92
+ const allPages = [...(0, exports.getContactPages)(pageText), ...(pages.extraPages ?? [])];
93
+ return pages.enabledPageIds
94
+ .map((id) => allPages.find((page) => page.id === id))
95
+ .filter((page) => page !== undefined);
96
+ }
97
+ function findMatchedPage(pathname, basePath, visiblePages) {
98
+ return visiblePages.find((page) => pathname.includes(`${basePath}/${page.slug}`));
99
+ }
100
+ function getPageTitleForPathname(pathname, config) {
101
+ const basePath = config.layout?.basePath ?? '/contact';
102
+ const { PageText: mergedPageText } = (0, translations_1.mergeTranslationOverrides)({
103
+ pages: config.translations?.pages,
104
+ });
105
+ const visiblePages = getVisiblePages(config.pages, mergedPageText);
106
+ return findMatchedPage(pathname, basePath, visiblePages)?.title;
107
+ }
108
+ /**
109
+ * Title of the currently active contact page, reactive to client-side
110
+ * navigation (including the shallow routing `ContactPageNavLink` uses).
111
+ * Safe to call above `ContactFormRoot`, since it only depends on Next's
112
+ * router, not the package's translation/config context.
113
+ */
114
+ function useActiveContactPageTitle(config) {
115
+ const pathname = (0, navigation_1.usePathname)();
116
+ return getPageTitleForPathname(pathname, config);
117
+ }
118
+ const pagesWithoutPrivacyAndTerms = ['group-travel'];
119
+ const displayPrivacyAndTerms = (contactPage) => {
120
+ if (!contactPage)
121
+ return false;
122
+ return !pagesWithoutPrivacyAndTerms.includes(contactPage.slug);
123
+ };
124
+ exports.displayPrivacyAndTerms = displayPrivacyAndTerms;
@@ -1,3 +1,4 @@
1
- export { default as ContactPageLayout, getContactPages, } from './contact-page-layout';
1
+ export { default as ContactPageLayout } from './contact-page-layout';
2
+ export { getContactPages, getPageTitleForPathname, useActiveContactPageTitle, } from './contact-pages';
2
3
  export { ContactFormContainer, type ContactFormContainerProps, } from './contact-form-container';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/layouts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,IAAI,iBAAiB,EAC5B,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,oBAAoB,EACpB,KAAK,yBAAyB,GAC/B,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/layouts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,oBAAoB,EACpB,KAAK,yBAAyB,GAC/B,MAAM,0BAA0B,CAAC"}
@@ -3,9 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ContactFormContainer = exports.getContactPages = exports.ContactPageLayout = void 0;
6
+ exports.ContactFormContainer = exports.useActiveContactPageTitle = exports.getPageTitleForPathname = exports.getContactPages = exports.ContactPageLayout = void 0;
7
7
  var contact_page_layout_1 = require("./contact-page-layout");
8
8
  Object.defineProperty(exports, "ContactPageLayout", { enumerable: true, get: function () { return __importDefault(contact_page_layout_1).default; } });
9
- Object.defineProperty(exports, "getContactPages", { enumerable: true, get: function () { return contact_page_layout_1.getContactPages; } });
9
+ var contact_pages_1 = require("./contact-pages");
10
+ Object.defineProperty(exports, "getContactPages", { enumerable: true, get: function () { return contact_pages_1.getContactPages; } });
11
+ Object.defineProperty(exports, "getPageTitleForPathname", { enumerable: true, get: function () { return contact_pages_1.getPageTitleForPathname; } });
12
+ Object.defineProperty(exports, "useActiveContactPageTitle", { enumerable: true, get: function () { return contact_pages_1.useActiveContactPageTitle; } });
10
13
  var contact_form_container_1 = require("./contact-form-container");
11
14
  Object.defineProperty(exports, "ContactFormContainer", { enumerable: true, get: function () { return contact_form_container_1.ContactFormContainer; } });
@@ -18,7 +18,7 @@ function formatDepartureTime(departureTime) {
18
18
  }
19
19
  function useDepartures(date, lineId, fromStopId, toStopId) {
20
20
  const apiConfig = (0, config_1.useApiConfig)();
21
- const endpoint = apiConfig.endpoints.departures;
21
+ const endpoint = apiConfig.endpoints?.departures;
22
22
  const key = endpoint && date && lineId && fromStopId && toStopId
23
23
  ? `${endpoint}?date=${encodeURIComponent(date)}&lineId=${encodeURIComponent(lineId)}&fromStopId=${encodeURIComponent(fromStopId)}&toStopId=${encodeURIComponent(toStopId)}`
24
24
  : null;
@@ -31,5 +31,5 @@ function useDepartures(date, lineId, fromStopId, toStopId) {
31
31
  }
32
32
  function useDeparturesEndpointConfigured() {
33
33
  const apiConfig = (0, config_1.useApiConfig)();
34
- return !!apiConfig.endpoints.departures;
34
+ return !!apiConfig.endpoints?.departures;
35
35
  }
@@ -8,8 +8,8 @@ export declare const useLines: () => {
8
8
  id: string;
9
9
  name: string;
10
10
  publicCode: string | null;
11
- transportMode: "unknown" | "air" | "bus" | "foot" | "bicycle" | "cableway" | "car" | "carpool" | "coach" | "funicular" | "lift" | "metro" | "monorail" | "rail" | "scooter" | "taxi" | "tram" | "trolleybus" | "water" | "snowAndIce" | null;
12
- transportSubmode: "undefined" | "unknown" | "funicular" | "lift" | "metro" | "SchengenAreaFlight" | "airportBoatLink" | "airportLinkBus" | "airportLinkRail" | "airshipService" | "allFunicularServices" | "allHireVehicles" | "allTaxiServices" | "bikeTaxi" | "blackCab" | "cableCar" | "cableFerry" | "canalBarge" | "carTransportRailService" | "chairLift" | "charterTaxi" | "cityTram" | "communalTaxi" | "commuterCoach" | "crossCountryRail" | "dedicatedLaneBus" | "demandAndResponseBus" | "domesticCharterFlight" | "domesticFlight" | "domesticScheduledFlight" | "dragLift" | "escooter" | "expressBus" | "helicopterService" | "highFrequencyBus" | "highSpeedPassengerService" | "highSpeedRail" | "highSpeedVehicleService" | "hireCar" | "hireCycle" | "hireMotorbike" | "hireVan" | "intercontinentalCharterFlight" | "intercontinentalFlight" | "international" | "internationalCarFerry" | "internationalCharterFlight" | "internationalCoach" | "internationalFlight" | "internationalPassengerFerry" | "interregionalRail" | "local" | "localBus" | "localCarFerry" | "localPassengerFerry" | "localTram" | "longDistance" | "miniCab" | "mobilityBus" | "mobilityBusForRegisteredDisabled" | "nationalCarFerry" | "nationalCoach" | "nationalPassengerFerry" | "nightBus" | "nightRail" | "postBoat" | "postBus" | "rackAndPinionRailway" | "railReplacementBus" | "railShuttle" | "railTaxi" | "regionalBus" | "regionalCarFerry" | "regionalCoach" | "regionalPassengerFerry" | "regionalRail" | "regionalTram" | "replacementRailService" | "riverBus" | "roadFerryLink" | "roundTripCharterFlight" | "scheduledFerry" | "schoolAndPublicServiceBus" | "schoolBoat" | "schoolBus" | "schoolCoach" | "shortHaulInternationalFlight" | "shuttleBus" | "shuttleCoach" | "shuttleFerryService" | "shuttleFlight" | "shuttleTram" | "sightseeingBus" | "sightseeingCoach" | "sightseeingFlight" | "sightseeingService" | "sightseeingTram" | "sleeperRailService" | "specialCoach" | "specialNeedsBus" | "specialTrain" | "streetCableCar" | "suburbanRailway" | "telecabin" | "telecabinLink" | "touristCoach" | "touristRailway" | "trainFerry" | "trainTram" | "tube" | "undefinedFunicular" | "urbanRailway" | "waterTaxi" | null;
11
+ transportMode: "bicycle" | "foot" | "scooter" | "air" | "bus" | "cableway" | "car" | "carpool" | "coach" | "funicular" | "lift" | "metro" | "monorail" | "rail" | "taxi" | "tram" | "trolleybus" | "snowAndIce" | "unknown" | "water" | null;
12
+ transportSubmode: "undefined" | "funicular" | "lift" | "metro" | "unknown" | "escooter" | "ebicycle" | "SchengenAreaFlight" | "airportBoatLink" | "airportLinkBus" | "airportLinkRail" | "airshipService" | "allFunicularServices" | "allHireVehicles" | "allTaxiServices" | "bikeTaxi" | "blackCab" | "cableCar" | "cableFerry" | "canalBarge" | "carTransportRailService" | "chairLift" | "charterTaxi" | "cityTram" | "communalTaxi" | "commuterCoach" | "crossCountryRail" | "dedicatedLaneBus" | "demandAndResponseBus" | "domesticCharterFlight" | "domesticFlight" | "domesticScheduledFlight" | "dragLift" | "expressBus" | "helicopterService" | "highFrequencyBus" | "highSpeedPassengerService" | "highSpeedRail" | "highSpeedVehicleService" | "hireCar" | "hireCycle" | "hireMotorbike" | "hireVan" | "intercontinentalCharterFlight" | "intercontinentalFlight" | "international" | "internationalCarFerry" | "internationalCharterFlight" | "internationalCoach" | "internationalFlight" | "internationalPassengerFerry" | "interregionalRail" | "local" | "localBus" | "localCarFerry" | "localPassengerFerry" | "localTram" | "longDistance" | "miniCab" | "mobilityBus" | "mobilityBusForRegisteredDisabled" | "nationalCarFerry" | "nationalCoach" | "nationalPassengerFerry" | "nightBus" | "nightRail" | "postBoat" | "postBus" | "rackAndPinionRailway" | "railReplacementBus" | "railShuttle" | "railTaxi" | "regionalBus" | "regionalCarFerry" | "regionalCoach" | "regionalPassengerFerry" | "regionalRail" | "regionalTram" | "replacementRailService" | "riverBus" | "roadFerryLink" | "roundTripCharterFlight" | "scheduledFerry" | "schoolAndPublicServiceBus" | "schoolBoat" | "schoolBus" | "schoolCoach" | "shortHaulInternationalFlight" | "shuttleBus" | "shuttleCoach" | "shuttleFerryService" | "shuttleFlight" | "shuttleTram" | "sightseeingBus" | "sightseeingCoach" | "sightseeingFlight" | "sightseeingService" | "sightseeingTram" | "sleeperRailService" | "specialCoach" | "specialNeedsBus" | "specialTrain" | "streetCableCar" | "suburbanRailway" | "telecabin" | "telecabinLink" | "touristCoach" | "touristRailway" | "trainFerry" | "trainTram" | "tube" | "undefinedFunicular" | "urbanRailway" | "waterTaxi" | null;
13
13
  quays: {
14
14
  id: string;
15
15
  name: string;
@@ -83,7 +83,7 @@ const useLines = () => {
83
83
  const apiConfig = (0, config_1.useApiConfig)();
84
84
  const { features, lineFilters } = (0, config_1.useContactFormConfig)();
85
85
  const includeFerry = features?.includeFerry !== false;
86
- const linesEndpoint = apiConfig.endpoints.lines || '/api/contact/lines';
86
+ const linesEndpoint = apiConfig.endpoints?.lines || '/api/contact/lines';
87
87
  const { data: lines, error, isLoading, } = (0, immutable_1.default)(linesEndpoint, api_browser_1.swrFetcher);
88
88
  const getLinesByMode = (transportMode) => {
89
89
  if (!lines)
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import type { LostPropertyContext, LostPropertyEvent } from './LostPropertyMachine';
2
3
  type LostPropertyFormProps = {
3
4
  state: {
@@ -5,6 +6,6 @@ type LostPropertyFormProps = {
5
6
  };
6
7
  send: (event: LostPropertyEvent) => void;
7
8
  };
8
- export default function LostPropertyForm({ state, send, }: LostPropertyFormProps): import("react/jsx-runtime").JSX.Element;
9
+ export default function LostPropertyForm({ state, send, }: LostPropertyFormProps): React.JSX.Element;
9
10
  export {};
10
11
  //# sourceMappingURL=LostPropertyForm.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"LostPropertyForm.d.ts","sourceRoot":"","sources":["../../src/lost-property/LostPropertyForm.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAE/B,KAAK,qBAAqB,GAAG;IAC3B,KAAK,EAAE;QAAE,OAAO,EAAE,mBAAmB,CAAA;KAAE,CAAC;IACxC,IAAI,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;CAC1C,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,KAAK,EACL,IAAI,GACL,EAAE,qBAAqB,2CAqOvB"}
1
+ {"version":3,"file":"LostPropertyForm.d.ts","sourceRoot":"","sources":["../../src/lost-property/LostPropertyForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAiB1B,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAE/B,KAAK,qBAAqB,GAAG;IAC3B,KAAK,EAAE;QAAE,OAAO,EAAE,mBAAmB,CAAA;KAAE,CAAC;IACxC,IAAI,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;CAC1C,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,KAAK,EACL,IAAI,GACL,EAAE,qBAAqB,qBAqOvB"}
@@ -1,7 +1,7 @@
1
1
  import { InputErrorMessages } from '../validation';
2
2
  import type { TransportModeType } from '../types';
3
3
  import type { Line } from '../server/journey-planner/validators';
4
- import type { FormSchemaName } from '../modules/config/types';
4
+ import type { FormSlug } from '../modules/config/types';
5
5
  export type LostPropertyContext = {
6
6
  transportMode?: TransportModeType;
7
7
  line?: Line;
@@ -51,7 +51,7 @@ type SubmitInput = {
51
51
  email?: string;
52
52
  phoneNumber?: string;
53
53
  };
54
- export declare function createLostPropertyMachine(onSubmit: (schemaName: FormSchemaName, state: Record<string, unknown>) => Promise<Response>, paths?: MachinePaths): import("xstate").StateMachine<LostPropertyContext, {
54
+ export declare function createLostPropertyMachine(onSubmit: (slug: FormSlug, state: Record<string, unknown>) => Promise<Response>, paths?: MachinePaths): import("xstate").StateMachine<LostPropertyContext, {
55
55
  type: "ON_INPUT_CHANGE";
56
56
  inputName: string;
57
57
  value: unknown;
@@ -1 +1 @@
1
- {"version":3,"file":"LostPropertyMachine.d.ts","sourceRoot":"","sources":["../../src/lost-property/LostPropertyMachine.ts"],"names":[],"mappings":"AACA,OAAO,EAAwB,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAMzE,OAAO,KAA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M,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,CACR,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC3B,OAAO,CAAC,QAAQ,CAAC,EACtB,KAAK,CAAC,EAAE,YAAY;UA3BV,iBAAiB;eAAa,MAAM;WAAS,OAAO;;UACpD,yBAAyB;WAAS,iBAAiB;;UACnD,gBAAgB;WAAS,IAAI,GAAG,SAAS;;UACzC,QAAQ;2BAAyB,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4NpD"}
@@ -129,7 +129,7 @@ function createLostPropertyMachine(onSubmit, paths) {
129
129
  },
130
130
  actors: {
131
131
  submit: (0, xstate_1.fromPromise)(async ({ input }) => {
132
- const response = await onSubmit('lostProperty', input);
132
+ const response = await onSubmit('lost-property', input);
133
133
  if (!response.ok)
134
134
  throw new Error('Failed to submit');
135
135
  return response.ok;
@@ -1,2 +1,2 @@
1
- export default function LostPropertyContent(): import("react/jsx-runtime").JSX.Element;
1
+ export default function LostPropertyContent(): import("react").JSX.Element;
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lost-property/index.tsx"],"names":[],"mappings":"AAaA,MAAM,CAAC,OAAO,UAAU,mBAAmB,4CA+C1C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lost-property/index.tsx"],"names":[],"mappings":"AAaA,MAAM,CAAC,OAAO,UAAU,mBAAmB,gCA+C1C"}
@@ -1,2 +1,2 @@
1
- export default function LostPropertyExternalFormContent(): import("react/jsx-runtime").JSX.Element;
1
+ export default function LostPropertyExternalFormContent(): import("react").JSX.Element;
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lost-property-external/index.tsx"],"names":[],"mappings":"AAMA,MAAM,CAAC,OAAO,UAAU,+BAA+B,4CAmBtD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lost-property-external/index.tsx"],"names":[],"mappings":"AAKA,MAAM,CAAC,OAAO,UAAU,+BAA+B,gCAkBtD"}
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.default = LostPropertyExternalFormContent;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
- const contact_module_css_1 = __importDefault(require("../contact.module.css"));
9
8
  const components_1 = require("../components");
10
9
  const link_1 = __importDefault(require("next/link"));
11
10
  const translations_1 = require("../translations");
@@ -13,5 +12,5 @@ const typography_1 = require("../components/typography");
13
12
  function LostPropertyExternalFormContent() {
14
13
  const PageText = (0, translations_1.usePageText)();
15
14
  const { t } = (0, translations_1.useTranslation)();
16
- return ((0, jsx_runtime_1.jsx)(components_1.SectionCard, { title: t(PageText.Contact.lostProperty.title), children: (0, jsx_runtime_1.jsxs)(typography_1.Typo.p, { textType: "body__m", children: [t(PageText.Contact.lostProperty.description.info), ' ', (0, jsx_runtime_1.jsx)(link_1.default, { className: contact_module_css_1.default.link, href: t(PageText.Contact.lostProperty.description.url), target: "_blank", rel: "noopener noreferrer", children: t(PageText.Contact.lostProperty.description.externalLink) })] }) }));
15
+ return ((0, jsx_runtime_1.jsx)(components_1.SectionCard, { title: t(PageText.Contact.lostProperty.title), children: (0, jsx_runtime_1.jsxs)(typography_1.Typo.p, { textType: "body__m", children: [t(PageText.Contact.lostProperty.description.info), ' ', (0, jsx_runtime_1.jsx)(link_1.default, { href: t(PageText.Contact.lostProperty.description.url), target: "_blank", rel: "noopener noreferrer", children: t(PageText.Contact.lostProperty.description.externalLink) })] }) }));
17
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/means-of-transport/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAE7D,KAAK,kCAAkC,GACnC;IACE,IAAI,EAAE,iBAAiB,CAAC;IACxB,SAAS,EAAE,UAAU,GAAG,kBAAkB,GAAG,MAAM,CAAC;IACpD,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;CACxD,GACD;IACE,IAAI,EAAE,kBAAkB,CAAC;IACzB,QAAQ,EAAE,QAAQ,CAAC;CACpB,GACD;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,qBAAqB,EAAE,MAAM,EAAE,CAAC;CACjC,CAAC;AAEN,eAAO,MAAM,0BAA0B,EACnC,kCAAkC,GAClC,OAAO,YAAY,CAAC"}
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/means-of-transport/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAE7D,KAAK,kCAAkC,GACnC;IACE,IAAI,EAAE,iBAAiB,CAAC;IACxB,SAAS,EAAE,UAAU,GAAG,kBAAkB,GAAG,MAAM,CAAC;IACpD,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;CACxD,GACD;IACE,IAAI,EAAE,kBAAkB,CAAC;IACzB,QAAQ,EAAE,QAAQ,CAAC;CACpB,GACD;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,qBAAqB,EAAE,MAAM,EAAE,CAAC;CACjC,CAAC;AAEN,eAAO,MAAM,0BAA0B,EACrC,kCAAkC,GAAG,OAAO,YAAY,CAAC"}
@@ -6,6 +6,6 @@ type DelayFormProps = {
6
6
  };
7
7
  send: (event: typeof meansOfTransportFormEvents) => void;
8
8
  };
9
- export declare const DelayForm: ({ state, send }: DelayFormProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const DelayForm: ({ state, send }: DelayFormProps) => import("react").JSX.Element;
10
10
  export default DelayForm;
11
11
  //# sourceMappingURL=delayForm.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"delayForm.d.ts","sourceRoot":"","sources":["../../../src/means-of-transport/forms/delayForm.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAiBvD,KAAK,cAAc,GAAG;IACpB,KAAK,EAAE;QAAE,OAAO,EAAE,4BAA4B,CAAA;KAAE,CAAC;IACjD,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,0BAA0B,KAAK,IAAI,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,iBAAiB,cAAc,4CAkRxD,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"delayForm.d.ts","sourceRoot":"","sources":["../../../src/means-of-transport/forms/delayForm.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAiBvD,KAAK,cAAc,GAAG;IACpB,KAAK,EAAE;QAAE,OAAO,EAAE,4BAA4B,CAAA;KAAE,CAAC;IACjD,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,0BAA0B,KAAK,IAAI,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,iBAAiB,cAAc,gCAkRxD,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -6,6 +6,6 @@ type DriverFormProps = {
6
6
  };
7
7
  send: (event: typeof meansOfTransportFormEvents) => void;
8
8
  };
9
- export declare const DriverForm: ({ state, send }: DriverFormProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const DriverForm: ({ state, send }: DriverFormProps) => import("react").JSX.Element;
10
10
  export default DriverForm;
11
11
  //# sourceMappingURL=driverForm.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"driverForm.d.ts","sourceRoot":"","sources":["../../../src/means-of-transport/forms/driverForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAIlF,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAiBvD,KAAK,eAAe,GAAG;IACrB,KAAK,EAAE;QAAE,OAAO,EAAE,4BAA4B,CAAA;KAAE,CAAC;IACjD,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,0BAA0B,KAAK,IAAI,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,iBAAiB,eAAe,4CAkR1D,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"driverForm.d.ts","sourceRoot":"","sources":["../../../src/means-of-transport/forms/driverForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAIlF,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAiBvD,KAAK,eAAe,GAAG;IACrB,KAAK,EAAE;QAAE,OAAO,EAAE,4BAA4B,CAAA;KAAE,CAAC;IACjD,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,0BAA0B,KAAK,IAAI,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,iBAAiB,eAAe,gCAkR1D,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -6,6 +6,6 @@ type InjuryFormProps = {
6
6
  };
7
7
  send: (event: typeof meansOfTransportFormEvents) => void;
8
8
  };
9
- export declare const InjuryForm: ({ state, send }: InjuryFormProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const InjuryForm: ({ state, send }: InjuryFormProps) => import("react").JSX.Element;
10
10
  export default InjuryForm;
11
11
  //# sourceMappingURL=injuryForm.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"injuryForm.d.ts","sourceRoot":"","sources":["../../../src/means-of-transport/forms/injuryForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAIlF,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAiBvD,KAAK,eAAe,GAAG;IACrB,KAAK,EAAE;QAAE,OAAO,EAAE,4BAA4B,CAAA;KAAE,CAAC;IACjD,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,0BAA0B,KAAK,IAAI,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,iBAAiB,eAAe,4CAiR1D,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"injuryForm.d.ts","sourceRoot":"","sources":["../../../src/means-of-transport/forms/injuryForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAIlF,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAiBvD,KAAK,eAAe,GAAG;IACrB,KAAK,EAAE;QAAE,OAAO,EAAE,4BAA4B,CAAA;KAAE,CAAC;IACjD,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,0BAA0B,KAAK,IAAI,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,iBAAiB,eAAe,gCAiR1D,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -6,6 +6,6 @@ type ServiceOfferingFormProps = {
6
6
  };
7
7
  send: (event: typeof meansOfTransportFormEvents) => void;
8
8
  };
9
- export declare const ServiceOfferingForm: ({ state, send, }: ServiceOfferingFormProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const ServiceOfferingForm: ({ state, send, }: ServiceOfferingFormProps) => import("react").JSX.Element;
10
10
  export default ServiceOfferingForm;
11
11
  //# sourceMappingURL=serviceOfferingForm.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"serviceOfferingForm.d.ts","sourceRoot":"","sources":["../../../src/means-of-transport/forms/serviceOfferingForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAIlF,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAcvD,KAAK,wBAAwB,GAAG;IAC9B,KAAK,EAAE;QAAE,OAAO,EAAE,4BAA4B,CAAA;KAAE,CAAC;IACjD,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,0BAA0B,KAAK,IAAI,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,kBAGjC,wBAAwB,4CA+L1B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"serviceOfferingForm.d.ts","sourceRoot":"","sources":["../../../src/means-of-transport/forms/serviceOfferingForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAIlF,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAcvD,KAAK,wBAAwB,GAAG;IAC9B,KAAK,EAAE;QAAE,OAAO,EAAE,4BAA4B,CAAA;KAAE,CAAC;IACjD,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,0BAA0B,KAAK,IAAI,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,kBAGjC,wBAAwB,gCAqM1B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -21,7 +21,9 @@ const ServiceOfferingForm = ({ state, send, }) => {
21
21
  type: 'ON_LINE_CHANGE',
22
22
  value: value,
23
23
  });
24
- } })] }), (0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.input.feedback.title), isRequired: true, children: (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "feedback", description: t(PageText.Contact.input.feedback.description), value: state.context.feedback || '', onChange: (e) => send({
24
+ }, isRequired: state.context.enableRequiredLineInServiceOffering, error: state.context?.errorMessages['line']?.[0]
25
+ ? t(state.context?.errorMessages['line']?.[0])
26
+ : undefined })] }), (0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.input.feedback.title), isRequired: true, children: (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "feedback", description: t(PageText.Contact.input.feedback.description), value: state.context.feedback || '', onChange: (e) => send({
25
27
  type: 'ON_INPUT_CHANGE',
26
28
  inputName: 'feedback',
27
29
  value: e.target.value,
@@ -6,6 +6,6 @@ type StopFormProps = {
6
6
  };
7
7
  send: (event: typeof meansOfTransportFormEvents) => void;
8
8
  };
9
- export declare const StopForm: ({ state, send }: StopFormProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const StopForm: ({ state, send }: StopFormProps) => import("react").JSX.Element;
10
10
  export default StopForm;
11
11
  //# sourceMappingURL=stopForm.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stopForm.d.ts","sourceRoot":"","sources":["../../../src/means-of-transport/forms/stopForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAIlF,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAgBvD,KAAK,aAAa,GAAG;IACnB,KAAK,EAAE;QAAE,OAAO,EAAE,4BAA4B,CAAA;KAAE,CAAC;IACjD,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,0BAA0B,KAAK,IAAI,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,iBAAiB,aAAa,4CAkOtD,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"stopForm.d.ts","sourceRoot":"","sources":["../../../src/means-of-transport/forms/stopForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAIlF,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAgBvD,KAAK,aAAa,GAAG;IACnB,KAAK,EAAE;QAAE,OAAO,EAAE,4BAA4B,CAAA;KAAE,CAAC;IACjD,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,0BAA0B,KAAK,IAAI,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,iBAAiB,aAAa,gCAkOtD,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -6,6 +6,6 @@ type TransportationFormProps = {
6
6
  };
7
7
  send: (event: typeof meansOfTransportFormEvents) => void;
8
8
  };
9
- export declare const TransportationForm: ({ state, send, }: TransportationFormProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const TransportationForm: ({ state, send, }: TransportationFormProps) => import("react").JSX.Element;
10
10
  export default TransportationForm;
11
11
  //# sourceMappingURL=transportationForm.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transportationForm.d.ts","sourceRoot":"","sources":["../../../src/means-of-transport/forms/transportationForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAKlF,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAevD,KAAK,uBAAuB,GAAG;IAC7B,KAAK,EAAE;QAAE,OAAO,EAAE,4BAA4B,CAAA;KAAE,CAAC;IACjD,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,0BAA0B,KAAK,IAAI,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,kBAGhC,uBAAuB,4CAsRzB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"transportationForm.d.ts","sourceRoot":"","sources":["../../../src/means-of-transport/forms/transportationForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAKlF,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAevD,KAAK,uBAAuB,GAAG;IAC7B,KAAK,EAAE;QAAE,OAAO,EAAE,4BAA4B,CAAA;KAAE,CAAC;IACjD,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,0BAA0B,KAAK,IAAI,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,kBAGhC,uBAAuB,gCAsRzB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -1,3 +1,3 @@
1
- declare const MeansOfTransportContent: () => import("react/jsx-runtime").JSX.Element;
1
+ declare const MeansOfTransportContent: () => import("react").JSX.Element;
2
2
  export default MeansOfTransportContent;
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/means-of-transport/index.tsx"],"names":[],"mappings":"AAwBA,QAAA,MAAM,uBAAuB,+CAoG5B,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/means-of-transport/index.tsx"],"names":[],"mappings":"AAwBA,QAAA,MAAM,uBAAuB,mCA2G5B,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
@@ -20,7 +20,7 @@ const MeansOfTransportContent = () => {
20
20
  const PageText = (0, translations_1.usePageText)();
21
21
  const { t } = (0, translations_1.useTranslation)();
22
22
  const apiConfig = (0, config_1.useApiConfig)();
23
- const { formSchemaOverrides, layout } = (0, config_1.useContactFormConfig)();
23
+ const { formSchemaOverrides, layout, features } = (0, config_1.useContactFormConfig)();
24
24
  const successPath = layout?.successPath ??
25
25
  (layout?.basePath ? `${layout.basePath}/success` : '/contact/success');
26
26
  const errorPath = layout?.errorPath ??
@@ -28,7 +28,13 @@ const MeansOfTransportContent = () => {
28
28
  const machine = (0, react_2.useMemo)(() => (0, means_of_transport_form_machine_1.createMeansOfTransportFormMachine)(apiConfig.onSubmit, {
29
29
  successPath,
30
30
  errorPath,
31
- }), [apiConfig.onSubmit, successPath, errorPath]);
31
+ enableRequiredLineInServiceOffering: features?.enableRequiredLineInServiceOffering === true,
32
+ }), [
33
+ apiConfig.onSubmit,
34
+ successPath,
35
+ errorPath,
36
+ features?.enableRequiredLineInServiceOffering,
37
+ ]);
32
38
  const [state, send] = (0, react_1.useMachine)(machine);
33
39
  const displaySubmitButton = state.context.formType;
34
40
  // Filter form types based on overrides
@@ -1,7 +1,7 @@
1
1
  import { TransportModeType } from '../types';
2
2
  import { Line } from '../server/journey-planner/validators';
3
3
  import { InputErrorMessages } from '../validation';
4
- import type { FormSchemaName } from '../modules/config/types';
4
+ import type { FormSlug } from '../modules/config/types';
5
5
  export declare enum FormType {
6
6
  Driver = "driver",
7
7
  Transportation = "transportation",
@@ -43,6 +43,7 @@ export type MeansOfTransportContextProps = {
43
43
  lastName?: string;
44
44
  email?: string;
45
45
  isResponseWanted?: boolean;
46
+ enableRequiredLineInServiceOffering: boolean;
46
47
  errorMessages: InputErrorMessages;
47
48
  firstErrorMessage?: string;
48
49
  hasSubmissionError?: boolean;
@@ -50,8 +51,9 @@ export type MeansOfTransportContextProps = {
50
51
  export type MachinePaths = {
51
52
  successPath: string;
52
53
  errorPath: string;
54
+ enableRequiredLineInServiceOffering?: boolean;
53
55
  };
54
- export declare function createMeansOfTransportFormMachine(onSubmit: (schemaName: FormSchemaName, state: Record<string, unknown>) => Promise<Response>, paths?: MachinePaths): import("xstate").StateMachine<MeansOfTransportContextProps, {
56
+ export declare function createMeansOfTransportFormMachine(onSubmit: (slug: FormSlug, state: Record<string, unknown>) => Promise<Response>, paths?: MachinePaths): import("xstate").StateMachine<MeansOfTransportContextProps, {
55
57
  type: "VALIDATE";
56
58
  } | {
57
59
  type: "ON_INPUT_CHANGE";
@@ -1 +1 @@
1
- {"version":3,"file":"means-of-transport-form-machine.d.ts","sourceRoot":"","sources":["../../src/means-of-transport/means-of-transport-form-machine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EAAE,IAAI,EAAE,MAAM,sCAAsC,CAAC;AAC5D,OAAO,EAAwB,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAUzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,oBAAY,QAAQ;IAClB,MAAM,WAAW;IACjB,cAAc,mBAAmB;IACjC,KAAK,UAAU;IACf,IAAI,SAAS;IACb,eAAe,oBAAoB;IACnC,MAAM,WAAW;CAClB;AAED,KAAK,WAAW,GAAG;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,IAAI,EAAE,CAAC;IACrB,SAAS,CAAC,EAAE,MAA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CAAC,EAAE,YAAY;;;;;;;;;;;;;;;8BAzJpB,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmYd;AAED,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;8BArYtC,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4Yd,CAAC"}
1
+ {"version":3,"file":"means-of-transport-form-machine.d.ts","sourceRoot":"","sources":["../../src/means-of-transport/means-of-transport-form-machine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EAAE,IAAI,EAAE,MAAM,sCAAsC,CAAC;AAC5D,OAAO,EAAwB,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAUzE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,oBAAY,QAAQ;IAClB,MAAM,WAAW;IACjB,cAAc,mBAAmB;IACjC,KAAK,UAAU;IACf,IAAI,SAAS;IACb,eAAe,oBAAoB;IACnC,MAAM,WAAW;CAClB;AAED,KAAK,WAAW,GAAG;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAA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R,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC3B,OAAO,CAAC,QAAQ,CAAC,EACtB,KAAK,CAAC,EAAE,YAAY;;;;;;;;;;;;;;;8BAhKpB,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgZd;AAED,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;8BAlZtC,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyZd,CAAC"}
@@ -16,7 +16,7 @@ var FormType;
16
16
  FormType["Injury"] = "injury";
17
17
  })(FormType || (exports.FormType = FormType = {}));
18
18
  const setInputsToValidate = (context) => {
19
- const { formType, transportMode, line, fromStop, toStop, stop, date, plannedDepartureTime, feedback, firstName, lastName, email, isResponseWanted, } = context;
19
+ const { formType, transportMode, line, fromStop, toStop, stop, date, plannedDepartureTime, feedback, firstName, lastName, email, isResponseWanted, enableRequiredLineInServiceOffering, } = context;
20
20
  switch (formType) {
21
21
  case FormType.Driver:
22
22
  return {
@@ -69,6 +69,7 @@ const setInputsToValidate = (context) => {
69
69
  transportMode,
70
70
  feedback,
71
71
  isResponseWanted,
72
+ ...(enableRequiredLineInServiceOffering && { line }),
72
73
  ...(isResponseWanted && { firstName, lastName, email }),
73
74
  };
74
75
  case FormType.Injury:
@@ -88,6 +89,7 @@ const setInputsToValidate = (context) => {
88
89
  function createMeansOfTransportFormMachine(onSubmit, paths) {
89
90
  const successPath = paths?.successPath ?? '/contact/success';
90
91
  const errorPath = paths?.errorPath ?? '/contact/error';
92
+ const enableRequiredLineInServiceOffering = paths?.enableRequiredLineInServiceOffering === true;
91
93
  return (0, xstate_1.setup)({
92
94
  types: {
93
95
  context: {},
@@ -172,7 +174,7 @@ function createMeansOfTransportFormMachine(onSubmit, paths) {
172
174
  ...input,
173
175
  attachments: base64EncodedAttachments,
174
176
  };
175
- const response = await onSubmit('meansOfTransport', state);
177
+ const response = await onSubmit('means-of-transport', state);
176
178
  if (!response.ok)
177
179
  throw new Error('Failed to call API');
178
180
  return response.ok;
@@ -181,7 +183,11 @@ function createMeansOfTransportFormMachine(onSubmit, paths) {
181
183
  }).createMachine({
182
184
  /** @xstate-layout N4IgpgJg5mDOIC5QAoC2BDAxgCwJYDswBKAOlwgBswBiAZQFUAhAWQEkAVAbQAYBdRUAAcA9rFwAXXMPwCQAD0QBGAGzcSAZgCsATnXLlAJi2rN6gDQgAnkoDsmktxsAObstN7FN5eoC+Pi2hYeISk5FTU7ADyAOLRADIAojz8SCAiYpLSsgoIACyKJNpFxSUlFtYIRvZO6rUqBg3c3Fp+ARg4BMRklDTsAIIAGqzJsukSUjKpOSpqWrr6VSbmVojqueoaBk6K3AbOqjYGyq0ggR0hJJDj+FB0TGxcfKOi41lTiJqaBdyKmoaKTmcTkB2nKtnsjhcblqyk83hOZ2CXSukhudAS7AA+uwAEp9ABytAACpEcVjmJEACJJJ6pMaZSagHJ2NSKXKudnqGw7TSAsGVdTaEhOYpOTQ2ZqmZS5BHtJGkCjCdAQAi3CDSMBkfAAN2EAGtNYjOgqlSqbggCLrMOgGckRnSXgzsh8vg5fv9AcCQfztiRcsVnHpuO4bLKgsaSIrlarqGAAE5x4RxkiCCg2gBmSdQJCNFyjZqgFp1wmttr49qEjomzoQn2+7oMAKB3pWlQM9nF20cn20nj8-hA+GEEDgslzxGeGWr7wQAFplA4mkvl8ubPz52Hzl0wmBJ69GfIPkLcgZtMpudovmze6DW7UbH7FGzT9wnA12TKB+PSCjVXunTO2wPq47anmK3DaGKuT8msBS5M4EFit4Ng2OoBifm04Z5qaf4OlObxMqsmi5H6TjrGRhwoV4wb8r8BgOAh5FNCo56bvKJCwAArpgmBwPAeH7jWQEOIYmhgZoiHEbRzQkKY2jBl83C5GKnihv2QA */
183
185
  initial: 'editing',
184
- context: { isResponseWanted: undefined, errorMessages: {} },
186
+ context: {
187
+ isResponseWanted: undefined,
188
+ enableRequiredLineInServiceOffering,
189
+ errorMessages: {},
190
+ },
185
191
  on: {
186
192
  ON_INPUT_CHANGE: { actions: 'onInputChange' },
187
193
  SELECT_FORM_TYPE: { target: '#formTypeHandler' },
@@ -1,37 +1,13 @@
1
- import { PropsWithChildren } from 'react';
2
1
  import type { ContactFormConfig, Theme } from './types';
3
- export type ContactFormConfigProviderProps = PropsWithChildren<{
4
- config: ContactFormConfig;
5
- }>;
6
2
  /**
7
- * Provider component that supplies configuration to the entire contact form.
8
- * This should wrap your entire application or the part that uses the contact form.
9
- *
10
- * @example
11
- * ```tsx
12
- * import { ContactFormConfigProvider } from '@mrfylke/contact-form';
13
- * import { myTheme, myIcons } from './my-config';
14
- *
15
- * function App() {
16
- * return (
17
- * <ContactFormConfigProvider
18
- * config={{
19
- * theme: myTheme,
20
- * icons: myIcons,
21
- * api: { baseUrl: '/api', endpoints: { submitForm: '/contact' } },
22
- * org: { name: 'My Company', supportEmail: 'support@example.com' }
23
- * }}
24
- * >
25
- * <ContactForm />
26
- * </ContactFormConfigProvider>
27
- * );
28
- * }
29
- * ```
3
+ * Context for contact form configuration.
4
+ * This allows the entire form to access theme, icons, and other settings.
30
5
  */
31
- export declare function ContactFormConfigProvider({ config, children, }: ContactFormConfigProviderProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare const ContactFormConfigContext: import("react").Context<ContactFormConfig | null>;
7
+ export declare function mergeConfigThemeOverrides(config: ContactFormConfig): ContactFormConfig;
32
8
  /**
33
9
  * Hook to access the contact form configuration.
34
- * @throws Error if used outside of ContactFormConfigProvider
10
+ * @throws Error if used outside of ContactFormRoot
35
11
  */
36
12
  export declare function useContactFormConfig(): ContactFormConfig;
37
13
  /**
@@ -39,16 +15,15 @@ export declare function useContactFormConfig(): ContactFormConfig;
39
15
  * Returns both light and dark theme variants.
40
16
  */
41
17
  export declare function useThemeConfig(): Theme;
42
- /**
43
- * Hook to access the icon set from configuration.
44
- */
45
- export declare function useIconConfig(): import("./types").IconSet;
46
- /**
47
- * Hook to access the org configuration.
48
- */
49
- export declare function useOrgConfig(): import("./types").OrgConfig;
50
18
  /**
51
19
  * Hook to access the API configuration.
52
20
  */
53
- export declare function useApiConfig(): import("./types").ApiConfig;
21
+ export declare function useApiConfig(): {
22
+ onSubmit: (slug: import("./types").FormSlug, state: Record<string, unknown>) => Promise<Response>;
23
+ endpoints?: {
24
+ lines?: string;
25
+ departures?: string;
26
+ submit?: string;
27
+ };
28
+ };
54
29
  //# sourceMappingURL=context.d.ts.map