@hhgtech/hhg-components 1.29.528 → 1.29.529-beta-2

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 (561) hide show
  1. package/build/{InputDate-e44a5170.js → InputDate-93f8710a.js} +5 -5
  2. package/build/{LastPeriod-acd8425a.js → LastPeriod-2eff4596.js} +1 -1
  3. package/build/{MobileBottomNavigationIcon-391275dc.js → MobileBottomNavigationIcon-1bedc288.js} +3 -3
  4. package/build/{SiteWideBanner-5f5eef6e.js → SiteWideBanner-261649b6.js} +11 -11
  5. package/build/{Spinner-9cb85a18.js → Spinner-3a0c9ab4.js} +1 -1
  6. package/build/{WhatsApp-e2be209d.js → WhatsApp-cf18181b.js} +1 -1
  7. package/build/adapters.js +20 -20
  8. package/build/atoms.js +51 -51
  9. package/build/babyGrowth.js +86 -86
  10. package/build/cache.js +2 -2
  11. package/build/care/components/organisms/bookingSearchBarV3/SearchResultContent.d.ts +13 -0
  12. package/build/care/components/organisms/bookingSearchBarV3/constants.d.ts +4 -0
  13. package/build/care/components/organisms/bookingSearchBarV3/index.d.ts +42 -0
  14. package/build/care/components/organisms/bookingSearchBarV3/index.styled.d.ts +16 -0
  15. package/build/care/components/organisms/bookingSearchBarV3/reducer.d.ts +166 -0
  16. package/build/care/components/organisms/bookingSearchBarV3/searchInputs/ModalSearchResult.d.ts +8 -0
  17. package/build/care/components/organisms/bookingSearchBarV3/searchInputs/index.d.ts +35 -0
  18. package/build/care/components/organisms/bookingSearchBarV3/searchInputs/index.styled.d.ts +17 -0
  19. package/build/care/components/organisms/bookingSearchBarV3/searchLocation/CustomSelectItem.d.ts +9 -0
  20. package/build/care/components/organisms/bookingSearchBarV3/searchLocation/index.d.ts +16 -0
  21. package/build/care/components/organisms/bookingSearchBarV3/searchLocation/index.styled.d.ts +21 -0
  22. package/build/care/components/organisms/bookingSearchBarV3/searchResult/icons.d.ts +5 -0
  23. package/build/care/components/organisms/bookingSearchBarV3/searchResult/index.d.ts +22 -0
  24. package/build/care/components/organisms/bookingSearchBarV3/searchResult/index.styled.d.ts +21 -0
  25. package/build/care/components/organisms/bookingSearchBarV3/searchResultSpecialties/index.d.ts +12 -0
  26. package/build/care/components/organisms/bookingSearchBarV3/searchResultSpecialties/index.styled.d.ts +16 -0
  27. package/build/care/components/organisms/bookingSearchBarV3/searchSpecialty/CustomSelectItem.d.ts +9 -0
  28. package/build/care/components/organisms/bookingSearchBarV3/searchSpecialty/index.d.ts +15 -0
  29. package/build/care/components/organisms/bookingSearchBarV3/searchSpecialty/index.styled.d.ts +13 -0
  30. package/build/care/components/organisms/bookingSearchBarV3/searchTag/index.d.ts +17 -0
  31. package/build/care/components/organisms/bookingSearchBarV3/searchTag/index.styled.d.ts +13 -0
  32. package/build/care/components/organisms/bookingSearchBarV3/tabSearch/index.d.ts +11 -0
  33. package/build/care/components/organisms/bookingSearchBarV3/tabSearch/index.styled.d.ts +8 -0
  34. package/build/care/components/organisms/bookingSearchBarV3/types.d.ts +17 -0
  35. package/build/care/components/organisms/bookingSearchBarV3/useSearchBarApi.d.ts +21 -0
  36. package/build/care/index.d.ts +1 -0
  37. package/build/care.js +23 -22
  38. package/build/careBookingSearchBar.js +14 -14
  39. package/build/careBookingSearchBarV2.js +19 -19
  40. package/build/components/atoms/inputMB/index.styled.d.ts +3 -3
  41. package/build/components.js +106 -106
  42. package/build/{constants-8187e577.js → constants-02ab5aca.js} +2 -2
  43. package/build/{constants-978bec21.js → constants-cfdfe331.js} +1 -1
  44. package/build/constants.js +3 -3
  45. package/build/constantsDomainLocales.js +1 -1
  46. package/build/constantsRiskScreener.js +2 -2
  47. package/build/constantsSite.js +2 -2
  48. package/build/{core-df6980aa.js → core-b8acccee.js} +1 -1
  49. package/build/{dataTransform-4e9d4b21.js → dataTransform-8938057c.js} +1 -1
  50. package/build/ecom.js +5 -5
  51. package/build/{editor-1410b123.js → editor-0aa1896f.js} +11 -11
  52. package/build/embeddedHeathToolCards_babyGrowth.js +25 -25
  53. package/build/embeddedHeathToolCards_babyPoop.js +22 -22
  54. package/build/embeddedHeathToolCards_babyVaccine.js +24 -24
  55. package/build/embeddedHeathToolCards_bmi_bmi.js +27 -27
  56. package/build/embeddedHeathToolCards_bmrBmr.js +27 -27
  57. package/build/embeddedHeathToolCards_dueDate_dueDate.js +24 -24
  58. package/build/embeddedHeathToolCards_ovulation_ovulation.js +24 -24
  59. package/build/embeddedHeathToolCards_pwg_pwg.js +28 -28
  60. package/build/embeddedHeathToolCards_targetHeartRate.js +29 -29
  61. package/build/esm/{InputDate-8a6cea00.js → InputDate-cb3fb374.js} +5 -5
  62. package/build/esm/{LastPeriod-782d7853.js → LastPeriod-09ea1d5d.js} +1 -1
  63. package/build/esm/{MobileBottomNavigationIcon-fd28ef21.js → MobileBottomNavigationIcon-a23f871b.js} +3 -3
  64. package/build/esm/{SiteWideBanner-93e3d85b.js → SiteWideBanner-9db1131d.js} +11 -11
  65. package/build/esm/{Spinner-ac3cafdf.js → Spinner-97dabe81.js} +1 -1
  66. package/build/esm/{WhatsApp-f00db235.js → WhatsApp-6abfba84.js} +1 -1
  67. package/build/esm/adapters.js +20 -20
  68. package/build/esm/atoms.js +51 -51
  69. package/build/esm/babyGrowth.js +86 -86
  70. package/build/esm/cache.js +2 -2
  71. package/build/esm/care/components/organisms/bookingSearchBarV3/SearchResultContent.d.ts +13 -0
  72. package/build/esm/care/components/organisms/bookingSearchBarV3/constants.d.ts +4 -0
  73. package/build/esm/care/components/organisms/bookingSearchBarV3/index.d.ts +42 -0
  74. package/build/esm/care/components/organisms/bookingSearchBarV3/index.styled.d.ts +16 -0
  75. package/build/esm/care/components/organisms/bookingSearchBarV3/reducer.d.ts +166 -0
  76. package/build/esm/care/components/organisms/bookingSearchBarV3/searchInputs/ModalSearchResult.d.ts +8 -0
  77. package/build/esm/care/components/organisms/bookingSearchBarV3/searchInputs/index.d.ts +35 -0
  78. package/build/esm/care/components/organisms/bookingSearchBarV3/searchInputs/index.styled.d.ts +17 -0
  79. package/build/esm/care/components/organisms/bookingSearchBarV3/searchLocation/CustomSelectItem.d.ts +9 -0
  80. package/build/esm/care/components/organisms/bookingSearchBarV3/searchLocation/index.d.ts +16 -0
  81. package/build/esm/care/components/organisms/bookingSearchBarV3/searchLocation/index.styled.d.ts +21 -0
  82. package/build/esm/care/components/organisms/bookingSearchBarV3/searchResult/icons.d.ts +5 -0
  83. package/build/esm/care/components/organisms/bookingSearchBarV3/searchResult/index.d.ts +22 -0
  84. package/build/esm/care/components/organisms/bookingSearchBarV3/searchResult/index.styled.d.ts +21 -0
  85. package/build/esm/care/components/organisms/bookingSearchBarV3/searchResultSpecialties/index.d.ts +12 -0
  86. package/build/esm/care/components/organisms/bookingSearchBarV3/searchResultSpecialties/index.styled.d.ts +16 -0
  87. package/build/esm/care/components/organisms/bookingSearchBarV3/searchSpecialty/CustomSelectItem.d.ts +9 -0
  88. package/build/esm/care/components/organisms/bookingSearchBarV3/searchSpecialty/index.d.ts +15 -0
  89. package/build/esm/care/components/organisms/bookingSearchBarV3/searchSpecialty/index.styled.d.ts +13 -0
  90. package/build/esm/care/components/organisms/bookingSearchBarV3/searchTag/index.d.ts +17 -0
  91. package/build/esm/care/components/organisms/bookingSearchBarV3/searchTag/index.styled.d.ts +13 -0
  92. package/build/esm/care/components/organisms/bookingSearchBarV3/tabSearch/index.d.ts +11 -0
  93. package/build/esm/care/components/organisms/bookingSearchBarV3/tabSearch/index.styled.d.ts +8 -0
  94. package/build/esm/care/components/organisms/bookingSearchBarV3/types.d.ts +17 -0
  95. package/build/esm/care/components/organisms/bookingSearchBarV3/useSearchBarApi.d.ts +21 -0
  96. package/build/esm/care/index.d.ts +1 -0
  97. package/build/esm/care.js +22 -22
  98. package/build/esm/careBookingSearchBar.js +14 -14
  99. package/build/esm/careBookingSearchBarV2.js +19 -19
  100. package/build/esm/components/atoms/inputMB/index.styled.d.ts +3 -3
  101. package/build/esm/components.js +106 -106
  102. package/build/esm/{constants-1d2564ea.js → constants-0585abda.js} +1 -1
  103. package/build/esm/{constants-ebc698d1.js → constants-5c8e090a.js} +2 -2
  104. package/build/esm/constants.js +3 -3
  105. package/build/esm/constantsDomainLocales.js +1 -1
  106. package/build/esm/constantsRiskScreener.js +2 -2
  107. package/build/esm/constantsSite.js +2 -2
  108. package/build/esm/{core-f02df1ea.js → core-f280bfb7.js} +1 -1
  109. package/build/esm/{dataTransform-7ec80df6.js → dataTransform-a4c4d198.js} +1 -1
  110. package/build/esm/ecom.js +5 -5
  111. package/build/esm/{editor-95beb114.js → editor-46ae846f.js} +11 -11
  112. package/build/esm/embeddedHeathToolCards_babyGrowth.js +25 -25
  113. package/build/esm/embeddedHeathToolCards_babyPoop.js +22 -22
  114. package/build/esm/embeddedHeathToolCards_babyVaccine.js +24 -24
  115. package/build/esm/embeddedHeathToolCards_bmi_bmi.js +27 -27
  116. package/build/esm/embeddedHeathToolCards_bmrBmr.js +27 -27
  117. package/build/esm/embeddedHeathToolCards_dueDate_dueDate.js +24 -24
  118. package/build/esm/embeddedHeathToolCards_ovulation_ovulation.js +24 -24
  119. package/build/esm/embeddedHeathToolCards_pwg_pwg.js +28 -28
  120. package/build/esm/embeddedHeathToolCards_targetHeartRate.js +29 -29
  121. package/build/esm/footer.js +22 -22
  122. package/build/esm/gAssets.js +2 -2
  123. package/build/esm/{healthTools-a478793b.js → healthTools-d1706ea2.js} +1 -1
  124. package/build/esm/healthToolsCardWrapper.js +20 -20
  125. package/build/esm/healthToolsForm.js +35 -35
  126. package/build/esm/hooks.js +14 -14
  127. package/build/esm/i18n.js +2 -2
  128. package/build/esm/i18nV2.js +2 -2
  129. package/build/esm/{index-873a735a.js → index-01f9872d.js} +7 -7
  130. package/build/esm/{index-80102061.js → index-0914004f.js} +3 -3
  131. package/build/esm/{index-6615252e.js → index-0a4fd2fe.js} +2 -2
  132. package/build/esm/{index-0cf4fb1a.js → index-0c31e5b6.js} +22 -22
  133. package/build/esm/{index-e30b89da.js → index-15ebe717.js} +16 -16
  134. package/build/esm/{index-1ef3bd24.js → index-1c22adc6.js} +17 -17
  135. package/build/esm/{index-1d71825a.js → index-1c309056.js} +3 -3
  136. package/build/esm/{index-75a9c5b3.js → index-294e0255.js} +2 -2
  137. package/build/esm/{index-ad9c69f5.js → index-29956cbd.js} +15 -15
  138. package/build/esm/{index-51642785.js → index-2d5dc1ea.js} +1 -1
  139. package/build/esm/{index-6c9ffea1.js → index-33275835.js} +6 -6
  140. package/build/esm/{index-bf75e23b.js → index-38f8e083.js} +2 -2
  141. package/build/esm/{index-d35dccbb.js → index-3c752506.js} +24 -24
  142. package/build/esm/{index-d5f782eb.js → index-3dfd3c89.js} +2 -2
  143. package/build/esm/{index-8ad71dae.js → index-403ea7da.js} +16 -16
  144. package/build/esm/{index-e29051bf.js → index-4597e0c7.js} +32 -32
  145. package/build/esm/{index-b79948be.js → index-46ee8441.js} +6 -6
  146. package/build/esm/{index-49993060.js → index-4a04d25e.js} +2 -2
  147. package/build/esm/{index-90c6261d.js → index-50fe015f.js} +2 -2
  148. package/build/esm/{index-e21fd7e1.js → index-513b59c7.js} +3 -3
  149. package/build/esm/{index-ad0c95a7.js → index-5cbebe59.js} +9 -9
  150. package/build/esm/{index-dc74d2a2.js → index-5fca77ea.js} +2 -2
  151. package/build/esm/{index-cc5f3d4b.js → index-65afb592.js} +9 -9
  152. package/build/esm/{index-0c8a796f.js → index-6632486d.js} +2 -2
  153. package/build/esm/{index-2fc6abb3.js → index-6ad42f98.js} +13 -13
  154. package/build/esm/{index-1c22f471.js → index-6be2580c.js} +2 -2
  155. package/build/esm/{index-d6463809.js → index-6f6782e6.js} +8 -8
  156. package/build/esm/{index-969578b1.js → index-72793c45.js} +13 -13
  157. package/build/esm/{index-3699be44.js → index-78856a79.js} +2 -2
  158. package/build/esm/{index-4e4a4448.js → index-7ab4987e.js} +2 -2
  159. package/build/esm/{index-e8e284f7.js → index-7dfa4cef.js} +1 -1
  160. package/build/esm/{index-4786dd1b.js → index-84923210.js} +4 -4
  161. package/build/esm/{index-9313ba10.js → index-86019d94.js} +5 -5
  162. package/build/esm/{index-a4fb5c60.js → index-89edea71.js} +16 -16
  163. package/build/esm/{index-28c3f888.js → index-8ae1021f.js} +3 -3
  164. package/build/esm/{index-fea9434a.js → index-8b566b15.js} +3 -3
  165. package/build/esm/{index-7061fdca.js → index-8c7798ae.js} +2 -2
  166. package/build/esm/{index-a7cbb0b9.js → index-8d9a544b.js} +1 -1
  167. package/build/esm/{index-29614899.js → index-8f99ebe7.js} +3 -3
  168. package/build/esm/{index-cea40631.js → index-9897533a.js} +33 -33
  169. package/build/esm/{index-14c5e5f8.js → index-9eff77a8.js} +14 -14
  170. package/build/esm/{index-b07e5ab0.js → index-9f33d631.js} +3 -3
  171. package/build/esm/{index-96cfc6d0.js → index-a05a3e52.js} +21 -21
  172. package/build/esm/{index-d1643abc.js → index-a25cb4db.js} +1 -1
  173. package/build/esm/{index-19b57024.js → index-a7c2c44a.js} +18 -18
  174. package/build/esm/{index-18597dc3.js → index-ab69b47b.js} +2 -2
  175. package/build/esm/{index-e102e0b2.js → index-ab6dd7b2.js} +15 -15
  176. package/build/esm/{index-8828f77d.js → index-af0ad684.js} +25 -25
  177. package/build/esm/{index-8d70c74a.js → index-b087a047.js} +4 -4
  178. package/build/esm/index-b3066d7a.js +1942 -0
  179. package/build/esm/{index-ba4cfc72.js → index-b32b0f9c.js} +2 -2
  180. package/build/esm/{index-729cb32a.js → index-b5494dc0.js} +18 -18
  181. package/build/esm/{index-52f5a292.js → index-b74cf15f.js} +15 -15
  182. package/build/esm/{index-72b972f5.js → index-b8257c21.js} +1 -1
  183. package/build/esm/{index-0aac98d9.js → index-b8e57785.js} +32 -32
  184. package/build/esm/{index-5c7ecb24.js → index-c8e8a848.js} +6 -6
  185. package/build/esm/{index-d957287d.js → index-cc2761d7.js} +1 -1
  186. package/build/esm/{index-e670af0e.js → index-ce15abdf.js} +6 -6
  187. package/build/esm/{index-8347736a.js → index-d17ae3b0.js} +3 -3
  188. package/build/esm/{index-73b17150.js → index-d1f4aeb1.js} +1 -1
  189. package/build/esm/{index-7d3b5c77.js → index-d4adbb94.js} +2 -2
  190. package/build/esm/{index-61c5b995.js → index-d9a6d08a.js} +11 -11
  191. package/build/esm/{index-fdb5c913.js → index-e08d57d4.js} +3 -3
  192. package/build/esm/{index-c3579fb3.js → index-e570b8d8.js} +2 -2
  193. package/build/esm/{index-caba5feb.js → index-ed716e00.js} +16 -16
  194. package/build/esm/{index-997d9afe.js → index-ef3a1ff0.js} +14 -14
  195. package/build/esm/{index-b13dc946.js → index-f2246c49.js} +7 -7
  196. package/build/esm/{index-8ff3d8b9.js → index-f890b580.js} +19 -19
  197. package/build/esm/{index-54a358f7.js → index-fda9c1f1.js} +3 -3
  198. package/build/esm/{index-5a3a3f42.js → index-fe9a3a41.js} +14 -14
  199. package/build/esm/{index-1e03896e.js → index-ffacce58.js} +5 -5
  200. package/build/esm/index.js +126 -126
  201. package/build/esm/{labelSorting-0ff4b693.js → labelSorting-b25214f6.js} +4 -4
  202. package/build/esm/lead.js +37 -37
  203. package/build/esm/{logoIcon-a24cf073.js → logoIcon-3d1d8927.js} +2 -2
  204. package/build/esm/mantine.js +27 -27
  205. package/build/esm/misc.js +19 -19
  206. package/build/esm/miscGetDynamicHealthTool.js +4 -4
  207. package/build/esm/miscGetSocialList.js +8 -8
  208. package/build/esm/miscScreenSizeContext.js +1 -1
  209. package/build/esm/mobileBottomNavigation.js +5 -5
  210. package/build/esm/mobileBottomNavigationIcon.js +5 -5
  211. package/build/esm/molecules.js +79 -79
  212. package/build/esm/moleculesArticleCard.js +6 -6
  213. package/build/esm/moleculesArticleCardV2.js +17 -17
  214. package/build/esm/navigation.js +49 -49
  215. package/build/esm/navigationLogoutPopup.js +11 -11
  216. package/build/esm/navigationProfileButton.js +27 -27
  217. package/build/esm/onboardingV2.js +30 -30
  218. package/build/esm/organisms.js +62 -62
  219. package/build/esm/{post-e85d518d.js → post-f9fbdafe.js} +2 -2
  220. package/build/esm/profileNavigation.js +20 -20
  221. package/build/esm/progressBar.js +1 -1
  222. package/build/esm/pwg.js +23 -23
  223. package/build/esm/ssoV2/screens/updateEmail.d.ts +4 -2
  224. package/build/esm/ssoV2/ssoStateManager/store.d.ts +1 -0
  225. package/build/esm/ssoV2.js +88 -70
  226. package/build/esm/{store-58945988.js → store-95a9812e.js} +37 -28
  227. package/build/esm/subot.js +40 -40
  228. package/build/esm/surveyOrPremiumBanner.js +34 -34
  229. package/build/esm/surveyQuestionCard.js +11 -11
  230. package/build/esm/{surveyThankyouCard-020bd785.js → surveyThankyouCard-22a44c5a.js} +5 -5
  231. package/build/esm/together.js +57 -57
  232. package/build/esm/togetherApiUtils.js +6 -6
  233. package/build/esm/togetherAtoms.js +31 -31
  234. package/build/esm/togetherComponentGlobalContext.js +6 -6
  235. package/build/esm/togetherMolecules.js +52 -52
  236. package/build/esm/togetherMoleculesCardAuthor.js +29 -29
  237. package/build/esm/togetherMoleculesPostImagePreview.js +13 -13
  238. package/build/esm/togetherMoleculesProfileDetail.js +40 -40
  239. package/build/esm/togetherOrganisms.js +51 -51
  240. package/build/esm/togetherRichTextEditor.js +20 -20
  241. package/build/esm/togetherShareBox.js +12 -12
  242. package/build/esm/{transform-54db313c.js → transform-963ad2a4.js} +27 -27
  243. package/build/esm/{translationsProvider-74ef088c.js → translationsProvider-c11de9d1.js} +1 -1
  244. package/build/esm/{treePopoverMenu-43e10598.js → treePopoverMenu-13999c6e.js} +19 -19
  245. package/build/esm/types.js +2 -2
  246. package/build/esm/{useCartCareService-78b0a223.js → useCartCareService-6985a53a.js} +1 -1
  247. package/build/esm/{useHealthToolCache-a120abd1.js → useHealthToolCache-3a9d2e47.js} +1 -1
  248. package/build/esm/{usePhoneValidator-6ac61ebc.js → usePhoneValidator-d802c149.js} +5 -5
  249. package/build/esm/{usePlacesAutocomplete-09a0e342.js → usePlacesAutocomplete-5680f5bb.js} +1 -1
  250. package/build/esm/useTogetherAuthRequiredAction.js +10 -10
  251. package/build/esm/{utils-78865776.js → utils-74a8f69f.js} +2 -2
  252. package/build/esm/{utils-9b4e448e.js → utils-84017753.js} +3 -3
  253. package/build/esm/{utils-4560ea01.js → utils-90449570.js} +5 -5
  254. package/build/esm/{utils-e4a74b46.js → utils-cac7bd05.js} +3 -3
  255. package/build/esm/{utils-e56045d9.js → utils-e8fd9273.js} +2 -2
  256. package/build/esm/vaccination.js +22 -22
  257. package/build/footer.js +22 -22
  258. package/build/gAssets.js +2 -2
  259. package/build/{healthTools-4c002c0b.js → healthTools-cc51a5fc.js} +1 -1
  260. package/build/healthToolsCardWrapper.js +20 -20
  261. package/build/healthToolsForm.js +35 -35
  262. package/build/hooks.js +14 -14
  263. package/build/i18n.js +2 -2
  264. package/build/i18nV2.js +1 -1
  265. package/build/{index-a027ddce.js → index-02e045e8.js} +3 -3
  266. package/build/{index-e6ee6bb1.js → index-06b75878.js} +33 -33
  267. package/build/{index-8a641926.js → index-09c48a13.js} +1 -1
  268. package/build/{index-3d073609.js → index-0bafca3b.js} +5 -5
  269. package/build/{index-9175f3dc.js → index-0c383e9e.js} +1 -1
  270. package/build/{index-fea268f5.js → index-0e71f7a9.js} +4 -4
  271. package/build/{index-f104b7d3.js → index-0ffcf757.js} +1 -1
  272. package/build/{index-43597605.js → index-11a7f0b1.js} +9 -9
  273. package/build/{index-0d3129b1.js → index-12cb0fd4.js} +6 -6
  274. package/build/{index-78d490d2.js → index-144e70fe.js} +3 -3
  275. package/build/{index-2c0ceb91.js → index-14b9c725.js} +3 -3
  276. package/build/{index-a0fe3cd0.js → index-1f805a45.js} +2 -2
  277. package/build/{index-3f93a7ef.js → index-228bab01.js} +32 -32
  278. package/build/{index-c037399a.js → index-24b985fa.js} +14 -14
  279. package/build/{index-abed94ee.js → index-24cb1a39.js} +7 -7
  280. package/build/{index-b919614c.js → index-273f9705.js} +1 -1
  281. package/build/{index-9cdb8ffc.js → index-2bb1f6de.js} +5 -5
  282. package/build/{index-68b3b9cc.js → index-2c307d5a.js} +25 -25
  283. package/build/{index-55741379.js → index-2d84f0b4.js} +1 -1
  284. package/build/{index-5057d16f.js → index-2f815469.js} +2 -2
  285. package/build/{index-30398c28.js → index-2f9237cd.js} +4 -4
  286. package/build/{index-8d636c5e.js → index-31ec285e.js} +15 -15
  287. package/build/{index-d08623ad.js → index-35e6955c.js} +16 -16
  288. package/build/index-384b975c.js +1951 -0
  289. package/build/{index-54f20948.js → index-39d35345.js} +1 -1
  290. package/build/{index-e72051d3.js → index-3ecc1113.js} +2 -2
  291. package/build/{index-aa442c73.js → index-41a3388a.js} +2 -2
  292. package/build/{index-94b27427.js → index-49bcfe55.js} +2 -2
  293. package/build/{index-317470d8.js → index-4a671c5a.js} +13 -13
  294. package/build/{index-4f61ac85.js → index-4cae5c26.js} +32 -32
  295. package/build/{index-5bc65809.js → index-54bc5603.js} +6 -6
  296. package/build/{index-034a704f.js → index-5644ca7f.js} +7 -7
  297. package/build/{index-7dbf4343.js → index-5f280f6f.js} +1 -1
  298. package/build/{index-2dc73063.js → index-61f7b016.js} +18 -18
  299. package/build/{index-6699754e.js → index-62da42cf.js} +13 -13
  300. package/build/{index-071fc285.js → index-6554e5ba.js} +3 -3
  301. package/build/{index-f3df57f3.js → index-65d4ab7f.js} +2 -2
  302. package/build/{index-99d8372b.js → index-6731f2f1.js} +2 -2
  303. package/build/{index-d0193408.js → index-677f7e12.js} +19 -19
  304. package/build/{index-ad516504.js → index-6845f9df.js} +3 -3
  305. package/build/{index-015f890f.js → index-6d9db5b4.js} +6 -6
  306. package/build/{index-9368f4ba.js → index-72f930ea.js} +8 -8
  307. package/build/{index-ac37f6c0.js → index-78faf82f.js} +16 -16
  308. package/build/{index-ec50dce8.js → index-7a877e10.js} +3 -3
  309. package/build/{index-8f89038a.js → index-7b37ed99.js} +15 -15
  310. package/build/{index-dab87a70.js → index-8059d636.js} +2 -2
  311. package/build/{index-a1138fdb.js → index-8cbedde4.js} +9 -9
  312. package/build/{index-c0797540.js → index-988586e6.js} +2 -2
  313. package/build/{index-08ce6245.js → index-a4a54068.js} +2 -2
  314. package/build/{index-bda9fc0f.js → index-a5dc52a5.js} +14 -14
  315. package/build/{index-fc3632d1.js → index-aaec4f92.js} +16 -16
  316. package/build/{index-0e60b5c7.js → index-ab4cfded.js} +18 -18
  317. package/build/{index-859d9704.js → index-ab6b3ac3.js} +11 -11
  318. package/build/{index-de56de6f.js → index-b84ae41b.js} +14 -14
  319. package/build/{index-7979a7fd.js → index-bc4537bc.js} +3 -3
  320. package/build/{index-9c06a9f8.js → index-bfe68813.js} +6 -6
  321. package/build/{index-31a7199d.js → index-c0e2c07f.js} +2 -2
  322. package/build/{index-2a0e7ab6.js → index-ca31af29.js} +3 -3
  323. package/build/{index-abacafb1.js → index-cca9fd6d.js} +2 -2
  324. package/build/{index-bb486b2b.js → index-d1e98400.js} +16 -16
  325. package/build/{index-07443896.js → index-d6a51c79.js} +2 -2
  326. package/build/{index-af18e92c.js → index-e7761918.js} +3 -3
  327. package/build/{index-2823f5ed.js → index-e8b8cb6b.js} +3 -3
  328. package/build/{index-4b4ffab8.js → index-edc1348b.js} +22 -22
  329. package/build/{index-9a1a2a20.js → index-f2ab0ab4.js} +24 -24
  330. package/build/{index-8ed68f29.js → index-f3aa68a7.js} +15 -15
  331. package/build/{index-5fdcef88.js → index-f723c49d.js} +2 -2
  332. package/build/{index-c74a66ef.js → index-f824d68f.js} +17 -17
  333. package/build/{index-626df4e1.js → index-f9a2c77c.js} +21 -21
  334. package/build/{index-7922e69e.js → index-fb83b2cc.js} +2 -2
  335. package/build/{index-dd216b8d.js → index-ffe2b143.js} +2 -2
  336. package/build/index.js +127 -126
  337. package/build/{labelSorting-7fc632e0.js → labelSorting-362cd978.js} +4 -4
  338. package/build/lead.js +37 -37
  339. package/build/{logoIcon-bfcdf2f9.js → logoIcon-3f185d9f.js} +2 -2
  340. package/build/mantine.js +25 -25
  341. package/build/misc.js +19 -19
  342. package/build/miscGetDynamicHealthTool.js +4 -4
  343. package/build/miscGetSocialList.js +8 -8
  344. package/build/miscScreenSizeContext.js +1 -1
  345. package/build/mobileBottomNavigation.js +5 -5
  346. package/build/mobileBottomNavigationIcon.js +5 -5
  347. package/build/molecules.js +79 -79
  348. package/build/moleculesArticleCard.js +6 -6
  349. package/build/moleculesArticleCardV2.js +17 -17
  350. package/build/navigation.js +49 -49
  351. package/build/navigationLogoutPopup.js +11 -11
  352. package/build/navigationProfileButton.js +27 -27
  353. package/build/onboardingV2.js +29 -29
  354. package/build/organisms.js +62 -62
  355. package/build/{post-a8461958.js → post-09ea2ae6.js} +2 -2
  356. package/build/profileNavigation.js +20 -20
  357. package/build/progressBar.js +1 -1
  358. package/build/pwg.js +23 -23
  359. package/build/ssoV2/screens/updateEmail.d.ts +4 -2
  360. package/build/ssoV2/ssoStateManager/store.d.ts +1 -0
  361. package/build/ssoV2.js +86 -68
  362. package/build/{store-61cad318.js → store-7b4ece91.js} +37 -28
  363. package/build/subot.js +39 -39
  364. package/build/surveyOrPremiumBanner.js +34 -34
  365. package/build/surveyQuestionCard.js +11 -11
  366. package/build/{surveyThankyouCard-896e9d87.js → surveyThankyouCard-bbc979fa.js} +5 -5
  367. package/build/together.js +57 -57
  368. package/build/togetherApiUtils.js +6 -6
  369. package/build/togetherAtoms.js +31 -31
  370. package/build/togetherComponentGlobalContext.js +6 -6
  371. package/build/togetherMolecules.js +52 -52
  372. package/build/togetherMoleculesCardAuthor.js +29 -29
  373. package/build/togetherMoleculesPostImagePreview.js +13 -13
  374. package/build/togetherMoleculesProfileDetail.js +40 -40
  375. package/build/togetherOrganisms.js +51 -51
  376. package/build/togetherRichTextEditor.js +20 -20
  377. package/build/togetherShareBox.js +12 -12
  378. package/build/{transform-f5678a32.js → transform-32454869.js} +27 -27
  379. package/build/{translationsProvider-7e6db534.js → translationsProvider-1561f904.js} +1 -1
  380. package/build/{treePopoverMenu-d6b74bd6.js → treePopoverMenu-75662739.js} +19 -19
  381. package/build/types.js +2 -2
  382. package/build/{useCartCareService-202114a6.js → useCartCareService-69cdb83f.js} +1 -1
  383. package/build/{useHealthToolCache-25f3cf03.js → useHealthToolCache-5bd11566.js} +1 -1
  384. package/build/{usePhoneValidator-36d897da.js → usePhoneValidator-da86ba48.js} +5 -5
  385. package/build/{usePlacesAutocomplete-437f7caf.js → usePlacesAutocomplete-1326ec25.js} +1 -1
  386. package/build/useTogetherAuthRequiredAction.js +10 -10
  387. package/build/{utils-4d304390.js → utils-035b5dce.js} +3 -3
  388. package/build/{utils-1aeabb49.js → utils-14347fda.js} +2 -2
  389. package/build/{utils-082f61e1.js → utils-a1749bd9.js} +5 -5
  390. package/build/{utils-bc652d73.js → utils-d6b2803d.js} +3 -3
  391. package/build/{utils-b3fa920f.js → utils-eee36594.js} +2 -2
  392. package/build/vaccination.js +22 -22
  393. package/package.json +1 -1
  394. package/build/esm/index-3ecee9df.js +0 -31
  395. package/build/index-4519c910.js +0 -38
  396. /package/build/{BMI_BOYS.percentile.monthly-c8cb7280.js → BMI_BOYS.percentile.monthly-65a2c694.js} +0 -0
  397. /package/build/{BMI_BOYS.percentile.weekly-55ff6bc1.js → BMI_BOYS.percentile.weekly-fcc71ab1.js} +0 -0
  398. /package/build/{BMI_BOYS.percentile.yearly-ae309cc1.js → BMI_BOYS.percentile.yearly-1b892cd3.js} +0 -0
  399. /package/build/{BMI_BOYS.zscore.monthly-51faa333.js → BMI_BOYS.zscore.monthly-7b740191.js} +0 -0
  400. /package/build/{BMI_BOYS.zscore.weekly-c8bc4567.js → BMI_BOYS.zscore.weekly-68ae80be.js} +0 -0
  401. /package/build/{BMI_BOYS.zscore.yearly-3e94c386.js → BMI_BOYS.zscore.yearly-0f534a12.js} +0 -0
  402. /package/build/{BMI_GIRLS.percentile.monthly-2f0f4651.js → BMI_GIRLS.percentile.monthly-50efef41.js} +0 -0
  403. /package/build/{BMI_GIRLS.percentile.weekly-f3d8cc3f.js → BMI_GIRLS.percentile.weekly-9ecc57f6.js} +0 -0
  404. /package/build/{BMI_GIRLS.percentile.yearly-ce01bdfd.js → BMI_GIRLS.percentile.yearly-0dd711be.js} +0 -0
  405. /package/build/{BMI_GIRLS.zscore.monthly-c30a5aa7.js → BMI_GIRLS.zscore.monthly-58e6237c.js} +0 -0
  406. /package/build/{BMI_GIRLS.zscore.weekly-850dcf70.js → BMI_GIRLS.zscore.weekly-2d6e5342.js} +0 -0
  407. /package/build/{BMI_GIRLS.zscore.yearly-c14aaf5e.js → BMI_GIRLS.zscore.yearly-ab6d435d.js} +0 -0
  408. /package/build/{ChevronDown-bd7697c4.js → ChevronDown-9759d6d4.js} +0 -0
  409. /package/build/{Close-d80873df.js → Close-11bb7b10.js} +0 -0
  410. /package/build/{Google-7f8e4f6e.js → Google-18e51c62.js} +0 -0
  411. /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-8faeb896.js → HEAD CIRCUM_BOYS.percentile.monthly-7c2899fc.js} +0 -0
  412. /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-e070074f.js → HEAD CIRCUM_BOYS.percentile.weekly-a1992be3.js} +0 -0
  413. /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-820285f4.js → HEAD CIRCUM_BOYS.percentile.yearly-b3a5a7e2.js} +0 -0
  414. /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-1b0097ec.js → HEAD CIRCUM_BOYS.zscore.monthly-8be96658.js} +0 -0
  415. /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-5686ddfb.js → HEAD CIRCUM_BOYS.zscore.weekly-94673fe3.js} +0 -0
  416. /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-ad150e91.js → HEAD CIRCUM_BOYS.zscore.yearly-fc371a3c.js} +0 -0
  417. /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-076cdb96.js → HEAD CIRCUM_GIRLS.percentile.monthly-fdbe4008.js} +0 -0
  418. /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-7ba0f699.js → HEAD CIRCUM_GIRLS.percentile.weekly-506ed0f2.js} +0 -0
  419. /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-c64aece9.js → HEAD CIRCUM_GIRLS.percentile.yearly-7754a604.js} +0 -0
  420. /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-222ef11f.js → HEAD CIRCUM_GIRLS.zscore.monthly-f164b6c5.js} +0 -0
  421. /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-bffe1fde.js → HEAD CIRCUM_GIRLS.zscore.weekly-e66f7327.js} +0 -0
  422. /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-65836f4a.js → HEAD CIRCUM_GIRLS.zscore.yearly-9acb3e24.js} +0 -0
  423. /package/build/{HEIGHT_BOYS.percentile.monthly-312b0a78.js → HEIGHT_BOYS.percentile.monthly-4d9ecc7c.js} +0 -0
  424. /package/build/{HEIGHT_BOYS.percentile.weekly-d4a02b3a.js → HEIGHT_BOYS.percentile.weekly-30231eb9.js} +0 -0
  425. /package/build/{HEIGHT_BOYS.percentile.yearly-4991623c.js → HEIGHT_BOYS.percentile.yearly-1395c6bc.js} +0 -0
  426. /package/build/{HEIGHT_BOYS.zscore.monthly-cf943dab.js → HEIGHT_BOYS.zscore.monthly-ccd38810.js} +0 -0
  427. /package/build/{HEIGHT_BOYS.zscore.weekly-929ee172.js → HEIGHT_BOYS.zscore.weekly-cb9c900e.js} +0 -0
  428. /package/build/{HEIGHT_BOYS.zscore.yearly-1ad495ec.js → HEIGHT_BOYS.zscore.yearly-3a582afc.js} +0 -0
  429. /package/build/{HEIGHT_GIRLS.percentile.monthly-49d5f51f.js → HEIGHT_GIRLS.percentile.monthly-ea021bff.js} +0 -0
  430. /package/build/{HEIGHT_GIRLS.percentile.weekly-a99518f5.js → HEIGHT_GIRLS.percentile.weekly-0c778c01.js} +0 -0
  431. /package/build/{HEIGHT_GIRLS.percentile.yearly-91a3be34.js → HEIGHT_GIRLS.percentile.yearly-4ea99b4d.js} +0 -0
  432. /package/build/{HEIGHT_GIRLS.zscore.monthly-ba8c8e6e.js → HEIGHT_GIRLS.zscore.monthly-9c652aff.js} +0 -0
  433. /package/build/{HEIGHT_GIRLS.zscore.weekly-50353a52.js → HEIGHT_GIRLS.zscore.weekly-69dcc948.js} +0 -0
  434. /package/build/{HEIGHT_GIRLS.zscore.yearly-d1b5f969.js → HEIGHT_GIRLS.zscore.yearly-21320bd4.js} +0 -0
  435. /package/build/{Locale-daf9aa88.js → Locale-85f7b9a8.js} +0 -0
  436. /package/build/{Visible-2b15fba4.js → Visible-e563038c.js} +0 -0
  437. /package/build/{WEIGHT_BOYS.percentile.monthly-5d6787ce.js → WEIGHT_BOYS.percentile.monthly-ee95bd2d.js} +0 -0
  438. /package/build/{WEIGHT_BOYS.percentile.weekly-1a860b4b.js → WEIGHT_BOYS.percentile.weekly-e1dbafce.js} +0 -0
  439. /package/build/{WEIGHT_BOYS.percentile.yearly-fd57716a.js → WEIGHT_BOYS.percentile.yearly-8310fc27.js} +0 -0
  440. /package/build/{WEIGHT_BOYS.zscore.monthly-a0acd992.js → WEIGHT_BOYS.zscore.monthly-36bb1cb8.js} +0 -0
  441. /package/build/{WEIGHT_BOYS.zscore.weekly-89ef1904.js → WEIGHT_BOYS.zscore.weekly-03b15883.js} +0 -0
  442. /package/build/{WEIGHT_BOYS.zscore.yearly-7da1d40a.js → WEIGHT_BOYS.zscore.yearly-54bf4bbe.js} +0 -0
  443. /package/build/{WEIGHT_GIRLS.percentile.monthly-6f58db3e.js → WEIGHT_GIRLS.percentile.monthly-516b868d.js} +0 -0
  444. /package/build/{WEIGHT_GIRLS.percentile.weekly-86271d0c.js → WEIGHT_GIRLS.percentile.weekly-40bd618a.js} +0 -0
  445. /package/build/{WEIGHT_GIRLS.percentile.yearly-0ef79884.js → WEIGHT_GIRLS.percentile.yearly-9bc8dfee.js} +0 -0
  446. /package/build/{WEIGHT_GIRLS.zscore.monthly-b25a4c9b.js → WEIGHT_GIRLS.zscore.monthly-8a2c9bef.js} +0 -0
  447. /package/build/{WEIGHT_GIRLS.zscore.weekly-370bd448.js → WEIGHT_GIRLS.zscore.weekly-0facc988.js} +0 -0
  448. /package/build/{WEIGHT_GIRLS.zscore.yearly-f9e4eee1.js → WEIGHT_GIRLS.zscore.yearly-37f3cdf1.js} +0 -0
  449. /package/build/{ageGenerate-15148d2a.js → ageGenerate-f36f2e26.js} +0 -0
  450. /package/build/{animation-2da7465d.js → animation-5dd10c52.js} +0 -0
  451. /package/build/{constants-d45110a8.js → constants-1371698c.js} +0 -0
  452. /package/build/{constants-01227b75.js → constants-f5a5e3e9.js} +0 -0
  453. /package/build/{context-e82deb48.js → context-b1fdb578.js} +0 -0
  454. /package/build/{dataTransform-88f89c7a.js → dataTransform-7ae4e690.js} +0 -0
  455. /package/build/esm/{BMI_BOYS.percentile.monthly-59d604f6.js → BMI_BOYS.percentile.monthly-bf3e8564.js} +0 -0
  456. /package/build/esm/{BMI_BOYS.percentile.weekly-fc44a5b7.js → BMI_BOYS.percentile.weekly-d1e9ec54.js} +0 -0
  457. /package/build/esm/{BMI_BOYS.percentile.yearly-9176e4e1.js → BMI_BOYS.percentile.yearly-6b6fed61.js} +0 -0
  458. /package/build/esm/{BMI_BOYS.zscore.monthly-6e573c0b.js → BMI_BOYS.zscore.monthly-38b81bfe.js} +0 -0
  459. /package/build/esm/{BMI_BOYS.zscore.weekly-1745ebd4.js → BMI_BOYS.zscore.weekly-a446b1e5.js} +0 -0
  460. /package/build/esm/{BMI_BOYS.zscore.yearly-1476fb3a.js → BMI_BOYS.zscore.yearly-94fa1e6d.js} +0 -0
  461. /package/build/esm/{BMI_GIRLS.percentile.monthly-d2d35df9.js → BMI_GIRLS.percentile.monthly-3b850cb5.js} +0 -0
  462. /package/build/esm/{BMI_GIRLS.percentile.weekly-6c19387b.js → BMI_GIRLS.percentile.weekly-796b574c.js} +0 -0
  463. /package/build/esm/{BMI_GIRLS.percentile.yearly-06cc8ebe.js → BMI_GIRLS.percentile.yearly-2f3a1e7e.js} +0 -0
  464. /package/build/esm/{BMI_GIRLS.zscore.monthly-fd5ac2e5.js → BMI_GIRLS.zscore.monthly-8fb10f7d.js} +0 -0
  465. /package/build/esm/{BMI_GIRLS.zscore.weekly-f68aa046.js → BMI_GIRLS.zscore.weekly-62a4dbe5.js} +0 -0
  466. /package/build/esm/{BMI_GIRLS.zscore.yearly-0c048503.js → BMI_GIRLS.zscore.yearly-69c07b5e.js} +0 -0
  467. /package/build/esm/{ChevronDown-99190b49.js → ChevronDown-daaa091a.js} +0 -0
  468. /package/build/esm/{Close-4c9c5d81.js → Close-cd4cb99c.js} +0 -0
  469. /package/build/esm/{Google-49452371.js → Google-b64103d0.js} +0 -0
  470. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-d369c45c.js → HEAD CIRCUM_BOYS.percentile.monthly-84a534f4.js} +0 -0
  471. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-2c48fafc.js → HEAD CIRCUM_BOYS.percentile.weekly-0e6317ed.js} +0 -0
  472. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-e794341e.js → HEAD CIRCUM_BOYS.percentile.yearly-8dc09a00.js} +0 -0
  473. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-407b0528.js → HEAD CIRCUM_BOYS.zscore.monthly-f7b7f4d3.js} +0 -0
  474. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-771bbb48.js → HEAD CIRCUM_BOYS.zscore.weekly-00e748f3.js} +0 -0
  475. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-623d50eb.js → HEAD CIRCUM_BOYS.zscore.yearly-192f0e61.js} +0 -0
  476. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-214f1990.js → HEAD CIRCUM_GIRLS.percentile.monthly-92680448.js} +0 -0
  477. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-7cbe6fff.js → HEAD CIRCUM_GIRLS.percentile.weekly-7a01c7fe.js} +0 -0
  478. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-28207825.js → HEAD CIRCUM_GIRLS.percentile.yearly-8dd2aa01.js} +0 -0
  479. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-9e25b76a.js → HEAD CIRCUM_GIRLS.zscore.monthly-55c16151.js} +0 -0
  480. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-32881b18.js → HEAD CIRCUM_GIRLS.zscore.weekly-44832872.js} +0 -0
  481. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-4f8e0a2e.js → HEAD CIRCUM_GIRLS.zscore.yearly-b46ce7d2.js} +0 -0
  482. /package/build/esm/{HEIGHT_BOYS.percentile.monthly-6a5617db.js → HEIGHT_BOYS.percentile.monthly-9937c4a3.js} +0 -0
  483. /package/build/esm/{HEIGHT_BOYS.percentile.weekly-f5400955.js → HEIGHT_BOYS.percentile.weekly-0f3e1872.js} +0 -0
  484. /package/build/esm/{HEIGHT_BOYS.percentile.yearly-7d0b1c6e.js → HEIGHT_BOYS.percentile.yearly-78b136a8.js} +0 -0
  485. /package/build/esm/{HEIGHT_BOYS.zscore.monthly-d03f1410.js → HEIGHT_BOYS.zscore.monthly-89f707b7.js} +0 -0
  486. /package/build/esm/{HEIGHT_BOYS.zscore.weekly-54afffac.js → HEIGHT_BOYS.zscore.weekly-7c047da0.js} +0 -0
  487. /package/build/esm/{HEIGHT_BOYS.zscore.yearly-395598e5.js → HEIGHT_BOYS.zscore.yearly-24bb0c90.js} +0 -0
  488. /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-202e9f0a.js → HEIGHT_GIRLS.percentile.monthly-44bfca68.js} +0 -0
  489. /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-0c2d2912.js → HEIGHT_GIRLS.percentile.weekly-14052ade.js} +0 -0
  490. /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-edbc48dd.js → HEIGHT_GIRLS.percentile.yearly-42bca689.js} +0 -0
  491. /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-6c102061.js → HEIGHT_GIRLS.zscore.monthly-9e7a96b1.js} +0 -0
  492. /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-c068f6e5.js → HEIGHT_GIRLS.zscore.weekly-f3a1bbdd.js} +0 -0
  493. /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-62525f1e.js → HEIGHT_GIRLS.zscore.yearly-b09cbe8e.js} +0 -0
  494. /package/build/esm/{Locale-dd85e540.js → Locale-bde7723e.js} +0 -0
  495. /package/build/esm/{Visible-ca95870e.js → Visible-262501a6.js} +0 -0
  496. /package/build/esm/{WEIGHT_BOYS.percentile.monthly-b0ec8b51.js → WEIGHT_BOYS.percentile.monthly-727a38bf.js} +0 -0
  497. /package/build/esm/{WEIGHT_BOYS.percentile.weekly-cbace597.js → WEIGHT_BOYS.percentile.weekly-a1049334.js} +0 -0
  498. /package/build/esm/{WEIGHT_BOYS.percentile.yearly-bd229dcb.js → WEIGHT_BOYS.percentile.yearly-51ecc876.js} +0 -0
  499. /package/build/esm/{WEIGHT_BOYS.zscore.monthly-8a2526bd.js → WEIGHT_BOYS.zscore.monthly-f18584fe.js} +0 -0
  500. /package/build/esm/{WEIGHT_BOYS.zscore.weekly-010ccb5d.js → WEIGHT_BOYS.zscore.weekly-cc713a38.js} +0 -0
  501. /package/build/esm/{WEIGHT_BOYS.zscore.yearly-807fb74a.js → WEIGHT_BOYS.zscore.yearly-acefa3a6.js} +0 -0
  502. /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-188cf1de.js → WEIGHT_GIRLS.percentile.monthly-1029a058.js} +0 -0
  503. /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-edcf30aa.js → WEIGHT_GIRLS.percentile.weekly-a090637e.js} +0 -0
  504. /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-11916aa1.js → WEIGHT_GIRLS.percentile.yearly-afdbc3e8.js} +0 -0
  505. /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-02e4f36e.js → WEIGHT_GIRLS.zscore.monthly-8a750312.js} +0 -0
  506. /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-f04180c7.js → WEIGHT_GIRLS.zscore.weekly-b4d37963.js} +0 -0
  507. /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-b0f6b466.js → WEIGHT_GIRLS.zscore.yearly-f2a267ff.js} +0 -0
  508. /package/build/esm/{ageGenerate-a19ee554.js → ageGenerate-c9d29857.js} +0 -0
  509. /package/build/esm/{animation-530c8713.js → animation-09bb9be0.js} +0 -0
  510. /package/build/esm/{constants-2a6f0822.js → constants-6301f0d0.js} +0 -0
  511. /package/build/esm/{constants-ebf82e1d.js → constants-9af47b1e.js} +0 -0
  512. /package/build/esm/{context-adea3929.js → context-3dffc612.js} +0 -0
  513. /package/build/esm/{dataTransform-31b69b1f.js → dataTransform-afde61d4.js} +0 -0
  514. /package/build/esm/{index-f3b9047f.js → index-500df0ee.js} +0 -0
  515. /package/build/esm/{index-676cea42.js → index-5cc8df17.js} +0 -0
  516. /package/build/esm/{index-b2a8a256.js → index-6746d426.js} +0 -0
  517. /package/build/esm/{index-10d0027c.js → index-71baf880.js} +0 -0
  518. /package/build/esm/{index-40178353.js → index-b5a44334.js} +0 -0
  519. /package/build/esm/{index-22cb52ac.js → index-dd16e62e.js} +0 -0
  520. /package/build/esm/{index-edde0d78.js → index-e6dffffc.js} +0 -0
  521. /package/build/esm/{index-43a9fa15.js → index-f0b0715c.js} +0 -0
  522. /package/build/esm/{index-52105956.js → index-fe128816.js} +0 -0
  523. /package/build/esm/{index.styles-fc1f3f4c.js → index.styles-d52bf774.js} +0 -0
  524. /package/build/esm/{localizeNumberFormat-02aa10d8.js → localizeNumberFormat-b19d8eec.js} +0 -0
  525. /package/build/esm/{normalizeLink-be7f4c29.js → normalizeLink-6d42a0bc.js} +0 -0
  526. /package/build/esm/{number-323db2e3.js → number-b32624ac.js} +0 -0
  527. /package/build/esm/{paths-57889e7a.js → paths-5c22a210.js} +0 -0
  528. /package/build/esm/{shared-ddb4a7c0.js → shared-560368e5.js} +0 -0
  529. /package/build/esm/{translationsContext-9ccdd735.js → translationsContext-5acae5f5.js} +0 -0
  530. /package/build/esm/{tslib.es6-eac05ee6.js → tslib.es6-7594be27.js} +0 -0
  531. /package/build/esm/{types-f3c62b8e.js → types-55e3660e.js} +0 -0
  532. /package/build/esm/{types-1da79786.js → types-fab32dfb.js} +0 -0
  533. /package/build/esm/{useOutsideClick-7b0e73bb.js → useOutsideClick-82ed3e36.js} +0 -0
  534. /package/build/esm/{useScrollbarSize-cbeb3de3.js → useScrollbarSize-74b70a1e.js} +0 -0
  535. /package/build/esm/{useUniqueId-09a9a15d.js → useUniqueId-37bb9e6d.js} +0 -0
  536. /package/build/esm/{utils-f2c14fb6.js → utils-93701764.js} +0 -0
  537. /package/build/esm/{utils-8fa947f2.js → utils-d5381d49.js} +0 -0
  538. /package/build/{index-a185e6c8.js → index-0bd9253d.js} +0 -0
  539. /package/build/{index-ff0be8db.js → index-1b5bbe05.js} +0 -0
  540. /package/build/{index-0b65a3e1.js → index-3e9bb95c.js} +0 -0
  541. /package/build/{index-6116f62d.js → index-6725888f.js} +0 -0
  542. /package/build/{index-cad29f79.js → index-9dbb13e5.js} +0 -0
  543. /package/build/{index-de2e9a33.js → index-9e3f8c10.js} +0 -0
  544. /package/build/{index-6c22e2d3.js → index-d7620e71.js} +0 -0
  545. /package/build/{index-3658a241.js → index-e003c7c0.js} +0 -0
  546. /package/build/{index-7305ec62.js → index-e935df00.js} +0 -0
  547. /package/build/{index.styles-7654fb59.js → index.styles-a60af306.js} +0 -0
  548. /package/build/{localizeNumberFormat-0c6e5858.js → localizeNumberFormat-035193f3.js} +0 -0
  549. /package/build/{normalizeLink-9cbdcafa.js → normalizeLink-f6cd6ba5.js} +0 -0
  550. /package/build/{number-10ca56f4.js → number-3a577940.js} +0 -0
  551. /package/build/{paths-60d5e970.js → paths-2d3f4bcc.js} +0 -0
  552. /package/build/{shared-7b7b3f13.js → shared-81241070.js} +0 -0
  553. /package/build/{translationsContext-9b0d023d.js → translationsContext-e37d46a0.js} +0 -0
  554. /package/build/{tslib.es6-7d483fc2.js → tslib.es6-1a97736c.js} +0 -0
  555. /package/build/{types-ed1ecac3.js → types-2b3e6454.js} +0 -0
  556. /package/build/{types-9d499822.js → types-efe6793c.js} +0 -0
  557. /package/build/{useOutsideClick-c0a2806b.js → useOutsideClick-9de9db39.js} +0 -0
  558. /package/build/{useScrollbarSize-96b32242.js → useScrollbarSize-454f6b9c.js} +0 -0
  559. /package/build/{useUniqueId-36c15220.js → useUniqueId-0f994efe.js} +0 -0
  560. /package/build/{utils-3b9fef4f.js → utils-7710be1a.js} +0 -0
  561. /package/build/{utils-06f796b5.js → utils-da3d064f.js} +0 -0
@@ -0,0 +1,1951 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var core$1 = require('@hhgtech/icons/core');
5
+ var core = require('@mantine/core');
6
+ var hooks = require('@mantine/hooks');
7
+ var utils$1 = require('./utils-14347fda.js');
8
+ var useOutsideClick = require('./useOutsideClick-9de9db39.js');
9
+ var index$1 = require('./index-0ffcf757.js');
10
+ var debounce = require('lodash/debounce');
11
+ var constants = require('./constants-f5a5e3e9.js');
12
+ var styled = require('@emotion/styled');
13
+ var miscTheme = require('./miscTheme.js');
14
+ var utils = require('./utils-7710be1a.js');
15
+ var index = require('./index-0bd9253d.js');
16
+ var index$2 = require('./index-cca9fd6d.js');
17
+ var ChevronDown = require('./ChevronDown-9759d6d4.js');
18
+ var tslib_es6 = require('./tslib.es6-1a97736c.js');
19
+ var arrow = require('@hhgtech/icons/arrow');
20
+ var index$3 = require('./index-6731f2f1.js');
21
+ var paths = require('./paths-2d3f4bcc.js');
22
+ var index$4 = require('./index-bc4537bc.js');
23
+
24
+ function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
25
+
26
+ var React__default = /*#__PURE__*/_interopDefault(React);
27
+ var debounce__default = /*#__PURE__*/_interopDefault(debounce);
28
+ var styled__default = /*#__PURE__*/_interopDefault(styled);
29
+
30
+ const StyledSearchBarWrapper = styled__default["default"].div ``;
31
+ const StyleWrapperContainer = styled__default["default"].div `
32
+ background-color: ${miscTheme.theme.colors.neutral50};
33
+ padding-bottom: 1px;
34
+ ${utils.MediaQueries.mbDown} {
35
+ padding: 0;
36
+ }
37
+ `;
38
+ const StyleSearchInputContainer = styled__default["default"](index.Container) `
39
+ padding: 0 16px;
40
+
41
+ ${utils.MediaQueries.mbDown} {
42
+ padding: 0;
43
+ }
44
+ `;
45
+ const StyleSearchContent = styled__default["default"].div `
46
+ padding: 24px 56px;
47
+ border-radius: 16px;
48
+ background-color: ${miscTheme.theme.colors.white};
49
+ box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.04),
50
+ 0px 0px 2px 0px rgba(0, 0, 0, 0.06), 0px 4px 8px 0px rgba(0, 0, 0, 0.04);
51
+
52
+ ${utils.MediaQueries.mbDown} {
53
+ padding: 16px;
54
+ border-radius: 0;
55
+ }
56
+
57
+ .flex-search-input {
58
+ flex-direction: row;
59
+ ${utils.MediaQueries.mbDown} {
60
+ flex-direction: column;
61
+ }
62
+ }
63
+ `;
64
+
65
+ const SEARCH_KEYWORD_MIN_LENGTH = {
66
+ 'en-PH': 3,
67
+ 'tl-PH': 2,
68
+ 'id-ID': 3,
69
+ 'vi-VN': 2,
70
+ 'zh-TW': 0,
71
+ 'ms-MY': 2,
72
+ 'th-TH': 2,
73
+ };
74
+
75
+ const initialState = {
76
+ isMobile: false,
77
+ isDebug: false,
78
+ navigateTo: null,
79
+ geoLocationPermission: 'unset',
80
+ geoLocationCoordinates: null,
81
+ focused: 'none',
82
+ focusedSpecialty: 'none',
83
+ searchLocationKeywords: '',
84
+ searchSpecialtyKeywords: '',
85
+ searchKeywords: '',
86
+ selectedLocation: null,
87
+ selectedSpecialty: null,
88
+ defaultCity: null,
89
+ initialCities: [],
90
+ cities: [],
91
+ searchResults: {},
92
+ initialSearchResults: {},
93
+ isLoadingCities: false,
94
+ isLoadingSearchResults: false,
95
+ isMobileModalOpened: false,
96
+ initialSelectedCity: null,
97
+ autoCompleteDisabled: false,
98
+ inputSearchPlaceholder: '',
99
+ locale: 'vi-VN',
100
+ allSpecialties: [],
101
+ popularKeys: [],
102
+ };
103
+ var ActionTypes;
104
+ (function (ActionTypes) {
105
+ ActionTypes["NavigateTo"] = "navigate to url";
106
+ ActionTypes["ClickOutsideInputLocation"] = "click outside input location";
107
+ ActionTypes["ClickOutsideInputSearch"] = "click outside input search";
108
+ ActionTypes["ClickOutsideInputSearchSpecialty"] = "click outside input search specialty";
109
+ ActionTypes["ClickOutsideInputSpecialty"] = "click outside input specialty";
110
+ ActionTypes["SelectCurrentLocation"] = "select current location";
111
+ ActionTypes["FocusInputLocation"] = "focus input location";
112
+ ActionTypes["FocusInputSearch"] = "focus input search";
113
+ ActionTypes["FocusInputSearchSpecialty"] = "focus input search specialty";
114
+ ActionTypes["ChangeInputLocation"] = "change input location";
115
+ ActionTypes["ChangeInputSearch"] = "change input search";
116
+ ActionTypes["ClearInputLocation"] = "clear input location";
117
+ ActionTypes["ClearInputSearch"] = "clear input search";
118
+ ActionTypes["SelectLocation"] = "select location";
119
+ ActionTypes["SelectSpecialty"] = "select specialty";
120
+ ActionTypes["FetchCitiesStart"] = "fetch cities start";
121
+ ActionTypes["FetchCitiesFinish"] = "fetch cities finish";
122
+ ActionTypes["FetchSearchResultsStart"] = "fetch search results start";
123
+ ActionTypes["FetchSearchResultsComplete"] = "fetch search results complete";
124
+ ActionTypes["FetchSearchResultsFinish"] = "fetch search results finish";
125
+ ActionTypes["FetchCitiesByGeoIpComplete"] = "fetch cities by geo IP finish";
126
+ ActionTypes["FetchCitiesByKeywordComplete"] = "fetch cities by keyword finish";
127
+ ActionTypes["DisplayInitialCities"] = "display initial cities";
128
+ ActionTypes["DisplayInitialSearchResults"] = "display initial search results";
129
+ ActionTypes["UpdateInitialSearchResults"] = "update initial search results";
130
+ ActionTypes["GrantGeoLocationPermission"] = "grant geolocation permission";
131
+ ActionTypes["DenyGeoLocationPermission"] = "deny geolocation permission";
132
+ ActionTypes["OpenMobileModal"] = "open mobile modal";
133
+ ActionTypes["CloseMobileModal"] = "close mobile modal";
134
+ ActionTypes["UpdateInitialSearchValue"] = "update initial search value";
135
+ ActionTypes["SelectSearchResult"] = "select search result";
136
+ ActionTypes["SetInputSearchPlaceholder"] = "set input search placeholder";
137
+ ActionTypes["FocusInputSpecialty"] = "focus input specialty";
138
+ ActionTypes["FetchAllSpecialties"] = "fetch all specialty";
139
+ ActionTypes["FetchPopularKeys"] = "fetch popular key by type";
140
+ })(ActionTypes || (ActionTypes = {}));
141
+ function resetSearchLocationKeywords(state) {
142
+ const { selectedLocation, searchLocationKeywords } = state;
143
+ if (selectedLocation && searchLocationKeywords !== selectedLocation.name) {
144
+ return Object.assign(Object.assign({}, state), { searchLocationKeywords: selectedLocation.name });
145
+ }
146
+ return state;
147
+ }
148
+ function reducer(state, action) {
149
+ var _a, _b;
150
+ if (state.isDebug) {
151
+ console.log('bookingSearchBarV3', { action, state });
152
+ }
153
+ switch (action.type) {
154
+ case ActionTypes.NavigateTo:
155
+ return Object.assign(Object.assign({}, state), { navigateTo: action.payload, focused: 'none', isMobileModalOpened: false });
156
+ case ActionTypes.ClickOutsideInputLocation: {
157
+ if (state.focused !== 'location') {
158
+ return state;
159
+ }
160
+ return resetSearchLocationKeywords(Object.assign(Object.assign({}, state), { focused: 'none' }));
161
+ }
162
+ case ActionTypes.ClickOutsideInputSpecialty: {
163
+ if (state.focused !== 'specialty') {
164
+ return state;
165
+ }
166
+ return resetSearchLocationKeywords(Object.assign(Object.assign({}, state), { focused: 'none' }));
167
+ }
168
+ case ActionTypes.ClickOutsideInputSearch: {
169
+ if (state.focused !== 'search') {
170
+ return state;
171
+ }
172
+ return Object.assign(Object.assign({}, state), { focused: 'none' });
173
+ }
174
+ case ActionTypes.ClickOutsideInputSearchSpecialty: {
175
+ if (state.focusedSpecialty !== 'search') {
176
+ return state;
177
+ }
178
+ return Object.assign(Object.assign({}, state), { focusedSpecialty: 'none' });
179
+ }
180
+ case ActionTypes.FocusInputLocation: {
181
+ const nextState = Object.assign(Object.assign({}, state), { focused: 'location' });
182
+ if (((_a = state.selectedLocation) === null || _a === void 0 ? void 0 : _a.id) === constants.ID_OPTION_CURRENT_LOCATION) {
183
+ nextState.searchLocationKeywords = '';
184
+ }
185
+ return nextState;
186
+ }
187
+ case ActionTypes.FocusInputSpecialty: {
188
+ const nextState = Object.assign(Object.assign({}, state), { focused: 'specialty' });
189
+ if (((_b = state.selectedLocation) === null || _b === void 0 ? void 0 : _b.id) === constants.ID_OPTION_CURRENT_LOCATION) {
190
+ nextState.searchLocationKeywords = '';
191
+ }
192
+ return nextState;
193
+ }
194
+ case ActionTypes.FocusInputSearch:
195
+ const nextState = Object.assign(Object.assign({}, state), { focused: 'search' });
196
+ if (state.isMobile) {
197
+ return resetSearchLocationKeywords(nextState);
198
+ }
199
+ return nextState;
200
+ case ActionTypes.FocusInputSearchSpecialty: {
201
+ const nextState = Object.assign(Object.assign({}, state), { focusedSpecialty: 'search' });
202
+ return nextState;
203
+ }
204
+ case ActionTypes.ChangeInputLocation:
205
+ return Object.assign(Object.assign({}, state), { searchLocationKeywords: action.payload });
206
+ case ActionTypes.ChangeInputSearch: {
207
+ const keyword = action.payload;
208
+ return Object.assign(Object.assign({}, state), { searchKeywords: keyword, isLoadingSearchResults: keyword.trim().length > SEARCH_KEYWORD_MIN_LENGTH[state.locale] });
209
+ }
210
+ case ActionTypes.SelectCurrentLocation:
211
+ return Object.assign(Object.assign({}, state), { focused: 'none', selectedLocation: action.payload, searchLocationKeywords: action.payload.name });
212
+ case ActionTypes.ClearInputLocation:
213
+ return Object.assign(Object.assign({}, state), { focused: 'location', cities: state.initialCities, searchLocationKeywords: '' });
214
+ case ActionTypes.ClearInputSearch:
215
+ return Object.assign(Object.assign({}, state), { focused: 'search', searchKeywords: '' });
216
+ case ActionTypes.SelectLocation:
217
+ return Object.assign(Object.assign({}, state), { focused: 'none', selectedLocation: action.payload, searchLocationKeywords: action.payload.name, searchResults: {} });
218
+ case ActionTypes.SelectSpecialty:
219
+ return Object.assign(Object.assign({}, state), { focused: 'none', selectedSpecialty: action.payload, searchResults: {} });
220
+ case ActionTypes.SelectSearchResult:
221
+ return Object.assign(Object.assign({}, state), { searchKeywords: action.payload.name, isMobileModalOpened: false, focused: 'none', navigateTo: action.payload.url });
222
+ case ActionTypes.FetchCitiesStart:
223
+ return Object.assign(Object.assign({}, state), { isLoadingCities: true });
224
+ case ActionTypes.FetchCitiesFinish:
225
+ return Object.assign(Object.assign({}, state), { isLoadingCities: false });
226
+ case ActionTypes.FetchSearchResultsStart:
227
+ return Object.assign(Object.assign({}, state), { isLoadingSearchResults: true });
228
+ case ActionTypes.FetchSearchResultsFinish:
229
+ return Object.assign(Object.assign({}, state), { isLoadingSearchResults: false });
230
+ case ActionTypes.FetchSearchResultsComplete: {
231
+ const nextState = Object.assign(Object.assign({}, state), { searchResults: Object.assign(Object.assign({}, state.searchResults), { [action.payload.key]: action.payload.searches }) });
232
+ return nextState;
233
+ }
234
+ case ActionTypes.FetchCitiesByGeoIpComplete: {
235
+ let { cities } = action.payload;
236
+ const { default: defaultCity } = action.payload;
237
+ cities = cities.filter((c) => c.id !== defaultCity.id);
238
+ if (defaultCity) {
239
+ cities.unshift(defaultCity);
240
+ }
241
+ if (state.initialSelectedCity &&
242
+ !cities.find((c) => c.id === state.initialSelectedCity.id)) {
243
+ cities.unshift(state.initialSelectedCity);
244
+ }
245
+ const nextState = Object.assign(Object.assign({}, state), { defaultCity, initialCities: cities, cities });
246
+ if (state.geoLocationPermission === 'denied' &&
247
+ !state.initialSelectedCity) {
248
+ nextState.selectedLocation = defaultCity;
249
+ nextState.searchLocationKeywords = defaultCity.name;
250
+ }
251
+ return nextState;
252
+ }
253
+ case ActionTypes.FetchCitiesByKeywordComplete:
254
+ return Object.assign(Object.assign({}, state), { cities: action.payload });
255
+ case ActionTypes.DisplayInitialCities:
256
+ return Object.assign(Object.assign({}, state), { cities: state.initialCities });
257
+ case ActionTypes.DisplayInitialSearchResults: {
258
+ const trimmed = state.searchKeywords.trim();
259
+ const minLen = SEARCH_KEYWORD_MIN_LENGTH[state.locale];
260
+ const shouldShowEmpty = trimmed.length > 0 && trimmed.length <= minLen;
261
+ return Object.assign(Object.assign({}, state), { searchResults: shouldShowEmpty ? {} : state.initialSearchResults, isLoadingSearchResults: false });
262
+ }
263
+ case ActionTypes.UpdateInitialSearchResults:
264
+ return Object.assign(Object.assign({}, state), { initialSearchResults: Object.assign(Object.assign({}, state.initialSearchResults), { [action.payload.key]: action.payload.searches }) });
265
+ case ActionTypes.GrantGeoLocationPermission:
266
+ return Object.assign(Object.assign({}, state), { geoLocationPermission: 'granted', geoLocationCoordinates: action.payload });
267
+ case ActionTypes.DenyGeoLocationPermission:
268
+ return Object.assign(Object.assign({}, state), { geoLocationPermission: 'denied', geoLocationCoordinates: null });
269
+ case ActionTypes.OpenMobileModal:
270
+ return Object.assign(Object.assign({}, state), { isMobileModalOpened: true });
271
+ case ActionTypes.CloseMobileModal:
272
+ return Object.assign(Object.assign({}, state), { isMobileModalOpened: false });
273
+ case ActionTypes.UpdateInitialSearchValue:
274
+ return Object.assign(Object.assign({}, state), { searchKeywords: action.payload });
275
+ case ActionTypes.SetInputSearchPlaceholder:
276
+ return Object.assign(Object.assign({}, state), { inputSearchPlaceholder: action.payload });
277
+ case ActionTypes.FetchAllSpecialties:
278
+ return Object.assign(Object.assign({}, state), { allSpecialties: action.payload });
279
+ case ActionTypes.FetchPopularKeys:
280
+ return Object.assign(Object.assign({}, state), { popularKeys: action.payload });
281
+ default:
282
+ return state;
283
+ }
284
+ }
285
+
286
+ const StyleSearchInputsWrapper = styled__default["default"].div `
287
+ flex: 1;
288
+ position: relative;
289
+
290
+ ${utils.MediaQueries.mbDown} {
291
+ width: 100%;
292
+ }
293
+ `;
294
+ const StyleSearchBarContainer = styled__default["default"].div `
295
+ background: #f7f9fc;
296
+ border-radius: 12px;
297
+ height: 48px;
298
+ display: flex;
299
+ align-items: center;
300
+ padding: 4px 12px 4px 4px;
301
+ gap: 16px;
302
+
303
+ ${utils.MediaQueries.mbDown} {
304
+ height: 48px;
305
+ width: 100%;
306
+ }
307
+ `;
308
+ const StyleSearchIconWrapper = styled__default["default"].div `
309
+ display: flex;
310
+ align-items: center;
311
+ flex-shrink: 0;
312
+ color: #8c8c8c;
313
+
314
+ svg {
315
+ width: 18px;
316
+ height: 18px;
317
+ }
318
+ `;
319
+ const StyleResultWrapper = styled__default["default"].div `
320
+ position: absolute;
321
+ top: calc(100% + 2px);
322
+ width: 100%;
323
+ border-radius: 4px;
324
+ background: ${miscTheme.theme.colors.white};
325
+ box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1);
326
+ z-index: 10;
327
+
328
+ ${utils.MediaQueries.mbDown} {
329
+ width: calc(100% + 64px);
330
+ left: -32px;
331
+ }
332
+ `;
333
+
334
+ const StyledSearchResultWrapper = styled__default["default"].div ``;
335
+ styled__default["default"].div `
336
+ display: flex;
337
+ justify-content: space-between;
338
+ align-item: center;
339
+ padding: 9px 14px 9px 22px;
340
+ background: #f7f9fc;
341
+
342
+ .title {
343
+ color: ${miscTheme.theme.colors.gray800};
344
+ font-size: 14px;
345
+ font-weight: 600;
346
+ line-height: 22px;
347
+ }
348
+
349
+ .btn-see-all {
350
+ color: ${miscTheme.theme.colors.blue600};
351
+ font-size: 14px;
352
+ line-height: 22px;
353
+ cursor: pointer;
354
+ }
355
+ `;
356
+ const StyleResultBody = styled__default["default"].div `
357
+ padding: 10px 16px;
358
+ max-height: 400px;
359
+ overflow: auto;
360
+ `;
361
+ const StyleResultItem = styled__default["default"].div `
362
+ display: flex;
363
+ gap: 12px;
364
+ align-items: center;
365
+ cursor: pointer;
366
+
367
+ ${utils.MediaQueries.mbUp} {
368
+ &:hover {
369
+ background-color: ${miscTheme.theme.colors.blue50};
370
+ }
371
+ }
372
+
373
+ .image-item {
374
+ flex: 0 0 48px;
375
+ width: 48px;
376
+ height: 48px;
377
+ border-radius: 50%;
378
+
379
+ img {
380
+ object-fit: contain;
381
+ width: 100%;
382
+ height: 100%;
383
+ border-radius: 50%;
384
+ }
385
+ }
386
+ .infor {
387
+ overflow: hidden;
388
+ padding: 12px 0;
389
+ flex: 1;
390
+ border-bottom: 1px solid ${miscTheme.theme.colors.neutral100};
391
+ .title {
392
+ color: ${miscTheme.theme.colors.gray800};
393
+ font-size: 16px;
394
+ font-weight: 600;
395
+ line-height: 24px;
396
+ }
397
+ .description {
398
+ overflow: hidden;
399
+ color: ${miscTheme.theme.colors.gray600};
400
+ text-overflow: ellipsis;
401
+ white-space: nowrap;
402
+ font-size: 12px;
403
+ line-height: 18px;
404
+ display: flex;
405
+ gap: 8px;
406
+ align-items: center;
407
+ margin-top: 5px;
408
+
409
+ svg {
410
+ flex: 0 0 16px;
411
+ }
412
+
413
+ .sub-description {
414
+ overflow: hidden;
415
+ white-space: nowrap;
416
+ text-overflow: ellipsis;
417
+ flex: 1;
418
+ }
419
+ }
420
+ }
421
+
422
+ &.last-item {
423
+ .infor {
424
+ border-bottom: none;
425
+ }
426
+ }
427
+ `;
428
+ styled__default["default"].div `
429
+ padding: 0 16px 16px;
430
+
431
+ .search-detail-btn {
432
+ color: ${miscTheme.theme.colors.blue600};
433
+ font-size: 14px;
434
+ line-height: 22px;
435
+ cursor: pointer;
436
+ }
437
+ `;
438
+
439
+ const SearchResult = ({ state, type, results,
440
+ // location,
441
+ isLoading, typeInformation,
442
+ // clientSlug = '',
443
+ dispatch, }) => {
444
+ const { t } = index$1.useTranslations();
445
+ const { selectedLocation } = state;
446
+ const typeSlug = React.useMemo(() => typeInformation[type].slug, [typeInformation, type]);
447
+ const handleOnClick = (item) => {
448
+ let url = '';
449
+ switch (type) {
450
+ case 'service':
451
+ url = `/${selectedLocation.slug}/${typeSlug}/${item.slug}`;
452
+ break;
453
+ case 'doctor':
454
+ case 'hospital':
455
+ url = `/${typeSlug}/${item.slug}-${item.id}`;
456
+ break;
457
+ }
458
+ if (url) {
459
+ dispatch({
460
+ type: ActionTypes.NavigateTo,
461
+ payload: url,
462
+ });
463
+ }
464
+ };
465
+ // const handleSeeAll = () => {
466
+ // let url = `/${selectedLocation.slug}/${typeSlug}`
467
+ // const slugClientUrl = MAPPING_CLIENT_WITH_SLUG[locale][clientSlug]
468
+ // if (slugClientUrl) {
469
+ // url += `/${slugClientUrl}`
470
+ // }
471
+ // if (
472
+ // (type === 'doctor' || type === 'hospital') &&
473
+ // state.selectedSpecialty.id > 0
474
+ // ) {
475
+ // url += `?specialtyId=${state.selectedSpecialty.id}`
476
+ // }
477
+ // if (url) {
478
+ // dispatch({ type: ActionTypes.NavigateTo, payload: url })
479
+ // }
480
+ // }
481
+ if (results === null)
482
+ return null;
483
+ return (React__default["default"].createElement(StyledSearchResultWrapper, null,
484
+ React__default["default"].createElement(StyleResultBody, { className: "search-results__body" },
485
+ isLoading && (React__default["default"].createElement("div", { className: "skeleton-result" }, Array(3)
486
+ .fill(undefined)
487
+ .map((_, i) => (React__default["default"].createElement(StyleResultItem, { key: type + 'loading' + i, className: i === 2 ? 'last-item' : '' },
488
+ React__default["default"].createElement("div", { className: "image-item" },
489
+ React__default["default"].createElement(core.Skeleton, { height: 48, circle: true, mb: "xl", animate: true })),
490
+ React__default["default"].createElement("div", { className: "infor" },
491
+ React__default["default"].createElement("div", { className: "title" },
492
+ React__default["default"].createElement(core.Skeleton, { height: 8, mt: 10, radius: "xl", animate: true })),
493
+ React__default["default"].createElement("div", { className: "description" },
494
+ React__default["default"].createElement("div", { className: "sub-description" },
495
+ React__default["default"].createElement(core.Skeleton, { height: 8, mt: 10, radius: "xl", width: "80%", animate: true }))))))))),
496
+ !isLoading && results && results.length > 0 && (React__default["default"].createElement(React__default["default"].Fragment, null, results.map((item, index) => {
497
+ var _a, _b;
498
+ const isLastItem = (results.length > 4 && index === 3) ||
499
+ (results.length <= 4 && index === results.length - 1);
500
+ let subDescription = '';
501
+ if (type === 'hospital') {
502
+ subDescription = (item === null || item === void 0 ? void 0 : item.address) || '';
503
+ }
504
+ if (type === 'doctor') {
505
+ subDescription = ((_a = item === null || item === void 0 ? void 0 : item.specialties) === null || _a === void 0 ? void 0 : _a.join(', ')) || '';
506
+ }
507
+ if (type === 'service') {
508
+ subDescription = ((_b = item === null || item === void 0 ? void 0 : item.hospital_branch) === null || _b === void 0 ? void 0 : _b.name) || '';
509
+ }
510
+ if (index >= 4) {
511
+ return React__default["default"].createElement(React__default["default"].Fragment, null);
512
+ }
513
+ return (React__default["default"].createElement(StyleResultItem, { key: item.id, className: core.clsx(isLastItem ? 'last-item' : '', 'result-item'), onClick: () => handleOnClick(item) },
514
+ React__default["default"].createElement("div", { className: "image-item" },
515
+ React__default["default"].createElement("img", { src: item.logo || item.avatar, alt: item.name })),
516
+ React__default["default"].createElement("div", { className: "infor" },
517
+ React__default["default"].createElement("div", { className: "title" }, item.name),
518
+ React__default["default"].createElement("div", { className: "description" },
519
+ typeInformation[type].icon,
520
+ React__default["default"].createElement("div", { className: "sub-description" }, subDescription)))));
521
+ }))),
522
+ !isLoading && (results === null || results === void 0 ? void 0 : results.length) === 0 && (React__default["default"].createElement(index$2.Text, { size: "sm", color: miscTheme.theme.colors.gray400, className: "noresult-block" }, t('booking.searchBar.noResults'))))));
523
+ };
524
+
525
+ const SearchResultContent = ({ state, type, isLoading, clientSlug, typeInformation, dispatch, }) => {
526
+ var _a;
527
+ if (state.focused !== 'search')
528
+ return null;
529
+ return (React__default["default"].createElement(SearchResult, { type: type, state: state, results: ((_a = state.searchResults) === null || _a === void 0 ? void 0 : _a[type]) || null, location: state.selectedLocation.name, dispatch: dispatch, isLoading: isLoading, typeInformation: typeInformation, clientSlug: clientSlug }));
530
+ };
531
+
532
+ const StyleSearchSpecialtyWrapper = styled__default["default"].div `
533
+ position: relative;
534
+ flex-shrink: 0;
535
+
536
+ ${utils.MediaQueries.mbDown} {
537
+ width: 100%;
538
+ display: flex;
539
+ flex-direction: column;
540
+ gap: 12px;
541
+ }
542
+
543
+ &.compact {
544
+ ${utils.MediaQueries.mbDown} {
545
+ width: auto;
546
+ display: block;
547
+ }
548
+ }
549
+ `;
550
+ const StyleDropdownPanel = styled__default["default"].div `
551
+ position: absolute;
552
+ top: calc(100% + 4px);
553
+ left: 0;
554
+ min-width: 264px;
555
+ background: white;
556
+ border-radius: 12px;
557
+ box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.04),
558
+ 0px 2px 8px 0px rgba(0, 0, 0, 0.04), 0px 10px 16px 0px rgba(0, 0, 0, 0.04);
559
+ z-index: 10;
560
+ overflow: hidden;
561
+
562
+ &.mobile {
563
+ min-width: 280px;
564
+ }
565
+ `;
566
+ const StyledSpecialtyItem = styled__default["default"].div `
567
+ cursor: pointer;
568
+ padding: 12px 16px;
569
+ display: flex;
570
+ align-items: center;
571
+ gap: 12px;
572
+ outline: none;
573
+
574
+ .image-item {
575
+ display: flex;
576
+ align-items: center;
577
+ justify-content: center;
578
+ width: 24px;
579
+ height: 24px;
580
+ flex-shrink: 0;
581
+
582
+ img {
583
+ width: 100%;
584
+ height: 100%;
585
+ object-fit: contain;
586
+ }
587
+
588
+ svg {
589
+ width: 24px;
590
+ height: 24px;
591
+ }
592
+ }
593
+
594
+ .item-label {
595
+ font-size: 15px;
596
+ font-weight: 400;
597
+ line-height: 24px;
598
+ letter-spacing: -0.3px;
599
+ color: ${miscTheme.theme.colors.gray800};
600
+ }
601
+
602
+ &:hover {
603
+ background-color: ${miscTheme.theme.colors.neutral50};
604
+ }
605
+
606
+ &.selected {
607
+ background-color: ${miscTheme.theme.colors.neutral50};
608
+ }
609
+
610
+ &:last-child {
611
+ border-bottom-left-radius: 12px;
612
+ border-bottom-right-radius: 12px;
613
+ }
614
+ `;
615
+
616
+ const DoctorIcon = () => (React__default["default"].createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
617
+ React__default["default"].createElement("path", { d: "M8.983 14.333q-1.666 0-2.833-1.166Q4.983 12 4.983 10.333v-.366a3.48 3.48 0 0 1-2.258-1.2 3.57 3.57 0 0 1-.909-2.434V3.1a.58.58 0 0 1 .175-.425.58.58 0 0 1 .425-.175h1.4v-.167a.486.486 0 0 1 .5-.5q.217 0 .36.142a.5.5 0 0 1 .14.358v1.334a.485.485 0 0 1-.5.5.484.484 0 0 1-.5-.5V3.5h-1v2.833q0 1.1.784 1.884Q4.383 9 5.483 9t1.883-.783.784-1.884V3.5h-1v.167a.485.485 0 0 1-.5.5.484.484 0 0 1-.5-.5V2.333a.486.486 0 0 1 .5-.5q.217 0 .358.142a.5.5 0 0 1 .142.358V2.5h1.4a.58.58 0 0 1 .425.175.58.58 0 0 1 .175.425v3.233q0 1.4-.908 2.434a3.5 3.5 0 0 1-2.259 1.2v.366q0 1.25.875 2.126a2.9 2.9 0 0 0 2.125.874q1.25 0 2.125-.874a2.9 2.9 0 0 0 .875-2.126V9.25a1.74 1.74 0 0 1-.858-.609 1.6 1.6 0 0 1-.342-1.008q0-.716.5-1.216t1.2-.5q.716 0 1.217.5.5.5.5 1.216 0 .567-.342 1.008t-.875.609v1.083q0 1.667-1.167 2.834-1.166 1.166-2.833 1.166m3.5-6q.3 0 .509-.208a.67.67 0 0 0 .208-.492q0-.3-.208-.508a.7.7 0 0 0-.509-.208q-.3 0-.5.208a.7.7 0 0 0-.2.508q0 .284.2.492t.5.208", fill: "#595959" })));
618
+ const ServiceIcon = () => (React__default["default"].createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
619
+ React__default["default"].createElement("path", { d: "M6.868 9.265v.974q0 .405.284.69.284.283.69.283t.69-.284.284-.69v-.973h.973q.405 0 .69-.284a.94.94 0 0 0 .284-.689.94.94 0 0 0-.284-.69.94.94 0 0 0-.69-.284h-.973v-.974a.94.94 0 0 0-.284-.69.94.94 0 0 0-.69-.284.94.94 0 0 0-.689.284.94.94 0 0 0-.285.69v.974h-.973a.94.94 0 0 0-.69.283.94.94 0 0 0-.284.69q0 .405.284.69.285.284.69.284zm-3.46 4.868q-.581 0-.994-.413A1.36 1.36 0 0 1 2 12.725v-6.65a1.4 1.4 0 0 1 .563-1.127l4.434-3.333q.369-.282.844-.282.474 0 .846.282l4.434 3.333q.264.193.413.493.15.3.15.633v6.651q0 .58-.414.995a1.36 1.36 0 0 1-.994.413zm0-1.168h8.868q.105 0 .172-.068a.23.23 0 0 0 .068-.172v-6.65a.2.2 0 0 0-.027-.11.3.3 0 0 0-.07-.085L7.983 2.554a.2.2 0 0 0-.142-.052.2.2 0 0 0-.142.052L3.266 5.88a.3.3 0 0 0-.071.086.2.2 0 0 0-.027.108v6.651q0 .105.068.172a.23.23 0 0 0 .172.068", fill: "#595959" })));
620
+ const HospitalIcon = () => (React__default["default"].createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
621
+ React__default["default"].createElement("path", { d: "M8 8q.55 0 .941-.392.393-.391.392-.941 0-.55-.392-.942A1.28 1.28 0 0 0 8 5.333q-.55 0-.942.392a1.28 1.28 0 0 0-.391.942q0 .55.391.941Q7.45 8 8 8m0 4.9q2.032-1.866 3.017-3.392Q12 7.983 12 6.8q0-1.817-1.158-2.975Q9.682 2.667 8 2.667T5.158 3.825Q4 4.983 4 6.8q0 1.184.983 2.708Q5.966 11.034 8 12.9m0 1.517a.8.8 0 0 1-.5-.183q-2.433-2.151-3.633-3.992T2.667 6.8q0-2.5 1.608-3.983Q5.883 1.332 8 1.333q2.116 0 3.725 1.484T13.333 6.8q0 1.6-1.2 3.442-1.2 1.841-3.633 3.991a.8.8 0 0 1-.5.184", fill: "#8C8C8C" })));
622
+ const SpecialtyIcon = () => (React__default["default"].createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16" },
623
+ React__default["default"].createElement("path", { d: "M3.833.5a3.333 3.333 0 1 0 0 6.667 3.333 3.333 0 0 0 0-6.667M10.5.5c-.92 0-1.667.746-1.667 1.667V5.5c0 .92.746 1.667 1.667 1.667h3.333c.921 0 1.667-.746 1.667-1.667V2.167C15.5 1.246 14.754.5 13.833.5zM3.833 8.833a3.333 3.333 0 1 0 0 6.667 3.333 3.333 0 0 0 0-6.667m8.334 0a3.333 3.333 0 1 0 0 6.667 3.333 3.333 0 0 0 0-6.667", fill: "#9AA2AC" })));
624
+
625
+ const SearchSpecialty = ({ state, isMobile, onSpecialtyClick, dispatch, isCompact = false, }) => {
626
+ const { t, locale } = index$1.useTranslations();
627
+ const inputSpecialtyWrapperRef = React.useRef(null);
628
+ const searchInputRef = React.useRef(null);
629
+ const slugs = React.useMemo(() => constants.LOCALIZED_SLUGS[locale], [locale]);
630
+ const [searchValue, setSearchValue] = React.useState('');
631
+ const [opened, { close, toggle }] = hooks.useDisclosure(false);
632
+ useOutsideClick.useOutsideClick(inputSpecialtyWrapperRef, () => {
633
+ close();
634
+ setSearchValue('');
635
+ dispatch({ type: ActionTypes.ClickOutsideInputSpecialty });
636
+ });
637
+ const specialtyData = React.useMemo(() => [
638
+ {
639
+ name: t('booking.searchBar.allSpecialties'),
640
+ id: -1,
641
+ thumbnail: '',
642
+ total_doctor: 0,
643
+ slug: slugs.SPECIALTIES,
644
+ },
645
+ ...state.allSpecialties,
646
+ ], [state.allSpecialties, t, slugs.SPECIALTIES]);
647
+ const filteredData = React.useMemo(() => {
648
+ if (!searchValue.trim())
649
+ return specialtyData;
650
+ return specialtyData.filter((s) => s.name.toLowerCase().includes(searchValue.toLowerCase().trim()));
651
+ }, [specialtyData, searchValue]);
652
+ const selectedLabel = React.useMemo(() => {
653
+ if (!state.selectedSpecialty)
654
+ return '';
655
+ return state.selectedSpecialty.name;
656
+ }, [state.selectedSpecialty]);
657
+ const handleSelect = React.useCallback((item) => {
658
+ onSpecialtyClick({
659
+ id: item.id,
660
+ name: item.name,
661
+ slug: item.slug,
662
+ thumbnail: item.thumbnail || '',
663
+ total_doctor: 0,
664
+ });
665
+ close();
666
+ setSearchValue('');
667
+ }, [onSpecialtyClick, close]);
668
+ const handleToggle = React.useCallback(() => {
669
+ toggle();
670
+ if (opened) {
671
+ setSearchValue('');
672
+ }
673
+ }, [toggle, opened]);
674
+ return (React__default["default"].createElement(StyleSearchSpecialtyWrapper, { ref: inputSpecialtyWrapperRef, className: isCompact ? 'compact' : '' },
675
+ React__default["default"].createElement(core.Box, { onClick: handleToggle, className: opened ? 'dropdown-trigger-open' : '', sx: {
676
+ cursor: 'pointer',
677
+ position: 'relative',
678
+ width: isCompact ? (isMobile ? 96 : 160) : '100%',
679
+ flexShrink: 0,
680
+ } },
681
+ React__default["default"].createElement(core.Input, { readOnly: true, value: selectedLabel, placeholder: t('booking.searchPopup.specialties'), rightSection: React__default["default"].createElement(ChevronDown.ChevronDown, { style: { width: 20, height: 20 } }), styles: Object.assign({ input: {
682
+ cursor: 'pointer',
683
+ outline: 'none',
684
+ '&:focus': {
685
+ outline: 'none',
686
+ },
687
+ '&:not(.mantine-Textarea-input)': {
688
+ height: isCompact ? 40 : isMobile ? 40 : 46,
689
+ fontSize: isCompact ? core.rem(14) : isMobile ? core.rem(14) : core.rem(16),
690
+ paddingLeft: isCompact ? 12 : 16,
691
+ paddingRight: 30,
692
+ background: isCompact ? 'white' : 'transparent',
693
+ border: isCompact
694
+ ? `1px solid ${miscTheme.theme.colors.gray200}`
695
+ : 'none',
696
+ borderRadius: 8,
697
+ letterSpacing: '-0.2px',
698
+ color: miscTheme.theme.colors.gray800,
699
+ textOverflow: 'ellipsis',
700
+ overflow: 'hidden',
701
+ whiteSpace: 'nowrap',
702
+ },
703
+ }, rightSection: {
704
+ width: 30,
705
+ pointerEvents: 'none',
706
+ } }, (!isCompact && {
707
+ wrapper: {
708
+ position: 'relative',
709
+ '&:after': {
710
+ content: '""',
711
+ width: '1px',
712
+ height: '20px',
713
+ backgroundColor: miscTheme.theme.colors.neutral100,
714
+ position: 'absolute',
715
+ right: 0,
716
+ top: '50%',
717
+ transform: 'translateY(-50%)',
718
+ },
719
+ },
720
+ })) })),
721
+ opened && (React__default["default"].createElement(StyleDropdownPanel, { className: isMobile ? 'mobile' : '' },
722
+ React__default["default"].createElement(core.Box, { sx: { padding: '12px 12px 8px' } },
723
+ React__default["default"].createElement(core.Input, { ref: searchInputRef, icon: React__default["default"].createElement(core$1.Search, { size: 18, color: miscTheme.theme.colors.gray300 }), placeholder: t('booking.searchBar.placeholder.specialty'), value: searchValue, onChange: (e) => setSearchValue(e.target.value), size: "md", styles: {
724
+ input: {
725
+ height: 40,
726
+ fontSize: core.rem(15),
727
+ paddingLeft: 36,
728
+ '&::placeholder': {
729
+ color: miscTheme.theme.colors.gray400,
730
+ },
731
+ },
732
+ icon: {
733
+ width: 36,
734
+ },
735
+ } })),
736
+ React__default["default"].createElement(core.ScrollArea.Autosize, { mah: 300 }, filteredData.length === 0 ? (React__default["default"].createElement(core.Box, { sx: {
737
+ padding: '12px 16px',
738
+ color: miscTheme.theme.colors.gray400,
739
+ fontSize: 14,
740
+ } }, t('common.noResult'))) : (filteredData.map((specialty) => {
741
+ var _a, _b;
742
+ return (React__default["default"].createElement(StyledSpecialtyItem, { key: specialty.id, tabIndex: 0, role: "option", "aria-selected": ((_a = state.selectedSpecialty) === null || _a === void 0 ? void 0 : _a.id) === specialty.id, className: ((_b = state.selectedSpecialty) === null || _b === void 0 ? void 0 : _b.id) === specialty.id
743
+ ? 'selected'
744
+ : '', onClick: () => handleSelect(specialty), onKeyDown: (e) => {
745
+ if (e.key === 'Enter' || e.key === ' ') {
746
+ e.preventDefault();
747
+ handleSelect(specialty);
748
+ }
749
+ } },
750
+ React__default["default"].createElement("div", { className: "image-item" }, specialty.thumbnail ? (React__default["default"].createElement("img", { src: specialty.thumbnail, alt: specialty.name })) : (React__default["default"].createElement(SpecialtyIcon, null))),
751
+ React__default["default"].createElement("span", { className: "item-label" }, specialty.name)));
752
+ })))))));
753
+ };
754
+
755
+ const SearchInputs = React.forwardRef(({ state, type, isMobile, isLoading, initalSearchValue, typeInformation, debouncedFetchSearchResults, trackingAttributes, hideSpecialtySelection = false, clientSlug = '', onSearch, onFocusInput, onEnterSearch, dispatch, onlyShowSearchBox, onChangeSpecialty, }, ref) => {
756
+ const { t } = index$1.useTranslations();
757
+ const inputSearchWrapperRef = React.useRef(null);
758
+ const internalInputRef = React.useRef(null);
759
+ React.useImperativeHandle(ref, () => ({
760
+ focus: () => {
761
+ var _a;
762
+ (_a = internalInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
763
+ },
764
+ }));
765
+ const gaAttributes = React.useMemo(() => {
766
+ if (trackingAttributes) {
767
+ return {
768
+ 'data-event-category': trackingAttributes.dataEventCategory,
769
+ 'data-event-action': trackingAttributes.dataEventAction,
770
+ 'data-event-label': trackingAttributes.dataEventLabel,
771
+ };
772
+ }
773
+ else {
774
+ return {};
775
+ }
776
+ }, [trackingAttributes]);
777
+ const placeholderSearch = React.useMemo(() => {
778
+ if (type === 'doctor')
779
+ return t('booking.searchBar.placeholder.doctor');
780
+ if (type === 'service')
781
+ return t('booking.searchBar.placeholder.service');
782
+ if (type === 'hospital')
783
+ return t('booking.searchBar.placeholder.hospital');
784
+ if (type === 'specialty')
785
+ return t('booking.searchBar.placeholder.specialty');
786
+ return '';
787
+ }, [type, t]);
788
+ const showSpecialtyInSearchBar = type !== 'specialty' &&
789
+ type !== 'service' &&
790
+ !hideSpecialtySelection &&
791
+ !onlyShowSearchBox;
792
+ const styleInputUnstyled = React.useMemo(() => ({
793
+ input: {
794
+ border: 'none',
795
+ background: 'transparent',
796
+ height: '100%',
797
+ fontSize: core.rem(16),
798
+ color: miscTheme.theme.colors.gray800,
799
+ padding: '0',
800
+ '&::placeholder': {
801
+ color: miscTheme.theme.colors.gray400,
802
+ },
803
+ '&:focus': {
804
+ outline: 'none',
805
+ boxShadow: 'none',
806
+ },
807
+ [isMobile ? '@media (max-width: 767px)' : '']: isMobile
808
+ ? {
809
+ fontSize: core.rem(16),
810
+ }
811
+ : {},
812
+ },
813
+ wrapper: {
814
+ flex: 1,
815
+ },
816
+ }), [isMobile]);
817
+ useOutsideClick.useOutsideClick(inputSearchWrapperRef, () => {
818
+ !isMobile && dispatch({ type: ActionTypes.ClickOutsideInputSearch });
819
+ });
820
+ const handleSearchInputChange = React.useCallback(function handleSearchInputChange(value) {
821
+ dispatch({ type: ActionTypes.ChangeInputSearch, payload: value });
822
+ if (typeof onSearch === 'function') {
823
+ return;
824
+ }
825
+ if (value.trim().length > SEARCH_KEYWORD_MIN_LENGTH[state.locale] ||
826
+ initalSearchValue ||
827
+ value.trim().length === 0) {
828
+ debouncedFetchSearchResults(value.trim(), state, type, clientSlug);
829
+ }
830
+ }, [
831
+ dispatch,
832
+ state,
833
+ type,
834
+ initalSearchValue,
835
+ debouncedFetchSearchResults,
836
+ clientSlug,
837
+ onSearch,
838
+ ]);
839
+ const handleSpecialtyClick = React.useCallback(function handleSpecialtyClick(specialty) {
840
+ var _a;
841
+ dispatch({ type: ActionTypes.SelectSpecialty, payload: specialty });
842
+ onChangeSpecialty === null || onChangeSpecialty === void 0 ? void 0 : onChangeSpecialty(specialty);
843
+ !isMobile && ((_a = internalInputRef.current) === null || _a === void 0 ? void 0 : _a.focus());
844
+ }, [dispatch, onChangeSpecialty]);
845
+ const inputOnKeyDown = React.useCallback((e) => {
846
+ if (e.key === 'Enter') {
847
+ e.stopPropagation();
848
+ e.preventDefault();
849
+ onEnterSearch && onEnterSearch();
850
+ }
851
+ }, [onEnterSearch]);
852
+ return (React__default["default"].createElement(StyleSearchInputsWrapper, { ref: inputSearchWrapperRef },
853
+ React__default["default"].createElement(StyleSearchBarContainer, null,
854
+ showSpecialtyInSearchBar && (React__default["default"].createElement(SearchSpecialty, { state: state, isMobile: isMobile, dispatch: dispatch, debouncedFetchSearchResults: debouncedFetchSearchResults, onSpecialtyClick: handleSpecialtyClick, isCompact: true })),
855
+ React__default["default"].createElement(StyleSearchIconWrapper, null,
856
+ React__default["default"].createElement(core$1.Search, null)),
857
+ React__default["default"].createElement(core.Input, Object.assign({ ref: internalInputRef, variant: "unstyled", size: isMobile ? 'md' : 'lg', placeholder: placeholderSearch, styles: styleInputUnstyled, value: state.searchKeywords, name: "search-results", autoComplete: "off", onFocus: () => {
858
+ dispatch({ type: ActionTypes.FocusInputSearch });
859
+ onFocusInput === null || onFocusInput === void 0 ? void 0 : onFocusInput();
860
+ }, onChange: (event) => {
861
+ handleSearchInputChange(event.target.value);
862
+ }, onKeyDown: inputOnKeyDown }, gaAttributes))),
863
+ !isMobile && type !== 'specialty' && (React__default["default"].createElement(StyleResultWrapper, null,
864
+ React__default["default"].createElement(SearchResultContent, { type: type, state: state, dispatch: dispatch, isLoading: isLoading, typeInformation: typeInformation, clientSlug: clientSlug })))));
865
+ });
866
+ SearchInputs.displayName = 'SearchInputs';
867
+
868
+ const ModalSearchResult = (_a) => {
869
+ var { searchInputEle, closeModal, children } = _a, props = tslib_es6.__rest(_a, ["searchInputEle", "closeModal", "children"]);
870
+ const theme = core.useMantineTheme();
871
+ return (React__default["default"].createElement(index$3.Modal, Object.assign({}, props, { zIndex: 310, fullScreen: true, styles: {
872
+ content: {
873
+ borderRadius: 0,
874
+ height: '100%',
875
+ '.search-results__body': { padding: 0 },
876
+ '.result-item': {
877
+ paddingLeft: 16,
878
+ paddingRight: 16,
879
+ },
880
+ '.noresult-block': {
881
+ padding: 16,
882
+ },
883
+ '.skeleton-result': {
884
+ padding: 16,
885
+ },
886
+ },
887
+ header: { display: 'none' },
888
+ } }),
889
+ React__default["default"].createElement(core.Stack, { spacing: 16, sx: { paddingTop: 16 } },
890
+ React__default["default"].createElement(core.Flex, { align: 'center', gap: 12 },
891
+ React__default["default"].createElement(arrow.ArrowLeft, { size: 28, onClick: closeModal, color: theme.fn.primaryColor() }),
892
+ React__default["default"].createElement(core.Box, { sx: { width: '100%' } }, searchInputEle)),
893
+ children)));
894
+ };
895
+
896
+ const StyleSearchLocationWrapper = styled__default["default"].div `
897
+ position: relative;
898
+ width: 240px;
899
+ flex-shrink: 0;
900
+
901
+ ${utils.MediaQueries.mbDown} {
902
+ width: 100%;
903
+ }
904
+ `;
905
+ styled__default["default"].div `
906
+ position: absolute;
907
+ top: calc(100% + 2px);
908
+ width: 100%;
909
+ border-radius: 4px;
910
+ background: ${miscTheme.theme.colors.white};
911
+ box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1);
912
+ z-index: 10;
913
+
914
+ ${utils.MediaQueries.mbDown} {
915
+ width: calc(100% + 64px);
916
+ left: -32px;
917
+ }
918
+ `;
919
+ const StyledLocationItem = styled__default["default"].div `
920
+ position: relative;
921
+ cursor: pointer;
922
+ padding: 12px 18px;
923
+ display: flex;
924
+ align-items: center;
925
+ gap: 14px;
926
+ overflow: hidden;
927
+
928
+ & + li::before {
929
+ content: '';
930
+ position: absolute;
931
+ left: 18px;
932
+ right: 18px;
933
+ top: 0;
934
+ height: 1px;
935
+ background-color: ${miscTheme.theme.colors.neutral100};
936
+ }
937
+
938
+ &:not([data-is-denied='true']):hover {
939
+ background-color: ${miscTheme.theme.colors.neutral50};
940
+ }
941
+
942
+ &:last-child:hover {
943
+ border-bottom-right-radius: 6px;
944
+ border-bottom-left-radius: 6px;
945
+ }
946
+
947
+ &:first-child:hover {
948
+ border-top-right-radius: 6px;
949
+ border-top-left-radius: 6px;
950
+ }
951
+
952
+ &[data-is-denied='true'] {
953
+ cursor: not-allowed;
954
+ }
955
+ `;
956
+ const StyledPinIcon = styled__default["default"](utils$1.PinIcon) `
957
+ width: 12px;
958
+ height: 18px;
959
+ flex: 0 0 12px;
960
+ `;
961
+
962
+ const CustomSelectItem = React.forwardRef((_a, ref) => {
963
+ var { label, value } = _a, others = tslib_es6.__rest(_a, ["label", "value"]);
964
+ return (React__default["default"].createElement("div", Object.assign({ ref: ref }, others),
965
+ React__default["default"].createElement(StyledLocationItem, { key: value, role: "button", tabIndex: 0, "aria-label": `Select ${label} as location`, className: "location-item" },
966
+ React__default["default"].createElement(StyledPinIcon, { color: miscTheme.theme.colors.neutral400 }),
967
+ React__default["default"].createElement(core.Text, { size: "md" }, label))));
968
+ });
969
+
970
+ const SearchLocation = ({ state, debouncedFetchCitiesByKeyword, selectedLocation, trackingAttributes, onLocationClick, dispatch, }) => {
971
+ var _a;
972
+ const { t, locale } = index$1.useTranslations();
973
+ const inputLocationWrapperRef = React.useRef(null);
974
+ const citiesData = React.useMemo(() => {
975
+ var _a;
976
+ return [
977
+ {
978
+ name: t('booking.searchBar.allLocations'),
979
+ id: constants.ID_OPTION_ALL_LOCATION,
980
+ slug: (_a = constants.LOCALIZED_SLUGS[locale]) === null || _a === void 0 ? void 0 : _a.ALL,
981
+ },
982
+ ...state.cities,
983
+ ];
984
+ }, [state.cities, t, locale]);
985
+ const gaAttributes = React.useMemo(() => {
986
+ if (trackingAttributes) {
987
+ return {
988
+ 'data-event-category': trackingAttributes.dataEventCategory,
989
+ 'data-event-action': trackingAttributes.dataEventAction,
990
+ 'data-event-label': trackingAttributes.dataEventLabel,
991
+ };
992
+ }
993
+ return {};
994
+ }, [trackingAttributes]);
995
+ const handleSearchLocationInputChange = React.useCallback(function handleSearchLocationInputChange(value) {
996
+ dispatch({ type: ActionTypes.ChangeInputLocation, payload: value });
997
+ if (value.trim().length > SEARCH_KEYWORD_MIN_LENGTH[state.locale]) {
998
+ debouncedFetchCitiesByKeyword(value.trim());
999
+ }
1000
+ else {
1001
+ debouncedFetchCitiesByKeyword.cancel();
1002
+ dispatch({ type: ActionTypes.DisplayInitialCities });
1003
+ }
1004
+ }, [debouncedFetchCitiesByKeyword, dispatch, state.locale]);
1005
+ useOutsideClick.useOutsideClick(inputLocationWrapperRef, () => {
1006
+ dispatch({ type: ActionTypes.ClickOutsideInputLocation });
1007
+ });
1008
+ const stateValue = (_a = selectedLocation === null || selectedLocation === void 0 ? void 0 : selectedLocation.id) !== null && _a !== void 0 ? _a : null;
1009
+ const defaultValue = stateValue === null ? undefined : String(stateValue);
1010
+ return (React__default["default"].createElement(StyleSearchLocationWrapper, { ref: inputLocationWrapperRef },
1011
+ React__default["default"].createElement(core.Select, Object.assign({ key: defaultValue !== null && defaultValue !== void 0 ? defaultValue : 'no-selected-location', defaultValue: defaultValue, placeholder: t('booking.searchBar.allLocations'), searchable: true, onSearchChange: (value) => {
1012
+ handleSearchLocationInputChange(value);
1013
+ }, onFocus: () => {
1014
+ dispatch({ type: ActionTypes.DisplayInitialCities });
1015
+ }, onDropdownClose: () => {
1016
+ debouncedFetchCitiesByKeyword.cancel();
1017
+ dispatch({ type: ActionTypes.DisplayInitialCities });
1018
+ }, nothingFound: t('common.noResult'), maxDropdownHeight: 340, dropdownPosition: "bottom", icon: React__default["default"].createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
1019
+ React__default["default"].createElement("path", { d: "M9.99908 10.8332C11.2264 10.8332 12.2213 9.83764 12.2213 8.61097C12.2213 7.3843 11.2264 6.38875 9.99908 6.38875C8.77174 6.38875 7.77686 7.3843 7.77686 8.61097C7.77686 9.83764 8.77174 10.8332 9.99908 10.8332Z", stroke: "#111111", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
1020
+ React__default["default"].createElement("path", { d: "M9.99919 18.0554C11.7584 17.4999 16.6659 13.611 16.6659 8.61097C16.6659 4.93097 13.6811 1.94431 9.99919 1.94431C6.3173 1.94431 3.33252 4.93097 3.33252 8.61097C3.33252 13.611 8.23996 17.4999 9.99919 18.0554Z", stroke: "#111111", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })), rightSection: React__default["default"].createElement(ChevronDown.ChevronDown, { style: { width: 20, height: 20 } }) }, gaAttributes, { styles: () => ({
1021
+ item: {
1022
+ padding: 0,
1023
+ '&[data-selected]': {
1024
+ '&, &:hover': {
1025
+ backgroundColor: '#F7F9FC',
1026
+ color: 'inherit',
1027
+ },
1028
+ '.location-item': {
1029
+ '&::after': {
1030
+ content: utils$1.checkMarkIconUrl,
1031
+ top: '50%',
1032
+ right: 19,
1033
+ position: 'absolute',
1034
+ transform: 'translateY(-50%)',
1035
+ },
1036
+ },
1037
+ },
1038
+ '&[data-hovered]': {
1039
+ backgroundColor: 'transparent',
1040
+ },
1041
+ },
1042
+ root: {
1043
+ width: '100%',
1044
+ },
1045
+ wrapper: {
1046
+ width: '100%',
1047
+ },
1048
+ input: {
1049
+ '&:not(.mantine-Textarea-input)': {
1050
+ height: 48,
1051
+ fontSize: core.rem(15),
1052
+ fontWeight: 400,
1053
+ letterSpacing: '-0.3px',
1054
+ color: miscTheme.theme.colors.gray1000,
1055
+ paddingLeft: 44,
1056
+ paddingRight: 40,
1057
+ background: 'white',
1058
+ border: `1px solid ${miscTheme.theme.colors.gray200}`,
1059
+ borderRadius: 12,
1060
+ },
1061
+ },
1062
+ icon: {
1063
+ width: 44,
1064
+ paddingLeft: 12,
1065
+ },
1066
+ rightSection: {
1067
+ width: 40,
1068
+ paddingRight: 12,
1069
+ },
1070
+ itemsWrapper: {
1071
+ padding: 0,
1072
+ },
1073
+ dropdown: {
1074
+ left: '0 !important',
1075
+ border: 0,
1076
+ marginTop: 4,
1077
+ borderRadius: 12,
1078
+ overflow: 'hidden',
1079
+ boxShadow: '0px 0px 1px 0px rgba(0, 0, 0, 0.04), 0px 2px 8px 0px rgba(0, 0, 0, 0.04), 0px 10px 16px 0px rgba(0, 0, 0, 0.04)',
1080
+ '& ::-webkit-scrollbar': {
1081
+ width: '6px',
1082
+ height: '6px',
1083
+ },
1084
+ },
1085
+ }), itemComponent: CustomSelectItem, filter: () => true, onChange: (value) => {
1086
+ if (value == null)
1087
+ return;
1088
+ const city = citiesData.find((i) => String(i.id) === value);
1089
+ if (!city)
1090
+ return;
1091
+ onLocationClick(city);
1092
+ debouncedFetchCitiesByKeyword.cancel();
1093
+ dispatch({ type: ActionTypes.DisplayInitialCities });
1094
+ setTimeout(() => {
1095
+ var _a, _b;
1096
+ (_b = (_a = inputLocationWrapperRef.current) === null || _a === void 0 ? void 0 : _a.querySelector('input')) === null || _b === void 0 ? void 0 : _b.blur();
1097
+ }, 0);
1098
+ }, data: citiesData.map((city) => ({
1099
+ value: String(city.id),
1100
+ label: city.name,
1101
+ city,
1102
+ })) }))));
1103
+ };
1104
+
1105
+ const StyleSpecialtiesWrapper = styled__default["default"].div `
1106
+ display: flex;
1107
+ flex-wrap: wrap;
1108
+ row-gap: 8px;
1109
+ column-gap: 20px;
1110
+ ${utils.MediaQueries.mbDown} {
1111
+ margin-top: 12px;
1112
+ }
1113
+ `;
1114
+ const StyleSpecialtyItem = styled__default["default"].div `
1115
+ display: flex;
1116
+ align-items: center;
1117
+ border-radius: 8px;
1118
+ border: 1px solid ${miscTheme.theme.colors.neutral100};
1119
+ background: ${miscTheme.theme.colors.white};
1120
+ padding: 8px 12px 8px 8px;
1121
+ flex: 0 0 calc(33.3% - 13px);
1122
+ gap: 12px;
1123
+ cursor: pointer;
1124
+
1125
+ &:hover {
1126
+ background: ${miscTheme.theme.colors.blue50};
1127
+ }
1128
+
1129
+ ${utils.MediaQueries.tdDown} {
1130
+ flex: 0 0 calc(50% - 10px);
1131
+ }
1132
+
1133
+ ${utils.MediaQueries.mbDown} {
1134
+ flex: 0 0 100%;
1135
+ border: none;
1136
+ }
1137
+
1138
+ .image-item {
1139
+ display: flex;
1140
+ align-items: center;
1141
+ width: 40px;
1142
+ height: 40px;
1143
+
1144
+ img {
1145
+ width: 100%;
1146
+ object-fit: cover;
1147
+ }
1148
+ }
1149
+
1150
+ .infor {
1151
+ flex: 1;
1152
+ .title {
1153
+ color: ${miscTheme.theme.colors.gray800};
1154
+ font-size: 14px;
1155
+ font-style: normal;
1156
+ font-weight: 400;
1157
+ line-height: 22px;
1158
+ }
1159
+
1160
+ .description {
1161
+ color: ${miscTheme.theme.colors.gray600};
1162
+ font-size: 12px;
1163
+ font-weight: 400;
1164
+ line-height: 18px;
1165
+ }
1166
+ }
1167
+ `;
1168
+ const StyleDivider = styled__default["default"](core.Divider) `
1169
+ margin: 24px 0 !important;
1170
+ `;
1171
+ const StyleShowMore = styled__default["default"].div `
1172
+ display: flex;
1173
+ justify-content: center;
1174
+ margin-top: 24px;
1175
+ .show-more {
1176
+ border-radius: 4px;
1177
+ border: 1px solid ${miscTheme.theme.colors.neutral200};
1178
+ padding: 12px 16px;
1179
+ cursor: pointer;
1180
+ display: inline-block;
1181
+ color: ${miscTheme.theme.colors.gray800};
1182
+ font-size: 16px;
1183
+ font-weight: 600;
1184
+ line-height: 24px;
1185
+
1186
+ ${utils.MediaQueries.mbDown} {
1187
+ width: 100%;
1188
+ text-align: center;
1189
+ }
1190
+ }
1191
+ `;
1192
+
1193
+ const SearchResultSpecialties = ({ state, isMobile, specialties, isLoading, dispatch, }) => {
1194
+ const { t, locale } = index$1.useTranslations();
1195
+ const { selectedLocation } = state;
1196
+ const slugs = React.useMemo(() => constants.LOCALIZED_SLUGS[locale], [locale]);
1197
+ const handleOnClick = (specialtySlug) => {
1198
+ let url = '';
1199
+ if (specialtySlug === constants.SLUG_VACIN_ID) {
1200
+ url = `/${selectedLocation.slug}/${slugs.HOSPITAL}/${constants.CLIENT_KEY.GSK}/`;
1201
+ dispatch({ type: ActionTypes.ClickOutsideInputSearchSpecialty });
1202
+ }
1203
+ else {
1204
+ url = `/${selectedLocation.slug}/${slugs.DOCTOR}/${specialtySlug}`;
1205
+ }
1206
+ dispatch({ type: ActionTypes.NavigateTo, payload: url });
1207
+ };
1208
+ const handleShowMore = () => {
1209
+ const url = `/${slugs.SPECIALTIES}`;
1210
+ dispatch({ type: ActionTypes.NavigateTo, payload: url });
1211
+ };
1212
+ const showSeeMore = React.useMemo(() => {
1213
+ return (specialties.length >= 9 ||
1214
+ state.searchKeywords.trim().length <=
1215
+ SEARCH_KEYWORD_MIN_LENGTH[state.locale]);
1216
+ }, [state.searchKeywords, specialties]);
1217
+ return (React__default["default"].createElement(React__default["default"].Fragment, null,
1218
+ !isMobile && React__default["default"].createElement(StyleDivider, { color: "#E4E8EC" }),
1219
+ React__default["default"].createElement(StyleSpecialtiesWrapper, null,
1220
+ specialties.length > 0 && !isLoading && (React__default["default"].createElement(React__default["default"].Fragment, null, specialties.map((specialty, index) => {
1221
+ if (index >= 9) {
1222
+ return React__default["default"].createElement(React__default["default"].Fragment, null);
1223
+ }
1224
+ return (React__default["default"].createElement(StyleSpecialtyItem, { key: specialty.id, onClick: () => handleOnClick(specialty.slug) },
1225
+ React__default["default"].createElement("div", { className: "image-item" },
1226
+ React__default["default"].createElement("img", { src: specialty.thumbnail, alt: specialty.name })),
1227
+ React__default["default"].createElement("div", { className: "infor" },
1228
+ React__default["default"].createElement("div", { className: "title" }, specialty.name))));
1229
+ }))),
1230
+ specialties.length === 0 && !isLoading && (React__default["default"].createElement(index$2.Text, { size: "sm", color: miscTheme.theme.colors.gray400 }, t('booking.searchBar.noResults'))),
1231
+ isLoading &&
1232
+ Array(6)
1233
+ .fill(undefined)
1234
+ .map((_, i) => (React__default["default"].createElement(StyleSpecialtyItem, { key: 'loading' + i },
1235
+ React__default["default"].createElement("div", { className: "image-item" },
1236
+ React__default["default"].createElement(core.Skeleton, { height: 40, animate: true })),
1237
+ React__default["default"].createElement("div", { className: "infor" },
1238
+ React__default["default"].createElement("div", { className: "title" },
1239
+ React__default["default"].createElement(core.Skeleton, { height: 20, radius: "sm", animate: true }))))))),
1240
+ showSeeMore && (React__default["default"].createElement(StyleShowMore, null,
1241
+ React__default["default"].createElement("div", { className: "show-more", onClick: handleShowMore }, t('home.seeAll'))))));
1242
+ };
1243
+
1244
+ const StyleSearchTagWrapper = styled__default["default"].div `
1245
+ display: flex;
1246
+ gap: 5px;
1247
+ margin-top: 16px;
1248
+ flex-wrap: wrap;
1249
+ `;
1250
+ const StyleTagItem = styled__default["default"].div `
1251
+ color: ${miscTheme.theme.colors.gray600};
1252
+ font-size: 14px;
1253
+ font-weight: 600;
1254
+ line-height: 22px;
1255
+ padding: 4px 12px;
1256
+ background: ${miscTheme.theme.colors.white};
1257
+ border-radius: 32px;
1258
+ cursor: pointer;
1259
+ border: 1px solid ${miscTheme.theme.colors.white};
1260
+ margin-bottom: 5px;
1261
+ border-color: ${miscTheme.theme.colors.neutral100};
1262
+ background: #f7f9fc;
1263
+
1264
+ &.view-all {
1265
+ border-radius: 32px;
1266
+ border-color: ${miscTheme.theme.colors.blue50};
1267
+ background: ${miscTheme.theme.colors.blue50};
1268
+ color: ${miscTheme.theme.colors.blue600};
1269
+
1270
+ &:hover {
1271
+ border-color: ${miscTheme.theme.colors.blue50};
1272
+ background: ${miscTheme.theme.colors.blue50};
1273
+ color: ${miscTheme.theme.colors.blue600};
1274
+ }
1275
+ }
1276
+
1277
+ &:hover {
1278
+ border-color: ${miscTheme.theme.colors.neutral100};
1279
+ background: #f7f9fc;
1280
+ }
1281
+ `;
1282
+ const StyleTagLabel = styled__default["default"].div `
1283
+ color: ${miscTheme.theme.colors.gray600};
1284
+ font-size: 14px;
1285
+ font-weight: 600;
1286
+ line-height: 22px;
1287
+ padding: 4px 0;
1288
+ background: ${miscTheme.theme.colors.white};
1289
+ border-radius: 32px;
1290
+ border: 1px solid ${miscTheme.theme.colors.white};
1291
+ margin-bottom: 5px;
1292
+ margin-right: 7px;
1293
+ `;
1294
+
1295
+ const SearchTag = ({ state, type, typeInformation, dispatch }) => {
1296
+ const { t } = index$1.useTranslations();
1297
+ const { selectedLocation } = state;
1298
+ const typeSlug = React.useMemo(() => typeInformation[type].slug, [typeInformation, type]);
1299
+ const handleViewAll = () => {
1300
+ const url = `/${selectedLocation.slug}/${typeSlug}`;
1301
+ if (url) {
1302
+ dispatch({ type: ActionTypes.NavigateTo, payload: url });
1303
+ }
1304
+ };
1305
+ const handleClickKeyword = (keyword) => {
1306
+ if (keyword.url) {
1307
+ window.location.href = keyword.url;
1308
+ }
1309
+ };
1310
+ return (React__default["default"].createElement(StyleSearchTagWrapper, null,
1311
+ React__default["default"].createElement(StyleTagLabel, null, t('booking.searchBar.popularKey')),
1312
+ state.popularKeys.map((item) => {
1313
+ return (React__default["default"].createElement(StyleTagItem, { key: item.id, onClick: () => handleClickKeyword(item) }, item.keyword));
1314
+ }),
1315
+ React__default["default"].createElement(StyleTagItem, { className: "view-all", onClick: handleViewAll }, t('booking.searchBar.viewAll'))));
1316
+ };
1317
+
1318
+ const StyledTabWrapper = styled__default["default"].div `
1319
+ background: rgba(255, 255, 255, 0.64);
1320
+ backdrop-filter: blur(12px);
1321
+ border-bottom: 1px solid ${miscTheme.theme.colors.neutral100};
1322
+ `;
1323
+ const StyleTabContainer = styled__default["default"](index.Container) `
1324
+ padding: 0 16px;
1325
+ `;
1326
+
1327
+ const TabSearch = ({ currentTab, hideTabBookingSearch = [], hideSpecialtyTab, isMobile, setCurrentTab, }) => {
1328
+ const { t } = index$1.useTranslations();
1329
+ const stylesTabs = React.useMemo(() => {
1330
+ return {
1331
+ root: {
1332
+ overflowY: isMobile ? 'hidden' : 'initial',
1333
+ overflowX: isMobile ? 'auto' : 'initial',
1334
+ },
1335
+ tabsList: {
1336
+ background: 'rgba(255, 255, 255, 0)',
1337
+ borderBottom: 'none',
1338
+ flexWrap: 'nowrap',
1339
+ '.mantine-Tabs-tab': {
1340
+ '&:last-child': {
1341
+ '&:after': {
1342
+ display: 'none',
1343
+ },
1344
+ },
1345
+ },
1346
+ },
1347
+ tab: {
1348
+ padding: isMobile ? '12px 16px 12px 16px' : '15px 40px 15px 40px',
1349
+ borderTop: '2px solid transparent',
1350
+ borderBottom: 'none',
1351
+ margin: 0,
1352
+ borderRadius: 0,
1353
+ position: 'relative',
1354
+ width: 'auto',
1355
+ '&[data-active="true"]': {
1356
+ borderColor: '#2d87f3',
1357
+ backgroundColor: '#ffffff',
1358
+ '&:after': {
1359
+ display: 'none',
1360
+ },
1361
+ '&:before': {
1362
+ content: '""',
1363
+ width: '100%',
1364
+ height: '1px',
1365
+ position: 'absolute',
1366
+ backgroundColor: '#ffffff',
1367
+ bottom: '-1px',
1368
+ },
1369
+ },
1370
+ '&:hover': {
1371
+ borderColor: '#2d87f3',
1372
+ backgroundColor: '#ffffff',
1373
+ '&:before': {
1374
+ content: '""',
1375
+ width: '100%',
1376
+ height: '1px',
1377
+ position: 'absolute',
1378
+ backgroundColor: '#ffffff',
1379
+ bottom: '-1px',
1380
+ },
1381
+ },
1382
+ '&:after': {
1383
+ content: '""',
1384
+ width: '1px',
1385
+ height: '24px',
1386
+ backgroundColor: '#E4E8EC',
1387
+ position: 'absolute',
1388
+ right: '-1px',
1389
+ },
1390
+ },
1391
+ tabLabel: {
1392
+ color: '#595959',
1393
+ fontSize: isMobile ? '14px' : '16px',
1394
+ fontWeight: 600,
1395
+ lineHeight: isMobile ? '22px' : '24px',
1396
+ },
1397
+ };
1398
+ }, [isMobile]);
1399
+ const tabConfig = React.useMemo(() => [
1400
+ {
1401
+ value: 'hospital',
1402
+ label: t('booking.searchPopup.hospitals'),
1403
+ },
1404
+ {
1405
+ value: 'doctor',
1406
+ label: t('booking.searchPopup.doctors'),
1407
+ },
1408
+ {
1409
+ value: 'service',
1410
+ label: t('booking.searchPopup.services'),
1411
+ },
1412
+ ...(!hideSpecialtyTab
1413
+ ? [
1414
+ {
1415
+ value: 'specialty',
1416
+ label: t('booking.searchPopup.specialties'),
1417
+ },
1418
+ ]
1419
+ : []),
1420
+ ], [hideSpecialtyTab]);
1421
+ const activeTabs = React.useMemo(() => {
1422
+ return (tabConfig.filter((item) => !hideTabBookingSearch.includes(item.value)) ||
1423
+ []);
1424
+ }, [hideTabBookingSearch, tabConfig]);
1425
+ return (React__default["default"].createElement(StyledTabWrapper, { className: "booking-search-tab" },
1426
+ React__default["default"].createElement(StyleTabContainer, null,
1427
+ React__default["default"].createElement(core.Tabs, { value: currentTab, onTabChange: (tab) => {
1428
+ setCurrentTab(tab);
1429
+ }, styles: stylesTabs },
1430
+ React__default["default"].createElement(core.Tabs.List, null, activeTabs.map((tab) => {
1431
+ return (React__default["default"].createElement(core.Tabs.Tab, { value: tab.value, key: tab.value }, tab.label));
1432
+ }))))));
1433
+ };
1434
+
1435
+ var TypePopularKeySearch;
1436
+ (function (TypePopularKeySearch) {
1437
+ TypePopularKeySearch["doctor"] = "doctor";
1438
+ TypePopularKeySearch["service"] = "hospital_service";
1439
+ TypePopularKeySearch["hospital"] = "hospital_branch";
1440
+ })(TypePopularKeySearch || (TypePopularKeySearch = {}));
1441
+
1442
+ const ignoreCacarSpecialty = (specialties) => {
1443
+ return specialties.filter((item) => {
1444
+ if (typeof item === 'string') {
1445
+ return item !== 'cacar-api';
1446
+ }
1447
+ return (item === null || item === void 0 ? void 0 : item.id) !== 232;
1448
+ });
1449
+ };
1450
+ function useSearchBarApi({ dispatch, careApiDomain, locale = 'vi-VN', client = '', }) {
1451
+ const fetchCitiesApi = React.useCallback(function fetchCitiesApi(path, params = {}) {
1452
+ const url = `${careApiDomain}${path}`;
1453
+ dispatch({ type: ActionTypes.FetchCitiesStart });
1454
+ return fetch(utils$1.getApiPath(url, params, locale), { method: 'GET' })
1455
+ .then((res) => res.json())
1456
+ .then((data) => {
1457
+ if (data._status !== 1 || !data._data) {
1458
+ console.log('error loading cities', data);
1459
+ return Promise.reject(data);
1460
+ }
1461
+ return data === null || data === void 0 ? void 0 : data._data;
1462
+ })
1463
+ .finally(() => dispatch({ type: ActionTypes.FetchCitiesFinish }));
1464
+ }, [locale]);
1465
+ const fetchCitiesByLocation = React.useCallback(function fetchCitiesByLocation({ coordinates }) {
1466
+ let params = {};
1467
+ const moreParams = {};
1468
+ if (coordinates) {
1469
+ params = {
1470
+ lat: coordinates.lat,
1471
+ lng: coordinates.lng,
1472
+ };
1473
+ }
1474
+ if (locale === 'ms-MY') {
1475
+ moreParams.noPaging = 1;
1476
+ }
1477
+ const requests = [
1478
+ fetchCitiesApi(paths.PATHS.GET_CITY_BY_IP, Object.assign(Object.assign(Object.assign({}, params), moreParams), { hospitalActive: 1, client: constants.CLIENT_KEY.MSD === client ? '' : client })),
1479
+ ];
1480
+ if (locale === 'zh-TW') {
1481
+ requests.push(fetchCitiesApi(paths.PATHS.GET_CITIES_LIST, {
1482
+ noPaging: 1,
1483
+ hospitalActive: 1,
1484
+ client: constants.CLIENT_KEY.MSD === client ? '' : client,
1485
+ }));
1486
+ }
1487
+ else {
1488
+ requests.push(fetchCitiesApi(paths.PATHS.GET_CITIES_LIST, {
1489
+ noPaging: 1,
1490
+ hospitalActive: 1,
1491
+ }));
1492
+ }
1493
+ return Promise.all(requests)
1494
+ .then(([data1, data2]) => {
1495
+ const data = Object.assign({}, data1);
1496
+ if (data2) {
1497
+ const citiesIds = data.cities.map((c) => c.id);
1498
+ data.cities = data.cities.concat(data2.cities.filter((c) => !citiesIds.includes(c.id)));
1499
+ }
1500
+ dispatch({
1501
+ type: ActionTypes.FetchCitiesByGeoIpComplete,
1502
+ payload: data,
1503
+ });
1504
+ })
1505
+ .catch((err) => console.error('error loading cities by location', err));
1506
+ }, [locale, careApiDomain, dispatch]);
1507
+ const fetchCitiesByKeyword = React.useCallback(function fetchCitiesByKeyword(keyword) {
1508
+ return fetchCitiesApi(paths.PATHS.GET_CITIES_LIST, {
1509
+ keyword,
1510
+ client,
1511
+ })
1512
+ .then((data) => {
1513
+ dispatch({
1514
+ type: ActionTypes.FetchCitiesByKeywordComplete,
1515
+ payload: data.cities,
1516
+ });
1517
+ })
1518
+ .catch((err) => console.error('error loading cities by keyword', err));
1519
+ }, [locale, careApiDomain, dispatch]);
1520
+ const fetchSearchResults = React.useCallback(function fetchSearchResults(searchKeywords, state, searchType, clientSlug, cacheResult) {
1521
+ const url = searchType === 'specialty'
1522
+ ? `${careApiDomain}${paths.PATHS.GET_SEARCH_SPECIALTY}`
1523
+ : `${careApiDomain}${paths.PATHS.GET_SEARCH_V2}`;
1524
+ dispatch({ type: ActionTypes.FetchSearchResultsStart });
1525
+ const { selectedLocation, geoLocationCoordinates, selectedSpecialty } = state;
1526
+ let cityId = '';
1527
+ if (!selectedLocation) {
1528
+ dispatch({ type: ActionTypes.FetchSearchResultsFinish });
1529
+ return;
1530
+ }
1531
+ if (selectedLocation.id === constants.ID_OPTION_ALL_LOCATION) {
1532
+ cityId = '';
1533
+ }
1534
+ else {
1535
+ cityId = selectedLocation.id;
1536
+ }
1537
+ const lat = (geoLocationCoordinates === null || geoLocationCoordinates === void 0 ? void 0 : geoLocationCoordinates.lat) || '';
1538
+ const lng = (geoLocationCoordinates === null || geoLocationCoordinates === void 0 ? void 0 : geoLocationCoordinates.lng) || '';
1539
+ const specialty_id = (selectedSpecialty === null || selectedSpecialty === void 0 ? void 0 : selectedSpecialty.id) > 0 ? selectedSpecialty === null || selectedSpecialty === void 0 ? void 0 : selectedSpecialty.id : '';
1540
+ const keyword = searchKeywords.trim().length > SEARCH_KEYWORD_MIN_LENGTH[locale]
1541
+ ? searchKeywords.trim()
1542
+ : '';
1543
+ return fetch(utils$1.getApiPath(url, Object.assign({ domain: careApiDomain, searchType: searchType || 'global', keyword: keyword, city: cityId === constants.ID_OPTION_CURRENT_LOCATION ? '' : cityId, lat,
1544
+ lng,
1545
+ specialty_id, client_slug: constants.CLIENT_KEY.MSD === clientSlug ? '' : clientSlug, msd: constants.CLIENT_KEY.MSD === client ? 1 : '' }, (searchType === 'doctor' && {
1546
+ skipBooking: 1,
1547
+ })), locale), {
1548
+ method: 'GET',
1549
+ headers: {
1550
+ accept: 'version=2.0.0.0',
1551
+ },
1552
+ })
1553
+ .then((res) => res.json())
1554
+ .then((data) => {
1555
+ if (data._status !== 1 || !data._data) {
1556
+ return Promise.reject(data);
1557
+ }
1558
+ return data === null || data === void 0 ? void 0 : data._data;
1559
+ })
1560
+ .then((results) => {
1561
+ let searchesResult = [];
1562
+ if (searchType !== 'specialty') {
1563
+ if (searchType === 'doctor') {
1564
+ searchesResult = results.searches.map((item) => {
1565
+ return Object.assign(Object.assign({}, item), { specialties: ignoreCacarSpecialty((item === null || item === void 0 ? void 0 : item.specialties) || []) });
1566
+ });
1567
+ }
1568
+ else {
1569
+ searchesResult = results.searches;
1570
+ }
1571
+ }
1572
+ if (searchType === 'specialty') {
1573
+ if (keyword) {
1574
+ searchesResult = ignoreCacarSpecialty((results === null || results === void 0 ? void 0 : results.specialties) || []);
1575
+ }
1576
+ else {
1577
+ searchesResult = ignoreCacarSpecialty((results === null || results === void 0 ? void 0 : results.default) || []);
1578
+ }
1579
+ }
1580
+ dispatch({
1581
+ type: ActionTypes.FetchSearchResultsComplete,
1582
+ payload: {
1583
+ key: searchType,
1584
+ searches: searchesResult || [],
1585
+ },
1586
+ });
1587
+ if (cacheResult) {
1588
+ dispatch({
1589
+ type: ActionTypes.UpdateInitialSearchResults,
1590
+ payload: {
1591
+ key: searchType,
1592
+ searches: searchesResult || [],
1593
+ },
1594
+ });
1595
+ }
1596
+ })
1597
+ .catch((error) => {
1598
+ console.log('error loading search results', { url, error });
1599
+ })
1600
+ .finally(() => dispatch({ type: ActionTypes.FetchSearchResultsFinish }));
1601
+ }, [locale, careApiDomain, dispatch]);
1602
+ const fetchAllSpecialties = React.useCallback(function fetchSearchSpecialties() {
1603
+ const url = `${careApiDomain}${paths.PATHS.GET_SEARCH_SPECIALTY}`;
1604
+ return fetch(utils$1.getApiPath(url, {
1605
+ domain: careApiDomain,
1606
+ searchType: '',
1607
+ msd: constants.CLIENT_KEY.MSD === client ? 1 : '',
1608
+ }, locale), {
1609
+ method: 'GET',
1610
+ headers: {
1611
+ accept: 'version=2.0.0.0',
1612
+ },
1613
+ })
1614
+ .then((res) => res.json())
1615
+ .then((data) => {
1616
+ if (data._status !== 1 || !data._data) {
1617
+ return Promise.reject(data);
1618
+ }
1619
+ return data === null || data === void 0 ? void 0 : data._data;
1620
+ })
1621
+ .then((results) => {
1622
+ dispatch({
1623
+ type: ActionTypes.FetchAllSpecialties,
1624
+ payload: ignoreCacarSpecialty(results.specialties || []),
1625
+ });
1626
+ })
1627
+ .catch((error) => {
1628
+ console.log('error loading search results', { url, error });
1629
+ });
1630
+ }, [locale, careApiDomain, dispatch]);
1631
+ const fetchPopularKeys = React.useCallback(function fetchPopularKeys(searchType) {
1632
+ const url = `${careApiDomain}${paths.PATHS.GET_SEARCH_POPULAR_KEY}`;
1633
+ return fetch(utils$1.getApiPath(url, {
1634
+ domain: careApiDomain,
1635
+ searchType: TypePopularKeySearch[searchType],
1636
+ sort_by: 'display_order',
1637
+ sort_order: 'asc',
1638
+ }, locale))
1639
+ .then((res) => res.json())
1640
+ .then((data) => {
1641
+ if (data._status !== 1 || !data._data) {
1642
+ return Promise.reject(data);
1643
+ }
1644
+ return data === null || data === void 0 ? void 0 : data._data;
1645
+ })
1646
+ .then((results) => {
1647
+ dispatch({
1648
+ type: ActionTypes.FetchPopularKeys,
1649
+ payload: results.popular_searches || [],
1650
+ });
1651
+ })
1652
+ .catch((error) => {
1653
+ console.log('error loading search results', { url, error });
1654
+ });
1655
+ }, [locale, careApiDomain, dispatch]);
1656
+ return {
1657
+ fetchCitiesByLocation,
1658
+ fetchCitiesByKeyword,
1659
+ fetchSearchResults,
1660
+ fetchAllSpecialties,
1661
+ fetchPopularKeys,
1662
+ };
1663
+ }
1664
+
1665
+ const BookingSearchBarV3 = ({ isMobile, careApiDomain, geoLocationPermission: geoLocationPermissionFromProps, geoLocationCoordinates: geoLocationCoordinatesFromProps, initialSelectedCity: initialSelectedCityFromProps, initialSearchValue = '', initTypeSearch = 'hospital', initSpecialty, careFrontDomain = '/care', isDebug = false,
1666
+ // askForGeolocationPermission = false,
1667
+ gaTrackingSearchBar, gaTrackingLocationSearch, autoCompleteDisabled = false, inputSearchPlaceholder = '', hideTabBookingSearch = [], hideSpecialtySelection = false, hideSpecialtyTab = false, hidePopularSearchKeys = false, clientSlug = '',
1668
+ // isOptionAllLocation = false,
1669
+ // hideResults = [],
1670
+ // isNavResultItem = true,
1671
+ triggerSearchWhenChangeFilter, routerPush, onGeoLocationPermissionChange,
1672
+ // onSearch,
1673
+ onChangeLocation, }) => {
1674
+ var _a;
1675
+ const { locale, t } = index$1.useTranslations();
1676
+ const wrapperRef = React.useRef(null);
1677
+ const searchInputDesktopRef = React.useRef(null);
1678
+ const searchInputMobileRef = React.useRef(null);
1679
+ const inputSearchSpecialtyWrapperRef = React.useRef(null);
1680
+ const [currentTab, setCurrentTab] = React.useState(initTypeSearch);
1681
+ const { geoLocationPermission: geoLocationPermissionFromHook, geoLocationCoordinates: geoLocationCoordinatesFromHook, } = utils$1.useGeolocation();
1682
+ const [state, dispatch] = React.useReducer(reducer, initialState, (s) => (Object.assign(Object.assign({}, s), { isDebug,
1683
+ isMobile, geoLocationPermission: geoLocationPermissionFromProps ||
1684
+ geoLocationPermissionFromHook ||
1685
+ 'unset', geoLocationCoordinates: geoLocationCoordinatesFromProps ||
1686
+ geoLocationCoordinatesFromHook ||
1687
+ null, searchKeywords: initialSearchValue, initialSelectedCity: initialSelectedCityFromProps || null, selectedLocation: initialSelectedCityFromProps || s.selectedLocation || null, searchLocationKeywords: (initialSelectedCityFromProps === null || initialSelectedCityFromProps === void 0 ? void 0 : initialSelectedCityFromProps.name) || s.searchLocationKeywords, autoCompleteDisabled,
1688
+ inputSearchPlaceholder,
1689
+ locale })));
1690
+ const { navigateTo, focusedSpecialty,
1691
+ // isLoadingCities,
1692
+ // cities,
1693
+ searchKeywords, geoLocationPermission, selectedLocation,
1694
+ // selectedSpecialty,
1695
+ initialSelectedCity,
1696
+ // defaultCity,
1697
+ searchResults, isLoadingSearchResults,
1698
+ // isMobileModalOpened,
1699
+ // inputSearchPlaceholder,
1700
+ // allSpecialties,
1701
+ } = state;
1702
+ const { fetchCitiesByLocation, fetchCitiesByKeyword, fetchSearchResults, fetchAllSpecialties, fetchPopularKeys, } = useSearchBarApi({
1703
+ dispatch,
1704
+ locale,
1705
+ careApiDomain,
1706
+ client: clientSlug,
1707
+ });
1708
+ const slugs = React.useMemo(() => constants.LOCALIZED_SLUGS[locale], [locale]);
1709
+ const [opened, { close, open }] = hooks.useDisclosure(false);
1710
+ const typeInformation = React.useMemo(() => {
1711
+ return Object.assign({ doctor: {
1712
+ name: t('booking.searchPopup.doctors'),
1713
+ icon: React__default["default"].createElement(DoctorIcon, null),
1714
+ slug: slugs.DOCTOR,
1715
+ }, service: {
1716
+ name: t('booking.searchPopup.services'),
1717
+ icon: React__default["default"].createElement(ServiceIcon, null),
1718
+ slug: slugs.SERVICE,
1719
+ }, hospital: {
1720
+ name: t('booking.searchPopup.hospitals'),
1721
+ icon: React__default["default"].createElement(HospitalIcon, null),
1722
+ slug: slugs.HOSPITAL,
1723
+ } }, (!hideSpecialtyTab && {
1724
+ specialty: {
1725
+ name: t('booking.searchPopup.specialties'),
1726
+ icon: React__default["default"].createElement(SpecialtyIcon, null),
1727
+ slug: slugs.SPECIALTIES,
1728
+ },
1729
+ }));
1730
+ }, [currentTab]);
1731
+ const debouncedFetchCitiesByKeyword = React.useMemo(() => debounce__default["default"](fetchCitiesByKeyword, 400), [fetchCitiesByKeyword]);
1732
+ const debouncedFetchSearchResults = React.useMemo(() => debounce__default["default"](fetchSearchResults, 400), [fetchSearchResults]);
1733
+ // function focusSearchInput() {
1734
+ // if (wrapperRef.current) {
1735
+ // wrapperRef.current
1736
+ // .querySelector<HTMLInputElement>('input[name="search-results"]')
1737
+ // ?.focus()
1738
+ // }
1739
+ // }
1740
+ const onClickSearchByKeyword = React.useCallback(function onClickSearchByKeyword({ locationSlug, specialtyId, } = {}) {
1741
+ var _a;
1742
+ close();
1743
+ let url = '';
1744
+ const { slug: typeSlug } = typeInformation[currentTab];
1745
+ let moreParams = '';
1746
+ const slugClientUrl = constants.MAPPING_CLIENT_WITH_SLUG[locale][clientSlug];
1747
+ const selectedSpecialtyId = specialtyId || ((_a = state.selectedSpecialty) === null || _a === void 0 ? void 0 : _a.id) || -1;
1748
+ const selectedLocationSlug = locationSlug || (selectedLocation === null || selectedLocation === void 0 ? void 0 : selectedLocation.slug) || '';
1749
+ if ((currentTab === 'doctor' || currentTab === 'hospital') &&
1750
+ selectedSpecialtyId > 0) {
1751
+ moreParams = `&specialtyId=${selectedSpecialtyId}`;
1752
+ }
1753
+ if (currentTab === 'specialty') {
1754
+ url = `/${typeSlug}`;
1755
+ }
1756
+ else {
1757
+ url = `/${selectedLocationSlug}/${typeSlug}`;
1758
+ }
1759
+ if (slugClientUrl) {
1760
+ url += `/${slugClientUrl}`;
1761
+ }
1762
+ url += `?q=${searchKeywords}${moreParams}`;
1763
+ if (url) {
1764
+ dispatch({ type: ActionTypes.NavigateTo, payload: url });
1765
+ }
1766
+ }, [
1767
+ clientSlug,
1768
+ close,
1769
+ currentTab,
1770
+ dispatch,
1771
+ locale,
1772
+ searchKeywords,
1773
+ selectedLocation === null || selectedLocation === void 0 ? void 0 : selectedLocation.slug,
1774
+ (_a = state.selectedSpecialty) === null || _a === void 0 ? void 0 : _a.id,
1775
+ typeInformation,
1776
+ ]);
1777
+ const handleLocationClick = React.useCallback(function handleLocationClick(city) {
1778
+ triggerSearchWhenChangeFilter &&
1779
+ onClickSearchByKeyword({ locationSlug: city.slug });
1780
+ dispatch({ type: ActionTypes.SelectLocation, payload: city });
1781
+ if (onChangeLocation) {
1782
+ onChangeLocation(city);
1783
+ }
1784
+ }, [
1785
+ dispatch,
1786
+ isMobile,
1787
+ onChangeLocation,
1788
+ onClickSearchByKeyword,
1789
+ triggerSearchWhenChangeFilter,
1790
+ ]);
1791
+ useOutsideClick.useOutsideClick(inputSearchSpecialtyWrapperRef, () => {
1792
+ !isMobile &&
1793
+ dispatch({ type: ActionTypes.ClickOutsideInputSearchSpecialty });
1794
+ });
1795
+ React.useEffect(() => {
1796
+ var _a;
1797
+ if (geoLocationPermission !== 'denied' && !initialSelectedCity) {
1798
+ dispatch({
1799
+ type: ActionTypes.SelectLocation,
1800
+ payload: {
1801
+ name: t('booking.searchBar.allLocations'),
1802
+ id: constants.ID_OPTION_ALL_LOCATION,
1803
+ slug: (_a = constants.LOCALIZED_SLUGS[locale]) === null || _a === void 0 ? void 0 : _a.ALL,
1804
+ },
1805
+ });
1806
+ }
1807
+ if (onGeoLocationPermissionChange) {
1808
+ onGeoLocationPermissionChange(geoLocationPermission, state.geoLocationCoordinates);
1809
+ }
1810
+ if (isMobile && geoLocationPermission === 'granted' && selectedLocation) {
1811
+ dispatch({ type: ActionTypes.FocusInputSearch });
1812
+ }
1813
+ fetchCitiesByLocation({ coordinates: state.geoLocationCoordinates });
1814
+ }, [geoLocationPermission]);
1815
+ React.useEffect(() => {
1816
+ var _a;
1817
+ const defaultSpecialty = initSpecialty
1818
+ ? initSpecialty
1819
+ : {
1820
+ name: t('booking.searchBar.allSpecialties'),
1821
+ id: -1,
1822
+ thumbnail: '',
1823
+ total_doctor: 0,
1824
+ slug: slugs.SPECIALTIES,
1825
+ };
1826
+ if (initSpecialty) {
1827
+ if (((_a = state.selectedSpecialty) === null || _a === void 0 ? void 0 : _a.id) !== initSpecialty.id) {
1828
+ dispatch({
1829
+ type: ActionTypes.SelectSpecialty,
1830
+ payload: initSpecialty,
1831
+ });
1832
+ }
1833
+ return;
1834
+ }
1835
+ if (!state.selectedSpecialty ||
1836
+ state.selectedSpecialty.id !== defaultSpecialty.id) {
1837
+ dispatch({
1838
+ type: ActionTypes.SelectSpecialty,
1839
+ payload: defaultSpecialty,
1840
+ });
1841
+ }
1842
+ }, [initSpecialty, slugs.SPECIALTIES, t]);
1843
+ React.useEffect(() => {
1844
+ fetchAllSpecialties();
1845
+ }, []);
1846
+ React.useEffect(() => {
1847
+ fetchPopularKeys(currentTab);
1848
+ }, [currentTab]);
1849
+ React.useEffect(() => {
1850
+ if (navigateTo) {
1851
+ if (routerPush) {
1852
+ routerPush(navigateTo);
1853
+ }
1854
+ else {
1855
+ window.location.href = `${careFrontDomain}${navigateTo}`;
1856
+ }
1857
+ }
1858
+ }, [navigateTo]);
1859
+ React.useEffect(() => {
1860
+ fetchSearchResults(state.searchKeywords, state, currentTab, clientSlug, true);
1861
+ }, [currentTab]);
1862
+ React.useEffect(() => {
1863
+ if (opened && isMobile) {
1864
+ const timer = setTimeout(() => {
1865
+ var _a;
1866
+ (_a = searchInputMobileRef.current) === null || _a === void 0 ? void 0 : _a.focus();
1867
+ }, 150);
1868
+ return () => clearTimeout(timer);
1869
+ }
1870
+ }, [opened, isMobile]);
1871
+ const searchInputsProps = {
1872
+ type: currentTab,
1873
+ isMobile: isMobile,
1874
+ state: state,
1875
+ dispatch: dispatch,
1876
+ debouncedFetchSearchResults: debouncedFetchSearchResults,
1877
+ initalSearchValue: initialSearchValue,
1878
+ // focusSearchInput: focusSearchInput,
1879
+ onEnterSearch: onClickSearchByKeyword,
1880
+ typeInformation: typeInformation,
1881
+ trackingAttributes: gaTrackingSearchBar,
1882
+ isLoading: isLoadingSearchResults,
1883
+ hideSpecialtySelection: hideSpecialtySelection || hideSpecialtyTab,
1884
+ clientSlug: clientSlug,
1885
+ triggerSearchWhenChangeFilter,
1886
+ onChangeSpecialty: (specialty) => triggerSearchWhenChangeFilter &&
1887
+ onClickSearchByKeyword({ specialtyId: specialty.id }),
1888
+ };
1889
+ return (React__default["default"].createElement(React__default["default"].Fragment, null,
1890
+ React__default["default"].createElement(StyledSearchBarWrapper, { ref: wrapperRef },
1891
+ React__default["default"].createElement(TabSearch, { currentTab: currentTab, setCurrentTab: setCurrentTab, isMobile: isMobile, hideTabBookingSearch: hideTabBookingSearch, hideSpecialtyTab: hideSpecialtyTab }),
1892
+ React__default["default"].createElement(StyleWrapperContainer, { className: "booking-search-container" },
1893
+ React__default["default"].createElement(StyleSearchInputContainer, null,
1894
+ React__default["default"].createElement(StyleSearchContent, { className: "booking-search-content" },
1895
+ React__default["default"].createElement("div", { ref: inputSearchSpecialtyWrapperRef },
1896
+ React__default["default"].createElement(core.Flex, { gap: "12px", align: "center", className: "flex-search-input" },
1897
+ React__default["default"].createElement(SearchInputs, Object.assign({}, searchInputsProps, { ref: searchInputDesktopRef, onFocusInput: () => isMobile && open() })),
1898
+ currentTab !== 'specialty' && (React__default["default"].createElement(SearchLocation, { state: state, isMobile: isMobile, dispatch: dispatch, debouncedFetchCitiesByKeyword: debouncedFetchCitiesByKeyword, selectedLocation: selectedLocation, onLocationClick: handleLocationClick, trackingAttributes: gaTrackingLocationSearch })),
1899
+ !isMobile && (React__default["default"].createElement(index$4.Button, { size: "lg", variant: "primary", onClick: () => onClickSearchByKeyword(), styles: {
1900
+ root: {
1901
+ height: '48px',
1902
+ minWidth: '120px',
1903
+ borderRadius: '12px',
1904
+ },
1905
+ } }, t('booking.searchBar.searchButton')))),
1906
+ !hidePopularSearchKeys &&
1907
+ currentTab !== 'specialty' &&
1908
+ state.popularKeys.length > 0 && (React__default["default"].createElement(SearchTag, { type: currentTab, state: state, typeInformation: typeInformation, dispatch: dispatch })),
1909
+ currentTab === 'specialty' &&
1910
+ focusedSpecialty === 'search' && (React__default["default"].createElement(SearchResultSpecialties, { state: state, isMobile: isMobile, dispatch: dispatch, specialties: (searchResults === null || searchResults === void 0 ? void 0 : searchResults.specialty) || [], isLoading: isLoadingSearchResults }))))))),
1911
+ isMobile && (React__default["default"].createElement(ModalSearchResult, { keepMounted: true, opened: opened, onClose: close, closeModal: close, searchInputEle: React__default["default"].createElement(core.Flex, { align: 'center', gap: 8 },
1912
+ React__default["default"].createElement(SearchInputs, Object.assign({}, searchInputsProps, { onlyShowSearchBox: true, ref: searchInputMobileRef })),
1913
+ React__default["default"].createElement(index$4.Button, { variant: "primary", leftIcon: React__default["default"].createElement(core$1.Search, { size: 20, color: '#fff' }), onClick: () => onClickSearchByKeyword(), styles: {
1914
+ root: {
1915
+ borderRadius: '12px',
1916
+ },
1917
+ } })) },
1918
+ React__default["default"].createElement(core.Box, { sx: {
1919
+ marginLeft: -16,
1920
+ marginRight: -16,
1921
+ } },
1922
+ React__default["default"].createElement(SearchResultContent, { type: currentTab, state: state, dispatch: dispatch, isLoading: isLoadingSearchResults, typeInformation: typeInformation, clientSlug: clientSlug }))))));
1923
+ };
1924
+
1925
+ const StyledTextDivider = styled__default["default"].div `
1926
+ background-color: var(--neutral50);
1927
+ padding: 12px 0;
1928
+ box-shadow: inset 0px 1px 0px #e4e8ec;
1929
+
1930
+ > * {
1931
+ display: grid;
1932
+ grid-template-columns: 32px 1fr;
1933
+ align-content: center;
1934
+
1935
+ p {
1936
+ font-weight: 600;
1937
+ }
1938
+ }
1939
+
1940
+ .icon-wrapper {
1941
+ display: flex;
1942
+ align-items: center;
1943
+ }
1944
+ `;
1945
+ const TextDivider = ({ children, icon, className, style }) => (React__default["default"].createElement(StyledTextDivider, { style: style, className: className },
1946
+ React__default["default"].createElement(index.Container, null,
1947
+ React__default["default"].createElement("div", { className: "icon-wrapper" }, icon),
1948
+ React__default["default"].createElement(index$2.Text, { size: "c1", color: "var(--neutral800)" }, children))));
1949
+
1950
+ exports.BookingSearchBarV3 = BookingSearchBarV3;
1951
+ exports.TextDivider = TextDivider;