@hhgtech/hhg-components 1.29.532 → 1.29.533-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 (587) hide show
  1. package/build/{InputDate-f44138a5.js → InputDate-e26b9cb7.js} +5 -5
  2. package/build/{LastPeriod-1e613fcb.js → LastPeriod-cd45c531.js} +1 -1
  3. package/build/{MobileBottomNavigationIcon-b7c0293d.js → MobileBottomNavigationIcon-2eb327b4.js} +3 -3
  4. package/build/{SiteWideBanner-83b05580.js → SiteWideBanner-319a88f6.js} +234 -85
  5. package/build/{Spinner-a3dd0a36.js → Spinner-457c3f74.js} +1 -1
  6. package/build/{WhatsApp-6e913391.js → WhatsApp-7923a1b7.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/mantine/theme/text.d.ts +15 -1
  42. package/build/components/molecules/index.d.ts +1 -1
  43. package/build/components/molecules/productDetail/generalInfo/GeneralInfo.d.ts +2 -1
  44. package/build/components/molecules/productDetail/generalInfo/index.styled.d.ts +19 -0
  45. package/build/components/molecules/videoItem/constants.d.ts +2 -0
  46. package/build/components/molecules/videoItem/index.d.ts +2 -2
  47. package/build/components/molecules/videoItem/shorts/index.d.ts +1 -1
  48. package/build/components/molecules/videoItem/shorts/index.styles.d.ts +1 -0
  49. package/build/components/molecules/videoItem/types.d.ts +4 -0
  50. package/build/components/molecules/videoItem/utils.d.ts +7 -0
  51. package/build/components/molecules/videoItem/video/index.d.ts +1 -1
  52. package/build/components/navigationV2/constants.d.ts +2 -0
  53. package/build/components/navigationV2/index.d.ts +1 -0
  54. package/build/components.js +107 -106
  55. package/build/constants-24591878.js +26 -0
  56. package/build/{constants-9939ab70.js → constants-5450ed41.js} +2 -2
  57. package/build/{constants-d8e60c3b.js → constants-8a226813.js} +1 -1
  58. package/build/constants.js +3 -3
  59. package/build/constantsDomainLocales.js +1 -1
  60. package/build/constantsRiskScreener.js +2 -2
  61. package/build/constantsSite.js +2 -2
  62. package/build/{core-b67a4def.js → core-f99d82fb.js} +1 -1
  63. package/build/{dataTransform-91a5ec36.js → dataTransform-47354a08.js} +1 -1
  64. package/build/ecom.js +5 -5
  65. package/build/{editor-64be9f18.js → editor-74e71c32.js} +11 -11
  66. package/build/embeddedHeathToolCards_babyGrowth.js +25 -25
  67. package/build/embeddedHeathToolCards_babyPoop.js +22 -22
  68. package/build/embeddedHeathToolCards_babyVaccine.js +24 -24
  69. package/build/embeddedHeathToolCards_bmi_bmi.js +27 -27
  70. package/build/embeddedHeathToolCards_bmrBmr.js +27 -27
  71. package/build/embeddedHeathToolCards_dueDate_dueDate.js +24 -24
  72. package/build/embeddedHeathToolCards_ovulation_ovulation.js +24 -24
  73. package/build/embeddedHeathToolCards_pwg_pwg.js +28 -28
  74. package/build/embeddedHeathToolCards_targetHeartRate.js +29 -29
  75. package/build/esm/{InputDate-7a1e6c32.js → InputDate-05bc7502.js} +5 -5
  76. package/build/esm/{LastPeriod-ac7bc68b.js → LastPeriod-d645f8fa.js} +1 -1
  77. package/build/esm/{MobileBottomNavigationIcon-8e45374b.js → MobileBottomNavigationIcon-941a8266.js} +3 -3
  78. package/build/esm/{SiteWideBanner-fbb357d4.js → SiteWideBanner-7c89eb0c.js} +235 -86
  79. package/build/esm/{Spinner-4a0a16d7.js → Spinner-05b810cc.js} +1 -1
  80. package/build/esm/{WhatsApp-eff465a1.js → WhatsApp-0e32e710.js} +1 -1
  81. package/build/esm/adapters.js +20 -20
  82. package/build/esm/atoms.js +51 -51
  83. package/build/esm/babyGrowth.js +86 -86
  84. package/build/esm/cache.js +2 -2
  85. package/build/esm/care/components/organisms/bookingSearchBarV3/SearchResultContent.d.ts +13 -0
  86. package/build/esm/care/components/organisms/bookingSearchBarV3/constants.d.ts +4 -0
  87. package/build/esm/care/components/organisms/bookingSearchBarV3/index.d.ts +42 -0
  88. package/build/esm/care/components/organisms/bookingSearchBarV3/index.styled.d.ts +16 -0
  89. package/build/esm/care/components/organisms/bookingSearchBarV3/reducer.d.ts +166 -0
  90. package/build/esm/care/components/organisms/bookingSearchBarV3/searchInputs/ModalSearchResult.d.ts +8 -0
  91. package/build/esm/care/components/organisms/bookingSearchBarV3/searchInputs/index.d.ts +35 -0
  92. package/build/esm/care/components/organisms/bookingSearchBarV3/searchInputs/index.styled.d.ts +17 -0
  93. package/build/esm/care/components/organisms/bookingSearchBarV3/searchLocation/CustomSelectItem.d.ts +9 -0
  94. package/build/esm/care/components/organisms/bookingSearchBarV3/searchLocation/index.d.ts +16 -0
  95. package/build/esm/care/components/organisms/bookingSearchBarV3/searchLocation/index.styled.d.ts +21 -0
  96. package/build/esm/care/components/organisms/bookingSearchBarV3/searchResult/icons.d.ts +5 -0
  97. package/build/esm/care/components/organisms/bookingSearchBarV3/searchResult/index.d.ts +22 -0
  98. package/build/esm/care/components/organisms/bookingSearchBarV3/searchResult/index.styled.d.ts +21 -0
  99. package/build/esm/care/components/organisms/bookingSearchBarV3/searchResultSpecialties/index.d.ts +12 -0
  100. package/build/esm/care/components/organisms/bookingSearchBarV3/searchResultSpecialties/index.styled.d.ts +16 -0
  101. package/build/esm/care/components/organisms/bookingSearchBarV3/searchSpecialty/CustomSelectItem.d.ts +9 -0
  102. package/build/esm/care/components/organisms/bookingSearchBarV3/searchSpecialty/index.d.ts +15 -0
  103. package/build/esm/care/components/organisms/bookingSearchBarV3/searchSpecialty/index.styled.d.ts +13 -0
  104. package/build/esm/care/components/organisms/bookingSearchBarV3/searchTag/index.d.ts +17 -0
  105. package/build/esm/care/components/organisms/bookingSearchBarV3/searchTag/index.styled.d.ts +13 -0
  106. package/build/esm/care/components/organisms/bookingSearchBarV3/tabSearch/index.d.ts +11 -0
  107. package/build/esm/care/components/organisms/bookingSearchBarV3/tabSearch/index.styled.d.ts +8 -0
  108. package/build/esm/care/components/organisms/bookingSearchBarV3/types.d.ts +17 -0
  109. package/build/esm/care/components/organisms/bookingSearchBarV3/useSearchBarApi.d.ts +21 -0
  110. package/build/esm/care/index.d.ts +1 -0
  111. package/build/esm/care.js +22 -22
  112. package/build/esm/careBookingSearchBar.js +14 -14
  113. package/build/esm/careBookingSearchBarV2.js +19 -19
  114. package/build/esm/components/atoms/inputMB/index.styled.d.ts +3 -3
  115. package/build/esm/components/mantine/theme/text.d.ts +15 -1
  116. package/build/esm/components/molecules/index.d.ts +1 -1
  117. package/build/esm/components/molecules/productDetail/generalInfo/GeneralInfo.d.ts +2 -1
  118. package/build/esm/components/molecules/productDetail/generalInfo/index.styled.d.ts +19 -0
  119. package/build/esm/components/molecules/videoItem/constants.d.ts +2 -0
  120. package/build/esm/components/molecules/videoItem/index.d.ts +2 -2
  121. package/build/esm/components/molecules/videoItem/shorts/index.d.ts +1 -1
  122. package/build/esm/components/molecules/videoItem/shorts/index.styles.d.ts +1 -0
  123. package/build/esm/components/molecules/videoItem/types.d.ts +4 -0
  124. package/build/esm/components/molecules/videoItem/utils.d.ts +7 -0
  125. package/build/esm/components/molecules/videoItem/video/index.d.ts +1 -1
  126. package/build/esm/components/navigationV2/constants.d.ts +2 -0
  127. package/build/esm/components/navigationV2/index.d.ts +1 -0
  128. package/build/esm/components.js +107 -106
  129. package/build/esm/{constants-92625e47.js → constants-03714c7e.js} +1 -1
  130. package/build/esm/{constants-01997487.js → constants-9194bfe5.js} +2 -2
  131. package/build/esm/constants-f42847a4.js +21 -0
  132. package/build/esm/constants.js +3 -3
  133. package/build/esm/constantsDomainLocales.js +1 -1
  134. package/build/esm/constantsRiskScreener.js +2 -2
  135. package/build/esm/constantsSite.js +2 -2
  136. package/build/esm/{core-e29868ec.js → core-6abdf8d0.js} +1 -1
  137. package/build/esm/{dataTransform-6e98ea13.js → dataTransform-513198eb.js} +1 -1
  138. package/build/esm/ecom.js +5 -5
  139. package/build/esm/{editor-dfd89741.js → editor-45b768b8.js} +11 -11
  140. package/build/esm/embeddedHeathToolCards_babyGrowth.js +25 -25
  141. package/build/esm/embeddedHeathToolCards_babyPoop.js +22 -22
  142. package/build/esm/embeddedHeathToolCards_babyVaccine.js +24 -24
  143. package/build/esm/embeddedHeathToolCards_bmi_bmi.js +27 -27
  144. package/build/esm/embeddedHeathToolCards_bmrBmr.js +27 -27
  145. package/build/esm/embeddedHeathToolCards_dueDate_dueDate.js +24 -24
  146. package/build/esm/embeddedHeathToolCards_ovulation_ovulation.js +24 -24
  147. package/build/esm/embeddedHeathToolCards_pwg_pwg.js +28 -28
  148. package/build/esm/embeddedHeathToolCards_targetHeartRate.js +29 -29
  149. package/build/esm/footer.js +22 -22
  150. package/build/esm/gAssets.js +2 -2
  151. package/build/esm/{healthTools-25e01c7f.js → healthTools-e9d8e3f5.js} +1 -1
  152. package/build/esm/healthToolsCardWrapper.js +20 -20
  153. package/build/esm/healthToolsForm.js +35 -35
  154. package/build/esm/hooks.js +14 -14
  155. package/build/esm/i18n.js +2 -2
  156. package/build/esm/i18nV2.js +2 -2
  157. package/build/esm/{index-9351c606.js → index-032eadac.js} +1 -1
  158. package/build/esm/{index-acacb902.js → index-038af1ec.js} +6 -6
  159. package/build/esm/{index-48c9e0de.js → index-098487ec.js} +14 -0
  160. package/build/esm/{index-1c2e7003.js → index-192758bd.js} +25 -25
  161. package/build/esm/{index-0ece7544.js → index-1aebdee9.js} +3 -3
  162. package/build/esm/{index-f1076114.js → index-1d2cd200.js} +5 -5
  163. package/build/esm/{index-f9bb3e38.js → index-28f55c7c.js} +2 -2
  164. package/build/esm/{index-cc4cfda6.js → index-314ef50f.js} +24 -24
  165. package/build/esm/{index-df5f9470.js → index-33141d80.js} +7 -7
  166. package/build/esm/{index-bf0aa642.js → index-34d21427.js} +3 -3
  167. package/build/esm/{index-8e9636e8.js → index-36734b35.js} +32 -32
  168. package/build/esm/{index-3415e87b.js → index-3c223867.js} +4 -4
  169. package/build/esm/{index-d484fd93.js → index-40f4488b.js} +6 -6
  170. package/build/esm/{index-709c1b4a.js → index-43af2123.js} +3 -2
  171. package/build/esm/{index-d668c9bf.js → index-45f53fb6.js} +22 -22
  172. package/build/esm/{index-21c64d8b.js → index-4b1ee530.js} +3 -3
  173. package/build/esm/{index-7ca534bc.js → index-4ca41125.js} +14 -14
  174. package/build/esm/{index-8aafe9e7.js → index-505b3994.js} +2 -2
  175. package/build/esm/{index-f87ee75d.js → index-50a2593d.js} +17 -17
  176. package/build/esm/{index-13d4d948.js → index-5121bfff.js} +6 -6
  177. package/build/esm/{index-b27394f7.js → index-55618a95.js} +49 -42
  178. package/build/esm/{index-6b3bccdf.js → index-56c17ad3.js} +8 -8
  179. package/build/esm/{index-1ca1501b.js → index-5b781b1e.js} +3 -3
  180. package/build/esm/{index-6a3ab061.js → index-609df880.js} +14 -14
  181. package/build/esm/{index-09e43a17.js → index-66653ef8.js} +2 -2
  182. package/build/esm/{index-2dfedb07.js → index-69fb88d1.js} +2 -2
  183. package/build/esm/{index-4e66e774.js → index-6b88e3c6.js} +4 -4
  184. package/build/esm/{index-f1961b13.js → index-700c50e4.js} +13 -13
  185. package/build/esm/{index-7dc47646.js → index-737eb40e.js} +16 -16
  186. package/build/esm/{index-2f629759.js → index-77179a51.js} +3 -3
  187. package/build/esm/{index-39781a98.js → index-77cf65fa.js} +2 -2
  188. package/build/esm/{index-06320955.js → index-7a563e82.js} +2 -2
  189. package/build/esm/{index-9dbc9cb4.js → index-7bd170e1.js} +21 -21
  190. package/build/esm/{index-0cf821f5.js → index-7cdbf913.js} +16 -16
  191. package/build/esm/{index-f78e44b7.js → index-84111ea5.js} +16 -16
  192. package/build/esm/{index-bf6850a0.js → index-8b31d952.js} +14 -14
  193. package/build/esm/{index-fc82208c.js → index-9681c915.js} +11 -11
  194. package/build/esm/{index-0666caa3.js → index-9698198d.js} +15 -15
  195. package/build/esm/{index-b710a31d.js → index-a1e76985.js} +7 -7
  196. package/build/esm/{index-bea2c496.js → index-a282baa1.js} +3 -3
  197. package/build/esm/{index-d10125f1.js → index-a6ed627b.js} +15 -15
  198. package/build/esm/{index-a1d9132d.js → index-a89f3931.js} +19 -19
  199. package/build/esm/{index-fa17f83f.js → index-aa69f1a9.js} +1 -1
  200. package/build/esm/{index-42db16aa.js → index-b26de0d6.js} +9 -9
  201. package/build/esm/{index-b9aaced9.js → index-b7bf9955.js} +6 -6
  202. package/build/esm/{index-913e49d4.js → index-b89ba068.js} +2 -2
  203. package/build/esm/{index-e262c835.js → index-bb13a6ff.js} +1 -1
  204. package/build/esm/{index-6a515ea4.js → index-beda55c1.js} +13 -13
  205. package/build/esm/{index-e8ecc796.js → index-bf3862b2.js} +2 -2
  206. package/build/esm/{index-8beef085.js → index-bf50095c.js} +2 -2
  207. package/build/esm/{index-6b962737.js → index-c37ef324.js} +2 -2
  208. package/build/esm/{index-28bce418.js → index-c651a487.js} +2 -2
  209. package/build/esm/{index-fa9b756f.js → index-c8883599.js} +3 -3
  210. package/build/esm/{index-5d735bf7.js → index-c8da944c.js} +5 -5
  211. package/build/esm/{index-10dc44c5.js → index-ccfa9c9e.js} +3 -3
  212. package/build/esm/{index-e85e1ced.js → index-d23fe2ae.js} +2 -2
  213. package/build/esm/{index-d5050a14.js → index-d6f6b595.js} +9 -9
  214. package/build/esm/{index-72bb84ba.js → index-db36636a.js} +2 -2
  215. package/build/esm/{index-e49a1561.js → index-dbaa0063.js} +1 -1
  216. package/build/esm/{index-8fd5f916.js → index-dd15ecc1.js} +15 -15
  217. package/build/esm/{index-09bab845.js → index-e66ed1d0.js} +3 -3
  218. package/build/esm/{index-dfd9ab20.js → index-e720265b.js} +1 -1
  219. package/build/esm/{index-ed84dcb0.js → index-e7d01b29.js} +16 -16
  220. package/build/esm/{index-760d69ce.js → index-e8e03414.js} +3 -3
  221. package/build/esm/{index-827c3318.js → index-e910bd48.js} +18 -18
  222. package/build/esm/{index-6621664d.js → index-ea04724c.js} +1 -1
  223. package/build/esm/{index-e92b6590.js → index-ec92fddf.js} +2 -2
  224. package/build/esm/{index-327386d7.js → index-ee931564.js} +1 -1
  225. package/build/esm/{index-c7ca71f6.js → index-f4e242fa.js} +2 -2
  226. package/build/esm/{index-21a74fc8.js → index-f8858b48.js} +18 -18
  227. package/build/esm/{index-a1fff0d0.js → index-f892d3d1.js} +32 -32
  228. package/build/esm/index-fa6d14f9.js +1942 -0
  229. package/build/esm/index.js +127 -126
  230. package/build/esm/interfaces/constants/index.d.ts +2 -1
  231. package/build/esm/{labelSorting-821e9c2e.js → labelSorting-3374e5dd.js} +4 -4
  232. package/build/esm/lead.js +38 -37
  233. package/build/esm/{logoIcon-6c43fd83.js → logoIcon-e72124bf.js} +2 -2
  234. package/build/esm/mantine.js +27 -27
  235. package/build/esm/misc.js +19 -19
  236. package/build/esm/miscGetDynamicHealthTool.js +4 -4
  237. package/build/esm/miscGetSocialList.js +8 -8
  238. package/build/esm/miscScreenSizeContext.js +1 -1
  239. package/build/esm/mobileBottomNavigation.js +5 -5
  240. package/build/esm/mobileBottomNavigationIcon.js +5 -5
  241. package/build/esm/molecules.js +80 -79
  242. package/build/esm/moleculesArticleCard.js +6 -6
  243. package/build/esm/moleculesArticleCardV2.js +17 -17
  244. package/build/esm/navigation.js +50 -49
  245. package/build/esm/navigationLogoutPopup.js +11 -11
  246. package/build/esm/navigationProfileButton.js +27 -27
  247. package/build/esm/onboardingV2.js +30 -30
  248. package/build/esm/organisms.js +63 -62
  249. package/build/esm/{post-f232a5fe.js → post-b9081b6c.js} +2 -2
  250. package/build/esm/profileNavigation.js +20 -20
  251. package/build/esm/progressBar.js +1 -1
  252. package/build/esm/pwg.js +23 -23
  253. package/build/esm/ssoV2.js +31 -31
  254. package/build/esm/{store-64df7581.js → store-0efd0c32.js} +3 -3
  255. package/build/esm/subot.js +47 -47
  256. package/build/esm/surveyOrPremiumBanner.js +34 -34
  257. package/build/esm/surveyQuestionCard.js +11 -11
  258. package/build/esm/{surveyThankyouCard-3847eb4d.js → surveyThankyouCard-6bc1296c.js} +5 -5
  259. package/build/esm/together.js +57 -57
  260. package/build/esm/togetherApiUtils.js +6 -6
  261. package/build/esm/togetherAtoms.js +31 -31
  262. package/build/esm/togetherComponentGlobalContext.js +6 -6
  263. package/build/esm/togetherMolecules.js +52 -52
  264. package/build/esm/togetherMoleculesCardAuthor.js +29 -29
  265. package/build/esm/togetherMoleculesPostImagePreview.js +13 -13
  266. package/build/esm/togetherMoleculesProfileDetail.js +40 -40
  267. package/build/esm/togetherOrganisms.js +51 -51
  268. package/build/esm/togetherRichTextEditor.js +20 -20
  269. package/build/esm/togetherShareBox.js +12 -12
  270. package/build/esm/{transform-fb2e76dd.js → transform-e3324fc6.js} +176 -65
  271. package/build/esm/{translationsProvider-2bd4c215.js → translationsProvider-c3122056.js} +1 -1
  272. package/build/esm/{treePopoverMenu-257c17c1.js → treePopoverMenu-e4ef777f.js} +19 -19
  273. package/build/esm/types.js +2 -2
  274. package/build/esm/{useCartCareService-d2eb4371.js → useCartCareService-3386d953.js} +1 -1
  275. package/build/esm/{useHealthToolCache-3fea4309.js → useHealthToolCache-0154ed13.js} +1 -1
  276. package/build/esm/{usePhoneValidator-9e60043e.js → usePhoneValidator-016ffb49.js} +5 -5
  277. package/build/esm/{usePlacesAutocomplete-523fe3bd.js → usePlacesAutocomplete-fc18fe0b.js} +1 -1
  278. package/build/esm/useTogetherAuthRequiredAction.js +10 -10
  279. package/build/esm/{utils-80f04d90.js → utils-08850e2c.js} +2 -2
  280. package/build/esm/{utils-1eca9722.js → utils-08c6ca6b.js} +5 -5
  281. package/build/esm/{utils-642156b1.js → utils-35709853.js} +2 -2
  282. package/build/esm/{utils-b6f19c3b.js → utils-b9be89c5.js} +5 -22
  283. package/build/esm/{utils-56f99032.js → utils-bf6be335.js} +3 -3
  284. package/build/esm/vaccination.js +22 -22
  285. package/build/footer.js +22 -22
  286. package/build/gAssets.js +2 -2
  287. package/build/{healthTools-36407269.js → healthTools-64ac0d85.js} +1 -1
  288. package/build/healthToolsCardWrapper.js +20 -20
  289. package/build/healthToolsForm.js +35 -35
  290. package/build/hooks.js +14 -14
  291. package/build/i18n.js +2 -2
  292. package/build/i18nV2.js +1 -1
  293. package/build/{index-5ad16fac.js → index-033a2c74.js} +2 -2
  294. package/build/{index-e61a4996.js → index-05584917.js} +1 -1
  295. package/build/{index-ecc2a79e.js → index-05b88dc9.js} +8 -8
  296. package/build/{index-60e7b18a.js → index-071ec1a3.js} +14 -14
  297. package/build/{index-209d7c78.js → index-09386ed8.js} +2 -2
  298. package/build/{index-056c51bb.js → index-09fd8980.js} +5 -5
  299. package/build/{index-ed457185.js → index-0b7946fd.js} +15 -15
  300. package/build/{index-6ce426ff.js → index-0e728a4a.js} +17 -17
  301. package/build/{index-2cdaaeb1.js → index-12a51438.js} +1 -1
  302. package/build/{index-8272f80c.js → index-18aa507c.js} +14 -14
  303. package/build/{index-d3b126e0.js → index-19afb248.js} +18 -18
  304. package/build/{index-896c4fdf.js → index-1da55ae0.js} +19 -19
  305. package/build/{index-9427863b.js → index-29ff8541.js} +24 -24
  306. package/build/{index-20115ada.js → index-2e7d74db.js} +9 -9
  307. package/build/{index-92d93e22.js → index-34208f1c.js} +6 -6
  308. package/build/{index-af134c30.js → index-39f51a03.js} +5 -5
  309. package/build/{index-fc5a1a81.js → index-3cc1179c.js} +1 -1
  310. package/build/{index-a4dec003.js → index-45add758.js} +2 -2
  311. package/build/{index-ca833e03.js → index-4974123a.js} +32 -32
  312. package/build/{index-2f052e2d.js → index-49f0461d.js} +2 -2
  313. package/build/{index-03093b46.js → index-4a61e65a.js} +16 -16
  314. package/build/{index-b57dfe26.js → index-4c82634e.js} +2 -2
  315. package/build/{index-07df8d1a.js → index-51a82282.js} +6 -6
  316. package/build/{index-d0ca8b4b.js → index-536ade52.js} +1 -1
  317. package/build/{index-bc0cda88.js → index-5396ca8d.js} +2 -2
  318. package/build/{index-b45ce592.js → index-58e03ec6.js} +6 -6
  319. package/build/{index-5eeb8c86.js → index-595868df.js} +6 -6
  320. package/build/{index-8b9288fa.js → index-59fd3ae8.js} +16 -16
  321. package/build/{index-437f6f96.js → index-5c45a485.js} +16 -16
  322. package/build/{index-553e5780.js → index-5e7145a3.js} +13 -13
  323. package/build/{index-68b84419.js → index-5f02f5bd.js} +2 -2
  324. package/build/{index-64884964.js → index-64193798.js} +14 -0
  325. package/build/{index-005dacc4.js → index-6d4bebc1.js} +13 -13
  326. package/build/{index-469fb7ee.js → index-72c3ab83.js} +3 -3
  327. package/build/{index-23b9dda4.js → index-73ada0e1.js} +21 -21
  328. package/build/{index-11713c70.js → index-7ab66545.js} +4 -4
  329. package/build/{index-40fc038d.js → index-87792f4e.js} +32 -32
  330. package/build/{index-83bf8bdd.js → index-890f8156.js} +14 -14
  331. package/build/{index-e3fbe03b.js → index-8a1fd475.js} +2 -2
  332. package/build/{index-8d2da5c8.js → index-8de4a62b.js} +15 -15
  333. package/build/{index-c41c78b4.js → index-90014322.js} +1 -1
  334. package/build/{index-84b8d1b5.js → index-9056ad7f.js} +3 -3
  335. package/build/{index-2d2fe2b1.js → index-91b97b89.js} +51 -44
  336. package/build/{index-95974e52.js → index-9834e87e.js} +7 -7
  337. package/build/{index-045d07b8.js → index-9acc5d73.js} +2 -2
  338. package/build/{index-180f198b.js → index-9b18a1ad.js} +3 -3
  339. package/build/{index-53f0c004.js → index-9cb93149.js} +1 -1
  340. package/build/{index-28e4c1b4.js → index-a0ee6bdf.js} +7 -7
  341. package/build/{index-e25a9f88.js → index-a2d8cbb4.js} +3 -3
  342. package/build/{index-e44a59ef.js → index-a8246d0e.js} +3 -3
  343. package/build/{index-bd4529db.js → index-a9cc1302.js} +18 -18
  344. package/build/{index-bfb42a57.js → index-acde8f90.js} +3 -3
  345. package/build/{index-8a6d8e0f.js → index-b599e025.js} +2 -2
  346. package/build/{index-be31a034.js → index-b8ad684b.js} +2 -2
  347. package/build/{index-bf508cf7.js → index-bd38fa40.js} +25 -25
  348. package/build/{index-62173c62.js → index-be6f2bc1.js} +2 -2
  349. package/build/{index-c4bd61bf.js → index-c368d6cf.js} +3 -3
  350. package/build/{index-9ca6ef5f.js → index-c776170e.js} +4 -4
  351. package/build/{index-a88b48a8.js → index-c8909b7a.js} +3 -3
  352. package/build/{index-519ab49d.js → index-ca913647.js} +1 -1
  353. package/build/{index-3d9ec0d4.js → index-ccd0fdf4.js} +3 -3
  354. package/build/{index-176f4b92.js → index-cd11a5f6.js} +11 -11
  355. package/build/{index-d7bd3994.js → index-ce89dc9e.js} +16 -16
  356. package/build/{index-aa2bd3fb.js → index-d3a82aa8.js} +2 -2
  357. package/build/{index-fbf91f6c.js → index-d4613c07.js} +22 -22
  358. package/build/{index-7abd825b.js → index-d6eb4a5e.js} +2 -2
  359. package/build/{index-cb7b6b9a.js → index-dbef812e.js} +9 -9
  360. package/build/{index-9d1df679.js → index-dd3e36cc.js} +3 -2
  361. package/build/{index-9a07e542.js → index-e3299cf4.js} +3 -3
  362. package/build/index-f1ed4dfb.js +1951 -0
  363. package/build/{index-8662633c.js → index-f66d26d3.js} +15 -15
  364. package/build/{index-3496fb31.js → index-fe0d9598.js} +2 -2
  365. package/build/index.js +128 -126
  366. package/build/interfaces/constants/index.d.ts +2 -1
  367. package/build/{labelSorting-ad062311.js → labelSorting-2c119957.js} +4 -4
  368. package/build/lead.js +38 -37
  369. package/build/{logoIcon-6cf01cd6.js → logoIcon-727fd474.js} +2 -2
  370. package/build/mantine.js +25 -25
  371. package/build/misc.js +19 -19
  372. package/build/miscGetDynamicHealthTool.js +4 -4
  373. package/build/miscGetSocialList.js +8 -8
  374. package/build/miscScreenSizeContext.js +1 -1
  375. package/build/mobileBottomNavigation.js +5 -5
  376. package/build/mobileBottomNavigationIcon.js +5 -5
  377. package/build/molecules.js +80 -79
  378. package/build/moleculesArticleCard.js +6 -6
  379. package/build/moleculesArticleCardV2.js +17 -17
  380. package/build/navigation.js +50 -49
  381. package/build/navigationLogoutPopup.js +11 -11
  382. package/build/navigationProfileButton.js +27 -27
  383. package/build/onboardingV2.js +29 -29
  384. package/build/organisms.js +63 -62
  385. package/build/{post-28b52569.js → post-4d261a5f.js} +2 -2
  386. package/build/profileNavigation.js +20 -20
  387. package/build/progressBar.js +1 -1
  388. package/build/pwg.js +23 -23
  389. package/build/ssoV2.js +29 -29
  390. package/build/{store-94ba5496.js → store-4d647c29.js} +3 -3
  391. package/build/subot.js +46 -46
  392. package/build/surveyOrPremiumBanner.js +34 -34
  393. package/build/surveyQuestionCard.js +11 -11
  394. package/build/{surveyThankyouCard-2bcbb412.js → surveyThankyouCard-d9d50f52.js} +5 -5
  395. package/build/together.js +57 -57
  396. package/build/togetherApiUtils.js +6 -6
  397. package/build/togetherAtoms.js +31 -31
  398. package/build/togetherComponentGlobalContext.js +6 -6
  399. package/build/togetherMolecules.js +52 -52
  400. package/build/togetherMoleculesCardAuthor.js +29 -29
  401. package/build/togetherMoleculesPostImagePreview.js +13 -13
  402. package/build/togetherMoleculesProfileDetail.js +40 -40
  403. package/build/togetherOrganisms.js +51 -51
  404. package/build/togetherRichTextEditor.js +20 -20
  405. package/build/togetherShareBox.js +12 -12
  406. package/build/{transform-c1ac3269.js → transform-2ac47572.js} +176 -65
  407. package/build/{translationsProvider-7e672d7f.js → translationsProvider-0961410b.js} +1 -1
  408. package/build/{treePopoverMenu-d39f297a.js → treePopoverMenu-3b792c70.js} +19 -19
  409. package/build/types.js +2 -2
  410. package/build/{useCartCareService-5ab73f7a.js → useCartCareService-ac8c5ff6.js} +1 -1
  411. package/build/{useHealthToolCache-fe16d6a1.js → useHealthToolCache-fb13f617.js} +1 -1
  412. package/build/{usePhoneValidator-0a642ae3.js → usePhoneValidator-d1f390b6.js} +5 -5
  413. package/build/{usePlacesAutocomplete-d4340873.js → usePlacesAutocomplete-e841579f.js} +1 -1
  414. package/build/useTogetherAuthRequiredAction.js +10 -10
  415. package/build/{utils-329af250.js → utils-9c3fe1d7.js} +5 -5
  416. package/build/{utils-ac946c7c.js → utils-c15a3a0b.js} +2 -2
  417. package/build/{utils-930ae326.js → utils-d027a66e.js} +2 -2
  418. package/build/{utils-08c47f05.js → utils-d952517b.js} +6 -24
  419. package/build/{utils-b0e7bd61.js → utils-d9f815a9.js} +3 -3
  420. package/build/vaccination.js +22 -22
  421. package/package.json +1 -1
  422. package/build/esm/index-cd0bbcbf.js +0 -31
  423. package/build/index-da025a8e.js +0 -38
  424. /package/build/{BMI_BOYS.percentile.monthly-eb75ded7.js → BMI_BOYS.percentile.monthly-e3082bee.js} +0 -0
  425. /package/build/{BMI_BOYS.percentile.weekly-8ed82736.js → BMI_BOYS.percentile.weekly-b715eaa8.js} +0 -0
  426. /package/build/{BMI_BOYS.percentile.yearly-2bf39ff4.js → BMI_BOYS.percentile.yearly-4665a4e5.js} +0 -0
  427. /package/build/{BMI_BOYS.zscore.monthly-c59815ce.js → BMI_BOYS.zscore.monthly-7e83dc64.js} +0 -0
  428. /package/build/{BMI_BOYS.zscore.weekly-43ebdf38.js → BMI_BOYS.zscore.weekly-e33c5a8f.js} +0 -0
  429. /package/build/{BMI_BOYS.zscore.yearly-9a66e6fe.js → BMI_BOYS.zscore.yearly-30ad1f57.js} +0 -0
  430. /package/build/{BMI_GIRLS.percentile.monthly-024aca63.js → BMI_GIRLS.percentile.monthly-0ba9f602.js} +0 -0
  431. /package/build/{BMI_GIRLS.percentile.weekly-197e644b.js → BMI_GIRLS.percentile.weekly-bfcba562.js} +0 -0
  432. /package/build/{BMI_GIRLS.percentile.yearly-bd03b9ce.js → BMI_GIRLS.percentile.yearly-8993bc33.js} +0 -0
  433. /package/build/{BMI_GIRLS.zscore.monthly-7e63c31a.js → BMI_GIRLS.zscore.monthly-2efbdabc.js} +0 -0
  434. /package/build/{BMI_GIRLS.zscore.weekly-5cb44eaf.js → BMI_GIRLS.zscore.weekly-2b091127.js} +0 -0
  435. /package/build/{BMI_GIRLS.zscore.yearly-2a98ab1c.js → BMI_GIRLS.zscore.yearly-9ac42c5d.js} +0 -0
  436. /package/build/{ChevronDown-0008ad7d.js → ChevronDown-bcabc32a.js} +0 -0
  437. /package/build/{Close-90c21063.js → Close-a13b17ab.js} +0 -0
  438. /package/build/{Google-8306cb76.js → Google-56a5abbd.js} +0 -0
  439. /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-e7d42012.js → HEAD CIRCUM_BOYS.percentile.monthly-27c7e539.js} +0 -0
  440. /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-2a4973fc.js → HEAD CIRCUM_BOYS.percentile.weekly-6053857b.js} +0 -0
  441. /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-a9df65a8.js → HEAD CIRCUM_BOYS.percentile.yearly-35d810f9.js} +0 -0
  442. /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-def06bda.js → HEAD CIRCUM_BOYS.zscore.monthly-da30fcec.js} +0 -0
  443. /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-628b60ee.js → HEAD CIRCUM_BOYS.zscore.weekly-f8990c90.js} +0 -0
  444. /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-2131b328.js → HEAD CIRCUM_BOYS.zscore.yearly-ade07911.js} +0 -0
  445. /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-c96b9b82.js → HEAD CIRCUM_GIRLS.percentile.monthly-57811bc5.js} +0 -0
  446. /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-51c95353.js → HEAD CIRCUM_GIRLS.percentile.weekly-4d2c6504.js} +0 -0
  447. /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-4bd70a5d.js → HEAD CIRCUM_GIRLS.percentile.yearly-5a6e9697.js} +0 -0
  448. /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-c82e39fa.js → HEAD CIRCUM_GIRLS.zscore.monthly-667d5b35.js} +0 -0
  449. /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-ef11351b.js → HEAD CIRCUM_GIRLS.zscore.weekly-dc6ef28f.js} +0 -0
  450. /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-9229d695.js → HEAD CIRCUM_GIRLS.zscore.yearly-f36a14ac.js} +0 -0
  451. /package/build/{HEIGHT_BOYS.percentile.monthly-c78280a5.js → HEIGHT_BOYS.percentile.monthly-0f006ba4.js} +0 -0
  452. /package/build/{HEIGHT_BOYS.percentile.weekly-f2df7c01.js → HEIGHT_BOYS.percentile.weekly-5189de85.js} +0 -0
  453. /package/build/{HEIGHT_BOYS.percentile.yearly-00c0d708.js → HEIGHT_BOYS.percentile.yearly-275ea444.js} +0 -0
  454. /package/build/{HEIGHT_BOYS.zscore.monthly-c79b00e5.js → HEIGHT_BOYS.zscore.monthly-78aaca36.js} +0 -0
  455. /package/build/{HEIGHT_BOYS.zscore.weekly-45b9318c.js → HEIGHT_BOYS.zscore.weekly-f31f5f67.js} +0 -0
  456. /package/build/{HEIGHT_BOYS.zscore.yearly-c26dd552.js → HEIGHT_BOYS.zscore.yearly-8727712e.js} +0 -0
  457. /package/build/{HEIGHT_GIRLS.percentile.monthly-632f50ae.js → HEIGHT_GIRLS.percentile.monthly-2187fc5a.js} +0 -0
  458. /package/build/{HEIGHT_GIRLS.percentile.weekly-6159caf4.js → HEIGHT_GIRLS.percentile.weekly-249c38b0.js} +0 -0
  459. /package/build/{HEIGHT_GIRLS.percentile.yearly-0c3609e5.js → HEIGHT_GIRLS.percentile.yearly-844d9140.js} +0 -0
  460. /package/build/{HEIGHT_GIRLS.zscore.monthly-e82ffc32.js → HEIGHT_GIRLS.zscore.monthly-3592b190.js} +0 -0
  461. /package/build/{HEIGHT_GIRLS.zscore.weekly-b7a87bb1.js → HEIGHT_GIRLS.zscore.weekly-650b086a.js} +0 -0
  462. /package/build/{HEIGHT_GIRLS.zscore.yearly-ba07d850.js → HEIGHT_GIRLS.zscore.yearly-6ebc0132.js} +0 -0
  463. /package/build/{Locale-23981f35.js → Locale-ff16c145.js} +0 -0
  464. /package/build/{Visible-15215e0c.js → Visible-6b874894.js} +0 -0
  465. /package/build/{WEIGHT_BOYS.percentile.monthly-0e74b080.js → WEIGHT_BOYS.percentile.monthly-9b3e149b.js} +0 -0
  466. /package/build/{WEIGHT_BOYS.percentile.weekly-1dae453e.js → WEIGHT_BOYS.percentile.weekly-fd175d46.js} +0 -0
  467. /package/build/{WEIGHT_BOYS.percentile.yearly-4031a9c9.js → WEIGHT_BOYS.percentile.yearly-485ac0d5.js} +0 -0
  468. /package/build/{WEIGHT_BOYS.zscore.monthly-6a9888cf.js → WEIGHT_BOYS.zscore.monthly-7e540646.js} +0 -0
  469. /package/build/{WEIGHT_BOYS.zscore.weekly-79c4948a.js → WEIGHT_BOYS.zscore.weekly-d11f4b68.js} +0 -0
  470. /package/build/{WEIGHT_BOYS.zscore.yearly-ee08ee06.js → WEIGHT_BOYS.zscore.yearly-da55a30e.js} +0 -0
  471. /package/build/{WEIGHT_GIRLS.percentile.monthly-9d15e0c2.js → WEIGHT_GIRLS.percentile.monthly-3990f99c.js} +0 -0
  472. /package/build/{WEIGHT_GIRLS.percentile.weekly-77bdebbc.js → WEIGHT_GIRLS.percentile.weekly-b7cb9dc7.js} +0 -0
  473. /package/build/{WEIGHT_GIRLS.percentile.yearly-f77b17ec.js → WEIGHT_GIRLS.percentile.yearly-f45ee214.js} +0 -0
  474. /package/build/{WEIGHT_GIRLS.zscore.monthly-b00fc4c0.js → WEIGHT_GIRLS.zscore.monthly-72e77798.js} +0 -0
  475. /package/build/{WEIGHT_GIRLS.zscore.weekly-aea7fafc.js → WEIGHT_GIRLS.zscore.weekly-d4ae961d.js} +0 -0
  476. /package/build/{WEIGHT_GIRLS.zscore.yearly-9658a62a.js → WEIGHT_GIRLS.zscore.yearly-7e9a0991.js} +0 -0
  477. /package/build/{ageGenerate-6ffae569.js → ageGenerate-db85587d.js} +0 -0
  478. /package/build/{animation-b54cdd8f.js → animation-7acf0edb.js} +0 -0
  479. /package/build/{constants-4eec0c49.js → constants-265b92b4.js} +0 -0
  480. /package/build/{constants-17808666.js → constants-dd387796.js} +0 -0
  481. /package/build/{context-ad31d80e.js → context-3c888756.js} +0 -0
  482. /package/build/{dataTransform-650b3963.js → dataTransform-081310ce.js} +0 -0
  483. /package/build/esm/{BMI_BOYS.percentile.monthly-d7cce91c.js → BMI_BOYS.percentile.monthly-b5976a7c.js} +0 -0
  484. /package/build/esm/{BMI_BOYS.percentile.weekly-d91b50bb.js → BMI_BOYS.percentile.weekly-9229b7b3.js} +0 -0
  485. /package/build/esm/{BMI_BOYS.percentile.yearly-2a065ef3.js → BMI_BOYS.percentile.yearly-4da881bd.js} +0 -0
  486. /package/build/esm/{BMI_BOYS.zscore.monthly-398c4bac.js → BMI_BOYS.zscore.monthly-ed195662.js} +0 -0
  487. /package/build/esm/{BMI_BOYS.zscore.weekly-b6389ceb.js → BMI_BOYS.zscore.weekly-de6b6fc0.js} +0 -0
  488. /package/build/esm/{BMI_BOYS.zscore.yearly-18f86f43.js → BMI_BOYS.zscore.yearly-3b0d8e3e.js} +0 -0
  489. /package/build/esm/{BMI_GIRLS.percentile.monthly-65e695d9.js → BMI_GIRLS.percentile.monthly-99507db5.js} +0 -0
  490. /package/build/esm/{BMI_GIRLS.percentile.weekly-3883be61.js → BMI_GIRLS.percentile.weekly-8d1f5cf4.js} +0 -0
  491. /package/build/esm/{BMI_GIRLS.percentile.yearly-12a2d679.js → BMI_GIRLS.percentile.yearly-d6d6c053.js} +0 -0
  492. /package/build/esm/{BMI_GIRLS.zscore.monthly-90837dc2.js → BMI_GIRLS.zscore.monthly-c0603b8a.js} +0 -0
  493. /package/build/esm/{BMI_GIRLS.zscore.weekly-6794b97d.js → BMI_GIRLS.zscore.weekly-24b7d5e6.js} +0 -0
  494. /package/build/esm/{BMI_GIRLS.zscore.yearly-bb66712a.js → BMI_GIRLS.zscore.yearly-d12f83be.js} +0 -0
  495. /package/build/esm/{ChevronDown-e8eda3d5.js → ChevronDown-fab3e09e.js} +0 -0
  496. /package/build/esm/{Close-e84d5ed4.js → Close-25ad16e1.js} +0 -0
  497. /package/build/esm/{Google-54183a38.js → Google-44de8f8e.js} +0 -0
  498. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-3b6f92b3.js → HEAD CIRCUM_BOYS.percentile.monthly-55e86891.js} +0 -0
  499. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-67712976.js → HEAD CIRCUM_BOYS.percentile.weekly-fb86f35a.js} +0 -0
  500. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-a6ddb7b9.js → HEAD CIRCUM_BOYS.percentile.yearly-7ff74373.js} +0 -0
  501. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-4b4cf579.js → HEAD CIRCUM_BOYS.zscore.monthly-9fe0d92c.js} +0 -0
  502. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-0d723018.js → HEAD CIRCUM_BOYS.zscore.weekly-8133ba2e.js} +0 -0
  503. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-3f5040f8.js → HEAD CIRCUM_BOYS.zscore.yearly-d2b9d02c.js} +0 -0
  504. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-e8aa17ec.js → HEAD CIRCUM_GIRLS.percentile.monthly-ebedd8fa.js} +0 -0
  505. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-6a07fb80.js → HEAD CIRCUM_GIRLS.percentile.weekly-6ffbf04a.js} +0 -0
  506. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-17cbca59.js → HEAD CIRCUM_GIRLS.percentile.yearly-8e3d6aa5.js} +0 -0
  507. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-413a23b0.js → HEAD CIRCUM_GIRLS.zscore.monthly-54510a71.js} +0 -0
  508. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-90f760a8.js → HEAD CIRCUM_GIRLS.zscore.weekly-a939119f.js} +0 -0
  509. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-729af742.js → HEAD CIRCUM_GIRLS.zscore.yearly-88e95b79.js} +0 -0
  510. /package/build/esm/{HEIGHT_BOYS.percentile.monthly-5371ae2a.js → HEIGHT_BOYS.percentile.monthly-150e530d.js} +0 -0
  511. /package/build/esm/{HEIGHT_BOYS.percentile.weekly-356633ec.js → HEIGHT_BOYS.percentile.weekly-972e3fe2.js} +0 -0
  512. /package/build/esm/{HEIGHT_BOYS.percentile.yearly-0aef78e6.js → HEIGHT_BOYS.percentile.yearly-9a350f6e.js} +0 -0
  513. /package/build/esm/{HEIGHT_BOYS.zscore.monthly-7ecd4c3e.js → HEIGHT_BOYS.zscore.monthly-b9f570e7.js} +0 -0
  514. /package/build/esm/{HEIGHT_BOYS.zscore.weekly-9ca95795.js → HEIGHT_BOYS.zscore.weekly-201eca61.js} +0 -0
  515. /package/build/esm/{HEIGHT_BOYS.zscore.yearly-b4fbc889.js → HEIGHT_BOYS.zscore.yearly-3d87d0e6.js} +0 -0
  516. /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-48355f70.js → HEIGHT_GIRLS.percentile.monthly-fa817f0e.js} +0 -0
  517. /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-637333d7.js → HEIGHT_GIRLS.percentile.weekly-69fff7e2.js} +0 -0
  518. /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-89995969.js → HEIGHT_GIRLS.percentile.yearly-2bbdc13c.js} +0 -0
  519. /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-0a27498a.js → HEIGHT_GIRLS.zscore.monthly-6880aae4.js} +0 -0
  520. /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-5b614a5c.js → HEIGHT_GIRLS.zscore.weekly-bd46906d.js} +0 -0
  521. /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-05bee6e6.js → HEIGHT_GIRLS.zscore.yearly-523d32ee.js} +0 -0
  522. /package/build/esm/{Locale-6237ebe4.js → Locale-b45f64dd.js} +0 -0
  523. /package/build/esm/{Visible-07cde34f.js → Visible-ebd41ca6.js} +0 -0
  524. /package/build/esm/{WEIGHT_BOYS.percentile.monthly-e7b29d80.js → WEIGHT_BOYS.percentile.monthly-2dfb20eb.js} +0 -0
  525. /package/build/esm/{WEIGHT_BOYS.percentile.weekly-21d36db0.js → WEIGHT_BOYS.percentile.weekly-204e67b7.js} +0 -0
  526. /package/build/esm/{WEIGHT_BOYS.percentile.yearly-6ee38f89.js → WEIGHT_BOYS.percentile.yearly-323a1074.js} +0 -0
  527. /package/build/esm/{WEIGHT_BOYS.zscore.monthly-eb1b34de.js → WEIGHT_BOYS.zscore.monthly-6115b5c4.js} +0 -0
  528. /package/build/esm/{WEIGHT_BOYS.zscore.weekly-57186f85.js → WEIGHT_BOYS.zscore.weekly-4c82f3d6.js} +0 -0
  529. /package/build/esm/{WEIGHT_BOYS.zscore.yearly-a8704f4b.js → WEIGHT_BOYS.zscore.yearly-ea398b61.js} +0 -0
  530. /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-87e07e0b.js → WEIGHT_GIRLS.percentile.monthly-dacef48c.js} +0 -0
  531. /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-9396d3fa.js → WEIGHT_GIRLS.percentile.weekly-a926d543.js} +0 -0
  532. /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-757c47ba.js → WEIGHT_GIRLS.percentile.yearly-d3106648.js} +0 -0
  533. /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-0e133beb.js → WEIGHT_GIRLS.zscore.monthly-0d01fb50.js} +0 -0
  534. /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-29132fe3.js → WEIGHT_GIRLS.zscore.weekly-34d36470.js} +0 -0
  535. /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-5eb38ecd.js → WEIGHT_GIRLS.zscore.yearly-93de58f7.js} +0 -0
  536. /package/build/esm/{ageGenerate-224f7d3d.js → ageGenerate-c7c163e8.js} +0 -0
  537. /package/build/esm/{animation-c287d73b.js → animation-4ef3beec.js} +0 -0
  538. /package/build/esm/{constants-f3f310d2.js → constants-d5db76c9.js} +0 -0
  539. /package/build/esm/{constants-056a3269.js → constants-eae66c7c.js} +0 -0
  540. /package/build/esm/{context-2498a8f0.js → context-e32c6b73.js} +0 -0
  541. /package/build/esm/{dataTransform-8c20c0ba.js → dataTransform-9912f08b.js} +0 -0
  542. /package/build/esm/{index-69ecd64f.js → index-1150677c.js} +0 -0
  543. /package/build/esm/{index-9c086cfe.js → index-2dd84602.js} +0 -0
  544. /package/build/esm/{index-12605605.js → index-40a681f5.js} +0 -0
  545. /package/build/esm/{index-18d9b44e.js → index-53adafa8.js} +0 -0
  546. /package/build/esm/{index-4906b926.js → index-a7780581.js} +0 -0
  547. /package/build/esm/{index-5ee11169.js → index-d3f9239b.js} +0 -0
  548. /package/build/esm/{index-55b838de.js → index-e7af3889.js} +0 -0
  549. /package/build/esm/{index-a031fe16.js → index-ef534160.js} +0 -0
  550. /package/build/esm/{index.styles-f25c06a1.js → index.styles-9e934a7f.js} +0 -0
  551. /package/build/esm/{localizeNumberFormat-e26ca2c8.js → localizeNumberFormat-dead6783.js} +0 -0
  552. /package/build/esm/{normalizeLink-6fc795db.js → normalizeLink-6e0feafd.js} +0 -0
  553. /package/build/esm/{number-f225de0f.js → number-c75052c8.js} +0 -0
  554. /package/build/esm/{paths-3b8ab138.js → paths-7124d91e.js} +0 -0
  555. /package/build/esm/{shared-3def0599.js → shared-46020226.js} +0 -0
  556. /package/build/esm/{translationsContext-5539c952.js → translationsContext-e21176c1.js} +0 -0
  557. /package/build/esm/{tslib.es6-1cd753c3.js → tslib.es6-f2b7e9c3.js} +0 -0
  558. /package/build/esm/{types-f99ecfbf.js → types-2e56bd87.js} +0 -0
  559. /package/build/esm/{types-13f41421.js → types-ae414a10.js} +0 -0
  560. /package/build/esm/{useOutsideClick-9fb1183e.js → useOutsideClick-ec049cb9.js} +0 -0
  561. /package/build/esm/{useScrollbarSize-653fe21a.js → useScrollbarSize-b55c7657.js} +0 -0
  562. /package/build/esm/{useUniqueId-31d41470.js → useUniqueId-5c2a2bfb.js} +0 -0
  563. /package/build/esm/{utils-f93704dc.js → utils-7250305e.js} +0 -0
  564. /package/build/esm/{utils-58ed5b66.js → utils-bf532564.js} +0 -0
  565. /package/build/{index-79d990e5.js → index-2efa27f5.js} +0 -0
  566. /package/build/{index-c1fd826e.js → index-38da85cf.js} +0 -0
  567. /package/build/{index-18f29c69.js → index-47f0e858.js} +0 -0
  568. /package/build/{index-b4aae532.js → index-5061c733.js} +0 -0
  569. /package/build/{index-58261cf1.js → index-b2f04a2f.js} +0 -0
  570. /package/build/{index-cdaefdd3.js → index-bab1ced1.js} +0 -0
  571. /package/build/{index-21fa50cd.js → index-bc86773b.js} +0 -0
  572. /package/build/{index-4bea9959.js → index-e0665030.js} +0 -0
  573. /package/build/{index.styles-052a3b95.js → index.styles-3a84d863.js} +0 -0
  574. /package/build/{localizeNumberFormat-e8804fd2.js → localizeNumberFormat-3c81287b.js} +0 -0
  575. /package/build/{normalizeLink-3f586564.js → normalizeLink-8845e2c9.js} +0 -0
  576. /package/build/{number-108ef76d.js → number-6781231b.js} +0 -0
  577. /package/build/{paths-e405e716.js → paths-350c134d.js} +0 -0
  578. /package/build/{shared-cfda3e6a.js → shared-b9d9f426.js} +0 -0
  579. /package/build/{translationsContext-dd655b46.js → translationsContext-5627662a.js} +0 -0
  580. /package/build/{tslib.es6-04bb6e9a.js → tslib.es6-c317a4f4.js} +0 -0
  581. /package/build/{types-2030d630.js → types-0a84788a.js} +0 -0
  582. /package/build/{types-dfdb38e9.js → types-5a78e2e2.js} +0 -0
  583. /package/build/{useOutsideClick-a663c31f.js → useOutsideClick-1069fc6f.js} +0 -0
  584. /package/build/{useScrollbarSize-e4209d68.js → useScrollbarSize-8268e4ed.js} +0 -0
  585. /package/build/{useUniqueId-540bffa6.js → useUniqueId-48f7bbc2.js} +0 -0
  586. /package/build/{utils-8d82a825.js → utils-4c3d9336.js} +0 -0
  587. /package/build/{utils-5e745d8e.js → utils-52a54da5.js} +0 -0
@@ -0,0 +1,1942 @@
1
+ import React__default, { useMemo, useRef, useState, useCallback, forwardRef, useImperativeHandle, useReducer, useEffect } from 'react';
2
+ import { Search } from '@hhgtech/icons/core';
3
+ import { Skeleton, clsx, Box, Input, rem, ScrollArea, useMantineTheme, Stack, Flex, Text as Text$1, Select, Divider, Tabs } from '@mantine/core';
4
+ import { useDisclosure } from '@mantine/hooks';
5
+ import { P as PinIcon, i as checkMarkIconUrl, h as getApiPath, u as useGeolocation } from './utils-08850e2c.js';
6
+ import { a as useOutsideClick } from './useOutsideClick-ec049cb9.js';
7
+ import { u as useTranslations } from './index-032eadac.js';
8
+ import debounce from 'lodash/debounce';
9
+ import { a as ID_OPTION_CURRENT_LOCATION, L as LOCALIZED_SLUGS, I as ID_OPTION_ALL_LOCATION, S as SLUG_VACIN_ID, C as CLIENT_KEY, M as MAPPING_CLIENT_WITH_SLUG } from './constants-d5db76c9.js';
10
+ import styled from '@emotion/styled';
11
+ import { theme } from './miscTheme.js';
12
+ import { M as MediaQueries } from './utils-7250305e.js';
13
+ import { C as Container } from './index-53adafa8.js';
14
+ import { T as Text } from './index-db36636a.js';
15
+ import { C as ChevronDown } from './ChevronDown-fab3e09e.js';
16
+ import { _ as __rest } from './tslib.es6-f2b7e9c3.js';
17
+ import { ArrowLeft } from '@hhgtech/icons/arrow';
18
+ import { M as Modal } from './index-28f55c7c.js';
19
+ import { P as PATHS } from './paths-7124d91e.js';
20
+ import { B as Button } from './index-e8e03414.js';
21
+
22
+ const StyledSearchBarWrapper = styled.div ``;
23
+ const StyleWrapperContainer = styled.div `
24
+ background-color: ${theme.colors.neutral50};
25
+ padding-bottom: 1px;
26
+ ${MediaQueries.mbDown} {
27
+ padding: 0;
28
+ }
29
+ `;
30
+ const StyleSearchInputContainer = styled(Container) `
31
+ padding: 0 16px;
32
+
33
+ ${MediaQueries.mbDown} {
34
+ padding: 0;
35
+ }
36
+ `;
37
+ const StyleSearchContent = styled.div `
38
+ padding: 24px 56px;
39
+ border-radius: 16px;
40
+ background-color: ${theme.colors.white};
41
+ box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.04),
42
+ 0px 0px 2px 0px rgba(0, 0, 0, 0.06), 0px 4px 8px 0px rgba(0, 0, 0, 0.04);
43
+
44
+ ${MediaQueries.mbDown} {
45
+ padding: 16px;
46
+ border-radius: 0;
47
+ }
48
+
49
+ .flex-search-input {
50
+ flex-direction: row;
51
+ ${MediaQueries.mbDown} {
52
+ flex-direction: column;
53
+ }
54
+ }
55
+ `;
56
+
57
+ const SEARCH_KEYWORD_MIN_LENGTH = {
58
+ 'en-PH': 3,
59
+ 'tl-PH': 2,
60
+ 'id-ID': 3,
61
+ 'vi-VN': 2,
62
+ 'zh-TW': 0,
63
+ 'ms-MY': 2,
64
+ 'th-TH': 2,
65
+ };
66
+
67
+ const initialState = {
68
+ isMobile: false,
69
+ isDebug: false,
70
+ navigateTo: null,
71
+ geoLocationPermission: 'unset',
72
+ geoLocationCoordinates: null,
73
+ focused: 'none',
74
+ focusedSpecialty: 'none',
75
+ searchLocationKeywords: '',
76
+ searchSpecialtyKeywords: '',
77
+ searchKeywords: '',
78
+ selectedLocation: null,
79
+ selectedSpecialty: null,
80
+ defaultCity: null,
81
+ initialCities: [],
82
+ cities: [],
83
+ searchResults: {},
84
+ initialSearchResults: {},
85
+ isLoadingCities: false,
86
+ isLoadingSearchResults: false,
87
+ isMobileModalOpened: false,
88
+ initialSelectedCity: null,
89
+ autoCompleteDisabled: false,
90
+ inputSearchPlaceholder: '',
91
+ locale: 'vi-VN',
92
+ allSpecialties: [],
93
+ popularKeys: [],
94
+ };
95
+ var ActionTypes;
96
+ (function (ActionTypes) {
97
+ ActionTypes["NavigateTo"] = "navigate to url";
98
+ ActionTypes["ClickOutsideInputLocation"] = "click outside input location";
99
+ ActionTypes["ClickOutsideInputSearch"] = "click outside input search";
100
+ ActionTypes["ClickOutsideInputSearchSpecialty"] = "click outside input search specialty";
101
+ ActionTypes["ClickOutsideInputSpecialty"] = "click outside input specialty";
102
+ ActionTypes["SelectCurrentLocation"] = "select current location";
103
+ ActionTypes["FocusInputLocation"] = "focus input location";
104
+ ActionTypes["FocusInputSearch"] = "focus input search";
105
+ ActionTypes["FocusInputSearchSpecialty"] = "focus input search specialty";
106
+ ActionTypes["ChangeInputLocation"] = "change input location";
107
+ ActionTypes["ChangeInputSearch"] = "change input search";
108
+ ActionTypes["ClearInputLocation"] = "clear input location";
109
+ ActionTypes["ClearInputSearch"] = "clear input search";
110
+ ActionTypes["SelectLocation"] = "select location";
111
+ ActionTypes["SelectSpecialty"] = "select specialty";
112
+ ActionTypes["FetchCitiesStart"] = "fetch cities start";
113
+ ActionTypes["FetchCitiesFinish"] = "fetch cities finish";
114
+ ActionTypes["FetchSearchResultsStart"] = "fetch search results start";
115
+ ActionTypes["FetchSearchResultsComplete"] = "fetch search results complete";
116
+ ActionTypes["FetchSearchResultsFinish"] = "fetch search results finish";
117
+ ActionTypes["FetchCitiesByGeoIpComplete"] = "fetch cities by geo IP finish";
118
+ ActionTypes["FetchCitiesByKeywordComplete"] = "fetch cities by keyword finish";
119
+ ActionTypes["DisplayInitialCities"] = "display initial cities";
120
+ ActionTypes["DisplayInitialSearchResults"] = "display initial search results";
121
+ ActionTypes["UpdateInitialSearchResults"] = "update initial search results";
122
+ ActionTypes["GrantGeoLocationPermission"] = "grant geolocation permission";
123
+ ActionTypes["DenyGeoLocationPermission"] = "deny geolocation permission";
124
+ ActionTypes["OpenMobileModal"] = "open mobile modal";
125
+ ActionTypes["CloseMobileModal"] = "close mobile modal";
126
+ ActionTypes["UpdateInitialSearchValue"] = "update initial search value";
127
+ ActionTypes["SelectSearchResult"] = "select search result";
128
+ ActionTypes["SetInputSearchPlaceholder"] = "set input search placeholder";
129
+ ActionTypes["FocusInputSpecialty"] = "focus input specialty";
130
+ ActionTypes["FetchAllSpecialties"] = "fetch all specialty";
131
+ ActionTypes["FetchPopularKeys"] = "fetch popular key by type";
132
+ })(ActionTypes || (ActionTypes = {}));
133
+ function resetSearchLocationKeywords(state) {
134
+ const { selectedLocation, searchLocationKeywords } = state;
135
+ if (selectedLocation && searchLocationKeywords !== selectedLocation.name) {
136
+ return Object.assign(Object.assign({}, state), { searchLocationKeywords: selectedLocation.name });
137
+ }
138
+ return state;
139
+ }
140
+ function reducer(state, action) {
141
+ var _a, _b;
142
+ if (state.isDebug) {
143
+ console.log('bookingSearchBarV3', { action, state });
144
+ }
145
+ switch (action.type) {
146
+ case ActionTypes.NavigateTo:
147
+ return Object.assign(Object.assign({}, state), { navigateTo: action.payload, focused: 'none', isMobileModalOpened: false });
148
+ case ActionTypes.ClickOutsideInputLocation: {
149
+ if (state.focused !== 'location') {
150
+ return state;
151
+ }
152
+ return resetSearchLocationKeywords(Object.assign(Object.assign({}, state), { focused: 'none' }));
153
+ }
154
+ case ActionTypes.ClickOutsideInputSpecialty: {
155
+ if (state.focused !== 'specialty') {
156
+ return state;
157
+ }
158
+ return resetSearchLocationKeywords(Object.assign(Object.assign({}, state), { focused: 'none' }));
159
+ }
160
+ case ActionTypes.ClickOutsideInputSearch: {
161
+ if (state.focused !== 'search') {
162
+ return state;
163
+ }
164
+ return Object.assign(Object.assign({}, state), { focused: 'none' });
165
+ }
166
+ case ActionTypes.ClickOutsideInputSearchSpecialty: {
167
+ if (state.focusedSpecialty !== 'search') {
168
+ return state;
169
+ }
170
+ return Object.assign(Object.assign({}, state), { focusedSpecialty: 'none' });
171
+ }
172
+ case ActionTypes.FocusInputLocation: {
173
+ const nextState = Object.assign(Object.assign({}, state), { focused: 'location' });
174
+ if (((_a = state.selectedLocation) === null || _a === void 0 ? void 0 : _a.id) === ID_OPTION_CURRENT_LOCATION) {
175
+ nextState.searchLocationKeywords = '';
176
+ }
177
+ return nextState;
178
+ }
179
+ case ActionTypes.FocusInputSpecialty: {
180
+ const nextState = Object.assign(Object.assign({}, state), { focused: 'specialty' });
181
+ if (((_b = state.selectedLocation) === null || _b === void 0 ? void 0 : _b.id) === ID_OPTION_CURRENT_LOCATION) {
182
+ nextState.searchLocationKeywords = '';
183
+ }
184
+ return nextState;
185
+ }
186
+ case ActionTypes.FocusInputSearch:
187
+ const nextState = Object.assign(Object.assign({}, state), { focused: 'search' });
188
+ if (state.isMobile) {
189
+ return resetSearchLocationKeywords(nextState);
190
+ }
191
+ return nextState;
192
+ case ActionTypes.FocusInputSearchSpecialty: {
193
+ const nextState = Object.assign(Object.assign({}, state), { focusedSpecialty: 'search' });
194
+ return nextState;
195
+ }
196
+ case ActionTypes.ChangeInputLocation:
197
+ return Object.assign(Object.assign({}, state), { searchLocationKeywords: action.payload });
198
+ case ActionTypes.ChangeInputSearch: {
199
+ const keyword = action.payload;
200
+ return Object.assign(Object.assign({}, state), { searchKeywords: keyword, isLoadingSearchResults: keyword.trim().length > SEARCH_KEYWORD_MIN_LENGTH[state.locale] });
201
+ }
202
+ case ActionTypes.SelectCurrentLocation:
203
+ return Object.assign(Object.assign({}, state), { focused: 'none', selectedLocation: action.payload, searchLocationKeywords: action.payload.name });
204
+ case ActionTypes.ClearInputLocation:
205
+ return Object.assign(Object.assign({}, state), { focused: 'location', cities: state.initialCities, searchLocationKeywords: '' });
206
+ case ActionTypes.ClearInputSearch:
207
+ return Object.assign(Object.assign({}, state), { focused: 'search', searchKeywords: '' });
208
+ case ActionTypes.SelectLocation:
209
+ return Object.assign(Object.assign({}, state), { focused: 'none', selectedLocation: action.payload, searchLocationKeywords: action.payload.name, searchResults: {} });
210
+ case ActionTypes.SelectSpecialty:
211
+ return Object.assign(Object.assign({}, state), { focused: 'none', selectedSpecialty: action.payload, searchResults: {} });
212
+ case ActionTypes.SelectSearchResult:
213
+ return Object.assign(Object.assign({}, state), { searchKeywords: action.payload.name, isMobileModalOpened: false, focused: 'none', navigateTo: action.payload.url });
214
+ case ActionTypes.FetchCitiesStart:
215
+ return Object.assign(Object.assign({}, state), { isLoadingCities: true });
216
+ case ActionTypes.FetchCitiesFinish:
217
+ return Object.assign(Object.assign({}, state), { isLoadingCities: false });
218
+ case ActionTypes.FetchSearchResultsStart:
219
+ return Object.assign(Object.assign({}, state), { isLoadingSearchResults: true });
220
+ case ActionTypes.FetchSearchResultsFinish:
221
+ return Object.assign(Object.assign({}, state), { isLoadingSearchResults: false });
222
+ case ActionTypes.FetchSearchResultsComplete: {
223
+ const nextState = Object.assign(Object.assign({}, state), { searchResults: Object.assign(Object.assign({}, state.searchResults), { [action.payload.key]: action.payload.searches }) });
224
+ return nextState;
225
+ }
226
+ case ActionTypes.FetchCitiesByGeoIpComplete: {
227
+ let { cities } = action.payload;
228
+ const { default: defaultCity } = action.payload;
229
+ cities = cities.filter((c) => c.id !== defaultCity.id);
230
+ if (defaultCity) {
231
+ cities.unshift(defaultCity);
232
+ }
233
+ if (state.initialSelectedCity &&
234
+ !cities.find((c) => c.id === state.initialSelectedCity.id)) {
235
+ cities.unshift(state.initialSelectedCity);
236
+ }
237
+ const nextState = Object.assign(Object.assign({}, state), { defaultCity, initialCities: cities, cities });
238
+ if (state.geoLocationPermission === 'denied' &&
239
+ !state.initialSelectedCity) {
240
+ nextState.selectedLocation = defaultCity;
241
+ nextState.searchLocationKeywords = defaultCity.name;
242
+ }
243
+ return nextState;
244
+ }
245
+ case ActionTypes.FetchCitiesByKeywordComplete:
246
+ return Object.assign(Object.assign({}, state), { cities: action.payload });
247
+ case ActionTypes.DisplayInitialCities:
248
+ return Object.assign(Object.assign({}, state), { cities: state.initialCities });
249
+ case ActionTypes.DisplayInitialSearchResults: {
250
+ const trimmed = state.searchKeywords.trim();
251
+ const minLen = SEARCH_KEYWORD_MIN_LENGTH[state.locale];
252
+ const shouldShowEmpty = trimmed.length > 0 && trimmed.length <= minLen;
253
+ return Object.assign(Object.assign({}, state), { searchResults: shouldShowEmpty ? {} : state.initialSearchResults, isLoadingSearchResults: false });
254
+ }
255
+ case ActionTypes.UpdateInitialSearchResults:
256
+ return Object.assign(Object.assign({}, state), { initialSearchResults: Object.assign(Object.assign({}, state.initialSearchResults), { [action.payload.key]: action.payload.searches }) });
257
+ case ActionTypes.GrantGeoLocationPermission:
258
+ return Object.assign(Object.assign({}, state), { geoLocationPermission: 'granted', geoLocationCoordinates: action.payload });
259
+ case ActionTypes.DenyGeoLocationPermission:
260
+ return Object.assign(Object.assign({}, state), { geoLocationPermission: 'denied', geoLocationCoordinates: null });
261
+ case ActionTypes.OpenMobileModal:
262
+ return Object.assign(Object.assign({}, state), { isMobileModalOpened: true });
263
+ case ActionTypes.CloseMobileModal:
264
+ return Object.assign(Object.assign({}, state), { isMobileModalOpened: false });
265
+ case ActionTypes.UpdateInitialSearchValue:
266
+ return Object.assign(Object.assign({}, state), { searchKeywords: action.payload });
267
+ case ActionTypes.SetInputSearchPlaceholder:
268
+ return Object.assign(Object.assign({}, state), { inputSearchPlaceholder: action.payload });
269
+ case ActionTypes.FetchAllSpecialties:
270
+ return Object.assign(Object.assign({}, state), { allSpecialties: action.payload });
271
+ case ActionTypes.FetchPopularKeys:
272
+ return Object.assign(Object.assign({}, state), { popularKeys: action.payload });
273
+ default:
274
+ return state;
275
+ }
276
+ }
277
+
278
+ const StyleSearchInputsWrapper = styled.div `
279
+ flex: 1;
280
+ position: relative;
281
+
282
+ ${MediaQueries.mbDown} {
283
+ width: 100%;
284
+ }
285
+ `;
286
+ const StyleSearchBarContainer = styled.div `
287
+ background: #f7f9fc;
288
+ border-radius: 12px;
289
+ height: 48px;
290
+ display: flex;
291
+ align-items: center;
292
+ padding: 4px 12px 4px 4px;
293
+ gap: 16px;
294
+
295
+ ${MediaQueries.mbDown} {
296
+ height: 48px;
297
+ width: 100%;
298
+ }
299
+ `;
300
+ const StyleSearchIconWrapper = styled.div `
301
+ display: flex;
302
+ align-items: center;
303
+ flex-shrink: 0;
304
+ color: #8c8c8c;
305
+
306
+ svg {
307
+ width: 18px;
308
+ height: 18px;
309
+ }
310
+ `;
311
+ const StyleResultWrapper = styled.div `
312
+ position: absolute;
313
+ top: calc(100% + 2px);
314
+ width: 100%;
315
+ border-radius: 4px;
316
+ background: ${theme.colors.white};
317
+ box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1);
318
+ z-index: 10;
319
+
320
+ ${MediaQueries.mbDown} {
321
+ width: calc(100% + 64px);
322
+ left: -32px;
323
+ }
324
+ `;
325
+
326
+ const StyledSearchResultWrapper = styled.div ``;
327
+ styled.div `
328
+ display: flex;
329
+ justify-content: space-between;
330
+ align-item: center;
331
+ padding: 9px 14px 9px 22px;
332
+ background: #f7f9fc;
333
+
334
+ .title {
335
+ color: ${theme.colors.gray800};
336
+ font-size: 14px;
337
+ font-weight: 600;
338
+ line-height: 22px;
339
+ }
340
+
341
+ .btn-see-all {
342
+ color: ${theme.colors.blue600};
343
+ font-size: 14px;
344
+ line-height: 22px;
345
+ cursor: pointer;
346
+ }
347
+ `;
348
+ const StyleResultBody = styled.div `
349
+ padding: 10px 16px;
350
+ max-height: 400px;
351
+ overflow: auto;
352
+ `;
353
+ const StyleResultItem = styled.div `
354
+ display: flex;
355
+ gap: 12px;
356
+ align-items: center;
357
+ cursor: pointer;
358
+
359
+ ${MediaQueries.mbUp} {
360
+ &:hover {
361
+ background-color: ${theme.colors.blue50};
362
+ }
363
+ }
364
+
365
+ .image-item {
366
+ flex: 0 0 48px;
367
+ width: 48px;
368
+ height: 48px;
369
+ border-radius: 50%;
370
+
371
+ img {
372
+ object-fit: contain;
373
+ width: 100%;
374
+ height: 100%;
375
+ border-radius: 50%;
376
+ }
377
+ }
378
+ .infor {
379
+ overflow: hidden;
380
+ padding: 12px 0;
381
+ flex: 1;
382
+ border-bottom: 1px solid ${theme.colors.neutral100};
383
+ .title {
384
+ color: ${theme.colors.gray800};
385
+ font-size: 16px;
386
+ font-weight: 600;
387
+ line-height: 24px;
388
+ }
389
+ .description {
390
+ overflow: hidden;
391
+ color: ${theme.colors.gray600};
392
+ text-overflow: ellipsis;
393
+ white-space: nowrap;
394
+ font-size: 12px;
395
+ line-height: 18px;
396
+ display: flex;
397
+ gap: 8px;
398
+ align-items: center;
399
+ margin-top: 5px;
400
+
401
+ svg {
402
+ flex: 0 0 16px;
403
+ }
404
+
405
+ .sub-description {
406
+ overflow: hidden;
407
+ white-space: nowrap;
408
+ text-overflow: ellipsis;
409
+ flex: 1;
410
+ }
411
+ }
412
+ }
413
+
414
+ &.last-item {
415
+ .infor {
416
+ border-bottom: none;
417
+ }
418
+ }
419
+ `;
420
+ styled.div `
421
+ padding: 0 16px 16px;
422
+
423
+ .search-detail-btn {
424
+ color: ${theme.colors.blue600};
425
+ font-size: 14px;
426
+ line-height: 22px;
427
+ cursor: pointer;
428
+ }
429
+ `;
430
+
431
+ const SearchResult = ({ state, type, results,
432
+ // location,
433
+ isLoading, typeInformation,
434
+ // clientSlug = '',
435
+ dispatch, }) => {
436
+ const { t } = useTranslations();
437
+ const { selectedLocation } = state;
438
+ const typeSlug = useMemo(() => typeInformation[type].slug, [typeInformation, type]);
439
+ const handleOnClick = (item) => {
440
+ let url = '';
441
+ switch (type) {
442
+ case 'service':
443
+ url = `/${selectedLocation.slug}/${typeSlug}/${item.slug}`;
444
+ break;
445
+ case 'doctor':
446
+ case 'hospital':
447
+ url = `/${typeSlug}/${item.slug}-${item.id}`;
448
+ break;
449
+ }
450
+ if (url) {
451
+ dispatch({
452
+ type: ActionTypes.NavigateTo,
453
+ payload: url,
454
+ });
455
+ }
456
+ };
457
+ // const handleSeeAll = () => {
458
+ // let url = `/${selectedLocation.slug}/${typeSlug}`
459
+ // const slugClientUrl = MAPPING_CLIENT_WITH_SLUG[locale][clientSlug]
460
+ // if (slugClientUrl) {
461
+ // url += `/${slugClientUrl}`
462
+ // }
463
+ // if (
464
+ // (type === 'doctor' || type === 'hospital') &&
465
+ // state.selectedSpecialty.id > 0
466
+ // ) {
467
+ // url += `?specialtyId=${state.selectedSpecialty.id}`
468
+ // }
469
+ // if (url) {
470
+ // dispatch({ type: ActionTypes.NavigateTo, payload: url })
471
+ // }
472
+ // }
473
+ if (results === null)
474
+ return null;
475
+ return (React__default.createElement(StyledSearchResultWrapper, null,
476
+ React__default.createElement(StyleResultBody, { className: "search-results__body" },
477
+ isLoading && (React__default.createElement("div", { className: "skeleton-result" }, Array(3)
478
+ .fill(undefined)
479
+ .map((_, i) => (React__default.createElement(StyleResultItem, { key: type + 'loading' + i, className: i === 2 ? 'last-item' : '' },
480
+ React__default.createElement("div", { className: "image-item" },
481
+ React__default.createElement(Skeleton, { height: 48, circle: true, mb: "xl", animate: true })),
482
+ React__default.createElement("div", { className: "infor" },
483
+ React__default.createElement("div", { className: "title" },
484
+ React__default.createElement(Skeleton, { height: 8, mt: 10, radius: "xl", animate: true })),
485
+ React__default.createElement("div", { className: "description" },
486
+ React__default.createElement("div", { className: "sub-description" },
487
+ React__default.createElement(Skeleton, { height: 8, mt: 10, radius: "xl", width: "80%", animate: true }))))))))),
488
+ !isLoading && results && results.length > 0 && (React__default.createElement(React__default.Fragment, null, results.map((item, index) => {
489
+ var _a, _b;
490
+ const isLastItem = (results.length > 4 && index === 3) ||
491
+ (results.length <= 4 && index === results.length - 1);
492
+ let subDescription = '';
493
+ if (type === 'hospital') {
494
+ subDescription = (item === null || item === void 0 ? void 0 : item.address) || '';
495
+ }
496
+ if (type === 'doctor') {
497
+ subDescription = ((_a = item === null || item === void 0 ? void 0 : item.specialties) === null || _a === void 0 ? void 0 : _a.join(', ')) || '';
498
+ }
499
+ if (type === 'service') {
500
+ subDescription = ((_b = item === null || item === void 0 ? void 0 : item.hospital_branch) === null || _b === void 0 ? void 0 : _b.name) || '';
501
+ }
502
+ if (index >= 4) {
503
+ return React__default.createElement(React__default.Fragment, null);
504
+ }
505
+ return (React__default.createElement(StyleResultItem, { key: item.id, className: clsx(isLastItem ? 'last-item' : '', 'result-item'), onClick: () => handleOnClick(item) },
506
+ React__default.createElement("div", { className: "image-item" },
507
+ React__default.createElement("img", { src: item.logo || item.avatar, alt: item.name })),
508
+ React__default.createElement("div", { className: "infor" },
509
+ React__default.createElement("div", { className: "title" }, item.name),
510
+ React__default.createElement("div", { className: "description" },
511
+ typeInformation[type].icon,
512
+ React__default.createElement("div", { className: "sub-description" }, subDescription)))));
513
+ }))),
514
+ !isLoading && (results === null || results === void 0 ? void 0 : results.length) === 0 && (React__default.createElement(Text, { size: "sm", color: theme.colors.gray400, className: "noresult-block" }, t('booking.searchBar.noResults'))))));
515
+ };
516
+
517
+ const SearchResultContent = ({ state, type, isLoading, clientSlug, typeInformation, dispatch, }) => {
518
+ var _a;
519
+ if (state.focused !== 'search')
520
+ return null;
521
+ return (React__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 }));
522
+ };
523
+
524
+ const StyleSearchSpecialtyWrapper = styled.div `
525
+ position: relative;
526
+ flex-shrink: 0;
527
+
528
+ ${MediaQueries.mbDown} {
529
+ width: 100%;
530
+ display: flex;
531
+ flex-direction: column;
532
+ gap: 12px;
533
+ }
534
+
535
+ &.compact {
536
+ ${MediaQueries.mbDown} {
537
+ width: auto;
538
+ display: block;
539
+ }
540
+ }
541
+ `;
542
+ const StyleDropdownPanel = styled.div `
543
+ position: absolute;
544
+ top: calc(100% + 4px);
545
+ left: 0;
546
+ min-width: 264px;
547
+ background: white;
548
+ border-radius: 12px;
549
+ box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.04),
550
+ 0px 2px 8px 0px rgba(0, 0, 0, 0.04), 0px 10px 16px 0px rgba(0, 0, 0, 0.04);
551
+ z-index: 10;
552
+ overflow: hidden;
553
+
554
+ &.mobile {
555
+ min-width: 280px;
556
+ }
557
+ `;
558
+ const StyledSpecialtyItem = styled.div `
559
+ cursor: pointer;
560
+ padding: 12px 16px;
561
+ display: flex;
562
+ align-items: center;
563
+ gap: 12px;
564
+ outline: none;
565
+
566
+ .image-item {
567
+ display: flex;
568
+ align-items: center;
569
+ justify-content: center;
570
+ width: 24px;
571
+ height: 24px;
572
+ flex-shrink: 0;
573
+
574
+ img {
575
+ width: 100%;
576
+ height: 100%;
577
+ object-fit: contain;
578
+ }
579
+
580
+ svg {
581
+ width: 24px;
582
+ height: 24px;
583
+ }
584
+ }
585
+
586
+ .item-label {
587
+ font-size: 15px;
588
+ font-weight: 400;
589
+ line-height: 24px;
590
+ letter-spacing: -0.3px;
591
+ color: ${theme.colors.gray800};
592
+ }
593
+
594
+ &:hover {
595
+ background-color: ${theme.colors.neutral50};
596
+ }
597
+
598
+ &.selected {
599
+ background-color: ${theme.colors.neutral50};
600
+ }
601
+
602
+ &:last-child {
603
+ border-bottom-left-radius: 12px;
604
+ border-bottom-right-radius: 12px;
605
+ }
606
+ `;
607
+
608
+ const DoctorIcon = () => (React__default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
609
+ React__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" })));
610
+ const ServiceIcon = () => (React__default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
611
+ React__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" })));
612
+ const HospitalIcon = () => (React__default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
613
+ React__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" })));
614
+ const SpecialtyIcon = () => (React__default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16" },
615
+ React__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" })));
616
+
617
+ const SearchSpecialty = ({ state, isMobile, onSpecialtyClick, dispatch, isCompact = false, }) => {
618
+ const { t, locale } = useTranslations();
619
+ const inputSpecialtyWrapperRef = useRef(null);
620
+ const searchInputRef = useRef(null);
621
+ const slugs = useMemo(() => LOCALIZED_SLUGS[locale], [locale]);
622
+ const [searchValue, setSearchValue] = useState('');
623
+ const [opened, { close, toggle }] = useDisclosure(false);
624
+ useOutsideClick(inputSpecialtyWrapperRef, () => {
625
+ close();
626
+ setSearchValue('');
627
+ dispatch({ type: ActionTypes.ClickOutsideInputSpecialty });
628
+ });
629
+ const specialtyData = useMemo(() => [
630
+ {
631
+ name: t('booking.searchBar.allSpecialties'),
632
+ id: -1,
633
+ thumbnail: '',
634
+ total_doctor: 0,
635
+ slug: slugs.SPECIALTIES,
636
+ },
637
+ ...state.allSpecialties,
638
+ ], [state.allSpecialties, t, slugs.SPECIALTIES]);
639
+ const filteredData = useMemo(() => {
640
+ if (!searchValue.trim())
641
+ return specialtyData;
642
+ return specialtyData.filter((s) => s.name.toLowerCase().includes(searchValue.toLowerCase().trim()));
643
+ }, [specialtyData, searchValue]);
644
+ const selectedLabel = useMemo(() => {
645
+ if (!state.selectedSpecialty)
646
+ return '';
647
+ return state.selectedSpecialty.name;
648
+ }, [state.selectedSpecialty]);
649
+ const handleSelect = useCallback((item) => {
650
+ onSpecialtyClick({
651
+ id: item.id,
652
+ name: item.name,
653
+ slug: item.slug,
654
+ thumbnail: item.thumbnail || '',
655
+ total_doctor: 0,
656
+ });
657
+ close();
658
+ setSearchValue('');
659
+ }, [onSpecialtyClick, close]);
660
+ const handleToggle = useCallback(() => {
661
+ toggle();
662
+ if (opened) {
663
+ setSearchValue('');
664
+ }
665
+ }, [toggle, opened]);
666
+ return (React__default.createElement(StyleSearchSpecialtyWrapper, { ref: inputSpecialtyWrapperRef, className: isCompact ? 'compact' : '' },
667
+ React__default.createElement(Box, { onClick: handleToggle, className: opened ? 'dropdown-trigger-open' : '', sx: {
668
+ cursor: 'pointer',
669
+ position: 'relative',
670
+ width: isCompact ? (isMobile ? 96 : 160) : '100%',
671
+ flexShrink: 0,
672
+ } },
673
+ React__default.createElement(Input, { readOnly: true, value: selectedLabel, placeholder: t('booking.searchPopup.specialties'), rightSection: React__default.createElement(ChevronDown, { style: { width: 20, height: 20 } }), styles: Object.assign({ input: {
674
+ cursor: 'pointer',
675
+ outline: 'none',
676
+ '&:focus': {
677
+ outline: 'none',
678
+ },
679
+ '&:not(.mantine-Textarea-input)': {
680
+ height: isCompact ? 40 : isMobile ? 40 : 46,
681
+ fontSize: isCompact ? rem(14) : isMobile ? rem(14) : rem(16),
682
+ paddingLeft: isCompact ? 12 : 16,
683
+ paddingRight: 30,
684
+ background: isCompact ? 'white' : 'transparent',
685
+ border: isCompact
686
+ ? `1px solid ${theme.colors.gray200}`
687
+ : 'none',
688
+ borderRadius: 8,
689
+ letterSpacing: '-0.2px',
690
+ color: theme.colors.gray800,
691
+ textOverflow: 'ellipsis',
692
+ overflow: 'hidden',
693
+ whiteSpace: 'nowrap',
694
+ },
695
+ }, rightSection: {
696
+ width: 30,
697
+ pointerEvents: 'none',
698
+ } }, (!isCompact && {
699
+ wrapper: {
700
+ position: 'relative',
701
+ '&:after': {
702
+ content: '""',
703
+ width: '1px',
704
+ height: '20px',
705
+ backgroundColor: theme.colors.neutral100,
706
+ position: 'absolute',
707
+ right: 0,
708
+ top: '50%',
709
+ transform: 'translateY(-50%)',
710
+ },
711
+ },
712
+ })) })),
713
+ opened && (React__default.createElement(StyleDropdownPanel, { className: isMobile ? 'mobile' : '' },
714
+ React__default.createElement(Box, { sx: { padding: '12px 12px 8px' } },
715
+ React__default.createElement(Input, { ref: searchInputRef, icon: React__default.createElement(Search, { size: 18, color: theme.colors.gray300 }), placeholder: t('booking.searchBar.placeholder.specialty'), value: searchValue, onChange: (e) => setSearchValue(e.target.value), size: "md", styles: {
716
+ input: {
717
+ height: 40,
718
+ fontSize: rem(15),
719
+ paddingLeft: 36,
720
+ '&::placeholder': {
721
+ color: theme.colors.gray400,
722
+ },
723
+ },
724
+ icon: {
725
+ width: 36,
726
+ },
727
+ } })),
728
+ React__default.createElement(ScrollArea.Autosize, { mah: 300 }, filteredData.length === 0 ? (React__default.createElement(Box, { sx: {
729
+ padding: '12px 16px',
730
+ color: theme.colors.gray400,
731
+ fontSize: 14,
732
+ } }, t('common.noResult'))) : (filteredData.map((specialty) => {
733
+ var _a, _b;
734
+ return (React__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
735
+ ? 'selected'
736
+ : '', onClick: () => handleSelect(specialty), onKeyDown: (e) => {
737
+ if (e.key === 'Enter' || e.key === ' ') {
738
+ e.preventDefault();
739
+ handleSelect(specialty);
740
+ }
741
+ } },
742
+ React__default.createElement("div", { className: "image-item" }, specialty.thumbnail ? (React__default.createElement("img", { src: specialty.thumbnail, alt: specialty.name })) : (React__default.createElement(SpecialtyIcon, null))),
743
+ React__default.createElement("span", { className: "item-label" }, specialty.name)));
744
+ })))))));
745
+ };
746
+
747
+ const SearchInputs = forwardRef(({ state, type, isMobile, isLoading, initalSearchValue, typeInformation, debouncedFetchSearchResults, trackingAttributes, hideSpecialtySelection = false, clientSlug = '', onSearch, onFocusInput, onEnterSearch, dispatch, onlyShowSearchBox, onChangeSpecialty, }, ref) => {
748
+ const { t } = useTranslations();
749
+ const inputSearchWrapperRef = useRef(null);
750
+ const internalInputRef = useRef(null);
751
+ useImperativeHandle(ref, () => ({
752
+ focus: () => {
753
+ var _a;
754
+ (_a = internalInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
755
+ },
756
+ }));
757
+ const gaAttributes = useMemo(() => {
758
+ if (trackingAttributes) {
759
+ return {
760
+ 'data-event-category': trackingAttributes.dataEventCategory,
761
+ 'data-event-action': trackingAttributes.dataEventAction,
762
+ 'data-event-label': trackingAttributes.dataEventLabel,
763
+ };
764
+ }
765
+ else {
766
+ return {};
767
+ }
768
+ }, [trackingAttributes]);
769
+ const placeholderSearch = useMemo(() => {
770
+ if (type === 'doctor')
771
+ return t('booking.searchBar.placeholder.doctor');
772
+ if (type === 'service')
773
+ return t('booking.searchBar.placeholder.service');
774
+ if (type === 'hospital')
775
+ return t('booking.searchBar.placeholder.hospital');
776
+ if (type === 'specialty')
777
+ return t('booking.searchBar.placeholder.specialty');
778
+ return '';
779
+ }, [type, t]);
780
+ const showSpecialtyInSearchBar = type !== 'specialty' &&
781
+ type !== 'service' &&
782
+ !hideSpecialtySelection &&
783
+ !onlyShowSearchBox;
784
+ const styleInputUnstyled = useMemo(() => ({
785
+ input: {
786
+ border: 'none',
787
+ background: 'transparent',
788
+ height: '100%',
789
+ fontSize: rem(16),
790
+ color: theme.colors.gray800,
791
+ padding: '0',
792
+ '&::placeholder': {
793
+ color: theme.colors.gray400,
794
+ },
795
+ '&:focus': {
796
+ outline: 'none',
797
+ boxShadow: 'none',
798
+ },
799
+ [isMobile ? '@media (max-width: 767px)' : '']: isMobile
800
+ ? {
801
+ fontSize: rem(16),
802
+ }
803
+ : {},
804
+ },
805
+ wrapper: {
806
+ flex: 1,
807
+ },
808
+ }), [isMobile]);
809
+ useOutsideClick(inputSearchWrapperRef, () => {
810
+ !isMobile && dispatch({ type: ActionTypes.ClickOutsideInputSearch });
811
+ });
812
+ const handleSearchInputChange = useCallback(function handleSearchInputChange(value) {
813
+ dispatch({ type: ActionTypes.ChangeInputSearch, payload: value });
814
+ if (typeof onSearch === 'function') {
815
+ return;
816
+ }
817
+ if (value.trim().length > SEARCH_KEYWORD_MIN_LENGTH[state.locale] ||
818
+ initalSearchValue ||
819
+ value.trim().length === 0) {
820
+ debouncedFetchSearchResults(value.trim(), state, type, clientSlug);
821
+ }
822
+ }, [
823
+ dispatch,
824
+ state,
825
+ type,
826
+ initalSearchValue,
827
+ debouncedFetchSearchResults,
828
+ clientSlug,
829
+ onSearch,
830
+ ]);
831
+ const handleSpecialtyClick = useCallback(function handleSpecialtyClick(specialty) {
832
+ var _a;
833
+ dispatch({ type: ActionTypes.SelectSpecialty, payload: specialty });
834
+ onChangeSpecialty === null || onChangeSpecialty === void 0 ? void 0 : onChangeSpecialty(specialty);
835
+ !isMobile && ((_a = internalInputRef.current) === null || _a === void 0 ? void 0 : _a.focus());
836
+ }, [dispatch, onChangeSpecialty]);
837
+ const inputOnKeyDown = useCallback((e) => {
838
+ if (e.key === 'Enter') {
839
+ e.stopPropagation();
840
+ e.preventDefault();
841
+ onEnterSearch && onEnterSearch();
842
+ }
843
+ }, [onEnterSearch]);
844
+ return (React__default.createElement(StyleSearchInputsWrapper, { ref: inputSearchWrapperRef },
845
+ React__default.createElement(StyleSearchBarContainer, null,
846
+ showSpecialtyInSearchBar && (React__default.createElement(SearchSpecialty, { state: state, isMobile: isMobile, dispatch: dispatch, debouncedFetchSearchResults: debouncedFetchSearchResults, onSpecialtyClick: handleSpecialtyClick, isCompact: true })),
847
+ React__default.createElement(StyleSearchIconWrapper, null,
848
+ React__default.createElement(Search, null)),
849
+ React__default.createElement(Input, Object.assign({ ref: internalInputRef, variant: "unstyled", size: isMobile ? 'md' : 'lg', placeholder: placeholderSearch, styles: styleInputUnstyled, value: state.searchKeywords, name: "search-results", autoComplete: "off", onFocus: () => {
850
+ dispatch({ type: ActionTypes.FocusInputSearch });
851
+ onFocusInput === null || onFocusInput === void 0 ? void 0 : onFocusInput();
852
+ }, onChange: (event) => {
853
+ handleSearchInputChange(event.target.value);
854
+ }, onKeyDown: inputOnKeyDown }, gaAttributes))),
855
+ !isMobile && type !== 'specialty' && (React__default.createElement(StyleResultWrapper, null,
856
+ React__default.createElement(SearchResultContent, { type: type, state: state, dispatch: dispatch, isLoading: isLoading, typeInformation: typeInformation, clientSlug: clientSlug })))));
857
+ });
858
+ SearchInputs.displayName = 'SearchInputs';
859
+
860
+ const ModalSearchResult = (_a) => {
861
+ var { searchInputEle, closeModal, children } = _a, props = __rest(_a, ["searchInputEle", "closeModal", "children"]);
862
+ const theme = useMantineTheme();
863
+ return (React__default.createElement(Modal, Object.assign({}, props, { zIndex: 310, fullScreen: true, styles: {
864
+ content: {
865
+ borderRadius: 0,
866
+ height: '100%',
867
+ '.search-results__body': { padding: 0 },
868
+ '.result-item': {
869
+ paddingLeft: 16,
870
+ paddingRight: 16,
871
+ },
872
+ '.noresult-block': {
873
+ padding: 16,
874
+ },
875
+ '.skeleton-result': {
876
+ padding: 16,
877
+ },
878
+ },
879
+ header: { display: 'none' },
880
+ } }),
881
+ React__default.createElement(Stack, { spacing: 16, sx: { paddingTop: 16 } },
882
+ React__default.createElement(Flex, { align: 'center', gap: 12 },
883
+ React__default.createElement(ArrowLeft, { size: 28, onClick: closeModal, color: theme.fn.primaryColor() }),
884
+ React__default.createElement(Box, { sx: { width: '100%' } }, searchInputEle)),
885
+ children)));
886
+ };
887
+
888
+ const StyleSearchLocationWrapper = styled.div `
889
+ position: relative;
890
+ width: 240px;
891
+ flex-shrink: 0;
892
+
893
+ ${MediaQueries.mbDown} {
894
+ width: 100%;
895
+ }
896
+ `;
897
+ styled.div `
898
+ position: absolute;
899
+ top: calc(100% + 2px);
900
+ width: 100%;
901
+ border-radius: 4px;
902
+ background: ${theme.colors.white};
903
+ box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1);
904
+ z-index: 10;
905
+
906
+ ${MediaQueries.mbDown} {
907
+ width: calc(100% + 64px);
908
+ left: -32px;
909
+ }
910
+ `;
911
+ const StyledLocationItem = styled.div `
912
+ position: relative;
913
+ cursor: pointer;
914
+ padding: 12px 18px;
915
+ display: flex;
916
+ align-items: center;
917
+ gap: 14px;
918
+ overflow: hidden;
919
+
920
+ & + li::before {
921
+ content: '';
922
+ position: absolute;
923
+ left: 18px;
924
+ right: 18px;
925
+ top: 0;
926
+ height: 1px;
927
+ background-color: ${theme.colors.neutral100};
928
+ }
929
+
930
+ &:not([data-is-denied='true']):hover {
931
+ background-color: ${theme.colors.neutral50};
932
+ }
933
+
934
+ &:last-child:hover {
935
+ border-bottom-right-radius: 6px;
936
+ border-bottom-left-radius: 6px;
937
+ }
938
+
939
+ &:first-child:hover {
940
+ border-top-right-radius: 6px;
941
+ border-top-left-radius: 6px;
942
+ }
943
+
944
+ &[data-is-denied='true'] {
945
+ cursor: not-allowed;
946
+ }
947
+ `;
948
+ const StyledPinIcon = styled(PinIcon) `
949
+ width: 12px;
950
+ height: 18px;
951
+ flex: 0 0 12px;
952
+ `;
953
+
954
+ const CustomSelectItem = forwardRef((_a, ref) => {
955
+ var { label, value } = _a, others = __rest(_a, ["label", "value"]);
956
+ return (React__default.createElement("div", Object.assign({ ref: ref }, others),
957
+ React__default.createElement(StyledLocationItem, { key: value, role: "button", tabIndex: 0, "aria-label": `Select ${label} as location`, className: "location-item" },
958
+ React__default.createElement(StyledPinIcon, { color: theme.colors.neutral400 }),
959
+ React__default.createElement(Text$1, { size: "md" }, label))));
960
+ });
961
+
962
+ const SearchLocation = ({ state, debouncedFetchCitiesByKeyword, selectedLocation, trackingAttributes, onLocationClick, dispatch, }) => {
963
+ var _a;
964
+ const { t, locale } = useTranslations();
965
+ const inputLocationWrapperRef = useRef(null);
966
+ const citiesData = useMemo(() => {
967
+ var _a;
968
+ return [
969
+ {
970
+ name: t('booking.searchBar.allLocations'),
971
+ id: ID_OPTION_ALL_LOCATION,
972
+ slug: (_a = LOCALIZED_SLUGS[locale]) === null || _a === void 0 ? void 0 : _a.ALL,
973
+ },
974
+ ...state.cities,
975
+ ];
976
+ }, [state.cities, t, locale]);
977
+ const gaAttributes = useMemo(() => {
978
+ if (trackingAttributes) {
979
+ return {
980
+ 'data-event-category': trackingAttributes.dataEventCategory,
981
+ 'data-event-action': trackingAttributes.dataEventAction,
982
+ 'data-event-label': trackingAttributes.dataEventLabel,
983
+ };
984
+ }
985
+ return {};
986
+ }, [trackingAttributes]);
987
+ const handleSearchLocationInputChange = useCallback(function handleSearchLocationInputChange(value) {
988
+ dispatch({ type: ActionTypes.ChangeInputLocation, payload: value });
989
+ if (value.trim().length > SEARCH_KEYWORD_MIN_LENGTH[state.locale]) {
990
+ debouncedFetchCitiesByKeyword(value.trim());
991
+ }
992
+ else {
993
+ debouncedFetchCitiesByKeyword.cancel();
994
+ dispatch({ type: ActionTypes.DisplayInitialCities });
995
+ }
996
+ }, [debouncedFetchCitiesByKeyword, dispatch, state.locale]);
997
+ useOutsideClick(inputLocationWrapperRef, () => {
998
+ dispatch({ type: ActionTypes.ClickOutsideInputLocation });
999
+ });
1000
+ const stateValue = (_a = selectedLocation === null || selectedLocation === void 0 ? void 0 : selectedLocation.id) !== null && _a !== void 0 ? _a : null;
1001
+ const defaultValue = stateValue === null ? undefined : String(stateValue);
1002
+ return (React__default.createElement(StyleSearchLocationWrapper, { ref: inputLocationWrapperRef },
1003
+ React__default.createElement(Select, Object.assign({ key: defaultValue !== null && defaultValue !== void 0 ? defaultValue : 'no-selected-location', defaultValue: defaultValue, placeholder: t('booking.searchBar.allLocations'), searchable: true, onSearchChange: (value) => {
1004
+ handleSearchLocationInputChange(value);
1005
+ }, onFocus: () => {
1006
+ dispatch({ type: ActionTypes.DisplayInitialCities });
1007
+ }, onDropdownClose: () => {
1008
+ debouncedFetchCitiesByKeyword.cancel();
1009
+ dispatch({ type: ActionTypes.DisplayInitialCities });
1010
+ }, nothingFound: t('common.noResult'), maxDropdownHeight: 340, dropdownPosition: "bottom", icon: React__default.createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
1011
+ React__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" }),
1012
+ React__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.createElement(ChevronDown, { style: { width: 20, height: 20 } }) }, gaAttributes, { styles: () => ({
1013
+ item: {
1014
+ padding: 0,
1015
+ '&[data-selected]': {
1016
+ '&, &:hover': {
1017
+ backgroundColor: '#F7F9FC',
1018
+ color: 'inherit',
1019
+ },
1020
+ '.location-item': {
1021
+ '&::after': {
1022
+ content: checkMarkIconUrl,
1023
+ top: '50%',
1024
+ right: 19,
1025
+ position: 'absolute',
1026
+ transform: 'translateY(-50%)',
1027
+ },
1028
+ },
1029
+ },
1030
+ '&[data-hovered]': {
1031
+ backgroundColor: 'transparent',
1032
+ },
1033
+ },
1034
+ root: {
1035
+ width: '100%',
1036
+ },
1037
+ wrapper: {
1038
+ width: '100%',
1039
+ },
1040
+ input: {
1041
+ '&:not(.mantine-Textarea-input)': {
1042
+ height: 48,
1043
+ fontSize: rem(15),
1044
+ fontWeight: 400,
1045
+ letterSpacing: '-0.3px',
1046
+ color: theme.colors.gray1000,
1047
+ paddingLeft: 44,
1048
+ paddingRight: 40,
1049
+ background: 'white',
1050
+ border: `1px solid ${theme.colors.gray200}`,
1051
+ borderRadius: 12,
1052
+ },
1053
+ },
1054
+ icon: {
1055
+ width: 44,
1056
+ paddingLeft: 12,
1057
+ },
1058
+ rightSection: {
1059
+ width: 40,
1060
+ paddingRight: 12,
1061
+ },
1062
+ itemsWrapper: {
1063
+ padding: 0,
1064
+ },
1065
+ dropdown: {
1066
+ left: '0 !important',
1067
+ border: 0,
1068
+ marginTop: 4,
1069
+ borderRadius: 12,
1070
+ overflow: 'hidden',
1071
+ 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)',
1072
+ '& ::-webkit-scrollbar': {
1073
+ width: '6px',
1074
+ height: '6px',
1075
+ },
1076
+ },
1077
+ }), itemComponent: CustomSelectItem, filter: () => true, onChange: (value) => {
1078
+ if (value == null)
1079
+ return;
1080
+ const city = citiesData.find((i) => String(i.id) === value);
1081
+ if (!city)
1082
+ return;
1083
+ onLocationClick(city);
1084
+ debouncedFetchCitiesByKeyword.cancel();
1085
+ dispatch({ type: ActionTypes.DisplayInitialCities });
1086
+ setTimeout(() => {
1087
+ var _a, _b;
1088
+ (_b = (_a = inputLocationWrapperRef.current) === null || _a === void 0 ? void 0 : _a.querySelector('input')) === null || _b === void 0 ? void 0 : _b.blur();
1089
+ }, 0);
1090
+ }, data: citiesData.map((city) => ({
1091
+ value: String(city.id),
1092
+ label: city.name,
1093
+ city,
1094
+ })) }))));
1095
+ };
1096
+
1097
+ const StyleSpecialtiesWrapper = styled.div `
1098
+ display: flex;
1099
+ flex-wrap: wrap;
1100
+ row-gap: 8px;
1101
+ column-gap: 20px;
1102
+ ${MediaQueries.mbDown} {
1103
+ margin-top: 12px;
1104
+ }
1105
+ `;
1106
+ const StyleSpecialtyItem = styled.div `
1107
+ display: flex;
1108
+ align-items: center;
1109
+ border-radius: 8px;
1110
+ border: 1px solid ${theme.colors.neutral100};
1111
+ background: ${theme.colors.white};
1112
+ padding: 8px 12px 8px 8px;
1113
+ flex: 0 0 calc(33.3% - 13px);
1114
+ gap: 12px;
1115
+ cursor: pointer;
1116
+
1117
+ &:hover {
1118
+ background: ${theme.colors.blue50};
1119
+ }
1120
+
1121
+ ${MediaQueries.tdDown} {
1122
+ flex: 0 0 calc(50% - 10px);
1123
+ }
1124
+
1125
+ ${MediaQueries.mbDown} {
1126
+ flex: 0 0 100%;
1127
+ border: none;
1128
+ }
1129
+
1130
+ .image-item {
1131
+ display: flex;
1132
+ align-items: center;
1133
+ width: 40px;
1134
+ height: 40px;
1135
+
1136
+ img {
1137
+ width: 100%;
1138
+ object-fit: cover;
1139
+ }
1140
+ }
1141
+
1142
+ .infor {
1143
+ flex: 1;
1144
+ .title {
1145
+ color: ${theme.colors.gray800};
1146
+ font-size: 14px;
1147
+ font-style: normal;
1148
+ font-weight: 400;
1149
+ line-height: 22px;
1150
+ }
1151
+
1152
+ .description {
1153
+ color: ${theme.colors.gray600};
1154
+ font-size: 12px;
1155
+ font-weight: 400;
1156
+ line-height: 18px;
1157
+ }
1158
+ }
1159
+ `;
1160
+ const StyleDivider = styled(Divider) `
1161
+ margin: 24px 0 !important;
1162
+ `;
1163
+ const StyleShowMore = styled.div `
1164
+ display: flex;
1165
+ justify-content: center;
1166
+ margin-top: 24px;
1167
+ .show-more {
1168
+ border-radius: 4px;
1169
+ border: 1px solid ${theme.colors.neutral200};
1170
+ padding: 12px 16px;
1171
+ cursor: pointer;
1172
+ display: inline-block;
1173
+ color: ${theme.colors.gray800};
1174
+ font-size: 16px;
1175
+ font-weight: 600;
1176
+ line-height: 24px;
1177
+
1178
+ ${MediaQueries.mbDown} {
1179
+ width: 100%;
1180
+ text-align: center;
1181
+ }
1182
+ }
1183
+ `;
1184
+
1185
+ const SearchResultSpecialties = ({ state, isMobile, specialties, isLoading, dispatch, }) => {
1186
+ const { t, locale } = useTranslations();
1187
+ const { selectedLocation } = state;
1188
+ const slugs = useMemo(() => LOCALIZED_SLUGS[locale], [locale]);
1189
+ const handleOnClick = (specialtySlug) => {
1190
+ let url = '';
1191
+ if (specialtySlug === SLUG_VACIN_ID) {
1192
+ url = `/${selectedLocation.slug}/${slugs.HOSPITAL}/${CLIENT_KEY.GSK}/`;
1193
+ dispatch({ type: ActionTypes.ClickOutsideInputSearchSpecialty });
1194
+ }
1195
+ else {
1196
+ url = `/${selectedLocation.slug}/${slugs.DOCTOR}/${specialtySlug}`;
1197
+ }
1198
+ dispatch({ type: ActionTypes.NavigateTo, payload: url });
1199
+ };
1200
+ const handleShowMore = () => {
1201
+ const url = `/${slugs.SPECIALTIES}`;
1202
+ dispatch({ type: ActionTypes.NavigateTo, payload: url });
1203
+ };
1204
+ const showSeeMore = useMemo(() => {
1205
+ return (specialties.length >= 9 ||
1206
+ state.searchKeywords.trim().length <=
1207
+ SEARCH_KEYWORD_MIN_LENGTH[state.locale]);
1208
+ }, [state.searchKeywords, specialties]);
1209
+ return (React__default.createElement(React__default.Fragment, null,
1210
+ !isMobile && React__default.createElement(StyleDivider, { color: "#E4E8EC" }),
1211
+ React__default.createElement(StyleSpecialtiesWrapper, null,
1212
+ specialties.length > 0 && !isLoading && (React__default.createElement(React__default.Fragment, null, specialties.map((specialty, index) => {
1213
+ if (index >= 9) {
1214
+ return React__default.createElement(React__default.Fragment, null);
1215
+ }
1216
+ return (React__default.createElement(StyleSpecialtyItem, { key: specialty.id, onClick: () => handleOnClick(specialty.slug) },
1217
+ React__default.createElement("div", { className: "image-item" },
1218
+ React__default.createElement("img", { src: specialty.thumbnail, alt: specialty.name })),
1219
+ React__default.createElement("div", { className: "infor" },
1220
+ React__default.createElement("div", { className: "title" }, specialty.name))));
1221
+ }))),
1222
+ specialties.length === 0 && !isLoading && (React__default.createElement(Text, { size: "sm", color: theme.colors.gray400 }, t('booking.searchBar.noResults'))),
1223
+ isLoading &&
1224
+ Array(6)
1225
+ .fill(undefined)
1226
+ .map((_, i) => (React__default.createElement(StyleSpecialtyItem, { key: 'loading' + i },
1227
+ React__default.createElement("div", { className: "image-item" },
1228
+ React__default.createElement(Skeleton, { height: 40, animate: true })),
1229
+ React__default.createElement("div", { className: "infor" },
1230
+ React__default.createElement("div", { className: "title" },
1231
+ React__default.createElement(Skeleton, { height: 20, radius: "sm", animate: true }))))))),
1232
+ showSeeMore && (React__default.createElement(StyleShowMore, null,
1233
+ React__default.createElement("div", { className: "show-more", onClick: handleShowMore }, t('home.seeAll'))))));
1234
+ };
1235
+
1236
+ const StyleSearchTagWrapper = styled.div `
1237
+ display: flex;
1238
+ gap: 5px;
1239
+ margin-top: 16px;
1240
+ flex-wrap: wrap;
1241
+ `;
1242
+ const StyleTagItem = styled.div `
1243
+ color: ${theme.colors.gray600};
1244
+ font-size: 14px;
1245
+ font-weight: 600;
1246
+ line-height: 22px;
1247
+ padding: 4px 12px;
1248
+ background: ${theme.colors.white};
1249
+ border-radius: 32px;
1250
+ cursor: pointer;
1251
+ border: 1px solid ${theme.colors.white};
1252
+ margin-bottom: 5px;
1253
+ border-color: ${theme.colors.neutral100};
1254
+ background: #f7f9fc;
1255
+
1256
+ &.view-all {
1257
+ border-radius: 32px;
1258
+ border-color: ${theme.colors.blue50};
1259
+ background: ${theme.colors.blue50};
1260
+ color: ${theme.colors.blue600};
1261
+
1262
+ &:hover {
1263
+ border-color: ${theme.colors.blue50};
1264
+ background: ${theme.colors.blue50};
1265
+ color: ${theme.colors.blue600};
1266
+ }
1267
+ }
1268
+
1269
+ &:hover {
1270
+ border-color: ${theme.colors.neutral100};
1271
+ background: #f7f9fc;
1272
+ }
1273
+ `;
1274
+ const StyleTagLabel = styled.div `
1275
+ color: ${theme.colors.gray600};
1276
+ font-size: 14px;
1277
+ font-weight: 600;
1278
+ line-height: 22px;
1279
+ padding: 4px 0;
1280
+ background: ${theme.colors.white};
1281
+ border-radius: 32px;
1282
+ border: 1px solid ${theme.colors.white};
1283
+ margin-bottom: 5px;
1284
+ margin-right: 7px;
1285
+ `;
1286
+
1287
+ const SearchTag = ({ state, type, typeInformation, dispatch }) => {
1288
+ const { t } = useTranslations();
1289
+ const { selectedLocation } = state;
1290
+ const typeSlug = useMemo(() => typeInformation[type].slug, [typeInformation, type]);
1291
+ const handleViewAll = () => {
1292
+ const url = `/${selectedLocation.slug}/${typeSlug}`;
1293
+ if (url) {
1294
+ dispatch({ type: ActionTypes.NavigateTo, payload: url });
1295
+ }
1296
+ };
1297
+ const handleClickKeyword = (keyword) => {
1298
+ if (keyword.url) {
1299
+ window.location.href = keyword.url;
1300
+ }
1301
+ };
1302
+ return (React__default.createElement(StyleSearchTagWrapper, null,
1303
+ React__default.createElement(StyleTagLabel, null, t('booking.searchBar.popularKey')),
1304
+ state.popularKeys.map((item) => {
1305
+ return (React__default.createElement(StyleTagItem, { key: item.id, onClick: () => handleClickKeyword(item) }, item.keyword));
1306
+ }),
1307
+ React__default.createElement(StyleTagItem, { className: "view-all", onClick: handleViewAll }, t('booking.searchBar.viewAll'))));
1308
+ };
1309
+
1310
+ const StyledTabWrapper = styled.div `
1311
+ background: rgba(255, 255, 255, 0.64);
1312
+ backdrop-filter: blur(12px);
1313
+ border-bottom: 1px solid ${theme.colors.neutral100};
1314
+ `;
1315
+ const StyleTabContainer = styled(Container) `
1316
+ padding: 0 16px;
1317
+ `;
1318
+
1319
+ const TabSearch = ({ currentTab, hideTabBookingSearch = [], hideSpecialtyTab, isMobile, setCurrentTab, }) => {
1320
+ const { t } = useTranslations();
1321
+ const stylesTabs = useMemo(() => {
1322
+ return {
1323
+ root: {
1324
+ overflowY: isMobile ? 'hidden' : 'initial',
1325
+ overflowX: isMobile ? 'auto' : 'initial',
1326
+ },
1327
+ tabsList: {
1328
+ background: 'rgba(255, 255, 255, 0)',
1329
+ borderBottom: 'none',
1330
+ flexWrap: 'nowrap',
1331
+ '.mantine-Tabs-tab': {
1332
+ '&:last-child': {
1333
+ '&:after': {
1334
+ display: 'none',
1335
+ },
1336
+ },
1337
+ },
1338
+ },
1339
+ tab: {
1340
+ padding: isMobile ? '12px 16px 12px 16px' : '15px 40px 15px 40px',
1341
+ borderTop: '2px solid transparent',
1342
+ borderBottom: 'none',
1343
+ margin: 0,
1344
+ borderRadius: 0,
1345
+ position: 'relative',
1346
+ width: 'auto',
1347
+ '&[data-active="true"]': {
1348
+ borderColor: '#2d87f3',
1349
+ backgroundColor: '#ffffff',
1350
+ '&:after': {
1351
+ display: 'none',
1352
+ },
1353
+ '&:before': {
1354
+ content: '""',
1355
+ width: '100%',
1356
+ height: '1px',
1357
+ position: 'absolute',
1358
+ backgroundColor: '#ffffff',
1359
+ bottom: '-1px',
1360
+ },
1361
+ },
1362
+ '&:hover': {
1363
+ borderColor: '#2d87f3',
1364
+ backgroundColor: '#ffffff',
1365
+ '&:before': {
1366
+ content: '""',
1367
+ width: '100%',
1368
+ height: '1px',
1369
+ position: 'absolute',
1370
+ backgroundColor: '#ffffff',
1371
+ bottom: '-1px',
1372
+ },
1373
+ },
1374
+ '&:after': {
1375
+ content: '""',
1376
+ width: '1px',
1377
+ height: '24px',
1378
+ backgroundColor: '#E4E8EC',
1379
+ position: 'absolute',
1380
+ right: '-1px',
1381
+ },
1382
+ },
1383
+ tabLabel: {
1384
+ color: '#595959',
1385
+ fontSize: isMobile ? '14px' : '16px',
1386
+ fontWeight: 600,
1387
+ lineHeight: isMobile ? '22px' : '24px',
1388
+ },
1389
+ };
1390
+ }, [isMobile]);
1391
+ const tabConfig = useMemo(() => [
1392
+ {
1393
+ value: 'hospital',
1394
+ label: t('booking.searchPopup.hospitals'),
1395
+ },
1396
+ {
1397
+ value: 'doctor',
1398
+ label: t('booking.searchPopup.doctors'),
1399
+ },
1400
+ {
1401
+ value: 'service',
1402
+ label: t('booking.searchPopup.services'),
1403
+ },
1404
+ ...(!hideSpecialtyTab
1405
+ ? [
1406
+ {
1407
+ value: 'specialty',
1408
+ label: t('booking.searchPopup.specialties'),
1409
+ },
1410
+ ]
1411
+ : []),
1412
+ ], [hideSpecialtyTab]);
1413
+ const activeTabs = useMemo(() => {
1414
+ return (tabConfig.filter((item) => !hideTabBookingSearch.includes(item.value)) ||
1415
+ []);
1416
+ }, [hideTabBookingSearch, tabConfig]);
1417
+ return (React__default.createElement(StyledTabWrapper, { className: "booking-search-tab" },
1418
+ React__default.createElement(StyleTabContainer, null,
1419
+ React__default.createElement(Tabs, { value: currentTab, onTabChange: (tab) => {
1420
+ setCurrentTab(tab);
1421
+ }, styles: stylesTabs },
1422
+ React__default.createElement(Tabs.List, null, activeTabs.map((tab) => {
1423
+ return (React__default.createElement(Tabs.Tab, { value: tab.value, key: tab.value }, tab.label));
1424
+ }))))));
1425
+ };
1426
+
1427
+ var TypePopularKeySearch;
1428
+ (function (TypePopularKeySearch) {
1429
+ TypePopularKeySearch["doctor"] = "doctor";
1430
+ TypePopularKeySearch["service"] = "hospital_service";
1431
+ TypePopularKeySearch["hospital"] = "hospital_branch";
1432
+ })(TypePopularKeySearch || (TypePopularKeySearch = {}));
1433
+
1434
+ const ignoreCacarSpecialty = (specialties) => {
1435
+ return specialties.filter((item) => {
1436
+ if (typeof item === 'string') {
1437
+ return item !== 'cacar-api';
1438
+ }
1439
+ return (item === null || item === void 0 ? void 0 : item.id) !== 232;
1440
+ });
1441
+ };
1442
+ function useSearchBarApi({ dispatch, careApiDomain, locale = 'vi-VN', client = '', }) {
1443
+ const fetchCitiesApi = useCallback(function fetchCitiesApi(path, params = {}) {
1444
+ const url = `${careApiDomain}${path}`;
1445
+ dispatch({ type: ActionTypes.FetchCitiesStart });
1446
+ return fetch(getApiPath(url, params, locale), { method: 'GET' })
1447
+ .then((res) => res.json())
1448
+ .then((data) => {
1449
+ if (data._status !== 1 || !data._data) {
1450
+ console.log('error loading cities', data);
1451
+ return Promise.reject(data);
1452
+ }
1453
+ return data === null || data === void 0 ? void 0 : data._data;
1454
+ })
1455
+ .finally(() => dispatch({ type: ActionTypes.FetchCitiesFinish }));
1456
+ }, [locale]);
1457
+ const fetchCitiesByLocation = useCallback(function fetchCitiesByLocation({ coordinates }) {
1458
+ let params = {};
1459
+ const moreParams = {};
1460
+ if (coordinates) {
1461
+ params = {
1462
+ lat: coordinates.lat,
1463
+ lng: coordinates.lng,
1464
+ };
1465
+ }
1466
+ if (locale === 'ms-MY') {
1467
+ moreParams.noPaging = 1;
1468
+ }
1469
+ const requests = [
1470
+ fetchCitiesApi(PATHS.GET_CITY_BY_IP, Object.assign(Object.assign(Object.assign({}, params), moreParams), { hospitalActive: 1, client: CLIENT_KEY.MSD === client ? '' : client })),
1471
+ ];
1472
+ if (locale === 'zh-TW') {
1473
+ requests.push(fetchCitiesApi(PATHS.GET_CITIES_LIST, {
1474
+ noPaging: 1,
1475
+ hospitalActive: 1,
1476
+ client: CLIENT_KEY.MSD === client ? '' : client,
1477
+ }));
1478
+ }
1479
+ else {
1480
+ requests.push(fetchCitiesApi(PATHS.GET_CITIES_LIST, {
1481
+ noPaging: 1,
1482
+ hospitalActive: 1,
1483
+ }));
1484
+ }
1485
+ return Promise.all(requests)
1486
+ .then(([data1, data2]) => {
1487
+ const data = Object.assign({}, data1);
1488
+ if (data2) {
1489
+ const citiesIds = data.cities.map((c) => c.id);
1490
+ data.cities = data.cities.concat(data2.cities.filter((c) => !citiesIds.includes(c.id)));
1491
+ }
1492
+ dispatch({
1493
+ type: ActionTypes.FetchCitiesByGeoIpComplete,
1494
+ payload: data,
1495
+ });
1496
+ })
1497
+ .catch((err) => console.error('error loading cities by location', err));
1498
+ }, [locale, careApiDomain, dispatch]);
1499
+ const fetchCitiesByKeyword = useCallback(function fetchCitiesByKeyword(keyword) {
1500
+ return fetchCitiesApi(PATHS.GET_CITIES_LIST, {
1501
+ keyword,
1502
+ client,
1503
+ })
1504
+ .then((data) => {
1505
+ dispatch({
1506
+ type: ActionTypes.FetchCitiesByKeywordComplete,
1507
+ payload: data.cities,
1508
+ });
1509
+ })
1510
+ .catch((err) => console.error('error loading cities by keyword', err));
1511
+ }, [locale, careApiDomain, dispatch]);
1512
+ const fetchSearchResults = useCallback(function fetchSearchResults(searchKeywords, state, searchType, clientSlug, cacheResult) {
1513
+ const url = searchType === 'specialty'
1514
+ ? `${careApiDomain}${PATHS.GET_SEARCH_SPECIALTY}`
1515
+ : `${careApiDomain}${PATHS.GET_SEARCH_V2}`;
1516
+ dispatch({ type: ActionTypes.FetchSearchResultsStart });
1517
+ const { selectedLocation, geoLocationCoordinates, selectedSpecialty } = state;
1518
+ let cityId = '';
1519
+ if (!selectedLocation) {
1520
+ dispatch({ type: ActionTypes.FetchSearchResultsFinish });
1521
+ return;
1522
+ }
1523
+ if (selectedLocation.id === ID_OPTION_ALL_LOCATION) {
1524
+ cityId = '';
1525
+ }
1526
+ else {
1527
+ cityId = selectedLocation.id;
1528
+ }
1529
+ const lat = (geoLocationCoordinates === null || geoLocationCoordinates === void 0 ? void 0 : geoLocationCoordinates.lat) || '';
1530
+ const lng = (geoLocationCoordinates === null || geoLocationCoordinates === void 0 ? void 0 : geoLocationCoordinates.lng) || '';
1531
+ const specialty_id = (selectedSpecialty === null || selectedSpecialty === void 0 ? void 0 : selectedSpecialty.id) > 0 ? selectedSpecialty === null || selectedSpecialty === void 0 ? void 0 : selectedSpecialty.id : '';
1532
+ const keyword = searchKeywords.trim().length > SEARCH_KEYWORD_MIN_LENGTH[locale]
1533
+ ? searchKeywords.trim()
1534
+ : '';
1535
+ return fetch(getApiPath(url, Object.assign({ domain: careApiDomain, searchType: searchType || 'global', keyword: keyword, city: cityId === ID_OPTION_CURRENT_LOCATION ? '' : cityId, lat,
1536
+ lng,
1537
+ specialty_id, client_slug: CLIENT_KEY.MSD === clientSlug ? '' : clientSlug, msd: CLIENT_KEY.MSD === client ? 1 : '' }, (searchType === 'doctor' && {
1538
+ skipBooking: 1,
1539
+ })), locale), {
1540
+ method: 'GET',
1541
+ headers: {
1542
+ accept: 'version=2.0.0.0',
1543
+ },
1544
+ })
1545
+ .then((res) => res.json())
1546
+ .then((data) => {
1547
+ if (data._status !== 1 || !data._data) {
1548
+ return Promise.reject(data);
1549
+ }
1550
+ return data === null || data === void 0 ? void 0 : data._data;
1551
+ })
1552
+ .then((results) => {
1553
+ let searchesResult = [];
1554
+ if (searchType !== 'specialty') {
1555
+ if (searchType === 'doctor') {
1556
+ searchesResult = results.searches.map((item) => {
1557
+ return Object.assign(Object.assign({}, item), { specialties: ignoreCacarSpecialty((item === null || item === void 0 ? void 0 : item.specialties) || []) });
1558
+ });
1559
+ }
1560
+ else {
1561
+ searchesResult = results.searches;
1562
+ }
1563
+ }
1564
+ if (searchType === 'specialty') {
1565
+ if (keyword) {
1566
+ searchesResult = ignoreCacarSpecialty((results === null || results === void 0 ? void 0 : results.specialties) || []);
1567
+ }
1568
+ else {
1569
+ searchesResult = ignoreCacarSpecialty((results === null || results === void 0 ? void 0 : results.default) || []);
1570
+ }
1571
+ }
1572
+ dispatch({
1573
+ type: ActionTypes.FetchSearchResultsComplete,
1574
+ payload: {
1575
+ key: searchType,
1576
+ searches: searchesResult || [],
1577
+ },
1578
+ });
1579
+ if (cacheResult) {
1580
+ dispatch({
1581
+ type: ActionTypes.UpdateInitialSearchResults,
1582
+ payload: {
1583
+ key: searchType,
1584
+ searches: searchesResult || [],
1585
+ },
1586
+ });
1587
+ }
1588
+ })
1589
+ .catch((error) => {
1590
+ console.log('error loading search results', { url, error });
1591
+ })
1592
+ .finally(() => dispatch({ type: ActionTypes.FetchSearchResultsFinish }));
1593
+ }, [locale, careApiDomain, dispatch]);
1594
+ const fetchAllSpecialties = useCallback(function fetchSearchSpecialties() {
1595
+ const url = `${careApiDomain}${PATHS.GET_SEARCH_SPECIALTY}`;
1596
+ return fetch(getApiPath(url, {
1597
+ domain: careApiDomain,
1598
+ searchType: '',
1599
+ msd: CLIENT_KEY.MSD === client ? 1 : '',
1600
+ }, locale), {
1601
+ method: 'GET',
1602
+ headers: {
1603
+ accept: 'version=2.0.0.0',
1604
+ },
1605
+ })
1606
+ .then((res) => res.json())
1607
+ .then((data) => {
1608
+ if (data._status !== 1 || !data._data) {
1609
+ return Promise.reject(data);
1610
+ }
1611
+ return data === null || data === void 0 ? void 0 : data._data;
1612
+ })
1613
+ .then((results) => {
1614
+ dispatch({
1615
+ type: ActionTypes.FetchAllSpecialties,
1616
+ payload: ignoreCacarSpecialty(results.specialties || []),
1617
+ });
1618
+ })
1619
+ .catch((error) => {
1620
+ console.log('error loading search results', { url, error });
1621
+ });
1622
+ }, [locale, careApiDomain, dispatch]);
1623
+ const fetchPopularKeys = useCallback(function fetchPopularKeys(searchType) {
1624
+ const url = `${careApiDomain}${PATHS.GET_SEARCH_POPULAR_KEY}`;
1625
+ return fetch(getApiPath(url, {
1626
+ domain: careApiDomain,
1627
+ searchType: TypePopularKeySearch[searchType],
1628
+ sort_by: 'display_order',
1629
+ sort_order: 'asc',
1630
+ }, locale))
1631
+ .then((res) => res.json())
1632
+ .then((data) => {
1633
+ if (data._status !== 1 || !data._data) {
1634
+ return Promise.reject(data);
1635
+ }
1636
+ return data === null || data === void 0 ? void 0 : data._data;
1637
+ })
1638
+ .then((results) => {
1639
+ dispatch({
1640
+ type: ActionTypes.FetchPopularKeys,
1641
+ payload: results.popular_searches || [],
1642
+ });
1643
+ })
1644
+ .catch((error) => {
1645
+ console.log('error loading search results', { url, error });
1646
+ });
1647
+ }, [locale, careApiDomain, dispatch]);
1648
+ return {
1649
+ fetchCitiesByLocation,
1650
+ fetchCitiesByKeyword,
1651
+ fetchSearchResults,
1652
+ fetchAllSpecialties,
1653
+ fetchPopularKeys,
1654
+ };
1655
+ }
1656
+
1657
+ const BookingSearchBarV3 = ({ isMobile, careApiDomain, geoLocationPermission: geoLocationPermissionFromProps, geoLocationCoordinates: geoLocationCoordinatesFromProps, initialSelectedCity: initialSelectedCityFromProps, initialSearchValue = '', initTypeSearch = 'hospital', initSpecialty, careFrontDomain = '/care', isDebug = false,
1658
+ // askForGeolocationPermission = false,
1659
+ gaTrackingSearchBar, gaTrackingLocationSearch, autoCompleteDisabled = false, inputSearchPlaceholder = '', hideTabBookingSearch = [], hideSpecialtySelection = false, hideSpecialtyTab = false, hidePopularSearchKeys = false, clientSlug = '',
1660
+ // isOptionAllLocation = false,
1661
+ // hideResults = [],
1662
+ // isNavResultItem = true,
1663
+ triggerSearchWhenChangeFilter, routerPush, onGeoLocationPermissionChange,
1664
+ // onSearch,
1665
+ onChangeLocation, }) => {
1666
+ var _a;
1667
+ const { locale, t } = useTranslations();
1668
+ const wrapperRef = useRef(null);
1669
+ const searchInputDesktopRef = useRef(null);
1670
+ const searchInputMobileRef = useRef(null);
1671
+ const inputSearchSpecialtyWrapperRef = useRef(null);
1672
+ const [currentTab, setCurrentTab] = useState(initTypeSearch);
1673
+ const { geoLocationPermission: geoLocationPermissionFromHook, geoLocationCoordinates: geoLocationCoordinatesFromHook, } = useGeolocation();
1674
+ const [state, dispatch] = useReducer(reducer, initialState, (s) => (Object.assign(Object.assign({}, s), { isDebug,
1675
+ isMobile, geoLocationPermission: geoLocationPermissionFromProps ||
1676
+ geoLocationPermissionFromHook ||
1677
+ 'unset', geoLocationCoordinates: geoLocationCoordinatesFromProps ||
1678
+ geoLocationCoordinatesFromHook ||
1679
+ null, searchKeywords: initialSearchValue, initialSelectedCity: initialSelectedCityFromProps || null, selectedLocation: initialSelectedCityFromProps || s.selectedLocation || null, searchLocationKeywords: (initialSelectedCityFromProps === null || initialSelectedCityFromProps === void 0 ? void 0 : initialSelectedCityFromProps.name) || s.searchLocationKeywords, autoCompleteDisabled,
1680
+ inputSearchPlaceholder,
1681
+ locale })));
1682
+ const { navigateTo, focusedSpecialty,
1683
+ // isLoadingCities,
1684
+ // cities,
1685
+ searchKeywords, geoLocationPermission, selectedLocation,
1686
+ // selectedSpecialty,
1687
+ initialSelectedCity,
1688
+ // defaultCity,
1689
+ searchResults, isLoadingSearchResults,
1690
+ // isMobileModalOpened,
1691
+ // inputSearchPlaceholder,
1692
+ // allSpecialties,
1693
+ } = state;
1694
+ const { fetchCitiesByLocation, fetchCitiesByKeyword, fetchSearchResults, fetchAllSpecialties, fetchPopularKeys, } = useSearchBarApi({
1695
+ dispatch,
1696
+ locale,
1697
+ careApiDomain,
1698
+ client: clientSlug,
1699
+ });
1700
+ const slugs = useMemo(() => LOCALIZED_SLUGS[locale], [locale]);
1701
+ const [opened, { close, open }] = useDisclosure(false);
1702
+ const typeInformation = useMemo(() => {
1703
+ return Object.assign({ doctor: {
1704
+ name: t('booking.searchPopup.doctors'),
1705
+ icon: React__default.createElement(DoctorIcon, null),
1706
+ slug: slugs.DOCTOR,
1707
+ }, service: {
1708
+ name: t('booking.searchPopup.services'),
1709
+ icon: React__default.createElement(ServiceIcon, null),
1710
+ slug: slugs.SERVICE,
1711
+ }, hospital: {
1712
+ name: t('booking.searchPopup.hospitals'),
1713
+ icon: React__default.createElement(HospitalIcon, null),
1714
+ slug: slugs.HOSPITAL,
1715
+ } }, (!hideSpecialtyTab && {
1716
+ specialty: {
1717
+ name: t('booking.searchPopup.specialties'),
1718
+ icon: React__default.createElement(SpecialtyIcon, null),
1719
+ slug: slugs.SPECIALTIES,
1720
+ },
1721
+ }));
1722
+ }, [currentTab]);
1723
+ const debouncedFetchCitiesByKeyword = useMemo(() => debounce(fetchCitiesByKeyword, 400), [fetchCitiesByKeyword]);
1724
+ const debouncedFetchSearchResults = useMemo(() => debounce(fetchSearchResults, 400), [fetchSearchResults]);
1725
+ // function focusSearchInput() {
1726
+ // if (wrapperRef.current) {
1727
+ // wrapperRef.current
1728
+ // .querySelector<HTMLInputElement>('input[name="search-results"]')
1729
+ // ?.focus()
1730
+ // }
1731
+ // }
1732
+ const onClickSearchByKeyword = useCallback(function onClickSearchByKeyword({ locationSlug, specialtyId, } = {}) {
1733
+ var _a;
1734
+ close();
1735
+ let url = '';
1736
+ const { slug: typeSlug } = typeInformation[currentTab];
1737
+ let moreParams = '';
1738
+ const slugClientUrl = MAPPING_CLIENT_WITH_SLUG[locale][clientSlug];
1739
+ const selectedSpecialtyId = specialtyId || ((_a = state.selectedSpecialty) === null || _a === void 0 ? void 0 : _a.id) || -1;
1740
+ const selectedLocationSlug = locationSlug || (selectedLocation === null || selectedLocation === void 0 ? void 0 : selectedLocation.slug) || '';
1741
+ if ((currentTab === 'doctor' || currentTab === 'hospital') &&
1742
+ selectedSpecialtyId > 0) {
1743
+ moreParams = `&specialtyId=${selectedSpecialtyId}`;
1744
+ }
1745
+ if (currentTab === 'specialty') {
1746
+ url = `/${typeSlug}`;
1747
+ }
1748
+ else {
1749
+ url = `/${selectedLocationSlug}/${typeSlug}`;
1750
+ }
1751
+ if (slugClientUrl) {
1752
+ url += `/${slugClientUrl}`;
1753
+ }
1754
+ url += `?q=${searchKeywords}${moreParams}`;
1755
+ if (url) {
1756
+ dispatch({ type: ActionTypes.NavigateTo, payload: url });
1757
+ }
1758
+ }, [
1759
+ clientSlug,
1760
+ close,
1761
+ currentTab,
1762
+ dispatch,
1763
+ locale,
1764
+ searchKeywords,
1765
+ selectedLocation === null || selectedLocation === void 0 ? void 0 : selectedLocation.slug,
1766
+ (_a = state.selectedSpecialty) === null || _a === void 0 ? void 0 : _a.id,
1767
+ typeInformation,
1768
+ ]);
1769
+ const handleLocationClick = useCallback(function handleLocationClick(city) {
1770
+ triggerSearchWhenChangeFilter &&
1771
+ onClickSearchByKeyword({ locationSlug: city.slug });
1772
+ dispatch({ type: ActionTypes.SelectLocation, payload: city });
1773
+ if (onChangeLocation) {
1774
+ onChangeLocation(city);
1775
+ }
1776
+ }, [
1777
+ dispatch,
1778
+ isMobile,
1779
+ onChangeLocation,
1780
+ onClickSearchByKeyword,
1781
+ triggerSearchWhenChangeFilter,
1782
+ ]);
1783
+ useOutsideClick(inputSearchSpecialtyWrapperRef, () => {
1784
+ !isMobile &&
1785
+ dispatch({ type: ActionTypes.ClickOutsideInputSearchSpecialty });
1786
+ });
1787
+ useEffect(() => {
1788
+ var _a;
1789
+ if (geoLocationPermission !== 'denied' && !initialSelectedCity) {
1790
+ dispatch({
1791
+ type: ActionTypes.SelectLocation,
1792
+ payload: {
1793
+ name: t('booking.searchBar.allLocations'),
1794
+ id: ID_OPTION_ALL_LOCATION,
1795
+ slug: (_a = LOCALIZED_SLUGS[locale]) === null || _a === void 0 ? void 0 : _a.ALL,
1796
+ },
1797
+ });
1798
+ }
1799
+ if (onGeoLocationPermissionChange) {
1800
+ onGeoLocationPermissionChange(geoLocationPermission, state.geoLocationCoordinates);
1801
+ }
1802
+ if (isMobile && geoLocationPermission === 'granted' && selectedLocation) {
1803
+ dispatch({ type: ActionTypes.FocusInputSearch });
1804
+ }
1805
+ fetchCitiesByLocation({ coordinates: state.geoLocationCoordinates });
1806
+ }, [geoLocationPermission]);
1807
+ useEffect(() => {
1808
+ var _a;
1809
+ const defaultSpecialty = initSpecialty
1810
+ ? initSpecialty
1811
+ : {
1812
+ name: t('booking.searchBar.allSpecialties'),
1813
+ id: -1,
1814
+ thumbnail: '',
1815
+ total_doctor: 0,
1816
+ slug: slugs.SPECIALTIES,
1817
+ };
1818
+ if (initSpecialty) {
1819
+ if (((_a = state.selectedSpecialty) === null || _a === void 0 ? void 0 : _a.id) !== initSpecialty.id) {
1820
+ dispatch({
1821
+ type: ActionTypes.SelectSpecialty,
1822
+ payload: initSpecialty,
1823
+ });
1824
+ }
1825
+ return;
1826
+ }
1827
+ if (!state.selectedSpecialty ||
1828
+ state.selectedSpecialty.id !== defaultSpecialty.id) {
1829
+ dispatch({
1830
+ type: ActionTypes.SelectSpecialty,
1831
+ payload: defaultSpecialty,
1832
+ });
1833
+ }
1834
+ }, [initSpecialty, slugs.SPECIALTIES, t]);
1835
+ useEffect(() => {
1836
+ fetchAllSpecialties();
1837
+ }, []);
1838
+ useEffect(() => {
1839
+ fetchPopularKeys(currentTab);
1840
+ }, [currentTab]);
1841
+ useEffect(() => {
1842
+ if (navigateTo) {
1843
+ if (routerPush) {
1844
+ routerPush(navigateTo);
1845
+ }
1846
+ else {
1847
+ window.location.href = `${careFrontDomain}${navigateTo}`;
1848
+ }
1849
+ }
1850
+ }, [navigateTo]);
1851
+ useEffect(() => {
1852
+ fetchSearchResults(state.searchKeywords, state, currentTab, clientSlug, true);
1853
+ }, [currentTab]);
1854
+ useEffect(() => {
1855
+ if (opened && isMobile) {
1856
+ const timer = setTimeout(() => {
1857
+ var _a;
1858
+ (_a = searchInputMobileRef.current) === null || _a === void 0 ? void 0 : _a.focus();
1859
+ }, 150);
1860
+ return () => clearTimeout(timer);
1861
+ }
1862
+ }, [opened, isMobile]);
1863
+ const searchInputsProps = {
1864
+ type: currentTab,
1865
+ isMobile: isMobile,
1866
+ state: state,
1867
+ dispatch: dispatch,
1868
+ debouncedFetchSearchResults: debouncedFetchSearchResults,
1869
+ initalSearchValue: initialSearchValue,
1870
+ // focusSearchInput: focusSearchInput,
1871
+ onEnterSearch: onClickSearchByKeyword,
1872
+ typeInformation: typeInformation,
1873
+ trackingAttributes: gaTrackingSearchBar,
1874
+ isLoading: isLoadingSearchResults,
1875
+ hideSpecialtySelection: hideSpecialtySelection || hideSpecialtyTab,
1876
+ clientSlug: clientSlug,
1877
+ triggerSearchWhenChangeFilter,
1878
+ onChangeSpecialty: (specialty) => triggerSearchWhenChangeFilter &&
1879
+ onClickSearchByKeyword({ specialtyId: specialty.id }),
1880
+ };
1881
+ return (React__default.createElement(React__default.Fragment, null,
1882
+ React__default.createElement(StyledSearchBarWrapper, { ref: wrapperRef },
1883
+ React__default.createElement(TabSearch, { currentTab: currentTab, setCurrentTab: setCurrentTab, isMobile: isMobile, hideTabBookingSearch: hideTabBookingSearch, hideSpecialtyTab: hideSpecialtyTab }),
1884
+ React__default.createElement(StyleWrapperContainer, { className: "booking-search-container" },
1885
+ React__default.createElement(StyleSearchInputContainer, null,
1886
+ React__default.createElement(StyleSearchContent, { className: "booking-search-content" },
1887
+ React__default.createElement("div", { ref: inputSearchSpecialtyWrapperRef },
1888
+ React__default.createElement(Flex, { gap: "12px", align: "center", className: "flex-search-input" },
1889
+ React__default.createElement(SearchInputs, Object.assign({}, searchInputsProps, { ref: searchInputDesktopRef, onFocusInput: () => isMobile && open() })),
1890
+ currentTab !== 'specialty' && (React__default.createElement(SearchLocation, { state: state, isMobile: isMobile, dispatch: dispatch, debouncedFetchCitiesByKeyword: debouncedFetchCitiesByKeyword, selectedLocation: selectedLocation, onLocationClick: handleLocationClick, trackingAttributes: gaTrackingLocationSearch })),
1891
+ !isMobile && (React__default.createElement(Button, { size: "lg", variant: "primary", onClick: () => onClickSearchByKeyword(), styles: {
1892
+ root: {
1893
+ height: '48px',
1894
+ minWidth: '120px',
1895
+ borderRadius: '12px',
1896
+ },
1897
+ } }, t('booking.searchBar.searchButton')))),
1898
+ !hidePopularSearchKeys &&
1899
+ currentTab !== 'specialty' &&
1900
+ state.popularKeys.length > 0 && (React__default.createElement(SearchTag, { type: currentTab, state: state, typeInformation: typeInformation, dispatch: dispatch })),
1901
+ currentTab === 'specialty' &&
1902
+ focusedSpecialty === 'search' && (React__default.createElement(SearchResultSpecialties, { state: state, isMobile: isMobile, dispatch: dispatch, specialties: (searchResults === null || searchResults === void 0 ? void 0 : searchResults.specialty) || [], isLoading: isLoadingSearchResults }))))))),
1903
+ isMobile && (React__default.createElement(ModalSearchResult, { keepMounted: true, opened: opened, onClose: close, closeModal: close, searchInputEle: React__default.createElement(Flex, { align: 'center', gap: 8 },
1904
+ React__default.createElement(SearchInputs, Object.assign({}, searchInputsProps, { onlyShowSearchBox: true, ref: searchInputMobileRef })),
1905
+ React__default.createElement(Button, { variant: "primary", leftIcon: React__default.createElement(Search, { size: 20, color: '#fff' }), onClick: () => onClickSearchByKeyword(), styles: {
1906
+ root: {
1907
+ borderRadius: '12px',
1908
+ },
1909
+ } })) },
1910
+ React__default.createElement(Box, { sx: {
1911
+ marginLeft: -16,
1912
+ marginRight: -16,
1913
+ } },
1914
+ React__default.createElement(SearchResultContent, { type: currentTab, state: state, dispatch: dispatch, isLoading: isLoadingSearchResults, typeInformation: typeInformation, clientSlug: clientSlug }))))));
1915
+ };
1916
+
1917
+ const StyledTextDivider = styled.div `
1918
+ background-color: var(--neutral50);
1919
+ padding: 12px 0;
1920
+ box-shadow: inset 0px 1px 0px #e4e8ec;
1921
+
1922
+ > * {
1923
+ display: grid;
1924
+ grid-template-columns: 32px 1fr;
1925
+ align-content: center;
1926
+
1927
+ p {
1928
+ font-weight: 600;
1929
+ }
1930
+ }
1931
+
1932
+ .icon-wrapper {
1933
+ display: flex;
1934
+ align-items: center;
1935
+ }
1936
+ `;
1937
+ const TextDivider = ({ children, icon, className, style }) => (React__default.createElement(StyledTextDivider, { style: style, className: className },
1938
+ React__default.createElement(Container, null,
1939
+ React__default.createElement("div", { className: "icon-wrapper" }, icon),
1940
+ React__default.createElement(Text, { size: "c1", color: "var(--neutral800)" }, children))));
1941
+
1942
+ export { BookingSearchBarV3 as B, TextDivider as T };