@alfadocs/ui-kit-debug 1.90.1 → 1.91.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (380) hide show
  1. package/dist/_chunks/address-autocomplete-DR4Xn23Z.js +519 -0
  2. package/dist/_chunks/address-autocomplete-DR4Xn23Z.js.map +1 -0
  3. package/dist/_chunks/{address-fields-CfnXK8RT.js → address-fields-qxQkGwPf.js} +5 -5
  4. package/dist/_chunks/{address-fields-CfnXK8RT.js.map → address-fields-qxQkGwPf.js.map} +1 -1
  5. package/dist/_chunks/{agenda-card-BDuvreCe.js → agenda-card-BhY342MA.js} +2 -2
  6. package/dist/_chunks/{agenda-card-BDuvreCe.js.map → agenda-card-BhY342MA.js.map} +1 -1
  7. package/dist/_chunks/{agenda-tray-D-jvptdo.js → agenda-tray-BmxBGEci.js} +2 -2
  8. package/dist/_chunks/{agenda-tray-D-jvptdo.js.map → agenda-tray-BmxBGEci.js.map} +1 -1
  9. package/dist/_chunks/{ai-permission-notice-CoW22jx1.js → ai-permission-notice-VNh3W57L.js} +2 -2
  10. package/dist/_chunks/{ai-permission-notice-CoW22jx1.js.map → ai-permission-notice-VNh3W57L.js.map} +1 -1
  11. package/dist/_chunks/{alia-sidebar-CsTRAxC8.js → alia-sidebar-ovRX_oti.js} +3 -3
  12. package/dist/_chunks/{alia-sidebar-CsTRAxC8.js.map → alia-sidebar-ovRX_oti.js.map} +1 -1
  13. package/dist/_chunks/{anamnesis-summary-rows-fbEQwcuW.js → anamnesis-summary-rows-EKPfVCmh.js} +2 -2
  14. package/dist/_chunks/{anamnesis-summary-rows-fbEQwcuW.js.map → anamnesis-summary-rows-EKPfVCmh.js.map} +1 -1
  15. package/dist/_chunks/{appointment-card-5JMWi9_f.js → appointment-card-Bstc1p7a.js} +2 -2
  16. package/dist/_chunks/{appointment-card-5JMWi9_f.js.map → appointment-card-Bstc1p7a.js.map} +1 -1
  17. package/dist/_chunks/{appointment-peek-39BwVMUf.js → appointment-peek-C0kKqnFk.js} +2 -2
  18. package/dist/_chunks/{appointment-peek-39BwVMUf.js.map → appointment-peek-C0kKqnFk.js.map} +1 -1
  19. package/dist/_chunks/{appointment-timeline-1-Za2miy.js → appointment-timeline-rbt9AwHO.js} +2 -2
  20. package/dist/_chunks/{appointment-timeline-1-Za2miy.js.map → appointment-timeline-rbt9AwHO.js.map} +1 -1
  21. package/dist/_chunks/{appointment-tray-Dwc8MSIQ.js → appointment-tray-6zd8RLIL.js} +2 -2
  22. package/dist/_chunks/{appointment-tray-Dwc8MSIQ.js.map → appointment-tray-6zd8RLIL.js.map} +1 -1
  23. package/dist/_chunks/autocomplete-BXMcNoa3.js +562 -0
  24. package/dist/_chunks/autocomplete-BXMcNoa3.js.map +1 -0
  25. package/dist/_chunks/{avatar-BPiPL7ND.js → avatar-a6042Ox2.js} +52 -52
  26. package/dist/_chunks/avatar-a6042Ox2.js.map +1 -0
  27. package/dist/_chunks/{balance-badge-cell-C4FYwmrZ.js → balance-badge-cell-BtJvre1-.js} +3 -3
  28. package/dist/_chunks/{balance-badge-cell-C4FYwmrZ.js.map → balance-badge-cell-BtJvre1-.js.map} +1 -1
  29. package/dist/_chunks/booking-opt_h7Uc.js +4590 -0
  30. package/dist/_chunks/booking-opt_h7Uc.js.map +1 -0
  31. package/dist/_chunks/{calendar-ClB-jWH1.js → calendar-CmiMS4FJ.js} +2 -2
  32. package/dist/_chunks/{calendar-ClB-jWH1.js.map → calendar-CmiMS4FJ.js.map} +1 -1
  33. package/dist/_chunks/{calendar-appointment-editor-dialog-C1v2MNE4.js → calendar-appointment-editor-dialog-sJKLoVJ2.js} +11 -11
  34. package/dist/_chunks/{calendar-appointment-editor-dialog-C1v2MNE4.js.map → calendar-appointment-editor-dialog-sJKLoVJ2.js.map} +1 -1
  35. package/dist/_chunks/{care-plan-card-BYCPNDvA.js → care-plan-card-DD9rEWYN.js} +2 -2
  36. package/dist/_chunks/{care-plan-card-BYCPNDvA.js.map → care-plan-card-DD9rEWYN.js.map} +1 -1
  37. package/dist/_chunks/{care-plan-header-BzsAg6oY.js → care-plan-header-CXUJQt8Q.js} +2 -2
  38. package/dist/_chunks/{care-plan-header-BzsAg6oY.js.map → care-plan-header-CXUJQt8Q.js.map} +1 -1
  39. package/dist/_chunks/{chat-message-CmFJdEre.js → chat-message-LRO_6Ee3.js} +2 -2
  40. package/dist/_chunks/{chat-message-CmFJdEre.js.map → chat-message-LRO_6Ee3.js.map} +1 -1
  41. package/dist/_chunks/{checkbox-BjDv-r3o.js → checkbox-a7Sh-dXb.js} +32 -31
  42. package/dist/_chunks/checkbox-a7Sh-dXb.js.map +1 -0
  43. package/dist/_chunks/{checkbox-group-Cw2H5qaq.js → checkbox-group-eGdv9fZc.js} +2 -2
  44. package/dist/_chunks/{checkbox-group-Cw2H5qaq.js.map → checkbox-group-eGdv9fZc.js.map} +1 -1
  45. package/dist/_chunks/{city-input-CJVGswxp.js → city-input-CA59CjnV.js} +2 -2
  46. package/dist/_chunks/{city-input-CJVGswxp.js.map → city-input-CA59CjnV.js.map} +1 -1
  47. package/dist/_chunks/{clinical-note-card-Caidqcwa.js → clinical-note-card-Cut2lNmu.js} +3 -3
  48. package/dist/_chunks/{clinical-note-card-Caidqcwa.js.map → clinical-note-card-Cut2lNmu.js.map} +1 -1
  49. package/dist/_chunks/{combobox-CDPm_n0p.js → combobox-D-gpgEDy.js} +314 -294
  50. package/dist/_chunks/combobox-D-gpgEDy.js.map +1 -0
  51. package/dist/_chunks/{contact-card-Czu60UvU.js → contact-card-ClvEDM9e.js} +2 -2
  52. package/dist/_chunks/{contact-card-Czu60UvU.js.map → contact-card-ClvEDM9e.js.map} +1 -1
  53. package/dist/_chunks/{contact-profile-card-Da1vmJQI.js → contact-profile-card-CX45mZA3.js} +106 -95
  54. package/dist/_chunks/contact-profile-card-CX45mZA3.js.map +1 -0
  55. package/dist/_chunks/{country-select-DQ8q7ypA.js → country-select-BfmX9y5i.js} +2 -2
  56. package/dist/_chunks/{country-select-DQ8q7ypA.js.map → country-select-BfmX9y5i.js.map} +1 -1
  57. package/dist/_chunks/{data-table-B_IcS0Ke.js → data-table-CqQgoNsU.js} +2 -2
  58. package/dist/_chunks/{data-table-B_IcS0Ke.js.map → data-table-CqQgoNsU.js.map} +1 -1
  59. package/dist/_chunks/{dependent-selector-C4kOgO8b.js → dependent-selector-CyNi7M_f.js} +2 -2
  60. package/dist/_chunks/{dependent-selector-C4kOgO8b.js.map → dependent-selector-CyNi7M_f.js.map} +1 -1
  61. package/dist/_chunks/{entity-summary-BLxzSSXK.js → entity-summary-B_bOloqP.js} +3 -3
  62. package/dist/_chunks/{entity-summary-BLxzSSXK.js.map → entity-summary-B_bOloqP.js.map} +1 -1
  63. package/dist/_chunks/error-page-B0fGNTRB.js +419 -0
  64. package/dist/_chunks/error-page-B0fGNTRB.js.map +1 -0
  65. package/dist/_chunks/{face-scheme-BgJGFDTa.js → face-scheme-BKSE98bo.js} +2 -2
  66. package/dist/_chunks/{face-scheme-BgJGFDTa.js.map → face-scheme-BKSE98bo.js.map} +1 -1
  67. package/dist/_chunks/{file-manager-C9YOT-Dn.js → file-manager-BnI1ZWZu.js} +2 -2
  68. package/dist/_chunks/{file-manager-C9YOT-Dn.js.map → file-manager-BnI1ZWZu.js.map} +1 -1
  69. package/dist/_chunks/{header-settings-BVhjndtV.js → header-settings-BeA2fnol.js} +24 -23
  70. package/dist/_chunks/header-settings-BeA2fnol.js.map +1 -0
  71. package/dist/_chunks/{heatmap-HTz3Jvzy.js → heatmap-fCxwNz2o.js} +2 -2
  72. package/dist/_chunks/{heatmap-HTz3Jvzy.js.map → heatmap-fCxwNz2o.js.map} +1 -1
  73. package/dist/_chunks/{languages-CZqBaPwI.js → languages-CGLX6Qpe.js} +3 -15
  74. package/dist/_chunks/languages-CGLX6Qpe.js.map +1 -0
  75. package/dist/_chunks/link-DtCfnLnF.js +332 -0
  76. package/dist/_chunks/link-DtCfnLnF.js.map +1 -0
  77. package/dist/_chunks/{link-cell-renderer-C0ynDik7.js → link-cell-renderer-BS3V4LA6.js} +4 -4
  78. package/dist/_chunks/{link-cell-renderer-C0ynDik7.js.map → link-cell-renderer-BS3V4LA6.js.map} +1 -1
  79. package/dist/_chunks/{login-dev-card-DYwbL5sD.js → login-dev-card-BZBR58mu.js} +2 -2
  80. package/dist/_chunks/{login-dev-card-DYwbL5sD.js.map → login-dev-card-BZBR58mu.js.map} +1 -1
  81. package/dist/_chunks/{map-view-Bvi06RVh.js → map-view-UrNgxBy3.js} +260 -237
  82. package/dist/_chunks/map-view-UrNgxBy3.js.map +1 -0
  83. package/dist/_chunks/{index.modern-BeRXQVdc.js → maps-core-gate-DkNqGkm3.js} +360 -319
  84. package/dist/_chunks/maps-core-gate-DkNqGkm3.js.map +1 -0
  85. package/dist/_chunks/{marketplace-app-shell-x_abo_ye.js → marketplace-app-shell-CJQtx3sv.js} +3 -3
  86. package/dist/_chunks/{marketplace-app-shell-x_abo_ye.js.map → marketplace-app-shell-CJQtx3sv.js.map} +1 -1
  87. package/dist/_chunks/{message-card-CvCnCssc.js → message-card-B6SduXJv.js} +2 -2
  88. package/dist/_chunks/{message-card-CvCnCssc.js.map → message-card-B6SduXJv.js.map} +1 -1
  89. package/dist/_chunks/{message-tray-IJYvy6Cf.js → message-tray-Cllf-v0G.js} +2 -2
  90. package/dist/_chunks/{message-tray-IJYvy6Cf.js.map → message-tray-Cllf-v0G.js.map} +1 -1
  91. package/dist/_chunks/{nav-grid-Oc4aCPrg.js → nav-grid-D2xVcHTO.js} +2 -2
  92. package/dist/_chunks/{nav-grid-Oc4aCPrg.js.map → nav-grid-D2xVcHTO.js.map} +1 -1
  93. package/dist/_chunks/{note-attachment-DIlIQ7JF.js → note-attachment-cnj2JRrg.js} +2 -2
  94. package/dist/_chunks/{note-attachment-DIlIQ7JF.js.map → note-attachment-cnj2JRrg.js.map} +1 -1
  95. package/dist/_chunks/{note-timeline-KzL52MmB.js → note-timeline-BrjHBQfx.js} +2 -2
  96. package/dist/_chunks/{note-timeline-KzL52MmB.js.map → note-timeline-BrjHBQfx.js.map} +1 -1
  97. package/dist/_chunks/{notes-panel-CZO1qsD-.js → notes-panel-ib7I3aNf.js} +3 -3
  98. package/dist/_chunks/{notes-panel-CZO1qsD-.js.map → notes-panel-ib7I3aNf.js.map} +1 -1
  99. package/dist/_chunks/{operator-hero-6aAIQaFZ.js → operator-hero-C_5B-8Qp.js} +43 -41
  100. package/dist/_chunks/operator-hero-C_5B-8Qp.js.map +1 -0
  101. package/dist/_chunks/{patient-details-D0P5eog5.js → patient-details-BjcUpD9S.js} +3 -3
  102. package/dist/_chunks/{patient-details-D0P5eog5.js.map → patient-details-BjcUpD9S.js.map} +1 -1
  103. package/dist/_chunks/{patient-field-row-R73dZJY6.js → patient-field-row-B0tdiaWi.js} +6 -6
  104. package/dist/_chunks/{patient-field-row-R73dZJY6.js.map → patient-field-row-B0tdiaWi.js.map} +1 -1
  105. package/dist/_chunks/patient-search-Ca9j5cWb.js +1306 -0
  106. package/dist/_chunks/patient-search-Ca9j5cWb.js.map +1 -0
  107. package/dist/_chunks/{patient-summary-card-6U74-ivO.js → patient-summary-card-Cvv6_Ugk.js} +4 -4
  108. package/dist/_chunks/{patient-summary-card-6U74-ivO.js.map → patient-summary-card-Cvv6_Ugk.js.map} +1 -1
  109. package/dist/_chunks/{payment-request-card-MndSlVoK.js → payment-request-card-BfGauFY0.js} +2 -2
  110. package/dist/_chunks/{payment-request-card-MndSlVoK.js.map → payment-request-card-BfGauFY0.js.map} +1 -1
  111. package/dist/_chunks/{periodontal-diagnosis-B9YmmVmM.js → periodontal-diagnosis-DD3hrg9X.js} +2 -2
  112. package/dist/_chunks/{periodontal-diagnosis-B9YmmVmM.js.map → periodontal-diagnosis-DD3hrg9X.js.map} +1 -1
  113. package/dist/_chunks/{permission-matrix-BoQjENGV.js → permission-matrix-BJ6sg3Zp.js} +3 -3
  114. package/dist/_chunks/{permission-matrix-BoQjENGV.js.map → permission-matrix-BJ6sg3Zp.js.map} +1 -1
  115. package/dist/_chunks/{practice-profile-hero-qfrsFQI_.js → practice-profile-hero-ClzE-4CB.js} +76 -73
  116. package/dist/_chunks/practice-profile-hero-ClzE-4CB.js.map +1 -0
  117. package/dist/_chunks/{practice-results-B61krlwu.js → practice-results-CQ_KvEXK.js} +517 -514
  118. package/dist/_chunks/practice-results-CQ_KvEXK.js.map +1 -0
  119. package/dist/_chunks/{product-hub-panel-Blag8t8f.js → product-hub-panel-bHi7lkVD.js} +2 -2
  120. package/dist/_chunks/{product-hub-panel-Blag8t8f.js.map → product-hub-panel-bHi7lkVD.js.map} +1 -1
  121. package/dist/_chunks/{province-select-CPdTwEob.js → province-select-D64whw0m.js} +2 -2
  122. package/dist/_chunks/{province-select-CPdTwEob.js.map → province-select-D64whw0m.js.map} +1 -1
  123. package/dist/_chunks/public-footer-IoRWoAMz.js +596 -0
  124. package/dist/_chunks/public-footer-IoRWoAMz.js.map +1 -0
  125. package/dist/_chunks/{registration-form-DmP3YUfp.js → registration-form-CRm6DaB9.js} +2 -2
  126. package/dist/_chunks/{registration-form-DmP3YUfp.js.map → registration-form-CRm6DaB9.js.map} +1 -1
  127. package/dist/_chunks/{reviews-panel-UzQQLb-z.js → reviews-panel-B7InBORU.js} +42 -41
  128. package/dist/_chunks/reviews-panel-B7InBORU.js.map +1 -0
  129. package/dist/_chunks/{rich-text-editor-BZTyxQBd.js → rich-text-editor-BfEu57dk.js} +3 -3
  130. package/dist/_chunks/{rich-text-editor-BZTyxQBd.js.map → rich-text-editor-BfEu57dk.js.map} +1 -1
  131. package/dist/_chunks/{signature-request-DjY-X62H.js → signature-request-DvhyrRpn.js} +3 -3
  132. package/dist/_chunks/{signature-request-DjY-X62H.js.map → signature-request-DvhyrRpn.js.map} +1 -1
  133. package/dist/_chunks/{signed-out-frame-G-3ATOdu.js → signed-out-frame-CgRXOUzi.js} +2 -2
  134. package/dist/_chunks/{signed-out-frame-G-3ATOdu.js.map → signed-out-frame-CgRXOUzi.js.map} +1 -1
  135. package/dist/_chunks/{slot-grid-Bb13H9Rl.js → slot-grid-B-IAFX3C.js} +183 -170
  136. package/dist/_chunks/slot-grid-B-IAFX3C.js.map +1 -0
  137. package/dist/_chunks/{task-editor-BOETWbjU.js → task-editor-CI1SKUNc.js} +2 -2
  138. package/dist/_chunks/{task-editor-BOETWbjU.js.map → task-editor-CI1SKUNc.js.map} +1 -1
  139. package/dist/_chunks/{timeline-wUuTDFY_.js → timeline-BcYHdP56.js} +2 -2
  140. package/dist/_chunks/{timeline-wUuTDFY_.js.map → timeline-BcYHdP56.js.map} +1 -1
  141. package/dist/_chunks/{use-appointment-details-read-CWN-nJCZ.js → use-appointment-details-read-D8vDg0sg.js} +5 -5
  142. package/dist/_chunks/{use-appointment-details-read-CWN-nJCZ.js.map → use-appointment-details-read-D8vDg0sg.js.map} +1 -1
  143. package/dist/_chunks/{voice-control-panel-BziKE-KK.js → voice-control-panel-BP0otrID.js} +2 -2
  144. package/dist/_chunks/{voice-control-panel-BziKE-KK.js.map → voice-control-panel-BP0otrID.js.map} +1 -1
  145. package/dist/_chunks/{workflow-webhook-action-DulCpCRz.js → workflow-webhook-action-B_nBJ_ht.js} +2 -2
  146. package/dist/_chunks/{workflow-webhook-action-DulCpCRz.js.map → workflow-webhook-action-B_nBJ_ht.js.map} +1 -1
  147. package/dist/agent-catalog.json +3 -3
  148. package/dist/agent-i18n/en.json +1 -1
  149. package/dist/components/_shared/maps-core-gate.d.ts +18 -0
  150. package/dist/components/_shared/maps-core-gate.d.ts.map +1 -0
  151. package/dist/components/_shared/social-brand-icons.d.ts +29 -0
  152. package/dist/components/_shared/social-brand-icons.d.ts.map +1 -0
  153. package/dist/components/address-autocomplete/address-autocomplete.d.ts.map +1 -1
  154. package/dist/components/address-autocomplete/index.js +1 -1
  155. package/dist/components/address-fields/index.js +1 -1
  156. package/dist/components/agenda-card/index.js +1 -1
  157. package/dist/components/agenda-tray/index.js +1 -1
  158. package/dist/components/ai-permission-notice/index.js +1 -1
  159. package/dist/components/appointment-card/index.js +2 -2
  160. package/dist/components/appointment-details-panel/index.js +1 -1
  161. package/dist/components/appointment-peek/index.js +1 -1
  162. package/dist/components/appointment-timeline/index.js +1 -1
  163. package/dist/components/autocomplete/autocomplete.agent.d.ts.map +1 -1
  164. package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
  165. package/dist/components/autocomplete/index.js +1 -1
  166. package/dist/components/avatar/avatar.d.ts +14 -0
  167. package/dist/components/avatar/avatar.d.ts.map +1 -1
  168. package/dist/components/avatar/index.js +1 -1
  169. package/dist/components/booking/booking-types.d.ts +26 -0
  170. package/dist/components/booking/booking-types.d.ts.map +1 -1
  171. package/dist/components/booking/booking.d.ts.map +1 -1
  172. package/dist/components/booking/details-form.d.ts.map +1 -1
  173. package/dist/components/booking/index.js +1 -1
  174. package/dist/components/booking/slot-load-state.d.ts +11 -0
  175. package/dist/components/booking/slot-load-state.d.ts.map +1 -0
  176. package/dist/components/calendar/index.js +1 -1
  177. package/dist/components/care-plan-card/index.js +1 -1
  178. package/dist/components/care-plan-header/index.js +1 -1
  179. package/dist/components/chat-message/index.js +1 -1
  180. package/dist/components/checkbox/checkbox.d.ts.map +1 -1
  181. package/dist/components/checkbox/index.js +1 -1
  182. package/dist/components/checkbox-group/index.js +1 -1
  183. package/dist/components/city-input/index.js +1 -1
  184. package/dist/components/clinical-note-card/index.js +1 -1
  185. package/dist/components/combobox/combobox.d.ts.map +1 -1
  186. package/dist/components/combobox/index.js +1 -1
  187. package/dist/components/contact-card/index.js +1 -1
  188. package/dist/components/contact-profile-card/index.js +1 -1
  189. package/dist/components/country-select/index.js +1 -1
  190. package/dist/components/data-table/index.js +2 -2
  191. package/dist/components/dependent-selector/index.js +1 -1
  192. package/dist/components/entity-summary/index.js +1 -1
  193. package/dist/components/face-scheme/index.js +1 -1
  194. package/dist/components/file-manager/index.js +1 -1
  195. package/dist/components/header-settings/header-settings.d.ts +2 -1
  196. package/dist/components/header-settings/header-settings.d.ts.map +1 -1
  197. package/dist/components/header-settings/index.js +1 -1
  198. package/dist/components/heatmap/index.js +1 -1
  199. package/dist/components/link/index.js +1 -1
  200. package/dist/components/link/link.d.ts +10 -1
  201. package/dist/components/link/link.d.ts.map +1 -1
  202. package/dist/components/link/social-url.d.ts +71 -0
  203. package/dist/components/link/social-url.d.ts.map +1 -0
  204. package/dist/components/map-view/index.js +1 -1
  205. package/dist/components/map-view/map-view.d.ts.map +1 -1
  206. package/dist/components/message-card/index.js +1 -1
  207. package/dist/components/message-tray/index.js +1 -1
  208. package/dist/components/nav-grid/index.js +1 -1
  209. package/dist/components/note-timeline/index.js +1 -1
  210. package/dist/components/notes-panel/index.js +1 -1
  211. package/dist/components/operator-hero/index.js +1 -1
  212. package/dist/components/operator-hero/operator-hero.d.ts +6 -0
  213. package/dist/components/operator-hero/operator-hero.d.ts.map +1 -1
  214. package/dist/components/patient-details/index.js +1 -1
  215. package/dist/components/patient-search/index.js +1 -1
  216. package/dist/components/patient-search/patient-search.d.ts.map +1 -1
  217. package/dist/components/patient-summary-card/index.js +1 -1
  218. package/dist/components/patient-table/index.js +1 -1
  219. package/dist/components/payment-card/index.js +1 -1
  220. package/dist/components/periodontal-diagnosis/index.js +1 -1
  221. package/dist/components/permission-matrix/index.js +1 -1
  222. package/dist/components/practice-profile-hero/index.js +1 -1
  223. package/dist/components/practice-profile-hero/practice-profile-hero.d.ts +6 -0
  224. package/dist/components/practice-profile-hero/practice-profile-hero.d.ts.map +1 -1
  225. package/dist/components/practice-results/index.js +1 -1
  226. package/dist/components/practice-results/practice-results.d.ts +8 -2
  227. package/dist/components/practice-results/practice-results.d.ts.map +1 -1
  228. package/dist/components/product-hub-tray/index.js +1 -1
  229. package/dist/components/province-select/index.js +1 -1
  230. package/dist/components/public-footer/index.js +1 -1
  231. package/dist/components/public-footer/public-footer.d.ts +13 -1
  232. package/dist/components/public-footer/public-footer.d.ts.map +1 -1
  233. package/dist/components/public-footer/socials.d.ts +6 -5
  234. package/dist/components/public-footer/socials.d.ts.map +1 -1
  235. package/dist/components/reviews-panel/index.js +1 -1
  236. package/dist/components/reviews-panel/reviews-panel.d.ts.map +1 -1
  237. package/dist/components/rich-text-editor/index.js +1 -1
  238. package/dist/components/slot-grid/index.js +1 -1
  239. package/dist/components/slot-grid/slot-grid.d.ts +2 -0
  240. package/dist/components/slot-grid/slot-grid.d.ts.map +1 -1
  241. package/dist/components/task-editor/index.js +1 -1
  242. package/dist/components/timeline/index.js +1 -1
  243. package/dist/components/voice-control-panel/index.js +1 -1
  244. package/dist/host-compat.css +1 -10
  245. package/dist/i18n/config.d.ts.map +1 -1
  246. package/dist/i18n/config.js +224 -96
  247. package/dist/i18n/config.js.map +1 -1
  248. package/dist/i18n/locales/ar.d.ts +3 -0
  249. package/dist/i18n/locales/ar.d.ts.map +1 -1
  250. package/dist/i18n/locales/ar.js +4 -1
  251. package/dist/i18n/locales/ar.js.map +1 -1
  252. package/dist/i18n/locales/de.d.ts +3 -0
  253. package/dist/i18n/locales/de.d.ts.map +1 -1
  254. package/dist/i18n/locales/de.js +4 -1
  255. package/dist/i18n/locales/de.js.map +1 -1
  256. package/dist/i18n/locales/el.d.ts +3 -0
  257. package/dist/i18n/locales/el.d.ts.map +1 -1
  258. package/dist/i18n/locales/el.js +4 -1
  259. package/dist/i18n/locales/el.js.map +1 -1
  260. package/dist/i18n/locales/en.d.ts +3 -0
  261. package/dist/i18n/locales/en.d.ts.map +1 -1
  262. package/dist/i18n/locales/en.js +3 -0
  263. package/dist/i18n/locales/en.js.map +1 -1
  264. package/dist/i18n/locales/es.d.ts +3 -0
  265. package/dist/i18n/locales/es.d.ts.map +1 -1
  266. package/dist/i18n/locales/es.js +4 -1
  267. package/dist/i18n/locales/es.js.map +1 -1
  268. package/dist/i18n/locales/fr.d.ts +3 -0
  269. package/dist/i18n/locales/fr.d.ts.map +1 -1
  270. package/dist/i18n/locales/fr.js +4 -1
  271. package/dist/i18n/locales/fr.js.map +1 -1
  272. package/dist/i18n/locales/hi.d.ts +3 -0
  273. package/dist/i18n/locales/hi.d.ts.map +1 -1
  274. package/dist/i18n/locales/hi.js +4 -1
  275. package/dist/i18n/locales/hi.js.map +1 -1
  276. package/dist/i18n/locales/it.d.ts +3 -0
  277. package/dist/i18n/locales/it.d.ts.map +1 -1
  278. package/dist/i18n/locales/it.js +4 -1
  279. package/dist/i18n/locales/it.js.map +1 -1
  280. package/dist/i18n/locales/ja.d.ts +3 -0
  281. package/dist/i18n/locales/ja.d.ts.map +1 -1
  282. package/dist/i18n/locales/ja.js +4 -1
  283. package/dist/i18n/locales/ja.js.map +1 -1
  284. package/dist/i18n/locales/nl.d.ts +3 -0
  285. package/dist/i18n/locales/nl.d.ts.map +1 -1
  286. package/dist/i18n/locales/nl.js +4 -1
  287. package/dist/i18n/locales/nl.js.map +1 -1
  288. package/dist/i18n/locales/pl.d.ts +3 -0
  289. package/dist/i18n/locales/pl.d.ts.map +1 -1
  290. package/dist/i18n/locales/pl.js +4 -1
  291. package/dist/i18n/locales/pl.js.map +1 -1
  292. package/dist/i18n/locales/pt.d.ts +3 -0
  293. package/dist/i18n/locales/pt.d.ts.map +1 -1
  294. package/dist/i18n/locales/pt.js +4 -1
  295. package/dist/i18n/locales/pt.js.map +1 -1
  296. package/dist/i18n/locales/ro.d.ts +3 -0
  297. package/dist/i18n/locales/ro.d.ts.map +1 -1
  298. package/dist/i18n/locales/ro.js +4 -1
  299. package/dist/i18n/locales/ro.js.map +1 -1
  300. package/dist/i18n/locales/ru.d.ts +3 -0
  301. package/dist/i18n/locales/ru.d.ts.map +1 -1
  302. package/dist/i18n/locales/ru.js +4 -1
  303. package/dist/i18n/locales/ru.js.map +1 -1
  304. package/dist/i18n/locales/sq.d.ts +3 -0
  305. package/dist/i18n/locales/sq.d.ts.map +1 -1
  306. package/dist/i18n/locales/sq.js +4 -1
  307. package/dist/i18n/locales/sq.js.map +1 -1
  308. package/dist/i18n/locales/sv.d.ts +3 -0
  309. package/dist/i18n/locales/sv.d.ts.map +1 -1
  310. package/dist/i18n/locales/sv.js +4 -1
  311. package/dist/i18n/locales/sv.js.map +1 -1
  312. package/dist/i18n/locales/tr.d.ts +3 -0
  313. package/dist/i18n/locales/tr.d.ts.map +1 -1
  314. package/dist/i18n/locales/tr.js +4 -1
  315. package/dist/i18n/locales/tr.js.map +1 -1
  316. package/dist/i18n/locales/zh.d.ts +3 -0
  317. package/dist/i18n/locales/zh.d.ts.map +1 -1
  318. package/dist/i18n/locales/zh.js +4 -1
  319. package/dist/i18n/locales/zh.js.map +1 -1
  320. package/dist/index.js +68 -68
  321. package/dist/locales/ar.json +4 -1
  322. package/dist/locales/de.json +4 -1
  323. package/dist/locales/el.json +4 -1
  324. package/dist/locales/en.json +3 -0
  325. package/dist/locales/es.json +4 -1
  326. package/dist/locales/fr.json +4 -1
  327. package/dist/locales/hi.json +4 -1
  328. package/dist/locales/it.json +4 -1
  329. package/dist/locales/ja.json +4 -1
  330. package/dist/locales/nl.json +4 -1
  331. package/dist/locales/pl.json +4 -1
  332. package/dist/locales/pt.json +4 -1
  333. package/dist/locales/ro.json +4 -1
  334. package/dist/locales/ru.json +4 -1
  335. package/dist/locales/sq.json +4 -1
  336. package/dist/locales/sv.json +4 -1
  337. package/dist/locales/tr.json +4 -1
  338. package/dist/locales/zh.json +4 -1
  339. package/dist/patterns/alia-assistant/index.js +1 -1
  340. package/dist/patterns/anamnesis/index.js +1 -1
  341. package/dist/patterns/calendar/index.js +1 -1
  342. package/dist/patterns/error-page/error-page-english.d.ts +71 -0
  343. package/dist/patterns/error-page/error-page-english.d.ts.map +1 -0
  344. package/dist/patterns/error-page/error-page.d.ts.map +1 -1
  345. package/dist/patterns/error-page/index.js +1 -1
  346. package/dist/patterns/login-form/index.js +1 -1
  347. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  348. package/dist/patterns/registration-form/index.js +1 -1
  349. package/dist/patterns/signature-request/index.js +1 -1
  350. package/dist/patterns/signed-out-frame/index.js +1 -1
  351. package/dist/patterns/workflow-webhook-action/index.js +1 -1
  352. package/dist/tokens.css +1 -1
  353. package/package.json +1 -1
  354. package/dist/_chunks/address-autocomplete-bPR2mNBt.js +0 -498
  355. package/dist/_chunks/address-autocomplete-bPR2mNBt.js.map +0 -1
  356. package/dist/_chunks/autocomplete-CnB1mHGc.js +0 -539
  357. package/dist/_chunks/autocomplete-CnB1mHGc.js.map +0 -1
  358. package/dist/_chunks/avatar-BPiPL7ND.js.map +0 -1
  359. package/dist/_chunks/booking-C0FoW8Yx.js +0 -4336
  360. package/dist/_chunks/booking-C0FoW8Yx.js.map +0 -1
  361. package/dist/_chunks/checkbox-BjDv-r3o.js.map +0 -1
  362. package/dist/_chunks/combobox-CDPm_n0p.js.map +0 -1
  363. package/dist/_chunks/contact-profile-card-Da1vmJQI.js.map +0 -1
  364. package/dist/_chunks/error-page-Bhai-spN.js +0 -344
  365. package/dist/_chunks/error-page-Bhai-spN.js.map +0 -1
  366. package/dist/_chunks/header-settings-BVhjndtV.js.map +0 -1
  367. package/dist/_chunks/index.modern-BeRXQVdc.js.map +0 -1
  368. package/dist/_chunks/languages-CZqBaPwI.js.map +0 -1
  369. package/dist/_chunks/link-N5_YpLtm.js +0 -138
  370. package/dist/_chunks/link-N5_YpLtm.js.map +0 -1
  371. package/dist/_chunks/map-view-Bvi06RVh.js.map +0 -1
  372. package/dist/_chunks/operator-hero-6aAIQaFZ.js.map +0 -1
  373. package/dist/_chunks/patient-search-CCOUZABE.js +0 -1196
  374. package/dist/_chunks/patient-search-CCOUZABE.js.map +0 -1
  375. package/dist/_chunks/practice-profile-hero-qfrsFQI_.js.map +0 -1
  376. package/dist/_chunks/practice-results-B61krlwu.js.map +0 -1
  377. package/dist/_chunks/public-footer-CXOrdAaS.js +0 -568
  378. package/dist/_chunks/public-footer-CXOrdAaS.js.map +0 -1
  379. package/dist/_chunks/reviews-panel-UzQQLb-z.js.map +0 -1
  380. package/dist/_chunks/slot-grid-Bb13H9Rl.js.map +0 -1
@@ -0,0 +1,4590 @@
1
+ import { jsx as n, jsxs as y, Fragment as me } from "react/jsx-runtime";
2
+ import { forwardRef as Vn, useId as pt, useRef as A, useLayoutEffect as _t, useCallback as Me, useState as J, useEffect as V, useMemo as K, Fragment as gr, useImperativeHandle as hr } from "react";
3
+ import { c as Lt } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as Q, Trans as $n } from "react-i18next";
5
+ import { u as vr } from "./registry-DvAUVLHh.js";
6
+ import { A as re } from "./alert-9kEwDza3.js";
7
+ import { B as Re } from "./button-DohK_Ak_.js";
8
+ import { C as wt } from "./checkbox-a7Sh-dXb.js";
9
+ import { C as br } from "./checkbox-group-eGdv9fZc.js";
10
+ import { R as yr } from "./radio-BZQs6_36.js";
11
+ import { R as kr } from "./radio-group-ChIKyeSJ.js";
12
+ import { D as Sr } from "./date-picker-CdhXlgVI.js";
13
+ import { E as xr } from "./email-input-C7THAwh2.js";
14
+ import { F as Je } from "./form-field-CyHfOVKF.js";
15
+ import { P as Ir } from "./phone-input-DJ4BN8tG.js";
16
+ import { T as Nr } from "./text-area-COMVJ1yE.js";
17
+ import { T as Yt } from "./text-input-CaG9ApoE.js";
18
+ import { A as wr } from "./address-fields-qxQkGwPf.js";
19
+ import { S as qn } from "./spinner-CoflYlEx.js";
20
+ import { a as on } from "./format-price-BcFBa-WP.js";
21
+ import { C as Cr } from "./credit-card-D9XZsHGA.js";
22
+ import { C as Tr } from "./card-BA4Ig_kn.js";
23
+ import { O as Ar } from "./otp-input-gV1446Dw.js";
24
+ import { i as Mr } from "./safe-href-5dbsfbQn.js";
25
+ import { B as zn } from "./badge-BUk4RjTS.js";
26
+ import { I as Mn } from "./icon-button-S8_weU3g.js";
27
+ import { S as an } from "./select-4S-eYZUf.js";
28
+ import { C as bn } from "./combobox-D-gpgEDy.js";
29
+ import { M as yn } from "./multi-select-i5MFRpXg.js";
30
+ import { c as Rr } from "./option-row-Dc7BrbK8.js";
31
+ import { S as rn } from "./skeleton-tTWJpvAq.js";
32
+ import { E as kn } from "./empty-state-DwJ5YNzz.js";
33
+ import { S as Or } from "./stepper-accordion-DDTSOUHc.js";
34
+ import { S as Dr } from "./stepper-progress-D6H8wQiV.js";
35
+ import { S as Er } from "./slot-grid-B-IAFX3C.js";
36
+ import { p as fe } from "./parseISO-DZZ5a-zK.js";
37
+ import { C as Fr } from "./chevron-down-DWE7GSq9.js";
38
+ import { s as rt, f as nn, d as Rn } from "./format--x5jypvH.js";
39
+ import { x as Kn, i as On, a as ut, b as un, s as Ft, m as _r, y as Zt } from "./date-picker-variants-Dt6UbonG.js";
40
+ import { s as Br } from "./subDays-DKISP2nE.js";
41
+ import { c as _e } from "./createLucideIcon-DhHxpK9K.js";
42
+ import { M as Lr, S as Pr } from "./sun-Bj9Mr553.js";
43
+ import { S as Vr } from "./stethoscope-sZXGC43m.js";
44
+ import { C as $r } from "./chevron-left-B8cOyH-V.js";
45
+ import { C as qr } from "./chevron-right-I9AeSxH2.js";
46
+ import { H as zr } from "./heart-pulse-BCppJyN2.js";
47
+ import { E as Kr } from "./eye-BjhN2nYf.js";
48
+ import { B as jr } from "./baby-Dku-Xvg9.js";
49
+ import { S as Ur } from "./scan-line-CNseIHQ0.js";
50
+ import { A as Hr } from "./astroid-BN4f5VXU.js";
51
+ import { C as Gr } from "./clipboard-check-BeAGxDVT.js";
52
+ /**
53
+ * @license lucide-react v1.22.0 - ISC
54
+ *
55
+ * This source code is licensed under the ISC license.
56
+ * See the LICENSE file in the root directory of this source tree.
57
+ */
58
+ const Jr = [
59
+ [
60
+ "path",
61
+ {
62
+ d: "M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",
63
+ key: "169zse"
64
+ }
65
+ ]
66
+ ], Wr = _e("activity", Jr);
67
+ /**
68
+ * @license lucide-react v1.22.0 - ISC
69
+ *
70
+ * This source code is licensed under the ISC license.
71
+ * See the LICENSE file in the root directory of this source tree.
72
+ */
73
+ const Yr = [
74
+ [
75
+ "path",
76
+ {
77
+ d: "M17 10c.7-.7 1.69 0 2.5 0a2.5 2.5 0 1 0 0-5 .5.5 0 0 1-.5-.5 2.5 2.5 0 1 0-5 0c0 .81.7 1.8 0 2.5l-7 7c-.7.7-1.69 0-2.5 0a2.5 2.5 0 0 0 0 5c.28 0 .5.22.5.5a2.5 2.5 0 1 0 5 0c0-.81-.7-1.8 0-2.5Z",
78
+ key: "w610uw"
79
+ }
80
+ ]
81
+ ], Zr = _e("bone", Yr);
82
+ /**
83
+ * @license lucide-react v1.22.0 - ISC
84
+ *
85
+ * This source code is licensed under the ISC license.
86
+ * See the LICENSE file in the root directory of this source tree.
87
+ */
88
+ const Xr = [
89
+ ["path", { d: "M12 18V5", key: "adv99a" }],
90
+ ["path", { d: "M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4", key: "1e3is1" }],
91
+ ["path", { d: "M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5", key: "1gqd8o" }],
92
+ ["path", { d: "M17.997 5.125a4 4 0 0 1 2.526 5.77", key: "iwvgf7" }],
93
+ ["path", { d: "M18 18a4 4 0 0 0 2-7.464", key: "efp6ie" }],
94
+ ["path", { d: "M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517", key: "1gq6am" }],
95
+ ["path", { d: "M6 18a4 4 0 0 1-2-7.464", key: "k1g0md" }],
96
+ ["path", { d: "M6.003 5.125a4 4 0 0 0-2.526 5.77", key: "q97ue3" }]
97
+ ], Qr = _e("brain", Xr);
98
+ /**
99
+ * @license lucide-react v1.22.0 - ISC
100
+ *
101
+ * This source code is licensed under the ISC license.
102
+ * See the LICENSE file in the root directory of this source tree.
103
+ */
104
+ const es = [
105
+ ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
106
+ ["path", { d: "M16 2v4", key: "4m81vk" }],
107
+ ["path", { d: "M3 10h18", key: "8toen8" }],
108
+ ["path", { d: "M8 2v4", key: "1cmpym" }],
109
+ ["path", { d: "M17 14h-6", key: "bkmgh3" }],
110
+ ["path", { d: "M13 18H7", key: "bb0bb7" }],
111
+ ["path", { d: "M7 14h.01", key: "1qa3f1" }],
112
+ ["path", { d: "M17 18h.01", key: "1bdyru" }]
113
+ ], ts = _e("calendar-range", es);
114
+ /**
115
+ * @license lucide-react v1.22.0 - ISC
116
+ *
117
+ * This source code is licensed under the ISC license.
118
+ * See the LICENSE file in the root directory of this source tree.
119
+ */
120
+ const ns = [
121
+ ["path", { d: "M6 8.5a6.5 6.5 0 1 1 13 0c0 6-6 6-6 10a3.5 3.5 0 1 1-7 0", key: "1dfaln" }],
122
+ ["path", { d: "M15 8.5a2.5 2.5 0 0 0-5 0v1a2 2 0 1 1 0 4", key: "1qnva7" }]
123
+ ], rs = _e("ear", ns);
124
+ /**
125
+ * @license lucide-react v1.22.0 - ISC
126
+ *
127
+ * This source code is licensed under the ISC license.
128
+ * See the LICENSE file in the root directory of this source tree.
129
+ */
130
+ const ss = [
131
+ ["path", { d: "M6 18h8", key: "1borvv" }],
132
+ ["path", { d: "M3 22h18", key: "8prr45" }],
133
+ ["path", { d: "M14 22a7 7 0 1 0 0-14h-1", key: "1jwaiy" }],
134
+ ["path", { d: "M9 14h2", key: "197e7h" }],
135
+ ["path", { d: "M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z", key: "1bmzmy" }],
136
+ ["path", { d: "M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3", key: "1drr47" }]
137
+ ], is = _e("microscope", ss);
138
+ /**
139
+ * @license lucide-react v1.22.0 - ISC
140
+ *
141
+ * This source code is licensed under the ISC license.
142
+ * See the LICENSE file in the root directory of this source tree.
143
+ */
144
+ const os = [
145
+ [
146
+ "path",
147
+ { d: "m10.5 20.5 10-10a4.95 4.95 0 1 0-7-7l-10 10a4.95 4.95 0 1 0 7 7Z", key: "wa1lgi" }
148
+ ],
149
+ ["path", { d: "m8.5 8.5 7 7", key: "rvfmvr" }]
150
+ ], as = _e("pill", os);
151
+ /**
152
+ * @license lucide-react v1.22.0 - ISC
153
+ *
154
+ * This source code is licensed under the ISC license.
155
+ * See the LICENSE file in the root directory of this source tree.
156
+ */
157
+ const cs = [
158
+ ["circle", { cx: "6", cy: "6", r: "3", key: "1lh9wr" }],
159
+ ["path", { d: "M8.12 8.12 12 12", key: "1alkpv" }],
160
+ ["path", { d: "M20 4 8.12 15.88", key: "xgtan2" }],
161
+ ["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }],
162
+ ["path", { d: "M14.8 14.8 20 20", key: "ptml3r" }]
163
+ ], ds = _e("scissors", cs);
164
+ /**
165
+ * @license lucide-react v1.22.0 - ISC
166
+ *
167
+ * This source code is licensed under the ISC license.
168
+ * See the LICENSE file in the root directory of this source tree.
169
+ */
170
+ const ls = [
171
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
172
+ ["path", { d: "M8 14s1.5 2 4 2 4-2 4-2", key: "1y1vjs" }],
173
+ ["line", { x1: "9", x2: "9.01", y1: "9", y2: "9", key: "yxxnd0" }],
174
+ ["line", { x1: "15", x2: "15.01", y1: "9", y2: "9", key: "1p4y9e" }]
175
+ ], us = _e("smile", ls);
176
+ /**
177
+ * @license lucide-react v1.22.0 - ISC
178
+ *
179
+ * This source code is licensed under the ISC license.
180
+ * See the LICENSE file in the root directory of this source tree.
181
+ */
182
+ const ms = [
183
+ ["path", { d: "M12 10V2", key: "16sf7g" }],
184
+ ["path", { d: "m4.93 10.93 1.41 1.41", key: "2a7f42" }],
185
+ ["path", { d: "M2 18h2", key: "j10viu" }],
186
+ ["path", { d: "M20 18h2", key: "wocana" }],
187
+ ["path", { d: "m19.07 10.93-1.41 1.41", key: "15zs5n" }],
188
+ ["path", { d: "M22 22H2", key: "19qnx5" }],
189
+ ["path", { d: "m16 6-4 4-4-4", key: "6wukr" }],
190
+ ["path", { d: "M16 18a4 4 0 0 0-8 0", key: "1lzouq" }]
191
+ ], ps = _e("sunset", ms);
192
+ /**
193
+ * @license lucide-react v1.22.0 - ISC
194
+ *
195
+ * This source code is licensed under the ISC license.
196
+ * See the LICENSE file in the root directory of this source tree.
197
+ */
198
+ const fs = [
199
+ ["path", { d: "m18 2 4 4", key: "22kx64" }],
200
+ ["path", { d: "m17 7 3-3", key: "1w1zoj" }],
201
+ ["path", { d: "M19 9 8.7 19.3c-1 1-2.5 1-3.4 0l-.6-.6c-1-1-1-2.5 0-3.4L15 5", key: "1exhtz" }],
202
+ ["path", { d: "m9 11 4 4", key: "rovt3i" }],
203
+ ["path", { d: "m5 19-3 3", key: "59f2uf" }],
204
+ ["path", { d: "m14 4 6 6", key: "yqp9t2" }]
205
+ ], Dn = _e("syringe", fs);
206
+ function gs(e, t, r) {
207
+ return Kn(e, -1, r);
208
+ }
209
+ const hs = {
210
+ id: "booking",
211
+ // `view_change` removed (0.69): the layout `variant` is a fixed prop — the
212
+ // handle exposes only `getVariant` (state), no action mutates it. The flow's
213
+ // only navigation is step-to-step (`goto_step` → `navigate`).
214
+ capabilities: ["navigate"],
215
+ state: {
216
+ variant: {
217
+ type: "string",
218
+ descriptionKey: "ui.agent.booking.state.variant",
219
+ description: "Active variant — one of `inline-list`, `accordion`, `calendar`, `flexible`, `progress`.",
220
+ read: (e) => e.getVariant()
221
+ },
222
+ currentStep: {
223
+ type: "number",
224
+ descriptionKey: "ui.agent.booking.state.currentStep",
225
+ description: 'The step the flow is on: 1 insurance, 2 specialty, 3 service, 4 provider, 5 date, 6 time, 7 patient details, payment or optional SMS code verification, 8 confirmation after all required steps succeed, including the "Time reserved" view that opens a host address after a short delay. Read this back after `goto_step` to see where the clamp landed.',
226
+ read: (e) => e.getCurrentStep()
227
+ }
228
+ },
229
+ actions: {
230
+ reset: {
231
+ // destructive: clears the whole in-progress booking value (patient
232
+ // identity, contact, slot choice) — irreversibly loses user input.
233
+ safety: "destructive",
234
+ idempotent: !0,
235
+ descriptionKey: "ui.agent.booking.actions.reset",
236
+ description: "Clear the booking value back to an empty state. Use to abandon an in-progress flow.",
237
+ errors: [
238
+ "Refused while a payment session is open (step 7): the consumer must cancel the hold first.",
239
+ "Refused while SMS code verification is pending (step 7): the locked form and code box stay, and the submitted booking remains active. The host owns cancellation."
240
+ ],
241
+ invoke: (e) => {
242
+ e.reset();
243
+ }
244
+ },
245
+ goto_step: {
246
+ safety: "read",
247
+ argsType: "{ step: 1 | 2 | 3 | 4 | 5 | 6 | 7 }",
248
+ argsSchema: {
249
+ type: "object",
250
+ properties: {
251
+ step: {
252
+ type: "integer",
253
+ enum: [1, 2, 3, 4, 5, 6, 7],
254
+ description: "Target step (1-7)."
255
+ }
256
+ },
257
+ required: ["step"]
258
+ },
259
+ idempotent: !0,
260
+ descriptionKey: "ui.agent.booking.actions.gotoStep",
261
+ description: "Jump to the given step. A step that is hidden for this practice, or that sits ahead of the first incomplete step, clamps to that first incomplete step — read `currentStep` back to see where it landed.",
262
+ errors: [
263
+ "Navigation stays on step 7 while payment or SMS code verification is pending.",
264
+ "Requested step is not yet reachable — clamped to the first incomplete step.",
265
+ "Requested step is hidden for this practice (e.g. insurance outside Germany, or provider choice turned off) — clamped to the first incomplete step."
266
+ ],
267
+ examples: [{ args: { step: 1 }, note: "Return to the first step." }],
268
+ invoke: (e, t) => {
269
+ e.goToStep(t.step);
270
+ }
271
+ }
272
+ },
273
+ domHooks: {
274
+ root: {
275
+ attr: "data-component",
276
+ value: "booking",
277
+ description: 'Marks the Booking root region. The host prop hideEmail (boolean, default false) hides the email field, skips its validation and omits email from submission. The host prop emailOptional (boolean, default false) keeps email visible and optional unless used for confirmation. Email is marked and validated as required when selected in the channel picker or singleConfirmationChannel radio, or when the effective confirmation channel is email. With a hidden picker, the form and success screen use the sole enabled channel, or email when multiple channels are enabled. This includes payment and blocked-payment flows, which omit stored selections from submission. Omitting confirmationChannels also defaults to email. Selecting SMS without email makes the field optional again. The optional/required marker updates visually when the channel changes, with no announcement of that change. Validation updates immediately using the existing email error. With emailOptional, surrounding spaces are trimmed before validation, even when email is required for confirmation. Optional blank values are omitted from submission; filled values are sent trimmed. hideEmail takes precedence over emailOptional. Neither prop changes confirmation channels; pair with confirmationChannels ["sms"] for SMS-only confirmation with no channel picker. The optional codeStep prop adds SMS verification after submission and before any payment: the submitted form stays in place but locked (controls disabled, text still readable, not hidden), the code box opens below it, and a Change button, for the patient only (no agent action unlocks it), unlocks the form for a new booking request (the host keeps the earlier request until it expires; the kit cannot cancel it). With payment, a correct code opens the payment stage, and the step remains 7 until payment succeeds; without payment it remains 7 until verification succeeds. It then becomes 8. Patient contact details and verification codes are never exposed through this adapter.'
278
+ },
279
+ instanceId: {
280
+ attr: "data-component-id",
281
+ sourceProp: "id",
282
+ description: "Sourced from the id prop."
283
+ }
284
+ }
285
+ }, fn = [
286
+ "email",
287
+ "whatsapp",
288
+ "sms"
289
+ ], qe = "all", vs = "de";
290
+ function bs(e) {
291
+ const t = e.lockedOperatorId;
292
+ return [...t ? e.operatorsByService ? e.specialties.filter(
293
+ (i) => e.services.some(
294
+ (s) => {
295
+ var a;
296
+ return s.specialtyId === i.id && ((a = s.operatorIds) == null ? void 0 : a.includes(t));
297
+ }
298
+ )
299
+ ) : e.specialties.filter((i) => {
300
+ var s;
301
+ return (s = i.operatorIds) == null ? void 0 : s.includes(t);
302
+ }) : e.specialties].sort((i, s) => {
303
+ const a = i.sequenceNumber ?? Number.POSITIVE_INFINITY, o = s.sequenceNumber ?? Number.POSITIVE_INFINITY;
304
+ return a - o;
305
+ });
306
+ }
307
+ function ys(e) {
308
+ let t = e.services;
309
+ if (e.lockedOperatorId && (t = t.filter(
310
+ (i) => {
311
+ var s;
312
+ return (s = i.operatorIds) == null ? void 0 : s.includes(e.lockedOperatorId);
313
+ }
314
+ )), e.useSpecialties === void 0 ? e.specialties.length > 0 : e.useSpecialties) {
315
+ const i = st(e.value);
316
+ i.length > 0 && (t = t.filter(
317
+ (s) => s.specialtyId !== void 0 && i.includes(s.specialtyId)
318
+ ));
319
+ }
320
+ return t;
321
+ }
322
+ function ks(e) {
323
+ const t = e.useSpecialties === void 0 ? e.specialties.length > 0 : e.useSpecialties, r = Ye(e.value);
324
+ if ((!t || e.operatorsByService) && r.length > 0)
325
+ return e.operators.filter(
326
+ (i) => {
327
+ var s;
328
+ return (s = i.appointmentBookingReasonIds) == null ? void 0 : s.some((a) => r.includes(a));
329
+ }
330
+ );
331
+ if (t) {
332
+ const i = st(e.value);
333
+ if (i.length > 0)
334
+ return e.operators.filter(
335
+ (s) => {
336
+ var a;
337
+ return (a = s.specialtyIds) == null ? void 0 : a.some((o) => i.includes(o));
338
+ }
339
+ );
340
+ }
341
+ return [];
342
+ }
343
+ function Ss(e, t) {
344
+ const r = e.country === vs, i = !r || e.value.insuranceType !== void 0, a = (e.useSpecialties === void 0 ? e.specialties.length > 0 : e.useSpecialties) && i, o = st(e.value).length > 0, m = !a || o, p = Ye(e.value).length > 0, f = !m || p, S = t.operators, g = !!e.allowOperatorSelection && f && p && !e.lockedOperatorId && S.length > 1, d = f && p, v = (!d || e.value.date !== void 0) && e.value.date !== void 0, M = (!v || e.value.slotKey !== void 0) && e.value.slotKey !== void 0, w = p && S.length === 0;
345
+ return {
346
+ insurance: r,
347
+ specialty: a,
348
+ service: m,
349
+ operator: g,
350
+ date: d,
351
+ slot: v,
352
+ details: M,
353
+ onboardingIncomplete: w
354
+ };
355
+ }
356
+ function xs(e, t) {
357
+ const r = [];
358
+ return t.insurance && r.push(1), t.specialty && r.push(2), r.push(3), t.operator && r.push(4), r.push(5), r.push(6), r.push(7), {
359
+ currentStep: r.find(
360
+ (s) => !We(s, e.value)
361
+ ) ?? 7,
362
+ visibleSteps: r
363
+ };
364
+ }
365
+ function We(e, t) {
366
+ switch (e) {
367
+ case 1:
368
+ return t.insuranceType !== void 0;
369
+ // 0.34.0: array-or-single — satisfied when EITHER form is present.
370
+ case 2:
371
+ return st(t).length > 0;
372
+ case 3:
373
+ return Ye(t).length > 0;
374
+ // Always satisfied, like its gate: "no preference" is a valid answer,
375
+ // whether it is the `'all'` sentinel or an empty multi-select.
376
+ case 4:
377
+ return !0;
378
+ case 5:
379
+ return t.date !== void 0;
380
+ case 6:
381
+ return t.slotKey !== void 0;
382
+ // Details fulfilment is owned by the form's own validation.
383
+ case 7:
384
+ return !1;
385
+ }
386
+ }
387
+ function Is(e) {
388
+ const t = {
389
+ specialties: bs(e),
390
+ services: ys(e),
391
+ operators: ks(e)
392
+ }, r = Ss(e, t), { currentStep: i, visibleSteps: s } = xs(e, r);
393
+ let a;
394
+ if (e.value.date && e.value.slotKey) {
395
+ const f = e.availableSlots[e.value.date];
396
+ f && (a = f.find((S) => S.key === e.value.slotKey));
397
+ }
398
+ const o = Ye(e.value), c = o.length > 0 ? e.services.find((f) => f.id === o[0]) : void 0, m = st(e.value).length > 0, p = o.length > 0 && e.value.date !== void 0 && e.value.slotKey !== void 0 && (!r.insurance || e.value.insuranceType !== void 0) && (!r.specialty || m);
399
+ return {
400
+ gates: r,
401
+ filtered: t,
402
+ currentStep: i,
403
+ totalSteps: s.length,
404
+ visibleSteps: s,
405
+ isReadyToSubmit: p,
406
+ durationMin: c == null ? void 0 : c.durationMin,
407
+ selectedSlot: a
408
+ };
409
+ }
410
+ function jn(e, t) {
411
+ return {
412
+ ...e,
413
+ insuranceType: t,
414
+ specialtyId: void 0,
415
+ serviceId: void 0,
416
+ operatorId: void 0,
417
+ date: void 0,
418
+ slotKey: void 0,
419
+ details: void 0
420
+ };
421
+ }
422
+ function Un(e, t) {
423
+ return {
424
+ ...e,
425
+ specialtyId: t,
426
+ specialtyIds: void 0,
427
+ serviceId: void 0,
428
+ serviceIds: void 0,
429
+ operatorId: void 0,
430
+ operatorIds: void 0,
431
+ date: void 0,
432
+ slotKey: void 0,
433
+ details: void 0
434
+ };
435
+ }
436
+ function Hn(e, t) {
437
+ return {
438
+ ...e,
439
+ specialtyId: void 0,
440
+ specialtyIds: t,
441
+ serviceId: void 0,
442
+ serviceIds: void 0,
443
+ operatorId: void 0,
444
+ operatorIds: void 0,
445
+ date: void 0,
446
+ slotKey: void 0,
447
+ details: void 0
448
+ };
449
+ }
450
+ function Gn(e, t) {
451
+ return {
452
+ ...e,
453
+ serviceId: t,
454
+ serviceIds: void 0,
455
+ // Default the operator to the "All operators" sentinel so a patient
456
+ // who doesn't care about picking lands on a satisfied step 4 without
457
+ // any further input.
458
+ operatorId: t ? qe : void 0,
459
+ operatorIds: void 0,
460
+ date: void 0,
461
+ slotKey: void 0,
462
+ details: void 0
463
+ };
464
+ }
465
+ function Jn(e, t) {
466
+ const r = !!t && t.length > 0;
467
+ return {
468
+ ...e,
469
+ serviceId: void 0,
470
+ serviceIds: t,
471
+ operatorId: r ? qe : void 0,
472
+ operatorIds: void 0,
473
+ date: void 0,
474
+ slotKey: void 0,
475
+ details: void 0
476
+ };
477
+ }
478
+ function Wn(e, t) {
479
+ return {
480
+ ...e,
481
+ operatorId: t,
482
+ operatorIds: void 0,
483
+ date: void 0,
484
+ slotKey: void 0,
485
+ details: void 0
486
+ };
487
+ }
488
+ function Yn(e, t) {
489
+ return {
490
+ ...e,
491
+ operatorId: void 0,
492
+ operatorIds: t,
493
+ date: void 0,
494
+ slotKey: void 0,
495
+ details: void 0
496
+ };
497
+ }
498
+ function st(e) {
499
+ return e.specialtyIds && e.specialtyIds.length > 0 ? e.specialtyIds : e.specialtyId ? [e.specialtyId] : [];
500
+ }
501
+ function Ye(e) {
502
+ return e.serviceIds && e.serviceIds.length > 0 ? e.serviceIds : e.serviceId ? [e.serviceId] : [];
503
+ }
504
+ function gn(e) {
505
+ return e.operatorIds && e.operatorIds.length > 0 ? e.operatorIds : e.operatorId ? [e.operatorId] : [];
506
+ }
507
+ function hn(e, t) {
508
+ return {
509
+ ...e,
510
+ date: t,
511
+ slotKey: void 0
512
+ // Keep details — date/slot changes shouldn't wipe the patient form
513
+ // since the user has already filled some fields.
514
+ };
515
+ }
516
+ function Zn(e, t) {
517
+ return {
518
+ ...e,
519
+ slotKey: t
520
+ };
521
+ }
522
+ function Ns(e, t) {
523
+ let r = e;
524
+ if (t.lockedOperatorId && r.operatorId !== t.lockedOperatorId && (r = { ...r, operatorId: t.lockedOperatorId }), (t.useSpecialties === void 0 ? t.specialties.length > 0 : t.useSpecialties) && t.specialties.length === 1 && r.specialtyId === void 0 && r.specialtyIds === void 0 && (r = { ...r, specialtyId: t.specialties[0].id }), t.autoSelectSingleService) {
525
+ const s = st(r), a = s.length > 0 ? t.services.filter(
526
+ (o) => o.specialtyId && s.includes(o.specialtyId)
527
+ ) : t.services;
528
+ a.length === 1 && r.serviceId === void 0 && r.serviceIds === void 0 && (r = { ...r, serviceId: a[0].id }, r.operatorId === void 0 && r.operatorIds === void 0 && (r = { ...r, operatorId: qe }));
529
+ }
530
+ return r;
531
+ }
532
+ function Xn(e) {
533
+ if (e.operatorId && e.operatorId !== qe)
534
+ return e.operatorId;
535
+ }
536
+ function ws(e) {
537
+ if (!e) return !1;
538
+ const t = e.trim();
539
+ return /^\+?\d[\d\s\-()]{6,}$/.test(t);
540
+ }
541
+ function Sn(e) {
542
+ const t = e && e.length > 0 ? e : ["email"], r = new Set(t);
543
+ return fn.filter((i) => r.has(i));
544
+ }
545
+ function Qn(e, t) {
546
+ return t ?? (e.length === 1 ? e : ["email"]);
547
+ }
548
+ function Cs(e, t, r) {
549
+ const i = Sn(e), s = new Set(i);
550
+ if (r)
551
+ return fn.filter(
552
+ (p) => r.includes(p) && s.has(p)
553
+ );
554
+ const a = [];
555
+ s.has("email") && a.push("email");
556
+ const o = ws(t), c = s.has("whatsapp");
557
+ c && o && a.push("whatsapp"), !c && s.has("sms") && a.push("sms");
558
+ const m = new Set(a);
559
+ return fn.filter((p) => m.has(p));
560
+ }
561
+ const Ts = /https?:\/\/(?:(?![.,;:!?'»›]https?:\/\/)[^\s<>"\u060C\u061B\u061F\u06D4\u2000-\u206F\u3000-\u303F\uFF00-\uFFEF])+/gi, As = /* @__PURE__ */ new Set([
562
+ ".",
563
+ ",",
564
+ ";",
565
+ ":",
566
+ "!",
567
+ "?",
568
+ "'",
569
+ "»",
570
+ "›"
571
+ ]), Ms = { ")": "(", "]": "[", "}": "{" }, En = (e, t) => e.split(t).length - 1;
572
+ function Rs(e) {
573
+ const t = {};
574
+ for (const [i, s] of Object.entries(Ms))
575
+ t[i] = En(e, i) - En(e, s);
576
+ let r = e.length;
577
+ for (; r > 0; ) {
578
+ const i = e[r - 1];
579
+ if (As.has(i))
580
+ r -= 1;
581
+ else if (i in t && t[i] > 0)
582
+ t[i] -= 1, r -= 1;
583
+ else
584
+ break;
585
+ }
586
+ return e.slice(0, r);
587
+ }
588
+ const Os = /[\u0600-\u06FF\u3040-\u30FF\u3400-\u9FFF\uAC00-\uD7AF]/, Ds = /[A-Za-z0-9]/;
589
+ function Es(e) {
590
+ const t = e.search(Os);
591
+ return t > 0 && Ds.test(e[t - 1]) ? e.slice(0, t) : e;
592
+ }
593
+ function Fs(e) {
594
+ try {
595
+ const { protocol: t, hostname: r } = new URL(e);
596
+ return (t === "http:" || t === "https:") && r !== "";
597
+ } catch {
598
+ return !1;
599
+ }
600
+ }
601
+ function _s(e) {
602
+ const t = [];
603
+ let r = 0;
604
+ const i = (s) => {
605
+ if (s === "") return;
606
+ const a = t[t.length - 1];
607
+ (a == null ? void 0 : a.kind) === "text" ? a.text += s : t.push({ kind: "text", text: s });
608
+ };
609
+ for (const s of e.matchAll(Ts)) {
610
+ const a = s.index ?? 0, o = Rs(Es(s[0]));
611
+ Fs(o) && (i(e.slice(r, a)), t.push({ kind: "link", text: o, href: o }), r = a + o.length);
612
+ }
613
+ return i(e.slice(r)), t;
614
+ }
615
+ const Fn = 500, Bs = /^[A-Z0-9]{16}$/, Ls = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, _n = 300, mn = "ds:rounded-[var(--radius-sm)] ds:underline ds:text-[var(--foreground)] ds:focus-visible:outline-solid ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]", Xt = (e) => e && /^https?:\/\//i.test(e) ? e : void 0, Ps = (e, t) => ({
616
+ street: (e == null ? void 0 : e.address.line1) ?? "",
617
+ city: (e == null ? void 0 : e.address.city) ?? "",
618
+ postcode: (e == null ? void 0 : e.address.postalCode) ?? "",
619
+ province: (e == null ? void 0 : e.address.state) ?? "",
620
+ // The practice's country only until the patient has an address at all.
621
+ country: (e ? e.address.country : t).toLowerCase(),
622
+ formatted: ""
623
+ }), Vs = (e, t, r = null) => ({
624
+ name: t,
625
+ address: {
626
+ line1: e.street,
627
+ line2: r,
628
+ city: e.city,
629
+ state: e.province,
630
+ postalCode: e.postcode,
631
+ country: e.country.toUpperCase()
632
+ }
633
+ }), $s = Lt("ds:flex ds:flex-col ds:border", {
634
+ variants: {
635
+ noticeStyle: {
636
+ plain: "ds:gap-[var(--spacing-xs)] ds:rounded-[var(--radius-md)] ds:border-[var(--border)] ds:bg-[var(--muted)] ds:p-[var(--spacing-sm)]",
637
+ highlighted: "ds:gap-[var(--spacing-sm)] ds:rounded-[var(--radius-lg)] ds:border-[color-mix(in_srgb,var(--primary)_30%,var(--border))] ds:bg-[color-mix(in_srgb,var(--primary)_8%,var(--card))] ds:p-[var(--spacing-md)]"
638
+ }
639
+ },
640
+ defaultVariants: { noticeStyle: "highlighted" }
641
+ }), qs = ["it", "ch", "de", "at", "fr", "sm"], X = {
642
+ country: "billing.country",
643
+ street: "billing.street",
644
+ city: "billing.city",
645
+ postcode: "billing.postcode",
646
+ province: "billing.province"
647
+ }, er = /^\d{5}$/, zs = (e) => {
648
+ if (!e) return !1;
649
+ const { line1: t, city: r, postalCode: i, country: s, state: a } = e.address;
650
+ return !t.trim() || !r.trim() || !i.trim() || !s.trim() ? !1 : s.toUpperCase() !== "IT" ? !0 : !!a.trim() && er.test(i.trim());
651
+ }, Ks = (e, t) => {
652
+ var r;
653
+ return {
654
+ name: t,
655
+ address: {
656
+ line1: e.address.line1.trim(),
657
+ line2: ((r = e.address.line2) == null ? void 0 : r.trim()) || null,
658
+ city: e.address.city.trim(),
659
+ state: e.address.state.trim(),
660
+ postalCode: e.address.postalCode.trim(),
661
+ country: e.address.country.trim().toUpperCase()
662
+ }
663
+ };
664
+ }, Qt = { state: "idle" }, Bn = [
665
+ "firstName",
666
+ "lastName",
667
+ "email",
668
+ "mobilePhone",
669
+ "codiceFiscale",
670
+ "dateOfBirth",
671
+ "insuranceNumber",
672
+ X.country,
673
+ X.street,
674
+ X.city,
675
+ X.postcode,
676
+ X.province
677
+ ], js = /* @__PURE__ */ new Set(), xn = Vn(
678
+ ({
679
+ value: e,
680
+ onChange: t,
681
+ onSubmit: r,
682
+ hideEmail: i = !1,
683
+ emailOptional: s = !1,
684
+ requireCodiceFiscale: a = !1,
685
+ requireDateOfBirth: o = !1,
686
+ requireInsuranceNumber: c = !1,
687
+ insuranceType: m,
688
+ showNote: p = !1,
689
+ showReturningPatientFlag: f = !1,
690
+ privacyPolicyUrl: S,
691
+ termsUrl: g,
692
+ practiceConsent: d,
693
+ payment: h,
694
+ paymentTermsUrl: v,
695
+ paymentBlocked: u = !1,
696
+ billingInDetails: M = !1,
697
+ paymentNoticeStyle: w = "highlighted",
698
+ criticalInformationToAccept: C,
699
+ validateCodiceFiscale: I,
700
+ validateInsuranceNumber: O,
701
+ submitting: B = !1,
702
+ locked: F = !1,
703
+ summarySlot: R,
704
+ defaultPhoneCountry: $,
705
+ confirmationChannels: j,
706
+ defaultConfirmationChannels: T,
707
+ singleConfirmationChannel: k = !1,
708
+ submitError: L
709
+ }, E) => {
710
+ var Ae, Jt, It, Nt, tt;
711
+ const { t: b, i18n: W } = Q("ui"), ne = pt(), Ne = A(null), ge = A(null);
712
+ _t(() => {
713
+ var l;
714
+ (l = ge.current) == null || l.setAttribute("inert", "");
715
+ }, []);
716
+ const N = Me(
717
+ (l) => {
718
+ Ne.current = l, typeof E == "function" ? E(l) : E && (E.current = l);
719
+ },
720
+ [E]
721
+ ), [q, Y] = J(0);
722
+ V(() => {
723
+ var D;
724
+ if (q === 0) return;
725
+ const l = (D = Ne.current) == null ? void 0 : D.querySelectorAll(
726
+ '[aria-invalid="true"], [role="checkbox"][aria-required="true"][aria-checked="false"], [data-unanswered] [role="checkbox"]'
727
+ );
728
+ for (const ie of l ?? [])
729
+ if (ie.focus(), document.activeElement === ie) return;
730
+ }, [q]);
731
+ const U = A(!1), [ze, Be] = J(!1), [he, ve] = J(!1), be = B || ze, [ye, Oe] = J(Qt), [De, ke] = J(Qt), [oe, ae] = J({}), se = Me(
732
+ (l) => ae((D) => ({ ...D, [l]: !0 })),
733
+ []
734
+ ), [it, ft] = J(js), Le = A(null), ot = A(
735
+ null
736
+ );
737
+ V(
738
+ () => () => {
739
+ Le.current && clearTimeout(Le.current), ot.current && clearTimeout(ot.current);
740
+ },
741
+ []
742
+ );
743
+ const Z = Me(
744
+ (l) => {
745
+ ve(!1), t({ ...e, ...l });
746
+ },
747
+ [e, t]
748
+ ), Ke = h ? JSON.stringify([
749
+ h.serviceId,
750
+ h.kind,
751
+ h.amountCents,
752
+ h.currencyCode,
753
+ v
754
+ ]) : void 0, [Pt, Tt] = J(
755
+ () => e.paymentAccepted ? Ke : void 0
756
+ ), Vt = A(Ke), Ze = !!(h && e.paymentAccepted && Pt === Ke);
757
+ V(() => {
758
+ Vt.current !== Ke && (Vt.current = Ke, Tt(void 0), e.paymentAccepted !== void 0 && Z({ paymentAccepted: h ? !1 : void 0 }));
759
+ }, [Ke, h, Z, e.paymentAccepted]);
760
+ const gt = typeof (d == null ? void 0 : d.label) == "string" && d.label.trim() !== "", we = d && gt ? JSON.stringify([
761
+ d.label,
762
+ d.url ?? null,
763
+ d.required
764
+ ]) : void 0, [At, $t] = J(
765
+ () => e.practiceConsentAccepted ? we : void 0
766
+ ), qt = A(we), de = !!(we !== void 0 && e.practiceConsentAccepted && At === we);
767
+ V(() => {
768
+ qt.current !== we && (qt.current = we, $t(void 0), e.practiceConsentAccepted !== void 0 && Z({ practiceConsentAccepted: void 0 }));
769
+ }, [we, Z, e.practiceConsentAccepted]);
770
+ const ht = h ? on(h.amountCents, h.currencyCode, W.language) : "", Se = Xt(v), Ee = M && !!h && !u, pe = a, at = ($ || "it").toLowerCase(), vt = !Ee || zs(e.billing), ct = Ps(e.billing, at), je = ct.country === "it", bt = A(null), Xe = A(
771
+ null
772
+ ), Pe = (Ae = e.billing) == null ? void 0 : Ae.address.line1.trim(), z = ((It = (Jt = e.billing) == null ? void 0 : Jt.address.line2) == null ? void 0 : It.trim()) || null;
773
+ V(() => {
774
+ var l;
775
+ Pe !== void 0 && z ? Xe.current = { street: Pe, line2: z } : (Pe === void 0 || Pe === ((l = Xe.current) == null ? void 0 : l.street)) && (Xe.current = null);
776
+ }, [Pe, z]);
777
+ const Ve = (l) => (
778
+ // Nothing for a block not shown, nor for a province outside Italy.
779
+ !Ee || !oe[X[l]] || l === "province" && !je ? void 0 : ct[l].trim() ? (
780
+ // The one format the block itself checks: an Italian CAP.
781
+ l === "postcode" && je && !er.test(ct.postcode.trim()) ? b("inputs.postalCode.invalid") : void 0
782
+ ) : b("booking.details.fieldRequired")
783
+ ), yt = Me(
784
+ () => ae(
785
+ (l) => l[X.province] ? l : {
786
+ ...l,
787
+ codiceFiscale: !0,
788
+ ...Object.fromEntries(
789
+ Object.values(X).map((D) => [D, !0])
790
+ )
791
+ }
792
+ ),
793
+ []
794
+ ), Ce = K(
795
+ () => Sn(j),
796
+ [j]
797
+ ), ee = !h && !u && Ce.length >= 2, xe = K(
798
+ () => k ? [
799
+ (T == null ? void 0 : T.find(
800
+ (l) => Ce.includes(l)
801
+ )) ?? Ce[0]
802
+ ] : Cs(
803
+ Ce,
804
+ e.mobilePhone,
805
+ T
806
+ ),
807
+ [
808
+ k,
809
+ T,
810
+ Ce,
811
+ e.mobilePhone
812
+ ]
813
+ ), kt = A(!1);
814
+ V(() => {
815
+ if (!(h || u)) {
816
+ if (!ee) {
817
+ e.confirmationChannels !== void 0 && Z({ confirmationChannels: void 0 });
818
+ return;
819
+ }
820
+ if (e.confirmationChannels !== void 0) {
821
+ kt.current = !0, k && e.confirmationChannels.length > 1 && Z({
822
+ confirmationChannels: e.confirmationChannels.slice(0, 1)
823
+ });
824
+ return;
825
+ }
826
+ kt.current = !0, Z({ confirmationChannels: xe });
827
+ }
828
+ }, [
829
+ xe,
830
+ ee,
831
+ h,
832
+ u,
833
+ Ce,
834
+ e.mobilePhone,
835
+ T,
836
+ k
837
+ ]);
838
+ const Ue = e.confirmationChannels ?? xe, St = ee && Ue.length === 0, Te = Qn(
839
+ Ce,
840
+ ee ? Ue : void 0
841
+ ), dt = !s || Te.includes("email"), Mt = A(I), zt = A(O);
842
+ V(() => {
843
+ Mt.current = I, zt.current = O;
844
+ }, [I, O]);
845
+ const Kt = !!I, He = !!O;
846
+ V(() => {
847
+ const l = e.codiceFiscale;
848
+ if (!pe || !Kt || !l) {
849
+ Oe(Qt);
850
+ return;
851
+ }
852
+ if (!Bs.test(l)) {
853
+ Oe({
854
+ state: "invalid",
855
+ hint: b("booking.details.codiceFiscale.invalidFormat")
856
+ });
857
+ return;
858
+ }
859
+ Oe({ state: "pending" });
860
+ let D = !0;
861
+ return Le.current && clearTimeout(Le.current), Le.current = setTimeout(async () => {
862
+ try {
863
+ const ie = Mt.current;
864
+ if (!ie) return;
865
+ const nt = await ie(l);
866
+ D && Oe({
867
+ state: nt.valid ? "valid" : "invalid",
868
+ hint: nt.hint,
869
+ value: l
870
+ });
871
+ } catch {
872
+ D && Oe({
873
+ state: "invalid",
874
+ hint: b("booking.details.codiceFiscale.unavailable"),
875
+ value: l
876
+ });
877
+ }
878
+ }, _n), () => {
879
+ D = !1, Le.current && clearTimeout(Le.current);
880
+ };
881
+ }, [pe, Kt, e.codiceFiscale, b]);
882
+ const $e = c && m === "public";
883
+ V(() => {
884
+ const l = e.insuranceNumber;
885
+ if (!$e || !He || !l) {
886
+ ke(Qt);
887
+ return;
888
+ }
889
+ ke({ state: "pending" }), ot.current && clearTimeout(ot.current), ot.current = setTimeout(() => {
890
+ const D = zt.current;
891
+ D && D(l).then(
892
+ (ie) => ke(
893
+ ie.valid ? { state: "valid" } : { state: "invalid", hint: ie.hint }
894
+ )
895
+ ).catch(
896
+ () => ke({
897
+ state: "invalid",
898
+ hint: b("booking.details.insuranceNumber.unavailable")
899
+ })
900
+ );
901
+ }, _n);
902
+ }, [$e, He, e.insuranceNumber, b]);
903
+ const G = K(() => {
904
+ var D;
905
+ if (i) return !0;
906
+ const l = s ? (D = e.email) == null ? void 0 : D.trim() : e.email;
907
+ return !dt && !l ? !0 : !!(l && Ls.test(l));
908
+ }, [i, s, dt, e.email]), H = K(
909
+ () => !!(e.mobilePhone && e.mobilePhone.length >= 6),
910
+ [e.mobilePhone]
911
+ ), jt = K(() => {
912
+ var l, D;
913
+ return !(!((l = e.firstName) != null && l.trim()) || !((D = e.lastName) != null && D.trim()) || !G || !H || pe && (ye.state !== "valid" || ye.value !== e.codiceFiscale) || !vt || o && !e.dateOfBirth || $e && De.state !== "valid");
914
+ }, [
915
+ e.firstName,
916
+ e.lastName,
917
+ G,
918
+ H,
919
+ pe,
920
+ vt,
921
+ ye.state,
922
+ ye.value,
923
+ e.codiceFiscale,
924
+ o,
925
+ e.dateOfBirth,
926
+ $e,
927
+ De.state
928
+ ]), Qe = C != null && C.trim() ? C : void 0, xt = Qe !== void 0, dn = !xt || !!e.criticalInformationAccepted, ln = !gt || !(d != null && d.required) || de, Ut = !!(e.privacyConsent && e.termsConsent && dn && ln), Ht = !ee || Ue.length > 0, lt = jt && Ut && Ht && (!h || Ze) && !u && !be, Rt = !lt && !be && !u, Ot = `${ne}-submit-hint`, te = {
929
+ firstName: oe.firstName && !((Nt = e.firstName) != null && Nt.trim()) ? b("booking.details.firstName.required") : void 0,
930
+ lastName: oe.lastName && !((tt = e.lastName) != null && tt.trim()) ? b("booking.details.lastName.required") : void 0,
931
+ email: !i && oe.email && !G ? b("booking.details.email.invalid") : void 0,
932
+ mobilePhone: oe.mobilePhone && !H ? b("booking.details.mobilePhone.invalid") : void 0,
933
+ codiceFiscale: oe.codiceFiscale && ye.state === "invalid" ? ye.hint ?? b("booking.details.codiceFiscale.invalid") : oe.codiceFiscale && !e.codiceFiscale ? b("booking.details.fieldRequired") : void 0,
934
+ dateOfBirth: oe.dateOfBirth && !e.dateOfBirth ? b("booking.details.dateOfBirth.required") : void 0,
935
+ insuranceNumber: oe.insuranceNumber && De.state === "invalid" ? De.hint ?? b("booking.details.insuranceNumber.invalid") : void 0,
936
+ [X.country]: Ve("country"),
937
+ [X.street]: Ve("street"),
938
+ [X.city]: Ve("city"),
939
+ [X.postcode]: Ve("postcode"),
940
+ [X.province]: Ve("province")
941
+ }, Dt = Bn.filter(
942
+ (l) => it.has(l) && te[l] !== void 0
943
+ );
944
+ Dt.length !== it.size && ft(new Set(Dt));
945
+ const le = (l) => !it.has(l), et = async (l) => {
946
+ var ie, nt;
947
+ if (l.preventDefault(), !be && !U.current && !lt && ft(
948
+ new Set(
949
+ Bn.filter(
950
+ (Ge) => it.has(Ge) || !te[Ge]
951
+ )
952
+ )
953
+ ), ae({
954
+ firstName: !0,
955
+ lastName: !0,
956
+ email: !i,
957
+ mobilePhone: !0,
958
+ codiceFiscale: !0,
959
+ dateOfBirth: !0,
960
+ insuranceNumber: !0,
961
+ ...Object.fromEntries(
962
+ Object.values(X).map((Ge) => [Ge, !0])
963
+ )
964
+ }), be || U.current) return;
965
+ if (!lt) {
966
+ Y((Ge) => Ge + 1);
967
+ return;
968
+ }
969
+ const D = {
970
+ firstName: e.firstName.trim(),
971
+ lastName: e.lastName.trim(),
972
+ ...!i && ((ie = e.email) != null && ie.trim()) ? { email: e.email.trim() } : {},
973
+ mobilePhone: e.mobilePhone,
974
+ // Always present so the platform can refuse a filled or omitted field.
975
+ // Read from the DOM: bots often set the input without firing onChange.
976
+ website: ((nt = ge.current) == null ? void 0 : nt.value) ?? "",
977
+ privacyConsent: !0,
978
+ termsConsent: !0,
979
+ // Only present when the service carried text to accept — a
980
+ // reason without it leaves the key out of the payload entirely.
981
+ ...xt ? { criticalInformationAccepted: !0 } : {},
982
+ // Sent whenever the practice's box is shown, ticked or not, so the
983
+ // server can record the answer; left out when there is no box.
984
+ ...gt ? { practiceConsentAccepted: de } : {},
985
+ ...h ? { paymentAccepted: !0 } : {},
986
+ codiceFiscale: e.codiceFiscale,
987
+ dateOfBirth: e.dateOfBirth,
988
+ insuranceNumber: e.insuranceNumber,
989
+ note: e.note,
990
+ returningPatient: e.returningPatient,
991
+ // Only include when the picker was visible; otherwise the single
992
+ // implicit channel is inferred backend-side from the practice
993
+ // config.
994
+ confirmationChannels: ee ? Ue : void 0,
995
+ ...Ee && e.billing ? {
996
+ billing: Ks(
997
+ e.billing,
998
+ `${e.firstName.trim()} ${e.lastName.trim()}`
999
+ )
1000
+ } : {}
1001
+ };
1002
+ U.current = !0, Be(!0), ve(!1);
1003
+ try {
1004
+ await r(D);
1005
+ } catch {
1006
+ ve(!0);
1007
+ } finally {
1008
+ U.current = !1, Be(!1);
1009
+ }
1010
+ }, Et = /* @__PURE__ */ n(
1011
+ Je,
1012
+ {
1013
+ label: b("booking.details.codiceFiscale.label"),
1014
+ required: !0,
1015
+ description: ye.state === "pending" ? b("booking.details.codiceFiscale.checking") : b("booking.details.codiceFiscale.helper"),
1016
+ error: te.codiceFiscale,
1017
+ announceError: le("codiceFiscale"),
1018
+ children: /* @__PURE__ */ n(
1019
+ Yt,
1020
+ {
1021
+ value: e.codiceFiscale ?? "",
1022
+ maxLength: 16,
1023
+ onChange: (l) => Z({
1024
+ codiceFiscale: l.target.value.slice(0, 16).toUpperCase()
1025
+ }),
1026
+ onBlur: () => se("codiceFiscale")
1027
+ }
1028
+ )
1029
+ }
1030
+ ), Gt = (l, D) => {
1031
+ const ie = Xt(D);
1032
+ return ie ? /* @__PURE__ */ n(
1033
+ $n,
1034
+ {
1035
+ ns: "ui",
1036
+ i18nKey: l,
1037
+ components: {
1038
+ // The `<Trans>` runtime injects link text from the i18n
1039
+ // string. The anchor renders empty at static-analysis time,
1040
+ // so `jsx-a11y/anchor-has-content` would false-flag — silence
1041
+ // it; the runtime content is the localised policy / terms
1042
+ // label.
1043
+ policyLink: (
1044
+ // eslint-disable-next-line jsx-a11y/anchor-has-content
1045
+ /* @__PURE__ */ n(
1046
+ "a",
1047
+ {
1048
+ href: ie,
1049
+ target: "_blank",
1050
+ rel: "noopener noreferrer",
1051
+ className: mn
1052
+ }
1053
+ )
1054
+ )
1055
+ }
1056
+ }
1057
+ ) : b(l);
1058
+ };
1059
+ return /* @__PURE__ */ y(
1060
+ "form",
1061
+ {
1062
+ ref: N,
1063
+ id: ne,
1064
+ noValidate: !0,
1065
+ onSubmit: et,
1066
+ onFocus: (l) => {
1067
+ const D = bt.current;
1068
+ !D || !l.currentTarget.contains(l.target) || !D.contains(l.target) && D.compareDocumentPosition(l.target) & Node.DOCUMENT_POSITION_FOLLOWING && yt();
1069
+ },
1070
+ "aria-busy": be || void 0,
1071
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
1072
+ children: [
1073
+ R,
1074
+ /* @__PURE__ */ n(
1075
+ "input",
1076
+ {
1077
+ ref: ge,
1078
+ type: "text",
1079
+ name: "ad_booking_hp",
1080
+ "data-honeypot": "",
1081
+ defaultValue: "",
1082
+ tabIndex: -1,
1083
+ autoComplete: "off",
1084
+ "data-1p-ignore": "",
1085
+ "data-lpignore": "true",
1086
+ "data-bwignore": "",
1087
+ "aria-hidden": "true",
1088
+ className: "ds:sr-only ds:pointer-events-none"
1089
+ }
1090
+ ),
1091
+ /* @__PURE__ */ y("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-sm)] ds:sm:grid-cols-2", children: [
1092
+ /* @__PURE__ */ n(
1093
+ Je,
1094
+ {
1095
+ label: b("booking.details.firstName.label"),
1096
+ required: !0,
1097
+ error: te.firstName,
1098
+ announceError: le("firstName"),
1099
+ children: /* @__PURE__ */ n(
1100
+ Yt,
1101
+ {
1102
+ autoComplete: "given-name",
1103
+ value: e.firstName ?? "",
1104
+ onChange: (l) => Z({ firstName: l.target.value }),
1105
+ onBlur: () => se("firstName")
1106
+ }
1107
+ )
1108
+ }
1109
+ ),
1110
+ /* @__PURE__ */ n(
1111
+ Je,
1112
+ {
1113
+ label: b("booking.details.lastName.label"),
1114
+ required: !0,
1115
+ error: te.lastName,
1116
+ announceError: le("lastName"),
1117
+ children: /* @__PURE__ */ n(
1118
+ Yt,
1119
+ {
1120
+ autoComplete: "family-name",
1121
+ value: e.lastName ?? "",
1122
+ onChange: (l) => Z({ lastName: l.target.value }),
1123
+ onBlur: () => se("lastName")
1124
+ }
1125
+ )
1126
+ }
1127
+ )
1128
+ ] }),
1129
+ /* @__PURE__ */ y(
1130
+ "div",
1131
+ {
1132
+ className: `ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-sm)]${i ? "" : " ds:sm:grid-cols-2"}`,
1133
+ children: [
1134
+ !i && /* @__PURE__ */ n(
1135
+ Je,
1136
+ {
1137
+ label: b("booking.details.email.label"),
1138
+ ...dt ? { required: !0 } : { optional: !0 },
1139
+ error: te.email,
1140
+ announceError: le("email"),
1141
+ children: /* @__PURE__ */ n(
1142
+ xr,
1143
+ {
1144
+ disableBuiltInValidation: s,
1145
+ value: e.email ?? "",
1146
+ onChange: (l) => Z({ email: l.target.value }),
1147
+ onBlur: () => se("email")
1148
+ }
1149
+ )
1150
+ }
1151
+ ),
1152
+ /* @__PURE__ */ n(
1153
+ Je,
1154
+ {
1155
+ label: b("booking.details.mobilePhone.label"),
1156
+ required: !0,
1157
+ error: te.mobilePhone,
1158
+ announceError: le("mobilePhone"),
1159
+ children: /* @__PURE__ */ n(
1160
+ Ir,
1161
+ {
1162
+ value: e.mobilePhone ?? "",
1163
+ defaultCountry: $ == null ? void 0 : $.toUpperCase(),
1164
+ onChange: (l) => {
1165
+ Z({ mobilePhone: l });
1166
+ },
1167
+ onBlur: () => se("mobilePhone")
1168
+ }
1169
+ )
1170
+ }
1171
+ )
1172
+ ]
1173
+ }
1174
+ ),
1175
+ pe && !Ee || o ? /* @__PURE__ */ y("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-sm)] ds:sm:grid-cols-2", children: [
1176
+ pe && !Ee ? Et : null,
1177
+ o ? /* @__PURE__ */ n(
1178
+ Je,
1179
+ {
1180
+ label: b("booking.details.dateOfBirth.label"),
1181
+ required: !0,
1182
+ error: te.dateOfBirth,
1183
+ announceError: le("dateOfBirth"),
1184
+ children: /* @__PURE__ */ n(
1185
+ Sr,
1186
+ {
1187
+ value: e.dateOfBirth ? new Date(e.dateOfBirth) : void 0,
1188
+ onChange: (l) => {
1189
+ Z({
1190
+ dateOfBirth: l ? l.toISOString().slice(0, 10) : void 0
1191
+ }), se("dateOfBirth");
1192
+ }
1193
+ }
1194
+ )
1195
+ }
1196
+ ) : null
1197
+ ] }) : null,
1198
+ $e ? /* @__PURE__ */ n(
1199
+ Je,
1200
+ {
1201
+ label: b("booking.details.insuranceNumber.label"),
1202
+ required: !0,
1203
+ description: De.state === "pending" ? b("booking.details.insuranceNumber.checking") : void 0,
1204
+ error: te.insuranceNumber,
1205
+ announceError: le("insuranceNumber"),
1206
+ children: /* @__PURE__ */ n(
1207
+ Yt,
1208
+ {
1209
+ value: e.insuranceNumber ?? "",
1210
+ onChange: (l) => Z({ insuranceNumber: l.target.value }),
1211
+ onBlur: () => se("insuranceNumber")
1212
+ }
1213
+ )
1214
+ }
1215
+ ) : null,
1216
+ Ee ? /* @__PURE__ */ y(
1217
+ "div",
1218
+ {
1219
+ ref: bt,
1220
+ "data-component": "booking-billing",
1221
+ role: "group",
1222
+ "aria-labelledby": `${ne}-billing-heading`,
1223
+ "aria-describedby": `${ne}-billing-intro`,
1224
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:rounded-[var(--radius-md)] ds:border ds:border-[var(--border)] ds:p-[var(--spacing-sm)]",
1225
+ onBlur: (l) => {
1226
+ var ie;
1227
+ const D = (ie = l.target.closest("[data-address-field]")) == null ? void 0 : ie.getAttribute("data-address-field");
1228
+ (D === "street" || D === "city" || D === "postcode") && se(X[D]);
1229
+ },
1230
+ children: [
1231
+ /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
1232
+ /* @__PURE__ */ n(
1233
+ "h3",
1234
+ {
1235
+ id: `${ne}-billing-heading`,
1236
+ className: "type-label ds:m-0 ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)]",
1237
+ children: b("booking.details.billing.heading")
1238
+ }
1239
+ ),
1240
+ /* @__PURE__ */ n(
1241
+ "p",
1242
+ {
1243
+ id: `${ne}-billing-intro`,
1244
+ className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]",
1245
+ children: b("booking.details.billing.intro")
1246
+ }
1247
+ )
1248
+ ] }),
1249
+ pe ? Et : null,
1250
+ /* @__PURE__ */ n(
1251
+ wr,
1252
+ {
1253
+ value: ct,
1254
+ onChange: (l) => {
1255
+ var D;
1256
+ return (
1257
+ // The name is set from the patient's own on submit.
1258
+ Z({
1259
+ billing: Vs(
1260
+ l,
1261
+ "",
1262
+ // A second line belongs to its street: it goes when the
1263
+ // patient writes another, and returns with the first.
1264
+ l.street.trim() === ((D = Xe.current) == null ? void 0 : D.street) ? Xe.current.line2 : null
1265
+ )
1266
+ })
1267
+ );
1268
+ },
1269
+ popularCountries: qs,
1270
+ layout: "grid",
1271
+ fields: je ? void 0 : ["street", "city", "postcode"],
1272
+ required: je ? ["country", "street", "city", "postcode", "province"] : ["country", "street", "city", "postcode"],
1273
+ errors: {
1274
+ country: te[X.country],
1275
+ street: te[X.street],
1276
+ city: te[X.city],
1277
+ postcode: te[X.postcode],
1278
+ province: te[X.province]
1279
+ },
1280
+ announceErrors: {
1281
+ country: le(X.country),
1282
+ street: le(X.street),
1283
+ city: le(X.city),
1284
+ postcode: le(X.postcode),
1285
+ province: le(X.province)
1286
+ }
1287
+ }
1288
+ )
1289
+ ]
1290
+ }
1291
+ ) : null,
1292
+ p ? /* @__PURE__ */ n(
1293
+ Je,
1294
+ {
1295
+ label: b("booking.details.note.label"),
1296
+ optional: !0,
1297
+ description: b("booking.details.note.helper", {
1298
+ max: Fn
1299
+ }),
1300
+ children: /* @__PURE__ */ n(
1301
+ Nr,
1302
+ {
1303
+ value: e.note ?? "",
1304
+ maxLength: Fn,
1305
+ rows: 3,
1306
+ onChange: (l) => Z({ note: l.target.value })
1307
+ }
1308
+ )
1309
+ }
1310
+ ) : null,
1311
+ f ? /* @__PURE__ */ n(
1312
+ wt,
1313
+ {
1314
+ checked: !!e.returningPatient,
1315
+ onCheckedChange: (l) => Z({ returningPatient: l === !0 }),
1316
+ label: b("booking.details.returningPatient.label")
1317
+ }
1318
+ ) : null,
1319
+ Qe !== void 0 ? /* @__PURE__ */ y(
1320
+ "div",
1321
+ {
1322
+ "data-component": "booking-critical-information",
1323
+ role: "group",
1324
+ "aria-labelledby": `${ne}-critical-information-heading`,
1325
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:rounded-[var(--radius-md)] ds:border ds:border-[var(--border)] ds:bg-[var(--muted)] ds:p-[var(--spacing-sm)]",
1326
+ children: [
1327
+ /* @__PURE__ */ n(
1328
+ "h3",
1329
+ {
1330
+ id: `${ne}-critical-information-heading`,
1331
+ className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0",
1332
+ children: b("booking.details.criticalInformation.heading")
1333
+ }
1334
+ ),
1335
+ /* @__PURE__ */ n(
1336
+ "p",
1337
+ {
1338
+ dir: "auto",
1339
+ className: "type-body-sm ds:m-0 ds:whitespace-pre-wrap ds:break-words ds:text-[var(--foreground)]",
1340
+ children: _s(Qe).map(
1341
+ (l, D) => l.kind === "link" ? /* @__PURE__ */ n(
1342
+ "a",
1343
+ {
1344
+ href: l.href,
1345
+ target: "_blank",
1346
+ rel: "noopener noreferrer",
1347
+ dir: "ltr",
1348
+ className: mn,
1349
+ children: l.text
1350
+ },
1351
+ D
1352
+ ) : /* @__PURE__ */ n(gr, { children: l.text }, D)
1353
+ )
1354
+ }
1355
+ ),
1356
+ /* @__PURE__ */ n(
1357
+ wt,
1358
+ {
1359
+ checked: !!e.criticalInformationAccepted,
1360
+ onCheckedChange: (l) => Z({ criticalInformationAccepted: l === !0 }),
1361
+ "aria-required": !0,
1362
+ label: /* @__PURE__ */ y(me, { children: [
1363
+ b("booking.details.criticalInformation.accept"),
1364
+ /* @__PURE__ */ n(
1365
+ "span",
1366
+ {
1367
+ "aria-hidden": "true",
1368
+ className: "ds:text-[var(--destructive)] ds:ms-[var(--spacing-2xs)]",
1369
+ children: "*"
1370
+ }
1371
+ )
1372
+ ] })
1373
+ }
1374
+ )
1375
+ ]
1376
+ }
1377
+ ) : null,
1378
+ h ? /* @__PURE__ */ y(
1379
+ "div",
1380
+ {
1381
+ "data-component": "booking-payment-notice",
1382
+ role: "group",
1383
+ "aria-labelledby": `${ne}-payment-heading`,
1384
+ "data-notice-style": w,
1385
+ className: $s({
1386
+ noticeStyle: w
1387
+ }),
1388
+ children: [
1389
+ w === "highlighted" ? /* @__PURE__ */ y("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
1390
+ /* @__PURE__ */ n("span", { className: "ds:flex ds:size-9 ds:shrink-0 ds:items-center ds:justify-center ds:rounded-full ds:bg-[var(--primary)] ds:text-[var(--primary-foreground)]", children: /* @__PURE__ */ n(Cr, { "aria-hidden": "true", className: "ds:size-5" }) }),
1391
+ /* @__PURE__ */ n(
1392
+ "h3",
1393
+ {
1394
+ id: `${ne}-payment-heading`,
1395
+ className: "type-title-item ds:m-0 ds:flex-1",
1396
+ children: b("booking.payment.noticeTitle")
1397
+ }
1398
+ ),
1399
+ /* @__PURE__ */ n(
1400
+ "span",
1401
+ {
1402
+ "aria-hidden": "true",
1403
+ className: "type-title-card ds:shrink-0 ds:text-[var(--foreground)]",
1404
+ children: ht
1405
+ }
1406
+ )
1407
+ ] }) : /* @__PURE__ */ n(
1408
+ "h3",
1409
+ {
1410
+ id: `${ne}-payment-heading`,
1411
+ className: "type-label ds:m-0",
1412
+ children: b("booking.payment.noticeTitle")
1413
+ }
1414
+ ),
1415
+ /* @__PURE__ */ n("p", { className: "type-body-sm ds:m-0", children: b("booking.payment.noticeBody", { amount: ht }) }),
1416
+ Se ? /* @__PURE__ */ n(
1417
+ "a",
1418
+ {
1419
+ href: Se,
1420
+ target: "_blank",
1421
+ rel: "noopener noreferrer",
1422
+ className: "type-body-sm ds:inline-flex ds:items-center ds:self-start ds:min-h-[var(--min-target-size)] ds:rounded-[var(--radius-sm)] ds:underline ds:text-[var(--foreground)] ds:focus-visible:outline-solid ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
1423
+ children: b("booking.payment.terms")
1424
+ }
1425
+ ) : null,
1426
+ /* @__PURE__ */ n(
1427
+ wt,
1428
+ {
1429
+ checked: Ze,
1430
+ onCheckedChange: (l) => {
1431
+ Tt(
1432
+ l === !0 ? Ke : void 0
1433
+ ), Z({ paymentAccepted: l === !0 });
1434
+ },
1435
+ "aria-required": !0,
1436
+ label: /* @__PURE__ */ y(me, { children: [
1437
+ b("booking.payment.accept", { amount: ht }),
1438
+ /* @__PURE__ */ n(
1439
+ "span",
1440
+ {
1441
+ "aria-hidden": "true",
1442
+ className: "ds:text-[var(--destructive)] ds:ms-[var(--spacing-2xs)]",
1443
+ children: "*"
1444
+ }
1445
+ )
1446
+ ] })
1447
+ }
1448
+ )
1449
+ ]
1450
+ }
1451
+ ) : null,
1452
+ /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
1453
+ /* @__PURE__ */ n(
1454
+ wt,
1455
+ {
1456
+ checked: !!e.privacyConsent,
1457
+ onCheckedChange: (l) => Z({ privacyConsent: l === !0 }),
1458
+ "aria-required": !0,
1459
+ label: /* @__PURE__ */ y(me, { children: [
1460
+ Gt(
1461
+ "booking.details.consent.privacy.label",
1462
+ S
1463
+ ),
1464
+ /* @__PURE__ */ n(
1465
+ "span",
1466
+ {
1467
+ "aria-hidden": "true",
1468
+ className: "ds:text-[var(--destructive)] ds:ms-[var(--spacing-2xs)]",
1469
+ children: "*"
1470
+ }
1471
+ )
1472
+ ] })
1473
+ }
1474
+ ),
1475
+ /* @__PURE__ */ n(
1476
+ wt,
1477
+ {
1478
+ checked: !!e.termsConsent,
1479
+ onCheckedChange: (l) => Z({ termsConsent: l === !0 }),
1480
+ "aria-required": !0,
1481
+ label: /* @__PURE__ */ y(me, { children: [
1482
+ Gt(
1483
+ "booking.details.consent.terms.label",
1484
+ g
1485
+ ),
1486
+ /* @__PURE__ */ n(
1487
+ "span",
1488
+ {
1489
+ "aria-hidden": "true",
1490
+ className: "ds:text-[var(--destructive)] ds:ms-[var(--spacing-2xs)]",
1491
+ children: "*"
1492
+ }
1493
+ )
1494
+ ] })
1495
+ }
1496
+ ),
1497
+ d && gt ? /* @__PURE__ */ n(
1498
+ wt,
1499
+ {
1500
+ checked: de,
1501
+ onCheckedChange: (l) => {
1502
+ $t(
1503
+ l === !0 ? we : void 0
1504
+ ), Z({ practiceConsentAccepted: l === !0 });
1505
+ },
1506
+ "aria-required": d.required || void 0,
1507
+ label: /* @__PURE__ */ y(me, { children: [
1508
+ Xt(d.url) ? /* @__PURE__ */ n(
1509
+ "a",
1510
+ {
1511
+ dir: "auto",
1512
+ href: Xt(d.url),
1513
+ target: "_blank",
1514
+ rel: "noopener noreferrer",
1515
+ className: mn,
1516
+ children: d.label
1517
+ }
1518
+ ) : /* @__PURE__ */ n("span", { dir: "auto", children: d.label }),
1519
+ d.required ? /* @__PURE__ */ n(
1520
+ "span",
1521
+ {
1522
+ "aria-hidden": "true",
1523
+ className: "ds:text-[var(--destructive)] ds:ms-[var(--spacing-2xs)]",
1524
+ children: "*"
1525
+ }
1526
+ ) : null
1527
+ ] })
1528
+ }
1529
+ ) : null
1530
+ ] }),
1531
+ ee ? /* @__PURE__ */ n(
1532
+ "div",
1533
+ {
1534
+ "data-component": "booking-confirmation-channels",
1535
+ "data-unanswered": St || void 0,
1536
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
1537
+ children: k ? /* @__PURE__ */ n(
1538
+ kr,
1539
+ {
1540
+ variant: "horizontal",
1541
+ label: b("booking.confirmation.heading"),
1542
+ value: Ue[0] ?? "",
1543
+ onValueChange: (l) => Z({
1544
+ confirmationChannels: [l]
1545
+ }),
1546
+ error: St ? b("booking.confirmation.atLeastOne") : void 0,
1547
+ children: Ce.map((l) => /* @__PURE__ */ n(
1548
+ yr,
1549
+ {
1550
+ value: l,
1551
+ label: b(`booking.confirmation.channel.${l}`)
1552
+ },
1553
+ l
1554
+ ))
1555
+ }
1556
+ ) : /* @__PURE__ */ n(
1557
+ br,
1558
+ {
1559
+ label: b("booking.confirmation.heading"),
1560
+ helperText: b("booking.confirmation.helper"),
1561
+ value: Ue,
1562
+ onChange: (l) => Z({
1563
+ confirmationChannels: l
1564
+ }),
1565
+ orientation: "vertical",
1566
+ options: Ce.map((l) => ({
1567
+ value: l,
1568
+ label: b(`booking.confirmation.channel.${l}`)
1569
+ })),
1570
+ error: St ? b("booking.confirmation.atLeastOne") : void 0
1571
+ }
1572
+ )
1573
+ }
1574
+ ) : null,
1575
+ !F && (L || he || u) ? /* @__PURE__ */ n(re, { variant: "error", children: /* @__PURE__ */ n(re.Description, { children: L ?? b(
1576
+ u ? "booking.payment.unavailable" : "booking.payment.submitFailed"
1577
+ ) }) }) : null,
1578
+ F ? null : /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
1579
+ Rt ? /* @__PURE__ */ n(
1580
+ "p",
1581
+ {
1582
+ id: Ot,
1583
+ "data-slot": "submit-hint",
1584
+ className: "type-body-sm ds:m-0 ds:text-[var(--muted-foreground)]",
1585
+ children: b("booking.details.submitHint")
1586
+ }
1587
+ ) : null,
1588
+ /* @__PURE__ */ n(
1589
+ Re,
1590
+ {
1591
+ intent: "primary",
1592
+ size: "md",
1593
+ type: "submit",
1594
+ disabled: be || u,
1595
+ "aria-disabled": !lt || void 0,
1596
+ "aria-describedby": Rt ? Ot : void 0,
1597
+ startIcon: be ? /* @__PURE__ */ n(qn, { variant: "pulse", size: "sm" }) : void 0,
1598
+ children: h ? b("booking.payment.submit", { amount: ht }) : b("booking.details.submit")
1599
+ }
1600
+ )
1601
+ ] })
1602
+ ]
1603
+ }
1604
+ );
1605
+ }
1606
+ );
1607
+ xn.displayName = "BookingDetailsForm";
1608
+ const Bt = [
1609
+ "ds:focus-visible:outline-[length:var(--focus-ring-width)]",
1610
+ "ds:focus-visible:outline-solid",
1611
+ "ds:focus-visible:outline-[var(--ring)]",
1612
+ "ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
1613
+ "ds:forced-colors:focus-visible:outline-[CanvasText]"
1614
+ ].join(" ");
1615
+ function vn(e) {
1616
+ if (typeof window > "u") return !1;
1617
+ if (typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches)
1618
+ return !0;
1619
+ if (!e) return !1;
1620
+ if (e.closest(".theme-accessible")) return !0;
1621
+ const t = getComputedStyle(e).getPropertyValue(
1622
+ "--animation-duration"
1623
+ );
1624
+ return t.trim() !== "" && parseFloat(t) === 0;
1625
+ }
1626
+ function tr(e, t) {
1627
+ if (!e || typeof e.scrollIntoView != "function") return !1;
1628
+ const r = getComputedStyle(e), i = getComputedStyle(document.documentElement), s = (parseFloat(r.scrollMarginTop) || 0) + (parseFloat(i.scrollPaddingTop) || 0), a = (parseFloat(r.scrollMarginBottom) || 0) + (parseFloat(i.scrollPaddingBottom) || 0), o = e.getBoundingClientRect();
1629
+ if (o.top >= s && o.bottom <= window.innerHeight - a) return !1;
1630
+ try {
1631
+ e.scrollIntoView({
1632
+ behavior: vn(e) ? "auto" : "smooth",
1633
+ block: t
1634
+ });
1635
+ } catch {
1636
+ e.scrollIntoView();
1637
+ }
1638
+ return !0;
1639
+ }
1640
+ function Us(e, t = 1e3) {
1641
+ let r = !1;
1642
+ const i = () => {
1643
+ r || (r = !0, window.removeEventListener("scrollend", i), clearTimeout(s), e());
1644
+ }, s = setTimeout(i, t);
1645
+ return window.addEventListener("scrollend", i), () => {
1646
+ r = !0, window.removeEventListener("scrollend", i), clearTimeout(s);
1647
+ };
1648
+ }
1649
+ function In({
1650
+ error: e,
1651
+ loading: t,
1652
+ onRetry: r,
1653
+ label: i,
1654
+ children: s
1655
+ }) {
1656
+ const { t: a } = Q("ui"), o = A(null), c = A(!1), m = A(!1);
1657
+ return V(() => {
1658
+ const p = m.current && !t;
1659
+ if (m.current = !!t, !c.current || !p) return;
1660
+ c.current = !1;
1661
+ const f = o.current;
1662
+ if (!f || document.activeElement !== f) return;
1663
+ const S = f.querySelector(
1664
+ e ? "[data-slot-retry]" : '[data-slot-id]:not(:disabled), [role="gridcell"]:not(:disabled)'
1665
+ );
1666
+ S == null || S.focus({ preventScroll: !0 });
1667
+ }, [e, t]), !e && !t && !r ? /* @__PURE__ */ n("div", { children: s }) : /* @__PURE__ */ n(
1668
+ "div",
1669
+ {
1670
+ ref: o,
1671
+ "data-component": "booking-slot-load-state",
1672
+ role: "group",
1673
+ tabIndex: -1,
1674
+ "aria-label": a(i === "date" ? "booking.date.heading" : "booking.slot.heading"),
1675
+ "aria-busy": t || void 0,
1676
+ "data-slot-load-state": t ? "loading" : e ? "error" : "ready",
1677
+ className: Bt,
1678
+ children: e && !t ? /* @__PURE__ */ y(re, { variant: "error", children: [
1679
+ /* @__PURE__ */ n(re.Description, { children: a("booking.slotsLoadError") }),
1680
+ r ? /* @__PURE__ */ n(re.Action, { children: /* @__PURE__ */ n(
1681
+ Re,
1682
+ {
1683
+ type: "button",
1684
+ "data-slot-retry": "",
1685
+ className: "ds:min-h-[var(--min-target-size)]",
1686
+ onClick: () => {
1687
+ var p;
1688
+ c.current = !0, (p = o.current) == null || p.focus({ preventScroll: !0 }), r();
1689
+ },
1690
+ children: a("booking.retrySlots")
1691
+ }
1692
+ ) }) : null
1693
+ ] }) : s
1694
+ }
1695
+ );
1696
+ }
1697
+ function Hs({
1698
+ length: e = 5,
1699
+ onVerify: t,
1700
+ onResend: r,
1701
+ resendSeconds: i = 60,
1702
+ phoneHint: s,
1703
+ onVerified: a,
1704
+ onBusyChange: o
1705
+ }) {
1706
+ const { t: c, i18n: m } = Q("ui"), p = pt(), f = pt(), S = A(null), g = A(null), d = A(null), h = A(null), v = A(!1), u = A(!1), [M, w] = J(null), [C, I] = J(!1), [O, B] = J(null), [F, R] = J(
1707
+ null
1708
+ ), [$, j] = J(0), T = Number.isFinite(i) ? Math.max(0, Math.ceil(i)) : 60, [k, L] = J(
1709
+ () => Date.now() + T * 1e3
1710
+ ), [E, b] = J(T), W = O === "too-many-attempts";
1711
+ V(() => {
1712
+ o == null || o(!!M);
1713
+ }, [M, o]), V(() => (v.current = !0, () => {
1714
+ v.current = !1;
1715
+ }), []), V(() => {
1716
+ var N;
1717
+ (N = d.current) == null || N.focus({ preventScroll: !0 }), tr(g.current, "center");
1718
+ }, [$]), V(() => {
1719
+ var Y, U;
1720
+ if (M || !W && F !== "resend") return;
1721
+ const N = document.activeElement, q = (Y = S.current) == null ? void 0 : Y.closest("section");
1722
+ N && N !== document.body && !(q != null && q.contains(N)) || (h.current && !h.current.disabled ? h.current.focus() : (U = S.current) == null || U.focus());
1723
+ }, [M, W, F]), V(() => {
1724
+ if (E === 0) return;
1725
+ const N = setTimeout(() => {
1726
+ b(Math.max(0, Math.ceil((k - Date.now()) / 1e3)));
1727
+ }, 1e3);
1728
+ return () => clearTimeout(N);
1729
+ }, [k, E]);
1730
+ const ne = async (N) => {
1731
+ if (!(u.current || W)) {
1732
+ u.current = !0, w("verify"), I(!1), B(null), R(null);
1733
+ try {
1734
+ const q = await t(N);
1735
+ if (!v.current) return;
1736
+ q.ok ? a(q.redirectUrl) : (B(q.reason), q.reason !== "too-many-attempts" && j((Y) => Y + 1));
1737
+ } catch {
1738
+ if (!v.current) return;
1739
+ R("verify"), j((q) => q + 1);
1740
+ } finally {
1741
+ u.current = !1, v.current && w(null);
1742
+ }
1743
+ }
1744
+ }, Ne = async () => {
1745
+ if (!(u.current || Date.now() < k)) {
1746
+ u.current = !0, w("resend"), I(!1), R(null);
1747
+ try {
1748
+ if (await r(), !v.current) return;
1749
+ L(Date.now() + T * 1e3), b(T), B(null), I(!0), j((N) => N + 1);
1750
+ } catch {
1751
+ v.current && R("resend");
1752
+ } finally {
1753
+ u.current = !1, v.current && w(null);
1754
+ }
1755
+ }
1756
+ }, ge = O === "wrong" ? c("booking.code.wrong") : O === "expired" ? c("booking.code.expired") : W ? c("booking.code.tooManyAttempts") : void 0;
1757
+ return /* @__PURE__ */ n(Tr, { variant: "elevated", asChild: !0, children: /* @__PURE__ */ y(
1758
+ "section",
1759
+ {
1760
+ ref: g,
1761
+ "aria-labelledby": p,
1762
+ "data-component": "booking-code-step",
1763
+ className: "ds:items-center ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)] ds:text-center",
1764
+ children: [
1765
+ /* @__PURE__ */ n(
1766
+ "h3",
1767
+ {
1768
+ ref: S,
1769
+ id: p,
1770
+ tabIndex: -1,
1771
+ className: `type-title-card ds:m-0 ${Bt}`,
1772
+ children: c("booking.code.heading")
1773
+ }
1774
+ ),
1775
+ /* @__PURE__ */ n("p", { id: f, className: "type-body ds:m-0", children: s ? /* @__PURE__ */ n(
1776
+ $n,
1777
+ {
1778
+ t: c,
1779
+ ns: "ui",
1780
+ i18nKey: "booking.code.instructionWithPhone",
1781
+ values: { phone: s },
1782
+ components: { phone: /* @__PURE__ */ n("bdi", {}) }
1783
+ }
1784
+ ) : c("booking.code.instruction") }),
1785
+ /* @__PURE__ */ n(Je, { label: c("booking.code.label"), error: ge, children: /* @__PURE__ */ n("div", { dir: "ltr", children: /* @__PURE__ */ n(
1786
+ Ar,
1787
+ {
1788
+ ref: d,
1789
+ length: e,
1790
+ mode: "alphanumeric",
1791
+ "aria-describedby": f,
1792
+ disabled: !!M || W,
1793
+ onComplete: ne
1794
+ },
1795
+ $
1796
+ ) }) }),
1797
+ F ? /* @__PURE__ */ n(re, { variant: "error", className: "ds:self-stretch ds:text-start", children: /* @__PURE__ */ n(re.Description, { children: c(F === "verify" ? "booking.code.verifyFailed" : "booking.code.resendFailed") }) }) : null,
1798
+ /* @__PURE__ */ n("p", { role: "status", className: "type-body ds:m-0", children: M === "verify" ? c("booking.code.verifying") : C ? c("booking.code.resent") : null }),
1799
+ /* @__PURE__ */ n(
1800
+ Re,
1801
+ {
1802
+ ref: h,
1803
+ type: "button",
1804
+ intent: "secondary",
1805
+ disabled: E > 0 || !!M,
1806
+ loading: M === "resend",
1807
+ onClick: Ne,
1808
+ children: E > 0 ? c("booking.code.resendCountdown", {
1809
+ seconds: new Intl.NumberFormat(m.language).format(
1810
+ E
1811
+ )
1812
+ }) : c("booking.code.resend")
1813
+ }
1814
+ )
1815
+ ]
1816
+ }
1817
+ ) });
1818
+ }
1819
+ function nr(e) {
1820
+ const t = e.payment;
1821
+ if (!t) return;
1822
+ const r = (t.currencyCode ?? "EUR").toUpperCase();
1823
+ if (!(!Number.isSafeInteger(t.amountCents) || t.amountCents <= 0 || !["full", "deposit"].includes(t.kind) || !/^[A-Z]{3}$/.test(r)))
1824
+ return {
1825
+ serviceId: e.id,
1826
+ kind: t.kind,
1827
+ amountCents: t.amountCents,
1828
+ currencyCode: r
1829
+ };
1830
+ }
1831
+ function Gs(e) {
1832
+ var s;
1833
+ const t = (s = e.priceLabel) != null && s.trim() ? e.priceLabel : void 0, r = t ? { label: t } : void 0;
1834
+ if (!e.payment) return { price: r };
1835
+ const i = nr(e);
1836
+ return i ? {
1837
+ price: r ?? (i.kind === "full" ? { amount: i } : void 0),
1838
+ payment: i
1839
+ } : { price: r, payment: "unavailable" };
1840
+ }
1841
+ function Js(e, t, r) {
1842
+ const i = e.filter(
1843
+ (a) => t.includes(a.id)
1844
+ ), s = (r == null ? void 0 : r.serviceId) ?? (t.length === 1 ? t[0] : void 0);
1845
+ if (s) {
1846
+ const a = i.find((c) => c.id === s);
1847
+ if (!a) return { blocked: !0 };
1848
+ const o = nr(a);
1849
+ return { payment: o, blocked: !!(a.payment && !o) };
1850
+ }
1851
+ return { blocked: i.some((a) => !!a.payment) };
1852
+ }
1853
+ function en(e) {
1854
+ return e ? JSON.stringify([
1855
+ e.serviceId,
1856
+ e.kind,
1857
+ e.amountCents,
1858
+ e.currencyCode
1859
+ ]) : "";
1860
+ }
1861
+ function Ws({
1862
+ services: e,
1863
+ value: t,
1864
+ availableSlots: r,
1865
+ onSubmit: i,
1866
+ onChange: s,
1867
+ paymentState: a,
1868
+ submitting: o,
1869
+ paymentTermsUrl: c,
1870
+ renderPayment: m,
1871
+ codeStep: p
1872
+ }) {
1873
+ var ge, N, q;
1874
+ const f = JSON.stringify([
1875
+ t.insuranceType,
1876
+ t.specialtyId,
1877
+ t.specialtyIds,
1878
+ Ye(t),
1879
+ t.operatorId,
1880
+ t.operatorIds,
1881
+ t.date,
1882
+ t.slotKey
1883
+ ]), S = A(
1884
+ void 0
1885
+ ), d = (t.date ? (ge = r[t.date]) == null ? void 0 : ge.find((Y) => Y.key === t.slotKey) : void 0) ?? (((N = S.current) == null ? void 0 : N.selection) === f ? S.current.slot : void 0), h = Js(
1886
+ e,
1887
+ Ye(t),
1888
+ d
1889
+ ), v = h.blocked || !!(h.payment && !m), u = JSON.stringify([
1890
+ f,
1891
+ d == null ? void 0 : d.serviceId,
1892
+ en(h.payment),
1893
+ c,
1894
+ v
1895
+ ]), M = h.payment ? JSON.stringify([en(h.payment), c]) : "", w = A(void 0), C = !!((q = t.details) != null && q.paymentAccepted);
1896
+ V(() => {
1897
+ if (!C) w.current = void 0;
1898
+ else if (M) w.current === void 0 ? w.current = M : w.current !== M && (w.current = void 0, s({
1899
+ ...t,
1900
+ details: { ...t.details, paymentAccepted: !1 }
1901
+ }));
1902
+ else return;
1903
+ }, [C, M, s, t]);
1904
+ const I = A(u);
1905
+ I.current = u;
1906
+ const [O, B] = J({ status: "idle" }), F = A(0), R = A(!1), $ = A(!0), j = A(!1), T = A(void 0), k = A(u);
1907
+ V(() => ($.current = !0, () => {
1908
+ $.current = !1, F.current += 1;
1909
+ }), []);
1910
+ const L = O.status === "payment" || O.status === "code" || O.status === "success";
1911
+ V(() => {
1912
+ k.current === u || j.current || L || (k.current = u, F.current += 1, R.current = !1, B({ status: "idle" }));
1913
+ }, [u, L]);
1914
+ const E = L || k.current === u ? O.session : void 0, b = K(
1915
+ () => E && (a == null ? void 0 : a.sessionId) === E.id ? a : E ? { sessionId: E.id, status: "ready" } : void 0,
1916
+ [E, a]
1917
+ );
1918
+ E && b && "phase" in b && b.phase === "completion" && (T.current = E.id);
1919
+ const W = K(
1920
+ () => E && T.current === E.id && b && b.status !== "paid" && (!("phase" in b) || b.phase !== "completion") ? {
1921
+ sessionId: E.id,
1922
+ status: "processing",
1923
+ phase: "completion"
1924
+ } : b,
1925
+ [E, b]
1926
+ );
1927
+ V(() => {
1928
+ if (!(!E || !W || j.current))
1929
+ if (W.status === "paid") {
1930
+ if (O.status !== "payment") return;
1931
+ j.current = !0, B((Y) => ({
1932
+ ...Y,
1933
+ status: "success",
1934
+ redirectUrl: W.redirectUrl
1935
+ }));
1936
+ } else W.status === "cancelled" && (F.current += 1, R.current = !1, S.current = void 0, s({
1937
+ ...t,
1938
+ details: { ...t.details, paymentAccepted: !1 }
1939
+ }), B({ status: "idle", cancelled: !0 }));
1940
+ }, [E, W, s, t, O.status]);
1941
+ const ne = () => {
1942
+ F.current += 1, R.current = !1, j.current = !1, T.current = void 0, S.current = void 0, k.current = I.current, B({ status: "idle" });
1943
+ }, Ne = async (Y) => {
1944
+ var ye, Oe, De, ke, oe;
1945
+ if (!(d != null && d.available) || v || o || R.current || O.status === "payment" || O.status === "code" || j.current || h.payment && !Y.paymentAccepted) return;
1946
+ R.current = !0;
1947
+ const U = p ? { ...p } : void 0;
1948
+ S.current = { selection: f, slot: { ...d } };
1949
+ const ze = ++F.current, Be = u;
1950
+ k.current = Be;
1951
+ const he = {
1952
+ slot: { ...d, meta: d.meta ? { ...d.meta } : void 0 },
1953
+ value: {
1954
+ ...t,
1955
+ serviceIds: (ye = t.serviceIds) == null ? void 0 : ye.slice(),
1956
+ specialtyIds: (Oe = t.specialtyIds) == null ? void 0 : Oe.slice(),
1957
+ operatorIds: (De = t.operatorIds) == null ? void 0 : De.slice(),
1958
+ operatorId: Xn(t) ?? t.operatorId,
1959
+ details: { ...Y }
1960
+ },
1961
+ details: {
1962
+ ...Y,
1963
+ confirmationChannels: (ke = Y.confirmationChannels) == null ? void 0 : ke.slice()
1964
+ },
1965
+ ...h.payment ? { payment: { ...h.payment } } : {}
1966
+ }, ve = () => $.current && F.current === ze && I.current === Be;
1967
+ B({ status: "submitting" });
1968
+ let be = !1;
1969
+ try {
1970
+ const ae = await i(he);
1971
+ if (!ve()) return;
1972
+ if (he.payment) {
1973
+ const se = ae == null ? void 0 : ae.paymentSession;
1974
+ if (!((oe = se == null ? void 0 : se.id) != null && oe.trim()) || en(se.payment) !== en(he.payment)) {
1975
+ B({ status: "error" });
1976
+ return;
1977
+ }
1978
+ be = !0, B({
1979
+ status: U ? "code" : "payment",
1980
+ snapshot: he,
1981
+ session: { id: se.id, payment: { ...se.payment } },
1982
+ codeStep: U
1983
+ });
1984
+ } else ae != null && ae.paymentSession ? B({ status: "error" }) : (j.current = !0, B({
1985
+ status: U ? "code" : "success",
1986
+ snapshot: he,
1987
+ codeStep: U
1988
+ }));
1989
+ } catch {
1990
+ ve() && B({ status: "error" });
1991
+ } finally {
1992
+ ve() && !be && (R.current = !1);
1993
+ }
1994
+ };
1995
+ return {
1996
+ ...O,
1997
+ payment: h.payment,
1998
+ blocked: v,
1999
+ state: W,
2000
+ activeSession: E,
2001
+ submit: Ne,
2002
+ reset: ne,
2003
+ completeCode: (Y) => {
2004
+ B(
2005
+ (U) => U.status !== "code" ? U : U.session ? { ...U, status: "payment", codeVerified: !0 } : {
2006
+ ...U,
2007
+ status: "success",
2008
+ codeVerified: !0,
2009
+ redirectUrl: Y
2010
+ }
2011
+ );
2012
+ }
2013
+ };
2014
+ }
2015
+ const Ys = 5e3, Zs = "ds:[stroke-dasharray:1] ds:[stroke-dashoffset:1] ds:animate-[stepper-icon-draw_calc(var(--animation-duration)*3)_var(--ease-out)_forwards]", Xs = "ds:block ds:[block-size:100%] ds:rounded-full ds:bg-[var(--primary)] ds:animate-[reserved-bar-fill_linear_forwards] ds:[animation-duration:var(--handover-ms)]";
2016
+ function Qs({
2017
+ url: e,
2018
+ delayMs: t,
2019
+ onNavigate: r,
2020
+ date: i,
2021
+ time: s,
2022
+ details: a,
2023
+ shouldTakeFocus: o
2024
+ }) {
2025
+ const { t: c } = Q("ui"), m = A(null), p = A(null), f = A(void 0), S = pt(), g = A(null), [d, h] = J(!1), [v, u] = J(() => vn(null)), M = () => {
2026
+ clearTimeout(f.current);
2027
+ try {
2028
+ r ? r(e) : window.location.assign(e);
2029
+ } catch {
2030
+ }
2031
+ }, w = () => {
2032
+ var I;
2033
+ clearTimeout(f.current), h(!0), (I = g.current) == null || I.focus({ preventScroll: !0 });
2034
+ }, C = A(M);
2035
+ return C.current = M, _t(() => {
2036
+ u(vn(m.current));
2037
+ }, []), V(() => {
2038
+ const I = p.current;
2039
+ I && m.current && o(m.current) && I.focus({ preventScroll: !0 });
2040
+ }, []), V(() => (f.current = setTimeout(() => C.current(), t), () => clearTimeout(f.current)), [e, t]), /* @__PURE__ */ y(
2041
+ "div",
2042
+ {
2043
+ ref: m,
2044
+ "data-component": "booking-reserved",
2045
+ className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-md)] ds:text-center",
2046
+ children: [
2047
+ /* @__PURE__ */ n(
2048
+ "span",
2049
+ {
2050
+ "aria-hidden": "true",
2051
+ className: "ds:flex ds:size-[var(--spacing-2xl)] ds:items-center ds:justify-center ds:rounded-full ds:bg-[color-mix(in_srgb,var(--success)_10%,transparent)] ds:text-[var(--success)]",
2052
+ children: /* @__PURE__ */ n(
2053
+ "svg",
2054
+ {
2055
+ viewBox: "0 0 24 24",
2056
+ fill: "none",
2057
+ stroke: "currentColor",
2058
+ strokeWidth: "3",
2059
+ strokeLinecap: "round",
2060
+ strokeLinejoin: "round",
2061
+ className: "ds:size-[var(--spacing-lg)]",
2062
+ children: /* @__PURE__ */ n("path", { pathLength: "1", d: "M5 12l5 5L20 7", className: Zs })
2063
+ }
2064
+ )
2065
+ }
2066
+ ),
2067
+ /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
2068
+ /* @__PURE__ */ n(
2069
+ "h3",
2070
+ {
2071
+ ref: p,
2072
+ tabIndex: -1,
2073
+ "aria-describedby": S,
2074
+ className: "type-title-card ds:m-0 ds:outline-none",
2075
+ children: c("booking.reserved.heading")
2076
+ }
2077
+ ),
2078
+ /* @__PURE__ */ n("p", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: i ? c("booking.reserved.when", { date: i, time: s }) : s }),
2079
+ a ? /* @__PURE__ */ n("p", { className: "type-body ds:m-0 ds:text-[var(--muted-foreground)]", children: a }) : null
2080
+ ] }),
2081
+ /* @__PURE__ */ n("p", { id: S, role: "status", className: "type-body ds:m-0", children: c(d ? "booking.reserved.stayed" : "booking.reserved.redirecting") }),
2082
+ v || d || t > Ys ? null : (
2083
+ // Decorative: the sentence above already says a redirect is coming,
2084
+ // and a progressbar with no value to read would only add noise.
2085
+ /* @__PURE__ */ n(
2086
+ "div",
2087
+ {
2088
+ "aria-hidden": "true",
2089
+ "data-slot": "booking-reserved-bar",
2090
+ className: "ds:[block-size:var(--spacing-xs)] ds:[inline-size:100%] ds:[max-inline-size:calc(var(--spacing-2xl)*5)] ds:overflow-hidden ds:rounded-full ds:bg-[var(--secondary)]",
2091
+ children: /* @__PURE__ */ n(
2092
+ "span",
2093
+ {
2094
+ className: Xs,
2095
+ style: { "--handover-ms": `${t}ms` }
2096
+ }
2097
+ )
2098
+ }
2099
+ )
2100
+ ),
2101
+ /* @__PURE__ */ n(
2102
+ Re,
2103
+ {
2104
+ ref: g,
2105
+ type: "button",
2106
+ intent: "secondary",
2107
+ size: "lg",
2108
+ onClick: M,
2109
+ children: c("booking.reserved.goNow")
2110
+ }
2111
+ ),
2112
+ d ? null : /* @__PURE__ */ n(Re, { type: "button", intent: "ghost", size: "md", onClick: w, children: c("booking.reserved.stay") })
2113
+ ]
2114
+ }
2115
+ );
2116
+ }
2117
+ const ei = 3e3;
2118
+ function ti(e) {
2119
+ if (typeof e != "string") return;
2120
+ const t = e.trim();
2121
+ try {
2122
+ const { protocol: r } = new URL(t);
2123
+ return (r === "https:" || r === "http:") && Mr(t) ? t : void 0;
2124
+ } catch {
2125
+ return;
2126
+ }
2127
+ }
2128
+ const ni = 2 ** 31 - 1;
2129
+ function ri(e) {
2130
+ return typeof e == "number" && Number.isFinite(e) && e >= 0 ? Math.min(e, ni) : ei;
2131
+ }
2132
+ const si = Lt(
2133
+ // --booking-held-height: see the step-8 effects (runtime-measured height).
2134
+ "ds:flex ds:w-full ds:flex-col ds:text-[var(--foreground)] ds:[min-block-size:var(--booking-held-height,auto)]",
2135
+ {
2136
+ variants: {
2137
+ variant: {
2138
+ "inline-list": "ds:gap-[var(--spacing-md)]",
2139
+ accordion: "ds:gap-[var(--spacing-md)]",
2140
+ calendar: "ds:gap-[var(--spacing-md)]",
2141
+ flexible: "ds:gap-[var(--spacing-lg)]",
2142
+ progress: "ds:gap-[var(--spacing-sm)]"
2143
+ },
2144
+ // `surface="elevated"` matches `Card variant="elevated"` — same
2145
+ // tokens, same padding, same boundary behaviour — so consumers can
2146
+ // drop their own Card wraps without a double-card look. Default
2147
+ // `'flat'` preserves 0.30.x rendering.
2148
+ surface: {
2149
+ flat: "",
2150
+ elevated: [
2151
+ "ds:rounded-[var(--radius-lg)]",
2152
+ "ds:bg-[var(--card)] ds:text-[var(--card-foreground)]",
2153
+ "ds:border ds:border-[color:var(--card-border)]",
2154
+ "ds:shadow-[var(--shadow-card)]",
2155
+ "ds:p-[var(--spacing-md)]"
2156
+ ].join(" ")
2157
+ }
2158
+ },
2159
+ defaultVariants: { variant: "inline-list", surface: "flat" }
2160
+ }
2161
+ ), ii = [
2162
+ [
2163
+ /\b(estetic|aesthetic|botox|filler|mesoterap|chirurgia\s*plastic)/i,
2164
+ Dn
2165
+ ],
2166
+ [/\b(cardio|ecg|elettrocardio|ecocardio|cuore|heart)/i, zr],
2167
+ [/\b(dent|odonto|tooth|teeth|pulizia|igien|smile)/i, us],
2168
+ [/\b(oftalmo|ocul|ophthal|vision|occhi|eye)/i, Kr],
2169
+ [/\b(otorin|udito|orecchi|hearing|ear)/i, rs],
2170
+ [/\b(neuro|brain|cervello)/i, Qr],
2171
+ [/\b(pediatr|child|bambin)/i, jr],
2172
+ [/\b(ortop|ortho|osteo|skeleton|ossa|bone)/i, Zr],
2173
+ [/\b(lab|analis|test|sang|esami)/i, is],
2174
+ [/\b(farmaco|pharm|pillol|refill)/i, as],
2175
+ [/\b(chirurg|surg|intervent|operat)/i, ds],
2176
+ [/\b(scan|rx|x-?ray|raggi|imag|radio|risonan|ecograf|ultras)/i, Ur],
2177
+ [/\b(vacc|inject|inie|punto)/i, Dn],
2178
+ [/\b(derma|skin|pelle)/i, Hr],
2179
+ [/\b(prima\s*visit|first\s*visit|consult|consulto|valutaz)/i, Gr],
2180
+ [/\b(general|medicin|family|control|check[-\s]?up)/i, Wr]
2181
+ ];
2182
+ function oi(e) {
2183
+ for (const [t, r] of ii)
2184
+ if (t.test(e)) return r;
2185
+ return null;
2186
+ }
2187
+ function ai(e) {
2188
+ const t = oi(e.label) ?? Vr;
2189
+ return /* @__PURE__ */ n(t, { "aria-hidden": "true", className: "ds:size-5" });
2190
+ }
2191
+ function rr() {
2192
+ const { t: e, i18n: t } = Q("ui");
2193
+ return (r) => {
2194
+ const i = Gs(r), s = (o) => on(o.amountCents, o.currencyCode, t.language), a = i.price ? "label" in i.price ? i.price.label : s(i.price.amount) : void 0;
2195
+ return i.payment === "unavailable" ? {
2196
+ price: a,
2197
+ payment: e("booking.payment.unavailable"),
2198
+ paymentTone: "error"
2199
+ } : {
2200
+ price: a,
2201
+ payment: i.payment ? e(`booking.payment.${i.payment.kind}`, {
2202
+ amount: s(i.payment)
2203
+ }) : void 0,
2204
+ paymentTone: "default"
2205
+ };
2206
+ };
2207
+ }
2208
+ function mt(e) {
2209
+ return nn(e, "yyyy-MM-dd");
2210
+ }
2211
+ const ci = [
2212
+ "ds:relative ds:flex ds:items-center ds:justify-center",
2213
+ "ds:min-h-[var(--min-target-size)] ds:min-w-[var(--min-target-size)]",
2214
+ "ds:rounded-[var(--radius-sm)]",
2215
+ "ds:text-[length:var(--font-size-sm)]",
2216
+ "ds:transition-colors ds:duration-[var(--animation-duration)]",
2217
+ "ds:motion-reduce:transition-none",
2218
+ "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
2219
+ "ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
2220
+ "ds:forced-colors:focus-visible:outline-[CanvasText]"
2221
+ ].join(" "), di = Lt(ci, {
2222
+ variants: {
2223
+ state: {
2224
+ available: "ds:cursor-pointer ds:text-[var(--foreground)] ds:hover:bg-[var(--muted)]/30",
2225
+ unavailable: "ds:cursor-not-allowed ds:text-[var(--muted-foreground)]/60",
2226
+ selected: "ds:bg-[var(--primary)] ds:text-[var(--primary-foreground)] ds:font-[var(--font-weight-semibold)]",
2227
+ outside: "ds:text-[var(--muted-foreground)]/40"
2228
+ }
2229
+ },
2230
+ defaultVariants: { state: "unavailable" }
2231
+ });
2232
+ function li({
2233
+ availableDates: e,
2234
+ selectedDate: t,
2235
+ onSelectDate: r,
2236
+ locale: i,
2237
+ loading: s
2238
+ }) {
2239
+ const { t: a } = Q("ui"), o = K(() => t ? Ft(fe(t)) : e.length > 0 ? Ft(fe(e[0])) : Ft(/* @__PURE__ */ new Date()), [t, e]), [c, m] = J(o), [p, f] = J(null), S = K(() => {
2240
+ const w = Ft(c), C = _r(c), I = w.getDay(), O = C.getDate(), B = [];
2241
+ for (let F = I; F > 0; F -= 1) {
2242
+ const R = new Date(w);
2243
+ R.setDate(w.getDate() - F), B.push(R);
2244
+ }
2245
+ for (let F = 0; F < O; F += 1) {
2246
+ const R = new Date(w);
2247
+ R.setDate(w.getDate() + F), B.push(R);
2248
+ }
2249
+ for (; B.length < 42; ) {
2250
+ const F = B[B.length - 1], R = new Date(F);
2251
+ R.setDate(F.getDate() + 1), B.push(R);
2252
+ }
2253
+ return B;
2254
+ }, [c]), g = K(() => {
2255
+ try {
2256
+ return new Intl.DateTimeFormat(i, {
2257
+ month: "long",
2258
+ year: "numeric"
2259
+ }).format(c);
2260
+ } catch {
2261
+ return nn(c, "MMMM yyyy");
2262
+ }
2263
+ }, [c, i]), d = K(() => {
2264
+ const w = new Date(2024, 0, 7);
2265
+ return Array.from({ length: 7 }, (C, I) => {
2266
+ const O = new Date(w);
2267
+ O.setDate(w.getDate() + I);
2268
+ try {
2269
+ return new Intl.DateTimeFormat(i, { weekday: "short" }).format(O);
2270
+ } catch {
2271
+ return nn(O, "EEE");
2272
+ }
2273
+ });
2274
+ }, [i]), h = K(() => new Set(e), [e]), v = Me(
2275
+ (w) => h.has(mt(w)),
2276
+ [h]
2277
+ ), u = K(() => {
2278
+ if (p) return p;
2279
+ if (t) return fe(t);
2280
+ const w = S.find(
2281
+ (C) => Zt(C, c) && v(C)
2282
+ );
2283
+ return w || (S.find((C) => Zt(C, c)) ?? null);
2284
+ }, [p, t, S, c, v]), M = Me(
2285
+ (w, C) => {
2286
+ let I = null;
2287
+ switch (w.key) {
2288
+ case "ArrowLeft":
2289
+ I = new Date(C), I.setDate(C.getDate() - 1);
2290
+ break;
2291
+ case "ArrowRight":
2292
+ I = new Date(C), I.setDate(C.getDate() + 1);
2293
+ break;
2294
+ case "ArrowUp":
2295
+ I = new Date(C), I.setDate(C.getDate() - 7);
2296
+ break;
2297
+ case "ArrowDown":
2298
+ I = new Date(C), I.setDate(C.getDate() + 7);
2299
+ break;
2300
+ case "Home":
2301
+ I = new Date(C), I.setDate(C.getDate() - C.getDay());
2302
+ break;
2303
+ case "End":
2304
+ I = new Date(C), I.setDate(C.getDate() + (6 - C.getDay()));
2305
+ break;
2306
+ case "Enter":
2307
+ case " ": {
2308
+ w.preventDefault(), v(C) && r(mt(C));
2309
+ return;
2310
+ }
2311
+ default:
2312
+ return;
2313
+ }
2314
+ I && (w.preventDefault(), Zt(I, c) || m(Ft(I)), f(I));
2315
+ },
2316
+ [v, r, c]
2317
+ );
2318
+ return s ? /* @__PURE__ */ y(
2319
+ "div",
2320
+ {
2321
+ role: "status",
2322
+ "aria-live": "polite",
2323
+ "aria-label": a("common.loading"),
2324
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
2325
+ children: [
2326
+ /* @__PURE__ */ n(rn, { variant: "text", width: "40%" }),
2327
+ /* @__PURE__ */ n("div", { className: "ds:grid ds:grid-cols-7 ds:gap-[var(--spacing-2xs)]", children: Array.from({ length: 42 }, (w, C) => /* @__PURE__ */ n(rn, { variant: "rounded", height: "2.5rem" }, `mg-skel-${C}`)) })
2328
+ ]
2329
+ }
2330
+ ) : /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
2331
+ /* @__PURE__ */ y("div", { className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
2332
+ /* @__PURE__ */ n(
2333
+ Mn,
2334
+ {
2335
+ icon: /* @__PURE__ */ n($r, {}),
2336
+ "aria-label": a("booking.previousMonth"),
2337
+ size: "sm",
2338
+ intent: "ghost",
2339
+ flipIconInRtl: !0,
2340
+ onClick: () => {
2341
+ m((w) => gs(w)), f(null);
2342
+ }
2343
+ }
2344
+ ),
2345
+ /* @__PURE__ */ n(
2346
+ "span",
2347
+ {
2348
+ className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)]",
2349
+ "aria-live": "polite",
2350
+ children: g
2351
+ }
2352
+ ),
2353
+ /* @__PURE__ */ n(
2354
+ Mn,
2355
+ {
2356
+ icon: /* @__PURE__ */ n(qr, {}),
2357
+ "aria-label": a("booking.nextMonth"),
2358
+ size: "sm",
2359
+ intent: "ghost",
2360
+ flipIconInRtl: !0,
2361
+ onClick: () => {
2362
+ m((w) => Kn(w, 1)), f(null);
2363
+ }
2364
+ }
2365
+ )
2366
+ ] }),
2367
+ /* @__PURE__ */ y(
2368
+ "div",
2369
+ {
2370
+ role: "grid",
2371
+ "aria-label": a("booking.monthGridLabel"),
2372
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]",
2373
+ children: [
2374
+ /* @__PURE__ */ n(
2375
+ "div",
2376
+ {
2377
+ role: "row",
2378
+ className: "ds:grid ds:grid-cols-7 ds:gap-[var(--spacing-2xs)]",
2379
+ children: d.map((w, C) => /* @__PURE__ */ n(
2380
+ "div",
2381
+ {
2382
+ role: "columnheader",
2383
+ className: "type-meta ds:text-center ds:text-[var(--muted-foreground)] ds:font-[var(--font-weight-medium)]",
2384
+ children: w
2385
+ },
2386
+ `wd-${C}`
2387
+ ))
2388
+ }
2389
+ ),
2390
+ Array.from({ length: 6 }, (w, C) => /* @__PURE__ */ n(
2391
+ "div",
2392
+ {
2393
+ role: "row",
2394
+ className: "ds:grid ds:grid-cols-7 ds:gap-[var(--spacing-2xs)]",
2395
+ children: S.slice(C * 7, C * 7 + 7).map((I, O) => {
2396
+ const B = C * 7 + O, F = Zt(I, c), R = F && v(I), $ = t ? Rn(I, fe(t)) : !1, j = F ? $ ? "selected" : R ? "available" : "unavailable" : "outside", T = u ? Rn(u, I) : !1, k = (() => {
2397
+ try {
2398
+ return new Intl.DateTimeFormat(i, {
2399
+ dateStyle: "full"
2400
+ }).format(I);
2401
+ } catch {
2402
+ return nn(I, "PPP");
2403
+ }
2404
+ })();
2405
+ return /* @__PURE__ */ n(
2406
+ "button",
2407
+ {
2408
+ type: "button",
2409
+ role: "gridcell",
2410
+ "aria-label": k,
2411
+ "aria-selected": $ || void 0,
2412
+ "aria-disabled": !R || void 0,
2413
+ tabIndex: T ? 0 : -1,
2414
+ disabled: !R,
2415
+ onClick: () => {
2416
+ R && r(mt(I));
2417
+ },
2418
+ onKeyDown: (L) => M(L, I),
2419
+ className: di({ state: j }),
2420
+ children: /* @__PURE__ */ n("span", { "aria-hidden": "true", children: I.getDate() })
2421
+ },
2422
+ `mg-cell-${B}`
2423
+ );
2424
+ })
2425
+ },
2426
+ `mg-row-${C}`
2427
+ ))
2428
+ ]
2429
+ }
2430
+ )
2431
+ ] });
2432
+ }
2433
+ const ui = Lt(
2434
+ [
2435
+ "ds:relative ds:flex ds:w-full ds:items-center ds:gap-[var(--spacing-md)]",
2436
+ "ds:min-h-[var(--min-target-size)]",
2437
+ "ds:rounded-[var(--radius-md)]",
2438
+ "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
2439
+ "ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-sm)]",
2440
+ "ds:text-start",
2441
+ "ds:transition-[background-color,box-shadow]",
2442
+ "ds:duration-[var(--animation-duration)]",
2443
+ "ds:motion-reduce:transition-none",
2444
+ "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
2445
+ "ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
2446
+ "ds:forced-colors:[outline:1px_solid_CanvasText]",
2447
+ "ds:cursor-pointer"
2448
+ ].join(" "),
2449
+ {
2450
+ variants: {
2451
+ state: {
2452
+ idle: "ds:bg-[var(--card)] ds:shadow-[var(--shadow-sm)] ds:hover:shadow-[var(--shadow-md)]",
2453
+ selected: "ds:bg-[color-mix(in_srgb,var(--primary)_8%,var(--card))] ds:shadow-[var(--shadow-sm)]"
2454
+ }
2455
+ },
2456
+ defaultVariants: { state: "idle" }
2457
+ }
2458
+ );
2459
+ function mi({
2460
+ services: e,
2461
+ selectedServiceId: t,
2462
+ onSelect: r,
2463
+ showDuration: i
2464
+ }) {
2465
+ const { t: s } = Q("ui"), a = rr(), o = pt(), [c, m] = J(() => {
2466
+ if (t) {
2467
+ const g = e.findIndex((d) => d.id === t);
2468
+ if (g >= 0) return g;
2469
+ }
2470
+ return 0;
2471
+ }), p = A(/* @__PURE__ */ new Map()), f = Me((g) => {
2472
+ var d;
2473
+ (d = p.current.get(g)) == null || d.focus();
2474
+ }, []), S = Me(
2475
+ (g, d, h) => {
2476
+ const v = e.length;
2477
+ if (v !== 0)
2478
+ switch (g.key) {
2479
+ case "ArrowDown":
2480
+ case "ArrowRight": {
2481
+ g.preventDefault();
2482
+ const u = (d + 1) % v;
2483
+ m(u), f(u);
2484
+ break;
2485
+ }
2486
+ case "ArrowUp":
2487
+ case "ArrowLeft": {
2488
+ g.preventDefault();
2489
+ const u = (d - 1 + v) % v;
2490
+ m(u), f(u);
2491
+ break;
2492
+ }
2493
+ case "Home": {
2494
+ g.preventDefault(), m(0), f(0);
2495
+ break;
2496
+ }
2497
+ case "End": {
2498
+ g.preventDefault();
2499
+ const u = v - 1;
2500
+ m(u), f(u);
2501
+ break;
2502
+ }
2503
+ case "Enter":
2504
+ case " ": {
2505
+ g.preventDefault(), r(h);
2506
+ break;
2507
+ }
2508
+ }
2509
+ },
2510
+ [e.length, f, r]
2511
+ );
2512
+ return e.length === 0 ? null : /* @__PURE__ */ n(
2513
+ "div",
2514
+ {
2515
+ role: "radiogroup",
2516
+ "aria-label": s("booking.serviceListLabel"),
2517
+ id: o,
2518
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
2519
+ children: e.map((g, d) => {
2520
+ const h = t === g.id, v = c === d, { price: u, payment: M, paymentTone: w } = a(g), C = u ? M ? s("booking.serviceCardLabelPayment", {
2521
+ label: g.label,
2522
+ price: u,
2523
+ payment: M
2524
+ }) : s("booking.serviceCardLabelPrice", {
2525
+ label: g.label,
2526
+ price: u
2527
+ }) : M ? s("booking.serviceCardLabelPaymentNoPrice", {
2528
+ label: g.label,
2529
+ payment: M
2530
+ }) : i ? s("booking.serviceCardLabel", {
2531
+ label: g.label,
2532
+ duration: g.durationMin
2533
+ }) : g.label, I = ai(g);
2534
+ return /* @__PURE__ */ y(
2535
+ "button",
2536
+ {
2537
+ ref: (O) => {
2538
+ O ? p.current.set(d, O) : p.current.delete(d);
2539
+ },
2540
+ type: "button",
2541
+ role: "radio",
2542
+ "aria-checked": h,
2543
+ "aria-label": C,
2544
+ tabIndex: v ? 0 : -1,
2545
+ onClick: () => r(g.id),
2546
+ onFocus: () => m(d),
2547
+ onKeyDown: (O) => S(O, d, g.id),
2548
+ className: ui({
2549
+ state: h ? "selected" : "idle"
2550
+ }),
2551
+ children: [
2552
+ /* @__PURE__ */ n(
2553
+ "span",
2554
+ {
2555
+ "aria-hidden": "true",
2556
+ className: "ds:flex ds:size-10 ds:shrink-0 ds:items-center ds:justify-center ds:rounded-[var(--radius-sm)] ds:bg-[var(--primary)]/10 ds:text-[var(--primary)]",
2557
+ children: I
2558
+ }
2559
+ ),
2560
+ /* @__PURE__ */ y("span", { className: "ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
2561
+ /* @__PURE__ */ n(
2562
+ "span",
2563
+ {
2564
+ dir: "auto",
2565
+ className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:break-words",
2566
+ children: g.label
2567
+ }
2568
+ ),
2569
+ M ? /* @__PURE__ */ n(
2570
+ "span",
2571
+ {
2572
+ className: Rr({ tone: w }),
2573
+ children: M
2574
+ }
2575
+ ) : u || !i ? null : /* @__PURE__ */ n("span", { className: "type-meta ds:text-[var(--muted-foreground)]", children: s("booking.serviceSummary", {
2576
+ minutes: g.durationMin
2577
+ }) })
2578
+ ] }),
2579
+ u ? /* @__PURE__ */ n(
2580
+ "span",
2581
+ {
2582
+ "aria-hidden": "true",
2583
+ className: "ds:inline-flex ds:shrink-0 ds:items-center ds:ms-auto",
2584
+ children: /* @__PURE__ */ n(zn, { variant: "accentSoft", size: "lg", children: u })
2585
+ }
2586
+ ) : null
2587
+ ]
2588
+ },
2589
+ g.id
2590
+ );
2591
+ })
2592
+ }
2593
+ );
2594
+ }
2595
+ const pi = Lt(
2596
+ [
2597
+ "ds:inline-flex ds:items-center ds:justify-center ds:gap-[var(--spacing-2xs)]",
2598
+ "ds:min-h-[var(--min-target-size)]",
2599
+ "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
2600
+ "ds:pt-[var(--spacing-2xs)] ds:pb-[var(--spacing-2xs)]",
2601
+ "ds:rounded-[var(--radius-md)]",
2602
+ "ds:text-[length:var(--font-size-sm)] ds:font-[var(--font-weight-medium)]",
2603
+ "ds:transition-[background-color,color,box-shadow] ds:duration-[var(--animation-duration)]",
2604
+ "ds:motion-reduce:transition-none",
2605
+ "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
2606
+ "ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
2607
+ "ds:disabled:cursor-not-allowed ds:disabled:opacity-50",
2608
+ "ds:forced-colors:[border:1px_solid_ButtonText] ds:forced-colors:text-[ButtonText]"
2609
+ ].join(" "),
2610
+ {
2611
+ variants: {
2612
+ state: {
2613
+ idle: "ds:bg-[color:var(--card)] ds:text-[color:var(--foreground)] ds:shadow-[var(--shadow-sm)] ds:hover:enabled:bg-[color:var(--muted)]/40 ds:hover:enabled:shadow-[var(--shadow-md)]",
2614
+ selected: "ds:bg-[color:var(--primary)] ds:text-[color:var(--primary-foreground)] ds:shadow-[var(--shadow-sm)]",
2615
+ unavailable: "ds:[outline:1px_dashed_color:var(--border)] ds:[outline-offset:-1px] ds:bg-transparent ds:text-[color:var(--muted-foreground)]"
2616
+ }
2617
+ },
2618
+ defaultVariants: { state: "idle" }
2619
+ }
2620
+ );
2621
+ function fi(e) {
2622
+ const [t] = e.split(":").map((i) => parseInt(i, 10)), r = Number.isFinite(t) ? t : 0;
2623
+ return r < 12 ? "morning" : r < 17 ? "afternoon" : "evening";
2624
+ }
2625
+ function sn(e, t, r) {
2626
+ if (!e) return t;
2627
+ try {
2628
+ return new Intl.DateTimeFormat(r, {
2629
+ hour: "numeric",
2630
+ minute: "2-digit"
2631
+ }).format(/* @__PURE__ */ new Date(`${e}T${t}:00`));
2632
+ } catch {
2633
+ return t;
2634
+ }
2635
+ }
2636
+ const gi = {
2637
+ morning: Pr,
2638
+ afternoon: ps,
2639
+ evening: Lr
2640
+ };
2641
+ function hi({
2642
+ emptyDescription: e,
2643
+ date: t,
2644
+ slots: r,
2645
+ selectedSlotKey: i,
2646
+ onSelect: s,
2647
+ loading: a,
2648
+ locale: o
2649
+ }) {
2650
+ const { t: c } = Q("ui"), m = K(() => {
2651
+ try {
2652
+ return new Intl.DateTimeFormat(o, {
2653
+ weekday: "long",
2654
+ day: "numeric",
2655
+ month: "long"
2656
+ }).format(fe(t));
2657
+ } catch {
2658
+ return t;
2659
+ }
2660
+ }, [t, o]), p = K(() => {
2661
+ const g = {
2662
+ morning: [],
2663
+ afternoon: [],
2664
+ evening: []
2665
+ };
2666
+ for (const d of r)
2667
+ g[fi(d.time)].push(d);
2668
+ return g;
2669
+ }, [r]), f = r.filter((g) => g.available).length, S = ["morning", "afternoon", "evening"];
2670
+ return a ? /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
2671
+ /* @__PURE__ */ n(rn, { variant: "text", width: "60%" }),
2672
+ [0, 1].map((g) => /* @__PURE__ */ n(
2673
+ "div",
2674
+ {
2675
+ className: "ds:grid ds:grid-cols-3 ds:gap-[var(--spacing-xs)]",
2676
+ children: [0, 1, 2].map((d) => /* @__PURE__ */ n(rn, { variant: "rounded", height: "44px" }, d))
2677
+ },
2678
+ g
2679
+ ))
2680
+ ] }) : f === 0 ? /* @__PURE__ */ n(
2681
+ kn,
2682
+ {
2683
+ variant: "no-results",
2684
+ title: c("booking.noSlotsForDate"),
2685
+ description: e
2686
+ }
2687
+ ) : /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
2688
+ /* @__PURE__ */ y("div", { className: "ds:flex ds:items-baseline ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
2689
+ /* @__PURE__ */ y("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
2690
+ /* @__PURE__ */ n(
2691
+ ts,
2692
+ {
2693
+ "aria-hidden": "true",
2694
+ className: "ds:size-4 ds:text-[color:var(--accent)]"
2695
+ }
2696
+ ),
2697
+ /* @__PURE__ */ n("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: m })
2698
+ ] }),
2699
+ /* @__PURE__ */ n("span", { className: "type-meta ds:text-[var(--muted-foreground)]", children: c("booking.slotsAvailable", { count: f }) })
2700
+ ] }),
2701
+ S.map((g) => {
2702
+ const d = p[g];
2703
+ if (d.length === 0) return null;
2704
+ const h = gi[g];
2705
+ return /* @__PURE__ */ y(
2706
+ "div",
2707
+ {
2708
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
2709
+ children: [
2710
+ /* @__PURE__ */ y("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)] ds:text-[color:var(--muted-foreground)]", children: [
2711
+ /* @__PURE__ */ n(h, { "aria-hidden": "true", className: "ds:size-3.5" }),
2712
+ /* @__PURE__ */ n("span", { className: "type-meta ds:font-[var(--font-weight-semibold)] ds:uppercase", children: c(`booking.timeOfDay.${g}`) })
2713
+ ] }),
2714
+ /* @__PURE__ */ n(
2715
+ "div",
2716
+ {
2717
+ role: "group",
2718
+ "aria-label": c(`booking.timeOfDay.${g}`),
2719
+ className: "ds:grid ds:grid-cols-3 ds:gap-[var(--spacing-xs)] ds:sm:grid-cols-4",
2720
+ children: d.map((v) => {
2721
+ const u = v.key === i, M = v.available ? u ? "selected" : "idle" : "unavailable";
2722
+ return /* @__PURE__ */ n(
2723
+ "button",
2724
+ {
2725
+ type: "button",
2726
+ "data-slot-id": v.key,
2727
+ disabled: !v.available,
2728
+ "aria-pressed": u,
2729
+ "aria-label": c("booking.slotAvailableLabel", {
2730
+ time: sn(t, v.time, o)
2731
+ }),
2732
+ onClick: () => v.available && s(v),
2733
+ className: pi({ state: M }),
2734
+ children: sn(t, v.time, o)
2735
+ },
2736
+ v.key
2737
+ );
2738
+ })
2739
+ }
2740
+ )
2741
+ ]
2742
+ },
2743
+ g
2744
+ );
2745
+ })
2746
+ ] });
2747
+ }
2748
+ const tn = 4;
2749
+ function vi({
2750
+ availableDates: e,
2751
+ availableSlots: t,
2752
+ value: r,
2753
+ onChange: i,
2754
+ onDateSelect: s,
2755
+ onWindowChange: a,
2756
+ nextAvailableDate: o,
2757
+ loadingDates: c,
2758
+ loadingSlots: m,
2759
+ slotLoadError: p,
2760
+ onRetrySlots: f,
2761
+ emptySlotsDescription: S,
2762
+ locale: g,
2763
+ agentIdBase: d
2764
+ }) {
2765
+ var Ne, ge;
2766
+ const h = K(() => rt(/* @__PURE__ */ new Date()), []), v = A(
2767
+ e.length > 0 || !!(r.date && !On(rt(fe(r.date)), h))
2768
+ ), [u, M] = J(() => {
2769
+ if (r.date) {
2770
+ const N = rt(fe(r.date));
2771
+ if (!ut(h, N)) return N;
2772
+ }
2773
+ if (e.length > 0) {
2774
+ const N = rt(fe(e[0]));
2775
+ if (ut(N, h)) return N;
2776
+ }
2777
+ return h;
2778
+ }), w = K(
2779
+ () => un(u, tn - 1),
2780
+ [u]
2781
+ ), C = K(() => Array.from({ length: tn }, (N, q) => {
2782
+ const Y = un(u, q), U = mt(Y), Be = (t[U] ?? []).map((he) => ({
2783
+ id: he.key,
2784
+ // SlotGrid formats `start` as a time via Intl.DateTimeFormat —
2785
+ // compose a full ISO from the column's date + the slot's HH:mm
2786
+ // so the locale-formatter has a real timestamp to work with.
2787
+ start: `${U}T${he.time}:00`,
2788
+ available: he.available
2789
+ }));
2790
+ return { date: U, slots: Be };
2791
+ }), [u, t]), I = ut(u, h), O = !0, B = Me(() => {
2792
+ v.current = !0, M((N) => {
2793
+ const q = Br(N, tn);
2794
+ return ut(h, q) ? h : q;
2795
+ });
2796
+ }, [h]), F = Me(() => {
2797
+ v.current = !0, M((N) => un(N, tn));
2798
+ }, []), R = [
2799
+ r.serviceId,
2800
+ (Ne = r.serviceIds) == null ? void 0 : Ne.join(","),
2801
+ r.operatorId,
2802
+ (ge = r.operatorIds) == null ? void 0 : ge.join(","),
2803
+ r.specialtyId
2804
+ ].join("|"), $ = e.join(","), j = A(R), T = A(null);
2805
+ V(() => {
2806
+ if (j.current !== R && (j.current = R, v.current = !1, T.current = $), v.current || e.length === 0) return;
2807
+ if (T.current !== null) {
2808
+ if (T.current === $) return;
2809
+ T.current = null;
2810
+ }
2811
+ v.current = !0;
2812
+ const N = rt(fe(e[0]));
2813
+ !ut(N, h) || e.some((Y) => {
2814
+ const U = rt(fe(Y));
2815
+ return !ut(U, w) && !On(U, u);
2816
+ }) || M(N);
2817
+ }, [e, $, R, h, u, w]), V(() => {
2818
+ a == null || a(mt(u), mt(w));
2819
+ }, [u, w, a]);
2820
+ const k = Me(
2821
+ (N, q) => {
2822
+ const Y = typeof q.date == "string" ? q.date : mt(q.date);
2823
+ i({
2824
+ ...Zn(hn(r, Y), N.id)
2825
+ }), s == null || s(Y);
2826
+ },
2827
+ [i, s, r]
2828
+ ), L = c || m ? "loading" : "default", E = C.some((N) => N.slots.length > 0), W = (e.length === 0 && o ? [o] : e).filter((N) => ut(rt(fe(N)), w)).sort()[0];
2829
+ return /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
2830
+ L !== "loading" && !p && !E && !!W ? /* @__PURE__ */ n(
2831
+ ur,
2832
+ {
2833
+ nextAvailableDate: W,
2834
+ onJump: () => {
2835
+ v.current = !0, M(rt(fe(W))), s == null || s(W);
2836
+ },
2837
+ locale: g
2838
+ }
2839
+ ) : null,
2840
+ /* @__PURE__ */ n(
2841
+ In,
2842
+ {
2843
+ label: "slot",
2844
+ error: p,
2845
+ loading: L === "loading",
2846
+ onRetry: f,
2847
+ children: /* @__PURE__ */ n(
2848
+ Er,
2849
+ {
2850
+ id: d ? `${d}-slots` : void 0,
2851
+ days: C,
2852
+ emptyDescription: S,
2853
+ state: L,
2854
+ selectedSlotId: r.slotKey,
2855
+ maxInitialSlotsPerDay: 6,
2856
+ locale: g,
2857
+ hasPrevious: I,
2858
+ hasNext: O,
2859
+ onSlotSelect: k,
2860
+ onPreviousDays: B,
2861
+ onNextDays: F
2862
+ }
2863
+ )
2864
+ }
2865
+ )
2866
+ ] });
2867
+ }
2868
+ function sr(e) {
2869
+ const {
2870
+ inputs: t,
2871
+ value: r,
2872
+ onChange: i,
2873
+ onDateSelect: s,
2874
+ onWindowChange: a,
2875
+ loadingDates: o,
2876
+ loadingSlots: c,
2877
+ slotLoadError: m,
2878
+ onRetrySlots: p,
2879
+ emptySlotsDescription: f,
2880
+ locale: S,
2881
+ datePickerStyle: g,
2882
+ agentIdBase: d
2883
+ } = e;
2884
+ return g === "four-day-grid" ? /* @__PURE__ */ n(
2885
+ vi,
2886
+ {
2887
+ availableDates: t.availableDates,
2888
+ availableSlots: t.availableSlots,
2889
+ value: r,
2890
+ onChange: i,
2891
+ onDateSelect: s,
2892
+ onWindowChange: a,
2893
+ nextAvailableDate: t.nextAvailableDate,
2894
+ loadingDates: o,
2895
+ loadingSlots: c,
2896
+ slotLoadError: m,
2897
+ onRetrySlots: p,
2898
+ emptySlotsDescription: f,
2899
+ locale: S,
2900
+ agentIdBase: d
2901
+ }
2902
+ ) : m && r.date && e.activeStep > 5 && !o && !c ? null : /* @__PURE__ */ n(
2903
+ In,
2904
+ {
2905
+ label: "date",
2906
+ error: m,
2907
+ loading: o || c,
2908
+ onRetry: p,
2909
+ children: /* @__PURE__ */ n(bi, { ...e })
2910
+ }
2911
+ );
2912
+ }
2913
+ function bi(e) {
2914
+ const { t } = Q("ui"), {
2915
+ inputs: r,
2916
+ value: i,
2917
+ onChange: s,
2918
+ onDateSelect: a,
2919
+ loadingDates: o,
2920
+ loadingSlots: c,
2921
+ locale: m,
2922
+ emptySlotsDescription: p
2923
+ } = e;
2924
+ if (!o && !c && r.availableDates.length === 0) {
2925
+ if (r.nextAvailableDate)
2926
+ return /* @__PURE__ */ n(
2927
+ ur,
2928
+ {
2929
+ nextAvailableDate: r.nextAvailableDate,
2930
+ onJump: (f) => {
2931
+ s(hn(i, f)), a == null || a(f);
2932
+ },
2933
+ locale: m
2934
+ }
2935
+ );
2936
+ if (p !== void 0)
2937
+ return /* @__PURE__ */ n(
2938
+ kn,
2939
+ {
2940
+ variant: "no-results",
2941
+ title: t("slotGrid.noSlots"),
2942
+ description: p
2943
+ }
2944
+ );
2945
+ }
2946
+ return /* @__PURE__ */ n(
2947
+ li,
2948
+ {
2949
+ availableDates: r.availableDates,
2950
+ selectedDate: i.date,
2951
+ onSelectDate: (f) => {
2952
+ s(hn(i, f)), a == null || a(f);
2953
+ },
2954
+ locale: m,
2955
+ loading: o ?? c
2956
+ }
2957
+ );
2958
+ }
2959
+ function ir(e) {
2960
+ const {
2961
+ inputs: t,
2962
+ value: r,
2963
+ onChange: i,
2964
+ loadingDates: s,
2965
+ loadingSlots: a,
2966
+ slotLoadError: o,
2967
+ onRetrySlots: c,
2968
+ emptySlotsDescription: m,
2969
+ locale: p,
2970
+ datePickerStyle: f
2971
+ } = e;
2972
+ return f === "four-day-grid" || !r.date || o && e.activeStep <= 5 && !s && !a ? null : /* @__PURE__ */ n(
2973
+ In,
2974
+ {
2975
+ label: "slot",
2976
+ error: o,
2977
+ loading: s || a,
2978
+ onRetry: c,
2979
+ children: /* @__PURE__ */ n(
2980
+ hi,
2981
+ {
2982
+ date: r.date,
2983
+ slots: t.availableSlots[r.date] ?? [],
2984
+ selectedSlotKey: r.slotKey,
2985
+ onSelect: (S) => i(Zn(r, S.key)),
2986
+ loading: s || a,
2987
+ emptyDescription: m,
2988
+ locale: p
2989
+ }
2990
+ )
2991
+ }
2992
+ );
2993
+ }
2994
+ function or({ value: e, onChange: t }) {
2995
+ const { t: r } = Q("ui"), i = [
2996
+ { value: "private", label: r("booking.insurance.private") },
2997
+ { value: "public", label: r("booking.insurance.public") }
2998
+ ];
2999
+ return /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
3000
+ /* @__PURE__ */ n("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: r("booking.insurance.heading") }),
3001
+ /* @__PURE__ */ n(
3002
+ an,
3003
+ {
3004
+ options: i,
3005
+ value: e ?? "",
3006
+ onValueChange: (s) => {
3007
+ (s === "private" || s === "public") && t(s);
3008
+ },
3009
+ placeholder: r("booking.insurance.placeholder"),
3010
+ "aria-label": r("booking.insurance.heading")
3011
+ }
3012
+ )
3013
+ ] });
3014
+ }
3015
+ function ar({
3016
+ specialties: e,
3017
+ value: t,
3018
+ valueIds: r,
3019
+ onChange: i,
3020
+ onChangeIds: s,
3021
+ pickerStyle: a = "select"
3022
+ }) {
3023
+ const { t: o } = Q("ui"), c = e.map((p) => ({
3024
+ value: p.id,
3025
+ label: p.label,
3026
+ dir: "auto"
3027
+ })), m = /* @__PURE__ */ n("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: o("booking.specialty.heading") });
3028
+ return a === "multi-select" && s ? /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
3029
+ m,
3030
+ /* @__PURE__ */ n(
3031
+ yn,
3032
+ {
3033
+ options: c,
3034
+ value: r ?? [],
3035
+ onChange: s,
3036
+ placeholder: o("booking.specialty.placeholder"),
3037
+ "aria-label": o("booking.specialty.heading"),
3038
+ allowClear: !0
3039
+ }
3040
+ )
3041
+ ] }) : a === "combobox" ? /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
3042
+ m,
3043
+ /* @__PURE__ */ n(
3044
+ bn,
3045
+ {
3046
+ options: c,
3047
+ value: t ?? "",
3048
+ onValueChange: (p) => i(p === "" ? "" : p),
3049
+ placeholder: o("booking.specialty.placeholder"),
3050
+ "aria-label": o("booking.specialty.heading"),
3051
+ clearable: !0
3052
+ }
3053
+ )
3054
+ ] }) : /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
3055
+ m,
3056
+ /* @__PURE__ */ n(
3057
+ an,
3058
+ {
3059
+ options: c,
3060
+ value: t ?? "",
3061
+ onValueChange: (p) => i(p),
3062
+ placeholder: o("booking.specialty.placeholder"),
3063
+ "aria-label": o("booking.specialty.heading")
3064
+ }
3065
+ )
3066
+ ] });
3067
+ }
3068
+ function cr({
3069
+ services: e,
3070
+ value: t,
3071
+ valueIds: r,
3072
+ onChange: i,
3073
+ onChangeIds: s,
3074
+ pickerStyle: a,
3075
+ compact: o,
3076
+ showDuration: c
3077
+ }) {
3078
+ const { t: m } = Q("ui"), p = rr(), f = a ?? (o ? "select" : "cards"), S = e.map((d) => {
3079
+ const { price: h, payment: v, paymentTone: u } = p(d);
3080
+ return {
3081
+ value: d.id,
3082
+ // The practice's service name leads the label, so it decides the
3083
+ // direction, even when the kit's duration is appended after it.
3084
+ dir: "auto",
3085
+ label: h || v || !c ? d.label : `${d.label} · ${m("booking.serviceSummary", {
3086
+ minutes: d.durationMin
3087
+ })}`,
3088
+ ...h ? {
3089
+ endContent: /* @__PURE__ */ n(zn, { variant: "accentSoft", size: "lg", children: h })
3090
+ } : {},
3091
+ ...v ? { description: v, descriptionTone: u } : {}
3092
+ };
3093
+ }), g = /* @__PURE__ */ n("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: m("booking.service.heading") });
3094
+ return f === "multi-select" && s ? /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
3095
+ g,
3096
+ /* @__PURE__ */ n(
3097
+ yn,
3098
+ {
3099
+ options: S,
3100
+ value: r ?? [],
3101
+ onChange: s,
3102
+ placeholder: m("booking.service.placeholder"),
3103
+ "aria-label": m("booking.service.heading"),
3104
+ allowClear: !0,
3105
+ wrapOptionLabels: !0
3106
+ }
3107
+ )
3108
+ ] }) : f === "combobox" ? /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
3109
+ g,
3110
+ /* @__PURE__ */ n(
3111
+ bn,
3112
+ {
3113
+ options: S,
3114
+ value: t ?? "",
3115
+ onValueChange: (d) => i(d === "" ? "" : d),
3116
+ placeholder: m("booking.service.placeholder"),
3117
+ "aria-label": m("booking.service.heading"),
3118
+ clearable: !0,
3119
+ wrapOptionLabels: !0
3120
+ }
3121
+ )
3122
+ ] }) : f === "select" ? /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
3123
+ g,
3124
+ /* @__PURE__ */ n(
3125
+ an,
3126
+ {
3127
+ options: S,
3128
+ value: t ?? "",
3129
+ onValueChange: (d) => i(d),
3130
+ placeholder: m("booking.service.placeholder"),
3131
+ "aria-label": m("booking.service.heading"),
3132
+ showDescriptions: !0,
3133
+ descriptionInName: !0,
3134
+ wrapOptionLabels: !0
3135
+ }
3136
+ )
3137
+ ] }) : /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
3138
+ g,
3139
+ /* @__PURE__ */ n(
3140
+ mi,
3141
+ {
3142
+ services: e,
3143
+ selectedServiceId: t,
3144
+ onSelect: i,
3145
+ showDuration: c
3146
+ }
3147
+ )
3148
+ ] });
3149
+ }
3150
+ function dr({
3151
+ operators: e,
3152
+ value: t,
3153
+ valueIds: r,
3154
+ onChange: i,
3155
+ onChangeIds: s,
3156
+ pickerStyle: a = "select"
3157
+ }) {
3158
+ const { t: o } = Q("ui"), c = /* @__PURE__ */ n("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: o("booking.operator.heading") });
3159
+ if (a === "multi-select" && s) {
3160
+ const p = e.map((f) => ({
3161
+ value: f.id,
3162
+ label: f.name,
3163
+ dir: "auto"
3164
+ }));
3165
+ return /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
3166
+ c,
3167
+ /* @__PURE__ */ n(
3168
+ yn,
3169
+ {
3170
+ options: p,
3171
+ value: r ?? [],
3172
+ onChange: s,
3173
+ placeholder: o("booking.operator.all"),
3174
+ "aria-label": o("booking.operator.heading"),
3175
+ allowClear: !0
3176
+ }
3177
+ )
3178
+ ] });
3179
+ }
3180
+ const m = [
3181
+ { value: qe, label: o("booking.operator.all") },
3182
+ ...e.map(
3183
+ (p) => ({ value: p.id, label: p.name, dir: "auto" })
3184
+ )
3185
+ ];
3186
+ return a === "combobox" ? /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
3187
+ c,
3188
+ /* @__PURE__ */ n(
3189
+ bn,
3190
+ {
3191
+ options: m,
3192
+ value: t ?? qe,
3193
+ onValueChange: (p) => i(p === "" ? qe : p),
3194
+ placeholder: o("booking.operator.placeholder"),
3195
+ "aria-label": o("booking.operator.heading"),
3196
+ clearable: !0
3197
+ }
3198
+ )
3199
+ ] }) : /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
3200
+ c,
3201
+ /* @__PURE__ */ n(
3202
+ an,
3203
+ {
3204
+ options: m,
3205
+ value: t ?? qe,
3206
+ onValueChange: (p) => i(p),
3207
+ placeholder: o("booking.operator.placeholder"),
3208
+ "aria-label": o("booking.operator.heading")
3209
+ }
3210
+ )
3211
+ ] });
3212
+ }
3213
+ function lr({
3214
+ customSlot: e
3215
+ }) {
3216
+ const { t } = Q("ui");
3217
+ return e ? /* @__PURE__ */ n(me, { children: e }) : /* @__PURE__ */ y(re, { variant: "warning", children: [
3218
+ /* @__PURE__ */ n(re.Title, { as: "h4", children: t("booking.onboardingIncomplete.title") }),
3219
+ /* @__PURE__ */ n(re.Description, { children: t("booking.onboardingIncomplete.description") })
3220
+ ] });
3221
+ }
3222
+ function ur({
3223
+ nextAvailableDate: e,
3224
+ onJump: t,
3225
+ locale: r
3226
+ }) {
3227
+ const { t: i } = Q("ui"), s = K(() => {
3228
+ try {
3229
+ return new Intl.DateTimeFormat(r, { dateStyle: "long" }).format(
3230
+ fe(e)
3231
+ );
3232
+ } catch {
3233
+ return e;
3234
+ }
3235
+ }, [e, r]);
3236
+ return /* @__PURE__ */ y(re, { variant: "info", children: [
3237
+ /* @__PURE__ */ n(re.Description, { children: i("booking.nextAvailable.description", { date: s }) }),
3238
+ /* @__PURE__ */ n(re.Action, { children: /* @__PURE__ */ n(
3239
+ Re,
3240
+ {
3241
+ intent: "secondary",
3242
+ size: "sm",
3243
+ onClick: () => t(e),
3244
+ children: i("booking.nextAvailable.cta")
3245
+ }
3246
+ ) })
3247
+ ] });
3248
+ }
3249
+ function yi({
3250
+ codeVerified: e = !1,
3251
+ handoverUrl: t,
3252
+ handoverDelayMs: r,
3253
+ onNavigate: i,
3254
+ payment: s,
3255
+ confirmationChannels: a,
3256
+ snapshot: o,
3257
+ operators: c,
3258
+ specialties: m,
3259
+ services: p,
3260
+ locale: f,
3261
+ mode: S,
3262
+ showModify: g,
3263
+ onReset: d,
3264
+ onModify: h,
3265
+ focusWasLost: v
3266
+ }) {
3267
+ const { t: u } = Q("ui"), M = A(null);
3268
+ V(() => {
3269
+ const T = M.current, k = document.activeElement, L = T == null ? void 0 : T.closest('[data-component="booking"]');
3270
+ T && (k && (L != null && L.contains(k)) || v()) && T.focus();
3271
+ }, []);
3272
+ const w = Sn(a), I = Qn(
3273
+ w,
3274
+ o.details.confirmationChannels
3275
+ ).map(
3276
+ (T) => u(`booking.confirmation.channel.${T}`)
3277
+ ), O = s ? on(s.amountCents, s.currencyCode, f) : "", B = s ? u(
3278
+ S === "demo" ? "booking.payment.paidDemo" : "booking.payment.paidBody",
3279
+ { amount: O }
3280
+ ) : e ? u(S === "demo" ? "booking.code.confirmedDemo" : "booking.code.confirmedBody") : S === "demo" ? u("booking.success.descriptionDemo") : I.length > 1 ? u("booking.success.descriptionMultiple", {
3281
+ channels: I.join(" · ")
3282
+ }) : u("booking.success.descriptionSingle", {
3283
+ channel: I[0]
3284
+ }), F = K(() => {
3285
+ if (o.date)
3286
+ try {
3287
+ return new Intl.DateTimeFormat(f, {
3288
+ weekday: "long",
3289
+ day: "numeric",
3290
+ month: "long"
3291
+ }).format(fe(o.date));
3292
+ } catch {
3293
+ return o.date;
3294
+ }
3295
+ }, [o.date, f]), R = K(() => {
3296
+ const k = (o.operatorIds && o.operatorIds.length > 0 ? o.operatorIds : o.operatorId ? [o.operatorId] : []).filter((L) => L !== qe).map((L) => {
3297
+ var E;
3298
+ return (E = c.find((b) => b.id === L)) == null ? void 0 : E.name;
3299
+ }).filter((L) => L !== void 0);
3300
+ if (k.length === 0) return [];
3301
+ try {
3302
+ return new Intl.ListFormat(f === "en" ? "en-GB" : f, {
3303
+ style: "long",
3304
+ type: "conjunction"
3305
+ }).formatToParts(k);
3306
+ } catch {
3307
+ return k.flatMap((L, E) => [
3308
+ ...E > 0 ? [{ type: "literal", value: ", " }] : [],
3309
+ { type: "element", value: L }
3310
+ ]);
3311
+ }
3312
+ }, [o.operatorIds, o.operatorId, c, f]), $ = o.specialtyId ? m.find((T) => T.id === o.specialtyId) : void 0, j = o.serviceId ? p.find((T) => T.id === o.serviceId) : void 0;
3313
+ if (t) {
3314
+ let T;
3315
+ if (o.date)
3316
+ try {
3317
+ T = new Intl.DateTimeFormat(f, {
3318
+ weekday: "short",
3319
+ day: "numeric",
3320
+ month: "short"
3321
+ }).format(fe(o.date));
3322
+ } catch {
3323
+ T = o.date;
3324
+ }
3325
+ const k = (j == null ? void 0 : j.label) ?? ($ == null ? void 0 : $.label), L = R.map(
3326
+ (E, b) => E.type === "element" ? /* @__PURE__ */ n("bdi", { children: E.value }, b) : E.value
3327
+ );
3328
+ return /* @__PURE__ */ n(
3329
+ Qs,
3330
+ {
3331
+ url: t,
3332
+ delayMs: ri(r),
3333
+ onNavigate: i,
3334
+ date: T,
3335
+ time: sn(o.date, o.slot.time, f),
3336
+ details: k || L.length > 0 ? /* @__PURE__ */ y(me, { children: [
3337
+ k ? /* @__PURE__ */ n("bdi", { children: k }) : null,
3338
+ k && L.length > 0 ? " · " : null,
3339
+ L
3340
+ ] }) : void 0,
3341
+ shouldTakeFocus: (E) => {
3342
+ const b = document.activeElement, W = E.closest('[data-component="booking"]');
3343
+ return !!(b && (W != null && W.contains(b)) || v());
3344
+ }
3345
+ }
3346
+ );
3347
+ }
3348
+ return /* @__PURE__ */ y(
3349
+ "div",
3350
+ {
3351
+ "data-component": "booking-success",
3352
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
3353
+ children: [
3354
+ /* @__PURE__ */ y(re, { variant: "success", children: [
3355
+ /* @__PURE__ */ n(
3356
+ re.Title,
3357
+ {
3358
+ as: "h3",
3359
+ ref: M,
3360
+ tabIndex: -1,
3361
+ className: "ds:outline-none",
3362
+ children: u(
3363
+ s ? S === "demo" ? "booking.payment.paidDemoTitle" : "booking.payment.paidTitle" : e ? "booking.code.confirmedHeading" : "booking.success.heading"
3364
+ )
3365
+ }
3366
+ ),
3367
+ /* @__PURE__ */ n(re.Description, { children: B })
3368
+ ] }),
3369
+ /* @__PURE__ */ n("div", { className: "ds:rounded-[var(--radius-md)] ds:bg-[var(--secondary)] ds:p-[var(--spacing-md)]", children: /* @__PURE__ */ y("dl", { className: "ds:grid ds:grid-cols-[auto_minmax(0,1fr)] ds:gap-x-[var(--spacing-md)] ds:gap-y-[var(--spacing-xs)] ds:m-0", children: [
3370
+ s && S !== "demo" ? /* @__PURE__ */ y(me, { children: [
3371
+ /* @__PURE__ */ n("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: u("booking.payment.summaryPaid") }),
3372
+ /* @__PURE__ */ n("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: O })
3373
+ ] }) : null,
3374
+ $ ? /* @__PURE__ */ y(me, { children: [
3375
+ /* @__PURE__ */ n("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: u("booking.success.summarySpecialty") }),
3376
+ /* @__PURE__ */ n(
3377
+ "dd",
3378
+ {
3379
+ dir: "auto",
3380
+ className: "type-body ds:m-0 ds:text-[var(--foreground)]",
3381
+ children: $.label
3382
+ }
3383
+ )
3384
+ ] }) : null,
3385
+ j ? /* @__PURE__ */ y(me, { children: [
3386
+ /* @__PURE__ */ n("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: u("booking.success.summaryService") }),
3387
+ /* @__PURE__ */ n(
3388
+ "dd",
3389
+ {
3390
+ dir: "auto",
3391
+ className: "type-body ds:m-0 ds:text-[var(--foreground)]",
3392
+ children: j.label
3393
+ }
3394
+ )
3395
+ ] }) : null,
3396
+ F ? /* @__PURE__ */ y(me, { children: [
3397
+ /* @__PURE__ */ n("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: u("booking.success.summaryDate") }),
3398
+ /* @__PURE__ */ n("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: F })
3399
+ ] }) : null,
3400
+ /* @__PURE__ */ n("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: u("booking.success.summaryTime") }),
3401
+ /* @__PURE__ */ n("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: sn(o.date, o.slot.time, f) }),
3402
+ R.length > 0 ? /* @__PURE__ */ y(me, { children: [
3403
+ /* @__PURE__ */ n("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: u("booking.success.summaryProvider") }),
3404
+ /* @__PURE__ */ n("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: R.map(
3405
+ (T, k) => T.type === "element" ? /* @__PURE__ */ n("bdi", { children: T.value }, k) : T.value
3406
+ ) })
3407
+ ] }) : null
3408
+ ] }) }),
3409
+ /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]", children: [
3410
+ /* @__PURE__ */ n(Re, { intent: "secondary", size: "md", onClick: d, children: u("booking.success.bookAnother") }),
3411
+ g ? /* @__PURE__ */ n(Re, { intent: "ghost", size: "md", onClick: h, children: u("booking.success.modifyBooking") }) : null
3412
+ ] })
3413
+ ]
3414
+ }
3415
+ );
3416
+ }
3417
+ function mr({ customSlot: e }) {
3418
+ const { t } = Q("ui");
3419
+ return e ? /* @__PURE__ */ n(me, { children: e }) : /* @__PURE__ */ n(
3420
+ kn,
3421
+ {
3422
+ variant: "no-results",
3423
+ title: t("booking.emptyServices.title"),
3424
+ description: t("booking.emptyServices.description")
3425
+ }
3426
+ );
3427
+ }
3428
+ const pr = "data-booking-step-active", Ln = `[${pr}]`;
3429
+ function ce({
3430
+ step: e,
3431
+ active: t,
3432
+ className: r,
3433
+ id: i,
3434
+ children: s
3435
+ }) {
3436
+ return /* @__PURE__ */ n(
3437
+ "div",
3438
+ {
3439
+ id: i,
3440
+ "data-booking-step": String(e),
3441
+ ...t ? { [pr]: "" } : null,
3442
+ tabIndex: -1,
3443
+ className: r ? `${r} ${Bt}` : Bt,
3444
+ children: s
3445
+ }
3446
+ );
3447
+ }
3448
+ function Nn(e, t) {
3449
+ return t === "four-day-grid" ? e.filter((r) => r !== 6) : e;
3450
+ }
3451
+ function ki(e) {
3452
+ const {
3453
+ cascade: t,
3454
+ inputs: r,
3455
+ value: i,
3456
+ onChange: s,
3457
+ onSubmit: a,
3458
+ emptyServicesSlot: o,
3459
+ onboardingIncompleteSlot: c,
3460
+ loadingDates: m,
3461
+ loadingSlots: p,
3462
+ slotLoadError: f,
3463
+ onRetrySlots: S,
3464
+ emptySlotsDescription: g,
3465
+ onDateSelect: d,
3466
+ onWindowChange: h,
3467
+ datePickerStyle: v,
3468
+ specialtyPickerStyle: u,
3469
+ servicePickerStyle: M,
3470
+ showServiceDuration: w,
3471
+ operatorPickerStyle: C,
3472
+ submitting: I,
3473
+ locale: O,
3474
+ detailsProps: B,
3475
+ agentIdBase: F,
3476
+ activeStep: R
3477
+ } = e, { t: $ } = Q("ui"), j = Ct(R, v), T = (k, L) => ({
3478
+ step: k,
3479
+ active: k === j,
3480
+ className: L
3481
+ });
3482
+ return /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
3483
+ t.gates.insurance ? /* @__PURE__ */ n(ce, { ...T(1), children: /* @__PURE__ */ n(
3484
+ or,
3485
+ {
3486
+ value: i.insuranceType,
3487
+ onChange: (k) => s(jn(i, k))
3488
+ }
3489
+ ) }) : null,
3490
+ t.gates.specialty ? /* @__PURE__ */ n(ce, { ...T(2), children: /* @__PURE__ */ n(
3491
+ ar,
3492
+ {
3493
+ specialties: t.filtered.specialties,
3494
+ value: i.specialtyId,
3495
+ valueIds: i.specialtyIds,
3496
+ onChange: (k) => s(Un(i, k)),
3497
+ onChangeIds: (k) => s(Hn(i, k)),
3498
+ pickerStyle: u
3499
+ }
3500
+ ) }) : null,
3501
+ t.gates.service ? /* @__PURE__ */ n(ce, { ...T(3), children: t.filtered.services.length === 0 ? /* @__PURE__ */ n(mr, { customSlot: o }) : /* @__PURE__ */ n(
3502
+ cr,
3503
+ {
3504
+ services: t.filtered.services,
3505
+ value: i.serviceId,
3506
+ valueIds: i.serviceIds,
3507
+ onChange: (k) => s(Gn(i, k)),
3508
+ onChangeIds: (k) => s(Jn(i, k)),
3509
+ pickerStyle: M,
3510
+ showDuration: w
3511
+ }
3512
+ ) }) : null,
3513
+ t.gates.onboardingIncomplete ? /* @__PURE__ */ n(lr, { customSlot: c }) : null,
3514
+ t.gates.operator ? /* @__PURE__ */ n(ce, { ...T(4), children: /* @__PURE__ */ n(
3515
+ dr,
3516
+ {
3517
+ operators: t.filtered.operators,
3518
+ value: i.operatorId,
3519
+ valueIds: i.operatorIds,
3520
+ onChange: (k) => s(Wn(i, k)),
3521
+ onChangeIds: (k) => s(Yn(i, k)),
3522
+ pickerStyle: C
3523
+ }
3524
+ ) }) : null,
3525
+ t.gates.date ? /* @__PURE__ */ y(
3526
+ ce,
3527
+ {
3528
+ ...T(5, "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]"),
3529
+ children: [
3530
+ /* @__PURE__ */ n("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: $("booking.date.heading") }),
3531
+ sr({
3532
+ activeStep: R,
3533
+ inputs: r,
3534
+ value: i,
3535
+ onChange: s,
3536
+ onDateSelect: d,
3537
+ onWindowChange: h,
3538
+ loadingDates: m,
3539
+ loadingSlots: p,
3540
+ slotLoadError: f,
3541
+ onRetrySlots: S,
3542
+ emptySlotsDescription: g,
3543
+ locale: O,
3544
+ datePickerStyle: v,
3545
+ agentIdBase: F
3546
+ })
3547
+ ]
3548
+ }
3549
+ ) : null,
3550
+ t.gates.slot && i.date && v === "month-calendar" ? /* @__PURE__ */ y(
3551
+ ce,
3552
+ {
3553
+ ...T(6, "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]"),
3554
+ children: [
3555
+ /* @__PURE__ */ n("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: $("booking.slot.heading") }),
3556
+ ir({
3557
+ activeStep: R,
3558
+ inputs: r,
3559
+ value: i,
3560
+ onChange: s,
3561
+ loadingDates: m,
3562
+ loadingSlots: p,
3563
+ slotLoadError: f,
3564
+ onRetrySlots: S,
3565
+ emptySlotsDescription: g,
3566
+ locale: O,
3567
+ datePickerStyle: v
3568
+ })
3569
+ ]
3570
+ }
3571
+ ) : null,
3572
+ t.gates.details && t.selectedSlot ? /* @__PURE__ */ n(ce, { ...T(7), children: /* @__PURE__ */ n(
3573
+ xn,
3574
+ {
3575
+ ...B,
3576
+ value: i.details ?? {},
3577
+ onChange: (k) => s({ ...i, details: k }),
3578
+ onSubmit: a,
3579
+ submitting: I,
3580
+ defaultPhoneCountry: e.policy.country
3581
+ }
3582
+ ) }) : null
3583
+ ] });
3584
+ }
3585
+ function Fe(e, t, r = {}) {
3586
+ const {
3587
+ activeStep: i,
3588
+ cascade: s,
3589
+ inputs: a,
3590
+ value: o,
3591
+ onChange: c,
3592
+ onSubmit: m,
3593
+ emptyServicesSlot: p,
3594
+ onboardingIncompleteSlot: f,
3595
+ loadingDates: S,
3596
+ loadingSlots: g,
3597
+ slotLoadError: d,
3598
+ onRetrySlots: h,
3599
+ emptySlotsDescription: v,
3600
+ onDateSelect: u,
3601
+ onWindowChange: M,
3602
+ datePickerStyle: w,
3603
+ specialtyPickerStyle: C,
3604
+ servicePickerStyle: I,
3605
+ showServiceDuration: O,
3606
+ operatorPickerStyle: B,
3607
+ submitting: F,
3608
+ locale: R,
3609
+ detailsProps: $,
3610
+ policy: j,
3611
+ agentIdBase: T
3612
+ } = t;
3613
+ switch (e) {
3614
+ case 1:
3615
+ return /* @__PURE__ */ n(
3616
+ or,
3617
+ {
3618
+ value: o.insuranceType,
3619
+ onChange: (k) => c(jn(o, k))
3620
+ }
3621
+ );
3622
+ case 2:
3623
+ return /* @__PURE__ */ n(
3624
+ ar,
3625
+ {
3626
+ specialties: s.filtered.specialties,
3627
+ value: o.specialtyId,
3628
+ valueIds: o.specialtyIds,
3629
+ onChange: (k) => c(Un(o, k)),
3630
+ onChangeIds: (k) => c(Hn(o, k)),
3631
+ pickerStyle: C
3632
+ }
3633
+ );
3634
+ case 3:
3635
+ return s.filtered.services.length === 0 ? /* @__PURE__ */ n(mr, { customSlot: p }) : s.gates.onboardingIncomplete ? /* @__PURE__ */ n(lr, { customSlot: f }) : /* @__PURE__ */ n(
3636
+ cr,
3637
+ {
3638
+ services: s.filtered.services,
3639
+ value: o.serviceId,
3640
+ valueIds: o.serviceIds,
3641
+ onChange: (k) => c(Gn(o, k)),
3642
+ onChangeIds: (k) => c(Jn(o, k)),
3643
+ pickerStyle: I,
3644
+ compact: r.compactService,
3645
+ showDuration: O
3646
+ }
3647
+ );
3648
+ case 4:
3649
+ return /* @__PURE__ */ n(
3650
+ dr,
3651
+ {
3652
+ operators: s.filtered.operators,
3653
+ value: o.operatorId,
3654
+ valueIds: o.operatorIds,
3655
+ onChange: (k) => c(Wn(o, k)),
3656
+ onChangeIds: (k) => c(Yn(o, k)),
3657
+ pickerStyle: B
3658
+ }
3659
+ );
3660
+ case 5:
3661
+ return sr({
3662
+ activeStep: i,
3663
+ inputs: a,
3664
+ value: o,
3665
+ onChange: c,
3666
+ onDateSelect: u,
3667
+ onWindowChange: M,
3668
+ loadingDates: S,
3669
+ loadingSlots: g,
3670
+ slotLoadError: d,
3671
+ onRetrySlots: h,
3672
+ emptySlotsDescription: v,
3673
+ locale: R,
3674
+ datePickerStyle: w,
3675
+ agentIdBase: T
3676
+ });
3677
+ case 6:
3678
+ return ir({
3679
+ activeStep: i,
3680
+ inputs: a,
3681
+ value: o,
3682
+ onChange: c,
3683
+ loadingDates: S,
3684
+ loadingSlots: g,
3685
+ slotLoadError: d,
3686
+ onRetrySlots: h,
3687
+ emptySlotsDescription: v,
3688
+ locale: R,
3689
+ datePickerStyle: w
3690
+ });
3691
+ case 7:
3692
+ return s.selectedSlot ? /* @__PURE__ */ n(
3693
+ xn,
3694
+ {
3695
+ ...$,
3696
+ value: o.details ?? {},
3697
+ onChange: (k) => c({ ...o, details: k }),
3698
+ onSubmit: m,
3699
+ submitting: F,
3700
+ defaultPhoneCountry: j.country
3701
+ }
3702
+ ) : null;
3703
+ /* c8 ignore next 2 */
3704
+ default:
3705
+ return null;
3706
+ }
3707
+ }
3708
+ function cn() {
3709
+ const { t: e } = Q("ui");
3710
+ return K(
3711
+ () => ({
3712
+ 1: e("booking.insurance.heading"),
3713
+ 2: e("booking.specialty.heading"),
3714
+ 3: e("booking.service.heading"),
3715
+ 4: e("booking.operator.heading"),
3716
+ 5: e("booking.date.heading"),
3717
+ 6: e("booking.slot.heading"),
3718
+ 7: e("booking.details.heading")
3719
+ }),
3720
+ [e]
3721
+ );
3722
+ }
3723
+ function Ct(e, t) {
3724
+ return t === "four-day-grid" && e === 6 ? 5 : e;
3725
+ }
3726
+ function Si(e) {
3727
+ const { cascade: t, value: r, activeStep: i, setActiveStep: s, datePickerStyle: a } = e, o = cn(), { t: c } = Q("ui"), m = c("booking.operator.all"), p = K(
3728
+ () => Nn(t.visibleSteps, a),
3729
+ [t.visibleSteps, a]
3730
+ ), f = Ct(i, a), S = Math.max(0, p.indexOf(f)), g = K(
3731
+ () => p.map((d) => ({
3732
+ label: o[d],
3733
+ summary: fr(d, r, t, m),
3734
+ status: xi(d, r, t),
3735
+ content: /* @__PURE__ */ n(ce, { step: d, active: d === f, children: Fe(d, e, { compactService: !0 }) })
3736
+ })),
3737
+ [
3738
+ p,
3739
+ r,
3740
+ o,
3741
+ t,
3742
+ e,
3743
+ f,
3744
+ m
3745
+ ]
3746
+ );
3747
+ return /* @__PURE__ */ n(
3748
+ Or,
3749
+ {
3750
+ activeStep: S,
3751
+ steps: g,
3752
+ onStepChange: (d) => {
3753
+ const h = p[d];
3754
+ h && s(h);
3755
+ }
3756
+ }
3757
+ );
3758
+ }
3759
+ function xi(e, t, r) {
3760
+ return We(e, t) && e < r.currentStep ? "completed" : e <= r.currentStep ? "unlocked" : void 0;
3761
+ }
3762
+ function Pn(e, t) {
3763
+ return e !== 4 ? We(e, t) : t.operatorIds && t.operatorIds.length > 0 ? !0 : Xn(t) !== void 0;
3764
+ }
3765
+ function pn(e, t) {
3766
+ const r = e.map((i) => {
3767
+ var s;
3768
+ return (s = t.find((a) => a.id === i)) == null ? void 0 : s.label;
3769
+ }).filter((i) => i !== void 0);
3770
+ return r.length > 0 ? r.join(", ") : void 0;
3771
+ }
3772
+ function fr(e, t, r, i) {
3773
+ var s;
3774
+ if (We(e, t))
3775
+ switch (e) {
3776
+ case 1:
3777
+ return t.insuranceType;
3778
+ case 2:
3779
+ return pn(
3780
+ st(t),
3781
+ r.filtered.specialties
3782
+ );
3783
+ case 3:
3784
+ return pn(Ye(t), r.filtered.services);
3785
+ case 4: {
3786
+ const o = gn(t).filter((m) => m !== qe), c = pn(
3787
+ o,
3788
+ r.filtered.operators.map((m) => ({
3789
+ id: m.id,
3790
+ label: m.name
3791
+ }))
3792
+ );
3793
+ return c !== void 0 ? c : o.length === 0 ? i : void 0;
3794
+ }
3795
+ case 5:
3796
+ return t.date;
3797
+ case 6:
3798
+ return (s = r.selectedSlot) == null ? void 0 : s.time;
3799
+ case 7:
3800
+ return;
3801
+ }
3802
+ }
3803
+ function Ii(e) {
3804
+ const { cascade: t, value: r, activeStep: i, setActiveStep: s } = e, { t: a } = Q("ui"), o = cn(), c = a("booking.operator.all"), m = `${pt()}-filter`, p = Ct(i, e.datePickerStyle), f = t.visibleSteps.filter(
3805
+ (d) => d === 1 || d === 2 || d === 3 || d === 4
3806
+ ), S = f.some(
3807
+ (d) => !We(d, r)
3808
+ ), g = f.some(
3809
+ (d) => d === i
3810
+ ) ? i : f.find((d) => !We(d, r));
3811
+ return /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
3812
+ f.length > 0 ? /* @__PURE__ */ n(
3813
+ "div",
3814
+ {
3815
+ role: "group",
3816
+ "aria-label": a("booking.filtersLabel"),
3817
+ className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
3818
+ children: f.map((d) => {
3819
+ const h = fr(
3820
+ d,
3821
+ r,
3822
+ t,
3823
+ c
3824
+ ), v = d === g, u = We(d, r);
3825
+ return /* @__PURE__ */ n(
3826
+ Re,
3827
+ {
3828
+ intent: v ? "primary" : "outline",
3829
+ size: "sm",
3830
+ endIcon: /* @__PURE__ */ n(
3831
+ Fr,
3832
+ {
3833
+ "aria-hidden": "true",
3834
+ className: v ? "ds:rotate-180" : void 0
3835
+ }
3836
+ ),
3837
+ "aria-expanded": u ? v : void 0,
3838
+ "aria-controls": u && v ? m : void 0,
3839
+ "aria-current": !u && v ? "step" : void 0,
3840
+ onClick: () => s(
3841
+ u && v ? t.currentStep : d
3842
+ ),
3843
+ children: h ? /* @__PURE__ */ y(me, { children: [
3844
+ o[d],
3845
+ ": ",
3846
+ h
3847
+ ] }) : o[d]
3848
+ },
3849
+ `csc-${d}`
3850
+ );
3851
+ })
3852
+ }
3853
+ ) : null,
3854
+ g !== void 0 ? /* @__PURE__ */ n(
3855
+ ce,
3856
+ {
3857
+ step: g,
3858
+ active: g === p,
3859
+ id: m,
3860
+ children: Fe(g, e, { compactService: !0 })
3861
+ }
3862
+ ) : null,
3863
+ !S && t.gates.date ? (
3864
+ // four-day-grid embeds slots inline with the day strip — the
3865
+ // historic 2-col date|slot split collapses to a single column
3866
+ // so the picker spans the full width instead of orphaning an
3867
+ // empty right cell.
3868
+ e.datePickerStyle === "four-day-grid" ? /* @__PURE__ */ n(ce, { step: 5, active: p === 5, children: Fe(5, e) }) : /* @__PURE__ */ y("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:md:grid-cols-2", children: [
3869
+ /* @__PURE__ */ n(
3870
+ ce,
3871
+ {
3872
+ step: 5,
3873
+ active: p === 5,
3874
+ className: "ds:min-w-0",
3875
+ children: Fe(5, e)
3876
+ }
3877
+ ),
3878
+ r.date ? /* @__PURE__ */ n(
3879
+ ce,
3880
+ {
3881
+ step: 6,
3882
+ active: p === 6,
3883
+ className: "ds:min-w-0",
3884
+ children: Fe(6, e)
3885
+ }
3886
+ ) : /* @__PURE__ */ n("div", { className: "ds:min-w-0" })
3887
+ ] })
3888
+ ) : null,
3889
+ t.gates.details ? /* @__PURE__ */ n(ce, { step: 7, active: p === 7, children: Fe(7, e) }) : null
3890
+ ] });
3891
+ }
3892
+ function Ni(e) {
3893
+ const { cascade: t, datePickerStyle: r, activeStep: i } = e, s = Ct(i, r), a = t.visibleSteps.filter(
3894
+ (c) => c === 1 || c === 2 || c === 3 || c === 4
3895
+ );
3896
+ return /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
3897
+ /* @__PURE__ */ y(
3898
+ "div",
3899
+ {
3900
+ className: r === "four-day-grid" ? "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]" : "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:md:grid-cols-2",
3901
+ children: [
3902
+ /* @__PURE__ */ n("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: a.map((c) => /* @__PURE__ */ n(ce, { step: c, active: c === s, children: Fe(c, e, { compactService: !0 }) }, `fbf-${c}`)) }),
3903
+ /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
3904
+ t.gates.date ? /* @__PURE__ */ n(ce, { step: 5, active: s === 5, children: Fe(5, e) }) : null,
3905
+ t.gates.slot && e.value.date && r === "month-calendar" ? /* @__PURE__ */ n(ce, { step: 6, active: s === 6, children: Fe(6, e) }) : null
3906
+ ] })
3907
+ ]
3908
+ }
3909
+ ),
3910
+ t.gates.details ? /* @__PURE__ */ n(ce, { step: 7, active: s === 7, children: Fe(7, e) }) : null
3911
+ ] });
3912
+ }
3913
+ function wi(e) {
3914
+ const { cascade: t, value: r, activeStep: i, setActiveStep: s, datePickerStyle: a } = e, { t: o } = Q("ui"), c = cn(), m = K(
3915
+ () => Nn(t.visibleSteps, a),
3916
+ [t.visibleSteps, a]
3917
+ ), p = Ct(i, a), f = Math.max(0, m.indexOf(p)), S = m.length, g = K(
3918
+ () => m.map((u) => ({ label: c[u] })),
3919
+ [m, c]
3920
+ ), d = f > 0, h = p === 5 && a === "four-day-grid", v = f < S - 1 && m[f + 1] <= t.currentStep && We(p, r) && (!h || We(6, r));
3921
+ return /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
3922
+ /* @__PURE__ */ n(Dr, { activeStep: f, steps: g }),
3923
+ /* @__PURE__ */ n(ce, { step: p, active: !0, children: Fe(p, e, { compactService: !0 }) }),
3924
+ /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
3925
+ /* @__PURE__ */ n(
3926
+ Re,
3927
+ {
3928
+ intent: "ghost",
3929
+ size: "md",
3930
+ disabled: !d,
3931
+ onClick: () => {
3932
+ const u = m[f - 1];
3933
+ u && s(u);
3934
+ },
3935
+ children: o("booking.actions.back")
3936
+ }
3937
+ ),
3938
+ p < 7 ? /* @__PURE__ */ n(
3939
+ Re,
3940
+ {
3941
+ intent: "primary",
3942
+ size: "md",
3943
+ disabled: !v,
3944
+ onClick: () => {
3945
+ const u = m[f + 1];
3946
+ u && s(u);
3947
+ },
3948
+ children: o("booking.actions.next")
3949
+ }
3950
+ ) : null
3951
+ ] })
3952
+ ] });
3953
+ }
3954
+ const Ci = [], Ti = [];
3955
+ function Ai() {
3956
+ return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
3957
+ }
3958
+ const Mi = Vn(
3959
+ ({
3960
+ variant: e = "inline-list",
3961
+ country: t,
3962
+ // No default — the cascade engine treats `undefined` as "auto-on
3963
+ // when `specialties` has items" so consumers who pass specialty
3964
+ // data without the explicit flag still get the step.
3965
+ useSpecialties: r,
3966
+ allowOperatorSelection: i = !1,
3967
+ lockedOperatorId: s,
3968
+ operatorsByService: a = !1,
3969
+ autoSelectSingleService: o = !1,
3970
+ specialties: c,
3971
+ services: m,
3972
+ operators: p,
3973
+ availableDates: f,
3974
+ availableSlots: S,
3975
+ nextAvailableDate: g,
3976
+ hideEmail: d = !1,
3977
+ emailOptional: h = !1,
3978
+ requireCodiceFiscale: v,
3979
+ requireDateOfBirth: u,
3980
+ requireInsuranceNumber: M,
3981
+ billingInDetails: w = !1,
3982
+ paymentNoticeStyle: C = "highlighted",
3983
+ showNote: I,
3984
+ showReturningPatientFlag: O,
3985
+ privacyPolicyUrl: B,
3986
+ termsUrl: F,
3987
+ practiceConsent: R,
3988
+ paymentTermsUrl: $,
3989
+ paymentState: j,
3990
+ handoverDelayMs: T,
3991
+ onNavigate: k,
3992
+ renderPayment: L,
3993
+ renderPaymentCompletion: E,
3994
+ validateCodiceFiscale: b,
3995
+ validateInsuranceNumber: W,
3996
+ confirmationChannels: ne,
3997
+ defaultConfirmationChannels: Ne,
3998
+ singleConfirmationChannel: ge,
3999
+ value: N,
4000
+ onChange: q,
4001
+ onSubmit: Y,
4002
+ codeStep: U,
4003
+ onStepChange: ze,
4004
+ onDateSelect: Be,
4005
+ onWindowChange: he,
4006
+ datePickerStyle: ve = "month-calendar",
4007
+ specialtyPickerStyle: be,
4008
+ servicePickerStyle: ye,
4009
+ showServiceDuration: Oe = !0,
4010
+ operatorPickerStyle: De,
4011
+ loadingDates: ke,
4012
+ loadingSlots: oe,
4013
+ slotLoadError: ae,
4014
+ onRetrySlots: se,
4015
+ emptySlotsDescription: it,
4016
+ submitting: ft,
4017
+ submitError: Le,
4018
+ mode: ot = "live",
4019
+ showModifyOnSuccess: Z = !0,
4020
+ surface: Ke = "flat",
4021
+ emptyServicesSlot: Pt,
4022
+ onboardingIncompleteSlot: Tt,
4023
+ "aria-label": Vt,
4024
+ id: Ze,
4025
+ className: gt,
4026
+ onFocus: we,
4027
+ onBlur: At,
4028
+ ...$t
4029
+ }, qt) => {
4030
+ var wn, Cn, Tn;
4031
+ const { t: de, i18n: ht } = Q("ui"), Se = e ?? "inline-list", Ee = ht.language ?? "en", pe = c ?? Ci, at = p ?? Ti;
4032
+ V(() => {
4033
+ const x = Ns(N, {
4034
+ useSpecialties: r,
4035
+ lockedOperatorId: s,
4036
+ autoSelectSingleService: o,
4037
+ specialties: pe,
4038
+ services: m
4039
+ });
4040
+ (x.specialtyId !== N.specialtyId || x.operatorId !== N.operatorId || x.serviceId !== N.serviceId) && q(x);
4041
+ }, [
4042
+ s,
4043
+ r,
4044
+ o,
4045
+ pe,
4046
+ m
4047
+ ]);
4048
+ const [vt, ct] = J(!1), je = A(!1), bt = !!(ke || oe);
4049
+ V(() => {
4050
+ if (vt) {
4051
+ if (bt) {
4052
+ je.current = !0;
4053
+ return;
4054
+ }
4055
+ (je.current || !ae) && (je.current = !1, ct(!1));
4056
+ }
4057
+ }, [vt, bt, ae]);
4058
+ const Xe = K(
4059
+ () => se ? () => {
4060
+ je.current = !1, ct(!0), se();
4061
+ } : void 0,
4062
+ [se]
4063
+ ), Pe = !!(ae || vt && bt), z = K(
4064
+ () => Is({
4065
+ country: t,
4066
+ useSpecialties: r,
4067
+ allowOperatorSelection: i,
4068
+ lockedOperatorId: s,
4069
+ operatorsByService: a,
4070
+ specialties: pe,
4071
+ services: m,
4072
+ operators: at,
4073
+ availableSlots: S,
4074
+ value: Pe ? { ...N, slotKey: void 0 } : N
4075
+ }),
4076
+ [
4077
+ t,
4078
+ r,
4079
+ i,
4080
+ s,
4081
+ a,
4082
+ o,
4083
+ pe,
4084
+ m,
4085
+ at,
4086
+ f,
4087
+ S,
4088
+ N,
4089
+ Pe
4090
+ ]
4091
+ ), Ve = K(
4092
+ () => [
4093
+ JSON.stringify(N.insuranceType),
4094
+ JSON.stringify(st(N)),
4095
+ JSON.stringify(Ye(N)),
4096
+ JSON.stringify(gn(N)),
4097
+ JSON.stringify(N.date),
4098
+ JSON.stringify(N.slotKey)
4099
+ ],
4100
+ [N]
4101
+ ), yt = Se === "progress", Ce = Me(
4102
+ (x) => {
4103
+ if (x === 4 && z.visibleSteps.includes(4) && gn(N).length === 0)
4104
+ return Math.min(4, z.currentStep);
4105
+ if (!yt) return z.currentStep;
4106
+ const _ = z.visibleSteps.find(
4107
+ (P) => P > x && !Pn(P, N)
4108
+ );
4109
+ return _ === void 0 ? z.currentStep : Math.min(_, z.currentStep);
4110
+ },
4111
+ [yt, z.visibleSteps, z.currentStep, N]
4112
+ ), [ee, xe] = J(
4113
+ z.currentStep
4114
+ ), kt = A(null);
4115
+ V(() => {
4116
+ if (Pe) {
4117
+ ee > z.currentStep && (kt.current = {
4118
+ from: ee,
4119
+ to: z.currentStep
4120
+ }, xe(z.currentStep));
4121
+ return;
4122
+ }
4123
+ const x = kt.current;
4124
+ kt.current = null, x && ee === x.to && xe(
4125
+ Math.min(x.from, z.currentStep)
4126
+ );
4127
+ }, [Pe, ee, z.currentStep]);
4128
+ const Ue = A(Ve), St = A(z.visibleSteps);
4129
+ V(() => {
4130
+ const x = Ue.current, _ = St.current;
4131
+ Ue.current = Ve, St.current = z.visibleSteps;
4132
+ const P = Ve.findIndex(
4133
+ (Ie, An) => Ie !== x[An]
4134
+ );
4135
+ if (P !== -1) {
4136
+ xe(Ce(P + 1));
4137
+ return;
4138
+ }
4139
+ const ue = yt ? z.visibleSteps.find(
4140
+ (Ie) => Ie < ee && !_.includes(Ie) && !Pn(Ie, N)
4141
+ ) : void 0;
4142
+ if (ue !== void 0) {
4143
+ xe(ue);
4144
+ return;
4145
+ }
4146
+ z.visibleSteps.includes(ee) || xe(z.currentStep);
4147
+ }, [
4148
+ Ve,
4149
+ Ce,
4150
+ yt,
4151
+ z.currentStep,
4152
+ z.visibleSteps,
4153
+ ee,
4154
+ N
4155
+ ]);
4156
+ const Te = A(null), dt = K(
4157
+ () => Nn(z.visibleSteps, ve),
4158
+ [z.visibleSteps, ve]
4159
+ ), Mt = cn(), [zt, Kt] = J(""), He = A(null), $e = A(null);
4160
+ _t(() => {
4161
+ const x = He.current, _ = Te.current;
4162
+ if (!_ || !x || x.isConnected || document.activeElement !== document.body)
4163
+ return;
4164
+ const P = _.querySelector(Ln);
4165
+ ((ae && !ke && !oe ? _.querySelector("[data-slot-retry]") : null) ?? (P == null ? void 0 : P.querySelector("[data-slot-load-state]")) ?? P ?? _).focus({ preventScroll: !0 });
4166
+ }, [ae, ke, oe]), V(() => {
4167
+ const x = Ct(ee, ve);
4168
+ if ($e.current === null) {
4169
+ $e.current = x;
4170
+ return;
4171
+ }
4172
+ if ($e.current === x) return;
4173
+ $e.current = x;
4174
+ const _ = dt.indexOf(x);
4175
+ Kt(
4176
+ _ === -1 ? "" : de("booking.stepAnnouncement", {
4177
+ current: _ + 1,
4178
+ total: dt.length,
4179
+ label: Mt[x]
4180
+ })
4181
+ );
4182
+ const P = He.current;
4183
+ if (!P || P.isConnected) return;
4184
+ const ue = Te.current;
4185
+ if (!ue) return;
4186
+ const Ie = document.activeElement;
4187
+ if (!(Ie === null || Ie === document.body || !ue.contains(Ie))) return;
4188
+ const Wt = ue.querySelector(Ln) ?? ue;
4189
+ if (Wt.focus({ preventScroll: !0 }), typeof Wt.scrollIntoView == "function")
4190
+ try {
4191
+ Wt.scrollIntoView({
4192
+ behavior: Ai() ? "auto" : "smooth",
4193
+ block: "nearest"
4194
+ });
4195
+ } catch {
4196
+ Wt.scrollIntoView();
4197
+ }
4198
+ }, [ee, ve, dt, Mt, de]);
4199
+ const G = Ws({
4200
+ services: m,
4201
+ value: N,
4202
+ availableSlots: S,
4203
+ onSubmit: Y,
4204
+ onChange: q,
4205
+ paymentState: j,
4206
+ submitting: ft,
4207
+ paymentTermsUrl: $,
4208
+ renderPayment: L,
4209
+ codeStep: U
4210
+ }), H = G.status, jt = G.submit, Qe = A(G.reset);
4211
+ Qe.current = G.reset;
4212
+ const xt = A(!1), [dn, ln] = J(!1);
4213
+ V(() => {
4214
+ var _, P;
4215
+ if (!xt.current || H !== "idle") return;
4216
+ xt.current = !1;
4217
+ const x = (_ = Te.current) == null ? void 0 : _.querySelector(
4218
+ 'form input:not([type="hidden"]):not([data-honeypot]):not(:disabled), form select:not(:disabled), form textarea:not(:disabled)'
4219
+ );
4220
+ x && (x.focus({ preventScroll: !0 }), (P = x.scrollIntoView) == null || P.call(x, { block: "nearest" }));
4221
+ }, [H]);
4222
+ const Ut = pt(), Ht = A(null), lt = A(null), Rt = ((wn = G.state) == null ? void 0 : wn.status) === "failed", Ot = G.state && "phase" in G.state && G.state.phase === "completion";
4223
+ V(() => {
4224
+ var x, _;
4225
+ if (H === "payment") {
4226
+ const P = document.activeElement;
4227
+ (!Ot || !P || P === document.body || !((x = Te.current) != null && x.contains(P))) && ((_ = Ht.current) == null || _.focus());
4228
+ }
4229
+ }, [H, Ot]), V(() => {
4230
+ var x;
4231
+ H === "payment" && Rt && ((x = lt.current) == null || x.focus());
4232
+ }, [H, Rt]), hr(qt, () => Te.current, []);
4233
+ const te = H === "success" ? 8 : H === "payment" || H === "code" ? 7 : z.currentStep, Dt = A(null), le = A(0);
4234
+ _t(() => {
4235
+ var x;
4236
+ (H === "submitting" || H === "code" || H === "payment") && (le.current = ((x = Te.current) == null ? void 0 : x.offsetHeight) ?? 0);
4237
+ }), _t(() => {
4238
+ const x = Te.current;
4239
+ te !== 8 || !x || le.current === 0 || (x.style.setProperty(
4240
+ "--booking-held-height",
4241
+ `${le.current}px`
4242
+ ), le.current = 0);
4243
+ }, [te]), V(() => {
4244
+ if (te === Dt.current) return;
4245
+ Dt.current = te, ze == null || ze(te);
4246
+ const x = Te.current;
4247
+ if (te !== 8 || !x) return;
4248
+ const _ = () => x.style.removeProperty("--booking-held-height");
4249
+ tr(x, "start") ? Us(_) : _();
4250
+ }, [te, ze]);
4251
+ const et = A({ activeStep: ee, cascade: z, submitState: H });
4252
+ V(() => {
4253
+ et.current = { activeStep: ee, cascade: z, submitState: H };
4254
+ }, [ee, z, H]);
4255
+ const Et = K(
4256
+ () => ({
4257
+ getVariant: () => Se,
4258
+ getCurrentStep: () => {
4259
+ const x = et.current;
4260
+ return x.submitState === "success" ? 8 : x.submitState === "payment" || x.submitState === "code" ? 7 : x.activeStep;
4261
+ },
4262
+ reset: () => {
4263
+ et.current.submitState === "payment" || et.current.submitState === "code" || (q({}), Qe.current(), xe(1));
4264
+ },
4265
+ goToStep: (x) => {
4266
+ const _ = et.current, P = _.cascade.visibleSteps.includes(x), ue = _.cascade.currentStep, Ie = _.submitState === "payment" || _.submitState === "code" ? 7 : !P || x > ue ? ue : x;
4267
+ et.current = { ..._, activeStep: Ie }, xe(Ie);
4268
+ }
4269
+ }),
4270
+ [Se, q]
4271
+ );
4272
+ vr(hs, Et, Ze);
4273
+ const Gt = Vt ?? de("booking.regionLabel"), Ae = G.snapshot, Jt = H === "success" && Ae ? /* @__PURE__ */ n(
4274
+ yi,
4275
+ {
4276
+ codeVerified: G.codeVerified,
4277
+ handoverUrl: ti(G.redirectUrl),
4278
+ handoverDelayMs: T,
4279
+ onNavigate: k,
4280
+ payment: Ae.payment,
4281
+ confirmationChannels: ne,
4282
+ snapshot: {
4283
+ ...Ae.value,
4284
+ slot: Ae.slot,
4285
+ details: Ae.details,
4286
+ serviceId: ((Cn = Ae.payment) == null ? void 0 : Cn.serviceId) ?? Ae.slot.serviceId ?? Ae.value.serviceId
4287
+ },
4288
+ operators: at,
4289
+ specialties: pe,
4290
+ services: m,
4291
+ locale: Ee,
4292
+ mode: ot,
4293
+ showModify: Z && !Ae.payment && !G.codeVerified,
4294
+ onReset: () => Et.reset(),
4295
+ focusWasLost: () => {
4296
+ const x = He.current, _ = document.activeElement;
4297
+ return !!(x && !x.isConnected) && (!_ || _ === document.body);
4298
+ },
4299
+ onModify: () => {
4300
+ Qe.current(), xe(7);
4301
+ }
4302
+ }
4303
+ ) : null, It = H === "code" && G.codeStep ? /* @__PURE__ */ n(
4304
+ Hs,
4305
+ {
4306
+ ...G.codeStep,
4307
+ ...U,
4308
+ onVerified: G.completeCode,
4309
+ onBusyChange: ln
4310
+ }
4311
+ ) : null, Nt = G.activeSession, tt = G.state, l = Nt && tt ? {
4312
+ session: Nt,
4313
+ payment: Nt.payment,
4314
+ state: tt,
4315
+ billing: (Tn = G.snapshot) == null ? void 0 : Tn.details.billing
4316
+ } : void 0, D = tt && "phase" in tt && tt.phase === "completion", ie = H === "payment" && l ? /* @__PURE__ */ y(
4317
+ "section",
4318
+ {
4319
+ "aria-labelledby": Ut,
4320
+ "data-component": "booking-payment",
4321
+ "data-payment-status": l.state.status,
4322
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
4323
+ children: [
4324
+ /* @__PURE__ */ n(
4325
+ "h3",
4326
+ {
4327
+ ref: Ht,
4328
+ id: Ut,
4329
+ tabIndex: -1,
4330
+ className: "type-title-card ds:m-0",
4331
+ children: de(
4332
+ D ? "booking.payment.confirming" : "booking.payment.heading"
4333
+ )
4334
+ }
4335
+ ),
4336
+ D ? null : /* @__PURE__ */ n("p", { className: "type-body ds:m-0", children: de("booking.payment.noticeBody", {
4337
+ amount: on(
4338
+ l.payment.amountCents,
4339
+ l.payment.currencyCode,
4340
+ Ee
4341
+ )
4342
+ }) }),
4343
+ /* @__PURE__ */ n(
4344
+ "p",
4345
+ {
4346
+ role: "status",
4347
+ className: l.state.status === "processing" ? "type-body ds:m-0 ds:flex ds:items-center ds:gap-[var(--spacing-sm)]" : "ds:sr-only",
4348
+ children: l.state.status === "processing" ? /* @__PURE__ */ y(me, { children: [
4349
+ /* @__PURE__ */ n(qn, { variant: "pulse", size: "lg", "aria-hidden": "true" }),
4350
+ /* @__PURE__ */ n("span", { children: de(
4351
+ D ? "booking.payment.confirming" : "booking.payment.processing"
4352
+ ) })
4353
+ ] }) : null
4354
+ }
4355
+ ),
4356
+ l.state.status === "failed" ? /* @__PURE__ */ n(
4357
+ re,
4358
+ {
4359
+ ref: lt,
4360
+ variant: "error",
4361
+ tabIndex: -1,
4362
+ className: Bt,
4363
+ children: /* @__PURE__ */ n(re.Description, { children: l.state.error ?? de(
4364
+ D ? "booking.payment.completionFailed" : "booking.payment.failed"
4365
+ ) })
4366
+ }
4367
+ ) : null,
4368
+ D ? E == null ? void 0 : E(l) : L == null ? void 0 : L(l)
4369
+ ]
4370
+ }
4371
+ ) : null, nt = K(() => {
4372
+ const x = new Set(Ye(N)), _ = m.filter((P) => x.has(P.id)).map((P) => {
4373
+ var ue;
4374
+ return {
4375
+ label: P.label,
4376
+ text: ((ue = P.criticalInformationToAccept) == null ? void 0 : ue.trim()) ?? ""
4377
+ };
4378
+ }).filter((P) => P.text.length > 0);
4379
+ if (_.length !== 0)
4380
+ return _.length === 1 ? _[0].text : _.map((P) => `${P.label}: ${P.text}`).join(`
4381
+
4382
+ `);
4383
+ }, [m, N]), Ge = K(() => {
4384
+ if (H === "success" || H === "payment") return null;
4385
+ const x = Se === "accordion" ? Si : Se === "calendar" ? Ii : Se === "flexible" ? Ni : Se === "progress" ? wi : ki, _ = {
4386
+ cascade: z,
4387
+ inputs: {
4388
+ specialties: pe,
4389
+ services: m,
4390
+ operators: at,
4391
+ availableDates: f,
4392
+ availableSlots: S,
4393
+ nextAvailableDate: g
4394
+ },
4395
+ value: N,
4396
+ onChange: q,
4397
+ onSubmit: jt,
4398
+ policy: { country: t, lockedOperatorId: s },
4399
+ detailsProps: {
4400
+ hideEmail: d,
4401
+ emailOptional: h,
4402
+ requireCodiceFiscale: v,
4403
+ requireDateOfBirth: u,
4404
+ requireInsuranceNumber: M,
4405
+ insuranceType: N.insuranceType,
4406
+ showNote: I,
4407
+ showReturningPatientFlag: O,
4408
+ privacyPolicyUrl: B,
4409
+ termsUrl: F,
4410
+ practiceConsent: R,
4411
+ criticalInformationToAccept: nt,
4412
+ locked: H === "code",
4413
+ payment: G.payment,
4414
+ paymentTermsUrl: $,
4415
+ paymentBlocked: G.blocked,
4416
+ billingInDetails: w,
4417
+ paymentNoticeStyle: C,
4418
+ validateCodiceFiscale: b,
4419
+ validateInsuranceNumber: W,
4420
+ confirmationChannels: ne,
4421
+ defaultConfirmationChannels: Ne,
4422
+ singleConfirmationChannel: ge,
4423
+ submitError: Le ?? (H === "error" ? de("booking.payment.submitFailed") : void 0)
4424
+ },
4425
+ emptyServicesSlot: Pt,
4426
+ onboardingIncompleteSlot: Tt,
4427
+ loadingDates: ke,
4428
+ loadingSlots: oe,
4429
+ slotLoadError: ae,
4430
+ onRetrySlots: Xe,
4431
+ emptySlotsDescription: it,
4432
+ onDateSelect: Be,
4433
+ onWindowChange: he,
4434
+ datePickerStyle: ve,
4435
+ specialtyPickerStyle: be,
4436
+ servicePickerStyle: ye,
4437
+ showServiceDuration: Oe,
4438
+ operatorPickerStyle: De,
4439
+ submitting: ft || H === "submitting",
4440
+ locale: Ee,
4441
+ activeStep: ee,
4442
+ setActiveStep: xe,
4443
+ agentIdBase: Ze
4444
+ };
4445
+ return /* @__PURE__ */ n(x, { ..._ });
4446
+ }, [
4447
+ H,
4448
+ G.payment,
4449
+ G.blocked,
4450
+ $,
4451
+ de,
4452
+ Se,
4453
+ z,
4454
+ pe,
4455
+ m,
4456
+ at,
4457
+ f,
4458
+ S,
4459
+ g,
4460
+ N,
4461
+ q,
4462
+ jt,
4463
+ t,
4464
+ s,
4465
+ d,
4466
+ h,
4467
+ v,
4468
+ u,
4469
+ M,
4470
+ w,
4471
+ C,
4472
+ Le,
4473
+ I,
4474
+ O,
4475
+ B,
4476
+ F,
4477
+ R,
4478
+ nt,
4479
+ b,
4480
+ W,
4481
+ ne,
4482
+ Ne,
4483
+ ge,
4484
+ Pt,
4485
+ Tt,
4486
+ ke,
4487
+ oe,
4488
+ ae,
4489
+ Xe,
4490
+ it,
4491
+ Be,
4492
+ he,
4493
+ ve,
4494
+ be,
4495
+ ye,
4496
+ Oe,
4497
+ De,
4498
+ ft,
4499
+ Ee,
4500
+ ee,
4501
+ Ze
4502
+ ]);
4503
+ return /* @__PURE__ */ y(
4504
+ "div",
4505
+ {
4506
+ ref: Te,
4507
+ role: "region",
4508
+ "aria-label": Gt,
4509
+ id: Ze,
4510
+ "data-component": "booking",
4511
+ "data-component-id": Ze,
4512
+ "data-variant": Se,
4513
+ className: si({
4514
+ variant: Se,
4515
+ surface: Ke,
4516
+ className: gt
4517
+ }),
4518
+ tabIndex: -1,
4519
+ onFocus: (x) => {
4520
+ He.current = x.target, we == null || we(x);
4521
+ },
4522
+ onBlur: (x) => {
4523
+ const _ = x.target;
4524
+ window.setTimeout(() => {
4525
+ var ue;
4526
+ const P = document.activeElement;
4527
+ He.current === _ && _.isConnected && !(P && ((ue = Te.current) != null && ue.contains(P))) && (He.current = null);
4528
+ }), At == null || At(x);
4529
+ },
4530
+ ...$t,
4531
+ children: [
4532
+ /* @__PURE__ */ n("div", { role: "status", className: "ds:sr-only", children: zt }),
4533
+ /* @__PURE__ */ y(
4534
+ "div",
4535
+ {
4536
+ className: [
4537
+ "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]",
4538
+ "ds:rounded-[var(--radius-md)]",
4539
+ "ds:bg-[color-mix(in_srgb,var(--primary)_35%,var(--background))]",
4540
+ "ds:bg-[image:var(--gradient-hero-brand)]",
4541
+ "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
4542
+ "ds:pt-[var(--spacing-md)] ds:pb-[var(--spacing-md)]"
4543
+ ].join(" "),
4544
+ children: [
4545
+ /* @__PURE__ */ n("h2", { className: "type-title-card ds:text-[var(--foreground)] ds:m-0", children: de("booking.regionLabel") }),
4546
+ /* @__PURE__ */ n("p", { className: "type-body-sm ds:text-[var(--foreground)] ds:m-0", children: de("booking.headingSubtitle") })
4547
+ ]
4548
+ }
4549
+ ),
4550
+ G.cancelled ? /* @__PURE__ */ n(re, { variant: "info", children: /* @__PURE__ */ n(re.Description, { children: de("booking.payment.cancelled") }) }) : null,
4551
+ Jt ?? ie ?? /* @__PURE__ */ y(me, { children: [
4552
+ U ? /* @__PURE__ */ n(
4553
+ "fieldset",
4554
+ {
4555
+ "data-slot": "booking-form",
4556
+ disabled: It ? !0 : void 0,
4557
+ className: "ds:m-0 ds:min-w-0 ds:border-0 ds:p-0",
4558
+ children: Ge
4559
+ }
4560
+ ) : Ge,
4561
+ It ? /* @__PURE__ */ y(me, { children: [
4562
+ /* @__PURE__ */ n("div", { className: "ds:flex ds:justify-end", children: /* @__PURE__ */ n(
4563
+ Re,
4564
+ {
4565
+ type: "button",
4566
+ intent: "ghost",
4567
+ size: "md",
4568
+ disabled: dn,
4569
+ onClick: () => {
4570
+ xt.current = !0, Qe.current();
4571
+ },
4572
+ children: de("booking.actions.change")
4573
+ }
4574
+ ) }),
4575
+ It
4576
+ ] }) : null
4577
+ ] })
4578
+ ]
4579
+ }
4580
+ );
4581
+ }
4582
+ );
4583
+ Mi.displayName = "Booking";
4584
+ export {
4585
+ Mi as B,
4586
+ fn as C,
4587
+ qe as O,
4588
+ hs as b
4589
+ };
4590
+ //# sourceMappingURL=booking-opt_h7Uc.js.map