@hhgtech/hhg-components 1.29.87 → 1.29.89

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 (459) hide show
  1. package/build/{LastPeriod-671d5143.js → LastPeriod-c8c46da3.js} +1 -1
  2. package/build/MobileBottomNavigationIcon-efacfc0c.js +193 -0
  3. package/build/{WhatsApp-07eb4e4a.js → WhatsApp-8a1d6d0c.js} +1 -1
  4. package/build/adapters.js +18 -16
  5. package/build/atoms.js +47 -45
  6. package/build/babyGrowth.js +82 -80
  7. package/build/cache.js +2 -2
  8. package/build/care.js +28 -25
  9. package/build/careBookingSearchBar.js +1594 -0
  10. package/build/careBookingSearchBarV2.js +1665 -0
  11. package/build/components.js +125 -115
  12. package/build/{constants-970e6cf6.js → constants-f5c5e2ae.js} +1 -1
  13. package/build/constants.js +3 -3
  14. package/build/constantsDomainLocales.js +1 -1
  15. package/build/constantsRiskScreener.js +2 -2
  16. package/build/constantsSite.js +2 -2
  17. package/build/{core-bcde5ba8.js → core-58a245c5.js} +1 -1
  18. package/build/{dataTransform-567bc0c2.js → dataTransform-9ec385e3.js} +1 -1
  19. package/build/ecom.js +4 -4
  20. package/build/editor-40386fe7.js +986 -0
  21. package/build/embeddedHeathToolCards_babyGrowth.js +22 -20
  22. package/build/embeddedHeathToolCards_babyPoop.js +18 -16
  23. package/build/embeddedHeathToolCards_babyVaccine.js +21 -19
  24. package/build/embeddedHeathToolCards_bmi_bmi.js +25 -23
  25. package/build/embeddedHeathToolCards_bmrBmr.js +25 -23
  26. package/build/embeddedHeathToolCards_dueDate_dueDate.js +21 -19
  27. package/build/embeddedHeathToolCards_ovulation_ovulation.js +21 -19
  28. package/build/embeddedHeathToolCards_pwg_pwg.js +26 -24
  29. package/build/embeddedHeathToolCards_targetHeartRate.js +27 -25
  30. package/build/esm/{LastPeriod-ebfcf053.js → LastPeriod-46d6c03f.js} +1 -1
  31. package/build/esm/MobileBottomNavigationIcon-ae6490d7.js +185 -0
  32. package/build/esm/{WhatsApp-c6c8eded.js → WhatsApp-ed8ce0f2.js} +1 -1
  33. package/build/esm/adapters.js +18 -16
  34. package/build/esm/atoms.js +44 -42
  35. package/build/esm/babyGrowth.js +82 -80
  36. package/build/esm/cache.js +2 -2
  37. package/build/esm/care.js +26 -23
  38. package/build/esm/careBookingSearchBar.js +1582 -0
  39. package/build/esm/careBookingSearchBarV2.js +1655 -0
  40. package/build/esm/components.js +93 -83
  41. package/build/esm/{constants-bdf5e358.js → constants-e9ebe043.js} +1 -1
  42. package/build/esm/constants.js +3 -3
  43. package/build/esm/constantsDomainLocales.js +1 -1
  44. package/build/esm/constantsRiskScreener.js +2 -2
  45. package/build/esm/constantsSite.js +2 -2
  46. package/build/esm/{core-b4f1131e.js → core-6d8629c2.js} +1 -1
  47. package/build/esm/{dataTransform-ad9d785b.js → dataTransform-2023858d.js} +2 -2
  48. package/build/esm/ecom.js +4 -4
  49. package/build/esm/editor-82c3d476.js +959 -0
  50. package/build/esm/embeddedHeathToolCards_babyGrowth.js +22 -20
  51. package/build/esm/embeddedHeathToolCards_babyPoop.js +18 -16
  52. package/build/esm/embeddedHeathToolCards_babyVaccine.js +21 -19
  53. package/build/esm/embeddedHeathToolCards_bmi_bmi.js +25 -23
  54. package/build/esm/embeddedHeathToolCards_bmrBmr.js +25 -23
  55. package/build/esm/embeddedHeathToolCards_dueDate_dueDate.js +21 -19
  56. package/build/esm/embeddedHeathToolCards_ovulation_ovulation.js +21 -19
  57. package/build/esm/embeddedHeathToolCards_pwg_pwg.js +26 -24
  58. package/build/esm/embeddedHeathToolCards_targetHeartRate.js +27 -25
  59. package/build/esm/{fixedBottomAdBlock-e5747eb3.js → fixedBottomAdBlock-2af1606f.js} +26 -662
  60. package/build/esm/footer.js +20 -18
  61. package/build/esm/gAssets.js +2 -2
  62. package/build/esm/healthToolsCardWrapper.js +17 -15
  63. package/build/esm/healthToolsForm.js +33 -31
  64. package/build/esm/hooks.js +15 -15
  65. package/build/esm/i18n.js +2 -2
  66. package/build/esm/i18nV2.js +2 -2
  67. package/build/esm/{index-9d2cc0b2.js → index-04ba5caa.js} +1 -1
  68. package/build/esm/{index-8f953b02.js → index-082a24ae.js} +12 -11
  69. package/build/esm/{index-46a2a5d7.js → index-1313a7ac.js} +12 -11
  70. package/build/esm/{index-1322446c.js → index-13783871.js} +2 -2
  71. package/build/esm/{index-3685677f.js → index-16a4f1c7.js} +16 -15
  72. package/build/esm/{index-cc650c45.js → index-19f27bd3.js} +2 -2
  73. package/build/esm/{index-7c6e33e0.js → index-1a2bc551.js} +2 -2
  74. package/build/esm/{index-029c478e.js → index-275c8526.js} +14 -13
  75. package/build/esm/{index-e7c62f10.js → index-277566f7.js} +1 -1
  76. package/build/esm/{index-240e2930.js → index-2ac50d8f.js} +15 -14
  77. package/build/esm/{index-0f6906bb.js → index-2c4a2d31.js} +1 -1
  78. package/build/esm/{index-69dd7596.js → index-32a968a1.js} +6 -6
  79. package/build/esm/{index-0025652b.js → index-346fd194.js} +21 -19
  80. package/build/esm/{index-d4941998.js → index-38b87b21.js} +12 -11
  81. package/build/esm/{index-27a9a555.js → index-46c22744.js} +6 -6
  82. package/build/esm/index-4cf37916.js +22 -0
  83. package/build/esm/{index-5407e81e.js → index-4d27d02e.js} +15 -14
  84. package/build/esm/{index-dbb0b265.js → index-52d04cc5.js} +7 -7
  85. package/build/esm/index-538ca8aa.js +860 -0
  86. package/build/esm/{index-691f32bb.js → index-57da0f13.js} +16 -88
  87. package/build/esm/{index-2449d246.js → index-5e17f985.js} +16 -15
  88. package/build/esm/{index-ffd3c918.js → index-605eed95.js} +35 -800
  89. package/build/esm/{index-b1022535.js → index-628c5e84.js} +2 -2
  90. package/build/esm/{index-0cc19c33.js → index-64b1cd5c.js} +1 -1
  91. package/build/esm/index-673fd5bd.js +1264 -0
  92. package/build/esm/{index-804dcc5a.js → index-70883b48.js} +17 -16
  93. package/build/esm/{index-32114d1a.js → index-71c8b83f.js} +3 -142
  94. package/build/esm/{index-1f077f71.js → index-72c269cf.js} +3 -3
  95. package/build/esm/index-7ad9db02.js +1030 -0
  96. package/build/esm/{index-394c352b.js → index-7ca4ec53.js} +15 -14
  97. package/build/esm/{index-f56ad865.js → index-7decdf27.js} +1 -1
  98. package/build/esm/index-7e95ba03.js +144 -0
  99. package/build/esm/{index-0dd98ba5.js → index-84b3ef3d.js} +3 -3
  100. package/build/esm/{index-4e0ef954.js → index-8b9c7b45.js} +3 -3
  101. package/build/esm/{index-b97f14ca.js → index-930b0a77.js} +16 -15
  102. package/build/esm/{index-79b8f3a0.js → index-93c8863d.js} +2 -2
  103. package/build/esm/{index-16ed17c9.js → index-949f771c.js} +6 -6
  104. package/build/esm/{index-22dbd9d2.js → index-99551970.js} +2 -2
  105. package/build/esm/{index-bf7b2785.js → index-9c268a93.js} +2 -2
  106. package/build/esm/{index-8801ddf9.js → index-9d7d3a53.js} +4 -4
  107. package/build/esm/{index-02019218.js → index-9e220aaa.js} +2 -2
  108. package/build/esm/{index-f4468b77.js → index-a424a33d.js} +3 -3
  109. package/build/esm/{index-b4866578.js → index-a54b6536.js} +14 -13
  110. package/build/esm/{index-53ca94ab.js → index-b09ced58.js} +1 -1
  111. package/build/esm/{index-b13c7add.js → index-b5ed732f.js} +5 -5
  112. package/build/esm/{index-68f3752c.js → index-b867d267.js} +1 -1
  113. package/build/esm/{index-d72f98d1.js → index-c4b04b5f.js} +1 -1
  114. package/build/esm/{index-7aa8728c.js → index-c5286b89.js} +12 -11
  115. package/build/esm/{index-151b9162.js → index-cbb45a5d.js} +2 -2
  116. package/build/esm/{index-2e4a2f44.js → index-d4dcfb68.js} +2 -2
  117. package/build/esm/{index-d7019532.js → index-dec46974.js} +20 -17
  118. package/build/esm/index-e19da15e.js +468 -0
  119. package/build/esm/{index-63825539.js → index-e1d35fec.js} +7 -6
  120. package/build/esm/{index-5eda6b48.js → index-e477c2a3.js} +23 -19
  121. package/build/esm/{index-d0d73bc9.js → index-ed292946.js} +2 -2
  122. package/build/esm/index-f3f06437.js +281 -0
  123. package/build/esm/index.js +118 -98
  124. package/build/esm/index.styles-25454e9c.js +62 -0
  125. package/build/esm/interfaces/types/Subot.d.ts +3 -3
  126. package/build/esm/{labelSorting-eaf1959d.js → labelSorting-27ecf45e.js} +4 -4
  127. package/build/esm/lead.js +22 -20
  128. package/build/esm/{logoIcon-cb9c1f10.js → logoIcon-ef6d9e4c.js} +2 -2
  129. package/build/esm/mantine.js +24 -22
  130. package/build/esm/misc.js +18 -18
  131. package/build/esm/miscGetDynamicHealthTool.js +7 -7
  132. package/build/esm/miscGetSocialList.js +12 -12
  133. package/build/esm/miscScreenSizeContext.js +1 -1
  134. package/build/esm/mobileBottomNavigation.js +19 -0
  135. package/build/esm/mobileBottomNavigationIcon.js +10 -0
  136. package/build/esm/molecules.js +71 -64
  137. package/build/esm/moleculesArticleCard.js +85 -0
  138. package/build/esm/moleculesArticleCardV2.js +171 -0
  139. package/build/esm/navigation.js +40 -35
  140. package/build/esm/navigationLogoutPopup.js +116 -0
  141. package/build/esm/navigationProfileButton.js +43 -0
  142. package/build/esm/{normalizeLink-c66d19ce.js → normalizeLink-d756e5e6.js} +1 -1
  143. package/build/esm/onboardingV2.js +27 -25
  144. package/build/esm/organisms.js +46 -41
  145. package/build/esm/post-86117110.js +267 -0
  146. package/build/esm/profileNavigation.js +441 -0
  147. package/build/esm/progressBar.js +250 -0
  148. package/build/esm/pwg.js +21 -19
  149. package/build/esm/{routing-f3629b7f.js → routing-b81b8f17.js} +1 -1
  150. package/build/esm/subot.js +29 -27
  151. package/build/esm/surveyOrPremiumBanner.js +30 -28
  152. package/build/esm/surveyQuestionCard.js +10 -10
  153. package/build/esm/{surveyThankyouCard-169d4956.js → surveyThankyouCard-1b30aa0b.js} +5 -5
  154. package/build/esm/together.js +53 -44
  155. package/build/esm/togetherApiUtils.js +4 -4
  156. package/build/esm/togetherAtoms.js +29 -26
  157. package/build/esm/togetherComponentGlobalContext.js +4 -4
  158. package/build/esm/togetherMolecules.js +56 -47
  159. package/build/esm/togetherMoleculesCardAuthor.js +41 -0
  160. package/build/esm/togetherMoleculesPostImagePreview.js +21 -0
  161. package/build/esm/togetherMoleculesProfileDetail.js +53 -0
  162. package/build/esm/togetherOrganisms.js +53 -44
  163. package/build/esm/togetherRichTextEditor.js +27 -0
  164. package/build/esm/togetherShareBox.js +305 -0
  165. package/build/esm/{treePopoverMenu-32a26245.js → treePopoverMenu-04ded0ef.js} +18 -17
  166. package/build/esm/types-3eb97d85.js +44 -0
  167. package/build/esm/types.js +2 -2
  168. package/build/esm/{useCategory-0995f0b4.js → useCategory-391ffab0.js} +5 -5
  169. package/build/esm/{useHealthToolCache-7387a56d.js → useHealthToolCache-931ab3ca.js} +1 -1
  170. package/build/esm/{useMantineLocale-7d4ef853.js → useMantineLocale-b29ca68b.js} +5 -5
  171. package/build/esm/{usePlacesAutocomplete-7f23b876.js → usePlacesAutocomplete-91226a4d.js} +1 -1
  172. package/build/esm/useTogetherAuthRequiredAction.js +4 -4
  173. package/build/esm/{useTranslations-12762455.js → useTranslations-b66d9f2b.js} +1 -1
  174. package/build/esm/utils-92e2bc22.js +206 -0
  175. package/build/esm/{utils-24afe0f1.js → utils-f4b925d7.js} +2 -2
  176. package/build/esm/{utils-aa5734af.js → utils-f873578b.js} +4 -4
  177. package/build/esm/vaccination.js +20 -18
  178. package/build/{fixedBottomAdBlock-4db856c1.js → fixedBottomAdBlock-605a8692.js} +49 -691
  179. package/build/footer.js +20 -18
  180. package/build/gAssets.js +2 -2
  181. package/build/healthToolsCardWrapper.js +17 -15
  182. package/build/healthToolsForm.js +33 -31
  183. package/build/hooks.js +15 -15
  184. package/build/i18n.js +1 -1
  185. package/build/i18nV2.js +1 -1
  186. package/build/{index-a91bff81.js → index-0afde39e.js} +2 -2
  187. package/build/{index-5d3563a4.js → index-0cb2de9d.js} +3 -3
  188. package/build/{index-922333dc.js → index-188e2316.js} +15 -14
  189. package/build/index-1b06e81f.js +151 -0
  190. package/build/{index-46a71da2.js → index-1cdccd4e.js} +2 -2
  191. package/build/index-27e50de1.js +478 -0
  192. package/build/{index-ad9d0b0a.js → index-32abfb15.js} +12 -11
  193. package/build/{index-82a0b931.js → index-36723718.js} +6 -6
  194. package/build/{index-ce1b7f76.js → index-36ba9947.js} +2 -2
  195. package/build/{index-c09c64b7.js → index-3c593ede.js} +6 -6
  196. package/build/{index-0450bf33.js → index-4bf6b5da.js} +24 -99
  197. package/build/{index-281daa83.js → index-4fd69136.js} +16 -15
  198. package/build/{index-4c15723a.js → index-526cee72.js} +6 -6
  199. package/build/{index-b64c981f.js → index-549b9e8c.js} +1 -1
  200. package/build/{index-5e984f33.js → index-5b52b076.js} +38 -34
  201. package/build/{index-776f2478.js → index-5dbd317c.js} +34 -33
  202. package/build/index-5dcd87b7.js +289 -0
  203. package/build/{index-169bae02.js → index-648aac83.js} +2 -2
  204. package/build/{index-34ca22f2.js → index-6b7b4292.js} +3 -3
  205. package/build/{index-743255db.js → index-6b95442c.js} +2 -2
  206. package/build/{index-a5526d77.js → index-6b9e8dda.js} +3 -3
  207. package/build/{index-e256aef8.js → index-767f9ac6.js} +2 -2
  208. package/build/{index-deec7e58.js → index-7ce45455.js} +16 -15
  209. package/build/{index-6223ea5f.js → index-81ff6094.js} +7 -7
  210. package/build/{index-0236dd90.js → index-86ecfc48.js} +3 -3
  211. package/build/{index-ddc36398.js → index-8a19ce1b.js} +96 -864
  212. package/build/{index-e3bbbf6e.js → index-8d9663db.js} +9 -8
  213. package/build/{index-ffc38f11.js → index-9151d357.js} +2 -2
  214. package/build/index-922020ed.js +1045 -0
  215. package/build/{index-ac40492f.js → index-a76596ef.js} +1 -1
  216. package/build/{index-0485f54b.js → index-a839c6ca.js} +3 -3
  217. package/build/{index-477ad803.js → index-a8705384.js} +1 -1
  218. package/build/{index-418220e9.js → index-aad249ab.js} +2 -2
  219. package/build/{index-d4801d2c.js → index-af48fea3.js} +5 -5
  220. package/build/{index-41b74c44.js → index-b04c5212.js} +16 -15
  221. package/build/{index-7072811b.js → index-b4fd3100.js} +1 -1
  222. package/build/{index-d903234f.js → index-be0a9d63.js} +17 -16
  223. package/build/{index-b502b7a7.js → index-be262a50.js} +2 -2
  224. package/build/index-becfec7a.js +1307 -0
  225. package/build/index-bf3796aa.js +870 -0
  226. package/build/{index-8a509409.js → index-cc4ce0c4.js} +1 -1
  227. package/build/{index-e6f93e28.js → index-cd0db938.js} +34 -31
  228. package/build/{index-e2ca51d6.js → index-d0610b0f.js} +14 -13
  229. package/build/{index-28f47f15.js → index-d393d57e.js} +1 -1
  230. package/build/{index-538200cd.js → index-d471ff2d.js} +1 -1
  231. package/build/{index-4e5179a2.js → index-d5d9ceb9.js} +15 -14
  232. package/build/{index-cd94cd77.js → index-de26b5d1.js} +12 -11
  233. package/build/{index-3efdbdaf.js → index-dec3abcf.js} +15 -14
  234. package/build/{index-b2757afe.js → index-e018af91.js} +31 -29
  235. package/build/index-e8dc7fdb.js +29 -0
  236. package/build/{index-a0ee5e9f.js → index-f30e56f1.js} +12 -11
  237. package/build/{index-b7e7f5d7.js → index-f6b32484.js} +12 -11
  238. package/build/{index-8e183dab.js → index-f91ed3be.js} +4 -4
  239. package/build/{index-38d090ba.js → index-faa2908c.js} +3 -143
  240. package/build/{index-212720b1.js → index-fbb369ff.js} +1 -1
  241. package/build/{index-3c06bcfd.js → index-fde11604.js} +2 -2
  242. package/build/index.js +182 -162
  243. package/build/index.styles-9031f6d6.js +65 -0
  244. package/build/interfaces/types/Subot.d.ts +3 -3
  245. package/build/{labelSorting-8542da52.js → labelSorting-11165c8e.js} +4 -4
  246. package/build/lead.js +22 -20
  247. package/build/{logoIcon-bd143b65.js → logoIcon-f3283bfd.js} +2 -2
  248. package/build/mantine.js +20 -18
  249. package/build/misc.js +18 -18
  250. package/build/miscGetDynamicHealthTool.js +7 -7
  251. package/build/miscGetSocialList.js +12 -12
  252. package/build/miscScreenSizeContext.js +1 -1
  253. package/build/mobileBottomNavigation.js +27 -0
  254. package/build/mobileBottomNavigationIcon.js +18 -0
  255. package/build/molecules.js +76 -69
  256. package/build/moleculesArticleCard.js +93 -0
  257. package/build/moleculesArticleCardV2.js +180 -0
  258. package/build/navigation.js +40 -35
  259. package/build/navigationLogoutPopup.js +125 -0
  260. package/build/navigationProfileButton.js +51 -0
  261. package/build/onboardingV2.js +29 -27
  262. package/build/organisms.js +49 -44
  263. package/build/post-0fec66f4.js +303 -0
  264. package/build/profileNavigation.js +450 -0
  265. package/build/progressBar.js +260 -0
  266. package/build/pwg.js +21 -19
  267. package/build/{routing-90dba95d.js → routing-7a9c8608.js} +1 -1
  268. package/build/subot.js +28 -26
  269. package/build/surveyOrPremiumBanner.js +30 -28
  270. package/build/surveyQuestionCard.js +10 -10
  271. package/build/{surveyThankyouCard-9aad36f8.js → surveyThankyouCard-db73c893.js} +5 -5
  272. package/build/together.js +77 -68
  273. package/build/togetherApiUtils.js +4 -4
  274. package/build/togetherAtoms.js +29 -26
  275. package/build/togetherComponentGlobalContext.js +4 -4
  276. package/build/togetherMolecules.js +79 -70
  277. package/build/togetherMoleculesCardAuthor.js +49 -0
  278. package/build/togetherMoleculesPostImagePreview.js +29 -0
  279. package/build/togetherMoleculesProfileDetail.js +70 -0
  280. package/build/togetherOrganisms.js +53 -44
  281. package/build/togetherRichTextEditor.js +36 -0
  282. package/build/togetherShareBox.js +314 -0
  283. package/build/{treePopoverMenu-3f7e6767.js → treePopoverMenu-61ebd05c.js} +18 -17
  284. package/build/types-57052089.js +52 -0
  285. package/build/types.js +2 -2
  286. package/build/{useCategory-a808e6a6.js → useCategory-d9f73b82.js} +5 -5
  287. package/build/{useHealthToolCache-42222cc2.js → useHealthToolCache-4b5bfb11.js} +1 -1
  288. package/build/{useMantineLocale-8df90961.js → useMantineLocale-cc272195.js} +5 -5
  289. package/build/{usePlacesAutocomplete-4e21e680.js → usePlacesAutocomplete-a0156f14.js} +1 -1
  290. package/build/useTogetherAuthRequiredAction.js +4 -4
  291. package/build/{useTranslations-6363932f.js → useTranslations-8a9fa84d.js} +1 -1
  292. package/build/{utils-87deb74b.js → utils-251b2841.js} +3 -3
  293. package/build/{utils-4058dee5.js → utils-c29214c6.js} +2 -2
  294. package/build/utils-f47b2d2d.js +229 -0
  295. package/build/vaccination.js +24 -22
  296. package/package.json +1 -1
  297. package/build/esm/index-43aaedbb.js +0 -5060
  298. package/build/esm/types-996bf08e.js +0 -3433
  299. package/build/index-05199dd8.js +0 -5123
  300. package/build/types-89c90eb3.js +0 -3447
  301. /package/build/{BMI_BOYS.percentile.monthly-00dc2939.js → BMI_BOYS.percentile.monthly-5f29289b.js} +0 -0
  302. /package/build/{BMI_BOYS.percentile.weekly-eebf395b.js → BMI_BOYS.percentile.weekly-53584232.js} +0 -0
  303. /package/build/{BMI_BOYS.percentile.yearly-fa98b4c9.js → BMI_BOYS.percentile.yearly-84aaf8fb.js} +0 -0
  304. /package/build/{BMI_BOYS.zscore.monthly-cc66463f.js → BMI_BOYS.zscore.monthly-76d7fd0e.js} +0 -0
  305. /package/build/{BMI_BOYS.zscore.weekly-e1c85879.js → BMI_BOYS.zscore.weekly-ed3d66f2.js} +0 -0
  306. /package/build/{BMI_BOYS.zscore.yearly-88d58724.js → BMI_BOYS.zscore.yearly-7e74f0e8.js} +0 -0
  307. /package/build/{BMI_GIRLS.percentile.monthly-82aff448.js → BMI_GIRLS.percentile.monthly-6973d8b0.js} +0 -0
  308. /package/build/{BMI_GIRLS.percentile.weekly-c5767e28.js → BMI_GIRLS.percentile.weekly-a873a4e6.js} +0 -0
  309. /package/build/{BMI_GIRLS.percentile.yearly-e45d9106.js → BMI_GIRLS.percentile.yearly-e86761bb.js} +0 -0
  310. /package/build/{BMI_GIRLS.zscore.monthly-120aa581.js → BMI_GIRLS.zscore.monthly-9a12fa84.js} +0 -0
  311. /package/build/{BMI_GIRLS.zscore.weekly-2f64347e.js → BMI_GIRLS.zscore.weekly-5936ed5b.js} +0 -0
  312. /package/build/{BMI_GIRLS.zscore.yearly-ed842624.js → BMI_GIRLS.zscore.yearly-d40d8356.js} +0 -0
  313. /package/build/{ChevronDown-89002c32.js → ChevronDown-a6775d48.js} +0 -0
  314. /package/build/{Close-5e8e15ce.js → Close-9fa735bc.js} +0 -0
  315. /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-b1965149.js → HEAD CIRCUM_BOYS.percentile.monthly-873a839f.js} +0 -0
  316. /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-7c8df376.js → HEAD CIRCUM_BOYS.percentile.weekly-bbe3965d.js} +0 -0
  317. /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-ebafd6df.js → HEAD CIRCUM_BOYS.percentile.yearly-645dfc78.js} +0 -0
  318. /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-b5a0cdd1.js → HEAD CIRCUM_BOYS.zscore.monthly-9fe137bf.js} +0 -0
  319. /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-4c32261f.js → HEAD CIRCUM_BOYS.zscore.weekly-2ccb15fb.js} +0 -0
  320. /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-7642a6b6.js → HEAD CIRCUM_BOYS.zscore.yearly-48aed724.js} +0 -0
  321. /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-37a5b7b2.js → HEAD CIRCUM_GIRLS.percentile.monthly-d99d6d30.js} +0 -0
  322. /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-909278a6.js → HEAD CIRCUM_GIRLS.percentile.weekly-8a49b504.js} +0 -0
  323. /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-bd7732f5.js → HEAD CIRCUM_GIRLS.percentile.yearly-d747b0cd.js} +0 -0
  324. /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-5a1dc106.js → HEAD CIRCUM_GIRLS.zscore.monthly-8ef18721.js} +0 -0
  325. /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-19531ac2.js → HEAD CIRCUM_GIRLS.zscore.weekly-853cca20.js} +0 -0
  326. /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-3e9b57e2.js → HEAD CIRCUM_GIRLS.zscore.yearly-4d5b2175.js} +0 -0
  327. /package/build/{HEIGHT_BOYS.percentile.monthly-75d3928f.js → HEIGHT_BOYS.percentile.monthly-070590b8.js} +0 -0
  328. /package/build/{HEIGHT_BOYS.percentile.weekly-49d0eac1.js → HEIGHT_BOYS.percentile.weekly-56741428.js} +0 -0
  329. /package/build/{HEIGHT_BOYS.percentile.yearly-ca043db8.js → HEIGHT_BOYS.percentile.yearly-9c81f767.js} +0 -0
  330. /package/build/{HEIGHT_BOYS.zscore.monthly-0ef5a0b0.js → HEIGHT_BOYS.zscore.monthly-729982c3.js} +0 -0
  331. /package/build/{HEIGHT_BOYS.zscore.weekly-897641f9.js → HEIGHT_BOYS.zscore.weekly-ddb206fb.js} +0 -0
  332. /package/build/{HEIGHT_BOYS.zscore.yearly-2f57ee05.js → HEIGHT_BOYS.zscore.yearly-5fc7ea6a.js} +0 -0
  333. /package/build/{HEIGHT_GIRLS.percentile.monthly-35a2bd2b.js → HEIGHT_GIRLS.percentile.monthly-8cbc8d18.js} +0 -0
  334. /package/build/{HEIGHT_GIRLS.percentile.weekly-6682008a.js → HEIGHT_GIRLS.percentile.weekly-7145e94f.js} +0 -0
  335. /package/build/{HEIGHT_GIRLS.percentile.yearly-1490cd28.js → HEIGHT_GIRLS.percentile.yearly-ab0e4f4e.js} +0 -0
  336. /package/build/{HEIGHT_GIRLS.zscore.monthly-ab0ba051.js → HEIGHT_GIRLS.zscore.monthly-b851b1d7.js} +0 -0
  337. /package/build/{HEIGHT_GIRLS.zscore.weekly-8cd489df.js → HEIGHT_GIRLS.zscore.weekly-98aef3cf.js} +0 -0
  338. /package/build/{HEIGHT_GIRLS.zscore.yearly-547aa680.js → HEIGHT_GIRLS.zscore.yearly-65d990f7.js} +0 -0
  339. /package/build/{Locale-126bf6bd.js → Locale-07aceee9.js} +0 -0
  340. /package/build/{Visible-7090d851.js → Visible-ddeaf4cc.js} +0 -0
  341. /package/build/{WEIGHT_BOYS.percentile.monthly-2c6444a6.js → WEIGHT_BOYS.percentile.monthly-0ce96694.js} +0 -0
  342. /package/build/{WEIGHT_BOYS.percentile.weekly-d43234b7.js → WEIGHT_BOYS.percentile.weekly-b5397f20.js} +0 -0
  343. /package/build/{WEIGHT_BOYS.percentile.yearly-361c6438.js → WEIGHT_BOYS.percentile.yearly-80cccd42.js} +0 -0
  344. /package/build/{WEIGHT_BOYS.zscore.monthly-1a56d8b2.js → WEIGHT_BOYS.zscore.monthly-12907f1f.js} +0 -0
  345. /package/build/{WEIGHT_BOYS.zscore.weekly-b1548cdf.js → WEIGHT_BOYS.zscore.weekly-a1af17eb.js} +0 -0
  346. /package/build/{WEIGHT_BOYS.zscore.yearly-17b0334c.js → WEIGHT_BOYS.zscore.yearly-2649ff58.js} +0 -0
  347. /package/build/{WEIGHT_GIRLS.percentile.monthly-64e137c6.js → WEIGHT_GIRLS.percentile.monthly-222d7201.js} +0 -0
  348. /package/build/{WEIGHT_GIRLS.percentile.weekly-98c2fb5d.js → WEIGHT_GIRLS.percentile.weekly-2997b740.js} +0 -0
  349. /package/build/{WEIGHT_GIRLS.percentile.yearly-533341f7.js → WEIGHT_GIRLS.percentile.yearly-3dc5928a.js} +0 -0
  350. /package/build/{WEIGHT_GIRLS.zscore.monthly-d17a0d64.js → WEIGHT_GIRLS.zscore.monthly-742b7617.js} +0 -0
  351. /package/build/{WEIGHT_GIRLS.zscore.weekly-36a412aa.js → WEIGHT_GIRLS.zscore.weekly-5ee1ca40.js} +0 -0
  352. /package/build/{WEIGHT_GIRLS.zscore.yearly-68f9f66b.js → WEIGHT_GIRLS.zscore.yearly-d6ca7d60.js} +0 -0
  353. /package/build/{animation-fce92928.js → animation-a1ed71d8.js} +0 -0
  354. /package/build/{cart-d32faa71.js → cart-7bc1b943.js} +0 -0
  355. /package/build/{constants-83e17a08.js → constants-4cad9f4d.js} +0 -0
  356. /package/build/{constants-ef1d9e50.js → constants-81b95117.js} +0 -0
  357. /package/build/{constants-6b5e2780.js → constants-c3b9c9a9.js} +0 -0
  358. /package/build/{dataTransform-64f3ba4c.js → dataTransform-867c472c.js} +0 -0
  359. /package/build/{doctor-2a2b78b0.js → doctor-dca6d1b2.js} +0 -0
  360. /package/build/esm/{BMI_BOYS.percentile.monthly-71f6615e.js → BMI_BOYS.percentile.monthly-2388d98f.js} +0 -0
  361. /package/build/esm/{BMI_BOYS.percentile.weekly-8729108b.js → BMI_BOYS.percentile.weekly-8ebe6955.js} +0 -0
  362. /package/build/esm/{BMI_BOYS.percentile.yearly-fe8dc27c.js → BMI_BOYS.percentile.yearly-3a97e95b.js} +0 -0
  363. /package/build/esm/{BMI_BOYS.zscore.monthly-aa14f52a.js → BMI_BOYS.zscore.monthly-f7572dcd.js} +0 -0
  364. /package/build/esm/{BMI_BOYS.zscore.weekly-6857bca0.js → BMI_BOYS.zscore.weekly-d6281906.js} +0 -0
  365. /package/build/esm/{BMI_BOYS.zscore.yearly-05894e8d.js → BMI_BOYS.zscore.yearly-fbebaaca.js} +0 -0
  366. /package/build/esm/{BMI_GIRLS.percentile.monthly-99639eee.js → BMI_GIRLS.percentile.monthly-a75c8880.js} +0 -0
  367. /package/build/esm/{BMI_GIRLS.percentile.weekly-241a8c86.js → BMI_GIRLS.percentile.weekly-652bc9af.js} +0 -0
  368. /package/build/esm/{BMI_GIRLS.percentile.yearly-a7d673ad.js → BMI_GIRLS.percentile.yearly-8bcb5a6e.js} +0 -0
  369. /package/build/esm/{BMI_GIRLS.zscore.monthly-ac552c64.js → BMI_GIRLS.zscore.monthly-ecbe2982.js} +0 -0
  370. /package/build/esm/{BMI_GIRLS.zscore.weekly-d3bd5cf8.js → BMI_GIRLS.zscore.weekly-3abed735.js} +0 -0
  371. /package/build/esm/{BMI_GIRLS.zscore.yearly-68c40e02.js → BMI_GIRLS.zscore.yearly-d88a34a0.js} +0 -0
  372. /package/build/esm/{ChevronDown-1c6ac70a.js → ChevronDown-dfd91883.js} +0 -0
  373. /package/build/esm/{Close-9dbbc4f5.js → Close-b8fc27b1.js} +0 -0
  374. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-e844f279.js → HEAD CIRCUM_BOYS.percentile.monthly-ff980a90.js} +0 -0
  375. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-c0ea6fc4.js → HEAD CIRCUM_BOYS.percentile.weekly-eb86eac9.js} +0 -0
  376. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-58273474.js → HEAD CIRCUM_BOYS.percentile.yearly-27ed6504.js} +0 -0
  377. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-867569e0.js → HEAD CIRCUM_BOYS.zscore.monthly-0d345597.js} +0 -0
  378. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-1c2e6c46.js → HEAD CIRCUM_BOYS.zscore.weekly-c182ab46.js} +0 -0
  379. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-4d2f300f.js → HEAD CIRCUM_BOYS.zscore.yearly-d45dbce1.js} +0 -0
  380. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-5d75244f.js → HEAD CIRCUM_GIRLS.percentile.monthly-61919e45.js} +0 -0
  381. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-73bd9176.js → HEAD CIRCUM_GIRLS.percentile.weekly-51fa8f98.js} +0 -0
  382. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-d1a55615.js → HEAD CIRCUM_GIRLS.percentile.yearly-c1fa6006.js} +0 -0
  383. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-4d365a9f.js → HEAD CIRCUM_GIRLS.zscore.monthly-4dfc55d8.js} +0 -0
  384. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-41370dfb.js → HEAD CIRCUM_GIRLS.zscore.weekly-b21b5bf1.js} +0 -0
  385. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-06ac6807.js → HEAD CIRCUM_GIRLS.zscore.yearly-c42836fa.js} +0 -0
  386. /package/build/esm/{HEIGHT_BOYS.percentile.monthly-3b18440a.js → HEIGHT_BOYS.percentile.monthly-24ff8afa.js} +0 -0
  387. /package/build/esm/{HEIGHT_BOYS.percentile.weekly-01a65af3.js → HEIGHT_BOYS.percentile.weekly-2be7b66e.js} +0 -0
  388. /package/build/esm/{HEIGHT_BOYS.percentile.yearly-c8203619.js → HEIGHT_BOYS.percentile.yearly-ac02aa2d.js} +0 -0
  389. /package/build/esm/{HEIGHT_BOYS.zscore.monthly-a3319613.js → HEIGHT_BOYS.zscore.monthly-b43667dc.js} +0 -0
  390. /package/build/esm/{HEIGHT_BOYS.zscore.weekly-981efa8b.js → HEIGHT_BOYS.zscore.weekly-abcfcf3a.js} +0 -0
  391. /package/build/esm/{HEIGHT_BOYS.zscore.yearly-a98e3bc6.js → HEIGHT_BOYS.zscore.yearly-71598c16.js} +0 -0
  392. /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-6959773b.js → HEIGHT_GIRLS.percentile.monthly-7f9d679c.js} +0 -0
  393. /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-128bb11e.js → HEIGHT_GIRLS.percentile.weekly-6ce1d4e7.js} +0 -0
  394. /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-29a94e1c.js → HEIGHT_GIRLS.percentile.yearly-c398fd6b.js} +0 -0
  395. /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-dd466c09.js → HEIGHT_GIRLS.zscore.monthly-8d33bc28.js} +0 -0
  396. /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-b602fae7.js → HEIGHT_GIRLS.zscore.weekly-eb44c302.js} +0 -0
  397. /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-358063df.js → HEIGHT_GIRLS.zscore.yearly-10b4d1fe.js} +0 -0
  398. /package/build/esm/{Locale-f781df87.js → Locale-b86a7a92.js} +0 -0
  399. /package/build/esm/{Visible-46717d08.js → Visible-69da852f.js} +0 -0
  400. /package/build/esm/{WEIGHT_BOYS.percentile.monthly-00996ab0.js → WEIGHT_BOYS.percentile.monthly-fd349fe7.js} +0 -0
  401. /package/build/esm/{WEIGHT_BOYS.percentile.weekly-c3c6f755.js → WEIGHT_BOYS.percentile.weekly-d5e52d60.js} +0 -0
  402. /package/build/esm/{WEIGHT_BOYS.percentile.yearly-c4571ef6.js → WEIGHT_BOYS.percentile.yearly-929119b3.js} +0 -0
  403. /package/build/esm/{WEIGHT_BOYS.zscore.monthly-b5eaafd1.js → WEIGHT_BOYS.zscore.monthly-3f0f08cd.js} +0 -0
  404. /package/build/esm/{WEIGHT_BOYS.zscore.weekly-b058aef3.js → WEIGHT_BOYS.zscore.weekly-b9fd3298.js} +0 -0
  405. /package/build/esm/{WEIGHT_BOYS.zscore.yearly-4557bb07.js → WEIGHT_BOYS.zscore.yearly-9945948d.js} +0 -0
  406. /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-094c8315.js → WEIGHT_GIRLS.percentile.monthly-1e83ae51.js} +0 -0
  407. /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-59bd62f7.js → WEIGHT_GIRLS.percentile.weekly-c3531852.js} +0 -0
  408. /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-7064def2.js → WEIGHT_GIRLS.percentile.yearly-3c0040b0.js} +0 -0
  409. /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-3e264c0b.js → WEIGHT_GIRLS.zscore.monthly-3baeda15.js} +0 -0
  410. /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-8402d0e1.js → WEIGHT_GIRLS.zscore.weekly-2d8e6618.js} +0 -0
  411. /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-58908f5c.js → WEIGHT_GIRLS.zscore.yearly-826f5bdd.js} +0 -0
  412. /package/build/esm/{animation-12f6a99a.js → animation-7207941a.js} +0 -0
  413. /package/build/esm/{cart-5cbf8fde.js → cart-4f482601.js} +0 -0
  414. /package/build/esm/{constants-c65d5e73.js → constants-0497b893.js} +0 -0
  415. /package/build/esm/{constants-7447b364.js → constants-af02be2a.js} +0 -0
  416. /package/build/esm/{constants-28f21bf7.js → constants-f7943ab2.js} +0 -0
  417. /package/build/esm/{dataTransform-4564c01a.js → dataTransform-610e61bf.js} +0 -0
  418. /package/build/esm/{doctor-a6dcb5b0.js → doctor-63e09ada.js} +0 -0
  419. /package/build/esm/{index-d1c6a5eb.js → index-20192854.js} +0 -0
  420. /package/build/esm/{index-3dfef0e2.js → index-20199246.js} +0 -0
  421. /package/build/esm/{index-7149c324.js → index-5364f2db.js} +0 -0
  422. /package/build/esm/{index-9d1a8bc8.js → index-56d0ac47.js} +0 -0
  423. /package/build/esm/{index-e2a19de9.js → index-9f076f64.js} +0 -0
  424. /package/build/esm/{index-31ca33d1.js → index-a2506e52.js} +0 -0
  425. /package/build/esm/{index-b503d8ca.js → index-c130afdc.js} +0 -0
  426. /package/build/esm/{index-5bd25778.js → index-c9467e39.js} +0 -0
  427. /package/build/esm/{localizeNumberFormat-fe248dc9.js → localizeNumberFormat-3bf28240.js} +0 -0
  428. /package/build/esm/{number-59fe2c76.js → number-d26abebe.js} +0 -0
  429. /package/build/esm/{other-8082eeb8.js → other-08d0b30e.js} +0 -0
  430. /package/build/esm/{paths-a31c249e.js → paths-ce59b252.js} +0 -0
  431. /package/build/esm/{translationsContext-f05845a3.js → translationsContext-8afb0ce3.js} +0 -0
  432. /package/build/esm/{tslib.es6-2813a841.js → tslib.es6-e0840efa.js} +0 -0
  433. /package/build/esm/{types-e1b0b130.js → types-41242882.js} +0 -0
  434. /package/build/esm/{useIsInit-6417c32d.js → useIsInit-f59c6bd2.js} +0 -0
  435. /package/build/esm/{useOutsideClick-cabe5b52.js → useOutsideClick-12815e56.js} +0 -0
  436. /package/build/esm/{useScrollbarSize-93f9665c.js → useScrollbarSize-431cf33c.js} +0 -0
  437. /package/build/esm/{useUniqueId-0c237f04.js → useUniqueId-8f710187.js} +0 -0
  438. /package/build/esm/{utils-5ac430a2.js → utils-8a1f05c9.js} +0 -0
  439. /package/build/{index-9a3d05f1.js → index-017f99b2.js} +0 -0
  440. /package/build/{index-ddd1ae54.js → index-1a6a94cd.js} +0 -0
  441. /package/build/{index-126368b4.js → index-668f591b.js} +0 -0
  442. /package/build/{index-eae45243.js → index-70abc2ac.js} +0 -0
  443. /package/build/{index-1fab78b5.js → index-c6b0831a.js} +0 -0
  444. /package/build/{index-d0ba8956.js → index-ce2d2850.js} +0 -0
  445. /package/build/{index-31ba7c80.js → index-e3e72aed.js} +0 -0
  446. /package/build/{index-b895e598.js → index-f70c0edf.js} +0 -0
  447. /package/build/{localizeNumberFormat-52a8a959.js → localizeNumberFormat-30e7f015.js} +0 -0
  448. /package/build/{normalizeLink-8a458cb4.js → normalizeLink-c1b2b407.js} +0 -0
  449. /package/build/{number-8f639a87.js → number-20d56f69.js} +0 -0
  450. /package/build/{other-fcf0cbba.js → other-eedaf6ca.js} +0 -0
  451. /package/build/{paths-822d5ab1.js → paths-4c182009.js} +0 -0
  452. /package/build/{translationsContext-1fe0412c.js → translationsContext-cd046df4.js} +0 -0
  453. /package/build/{tslib.es6-d6f7eba3.js → tslib.es6-f3c387c0.js} +0 -0
  454. /package/build/{types-7b239cb4.js → types-2614ec58.js} +0 -0
  455. /package/build/{useIsInit-3c23a980.js → useIsInit-e56642e4.js} +0 -0
  456. /package/build/{useOutsideClick-dcf05d21.js → useOutsideClick-f18dfe3f.js} +0 -0
  457. /package/build/{useScrollbarSize-e144fad0.js → useScrollbarSize-4aaa4dd1.js} +0 -0
  458. /package/build/{useUniqueId-47d33d64.js → useUniqueId-621ec272.js} +0 -0
  459. /package/build/{utils-03c7b063.js → utils-ae9740c0.js} +0 -0
@@ -0,0 +1,1665 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var core = require('@mantine/core');
7
+ var utils$1 = require('./utils-f47b2d2d.js');
8
+ var useOutsideClick = require('./useOutsideClick-f18dfe3f.js');
9
+ var useTranslations = require('./useTranslations-8a9fa84d.js');
10
+ var debounce = require('lodash/debounce');
11
+ var constants = require('./constants-c3b9c9a9.js');
12
+ var styled = require('@emotion/styled');
13
+ var miscTheme = require('./miscTheme.js');
14
+ var utils = require('./utils-ae9740c0.js');
15
+ var index = require('./index-c6b0831a.js');
16
+ var core$1 = require('@hhgtech/icons/core');
17
+ var index$1 = require('./index-6b95442c.js');
18
+ var ChevronDown = require('./ChevronDown-a6775d48.js');
19
+ var paths = require('./paths-4c182009.js');
20
+ require('./index-648aac83.js');
21
+ require('date-fns/locale');
22
+ require('./index-d471ff2d.js');
23
+ require('./Locale-07aceee9.js');
24
+ require('./constantsIsProduction.js');
25
+ require('./constantsSite.js');
26
+ require('./constantsDomainLocales.js');
27
+ require('./constantsRiskScreener.js');
28
+ require('./miscCookieHelper.js');
29
+ require('react-loading-skeleton');
30
+ require('string-format');
31
+ require('./translationsContext-cd046df4.js');
32
+ require('./tslib.es6-f3c387c0.js');
33
+ require('./other-eedaf6ca.js');
34
+
35
+ function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
36
+
37
+ var React__default = /*#__PURE__*/_interopDefault(React);
38
+ var debounce__default = /*#__PURE__*/_interopDefault(debounce);
39
+ var styled__default = /*#__PURE__*/_interopDefault(styled);
40
+
41
+ const StyledSearchBarWrapper = styled__default["default"].div ``;
42
+ const StyleWrapperContainer = styled__default["default"].div `
43
+ background-color: ${miscTheme.theme.colors.neutral50};
44
+ padding-bottom: 1px;
45
+ ${utils.MediaQueries.mbDown} {
46
+ padding: 0 16px 10px;
47
+ }
48
+ `;
49
+ const StyleSearchInputContainer = styled__default["default"](index.Container) `
50
+ padding: 0 16px;
51
+
52
+ ${utils.MediaQueries.mbDown} {
53
+ padding: 0;
54
+ }
55
+ `;
56
+ const StyleSearchContent = styled__default["default"].div `
57
+ padding: 24px 56px;
58
+ border-radius: 16px;
59
+ background-color: ${miscTheme.theme.colors.white};
60
+ box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.04),
61
+ 0px 0px 2px 0px rgba(0, 0, 0, 0.06), 0px 4px 8px 0px rgba(0, 0, 0, 0.04);
62
+
63
+ ${utils.MediaQueries.mbDown} {
64
+ padding: 16px 16px;
65
+ border-radius: 0px 0px 12px 12px;
66
+ }
67
+
68
+ .flex-search-input {
69
+ flex-direction: row;
70
+ ${utils.MediaQueries.mbDown} {
71
+ flex-direction: column;
72
+ }
73
+ }
74
+ `;
75
+
76
+ const SEARCH_KEYWORD_MIN_LENGTH = {
77
+ 'en-PH': 3,
78
+ 'tl-PH': 2,
79
+ 'id-ID': 3,
80
+ 'vi-VN': 2,
81
+ 'zh-TW': 0,
82
+ 'ms-MY': 2,
83
+ };
84
+
85
+ const initialState = {
86
+ isMobile: false,
87
+ isDebug: false,
88
+ navigateTo: null,
89
+ geoLocationPermission: 'unset',
90
+ geoLocationCoordinates: null,
91
+ focused: 'none',
92
+ focusedSpecialty: 'none',
93
+ searchLocationKeywords: '',
94
+ searchSpecialtyKeywords: '',
95
+ searchKeywords: '',
96
+ selectedLocation: null,
97
+ selectedSpecialty: null,
98
+ defaultCity: null,
99
+ initialCities: [],
100
+ cities: [],
101
+ searchResults: {},
102
+ initialSearchResults: {},
103
+ isLoadingCities: false,
104
+ isLoadingSearchResults: false,
105
+ isMobileModalOpened: false,
106
+ initialSelectedCity: null,
107
+ autoCompleteDisabled: false,
108
+ inputSearchPlaceholder: '',
109
+ locale: 'vi-VN',
110
+ allSpecialties: [],
111
+ popularKeys: [],
112
+ };
113
+ var ActionTypes;
114
+ (function (ActionTypes) {
115
+ ActionTypes["NavigateTo"] = "navigate to url";
116
+ ActionTypes["ClickOutsideInputLocation"] = "click outside input location";
117
+ ActionTypes["ClickOutsideInputSearch"] = "click outside input search";
118
+ ActionTypes["ClickOutsideInputSearchSpecialty"] = "click outside input search specialty";
119
+ ActionTypes["ClickOutsideInputSpecialty"] = "click outside input specialty";
120
+ ActionTypes["SelectCurrentLocation"] = "select current location";
121
+ ActionTypes["FocusInputLocation"] = "focus input location";
122
+ ActionTypes["FocusInputSearch"] = "focus input search";
123
+ ActionTypes["FocusInputSearchSpecialty"] = "focus input search specialty";
124
+ ActionTypes["ChangeInputLocation"] = "change input location";
125
+ ActionTypes["ChangeInputSearch"] = "change input search";
126
+ ActionTypes["ClearInputLocation"] = "clear input location";
127
+ ActionTypes["ClearInputSearch"] = "clear input search";
128
+ ActionTypes["SelectLocation"] = "select location";
129
+ ActionTypes["SelectSpecialty"] = "select specialty";
130
+ ActionTypes["FetchCitiesStart"] = "fetch cities start";
131
+ ActionTypes["FetchCitiesFinish"] = "fetch cities finish";
132
+ ActionTypes["FetchSearchResultsStart"] = "fetch search results start";
133
+ ActionTypes["FetchSearchResultsComplete"] = "fetch search results complete";
134
+ ActionTypes["FetchSearchResultsFinish"] = "fetch search results finish";
135
+ ActionTypes["FetchCitiesByGeoIpComplete"] = "fetch cities by geo IP finish";
136
+ ActionTypes["FetchCitiesByKeywordComplete"] = "fetch cities by keyword finish";
137
+ ActionTypes["DisplayInitialCities"] = "display initial cities";
138
+ ActionTypes["DisplayInitialSearchResults"] = "display initial search results";
139
+ ActionTypes["UpdateInitialSearchResults"] = "update initial search results";
140
+ ActionTypes["GrantGeoLocationPermission"] = "grant geolocation permission";
141
+ ActionTypes["DenyGeoLocationPermission"] = "deny geolocation permission";
142
+ ActionTypes["OpenMobileModal"] = "open mobile modal";
143
+ ActionTypes["CloseMobileModal"] = "close mobile modal";
144
+ ActionTypes["UpdateInitialSearchValue"] = "update initial search value";
145
+ ActionTypes["SelectSearchResult"] = "select search result";
146
+ ActionTypes["SetInputSearchPlaceholder"] = "set input search placeholder";
147
+ ActionTypes["FocusInputSpecialty"] = "focus input specialty";
148
+ ActionTypes["FetchAllSpecialties"] = "fetch all specialty";
149
+ ActionTypes["FetchPopularKeys"] = "fetch popular key by type";
150
+ })(ActionTypes || (ActionTypes = {}));
151
+ function resetSearchLocationKeywords(state) {
152
+ const { selectedLocation, searchLocationKeywords } = state;
153
+ if (selectedLocation && searchLocationKeywords !== selectedLocation.name) {
154
+ return Object.assign(Object.assign({}, state), { searchLocationKeywords: selectedLocation.name });
155
+ }
156
+ return state;
157
+ }
158
+ function reducer(state, action) {
159
+ var _a, _b;
160
+ if (state.isDebug) {
161
+ console.log('bookingSearchBar', { action, state });
162
+ }
163
+ switch (action.type) {
164
+ case ActionTypes.NavigateTo:
165
+ return Object.assign(Object.assign({}, state), { navigateTo: action.payload, focused: 'none', isMobileModalOpened: false });
166
+ case ActionTypes.ClickOutsideInputLocation: {
167
+ if (state.focused !== 'location') {
168
+ return state;
169
+ }
170
+ return resetSearchLocationKeywords(Object.assign(Object.assign({}, state), { focused: 'none' }));
171
+ }
172
+ case ActionTypes.ClickOutsideInputSpecialty: {
173
+ if (state.focused !== 'specialty') {
174
+ return state;
175
+ }
176
+ return resetSearchLocationKeywords(Object.assign(Object.assign({}, state), { focused: 'none' }));
177
+ }
178
+ case ActionTypes.ClickOutsideInputSearch: {
179
+ if (state.focused !== 'search') {
180
+ return state;
181
+ }
182
+ return Object.assign(Object.assign({}, state), { focused: 'none' });
183
+ }
184
+ case ActionTypes.ClickOutsideInputSearchSpecialty: {
185
+ if (state.focusedSpecialty !== 'search') {
186
+ return state;
187
+ }
188
+ return Object.assign(Object.assign({}, state), { focusedSpecialty: 'none' });
189
+ }
190
+ case ActionTypes.FocusInputLocation: {
191
+ const nextState = Object.assign(Object.assign({}, state), { focused: 'location' });
192
+ if (((_a = state.selectedLocation) === null || _a === void 0 ? void 0 : _a.id) === constants.ID_OPTION_CURRENT_LOCATION) {
193
+ nextState.searchLocationKeywords = '';
194
+ }
195
+ return nextState;
196
+ }
197
+ case ActionTypes.FocusInputSpecialty: {
198
+ const nextState = Object.assign(Object.assign({}, state), { focused: 'specialty' });
199
+ if (((_b = state.selectedLocation) === null || _b === void 0 ? void 0 : _b.id) === constants.ID_OPTION_CURRENT_LOCATION) {
200
+ nextState.searchLocationKeywords = '';
201
+ }
202
+ return nextState;
203
+ }
204
+ case ActionTypes.FocusInputSearch:
205
+ const nextState = Object.assign(Object.assign({}, state), { focused: 'search' });
206
+ if (state.isMobile) {
207
+ return resetSearchLocationKeywords(nextState);
208
+ }
209
+ return nextState;
210
+ case ActionTypes.FocusInputSearchSpecialty: {
211
+ const nextState = Object.assign(Object.assign({}, state), { focusedSpecialty: 'search' });
212
+ return nextState;
213
+ }
214
+ case ActionTypes.ChangeInputLocation:
215
+ return Object.assign(Object.assign({}, state), { searchLocationKeywords: action.payload });
216
+ case ActionTypes.ChangeInputSearch: {
217
+ const keyword = action.payload;
218
+ return Object.assign(Object.assign({}, state), { searchKeywords: keyword, isLoadingSearchResults: keyword.trim().length > SEARCH_KEYWORD_MIN_LENGTH[state.locale] });
219
+ }
220
+ case ActionTypes.SelectCurrentLocation:
221
+ return Object.assign(Object.assign({}, state), { focused: 'none', selectedLocation: action.payload, searchLocationKeywords: action.payload.name });
222
+ case ActionTypes.ClearInputLocation:
223
+ return Object.assign(Object.assign({}, state), { focused: 'location', cities: state.initialCities, searchLocationKeywords: '' });
224
+ case ActionTypes.ClearInputSearch:
225
+ return Object.assign(Object.assign({}, state), { focused: 'search', searchKeywords: '' });
226
+ case ActionTypes.SelectLocation:
227
+ return Object.assign(Object.assign({}, state), { focused: 'none', selectedLocation: action.payload, searchLocationKeywords: action.payload.name });
228
+ case ActionTypes.SelectSpecialty:
229
+ return Object.assign(Object.assign({}, state), { focused: 'none', selectedSpecialty: action.payload });
230
+ case ActionTypes.SelectSearchResult:
231
+ return Object.assign(Object.assign({}, state), { searchKeywords: action.payload.name, isMobileModalOpened: false, focused: 'none', navigateTo: action.payload.url });
232
+ case ActionTypes.FetchCitiesStart:
233
+ return Object.assign(Object.assign({}, state), { isLoadingCities: true });
234
+ case ActionTypes.FetchCitiesFinish:
235
+ return Object.assign(Object.assign({}, state), { isLoadingCities: false });
236
+ case ActionTypes.FetchSearchResultsStart:
237
+ return Object.assign(Object.assign({}, state), { isLoadingSearchResults: true });
238
+ case ActionTypes.FetchSearchResultsFinish:
239
+ return Object.assign(Object.assign({}, state), { isLoadingSearchResults: false });
240
+ case ActionTypes.FetchSearchResultsComplete: {
241
+ const nextState = Object.assign(Object.assign({}, state), { searchResults: Object.assign(Object.assign({}, state.searchResults), { [action.payload.key]: action.payload.searches }) });
242
+ return nextState;
243
+ }
244
+ case ActionTypes.FetchCitiesByGeoIpComplete: {
245
+ let { cities } = action.payload;
246
+ const { default: defaultCity } = action.payload;
247
+ cities = cities.filter((c) => c.id !== defaultCity.id);
248
+ if (defaultCity) {
249
+ cities.unshift(defaultCity);
250
+ }
251
+ if (state.initialSelectedCity &&
252
+ !cities.find((c) => c.id === state.initialSelectedCity.id)) {
253
+ cities.unshift(state.initialSelectedCity);
254
+ }
255
+ const nextState = Object.assign(Object.assign({}, state), { defaultCity, initialCities: cities, cities });
256
+ if (state.geoLocationPermission === 'denied' &&
257
+ !state.initialSelectedCity) {
258
+ nextState.selectedLocation = defaultCity;
259
+ nextState.searchLocationKeywords = defaultCity.name;
260
+ }
261
+ return nextState;
262
+ }
263
+ case ActionTypes.FetchCitiesByKeywordComplete:
264
+ return Object.assign(Object.assign({}, state), { cities: action.payload });
265
+ case ActionTypes.DisplayInitialCities:
266
+ return Object.assign(Object.assign({}, state), { cities: state.initialCities });
267
+ case ActionTypes.DisplayInitialSearchResults:
268
+ return Object.assign(Object.assign({}, state), { searchResults: state.initialSearchResults, isLoadingSearchResults: false });
269
+ case ActionTypes.UpdateInitialSearchResults:
270
+ return Object.assign(Object.assign({}, state), { initialSearchResults: Object.assign(Object.assign({}, state.initialSearchResults), { [action.payload.key]: action.payload.searches }) });
271
+ case ActionTypes.GrantGeoLocationPermission:
272
+ return Object.assign(Object.assign({}, state), { geoLocationPermission: 'granted', geoLocationCoordinates: action.payload });
273
+ case ActionTypes.DenyGeoLocationPermission:
274
+ return Object.assign(Object.assign({}, state), { geoLocationPermission: 'denied', geoLocationCoordinates: null });
275
+ case ActionTypes.OpenMobileModal:
276
+ return Object.assign(Object.assign({}, state), { isMobileModalOpened: true });
277
+ case ActionTypes.CloseMobileModal:
278
+ return Object.assign(Object.assign({}, state), { isMobileModalOpened: false });
279
+ case ActionTypes.UpdateInitialSearchValue:
280
+ return Object.assign(Object.assign({}, state), { searchKeywords: action.payload });
281
+ case ActionTypes.SetInputSearchPlaceholder:
282
+ return Object.assign(Object.assign({}, state), { inputSearchPlaceholder: action.payload });
283
+ case ActionTypes.FetchAllSpecialties:
284
+ return Object.assign(Object.assign({}, state), { allSpecialties: action.payload });
285
+ case ActionTypes.FetchPopularKeys:
286
+ return Object.assign(Object.assign({}, state), { popularKeys: action.payload });
287
+ default:
288
+ return state;
289
+ }
290
+ }
291
+
292
+ const StyleSearchInputsWrapper = styled__default["default"].div `
293
+ flex: 1;
294
+ position: relative;
295
+
296
+ ${utils.MediaQueries.mbDown} {
297
+ width: 100%;
298
+ display: flex;
299
+ flex-direction: column;
300
+ gap: 12px;
301
+ }
302
+ `;
303
+ const StyleResultWrapper$2 = styled__default["default"].div `
304
+ position: absolute;
305
+ top: calc(100% + 2px);
306
+ width: 100%;
307
+ border-radius: 4px;
308
+ background: ${miscTheme.theme.colors.white};
309
+ box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1);
310
+ z-index: 10;
311
+
312
+ ${utils.MediaQueries.mbDown} {
313
+ width: calc(100% + 64px);
314
+ left: -32px;
315
+ }
316
+ `;
317
+
318
+ const StyledSearchResultWrapper = styled__default["default"].div ``;
319
+ const StyleResultHeader = styled__default["default"].div `
320
+ display: flex;
321
+ justify-content: space-between;
322
+ align-item: center;
323
+ padding: 9px 14px 9px 22px;
324
+ background: #f7f9fc;
325
+
326
+ .title {
327
+ color: ${miscTheme.theme.colors.gray800};
328
+ font-size: 14px;
329
+ font-weight: 600;
330
+ line-height: 22px;
331
+ }
332
+
333
+ .btn-see-all {
334
+ color: ${miscTheme.theme.colors.blue600};
335
+ font-size: 14px;
336
+ line-height: 22px;
337
+ cursor: pointer;
338
+ }
339
+ `;
340
+ const StyleResultBody = styled__default["default"].div `
341
+ padding: 10px 16px;
342
+ max-height: 400px;
343
+ overflow: auto;
344
+ `;
345
+ const StyleResultItem = styled__default["default"].div `
346
+ display: flex;
347
+ gap: 12px;
348
+ align-items: center;
349
+ cursor: pointer;
350
+
351
+ &:hover {
352
+ background-color: ${miscTheme.theme.colors.blue50};
353
+ }
354
+ .image-item {
355
+ flex: 0 0 48px;
356
+ width: 48px;
357
+ height: 48px;
358
+ border-radius: 50%;
359
+
360
+ img {
361
+ object-fit: contain;
362
+ width: 100%;
363
+ height: 100%;
364
+ border-radius: 50%;
365
+ }
366
+ }
367
+ .infor {
368
+ overflow: hidden;
369
+ padding: 12px 0;
370
+ flex: 1;
371
+ border-bottom: 1px solid ${miscTheme.theme.colors.neutral100};
372
+ .title {
373
+ color: ${miscTheme.theme.colors.gray800};
374
+ font-size: 16px;
375
+ font-weight: 600;
376
+ line-height: 24px;
377
+ }
378
+ .description {
379
+ overflow: hidden;
380
+ color: ${miscTheme.theme.colors.gray600};
381
+ text-overflow: ellipsis;
382
+ white-space: nowrap;
383
+ font-size: 12px;
384
+ line-height: 18px;
385
+ display: flex;
386
+ gap: 8px;
387
+ align-items: center;
388
+ margin-top: 5px;
389
+
390
+ svg {
391
+ flex: 0 0 16px;
392
+ }
393
+
394
+ .sub-description {
395
+ overflow: hidden;
396
+ white-space: nowrap;
397
+ text-overflow: ellipsis;
398
+ flex: 1;
399
+ }
400
+ }
401
+ }
402
+
403
+ &.last-item {
404
+ .infor {
405
+ border-bottom: none;
406
+ }
407
+ }
408
+ `;
409
+ styled__default["default"].div `
410
+ padding: 0 16px 16px;
411
+
412
+ .search-detail-btn {
413
+ color: ${miscTheme.theme.colors.blue600};
414
+ font-size: 14px;
415
+ line-height: 22px;
416
+ cursor: pointer;
417
+ }
418
+ `;
419
+
420
+ const SearchResult = ({ state, type, results, location, isLoading, typeInformation, clientSlug = '', dispatch, }) => {
421
+ const { locale, t } = useTranslations.useTranslations();
422
+ const { selectedLocation } = state;
423
+ const typeSlug = React.useMemo(() => typeInformation[type].slug, [typeInformation, type]);
424
+ const handleOnClick = (item) => {
425
+ let url = '';
426
+ switch (type) {
427
+ case 'service':
428
+ url = `/${selectedLocation.slug}/${typeSlug}/${item.slug}`;
429
+ break;
430
+ case 'doctor':
431
+ case 'hospital':
432
+ url = `/${typeSlug}/${item.slug}-${item.id}`;
433
+ break;
434
+ }
435
+ if (url) {
436
+ dispatch({
437
+ type: ActionTypes.NavigateTo,
438
+ payload: url,
439
+ });
440
+ }
441
+ };
442
+ const handleSeeAll = () => {
443
+ let url = `/${selectedLocation.slug}/${typeSlug}`;
444
+ const slugClientUrl = constants.MAPPING_CLIENT_WITH_SLUG[locale][clientSlug];
445
+ if (slugClientUrl) {
446
+ url += `/${slugClientUrl}`;
447
+ }
448
+ if ((type === 'doctor' || type === 'hospital') &&
449
+ state.selectedSpecialty.id > 0) {
450
+ url += `?specialtyId=${state.selectedSpecialty.id}`;
451
+ }
452
+ if (url) {
453
+ dispatch({ type: ActionTypes.NavigateTo, payload: url });
454
+ }
455
+ };
456
+ return (React__default["default"].createElement(StyledSearchResultWrapper, null,
457
+ React__default["default"].createElement(StyleResultHeader, null,
458
+ React__default["default"].createElement("div", { className: "title" }, t('booking.searchResult.description', {
459
+ search_type: typeInformation[type].name,
460
+ search_location: location,
461
+ })),
462
+ results.length > 0 && (React__default["default"].createElement("div", { className: "btn-see-all", onClick: handleSeeAll }, t('home.seeAll')))),
463
+ React__default["default"].createElement(StyleResultBody, null,
464
+ isLoading &&
465
+ Array(3)
466
+ .fill(undefined)
467
+ .map((_, i) => (React__default["default"].createElement(StyleResultItem, { key: type + 'loading' + i, className: i === 2 ? 'last-item' : '' },
468
+ React__default["default"].createElement("div", { className: "image-item" },
469
+ React__default["default"].createElement(core.Skeleton, { height: 48, circle: true, mb: "xl", animate: true })),
470
+ React__default["default"].createElement("div", { className: "infor" },
471
+ React__default["default"].createElement("div", { className: "title" },
472
+ React__default["default"].createElement(core.Skeleton, { height: 8, mt: 10, radius: "xl", animate: true })),
473
+ React__default["default"].createElement("div", { className: "description" },
474
+ React__default["default"].createElement("div", { className: "sub-description" },
475
+ React__default["default"].createElement(core.Skeleton, { height: 8, mt: 10, radius: "xl", width: "80%", animate: true }))))))),
476
+ !isLoading && results && results.length > 0 && (React__default["default"].createElement(React__default["default"].Fragment, null, results.map((item, index) => {
477
+ var _a, _b;
478
+ const isLastItem = (results.length > 4 && index === 3) ||
479
+ (results.length <= 4 && index === results.length - 1);
480
+ let subDescription = '';
481
+ if (type === 'hospital') {
482
+ subDescription = (item === null || item === void 0 ? void 0 : item.address) || '';
483
+ }
484
+ if (type === 'doctor') {
485
+ subDescription = ((_a = item === null || item === void 0 ? void 0 : item.specialties) === null || _a === void 0 ? void 0 : _a.join(', ')) || '';
486
+ }
487
+ if (type === 'service') {
488
+ subDescription = ((_b = item === null || item === void 0 ? void 0 : item.hospital_branch) === null || _b === void 0 ? void 0 : _b.name) || '';
489
+ }
490
+ if (index >= 4) {
491
+ return React__default["default"].createElement(React__default["default"].Fragment, null);
492
+ }
493
+ return (React__default["default"].createElement(StyleResultItem, { key: item.id, className: isLastItem ? 'last-item' : '', onClick: () => handleOnClick(item) },
494
+ React__default["default"].createElement("div", { className: "image-item" },
495
+ React__default["default"].createElement("img", { src: item.logo || item.avatar, alt: item.name })),
496
+ React__default["default"].createElement("div", { className: "infor" },
497
+ React__default["default"].createElement("div", { className: "title" }, item.name),
498
+ React__default["default"].createElement("div", { className: "description" },
499
+ typeInformation[type].icon,
500
+ React__default["default"].createElement("div", { className: "sub-description" }, subDescription)))));
501
+ }))),
502
+ !isLoading && (results === null || results === void 0 ? void 0 : results.length) === 0 && (React__default["default"].createElement(index$1.Text, { size: "sm", color: miscTheme.theme.colors.gray400 }, t('booking.searchBar.noResults'))))));
503
+ };
504
+
505
+ const StyleSearchSpecialtyWrapper = styled__default["default"].div `
506
+ position: relative;
507
+
508
+ ${utils.MediaQueries.mbDown} {
509
+ width: 100%;
510
+ display: flex;
511
+ flex-direction: column;
512
+ gap: 12px;
513
+ }
514
+ `;
515
+ const StyleResultWrapper$1 = styled__default["default"].div `
516
+ position: absolute;
517
+ top: calc(100% + 2px);
518
+ width: calc(100% + 100px);
519
+ border-radius: 4px;
520
+ background: ${miscTheme.theme.colors.white};
521
+ box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1);
522
+ z-index: 10;
523
+ max-height: 300px;
524
+ overflow: auto;
525
+
526
+ ${utils.MediaQueries.mbDown} {
527
+ width: calc(100% + 64px);
528
+ left: -32px;
529
+ }
530
+ `;
531
+ const StyledSpecialtyItem = styled__default["default"].li `
532
+ position: relative;
533
+ cursor: pointer;
534
+ padding: 12px 18px;
535
+ display: flex;
536
+ align-items: center;
537
+ gap: 14px;
538
+ overflow: hidden;
539
+
540
+ .image-item {
541
+ display: flex;
542
+ align-items: center;
543
+ width: 40px;
544
+ height: 40px;
545
+
546
+ img {
547
+ width: 100%;
548
+ object-fit: cover;
549
+ }
550
+
551
+ svg {
552
+ width: 40px;
553
+ }
554
+ }
555
+
556
+ ${({ isSelected }) => isSelected &&
557
+ `
558
+ &::after {
559
+ content: ${utils$1.checkMarkIconUrl};
560
+ top: 50%;
561
+ right: 18px;
562
+ position: absolute;
563
+ transform: translateY(-50%);
564
+ }
565
+ `}
566
+
567
+ & + li::before {
568
+ content: '';
569
+ position: absolute;
570
+ left: 18px;
571
+ right: 18px;
572
+ top: 0;
573
+ height: 1px;
574
+ background-color: ${miscTheme.theme.colors.neutral100};
575
+ }
576
+
577
+ &:not([data-is-denied='true']):hover {
578
+ background-color: ${miscTheme.theme.colors.neutral50};
579
+ }
580
+
581
+ &:last-child:hover {
582
+ border-bottom-right-radius: 6px;
583
+ border-bottom-left-radius: 6px;
584
+ }
585
+
586
+ &:first-child:hover {
587
+ border-top-right-radius: 6px;
588
+ border-top-left-radius: 6px;
589
+ }
590
+
591
+ &[data-is-denied='true'] {
592
+ cursor: not-allowed;
593
+ }
594
+ `;
595
+
596
+ const DoctorIcon = () => (React__default["default"].createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
597
+ React__default["default"].createElement("path", { d: "M8.983 14.333q-1.666 0-2.833-1.166Q4.983 12 4.983 10.333v-.366a3.48 3.48 0 0 1-2.258-1.2 3.57 3.57 0 0 1-.909-2.434V3.1a.58.58 0 0 1 .175-.425.58.58 0 0 1 .425-.175h1.4v-.167a.486.486 0 0 1 .5-.5q.217 0 .36.142a.5.5 0 0 1 .14.358v1.334a.485.485 0 0 1-.5.5.484.484 0 0 1-.5-.5V3.5h-1v2.833q0 1.1.784 1.884Q4.383 9 5.483 9t1.883-.783.784-1.884V3.5h-1v.167a.485.485 0 0 1-.5.5.484.484 0 0 1-.5-.5V2.333a.486.486 0 0 1 .5-.5q.217 0 .358.142a.5.5 0 0 1 .142.358V2.5h1.4a.58.58 0 0 1 .425.175.58.58 0 0 1 .175.425v3.233q0 1.4-.908 2.434a3.5 3.5 0 0 1-2.259 1.2v.366q0 1.25.875 2.126a2.9 2.9 0 0 0 2.125.874q1.25 0 2.125-.874a2.9 2.9 0 0 0 .875-2.126V9.25a1.74 1.74 0 0 1-.858-.609 1.6 1.6 0 0 1-.342-1.008q0-.716.5-1.216t1.2-.5q.716 0 1.217.5.5.5.5 1.216 0 .567-.342 1.008t-.875.609v1.083q0 1.667-1.167 2.834-1.166 1.166-2.833 1.166m3.5-6q.3 0 .509-.208a.67.67 0 0 0 .208-.492q0-.3-.208-.508a.7.7 0 0 0-.509-.208q-.3 0-.5.208a.7.7 0 0 0-.2.508q0 .284.2.492t.5.208", fill: "#595959" })));
598
+ const ServiceIcon = () => (React__default["default"].createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
599
+ React__default["default"].createElement("path", { d: "M6.868 9.265v.974q0 .405.284.69.284.283.69.283t.69-.284.284-.69v-.973h.973q.405 0 .69-.284a.94.94 0 0 0 .284-.689.94.94 0 0 0-.284-.69.94.94 0 0 0-.69-.284h-.973v-.974a.94.94 0 0 0-.284-.69.94.94 0 0 0-.69-.284.94.94 0 0 0-.689.284.94.94 0 0 0-.285.69v.974h-.973a.94.94 0 0 0-.69.283.94.94 0 0 0-.284.69q0 .405.284.69.285.284.69.284zm-3.46 4.868q-.581 0-.994-.413A1.36 1.36 0 0 1 2 12.725v-6.65a1.4 1.4 0 0 1 .563-1.127l4.434-3.333q.369-.282.844-.282.474 0 .846.282l4.434 3.333q.264.193.413.493.15.3.15.633v6.651q0 .58-.414.995a1.36 1.36 0 0 1-.994.413zm0-1.168h8.868q.105 0 .172-.068a.23.23 0 0 0 .068-.172v-6.65a.2.2 0 0 0-.027-.11.3.3 0 0 0-.07-.085L7.983 2.554a.2.2 0 0 0-.142-.052.2.2 0 0 0-.142.052L3.266 5.88a.3.3 0 0 0-.071.086.2.2 0 0 0-.027.108v6.651q0 .105.068.172a.23.23 0 0 0 .172.068", fill: "#595959" })));
600
+ const HospitalIcon = () => (React__default["default"].createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
601
+ React__default["default"].createElement("path", { d: "M8 8q.55 0 .941-.392.393-.391.392-.941 0-.55-.392-.942A1.28 1.28 0 0 0 8 5.333q-.55 0-.942.392a1.28 1.28 0 0 0-.391.942q0 .55.391.941Q7.45 8 8 8m0 4.9q2.032-1.866 3.017-3.392Q12 7.983 12 6.8q0-1.817-1.158-2.975Q9.682 2.667 8 2.667T5.158 3.825Q4 4.983 4 6.8q0 1.184.983 2.708Q5.966 11.034 8 12.9m0 1.517a.8.8 0 0 1-.5-.183q-2.433-2.151-3.633-3.992T2.667 6.8q0-2.5 1.608-3.983Q5.883 1.332 8 1.333q2.116 0 3.725 1.484T13.333 6.8q0 1.6-1.2 3.442-1.2 1.841-3.633 3.991a.8.8 0 0 1-.5.184", fill: "#8C8C8C" })));
602
+ const SpecialtyIcon = () => (React__default["default"].createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16" },
603
+ React__default["default"].createElement("path", { d: "M3.833.5a3.333 3.333 0 1 0 0 6.667 3.333 3.333 0 0 0 0-6.667M10.5.5c-.92 0-1.667.746-1.667 1.667V5.5c0 .92.746 1.667 1.667 1.667h3.333c.921 0 1.667-.746 1.667-1.667V2.167C15.5 1.246 14.754.5 13.833.5zM3.833 8.833a3.333 3.333 0 1 0 0 6.667 3.333 3.333 0 0 0 0-6.667m8.334 0a3.333 3.333 0 1 0 0 6.667 3.333 3.333 0 0 0 0-6.667", fill: "#9AA2AC" })));
604
+
605
+ const SearchSpecialty = ({ state, isMobile, debouncedFetchSearchResults, selectedLocation, onSpecialtyClick, dispatch, }) => {
606
+ var _a;
607
+ const { t, locale } = useTranslations.useTranslations();
608
+ const inputSpecialtyWrapperRef = React.useRef(null);
609
+ const slugs = React.useMemo(() => constants.LOCALIZED_SLUGS[locale], [locale]);
610
+ const styleSpecialties = React.useMemo(() => {
611
+ return {
612
+ wrapper: {
613
+ '&:after': {
614
+ content: '""',
615
+ width: '1px',
616
+ height: '20px',
617
+ backgroundColor: '#E4E8EC',
618
+ position: 'absolute',
619
+ right: 0,
620
+ top: '13px',
621
+ },
622
+ },
623
+ input: {
624
+ border: isMobile ? 'border: 1px solid #d9d9d9' : 'none',
625
+ height: isMobile ? '40px' : '46px !important',
626
+ paddingRight: '30px',
627
+ '&:focus': {
628
+ boxShadow: isMobile ? 'box-shadow: 0px 0px 0px 2px #91caff' : 'none',
629
+ },
630
+ },
631
+ rightSection: {
632
+ width: '30px',
633
+ svg: {
634
+ fontSize: '20px',
635
+ },
636
+ },
637
+ };
638
+ }, [isMobile]);
639
+ const handleSearchSpecialtyInputChange = React.useCallback(function handleSearchSpecialtyInputChange(value) {
640
+ // dispatch({ type: ActionTypes.ChangeInputLocation, payload: value })
641
+ // if (value.trim().length > SEARCH_KEYWORD_MIN_LENGTH[state.locale]) {
642
+ // debouncedFetchSearchResults(value.trim())
643
+ // } else {
644
+ // debouncedFetchSearchResults.cancel()
645
+ // dispatch({ type: ActionTypes.DisplayInitialCities })
646
+ // }
647
+ console.log(value);
648
+ }, [debouncedFetchSearchResults, dispatch]);
649
+ useOutsideClick.useOutsideClick(inputSpecialtyWrapperRef, () => {
650
+ dispatch({ type: ActionTypes.ClickOutsideInputSpecialty });
651
+ });
652
+ return (React__default["default"].createElement(StyleSearchSpecialtyWrapper, { ref: inputSpecialtyWrapperRef },
653
+ React__default["default"].createElement(core.Input.Wrapper, null,
654
+ React__default["default"].createElement(core.Input, { size: isMobile ? 'md' : 'lg', placeholder: t('booking.searchPopup.specialties'), value: ((_a = state === null || state === void 0 ? void 0 : state.selectedSpecialty) === null || _a === void 0 ? void 0 : _a.name) || '', rightSection: React__default["default"].createElement(ChevronDown.ChevronDown, null), styles: styleSpecialties, onFocus: () => dispatch({ type: ActionTypes.FocusInputSpecialty }), onChange: (event) => {
655
+ handleSearchSpecialtyInputChange(event.target.value);
656
+ } })),
657
+ state.focused === 'specialty' && (React__default["default"].createElement(StyleResultWrapper$1, null,
658
+ React__default["default"].createElement(StyledSpecialtyItem, { key: "all-location", role: "button", tabIndex: 0, onClick: () => {
659
+ if (onSpecialtyClick) {
660
+ onSpecialtyClick({
661
+ name: t('booking.searchBar.allSpecialties'),
662
+ id: -1,
663
+ thumbnail: '',
664
+ total_doctor: 0,
665
+ slug: slugs.SPECIALTIES,
666
+ });
667
+ }
668
+ } },
669
+ React__default["default"].createElement("div", { className: "image-item" },
670
+ React__default["default"].createElement(SpecialtyIcon, null)),
671
+ React__default["default"].createElement(index$1.Text, { size: "md" }, t('booking.searchBar.allSpecialties'))),
672
+ state.allSpecialties.map((specialty) => (React__default["default"].createElement(StyledSpecialtyItem, { key: specialty.id, onClick: (evt) => {
673
+ evt.nativeEvent.stopImmediatePropagation();
674
+ if (onSpecialtyClick) {
675
+ onSpecialtyClick(Object.assign(Object.assign({}, specialty), { total_doctor: 0 }));
676
+ }
677
+ }, role: "button", tabIndex: 0, "aria-label": `Select ${specialty.name} as location`, isSelected: (selectedLocation === null || selectedLocation === void 0 ? void 0 : selectedLocation.id) === specialty.id },
678
+ React__default["default"].createElement("div", { className: "image-item" },
679
+ React__default["default"].createElement("img", { src: specialty.thumbnail, alt: specialty.name })),
680
+ React__default["default"].createElement(index$1.Text, { size: "md" }, specialty.name))))))));
681
+ };
682
+
683
+ const SearchInputs = ({ state, type, isMobile, isLoading, initalSearchValue, typeInformation, debouncedFetchSearchResults, trackingAttributes, hideSpecialtySelection = false, clientSlug = '', focusSearchInput, onSearch, onEnterSearch, dispatch, }) => {
684
+ var _a;
685
+ const { t } = useTranslations.useTranslations();
686
+ const inputSearchWrapperRef = React.useRef(null);
687
+ const gaAttributes = React.useMemo(() => {
688
+ if (trackingAttributes) {
689
+ return {
690
+ 'data-event-category': trackingAttributes.dataEventCategory,
691
+ 'data-event-action': trackingAttributes.dataEventAction,
692
+ 'data-event-label': trackingAttributes.dataEventLabel,
693
+ };
694
+ }
695
+ else {
696
+ return {};
697
+ }
698
+ }, [trackingAttributes]);
699
+ const placeholderSearch = React.useMemo(() => {
700
+ if (type === 'doctor') {
701
+ return t('booking.searchBar.placeholder.doctor');
702
+ }
703
+ if (type === 'service') {
704
+ return t('booking.searchBar.placeholder.service');
705
+ }
706
+ if (type === 'hospital') {
707
+ return t('booking.searchBar.placeholder.hospital');
708
+ }
709
+ if (type === 'specialty') {
710
+ return t('booking.searchBar.placeholder.specialty');
711
+ }
712
+ return '';
713
+ }, [type]);
714
+ const styleInputWrapper = React.useMemo(() => {
715
+ return {
716
+ root: {
717
+ flex: 1,
718
+ '&.hide-specialty-selection': {
719
+ '.mantine-Input-rightSection': {
720
+ display: 'none',
721
+ },
722
+ input: {
723
+ paddingLeft: '48px',
724
+ },
725
+ '.mantine-Input-icon': {
726
+ left: '0',
727
+ },
728
+ },
729
+ },
730
+ };
731
+ }, []);
732
+ const styleInput = React.useMemo(() => {
733
+ return {
734
+ icon: {
735
+ left: '165px',
736
+ },
737
+ input: {
738
+ color: '#262626',
739
+ '&[data-with-icon="true"]': {
740
+ paddingLeft: '205px',
741
+ paddingRight: '16px',
742
+ },
743
+ },
744
+ rightSection: {
745
+ left: 0,
746
+ width: '165px',
747
+ padding: '1px',
748
+ },
749
+ };
750
+ }, []);
751
+ const styleInputSpecialties = React.useMemo(() => {
752
+ return {
753
+ input: {
754
+ color: '#262626',
755
+ },
756
+ };
757
+ }, []);
758
+ useOutsideClick.useOutsideClick(inputSearchWrapperRef, () => {
759
+ dispatch({ type: ActionTypes.ClickOutsideInputSearch });
760
+ });
761
+ const handleSearchInputChange = React.useCallback(function handleSearchInputChange(value) {
762
+ dispatch({ type: ActionTypes.ChangeInputSearch, payload: value });
763
+ if (typeof onSearch === 'function') {
764
+ return;
765
+ }
766
+ if (value.trim().length > SEARCH_KEYWORD_MIN_LENGTH[state.locale] ||
767
+ initalSearchValue ||
768
+ value.trim().length === 0) {
769
+ debouncedFetchSearchResults(value.trim(), state, type, clientSlug);
770
+ }
771
+ else {
772
+ debouncedFetchSearchResults.cancel();
773
+ dispatch({ type: ActionTypes.DisplayInitialSearchResults });
774
+ }
775
+ }, [dispatch, state, type]);
776
+ const handleSpecialtyClick = React.useCallback(function handleSpecialtyClick(specialty) {
777
+ dispatch({ type: ActionTypes.SelectSpecialty, payload: specialty });
778
+ focusSearchInput();
779
+ }, [dispatch]);
780
+ const inputOnKeyDown = React.useCallback((e) => {
781
+ if (e.keyCode === 13) {
782
+ e.stopPropagation();
783
+ e.preventDefault();
784
+ onEnterSearch && onEnterSearch();
785
+ }
786
+ }, [onEnterSearch]);
787
+ return (React__default["default"].createElement(StyleSearchInputsWrapper, { ref: inputSearchWrapperRef }, type === 'specialty' ? (React__default["default"].createElement(core.Input.Wrapper, { styles: styleInputWrapper },
788
+ React__default["default"].createElement(core.Input, { icon: React__default["default"].createElement(core$1.Search, null), size: isMobile ? 'md' : 'lg', placeholder: placeholderSearch, styles: styleInputSpecialties, value: state.searchKeywords, onFocus: () => dispatch({ type: ActionTypes.FocusInputSearchSpecialty }), onChange: (event) => {
789
+ handleSearchInputChange(event.target.value);
790
+ }, onKeyDown: inputOnKeyDown }))) : (React__default["default"].createElement(React__default["default"].Fragment, null,
791
+ type === 'service' ? (React__default["default"].createElement(core.Input.Wrapper, { styles: styleInputWrapper },
792
+ React__default["default"].createElement(core.Input, { icon: React__default["default"].createElement(core$1.Search, null), size: isMobile ? 'md' : 'lg', name: "search-results", placeholder: placeholderSearch, onFocus: () => dispatch({ type: ActionTypes.FocusInputSearch }), value: state.searchKeywords, onChange: (event) => {
793
+ handleSearchInputChange(event.target.value);
794
+ }, onKeyDown: inputOnKeyDown }))) : (React__default["default"].createElement(React__default["default"].Fragment, null, isMobile && !hideSpecialtySelection ? (React__default["default"].createElement(React__default["default"].Fragment, null,
795
+ React__default["default"].createElement(SearchSpecialty, { state: state, isMobile: isMobile, dispatch: dispatch, debouncedFetchSearchResults: debouncedFetchSearchResults, onSpecialtyClick: handleSpecialtyClick }),
796
+ React__default["default"].createElement(core.Input.Wrapper, { styles: styleInputWrapper },
797
+ React__default["default"].createElement(core.Input, { icon: React__default["default"].createElement(core$1.Search, null), size: "md", placeholder: placeholderSearch, value: state.searchKeywords, name: "search-results", onFocus: () => dispatch({ type: ActionTypes.FocusInputSearch }), onChange: (event) => {
798
+ handleSearchInputChange(event.target.value);
799
+ }, onKeyDown: inputOnKeyDown })))) : (React__default["default"].createElement(core.Input.Wrapper, { styles: styleInputWrapper, className: hideSpecialtySelection ? 'hide-specialty-selection' : '' },
800
+ React__default["default"].createElement(core.Input, Object.assign({ icon: React__default["default"].createElement(core$1.Search, null), size: "lg", placeholder: placeholderSearch, styles: styleInput, name: "search-results", autoComplete: "off", value: state.searchKeywords, onChange: (event) => {
801
+ handleSearchInputChange(event.target.value);
802
+ }, onFocus: () => dispatch({ type: ActionTypes.FocusInputSearch }), onKeyDown: inputOnKeyDown }, gaAttributes, { rightSection: hideSpecialtySelection ? (React__default["default"].createElement(React__default["default"].Fragment, null)) : (React__default["default"].createElement(SearchSpecialty, { state: state, isMobile: isMobile, dispatch: dispatch, debouncedFetchSearchResults: debouncedFetchSearchResults, onSpecialtyClick: handleSpecialtyClick })) })))))),
803
+ state.focused === 'search' && (React__default["default"].createElement(StyleResultWrapper$2, null,
804
+ React__default["default"].createElement(SearchResult, { type: type, state: state, results: ((_a = state.searchResults) === null || _a === void 0 ? void 0 : _a[type]) || [], location: state.selectedLocation.name, dispatch: dispatch, isLoading: isLoading, typeInformation: typeInformation, clientSlug: clientSlug })))))));
805
+ };
806
+
807
+ const StyleSearchLocationWrapper = styled__default["default"].div `
808
+ position: relative;
809
+
810
+ ${utils.MediaQueries.mbDown} {
811
+ width: 100%;
812
+ display: flex;
813
+ flex-direction: column;
814
+ gap: 12px;
815
+ }
816
+ `;
817
+ const StyleResultWrapper = styled__default["default"].div `
818
+ position: absolute;
819
+ top: calc(100% + 2px);
820
+ width: 100%;
821
+ border-radius: 4px;
822
+ background: ${miscTheme.theme.colors.white};
823
+ box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1);
824
+ z-index: 10;
825
+
826
+ ${utils.MediaQueries.mbDown} {
827
+ width: calc(100% + 64px);
828
+ left: -32px;
829
+ }
830
+ `;
831
+ const StyledLocationItem = styled__default["default"].li `
832
+ position: relative;
833
+ cursor: pointer;
834
+ padding: 12px 18px;
835
+ display: flex;
836
+ align-items: center;
837
+ gap: 14px;
838
+ overflow: hidden;
839
+
840
+ ${({ isSelected }) => isSelected &&
841
+ `
842
+ &::after {
843
+ content: ${utils$1.checkMarkIconUrl};
844
+ top: 50%;
845
+ right: 18px;
846
+ position: absolute;
847
+ transform: translateY(-50%);
848
+ }
849
+ `}
850
+
851
+ & + li::before {
852
+ content: '';
853
+ position: absolute;
854
+ left: 18px;
855
+ right: 18px;
856
+ top: 0;
857
+ height: 1px;
858
+ background-color: ${miscTheme.theme.colors.neutral100};
859
+ }
860
+
861
+ &:not([data-is-denied='true']):hover {
862
+ background-color: ${miscTheme.theme.colors.neutral50};
863
+ }
864
+
865
+ &:last-child:hover {
866
+ border-bottom-right-radius: 6px;
867
+ border-bottom-left-radius: 6px;
868
+ }
869
+
870
+ &:first-child:hover {
871
+ border-top-right-radius: 6px;
872
+ border-top-left-radius: 6px;
873
+ }
874
+
875
+ &[data-is-denied='true'] {
876
+ cursor: not-allowed;
877
+ }
878
+ `;
879
+ const StyledPinIcon = styled__default["default"](utils$1.PinIcon) `
880
+ width: 12px;
881
+ height: 18px;
882
+ flex: 0 0 12px;
883
+ `;
884
+
885
+ const SearchLocation = ({ state, isMobile, debouncedFetchCitiesByKeyword, selectedLocation, trackingAttributes, onLocationClick, dispatch, }) => {
886
+ const { t, locale } = useTranslations.useTranslations();
887
+ const inputLocationWrapperRef = React.useRef(null);
888
+ const gaAttributes = React.useMemo(() => {
889
+ if (trackingAttributes) {
890
+ return {
891
+ 'data-event-category': trackingAttributes.dataEventCategory,
892
+ 'data-event-action': trackingAttributes.dataEventAction,
893
+ 'data-event-label': trackingAttributes.dataEventLabel,
894
+ };
895
+ }
896
+ else {
897
+ return {};
898
+ }
899
+ }, [trackingAttributes]);
900
+ const handleSearchLocationInputChange = React.useCallback(function handleSearchLocationInputChange(value) {
901
+ dispatch({ type: ActionTypes.ChangeInputLocation, payload: value });
902
+ if (value.trim().length > SEARCH_KEYWORD_MIN_LENGTH[state.locale]) {
903
+ debouncedFetchCitiesByKeyword(value.trim());
904
+ }
905
+ else {
906
+ debouncedFetchCitiesByKeyword.cancel();
907
+ dispatch({ type: ActionTypes.DisplayInitialCities });
908
+ }
909
+ }, [debouncedFetchCitiesByKeyword, dispatch]);
910
+ useOutsideClick.useOutsideClick(inputLocationWrapperRef, () => {
911
+ dispatch({ type: ActionTypes.ClickOutsideInputLocation });
912
+ });
913
+ return (React__default["default"].createElement(StyleSearchLocationWrapper, { ref: inputLocationWrapperRef },
914
+ React__default["default"].createElement(core.Input.Wrapper, null,
915
+ React__default["default"].createElement(core.Input, Object.assign({ size: isMobile ? 'md' : 'lg', placeholder: "Search location", value: state.searchLocationKeywords, onFocus: () => dispatch({ type: ActionTypes.FocusInputLocation }), onChange: (event) => {
916
+ handleSearchLocationInputChange(event.target.value);
917
+ } }, gaAttributes))),
918
+ state.focused === 'location' && (React__default["default"].createElement(StyleResultWrapper, null,
919
+ React__default["default"].createElement(StyledLocationItem, { key: "all-location", role: "button", tabIndex: 0, onClick: () => {
920
+ var _a;
921
+ if (onLocationClick) {
922
+ onLocationClick({
923
+ name: t('booking.searchBar.allLocations'),
924
+ id: constants.ID_OPTION_ALL_LOCATION,
925
+ slug: (_a = constants.LOCALIZED_SLUGS[locale]) === null || _a === void 0 ? void 0 : _a.ALL,
926
+ });
927
+ }
928
+ } },
929
+ React__default["default"].createElement(StyledPinIcon, { color: miscTheme.theme.colors.neutral400 }),
930
+ React__default["default"].createElement(index$1.Text, { size: "md" }, t('booking.searchBar.allLocations'))),
931
+ state.cities.map((city) => (React__default["default"].createElement(StyledLocationItem, { key: city.id, onClick: (evt) => {
932
+ evt.nativeEvent.stopImmediatePropagation();
933
+ if (onLocationClick) {
934
+ onLocationClick(city);
935
+ }
936
+ }, role: "button", tabIndex: 0, "aria-label": `Select ${city.name} as location`, isSelected: (selectedLocation === null || selectedLocation === void 0 ? void 0 : selectedLocation.id) === city.id },
937
+ React__default["default"].createElement(StyledPinIcon, { color: miscTheme.theme.colors.neutral400 }),
938
+ React__default["default"].createElement(index$1.Text, { size: "md" }, city.name))))))));
939
+ };
940
+
941
+ const StyleSpecialtiesWrapper = styled__default["default"].div `
942
+ display: flex;
943
+ flex-wrap: wrap;
944
+ row-gap: 8px;
945
+ column-gap: 20px;
946
+ ${utils.MediaQueries.mbDown} {
947
+ margin-top: 12px;
948
+ }
949
+ `;
950
+ const StyleSpecialtyItem = styled__default["default"].div `
951
+ display: flex;
952
+ align-items: center;
953
+ border-radius: 8px;
954
+ border: 1px solid ${miscTheme.theme.colors.neutral100};
955
+ background: ${miscTheme.theme.colors.white};
956
+ padding: 8px 12px 8px 8px;
957
+ flex: 0 0 calc(33.3% - 13px);
958
+ gap: 12px;
959
+ cursor: pointer;
960
+
961
+ &:hover {
962
+ background: ${miscTheme.theme.colors.blue50};
963
+ }
964
+
965
+ ${utils.MediaQueries.tdDown} {
966
+ flex: 0 0 calc(50% - 10px);
967
+ }
968
+
969
+ ${utils.MediaQueries.mbDown} {
970
+ flex: 0 0 100%;
971
+ border: none;
972
+ }
973
+
974
+ .image-item {
975
+ display: flex;
976
+ align-items: center;
977
+ width: 40px;
978
+ height: 40px;
979
+
980
+ img {
981
+ width: 100%;
982
+ object-fit: cover;
983
+ }
984
+ }
985
+
986
+ .infor {
987
+ flex: 1;
988
+ .title {
989
+ color: ${miscTheme.theme.colors.gray800};
990
+ font-size: 14px;
991
+ font-style: normal;
992
+ font-weight: 400;
993
+ line-height: 22px;
994
+ }
995
+
996
+ .description {
997
+ color: ${miscTheme.theme.colors.gray600};
998
+ font-size: 12px;
999
+ font-weight: 400;
1000
+ line-height: 18px;
1001
+ }
1002
+ }
1003
+ `;
1004
+ const StyleDivider = styled__default["default"](core.Divider) `
1005
+ margin: 24px 0 !important;
1006
+ `;
1007
+ const StyleShowMore = styled__default["default"].div `
1008
+ display: flex;
1009
+ justify-content: center;
1010
+ margin-top: 24px;
1011
+ .show-more {
1012
+ border-radius: 4px;
1013
+ border: 1px solid ${miscTheme.theme.colors.neutral200};
1014
+ padding: 12px 16px;
1015
+ cursor: pointer;
1016
+ display: inline-block;
1017
+ color: ${miscTheme.theme.colors.gray800};
1018
+ font-size: 16px;
1019
+ font-weight: 600;
1020
+ line-height: 24px;
1021
+
1022
+ ${utils.MediaQueries.mbDown} {
1023
+ width: 100%;
1024
+ text-align: center;
1025
+ }
1026
+ }
1027
+ `;
1028
+
1029
+ const SearchResultSpecialties = ({ state, isMobile, specialties, isLoading, dispatch, }) => {
1030
+ const { t, locale } = useTranslations.useTranslations();
1031
+ const { selectedLocation } = state;
1032
+ const slugs = React.useMemo(() => constants.LOCALIZED_SLUGS[locale], [locale]);
1033
+ const handleOnClick = (specialtySlug) => {
1034
+ let url = '';
1035
+ if (specialtySlug === constants.SLUG_VACIN_ID) {
1036
+ url = `/${selectedLocation.slug}/${slugs.HOSPITAL}/${constants.CLIENT_KEY.GSK}/`;
1037
+ dispatch({ type: ActionTypes.ClickOutsideInputSearchSpecialty });
1038
+ }
1039
+ else {
1040
+ url = `/${selectedLocation.slug}/${slugs.DOCTOR}/${specialtySlug}`;
1041
+ }
1042
+ dispatch({ type: ActionTypes.NavigateTo, payload: url });
1043
+ };
1044
+ const handleShowMore = () => {
1045
+ const url = `/${slugs.SPECIALTIES}`;
1046
+ dispatch({ type: ActionTypes.NavigateTo, payload: url });
1047
+ };
1048
+ const showSeeMore = React.useMemo(() => {
1049
+ return (specialties.length >= 9 ||
1050
+ state.searchKeywords.trim().length <=
1051
+ SEARCH_KEYWORD_MIN_LENGTH[state.locale]);
1052
+ }, [state.searchKeywords, specialties]);
1053
+ return (React__default["default"].createElement(React__default["default"].Fragment, null,
1054
+ !isMobile && React__default["default"].createElement(StyleDivider, { color: "#E4E8EC" }),
1055
+ React__default["default"].createElement(StyleSpecialtiesWrapper, null,
1056
+ specialties.length > 0 && !isLoading && (React__default["default"].createElement(React__default["default"].Fragment, null, specialties.map((specialty, index) => {
1057
+ if (index >= 9) {
1058
+ return React__default["default"].createElement(React__default["default"].Fragment, null);
1059
+ }
1060
+ return (React__default["default"].createElement(StyleSpecialtyItem, { key: specialty.id, onClick: () => handleOnClick(specialty.slug) },
1061
+ React__default["default"].createElement("div", { className: "image-item" },
1062
+ React__default["default"].createElement("img", { src: specialty.thumbnail, alt: specialty.name })),
1063
+ React__default["default"].createElement("div", { className: "infor" },
1064
+ React__default["default"].createElement("div", { className: "title" }, specialty.name))));
1065
+ }))),
1066
+ specialties.length === 0 && !isLoading && (React__default["default"].createElement(index$1.Text, { size: "sm", color: miscTheme.theme.colors.gray400 }, t('booking.searchBar.noResults'))),
1067
+ isLoading &&
1068
+ Array(6)
1069
+ .fill(undefined)
1070
+ .map((_, i) => (React__default["default"].createElement(StyleSpecialtyItem, { key: 'loading' + i },
1071
+ React__default["default"].createElement("div", { className: "image-item" },
1072
+ React__default["default"].createElement(core.Skeleton, { height: 40, animate: true })),
1073
+ React__default["default"].createElement("div", { className: "infor" },
1074
+ React__default["default"].createElement("div", { className: "title" },
1075
+ React__default["default"].createElement(core.Skeleton, { height: 20, radius: "sm", animate: true }))))))),
1076
+ showSeeMore && (React__default["default"].createElement(StyleShowMore, null,
1077
+ React__default["default"].createElement("div", { className: "show-more", onClick: handleShowMore }, t('home.seeAll'))))));
1078
+ };
1079
+
1080
+ const StyleSearchTagWrapper = styled__default["default"].div `
1081
+ display: flex;
1082
+ gap: 5px;
1083
+ margin-top: 16px;
1084
+ flex-wrap: wrap;
1085
+ `;
1086
+ const StyleTagItem = styled__default["default"].div `
1087
+ color: ${miscTheme.theme.colors.gray600};
1088
+ font-size: 14px;
1089
+ font-weight: 600;
1090
+ line-height: 22px;
1091
+ padding: 4px 12px;
1092
+ background: ${miscTheme.theme.colors.white};
1093
+ border-radius: 32px;
1094
+ cursor: pointer;
1095
+ border: 1px solid ${miscTheme.theme.colors.white};
1096
+ margin-bottom: 5px;
1097
+ border-color: ${miscTheme.theme.colors.neutral100};
1098
+ background: #f7f9fc;
1099
+
1100
+ &.view-all {
1101
+ border-radius: 32px;
1102
+ border-color: ${miscTheme.theme.colors.blue50};
1103
+ background: ${miscTheme.theme.colors.blue50};
1104
+ color: ${miscTheme.theme.colors.blue600};
1105
+
1106
+ &:hover {
1107
+ border-color: ${miscTheme.theme.colors.blue50};
1108
+ background: ${miscTheme.theme.colors.blue50};
1109
+ color: ${miscTheme.theme.colors.blue600};
1110
+ }
1111
+ }
1112
+
1113
+ &:hover {
1114
+ border-color: ${miscTheme.theme.colors.neutral100};
1115
+ background: #f7f9fc;
1116
+ }
1117
+ `;
1118
+ const StyleTagLabel = styled__default["default"].div `
1119
+ color: ${miscTheme.theme.colors.gray600};
1120
+ font-size: 14px;
1121
+ font-weight: 600;
1122
+ line-height: 22px;
1123
+ padding: 4px 0;
1124
+ background: ${miscTheme.theme.colors.white};
1125
+ border-radius: 32px;
1126
+ border: 1px solid ${miscTheme.theme.colors.white};
1127
+ margin-bottom: 5px;
1128
+ margin-right: 7px;
1129
+ `;
1130
+
1131
+ const SearchTag = ({ state, type, typeInformation, dispatch }) => {
1132
+ const { t } = useTranslations.useTranslations();
1133
+ const { selectedLocation } = state;
1134
+ const typeSlug = React.useMemo(() => typeInformation[type].slug, [typeInformation, type]);
1135
+ const handleViewAll = () => {
1136
+ const url = `/${selectedLocation.slug}/${typeSlug}`;
1137
+ if (url) {
1138
+ dispatch({ type: ActionTypes.NavigateTo, payload: url });
1139
+ }
1140
+ };
1141
+ const handleClickKeyword = (keyword) => {
1142
+ if (keyword.url) {
1143
+ window.location.href = keyword.url;
1144
+ }
1145
+ };
1146
+ return (React__default["default"].createElement(StyleSearchTagWrapper, null,
1147
+ React__default["default"].createElement(StyleTagLabel, null, t('booking.searchBar.popularKey')),
1148
+ state.popularKeys.map((item) => {
1149
+ return (React__default["default"].createElement(StyleTagItem, { key: item.id, onClick: () => handleClickKeyword(item) }, item.keyword));
1150
+ }),
1151
+ React__default["default"].createElement(StyleTagItem, { className: "view-all", onClick: handleViewAll }, t('booking.searchBar.viewAll'))));
1152
+ };
1153
+
1154
+ const StyledTabWrapper = styled__default["default"].div `
1155
+ background: rgba(255, 255, 255, 0.64);
1156
+ backdrop-filter: blur(12px);
1157
+ border-bottom: 1px solid ${miscTheme.theme.colors.neutral100};
1158
+ `;
1159
+ const StyleTabContainer = styled__default["default"](index.Container) `
1160
+ padding: 0 16px;
1161
+ `;
1162
+
1163
+ const itemTabs = () => {
1164
+ const { t } = useTranslations.useTranslations();
1165
+ return [
1166
+ {
1167
+ value: 'hospital',
1168
+ label: t('booking.searchPopup.hospitals'),
1169
+ },
1170
+ {
1171
+ value: 'doctor',
1172
+ label: t('booking.searchPopup.doctors'),
1173
+ },
1174
+ {
1175
+ value: 'service',
1176
+ label: t('booking.searchPopup.services'),
1177
+ },
1178
+ {
1179
+ value: 'specialty',
1180
+ label: t('booking.searchPopup.specialties'),
1181
+ },
1182
+ ];
1183
+ };
1184
+ const TabSearch = ({ currentTab, hideTabBookingSearch = [], isMobile, setCurrentTab, }) => {
1185
+ const stylesTabs = React.useMemo(() => {
1186
+ return {
1187
+ root: {
1188
+ overflowY: isMobile ? 'hidden' : 'initial',
1189
+ overflowX: isMobile ? 'auto' : 'initial',
1190
+ },
1191
+ tabsList: {
1192
+ background: 'rgba(255, 255, 255, 0)',
1193
+ borderBottom: 'none',
1194
+ flexWrap: 'nowrap',
1195
+ '.mantine-Tabs-tab': {
1196
+ '&:last-child': {
1197
+ '&:after': {
1198
+ display: 'none',
1199
+ },
1200
+ },
1201
+ },
1202
+ },
1203
+ tab: {
1204
+ padding: isMobile ? '12px 16px 12px 16px' : '15px 40px 15px 40px',
1205
+ borderTop: '2px solid transparent',
1206
+ borderBottom: 'none',
1207
+ margin: 0,
1208
+ borderRadius: 0,
1209
+ position: 'relative',
1210
+ width: 'auto',
1211
+ '&[data-active="true"]': {
1212
+ borderColor: '#2d87f3',
1213
+ backgroundColor: '#ffffff',
1214
+ '&:after': {
1215
+ display: 'none',
1216
+ },
1217
+ '&:before': {
1218
+ content: '""',
1219
+ width: '100%',
1220
+ height: '1px',
1221
+ position: 'absolute',
1222
+ backgroundColor: '#ffffff',
1223
+ bottom: '-1px',
1224
+ },
1225
+ },
1226
+ '&:hover': {
1227
+ borderColor: '#2d87f3',
1228
+ backgroundColor: '#ffffff',
1229
+ '&:before': {
1230
+ content: '""',
1231
+ width: '100%',
1232
+ height: '1px',
1233
+ position: 'absolute',
1234
+ backgroundColor: '#ffffff',
1235
+ bottom: '-1px',
1236
+ },
1237
+ },
1238
+ '&:after': {
1239
+ content: '""',
1240
+ width: '1px',
1241
+ height: '24px',
1242
+ backgroundColor: '#E4E8EC',
1243
+ position: 'absolute',
1244
+ right: '-1px',
1245
+ },
1246
+ },
1247
+ tabLabel: {
1248
+ color: '#595959',
1249
+ fontSize: isMobile ? '14px' : '16px',
1250
+ fontWeight: 600,
1251
+ lineHeight: isMobile ? '22px' : '24px',
1252
+ },
1253
+ };
1254
+ }, [isMobile]);
1255
+ const tabConfig = itemTabs();
1256
+ const activeTabs = React.useMemo(() => {
1257
+ return (tabConfig.filter((item) => !hideTabBookingSearch.includes(item.value)) ||
1258
+ []);
1259
+ }, [hideTabBookingSearch, tabConfig]);
1260
+ return (React__default["default"].createElement(StyledTabWrapper, { className: "booking-search-tab" },
1261
+ React__default["default"].createElement(StyleTabContainer, null,
1262
+ React__default["default"].createElement(core.Tabs, { value: currentTab, onTabChange: (tab) => {
1263
+ setCurrentTab(tab);
1264
+ }, styles: stylesTabs },
1265
+ React__default["default"].createElement(core.Tabs.List, null, activeTabs.map((tab) => {
1266
+ return (React__default["default"].createElement(core.Tabs.Tab, { value: tab.value, key: tab.value }, tab.label));
1267
+ }))))));
1268
+ };
1269
+
1270
+ var TypePopularKeySearch;
1271
+ (function (TypePopularKeySearch) {
1272
+ TypePopularKeySearch["doctor"] = "doctor";
1273
+ TypePopularKeySearch["service"] = "hospital_service";
1274
+ TypePopularKeySearch["hospital"] = "hospital_branch";
1275
+ })(TypePopularKeySearch || (TypePopularKeySearch = {}));
1276
+
1277
+ function useSearchBarApi({ dispatch, careApiDomain, locale = 'vi-VN', client = '', }) {
1278
+ const fetchCitiesApi = React.useCallback(function fetchCitiesApi(path, params = {}) {
1279
+ const url = `${careApiDomain}${path}`;
1280
+ dispatch({ type: ActionTypes.FetchCitiesStart });
1281
+ return fetch(utils$1.getApiPath(url, params, locale), { method: 'GET' })
1282
+ .then((res) => res.json())
1283
+ .then((data) => {
1284
+ if (data._status !== 1 || !data._data) {
1285
+ console.log('error loading cities', data);
1286
+ return Promise.reject(data);
1287
+ }
1288
+ return data === null || data === void 0 ? void 0 : data._data;
1289
+ })
1290
+ .finally(() => dispatch({ type: ActionTypes.FetchCitiesFinish }));
1291
+ }, [locale]);
1292
+ const fetchCitiesByLocation = React.useCallback(function fetchCitiesByLocation({ coordinates }) {
1293
+ let params = {};
1294
+ const moreParams = {};
1295
+ if (coordinates) {
1296
+ params = {
1297
+ lat: coordinates.lat,
1298
+ lng: coordinates.lng,
1299
+ };
1300
+ }
1301
+ if (locale === 'ms-MY') {
1302
+ moreParams.noPaging = 1;
1303
+ }
1304
+ const requests = [
1305
+ fetchCitiesApi(paths.PATHS.GET_CITY_BY_IP, Object.assign(Object.assign(Object.assign({}, params), moreParams), { client: constants.CLIENT_KEY.MSD === client ? '' : client })),
1306
+ ];
1307
+ if (locale === 'zh-TW') {
1308
+ requests.push(fetchCitiesApi(paths.PATHS.GET_CITIES_LIST, {
1309
+ noPaging: 1,
1310
+ client: constants.CLIENT_KEY.MSD === client ? '' : client,
1311
+ }));
1312
+ }
1313
+ return Promise.all(requests)
1314
+ .then(([data1, data2]) => {
1315
+ const data = Object.assign({}, data1);
1316
+ if (data2) {
1317
+ const citiesIds = data.cities.map((c) => c.id);
1318
+ data.cities = data.cities.concat(data2.cities.filter((c) => !citiesIds.includes(c.id)));
1319
+ }
1320
+ dispatch({
1321
+ type: ActionTypes.FetchCitiesByGeoIpComplete,
1322
+ payload: data,
1323
+ });
1324
+ })
1325
+ .catch((err) => console.error('error loading cities by location', err));
1326
+ }, [locale, careApiDomain, dispatch]);
1327
+ const fetchCitiesByKeyword = React.useCallback(function fetchCitiesByKeyword(keyword) {
1328
+ return fetchCitiesApi(paths.PATHS.GET_CITIES_LIST, {
1329
+ keyword,
1330
+ client,
1331
+ })
1332
+ .then((data) => {
1333
+ dispatch({
1334
+ type: ActionTypes.FetchCitiesByKeywordComplete,
1335
+ payload: data.cities,
1336
+ });
1337
+ })
1338
+ .catch((err) => console.error('error loading cities by keyword', err));
1339
+ }, [locale, careApiDomain, dispatch]);
1340
+ const fetchSearchResults = React.useCallback(function fetchSearchResults(searchKeywords, state, searchType, clientSlug, cacheResult) {
1341
+ const url = searchType === 'specialty'
1342
+ ? `${careApiDomain}${paths.PATHS.GET_SEARCH_SPECIALTY}`
1343
+ : `${careApiDomain}${paths.PATHS.GET_SEARCH_V2}`;
1344
+ dispatch({ type: ActionTypes.FetchSearchResultsStart });
1345
+ const { selectedLocation, geoLocationCoordinates, selectedSpecialty } = state;
1346
+ let cityId = '';
1347
+ if (!selectedLocation) {
1348
+ dispatch({ type: ActionTypes.FetchSearchResultsFinish });
1349
+ return;
1350
+ }
1351
+ if (selectedLocation.id === constants.ID_OPTION_ALL_LOCATION) {
1352
+ cityId = '';
1353
+ }
1354
+ else {
1355
+ cityId = selectedLocation.id;
1356
+ }
1357
+ const lat = (geoLocationCoordinates === null || geoLocationCoordinates === void 0 ? void 0 : geoLocationCoordinates.lat) || '';
1358
+ const lng = (geoLocationCoordinates === null || geoLocationCoordinates === void 0 ? void 0 : geoLocationCoordinates.lng) || '';
1359
+ const specialty_id = (selectedSpecialty === null || selectedSpecialty === void 0 ? void 0 : selectedSpecialty.id) > 0 ? selectedSpecialty === null || selectedSpecialty === void 0 ? void 0 : selectedSpecialty.id : '';
1360
+ const keyword = searchKeywords.trim().length > SEARCH_KEYWORD_MIN_LENGTH[locale]
1361
+ ? searchKeywords.trim()
1362
+ : '';
1363
+ return fetch(utils$1.getApiPath(url, {
1364
+ domain: careApiDomain,
1365
+ searchType: searchType || 'global',
1366
+ keyword: keyword,
1367
+ city: cityId === constants.ID_OPTION_CURRENT_LOCATION ? '' : cityId,
1368
+ lat,
1369
+ lng,
1370
+ specialty_id,
1371
+ client_slug: constants.CLIENT_KEY.MSD === clientSlug ? '' : clientSlug,
1372
+ msd: constants.CLIENT_KEY.MSD === client ? 1 : '',
1373
+ }, locale), {
1374
+ method: 'GET',
1375
+ headers: {
1376
+ accept: 'version=2.0.0.0',
1377
+ },
1378
+ })
1379
+ .then((res) => res.json())
1380
+ .then((data) => {
1381
+ if (data._status !== 1 || !data._data) {
1382
+ return Promise.reject(data);
1383
+ }
1384
+ return data === null || data === void 0 ? void 0 : data._data;
1385
+ })
1386
+ .then((results) => {
1387
+ let searchesResult = [];
1388
+ if (searchType !== 'specialty') {
1389
+ searchesResult = results.searches;
1390
+ }
1391
+ if (searchType === 'specialty') {
1392
+ if (keyword) {
1393
+ searchesResult = results.specialties;
1394
+ }
1395
+ else {
1396
+ searchesResult = results.default;
1397
+ }
1398
+ }
1399
+ dispatch({
1400
+ type: ActionTypes.FetchSearchResultsComplete,
1401
+ payload: {
1402
+ key: searchType,
1403
+ searches: searchesResult || [],
1404
+ },
1405
+ });
1406
+ if (cacheResult) {
1407
+ dispatch({
1408
+ type: ActionTypes.UpdateInitialSearchResults,
1409
+ payload: {
1410
+ key: searchType,
1411
+ searches: searchesResult || [],
1412
+ },
1413
+ });
1414
+ }
1415
+ })
1416
+ .catch((error) => {
1417
+ console.log('error loading search results', { url, error });
1418
+ })
1419
+ .finally(() => dispatch({ type: ActionTypes.FetchSearchResultsFinish }));
1420
+ }, [locale, careApiDomain, dispatch]);
1421
+ const fetchAllSpecialties = React.useCallback(function fetchSearchSpecialties() {
1422
+ const url = `${careApiDomain}${paths.PATHS.GET_SEARCH_SPECIALTY}`;
1423
+ return fetch(utils$1.getApiPath(url, {
1424
+ domain: careApiDomain,
1425
+ searchType: '',
1426
+ msd: constants.CLIENT_KEY.MSD === client ? 1 : '',
1427
+ }, locale), {
1428
+ method: 'GET',
1429
+ headers: {
1430
+ accept: 'version=2.0.0.0',
1431
+ },
1432
+ })
1433
+ .then((res) => res.json())
1434
+ .then((data) => {
1435
+ if (data._status !== 1 || !data._data) {
1436
+ return Promise.reject(data);
1437
+ }
1438
+ return data === null || data === void 0 ? void 0 : data._data;
1439
+ })
1440
+ .then((results) => {
1441
+ dispatch({
1442
+ type: ActionTypes.FetchAllSpecialties,
1443
+ payload: results.specialties || [],
1444
+ });
1445
+ })
1446
+ .catch((error) => {
1447
+ console.log('error loading search results', { url, error });
1448
+ });
1449
+ }, [locale, careApiDomain, dispatch]);
1450
+ const fetchPopularKeys = React.useCallback(function fetchPopularKeys(searchType) {
1451
+ const url = `${careApiDomain}${paths.PATHS.GET_SEARCH_POPULAR_KEY}`;
1452
+ return fetch(utils$1.getApiPath(url, {
1453
+ domain: careApiDomain,
1454
+ searchType: TypePopularKeySearch[searchType],
1455
+ sort_by: 'display_order',
1456
+ sort_order: 'asc',
1457
+ }, locale))
1458
+ .then((res) => res.json())
1459
+ .then((data) => {
1460
+ if (data._status !== 1 || !data._data) {
1461
+ return Promise.reject(data);
1462
+ }
1463
+ return data === null || data === void 0 ? void 0 : data._data;
1464
+ })
1465
+ .then((results) => {
1466
+ dispatch({
1467
+ type: ActionTypes.FetchPopularKeys,
1468
+ payload: results.popular_searches || [],
1469
+ });
1470
+ })
1471
+ .catch((error) => {
1472
+ console.log('error loading search results', { url, error });
1473
+ });
1474
+ }, [locale, careApiDomain, dispatch]);
1475
+ return {
1476
+ fetchCitiesByLocation,
1477
+ fetchCitiesByKeyword,
1478
+ fetchSearchResults,
1479
+ fetchAllSpecialties,
1480
+ fetchPopularKeys,
1481
+ };
1482
+ }
1483
+
1484
+ const BookingSearchBarV2 = ({ isMobile, careApiDomain, geoLocationPermission: geoLocationPermissionFromProps, geoLocationCoordinates: geoLocationCoordinatesFromProps, initialSelectedCity: initialSelectedCityFromProps, initialSearchValue = '', initTypeSearch = 'hospital', initSpecialty, careFrontDomain = '/care', isDebug = false,
1485
+ // askForGeolocationPermission = false,
1486
+ gaTrackingSearchBar, gaTrackingLocationSearch, autoCompleteDisabled = false, inputSearchPlaceholder = '', hideTabBookingSearch = [], hideSpecialtySelection = false, hidePopularSearchKeys = false, clientSlug = '',
1487
+ // isOptionAllLocation = false,
1488
+ // hideResults = [],
1489
+ // isNavResultItem = true,
1490
+ routerPush, onGeoLocationPermissionChange,
1491
+ // onSearch,
1492
+ onChangeLocation, }) => {
1493
+ const { locale, t } = useTranslations.useTranslations();
1494
+ const wrapperRef = React.useRef(null);
1495
+ const inputSearchSpecialtyWrapperRef = React.useRef(null);
1496
+ const [currentTab, setCurrentTab] = React.useState(initTypeSearch);
1497
+ const { geoLocationPermission: geoLocationPermissionFromHook, geoLocationCoordinates: geoLocationCoordinatesFromHook, } = utils$1.useGeolocation();
1498
+ const [state, dispatch] = React.useReducer(reducer, initialState, (s) => (Object.assign(Object.assign({}, s), { isDebug,
1499
+ isMobile, geoLocationPermission: geoLocationPermissionFromProps ||
1500
+ geoLocationPermissionFromHook ||
1501
+ 'unset', geoLocationCoordinates: geoLocationCoordinatesFromProps ||
1502
+ geoLocationCoordinatesFromHook ||
1503
+ null, searchKeywords: initialSearchValue, initialSelectedCity: initialSelectedCityFromProps || null, selectedLocation: initialSelectedCityFromProps || s.selectedLocation || null, searchLocationKeywords: (initialSelectedCityFromProps === null || initialSelectedCityFromProps === void 0 ? void 0 : initialSelectedCityFromProps.name) || s.searchLocationKeywords, autoCompleteDisabled,
1504
+ inputSearchPlaceholder,
1505
+ locale })));
1506
+ const { navigateTo, focusedSpecialty,
1507
+ // isLoadingCities,
1508
+ // cities,
1509
+ searchKeywords, geoLocationPermission, selectedLocation, selectedSpecialty, initialSelectedCity,
1510
+ // defaultCity,
1511
+ searchResults, isLoadingSearchResults,
1512
+ // isMobileModalOpened,
1513
+ // inputSearchPlaceholder,
1514
+ // allSpecialties,
1515
+ } = state;
1516
+ const { fetchCitiesByLocation, fetchCitiesByKeyword, fetchSearchResults, fetchAllSpecialties, fetchPopularKeys, } = useSearchBarApi({
1517
+ dispatch,
1518
+ locale,
1519
+ careApiDomain,
1520
+ client: clientSlug,
1521
+ });
1522
+ const slugs = React.useMemo(() => constants.LOCALIZED_SLUGS[locale], [locale]);
1523
+ const typeInformation = React.useMemo(() => {
1524
+ return {
1525
+ doctor: {
1526
+ name: t('booking.searchPopup.doctors'),
1527
+ icon: React__default["default"].createElement(DoctorIcon, null),
1528
+ slug: slugs.DOCTOR,
1529
+ },
1530
+ service: {
1531
+ name: t('booking.searchPopup.services'),
1532
+ icon: React__default["default"].createElement(ServiceIcon, null),
1533
+ slug: slugs.SERVICE,
1534
+ },
1535
+ hospital: {
1536
+ name: t('booking.searchPopup.hospitals'),
1537
+ icon: React__default["default"].createElement(HospitalIcon, null),
1538
+ slug: slugs.HOSPITAL,
1539
+ },
1540
+ specialty: {
1541
+ name: t('booking.searchPopup.specialties'),
1542
+ icon: React__default["default"].createElement(SpecialtyIcon, null),
1543
+ slug: slugs.SPECIALTIES,
1544
+ },
1545
+ };
1546
+ }, [currentTab]);
1547
+ const debouncedFetchCitiesByKeyword = React.useMemo(() => debounce__default["default"](fetchCitiesByKeyword, 400), [fetchCitiesByKeyword]);
1548
+ const debouncedFetchSearchResults = React.useMemo(() => debounce__default["default"](fetchSearchResults, 400), [fetchSearchResults]);
1549
+ const handleLocationClick = React.useCallback(function handleLocationClick(city) {
1550
+ dispatch({ type: ActionTypes.SelectLocation, payload: city });
1551
+ focusSearchInput();
1552
+ if (onChangeLocation) {
1553
+ onChangeLocation(city);
1554
+ }
1555
+ }, [t, dispatch]);
1556
+ function focusSearchInput() {
1557
+ var _a;
1558
+ if (wrapperRef.current) {
1559
+ (_a = wrapperRef.current
1560
+ .querySelector('input[name="search-results"]')) === null || _a === void 0 ? void 0 : _a.focus();
1561
+ }
1562
+ }
1563
+ function onClickSearchByKeyword() {
1564
+ let url = '';
1565
+ const { slug: typeSlug } = typeInformation[currentTab];
1566
+ let moreParams = '';
1567
+ const slugClientUrl = constants.MAPPING_CLIENT_WITH_SLUG[locale][clientSlug];
1568
+ if ((currentTab === 'doctor' || currentTab === 'hospital') &&
1569
+ state.selectedSpecialty.id > 0) {
1570
+ moreParams = `&specialtyId=${state.selectedSpecialty.id}`;
1571
+ }
1572
+ if (currentTab === 'specialty') {
1573
+ url = `/${typeSlug}`;
1574
+ }
1575
+ else {
1576
+ url = `/${selectedLocation.slug}/${typeSlug}`;
1577
+ }
1578
+ if (slugClientUrl) {
1579
+ url += `/${slugClientUrl}`;
1580
+ }
1581
+ url += `?q=${searchKeywords}${moreParams}`;
1582
+ if (url) {
1583
+ dispatch({ type: ActionTypes.NavigateTo, payload: url });
1584
+ }
1585
+ }
1586
+ useOutsideClick.useOutsideClick(inputSearchSpecialtyWrapperRef, () => {
1587
+ dispatch({ type: ActionTypes.ClickOutsideInputSearchSpecialty });
1588
+ });
1589
+ React.useEffect(() => {
1590
+ var _a;
1591
+ if (geoLocationPermission !== 'denied' && !initialSelectedCity) {
1592
+ dispatch({
1593
+ type: ActionTypes.SelectLocation,
1594
+ payload: {
1595
+ name: t('booking.searchBar.allLocations'),
1596
+ id: constants.ID_OPTION_ALL_LOCATION,
1597
+ slug: (_a = constants.LOCALIZED_SLUGS[locale]) === null || _a === void 0 ? void 0 : _a.ALL,
1598
+ },
1599
+ });
1600
+ }
1601
+ if (onGeoLocationPermissionChange) {
1602
+ onGeoLocationPermissionChange(geoLocationPermission, state.geoLocationCoordinates);
1603
+ }
1604
+ if (isMobile && geoLocationPermission === 'granted' && selectedLocation) {
1605
+ dispatch({ type: ActionTypes.FocusInputSearch });
1606
+ }
1607
+ fetchCitiesByLocation({ coordinates: state.geoLocationCoordinates });
1608
+ }, [geoLocationPermission]);
1609
+ React.useEffect(() => {
1610
+ const defaultSpecialty = initSpecialty
1611
+ ? initSpecialty
1612
+ : {
1613
+ name: t('booking.searchBar.allSpecialties'),
1614
+ id: -1,
1615
+ thumbnail: '',
1616
+ total_doctor: 0,
1617
+ slug: slugs.SPECIALTIES,
1618
+ };
1619
+ if (!state.selectedSpecialty) {
1620
+ dispatch({
1621
+ type: ActionTypes.SelectSpecialty,
1622
+ payload: defaultSpecialty,
1623
+ });
1624
+ }
1625
+ }, [initSpecialty, state.selectedSpecialty]);
1626
+ React.useEffect(() => {
1627
+ fetchAllSpecialties();
1628
+ }, []);
1629
+ React.useEffect(() => {
1630
+ fetchPopularKeys(currentTab);
1631
+ }, [currentTab]);
1632
+ React.useEffect(() => {
1633
+ if (navigateTo) {
1634
+ if (routerPush) {
1635
+ routerPush(navigateTo);
1636
+ }
1637
+ else {
1638
+ window.location.href = `${careFrontDomain}${navigateTo}`;
1639
+ }
1640
+ }
1641
+ }, [navigateTo]);
1642
+ React.useEffect(() => {
1643
+ fetchSearchResults(state.searchKeywords, state, currentTab, clientSlug, true);
1644
+ }, [selectedLocation, selectedSpecialty, currentTab]);
1645
+ return (React__default["default"].createElement(StyledSearchBarWrapper, { ref: wrapperRef },
1646
+ React__default["default"].createElement(TabSearch, { currentTab: currentTab, setCurrentTab: setCurrentTab, isMobile: isMobile, hideTabBookingSearch: hideTabBookingSearch }),
1647
+ React__default["default"].createElement(StyleWrapperContainer, { className: "booking-search-container" },
1648
+ React__default["default"].createElement(StyleSearchInputContainer, null,
1649
+ React__default["default"].createElement(StyleSearchContent, { className: "booking-search-content" },
1650
+ React__default["default"].createElement("div", { ref: inputSearchSpecialtyWrapperRef },
1651
+ React__default["default"].createElement(core.Flex, { gap: "12px", justify: "space-between", align: "center", direction: isMobile ? 'column' : 'row', className: "flex-search-input" },
1652
+ currentTab !== 'specialty' && (React__default["default"].createElement(SearchLocation, { state: state, isMobile: isMobile, dispatch: dispatch, debouncedFetchCitiesByKeyword: debouncedFetchCitiesByKeyword, selectedLocation: selectedLocation, onLocationClick: handleLocationClick, trackingAttributes: gaTrackingLocationSearch })),
1653
+ React__default["default"].createElement(SearchInputs, { type: currentTab, isMobile: isMobile, state: state, dispatch: dispatch, debouncedFetchSearchResults: debouncedFetchSearchResults, initalSearchValue: initialSearchValue, focusSearchInput: focusSearchInput, onEnterSearch: onClickSearchByKeyword, typeInformation: typeInformation, trackingAttributes: gaTrackingSearchBar, isLoading: isLoadingSearchResults, hideSpecialtySelection: hideSpecialtySelection, clientSlug: clientSlug }),
1654
+ React__default["default"].createElement(core.Button, { size: isMobile ? 'md' : 'lg', color: "#2D87F3", fullWidth: isMobile, variant: "filled", onClick: onClickSearchByKeyword, styles: {
1655
+ root: {
1656
+ height: isMobile ? '40px' : '48px',
1657
+ },
1658
+ } }, t('booking.searchBar.searchButton'))),
1659
+ !hidePopularSearchKeys &&
1660
+ currentTab !== 'specialty' &&
1661
+ state.popularKeys.length > 0 && (React__default["default"].createElement(SearchTag, { type: currentTab, state: state, typeInformation: typeInformation, dispatch: dispatch })),
1662
+ currentTab === 'specialty' && focusedSpecialty === 'search' && (React__default["default"].createElement(SearchResultSpecialties, { state: state, isMobile: isMobile, dispatch: dispatch, specialties: (searchResults === null || searchResults === void 0 ? void 0 : searchResults.specialty) || [], isLoading: isLoadingSearchResults }))))))));
1663
+ };
1664
+
1665
+ exports.BookingSearchBarV2 = BookingSearchBarV2;