@hhgtech/hhg-components 1.24.19 → 1.24.21

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 (278) hide show
  1. package/build/babyGrowth.js +2 -2
  2. package/build/cache.js +1 -1
  3. package/build/care.js +1 -1
  4. package/build/components/mantine/index.d.ts +4 -1
  5. package/build/components/mantine/text/index.d.ts +11 -0
  6. package/build/components/mantine/text/index.styled.d.ts +9 -0
  7. package/build/components/mantine/theme/heading.d.ts +9 -0
  8. package/build/components/mantine/theme/index.d.ts +1 -0
  9. package/build/components/mantine/theme/other.d.ts +7 -0
  10. package/build/components/mantine/theme/text.d.ts +63 -0
  11. package/build/components/mantine/useMantineLocale.d.ts +3 -1
  12. package/build/components.js +1 -1
  13. package/build/constants.js +1 -1
  14. package/build/{core-f52ebeaa.js → core-1ddff0e2.js} +1 -1
  15. package/build/{dataTransform-8acb1cae.js → dataTransform-f19c1617.js} +1 -1
  16. package/build/esm/babyGrowth.js +8 -8
  17. package/build/esm/cache.js +1 -1
  18. package/build/esm/care.js +1 -1
  19. package/build/esm/components.js +1 -1
  20. package/build/esm/constants.js +1 -1
  21. package/build/esm/{core-55659962.js → core-01abe7a1.js} +1 -1
  22. package/build/esm/{dataTransform-7c7cd603.js → dataTransform-b6ffa89e.js} +1 -1
  23. package/build/esm/footer.js +1 -1
  24. package/build/esm/gAssets.js +1 -1
  25. package/build/esm/getDynamicHealthTool-0aab98fc.js +1 -0
  26. package/build/esm/{getSocialList-b4b810ea.js → getSocialList-03e2a2b1.js} +1 -1
  27. package/build/esm/hooks.js +1 -1
  28. package/build/esm/i18n.js +1 -1
  29. package/build/esm/{index-bed3247d.js → index-10233643.js} +1 -1
  30. package/build/esm/index-1a820ef8.js +1 -0
  31. package/build/esm/{index-d24056ce.js → index-28b8dab6.js} +1 -1
  32. package/build/esm/{index-054ee498.js → index-43d2bffe.js} +1 -1
  33. package/build/esm/{index-e4836320.js → index-4b19571c.js} +1 -1
  34. package/build/esm/index-505a781d.js +1 -0
  35. package/build/esm/{index-8ac32fa0.js → index-65b95e24.js} +1 -1
  36. package/build/esm/{index-db2e1d7b.js → index-6b049c9f.js} +1 -1
  37. package/build/esm/{index-eb79e0cf.js → index-6d8a955b.js} +1 -1
  38. package/build/esm/index-6f78a19c.js +1 -0
  39. package/build/esm/{index-3f781614.js → index-879836ec.js} +1 -1
  40. package/build/esm/{index-bff98440.js → index-881e5990.js} +1 -1
  41. package/build/esm/index-8eec058f.js +1 -0
  42. package/build/esm/index-8f7ffa4b.js +1 -0
  43. package/build/esm/index-c2de5d7b.js +1 -0
  44. package/build/esm/{index-f1e8b189.js → index-c9290e7f.js} +1 -1
  45. package/build/esm/{index-7a57bc59.js → index-e1e88ca8.js} +1 -1
  46. package/build/esm/index-e2b7ef68.js +1 -0
  47. package/build/esm/{index-e5b9bc02.js → index-f3de7ff9.js} +11 -11
  48. package/build/esm/{index-693aacdc.js → index-f49aeb82.js} +1 -1
  49. package/build/esm/index-fcef2054.js +78 -0
  50. package/build/esm/index.css +1 -1
  51. package/build/esm/index.js +1 -1
  52. package/build/esm/{index.styled-75b0ceaa.js → index.styled-243d7f64.js} +1 -1
  53. package/build/esm/{index.styled-e6d05e31.js → index.styled-38864315.js} +1 -1
  54. package/build/esm/{index.styled-8f59035f.js → index.styled-839052ac.js} +1 -1
  55. package/build/esm/{index.styled-77b271f5.js → index.styled-89252990.js} +1 -1
  56. package/build/esm/{index.styled-70d2421e.js → index.styled-8aca10eb.js} +4 -4
  57. package/build/esm/{index.styled-53842855.js → index.styled-981e6c04.js} +1 -1
  58. package/build/esm/{index.styled-1c09bfcc.js → index.styled-c3d5eff6.js} +1 -1
  59. package/build/esm/lead.js +1 -1
  60. package/build/esm/mantine.js +1 -1
  61. package/build/esm/misc.js +1 -1
  62. package/build/esm/navigation.js +1 -1
  63. package/build/esm/onboarding.js +1 -1
  64. package/build/esm/pwg.js +2 -2
  65. package/build/esm/{routing-065ec7dc.js → routing-6d3d5706.js} +1 -1
  66. package/build/esm/{screenSizeContext-88744824.js → screenSizeContext-796cb6e5.js} +1 -1
  67. package/build/esm/together.js +1 -1
  68. package/build/esm/{translationsProvider-ccaaba93.js → translationsProvider-8152b937.js} +1 -1
  69. package/build/esm/{types-e1294419.js → types-31c78444.js} +37 -37
  70. package/build/esm/{types-8f9ba152.js → types-e46ef606.js} +1 -1
  71. package/build/esm/types.js +1 -1
  72. package/build/esm/useHealthToolCache-3488ead9.js +1 -0
  73. package/build/esm/useRafState-1e0d71f3.js +1 -0
  74. package/build/esm/useTranslations-86f7e107.js +1 -0
  75. package/build/footer.js +1 -1
  76. package/build/gAssets.js +1 -1
  77. package/build/getDynamicHealthTool-407de63f.js +1 -0
  78. package/build/{getSocialList-f3816706.js → getSocialList-5d162a85.js} +1 -1
  79. package/build/hooks.js +1 -1
  80. package/build/i18n.js +1 -1
  81. package/build/{index-25fc984e.js → index-03b58356.js} +1 -1
  82. package/build/{index-4fdb1fcf.js → index-085adf8a.js} +1 -1
  83. package/build/{index-dfe405f8.js → index-178a694b.js} +1 -1
  84. package/build/{index-d0f252ba.js → index-19064ad7.js} +1 -1
  85. package/build/{index-378e1adb.js → index-1ecd880c.js} +1 -1
  86. package/build/{index-35c8dfd4.js → index-4d6932de.js} +1 -1
  87. package/build/{index-05535f0e.js → index-50f5a6cd.js} +1 -1
  88. package/build/index-5afdfa27.js +1 -0
  89. package/build/index-62cac9a6.js +1 -0
  90. package/build/{index-51753982.js → index-6419e3dc.js} +1 -1
  91. package/build/{index-58100bad.js → index-702d2f27.js} +1 -1
  92. package/build/index-727332bb.js +73 -0
  93. package/build/{index-3d81f9cc.js → index-857fa6cb.js} +1 -1
  94. package/build/{index-e37557dd.js → index-8fddd03f.js} +1 -1
  95. package/build/{index-b29f0100.js → index-92ea35de.js} +1 -1
  96. package/build/{index-90e9e28b.js → index-980141e9.js} +1 -1
  97. package/build/{index-ebf2f582.js → index-aca89b3b.js} +1 -1
  98. package/build/{index-cf883358.js → index-aeea420e.js} +1 -1
  99. package/build/index-c2ef36dd.js +1 -0
  100. package/build/{index-2814d9cc.js → index-fb65c87a.js} +1 -1
  101. package/build/{index-59408b77.js → index-fc40c9d0.js} +1 -1
  102. package/build/index.css +1 -1
  103. package/build/index.js +1 -1
  104. package/build/{index.styled-637e5ec7.js → index.styled-1f82603f.js} +5 -5
  105. package/build/{index.styled-1a66009b.js → index.styled-38bd8957.js} +1 -1
  106. package/build/{index.styled-a51da094.js → index.styled-431f1caa.js} +1 -1
  107. package/build/{index.styled-5bb1a1f5.js → index.styled-66045dd3.js} +1 -1
  108. package/build/{index.styled-bf998dad.js → index.styled-77b969ab.js} +1 -1
  109. package/build/{index.styled-f315a185.js → index.styled-8fe3cbb8.js} +1 -1
  110. package/build/{index.styled-bd5b6a11.js → index.styled-da26abe1.js} +1 -1
  111. package/build/lead.js +1 -1
  112. package/build/mantine.js +1 -1
  113. package/build/misc.js +1 -1
  114. package/build/navigation.js +1 -1
  115. package/build/onboarding.js +1 -1
  116. package/build/pwg.js +3 -3
  117. package/build/{routing-7dbf8fef.js → routing-c02011e8.js} +1 -1
  118. package/build/screenSizeContext-4f7042b6.js +81 -0
  119. package/build/together.js +1 -1
  120. package/build/{translationsProvider-354e346a.js → translationsProvider-d0f24f1c.js} +1 -1
  121. package/build/{types-56115ec7.js → types-5df2a81a.js} +1 -1
  122. package/build/{types-cd37f582.js → types-d10baf2e.js} +1 -1
  123. package/build/types.js +1 -1
  124. package/build/useHealthToolCache-3f4dc66a.js +1 -0
  125. package/build/{useRafState-31591b58.js → useRafState-9cd628f0.js} +1 -1
  126. package/build/{useTranslations-2adbbe41.js → useTranslations-7bb84bd7.js} +1 -1
  127. package/package.json +1 -1
  128. package/build/esm/getDynamicHealthTool-f24e91d5.js +0 -1
  129. package/build/esm/index-04aac021.js +0 -1
  130. package/build/esm/index-1212f61e.js +0 -1
  131. package/build/esm/index-30dfa58f.js +0 -1
  132. package/build/esm/index-44a439da.js +0 -1
  133. package/build/esm/index-45ac44f1.js +0 -67
  134. package/build/esm/index-dd6e5684.js +0 -1
  135. package/build/esm/index-eb7126f6.js +0 -1
  136. package/build/esm/index-f5718bdd.js +0 -1
  137. package/build/esm/useHealthToolCache-a6576ccb.js +0 -1
  138. package/build/esm/useRafState-e6b465bb.js +0 -1
  139. package/build/esm/useTranslations-860db584.js +0 -1
  140. package/build/getDynamicHealthTool-4e1a845a.js +0 -1
  141. package/build/index-0bd8af32.js +0 -62
  142. package/build/index-879dd367.js +0 -1
  143. package/build/index-b3544b7d.js +0 -1
  144. package/build/index-b4a2c2fe.js +0 -1
  145. package/build/screenSizeContext-b1062be4.js +0 -81
  146. package/build/useHealthToolCache-e7470f87.js +0 -1
  147. /package/build/{BMI_BOYS.percentile.monthly-2ff92556.js → BMI_BOYS.percentile.monthly-9061bffa.js} +0 -0
  148. /package/build/{BMI_BOYS.percentile.weekly-4bdaa6f2.js → BMI_BOYS.percentile.weekly-6963805b.js} +0 -0
  149. /package/build/{BMI_BOYS.percentile.yearly-961c9f82.js → BMI_BOYS.percentile.yearly-479e90a6.js} +0 -0
  150. /package/build/{BMI_BOYS.zscore.monthly-bf59e9f5.js → BMI_BOYS.zscore.monthly-1174fe4a.js} +0 -0
  151. /package/build/{BMI_BOYS.zscore.weekly-7f264766.js → BMI_BOYS.zscore.weekly-fca159e9.js} +0 -0
  152. /package/build/{BMI_BOYS.zscore.yearly-31d3ec67.js → BMI_BOYS.zscore.yearly-c7cbffa6.js} +0 -0
  153. /package/build/{BMI_GIRLS.percentile.monthly-d88b9683.js → BMI_GIRLS.percentile.monthly-925f454e.js} +0 -0
  154. /package/build/{BMI_GIRLS.percentile.weekly-60f02b5b.js → BMI_GIRLS.percentile.weekly-3ee3b6cb.js} +0 -0
  155. /package/build/{BMI_GIRLS.percentile.yearly-7a944b49.js → BMI_GIRLS.percentile.yearly-a8a64247.js} +0 -0
  156. /package/build/{BMI_GIRLS.zscore.monthly-532639fd.js → BMI_GIRLS.zscore.monthly-818e735c.js} +0 -0
  157. /package/build/{BMI_GIRLS.zscore.weekly-2c5d69e6.js → BMI_GIRLS.zscore.weekly-f69dc139.js} +0 -0
  158. /package/build/{BMI_GIRLS.zscore.yearly-9d753f49.js → BMI_GIRLS.zscore.yearly-01c99405.js} +0 -0
  159. /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-b6ce559f.js → HEAD CIRCUM_BOYS.percentile.monthly-c23614a4.js} +0 -0
  160. /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-ab7409cd.js → HEAD CIRCUM_BOYS.percentile.weekly-a84f9182.js} +0 -0
  161. /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-7a6703de.js → HEAD CIRCUM_BOYS.percentile.yearly-b1784f74.js} +0 -0
  162. /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-d702a50e.js → HEAD CIRCUM_BOYS.zscore.monthly-6fa109d5.js} +0 -0
  163. /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-ca166fc4.js → HEAD CIRCUM_BOYS.zscore.weekly-0f128294.js} +0 -0
  164. /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-58c4e982.js → HEAD CIRCUM_BOYS.zscore.yearly-b0ae2aa5.js} +0 -0
  165. /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-15e0eca2.js → HEAD CIRCUM_GIRLS.percentile.monthly-d8a849f5.js} +0 -0
  166. /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-54bd6dc4.js → HEAD CIRCUM_GIRLS.percentile.weekly-e585c948.js} +0 -0
  167. /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-d564c43d.js → HEAD CIRCUM_GIRLS.percentile.yearly-f312b25f.js} +0 -0
  168. /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-6cf92cb3.js → HEAD CIRCUM_GIRLS.zscore.monthly-a79f2c22.js} +0 -0
  169. /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-87ced1d3.js → HEAD CIRCUM_GIRLS.zscore.weekly-3905832d.js} +0 -0
  170. /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-0bc87993.js → HEAD CIRCUM_GIRLS.zscore.yearly-76817288.js} +0 -0
  171. /package/build/{HEIGHT_BOYS.percentile.monthly-54a784db.js → HEIGHT_BOYS.percentile.monthly-058b22b8.js} +0 -0
  172. /package/build/{HEIGHT_BOYS.percentile.weekly-ce47d1ad.js → HEIGHT_BOYS.percentile.weekly-225abac0.js} +0 -0
  173. /package/build/{HEIGHT_BOYS.percentile.yearly-6813c238.js → HEIGHT_BOYS.percentile.yearly-c8f6fbc5.js} +0 -0
  174. /package/build/{HEIGHT_BOYS.zscore.monthly-16af81ce.js → HEIGHT_BOYS.zscore.monthly-f2d62779.js} +0 -0
  175. /package/build/{HEIGHT_BOYS.zscore.weekly-1476fa2c.js → HEIGHT_BOYS.zscore.weekly-2132aa31.js} +0 -0
  176. /package/build/{HEIGHT_BOYS.zscore.yearly-8e93eb69.js → HEIGHT_BOYS.zscore.yearly-7bd73d3a.js} +0 -0
  177. /package/build/{HEIGHT_GIRLS.percentile.monthly-a6a27fa2.js → HEIGHT_GIRLS.percentile.monthly-524307c0.js} +0 -0
  178. /package/build/{HEIGHT_GIRLS.percentile.weekly-23d26ea5.js → HEIGHT_GIRLS.percentile.weekly-f323e7e3.js} +0 -0
  179. /package/build/{HEIGHT_GIRLS.percentile.yearly-ecf66504.js → HEIGHT_GIRLS.percentile.yearly-1f2f77ee.js} +0 -0
  180. /package/build/{HEIGHT_GIRLS.zscore.monthly-9a2cd13b.js → HEIGHT_GIRLS.zscore.monthly-a58cd90f.js} +0 -0
  181. /package/build/{HEIGHT_GIRLS.zscore.weekly-53e5495f.js → HEIGHT_GIRLS.zscore.weekly-24d8a6ac.js} +0 -0
  182. /package/build/{HEIGHT_GIRLS.zscore.yearly-46db6361.js → HEIGHT_GIRLS.zscore.yearly-d233bce8.js} +0 -0
  183. /package/build/{Locale-9a58ef93.js → Locale-a4f9d8f6.js} +0 -0
  184. /package/build/{Vietnam-e8b1dd8b.js → Vietnam-48e12311.js} +0 -0
  185. /package/build/{Visible-3a7847ca.js → Visible-f3415620.js} +0 -0
  186. /package/build/{WEIGHT_BOYS.percentile.monthly-845b9c24.js → WEIGHT_BOYS.percentile.monthly-111c4d25.js} +0 -0
  187. /package/build/{WEIGHT_BOYS.percentile.weekly-938e8254.js → WEIGHT_BOYS.percentile.weekly-478bf0e4.js} +0 -0
  188. /package/build/{WEIGHT_BOYS.percentile.yearly-76a5f36c.js → WEIGHT_BOYS.percentile.yearly-a35cc113.js} +0 -0
  189. /package/build/{WEIGHT_BOYS.zscore.monthly-bd78f3f3.js → WEIGHT_BOYS.zscore.monthly-33586e3f.js} +0 -0
  190. /package/build/{WEIGHT_BOYS.zscore.weekly-d2503217.js → WEIGHT_BOYS.zscore.weekly-0299912e.js} +0 -0
  191. /package/build/{WEIGHT_BOYS.zscore.yearly-066d0ab4.js → WEIGHT_BOYS.zscore.yearly-0e683e93.js} +0 -0
  192. /package/build/{WEIGHT_GIRLS.percentile.monthly-4ab70bd3.js → WEIGHT_GIRLS.percentile.monthly-ab188feb.js} +0 -0
  193. /package/build/{WEIGHT_GIRLS.percentile.weekly-d751466f.js → WEIGHT_GIRLS.percentile.weekly-876c7d98.js} +0 -0
  194. /package/build/{WEIGHT_GIRLS.percentile.yearly-42ee7012.js → WEIGHT_GIRLS.percentile.yearly-49975396.js} +0 -0
  195. /package/build/{WEIGHT_GIRLS.zscore.monthly-ddf72f77.js → WEIGHT_GIRLS.zscore.monthly-1370faec.js} +0 -0
  196. /package/build/{WEIGHT_GIRLS.zscore.weekly-c2e0dc42.js → WEIGHT_GIRLS.zscore.weekly-01f8c266.js} +0 -0
  197. /package/build/{WEIGHT_GIRLS.zscore.yearly-b590d7d4.js → WEIGHT_GIRLS.zscore.yearly-f65a2231.js} +0 -0
  198. /package/build/{constants-540014d8.js → constants-81475620.js} +0 -0
  199. /package/build/{cookieHelper-f3717d04.js → cookieHelper-c871b460.js} +0 -0
  200. /package/build/{dataTransform-8d4b941a.js → dataTransform-68517294.js} +0 -0
  201. /package/build/esm/{BMI_BOYS.percentile.monthly-02c0174e.js → BMI_BOYS.percentile.monthly-4223c4eb.js} +0 -0
  202. /package/build/esm/{BMI_BOYS.percentile.weekly-fe988069.js → BMI_BOYS.percentile.weekly-c9f3efaa.js} +0 -0
  203. /package/build/esm/{BMI_BOYS.percentile.yearly-14f63c53.js → BMI_BOYS.percentile.yearly-f0b4b014.js} +0 -0
  204. /package/build/esm/{BMI_BOYS.zscore.monthly-aa3ff2b8.js → BMI_BOYS.zscore.monthly-e16193f5.js} +0 -0
  205. /package/build/esm/{BMI_BOYS.zscore.weekly-269962d9.js → BMI_BOYS.zscore.weekly-d2b2b292.js} +0 -0
  206. /package/build/esm/{BMI_BOYS.zscore.yearly-8318afa5.js → BMI_BOYS.zscore.yearly-817ec82e.js} +0 -0
  207. /package/build/esm/{BMI_GIRLS.percentile.monthly-98db0e41.js → BMI_GIRLS.percentile.monthly-494bc828.js} +0 -0
  208. /package/build/esm/{BMI_GIRLS.percentile.weekly-7dbdd5e4.js → BMI_GIRLS.percentile.weekly-042426ae.js} +0 -0
  209. /package/build/esm/{BMI_GIRLS.percentile.yearly-0023eb12.js → BMI_GIRLS.percentile.yearly-247c7391.js} +0 -0
  210. /package/build/esm/{BMI_GIRLS.zscore.monthly-5b6640cb.js → BMI_GIRLS.zscore.monthly-371459b5.js} +0 -0
  211. /package/build/esm/{BMI_GIRLS.zscore.weekly-6e0ab037.js → BMI_GIRLS.zscore.weekly-ecf23bd6.js} +0 -0
  212. /package/build/esm/{BMI_GIRLS.zscore.yearly-232db6da.js → BMI_GIRLS.zscore.yearly-8020be10.js} +0 -0
  213. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-96410a5e.js → HEAD CIRCUM_BOYS.percentile.monthly-854959a5.js} +0 -0
  214. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-27d9ac78.js → HEAD CIRCUM_BOYS.percentile.weekly-c39075dc.js} +0 -0
  215. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-c1a53267.js → HEAD CIRCUM_BOYS.percentile.yearly-e387af13.js} +0 -0
  216. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-7787fb4e.js → HEAD CIRCUM_BOYS.zscore.monthly-b7a84ef5.js} +0 -0
  217. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-5d08056c.js → HEAD CIRCUM_BOYS.zscore.weekly-b9a6fd79.js} +0 -0
  218. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-75acbe34.js → HEAD CIRCUM_BOYS.zscore.yearly-28d7fb71.js} +0 -0
  219. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-1702b14d.js → HEAD CIRCUM_GIRLS.percentile.monthly-cebb3bd4.js} +0 -0
  220. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-450eb76b.js → HEAD CIRCUM_GIRLS.percentile.weekly-e30f8aee.js} +0 -0
  221. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-386506ef.js → HEAD CIRCUM_GIRLS.percentile.yearly-a517c188.js} +0 -0
  222. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-11f285ca.js → HEAD CIRCUM_GIRLS.zscore.monthly-6ec149f3.js} +0 -0
  223. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-9d5065f8.js → HEAD CIRCUM_GIRLS.zscore.weekly-e7a5b23f.js} +0 -0
  224. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-23d5bbeb.js → HEAD CIRCUM_GIRLS.zscore.yearly-2935ab55.js} +0 -0
  225. /package/build/esm/{HEIGHT_BOYS.percentile.monthly-2b99262e.js → HEIGHT_BOYS.percentile.monthly-f69e7c07.js} +0 -0
  226. /package/build/esm/{HEIGHT_BOYS.percentile.weekly-d9f156be.js → HEIGHT_BOYS.percentile.weekly-9a4b487d.js} +0 -0
  227. /package/build/esm/{HEIGHT_BOYS.percentile.yearly-094e8482.js → HEIGHT_BOYS.percentile.yearly-cb58cecc.js} +0 -0
  228. /package/build/esm/{HEIGHT_BOYS.zscore.monthly-27d449eb.js → HEIGHT_BOYS.zscore.monthly-5f7e0a28.js} +0 -0
  229. /package/build/esm/{HEIGHT_BOYS.zscore.weekly-d3826e91.js → HEIGHT_BOYS.zscore.weekly-3c7bd88b.js} +0 -0
  230. /package/build/esm/{HEIGHT_BOYS.zscore.yearly-11ae82a4.js → HEIGHT_BOYS.zscore.yearly-66c2098e.js} +0 -0
  231. /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-42522b7a.js → HEIGHT_GIRLS.percentile.monthly-484e0602.js} +0 -0
  232. /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-996a0b65.js → HEIGHT_GIRLS.percentile.weekly-3c492d07.js} +0 -0
  233. /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-74e99347.js → HEIGHT_GIRLS.percentile.yearly-8ce15a6f.js} +0 -0
  234. /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-0305fe44.js → HEIGHT_GIRLS.zscore.monthly-204b1e6d.js} +0 -0
  235. /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-f269d20b.js → HEIGHT_GIRLS.zscore.weekly-ccb615d2.js} +0 -0
  236. /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-c985ffc1.js → HEIGHT_GIRLS.zscore.yearly-9479f3c0.js} +0 -0
  237. /package/build/esm/{Locale-c8320005.js → Locale-2a1e1450.js} +0 -0
  238. /package/build/esm/{Vietnam-3b9acb67.js → Vietnam-dc72e656.js} +0 -0
  239. /package/build/esm/{Visible-5d9b1ecd.js → Visible-18cf87ba.js} +0 -0
  240. /package/build/esm/{WEIGHT_BOYS.percentile.monthly-2fcf89dd.js → WEIGHT_BOYS.percentile.monthly-8dd91b1d.js} +0 -0
  241. /package/build/esm/{WEIGHT_BOYS.percentile.weekly-ec8ac244.js → WEIGHT_BOYS.percentile.weekly-3a959642.js} +0 -0
  242. /package/build/esm/{WEIGHT_BOYS.percentile.yearly-a543aa14.js → WEIGHT_BOYS.percentile.yearly-cc8eb0ef.js} +0 -0
  243. /package/build/esm/{WEIGHT_BOYS.zscore.monthly-5fa13f3f.js → WEIGHT_BOYS.zscore.monthly-2e131dd1.js} +0 -0
  244. /package/build/esm/{WEIGHT_BOYS.zscore.weekly-1f075b0e.js → WEIGHT_BOYS.zscore.weekly-cabcd1af.js} +0 -0
  245. /package/build/esm/{WEIGHT_BOYS.zscore.yearly-20bfba23.js → WEIGHT_BOYS.zscore.yearly-f1f7e94e.js} +0 -0
  246. /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-231f6f63.js → WEIGHT_GIRLS.percentile.monthly-4de3f67c.js} +0 -0
  247. /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-71540ce9.js → WEIGHT_GIRLS.percentile.weekly-2ed25b2a.js} +0 -0
  248. /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-37ff25bb.js → WEIGHT_GIRLS.percentile.yearly-f0f76a88.js} +0 -0
  249. /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-7d7d8957.js → WEIGHT_GIRLS.zscore.monthly-b841255d.js} +0 -0
  250. /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-f1e586cb.js → WEIGHT_GIRLS.zscore.weekly-d6eb177b.js} +0 -0
  251. /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-ca5d172b.js → WEIGHT_GIRLS.zscore.yearly-58a53745.js} +0 -0
  252. /package/build/esm/{constants-170605f8.js → constants-fb47e65c.js} +0 -0
  253. /package/build/esm/{cookieHelper-46eca077.js → cookieHelper-b88c2be8.js} +0 -0
  254. /package/build/esm/{dataTransform-81026524.js → dataTransform-75f1271b.js} +0 -0
  255. /package/build/esm/{index-9f83d332.js → index-77a5c7ce.js} +0 -0
  256. /package/build/esm/{isProduction-35cc6094.js → isProduction-e00482ad.js} +0 -0
  257. /package/build/esm/{localizeNumberFormat-14832370.js → localizeNumberFormat-65181040.js} +0 -0
  258. /package/build/esm/{normalizeLink-22f231d9.js → normalizeLink-1d2dc701.js} +0 -0
  259. /package/build/esm/{theme-35a76b33.js → theme-6dca57c7.js} +0 -0
  260. /package/build/esm/{translationsContext-7730f46a.js → translationsContext-d4d12e4a.js} +0 -0
  261. /package/build/esm/{tslib.es6-cb3ea48c.js → tslib.es6-f1b9d31e.js} +0 -0
  262. /package/build/esm/{useIsInit-17c423cc.js → useIsInit-e900b10b.js} +0 -0
  263. /package/build/esm/{useOutsideClick-b3adcf0b.js → useOutsideClick-305b5046.js} +0 -0
  264. /package/build/esm/{useScrollbarSize-e8a276bb.js → useScrollbarSize-057c4f10.js} +0 -0
  265. /package/build/esm/{useUniqueId-2654c98c.js → useUniqueId-679a497e.js} +0 -0
  266. /package/build/esm/{utils-1fa73d05.js → utils-049d75fa.js} +0 -0
  267. /package/build/{index-7c1cf961.js → index-444eee4a.js} +0 -0
  268. /package/build/{isProduction-25e05d32.js → isProduction-2a4d042f.js} +0 -0
  269. /package/build/{localizeNumberFormat-3d2fd8b9.js → localizeNumberFormat-3d8dd0e3.js} +0 -0
  270. /package/build/{normalizeLink-293919db.js → normalizeLink-f5ed8bd7.js} +0 -0
  271. /package/build/{theme-f8d912d5.js → theme-c812af69.js} +0 -0
  272. /package/build/{translationsContext-f782ff56.js → translationsContext-0e066585.js} +0 -0
  273. /package/build/{tslib.es6-7da5763e.js → tslib.es6-09b9cf36.js} +0 -0
  274. /package/build/{useIsInit-cc0a07fc.js → useIsInit-b290676c.js} +0 -0
  275. /package/build/{useOutsideClick-9fc45503.js → useOutsideClick-e4b4783f.js} +0 -0
  276. /package/build/{useScrollbarSize-70be7d32.js → useScrollbarSize-220a2ce3.js} +0 -0
  277. /package/build/{useUniqueId-71515148.js → useUniqueId-f2e50bd6.js} +0 -0
  278. /package/build/{utils-2fe5fc5c.js → utils-daf19904.js} +0 -0
package/build/esm/lead.js CHANGED
@@ -1 +1 @@
1
- import{_ as e,a as t}from"./tslib.es6-cb3ea48c.js";import a,{createContext as l,useMemo as n,useRef as o,useState as i,useEffect as r,useContext as s}from"react";import d from"lodash/debounce";import{createPortal as c}from"react-dom";import{T as m}from"./translationsContext-7730f46a.js";import{g as u,s as p}from"./cookieHelper-46eca077.js";import{b as h,a as g}from"./utils-1fa73d05.js";import{v1 as v}from"uuid";import{u as b}from"./useTranslations-860db584.js";import{H as f}from"./index.styled-e6d05e31.js";import{B as y}from"./index-bed3247d.js";import{CommonGAssets as k}from"./gAssets.js";import"./index.styled-8f59035f.js";import"./index-7a57bc59.js";import{t as _}from"./theme-35a76b33.js";import"@mantine/core";import"./index.styled-1c09bfcc.js";import"string-format";import"./index-9f83d332.js";import"./index.styled-77b271f5.js";import"date-fns";import"react-day-picker/DayPickerInput";import"./index.styled-53842855.js";import"./index-d24056ce.js";import"lodash/throttle";import"keen-slider/react";import E from"dayjs";import"./screenSizeContext-88744824.js";import"styled-components";import"./index-f1e8b189.js";import"./isProduction-35cc6094.js";import"./Locale-c8320005.js";import"@mantine/hooks";import{I as w,N as C}from"./index-bff98440.js";import"react-hook-form";import"date-fns/locale/en-US";import"date-fns/locale/id";import"date-fns/locale/vi";import"date-fns/locale/zh-TW";import"./index.styled-70d2421e.js";import"@mantine/dates";import{R as N,d as S,D as T,P as x}from"./index-45ac44f1.js";import{S as O}from"./index-eb79e0cf.js";import{M as P}from"./index-e5b9bc02.js";import{createFormContext as j}from"@mantine/form";import"./index.styled-75b0ceaa.js";import"./index-054ee498.js";import"yup";import{T as B}from"./index-db2e1d7b.js";import"./index-8ac32fa0.js";import"./index-e4836320.js";import"@hookform/resolvers/yup";import"./index-1212f61e.js";import"./index-44a439da.js";import"slugify";import"./routing-065ec7dc.js";import"dayjs/plugin/relativeTime";import"./useScrollbarSize-e8a276bb.js";import"./useUniqueId-2654c98c.js";import"./Vietnam-3b9acb67.js";import"@mantine/carousel";import"./Visible-5d9b1ecd.js";const L={LINKS:1,TAGS:2};let I="https://dev.leadgen.hellobacsi.com/";const A={MOBILE:1,DESKTOP:2};let $="";I.includes("localhost")&&(I="https://dev.leadgen.hellobacsi.com/"),location.hostname.includes("marrybaby.vn")&&($="pink");let U="https://"+location.hostname+location.pathname+location.search;U=U.toLowerCase(),sessionStorage.getItem("insider_object")&&(window.insider_object=JSON.parse(sessionStorage.getItem("insider_object")));const D={"vi-VN":{popupLang:"vi",countryCode:"vn",countryCodeNumber:84},"id-ID":{popupLang:"id",countryCode:"id",countryCodeNumber:62},"th-TH":{popupLang:"th",countryCode:"th",countryCodeNumber:66},"ms-MY":{popupLang:"ms",countryCode:"my",countryCodeNumber:60},"zh-TW":{popupLang:"zh",countryCode:"tw",countryCodeNumber:886},"km-KH":{popupLang:"km",countryCode:"kh",countryCodeNumber:855},"my-MM":{popupLang:"my",countryCode:"mm",countryCodeNumber:95},"hi-IN":{popupLang:"hi",countryCode:"in",countryCodeNumber:91}},M=D[document.documentElement.lang]||D["vi-VN"];const H={1:"Asia/Ho_Chi_Minh",10:"Asia/Ho_Chi_Minh",11:"Asia/Ho_Chi_Minh",12:"Asia/Ho_Chi_Minh",2:"Asia/Jakarta",3:"Asia/Bangkok",4:"Asia/Phnom_Penh",5:"Asia/Kuala_Lumpur",6:"Asia/Taipei",7:"Asia/Yangon",8:"Asia/Kolkata",9:"Asia/Manila"};var R={"validator.required":"This field is required.","validator.remote":"Please fix this field.","validator.email":"Please enter a valid email address.","validator.phone":"Please input correct phone number.","validator.url":"Please enter a valid URL.","validator.date":"Please enter a valid date.","validator.dateISO":"Please enter a valid date (ISO).","validator.number":"Please enter a valid number.","validator.digits":"Please enter only digits.","validator.creditcard":"Please enter a valid credit card number.","validator.equalTo":"Please enter the same value again.","validator.accept":"Please enter a value with a valid extension.","validator.maxlength":"jQuery.validator.format('Please enter no more than {0} characters.","validator.minlength":"jQuery.validator.format('Please enter at least {0} characters.","validator.rangelength":"jQuery.validator.format('Please enter a value between {0} and {1} characters long.","validator.range":"jQuery.validator.format('Please enter a value between {0} and {1}.","validator.max":"jQuery.validator.format('Please enter a value less than or equal to {0}.","validator.min":"jQuery.validator.format('Please enter a value greater than or equal to {0}.","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"};const F={"en-PH":R,"vi-VN":{"validator.required":"Vui lòng điền mục này","validator.email":"Vui lòng điền email có thật.","validator.number":"Vui lòng điền số có thật","validator.digits":"Vui lòng chỉ điền số","validator.maxlength":"Vui lòng điền dưới {0} số","validator.minlength":"Vui lòng điền hơn {0} số","validator.remote":"Hãy sửa cho đúng.","validator.url":"Hãy nhập URL.","validator.date":"Hãy nhập ngày.","validator.dateISO":"Hãy nhập ngày (ISO).","validator.creditcard":"Hãy nhập số thẻ tín dụng.","validator.equalTo":"Hãy nhập thêm lần nữa.","validator.extension":"Phần mở rộng không đúng.","validator.rangelength":"Hãy nhập từ {0} đến {1} kí tự.","validator.range":"Hãy nhập từ {0} đến {1}.","validator.max":"Hãy nhập từ {0} trở xuống.","validator.min":"Hãy nhập từ {0} trở lên.","validator.phone":"Nhập đúng định dạng số điện thoại","validator.emailUsed":"Email này đã được sử dụng cho chiến dịch.","validator.phoneUsed":"Số điện thoại này đã được sử dụng cho chiến dịch.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"hi-IN":{"validator.required":"इस क्षेत्र की आवश्यकता है।","validator.email":"कृपया एक मान्य ईमेल पता दर्ज करें","validator.number":"कृपया एक वैध संख्या दर्ज करें","validator.digits":"कृपया केवल अंक दर्ज करें","validator.maxlength":"कृपया {0} अक्षर से अधिक दर्ज न करें","validator.minlength":"कृपया कम से कम {0} अक्षर दर्ज करें","validator.phone":"कृपया एक वैध संख्या दर्ज करें","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"id-ID":{"validator.required":"Kolom ini wajib diisi","validator.email":"Tolong daftarkan email yang valid","validator.number":"Tolong daftarkan nomor telepon yang valid","validator.digits":"Tolong masukkan angka saja","validator.maxlength":"Jangan memasukkan lebih dari {0} karakter","validator.minlength":"Tolong ketik sedikitnya {0} karakter","validator.phone":"Tolong daftarkan nomor telepon yang valid","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"ms-MY":{"validator.required":"Bahagian ini wajib diisi.","validator.email":"Sila masukkan alamat emel yang sah.","validator.number":"Sila masukkan no telefon yang sah.","validator.digits":"Sila masukkan nombor digit sahaja.","validator.maxlength":"Sila masukkan tidak lebih dari {0} aksara","validator.minlength":"Sila masukkan sekurang-kurangnya {0} aksara","validator.phone":"Sila masukkan no telefon yang sah.","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"my-MM":{"validator.required":"ဒီနေရာမှာ ဖြည့်ဖို့ လိုအပ်ပါတယ်","validator.email":"မှန်ကန်သော အီးမေးလ်လိပ်စာထည့်သွင်းပါ","validator.number":"မှန်ကန်သော ဖုန်းနံပါတ်ထည့်သွင်းပါ","validator.digits":"နံပါတ်များသာဖြည့်ပါ","validator.maxlength":"ကျေးဇူးပြု၍ {0} ထပ်မပိုသော ဂဏန်းများသာဖြည့်ပါ","validator.minlength":"ကျေးဇူးပြု၍ အနည်းဆုံး {0} ဂဏန်းဖြည့်ပါ","validator.phone":"မှန်ကန်သော ဖုန်းနံပါတ်ထည့်သွင်းပါ","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"km-KH":{"validator.required":"ព័ត៌មាន​ចាំបាច់​ដែល​ត្រូវ​បំពេញ","validator.email":"សូម​វាយ​អាសយដ្ឋាន​អ៊ីម៉ែល​ឲ្យ​បាន​ត្រឹមត្រូវ","validator.number":"សូម​វាយបញ្ចូល​លេខ​ឲ្យ​បាន​ត្រឹមត្រូវ","validator.digits":"វាយ​បញ្ចូល​បាន​តែ​លេខ​ប៉ុណ្ណោះ","validator.maxlength":"សូម​វាយ​បញ្ចូលកុំ​ឲ្យ​លើស {0} តួអក្សរ","validator.minlength":"សូម​វាយ​បញ្ចូល​តិច​បំផុត {0} តួអក្ស","validator.phone":"សូម​វាយបញ្ចូល​លេខ​ឲ្យ​បាន​ត្រឹមត្រូវ","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"zh-TW":{"validator.required":"此為必填欄位","validator.email":"請填入有效的 email 地址","validator.number":"請填入有效的電話號碼","validator.digits":"此欄位僅能輸入數字","validator.maxlength":"請輸入少於 {0} 位數","validator.minlength":"請輸入至少 {0} 位數","validator.phone":"請填入有效的電話號碼","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"th-TH":{"validator.required":"ต้องระบุข้อมูลในช่องนี้","validator.email":"กรุณาใส่อีเมล์ที่ถูกต้อง","validator.number":"กรุณาใส่ตัวเลขที่ถูกต้อง","validator.digits":"กรุณาส่เฉพาะตัวเลข","validator.maxlength":"กรุณาใส่ตัวเลขมากกว่า {0} หลัก","validator.minlength":"กรุณาใส่ตัวเลขอย่างน้อย {0} หลัก","validator.phone":"กรุณาใส่ตัวเลขที่ถูกต้อง","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"tl-PH":R},V=e=>{const t=F[e];return t||F["en-PH"]},W=l({}),q=({onClose:e,containerClassName:t,svgClassName:l})=>a.createElement("button",{onClick:e,className:`le-newbuilder-close-button js-modal__close ${t||""}`},a.createElement("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:l},a.createElement("circle",{cx:"16",cy:"16",r:"16",fill:"white"}),a.createElement("path",{d:"M16 17.05L10.925 22.125C10.7917 22.2584 10.621 22.329 10.413 22.337C10.2044 22.3457 10.025 22.275 9.87502 22.125C9.72502 21.975 9.65002 21.8 9.65002 21.6C9.65002 21.4 9.72502 21.225 9.87502 21.075L14.95 16L9.87502 10.925C9.74169 10.7917 9.67102 10.6207 9.66302 10.412C9.65436 10.204 9.72502 10.025 9.87502 9.87502C10.025 9.72502 10.2 9.65002 10.4 9.65002C10.6 9.65002 10.775 9.72502 10.925 9.87502L16 14.95L21.075 9.87502C21.2084 9.74169 21.3794 9.67069 21.588 9.66202C21.796 9.65402 21.975 9.72502 22.125 9.87502C22.275 10.025 22.35 10.2 22.35 10.4C22.35 10.6 22.275 10.775 22.125 10.925L17.05 16L22.125 21.075C22.2584 21.2084 22.329 21.379 22.337 21.587C22.3457 21.7957 22.275 21.975 22.125 22.125C21.975 22.275 21.8 22.35 21.6 22.35C21.4 22.35 21.225 22.275 21.075 22.125L16 17.05Z",fill:"#595959"}))),Y=({popupId:e,url:t,newTab:l,imageDestkop:n,imageMobile:o,onClose:i,onOtherSubmit:r})=>a.createElement("div",{id:e,className:"lead-modal-wrapper","data-popup-url":location.pathname,"data-popup-type":"center_tab"},a.createElement("div",{className:"le-center-tab-popup"},a.createElement("div",{style:{position:"relative"}},a.createElement("a",{className:"js-popup-other-submit",href:t,target:l?"blank":"_parent",onClick:r},a.createElement("img",{className:"le-only-mobile",src:o}),a.createElement("img",{className:"le-only-desktop",src:n})),a.createElement(q,{onClose:i,containerClassName:"close-button-top-right"})))),J=({popupId:e,url:t,title:l,urlText:n,titleAlign:o,subtitle:i,subtitleAlign:r,newTab:s,imageDesktop:d,imageMobile:c,onClose:m,onOtherSubmit:u})=>a.createElement("div",{id:e,className:"lead-modal-wrapper lead-floating-wrapper","data-popup-url":location.pathname,"data-popup-type":"floating"},a.createElement("aside",{className:"le-only-desktop"},a.createElement("div",{className:"le-floating-desktop"},a.createElement("div",{className:"le-floating-desktop-wrap",style:{position:"relative",background:"#fff"}},d?a.createElement("div",null,a.createElement("img",{style:{maxWidth:120,borderTopLeftRadius:5,borderBottomLeftRadius:5},src:d})):null,a.createElement("div",{style:{padding:20}},a.createElement("div",{className:`le-floating-desktop-title le-text-align-${o}`},l),a.createElement("div",{className:`le-floating-desktop-desc le-text-align-${r}`},i)),a.createElement("a",{target:s?"blank":"_parent",style:{marginLeft:35,textDecoration:"none"},href:t},a.createElement("button",{className:"le-joinbow-floating-btn js-popup-other-submit",onClick:u},n)),a.createElement(q,{onClose:m,containerClassName:"close-button-top-right"})))),a.createElement("aside",{className:"le-only-mobile"},a.createElement("div",{className:"le-floating-mobile"},a.createElement("div",{className:"le-floating-mobile-wrap",style:{position:"relative",background:"#fff"}},a.createElement("aside",{style:{display:"flex",justifyContent:"space-between"}},a.createElement("div",null,a.createElement("div",{className:`le-floating-mobile-title le-text-align-${o}`},l),a.createElement("div",{className:`le-floating-mobile-desc le-text-align-${r}`},i)),c?a.createElement("div",null,a.createElement("img",{style:{marginLeft:15,marginTop:4,maxWidth:100},src:c})):null),a.createElement("div",{style:{textAlign:"center",marginTop:10}},a.createElement("a",{target:s?"blank":"_parent",href:t,style:{textDecoration:"none"}},a.createElement("button",{className:"le-joinbow-floating-btn js-popup-other-submit",onClick:u},n))),a.createElement(q,{onClose:m,containerClassName:"close-button-top-right"}))))),z=({title:e,titleAlign:t,subtitle:l,subtitleAlign:n,link:o,linkNewTab:i,linkText:r,image:s})=>a.createElement("div",{className:"lead-modal__thank-you"},a.createElement("div",{style:{width:"100%"}},a.createElement("img",{src:s,style:{maxHeight:162,objectFit:"cover"}}),e&&a.createElement("h1",{className:`le-thankyou-title le-text-align-${t}`},e),l&&a.createElement("p",{className:`le-thankyou-subtitle le-text-align-${n}`},l),r&&a.createElement("div",null,a.createElement("a",{href:o,target:i?"_blank":"parrent",rel:"noreferrer"},a.createElement("button",{className:`lead-modal__btn ${$}`},r)))));const K=new class{constructor(){this.apiLeadUrl="https://dev.leadgen.hellobacsi.com/",this.apiSubotUrl="https://staging-service-subot.hellohealthgroup.com/"}},G={call(t){var{url:a,data:l}=t,n=e(t,["url","data"]);return n.body=JSON.stringify(l),n.headers={"Content-Type":"application/json"},fetch(`${K.apiLeadUrl}${a}`,n).then((e=>e.json())).catch((e=>({})))}},Q={call(t){var{url:a,data:l}=t,n=e(t,["url","data"]);return n.body=JSON.stringify(l),n.headers={"Content-Type":"application/json"},fetch(`${K.apiSubotUrl}${a}`,n).then((e=>e.json())).catch((e=>({})))}},X=({bot_id:e,email:t,phone:a})=>{let l=a;return l&&l.startsWith("0")&&(l=l.substring(1)),Q.call({url:"frontend/api/subot-campaign/check",method:"post",data:{bot_id:e,email:t,phone:l}})},Z=({campaign_id:e,email:t,phone:a})=>{let l=a;return l&&l.startsWith("0")&&(l=l.substring(1)),G.call({url:"api/subot-campaign/check",method:"post",data:{campaign_id:e,email:t,phone:l}})},ee=({phone:e})=>G.call({url:"api/sms/otp",method:"post",data:{phone_number:e.replace("+","")}}),te=({phone:e,otp:t})=>G.call({url:"api/sms/verify",method:"post",data:{otp_code:t,phone_number:e.replace("+","")}}),ae={email:{},phone:{}},le=(e,a,l)=>t(void 0,void 0,void 0,(function*(){const n="email"in l?"email":"phone",o="email"in l?l.email:l.phone,i="email"in l?"validator.emailUsed":"validator.phoneUsed";if(ae[n][o]){if(ae[n][o].value)return i;if(!ae[n][o].value&&ae[n][o].expire>Date.now())return""}const r=yield((e,a,l)=>t(void 0,void 0,void 0,(function*(){const t="email"in l?"email":"phone",n="email"in l?l.email:l.phone,o="email"in l?"validator.emailUsed":"validator.phoneUsed",i=yield Z({campaign_id:[e],[t]:n});return"SubmitLeadWithBotId_ERR_001"===i._errorCode||"SubmitLeadWithBotId_ERR_002"===i._errorCode||a.length&&"CheckSuBotLeadTool_ERR_001"===(yield X({bot_id:a,[t]:n}))._errorCode?o:void 0})))(e,a,l);return ae[n][o]=r?{value:!0}:{value:!1,expire:Date.now()+6e4},r})),ne=({content:e,inlinePosition:t})=>{const a=n((()=>{if(!t)return null;const e=document.querySelectorAll(`[data-url="${location.pathname}"] .body-content`),a=Array.from(e).reduce(((e,t)=>[...e,...Array.from(t.children)]),[]);if(null==a?void 0:a.length){const e=a.filter((e=>"P"===e.nodeName)),l=a.filter((e=>"H2"===e.nodeName));let n=null;switch(t){case"1th":n=e[0];break;case"2th":n=e[1];break;case"3th":n=e[2];break;case"4th":n=e[3];break;case"5th":n=e[4];break;case"6th":n=e[5];break;case"7th":n=e[6];break;case"8th":n=e[7];break;case"9th":n=e[8];break;case"10th":n=e[9];break;case"11th":n=e[10];break;case"12th":n=e[11];break;case"lastP":n=e[e.length-1];break;case"1thH2":n=l[0];break;case"2thH2":n=l[1];break;case"3thH2":n=l[2];break;case"4thH2":n=l[3];break;case"5thH2":n=l[4];break;case"6thH2":n=l[5];break;case"7thH2":n=l[6];break;case"8thH2":n=l[7];break;case"9thH2":n=l[8];break;case"10thH2":n=l[9];break;case"lastH2":n=l[l.length-1]}if(n){if(n.parentElement.querySelector(".inline-lead-wrapper"))return n.parentElement.querySelector(".inline-lead-wrapper");{const e=document.createElement("div");return e.classList.add("inline-lead-wrapper"),n.nextElementSibling?n.parentElement.insertBefore(e,n.nextElementSibling):n.parentElement.appendChild(e),e}}}}),[t]);return t&&a?c(e,a):null},oe=({content:e})=>{const t=n((()=>{const e=Array.from(document.querySelectorAll(".hc2-sidebar-with-ads,.page-main-col .right-col.f-right,.hhg-lead-sidebar"));return e.forEach((e=>{if(e.querySelector(".sidebar-lead-modal-wrapper"))return;const t=document.createElement("div");t.classList.add("sidebar-lead-modal-wrapper"),e.prepend(t)})),e.map((e=>e.querySelector(".sidebar-lead-modal-wrapper")))}),[]);return a.createElement(a.Fragment,null,t.map((t=>c(e,h(t,"sidebar-lead-modal-wrapper")))))},[ie,re,se]=j(),de="undefined"==typeof window,ce={VN:"vi",ID:"id",TH:"th",MY:"ms",TW:"zh-TW",KH:"km",MM:"my",IN:"hi",PH:"en"},me=(e="",a="",l="",n=500)=>{const[o,s]=i([]),[d,c]=i(!1);return r((()=>{let i;return e?i=window.setTimeout((()=>t(void 0,void 0,void 0,(function*(){var n;if(e)try{c(!0);const o=yield((e="",a="",l="vi")=>t(void 0,void 0,void 0,(function*(){return new Promise(((t,n)=>{if(!e)return n("Need valid text input");if(de)return n("Need valid window object");try{(new window.google.maps.places.AutocompleteService).getPlacePredictions(Object.assign(Object.assign({input:e},a?{componentRestrictions:{country:a}}:{}),{language:ce[l]}),t)}catch(e){n(e)}}))})))(e,a,l);s(!(n=o)||n.length<1?[]:n.map((e=>({placeId:e.place_id,description:e.description}))))}catch(e){console.error(e)}finally{c(!1)}else s([])}))),n):o.length&&s([]),()=>{window.clearTimeout(i)}}),[e,n,a]),{isLoading:d,predictions:o}},ue=["places"],pe=({name:e,placeholder:t,locale:l})=>{var s;const d=re(),[c,m]=i(""),[u,p]=i(""),{predictions:h}=me(c||"15 Lê","","tl-PH"===l?"en":null===(s=null==l?void 0:l.split("-"))||void 0===s?void 0:s[0]),[g,v]=i(null),[b,f]=i(!1),y=o(Math.random().toString(36).substring(7)),k=n((()=>{const e=h.map((e=>({value:e.description,label:e.description}))),t=e.find((e=>e.value===u));return!u||t?e:[{value:u,label:u}].concat(e)}),[h,u]);return r((()=>{var e,t,a;(null===(a=null===(t=null===(e=null===window||void 0===window?void 0:window.google)||void 0===e?void 0:e.maps)||void 0===t?void 0:t.places)||void 0===a?void 0:a.AutocompleteService)?f(!0):import("@react-google-maps/api").then((e=>{v((()=>e.LoadScript)),setTimeout((()=>{f(!0)}),200)}))}),[]),b?a.createElement(a.Fragment,null,g&&a.createElement(g,{googleMapsApiKey:"AIzaSyB9QmhfEYcy2wj5X3Fl38aCD5UkET6n82M",libraries:ue,loadingElement:a.createElement(a.Fragment,null)}),a.createElement("div",{style:{display:"none"},"data-extra":!0,"data-name":e,"data-control":"text"}),a.createElement(O,Object.assign({className:"lead-modal__form-control",label:t,placeholder:t,withAsterisk:!0,name:e,data:k,searchValue:c,onSearchChange:e=>{m(e)},filter:()=>!0,clearable:!0,searchable:!0,onChange:e=>p(e||""),icon:a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.createElement("path",{d:"M9.99999 9.79167C10.4028 9.79167 10.7467 9.64944 11.0317 9.365C11.3161 9.08 11.4583 8.73611 11.4583 8.33333C11.4583 7.93056 11.3161 7.58667 11.0317 7.30167C10.7467 7.01722 10.4028 6.875 9.99999 6.875C9.59721 6.875 9.25332 7.01722 8.96832 7.30167C8.68388 7.58667 8.54166 7.93056 8.54166 8.33333C8.54166 8.73611 8.68388 9.08 8.96832 9.365C9.25332 9.64944 9.59721 9.79167 9.99999 9.79167ZM9.99999 17.875C9.90277 17.875 9.80555 17.8611 9.70832 17.8333C9.6111 17.8056 9.52082 17.7569 9.43749 17.6875C7.46527 15.8958 5.98971 14.2361 5.01082 12.7083C4.03138 11.1806 3.54166 9.77778 3.54166 8.5C3.54166 6.48611 4.1911 4.87833 5.48999 3.67667C6.78832 2.47556 8.29166 1.875 9.99999 1.875C11.7083 1.875 13.2119 2.47556 14.5108 3.67667C15.8092 4.87833 16.4583 6.48611 16.4583 8.5C16.4583 9.77778 15.9689 11.1806 14.99 12.7083C14.0105 14.2361 12.5347 15.8958 10.5625 17.6875C10.4792 17.7569 10.3889 17.8056 10.2917 17.8333C10.1944 17.8611 10.0972 17.875 9.99999 17.875Z",fill:"#8C8C8C"})),autoComplete:"no-auto-complete-"+y.current,rightSection:a.createElement(a.Fragment,null)},d.getInputProps(e)))):a.createElement("div",{style:{height:73}})},he=({children:e,align:t})=>a.createElement("p",{className:`lead-modal__description ${"le-text-align-"+(t||"")} ${$}`},e),ge=({children:e,align:t})=>a.createElement("h2",{className:`lead-modal__title ${"le-text-align-"+(t||"")} ${$}`},e),ve=({listBlockAdded:e,popupId:t,locale:l,onClose:n,onOtherSubmit:o})=>{const i=re();return a.createElement(a.Fragment,null,e.map(((e,r)=>{const{name:s="",data:d={}}=e||{},{placeholder:c,value:m,align:u,listQuestion:p,isSendMailChimp:h=!1,newtab:g,url:v}=d;switch(s){case"TitleBlock":return a.createElement(ge,{key:r,align:u},m);case"SubtitleBlock":return a.createElement(he,{key:r,align:u},m);case"TextBlock":return a.createElement(w,Object.assign({key:r,withAsterisk:!0,spellCheck:!1,type:"text",placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"text",name:m},i.getInputProps(m)));case"NumberBlock":return a.createElement(C,Object.assign({key:r,withAsterisk:!0,spellCheck:!1,type:"number",placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"number",name:m},i.getInputProps(m)));case"EmailBlock":return a.createElement(w,Object.assign({key:r,withAsterisk:!0,spellCheck:!1,placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"email",name:m},i.getInputProps(m)));case"PhoneOtpBlock":case"PhoneBlock":{const e=t+"-"+m+"-"+r;return a.createElement(w.Wrapper,Object.assign({size:"md",withAsterisk:!0,key:r,label:c,className:"lead-modal__form-control",labelProps:{htmlFor:e}},i.getInputProps(m)),a.createElement(x,{name:m,spellCheck:!1,type:"tel",placeholder:c,onChange:e=>{i.setFieldValue(m,e)},id:e,defaultCountry:l&&P[l]||"VN","data-control":"tel"}))}case"LocationBlock":return a.createElement(pe,{key:r,name:m,placeholder:c,locale:l});case"DateBlock":return a.createElement(T,Object.assign({withAsterisk:!0,key:r,type:"date",name:m,placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"date"},i.getInputProps(m)));case"LinkButtonBlock":return a.createElement("div",{key:r},a.createElement("a",{target:g?"blank":"parrent",href:v,style:{textDecoration:"none"}},a.createElement(y,{type:"button",size:"md",className:`lead-modal__btn ${$}`,onClick:()=>{null==n||n(),null==o||o()}},m)));case"CheckboxBlock":return a.createElement(a.Fragment,null,h&&a.createElement("div",{style:{display:"none"},"data-name":m+"-mailchimp"}),a.createElement(S.Group,Object.assign({withAsterisk:!0,className:"lead-modal__form-control",key:r,label:c,size:"md"},i.getInputProps(m)),p.map(((e,t)=>a.createElement(S,{name:m,key:t,value:e.value,label:e.placeholder,"data-control":"checkbox"})))));case"RadioBlock":return a.createElement(a.Fragment,null,h&&a.createElement(w,{type:"hidden",name:m+"-mailchimp",value:h}),a.createElement(N.Group,Object.assign({withAsterisk:!0,className:"lead-modal__form-control",key:r,label:c,size:"md"},i.getInputProps(m)),p.map(((e,t)=>a.createElement(N,{name:m,key:t,value:e.value,label:e.placeholder,"data-control":"radio"})))));case"DropdownBlock":return a.createElement(a.Fragment,null,a.createElement("div",{style:{display:"none"},"data-extra":!0,"data-name":m,"data-control":"dropdown"}),a.createElement(O,Object.assign({key:r,className:"lead-modal__form-control",label:c,withAsterisk:!0,name:m,data:p.map((e=>({value:e.value,label:e.placeholder})))},i.getInputProps(m))))}return null})))},be=({phone:e,onSuccess:l,autoSendWhenOpen:n})=>{const{t:s}=b(),[d,c]=i(""),[m,u]=i(!1),[p,h]=i(0),g=o(null),[v,k]=i(),[E,C]=i(""),N=o();r((()=>{t(void 0,void 0,void 0,(function*(){var t;if(!N.current){const e=yield import("react-phone-number-input");N.current=e.formatPhoneNumberIntl}C((null===(t=N.current)||void 0===t?void 0:t.call(N,e))||e)}))}),[e]);const S=()=>t(void 0,void 0,void 0,(function*(){var t;if(!e)return;const a=yield ee({phone:e}),n=null===(t=null==a?void 0:a._messages)||void 0===t?void 0:t[0];"Send sms successfully"===n?(h(60),setTimeout((()=>{g.current&&(g.current.focus(),g.current.scrollIntoView({block:"center"}))}),100)):"This phone number was verified"===n?l():k(n||"something Wrong")}));return r((()=>{setTimeout((()=>{p>0&&h((e=>e-1))}),1e3)}),[p]),r((()=>{n&&!p&&S()}),[]),a.createElement(a.Fragment,null,a.createElement("form",{onSubmit:a=>{a.preventDefault(),t(void 0,void 0,void 0,(function*(){if(!e||!d)return;const t=yield te({phone:e,otp:d}),a=null==t?void 0:t._messages[0];"Verify successfully"===a||"This phone number was verified"===a?l():k(a||"something Wrong")}))},className:"lead-phone-otp-form"},a.createElement(f,{tag:"h3",fontWeight:"bold",style:{marginBottom:4}},s("lead.otp.title")),a.createElement(B,{size:"p1",color:_.colors.gray600},s("lead.otp.desc",{phone:E})),a.createElement(w,{ref:g,name:"_"+name+"-otp",spellCheck:!1,type:"number",placeholder:"Enter OTP",className:"lead-modal__form-control",label:"Phone OTP","data-control":"otp",withAsterisk:!0,pattern:"[0-9]*",value:d,onChange:e=>{u(!0),c(e),k(m&&!e?"OTP is required":void 0)},error:m?v:void 0}),a.createElement(y,{size:"md",color:"primary",className:`lead-modal__btn ${$}`,disabled:!d},s("lead.otp.verify")),a.createElement(y,{type:"button",size:"md",color:"transparent",className:`lead-modal__btn lead-phone-otp-button ${$}`,onClick:()=>{S()},disabled:!!p},s("lead.otp.resend",{timer:p?` (${p}s)`:""}))))},fe=({popupId:e,extraFields:t,onClose:l,onOtherSubmit:s,imageMobile:d,imageDesktop:c,imageOverlayMobile:m,imageOverlayDesktop:u,imageBackground:p,currentLayout:h,title:g,onSubmit:v,showThankyou:f,campaignId:_,campaign_subot_id:E,locale:w})=>{var C,N,S;const T=JSON.parse(t.listBlockAdded),x=JSON.parse(t.actionBlocks),O=JSON.parse(t.textBlocks),P=x.submitBlock.data.url,j=x.submitBlock.data.text,B=x.submitBlock.data.text2,L=x.submitBlock.data.value,I=location.pathname,A=h.includes("Inline")||"Sidebar"===h,U="Slider"===h,[D,H]=i(!0),[R,F]=i(""),V=o(),W=()=>{R?F(""):null==l||l()};if(window.innerWidth<769&&["Fullscreen","Slider"].includes(h))return console.log("😎 Not show fullscreen, slider on mobile "),null;r((()=>{(h.includes("LightBox")||"Fullscreen"==h)&&document.body.classList.add("noscroll"),window.intlTelInputUtils||require("intl-tel-input/build/js/utils"),ae.email={},ae.phone={}}),[]);const Y=o(!1),J=o(!1),{form:K,validateObj:G}=(({listBlockAdded:e=[],validatingPhoneRef:t,validatingEmailRef:a,campaignId:l,campaign_subot_id:i=[]})=>{const{t:r}=b(),s=n((()=>{const n=["TextBlock","NumberBlock","EmailBlock","PhoneBlock","DateBlock","CheckboxBlock","RadioBlock","DropdownBlock","PhoneOtpBlock","LocationBlock"],o=(e,t)=>a=>{if(c.current.isTouched(e))return void 0===a||""===a||Array.isArray(a)&&0===a.length?r("validator.required"):null==t?void 0:t(a)};return e.filter((e=>n.includes(e.name))).reduce(((e,n)=>"NumberBlock"===n.name?Object.assign(Object.assign({},e),{[n.data.value]:o(n.data.value,(e=>{if(isNaN(Number(e)))return r("validator.number")}))}):"EmailBlock"===n.name?Object.assign(Object.assign({},e),{[n.data.value]:o(n.data.value,(e=>{if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e))return r("validator.email");a.current=!0,setTimeout((()=>{c.current.setFieldError(n.data.value,"Validating..."),le(l,i,{email:e}).then((e=>{e?c.current.setFieldError(n.data.value,r(e)):c.current.clearFieldError(n.data.value),a.current=!1})).catch((e=>{console.error(e),c.current.setFieldError(n.data.value,e.message||"Something went wrong"),a.current=!1}))}),200)}))}):"PhoneBlock"===n.name||"PhoneOtpBlock"===n.name?Object.assign(Object.assign({},e),{[n.data.value]:o(n.data.value,(e=>{if(window.intlTelInputUtils&&!window.intlTelInputUtils.isValidNumber(String(e),M.countryCode))return r("validator.phone");t.current=!0,setTimeout((()=>{c.current.setFieldError(n.data.value,"Validating..."),le(l,i,{phone:e}).then((e=>{e?c.current.setFieldError(n.data.value,r(e)):c.current.clearFieldError(n.data.value),t.current=!1})).catch((e=>{console.error(e),c.current.setFieldError(n.data.value,e.message||"Something went wrong"),t.current=!1}))}),200)}))}):"DateBlock"===n.name?Object.assign(Object.assign({},e),{[n.data.value]:o(n.data.value,(e=>{if(isNaN(Date.parse(e)))return r("validator.date")}))}):Object.assign(Object.assign({},e),{[n.data.value]:o(n.data.value)})),{})}),[e.map((e=>e.name)).join(",")]),d=se({validateInputOnChange:!0,clearInputErrorOnChange:!0,validate:s}),c=o(d);return c.current=d,{form:d,validateObj:s}})({listBlockAdded:T,validatingPhoneRef:Y,validatingEmailRef:J,campaignId:_,campaign_subot_id:E}),Q=a.createElement(a.Fragment,null,a.createElement("style",{dangerouslySetInnerHTML:{__html:`\n .le-newbuilder-overlay {\n background-repeat: no-repeat;\n background-size: cover;\n }\n ${m?`\n .le-newbuilder-overlay {\n background: url(${m}) ;\n }`:""}\n ${u?`\n @media screen and (min-width:768px) {\n .le-newbuilder-overlay {\n background: url(${u}) ;\n }\n }`:""}`}}),a.createElement("div",{id:e,"data-popup-url":I,"data-popup-type":"lightbox-inline",className:`lead-modal lead-modal-wrapper modal--animate-scale ${A?"le-buider-inline":""} ${U?"le-buider-slider":""}`},"Fullscreen"==h?a.createElement("img",{className:"le-only-desktop le-fullscreen-img",draggable:!1,src:p||""}):null,a.createElement("div",{className:`lead-modal__wrapper le-newbuilder-wrap-${h}`},a.createElement("div",{className:`lead-modal__content le-newbuilder-${h}`},f?a.createElement(z,{title:f.title,titleAlign:f.titleAlign,subtitle:f.subtitle,subtitleAlign:f.subtitleAlign,link:f.link,linkNewTab:f.linkNewTab,linkText:f.linkText,image:f.image}):a.createElement(a.Fragment,null,a.createElement("header",{className:"lead-modal__header"},R?a.createElement("img",{src:k.getAssetPath("lead-otp-thumb.png"),draggable:"false",alt:"",style:{width:"100%"}}):a.createElement(a.Fragment,null,["LightBoxA","InlineA","Sidebar","Slider"].includes(h)?d?a.createElement("img",{draggable:"false",className:"lead-modal__image lead-modal-image-cover",src:d,alt:""}):null:a.createElement(a.Fragment,null,c?a.createElement("img",{draggable:"false",className:"le-only-desktop lead-modal__image lead-modal-image-cover",style:{height:"100%",objectFit:"cover"},src:c,alt:""}):null,d?a.createElement("img",{draggable:"false",className:"le-only-mobile lead-modal__image lead-modal-image-cover",src:d,alt:""}):null))),R&&a.createElement(be,{phone:R,autoSendWhenOpen:!0,onSuccess:()=>{null==v||v(V.current,K.values)}}),a.createElement("div",{"data-hidden":!!R,className:"lead-modal__body le-newbuilder-overlay"},a.createElement(ie,{form:K},a.createElement("form",{ref:V,className:`lead-modal__form ${e}`,onSubmit:e=>{e.preventDefault(),K.setTouched(Object.keys(G).reduce(((e,t)=>(e[t]=!0,e)),{})),J.current||Y.current||setTimeout((()=>{K.onSubmit((e=>{var t,a,l;if(!Object.keys(K.errors).length){if(T.findIndex((e=>"PhoneOtpBlock"===e.name))>-1){const n=null===(a=null===(t=T.find((e=>"PhoneOtpBlock"===e.name)))||void 0===t?void 0:t.data)||void 0===a?void 0:a.value;if(null===(l=e[n])||void 0===l?void 0:l.startsWith("+84"))return void F(e[n])}null==v||v(V.current,e)}}))(e)}),100)}},a.createElement("div",{style:{marginBottom:20}},a.createElement("h2",{className:`lead-modal__title ${"le-text-align-"+(null===(C=O.titleBlock.data)||void 0===C?void 0:C.align)} ${$}`},g),a.createElement("p",{className:`lead-modal__description ${"le-text-align-"+(null===(N=O.titleBlock.data)||void 0===N?void 0:N.align)} ${$}`},O.subtitleBlock.data.value)),a.createElement("div",{className:"lead-modal__form-control-wrapper"},a.createElement(ve,{listBlockAdded:T,popupId:e,locale:w,onClose:W,onOtherSubmit:s})),(null===(S=null==x?void 0:x.submitBlock)||void 0===S?void 0:S.isHide)?null:a.createElement(a.Fragment,null,a.createElement("div",{className:`lead-modal__checkbox-wrapper ${$}`},a.createElement("div",{className:"lead-modal__checkbox"},a.createElement("input",{id:"lead-term-checkbox",className:`lead-modal__checkbox__input ${$}`,type:"checkbox","aria-label":"Checkbox label",checked:D,onChange:e=>H(e.currentTarget.checked)}),a.createElement("div",{className:"lead-modal__checkbox__control","aria-hidden":"true"})),a.createElement("label",{htmlFor:"checkbox",className:"lead-modal__checkbox__label"},j," ",a.createElement("span",{style:{fontWeight:"bold"}},a.createElement("a",{target:"blank",href:P||"https://hellobacsi.com/chinh-sach",rel:"noopener noreferrer",style:{textDecoration:"none"}},B)))),a.createElement(y,{size:"md",id:"lead-submit",type:"submit",className:`lead-modal__btn ${$}`,disabled:!D},L))))))),!h.includes("Inline")&&a.createElement(q,{onClose:W,containerClassName:"close-button-top-right"}))));return h.includes("LightBox")||"Fullscreen"==h||"Slider"==h?Q:"Sidebar"==h?a.createElement(oe,{content:Q}):h.includes("Inline")?a.createElement(ne,{content:Q,inlinePosition:t.popupInlinePosition}):null},ye=({popupId:e,link:t,linkText:l,linkNewTab:n,onClose:o,imageMobile:i,imageDesktop:r,currentLayout:s,onOtherSubmit:d})=>{const c=location.pathname;return a.createElement("div",{id:e,className:"lead-modal-wrapper","data-popup-url":c,"data-popup-type":"skin_ab"},"SkinA"==s?a.createElement("aside",{className:"le-only-desktop"},a.createElement("div",{className:"le-skin-a-desktop"},a.createElement("div",{style:{position:"relative"}},a.createElement("img",{src:r}),a.createElement("a",{style:{position:"absolute",top:"75%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",width:"calc(100% - 15px)"},href:t,target:n?"blank":"_parent"},a.createElement("button",{onClick:d,className:"le-joinbow-btn js-popup-other-submit"},l)),a.createElement(q,{onClose:o,containerClassName:"close-button-top-right"})))):"SkinB"==s?a.createElement("aside",{className:"le-only-desktop"},a.createElement("div",{className:""},a.createElement("div",{style:{position:"relative",zIndex:1e4}},a.createElement("img",{src:r,style:{width:"100%"}}),a.createElement("a",{style:{position:"absolute",top:"75%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",width:"100%"},href:t,target:n?"blank":"_parent"},a.createElement("button",{onClick:d,className:"le-joinbow-btn-mobile js-popup-other-submit"},l)),a.createElement(q,{containerClassName:"close-button-top-right",onClose:o})))):null,a.createElement("aside",{className:"le-only-mobile"},a.createElement("div",{className:"le-skin-mobile"},a.createElement("div",{style:{position:"relative"}},a.createElement("img",{src:i,style:{width:"100%"}}),a.createElement("a",{style:{position:"absolute",top:"82%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",maxWidth:"calc(100% - 15px)"},href:t,target:n?"blank":"_parent"},a.createElement("button",{onClick:d,className:"le-joinbow-btn-mobile js-popup-other-submit"},l)),a.createElement(q,{containerClassName:"close-button-top-right",svgClassName:"le-mobile-btn",onClose:o})))))},ke=({popupId:e,url:t,newTab:l,image:n,onClose:o,onOtherSubmit:i})=>a.createElement("div",{id:e,className:"lead-modal-wrapper","data-popup-url":location.pathname,"data-popup-type":"tab"},a.createElement("div",{className:"le-tab-popup"},a.createElement("div",{style:{position:"relative"}},a.createElement("a",{href:t,target:l?"blank":"_parent",onClick:i},a.createElement("img",{className:"js-popup-other-submit",src:n})),a.createElement(q,{onClose:o,containerClassName:"close-button-top-right"})))),_e=[],Ee=[],we=[];const Ce=e=>{const t=[...e];for(let e=t.length-1;e>0;e--){const a=Math.floor(Math.random()*(e+1)),l=t[e];t[e]=t[a],t[a]=l}return t},Ne=(e="UTC")=>{const t=new Date;return new Date(t.toLocaleString("en-US",{timeZone:e}))},Se=e=>{try{const[t,a]=e.split(" "),[l,n,o]=t.split("-").map(Number),[i,r,s]=a.split(":").map(Number);return new Date(l,n-1,o,i,r,s)}catch(e){return null}};const Te=e=>1===e.formatted_status?function(e){var t;if(1===e.forever)return!0;const a=e.started_at,l=e.ended_at,n=Se(a),o=Se(l);if(!n||!o)return!0;const i=(null===(t=e.site)||void 0===t?void 0:t.id)||1,r=H[i];return!(Ne(r).getTime()>o.getTime()&&(we.push(e),1))}(e):0===e.formatted_status&&(_e.push(e),(e=>{var t;const a=(null===(t=e.site)||void 0===t?void 0:t.id)||1,l=e.started_at,n=e.ended_at,o=Se(l),i=Se(n);if(!o||!i)return!1;const r=H[a],s=Ne(r).getTime();return s<=i.getTime()&&s>=o.getTime()&&(Ee.push(e),!0)})(e));let xe=null;function Oe({leadApi:e,leadSiteId:t,leadDomain:a,onShowPopup:l,DEBUG_URL:n}){const o=n||("https://"+location.hostname+location.pathname+location.search).toLowerCase();fetch(e+"api/campaign/"+t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:o,ga_client_id:u("_ga")||null})}).then((e=>e.json())).then((e=>{var t,n,i,r,s;if(Pe("List campagin: ",e),U="https://"+location.hostname+location.pathname+location.search,1==e._status){const d=(null===(n=null===(t=e._data)||void 0===t?void 0:t.campaigns)||void 0===n?void 0:n.filter(Te))||[];u("hhg-id")||(p("hhg-id",v(),{domain:"."+a,path:"/"}),Pe("😍 Set HHG ID cookie"));let c=[];c=/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Kindle|Silk|Opera Mini/i.test(navigator.userAgent)?d.filter((e=>e.device_types.some((e=>e.id==A.MOBILE)))):d.filter((e=>e.device_types.some((e=>e.id==A.DESKTOP)))),Pe("👓 campaignsDevice",c),Pe("--listCampaignScheduled",_e),Pe("--listCampaignScheduledToActivated",Ee),Pe("--listCampaignActiveButExpired",we);let m=c.map(((e,t)=>e.targets.filter((e=>e.type==L.LINKS)).map((e=>Object.assign(Object.assign({},e),{campaignIndex:t}))))).flat(1);m=m.filter((e=>{const t=new URL(String(e.target).toLowerCase());if("exact_match"==e.option)return Boolean(o===t.href);if("start_with"==e.option){if(o.includes(String(e.target))){return!e.sub_target.filter((e=>"excluding"==e.option)).map((e=>e.value)).includes(o.split("?")[0])}return!1}}));const h=Array.from(document.getElementsByTagName("META")).filter((e=>"article:tag"==e.getAttribute("property"))).map((e=>e.content));let g=[],b=[];h&&h.length&&(g=c.map(((e,t)=>e.targets.filter((e=>e.type==L.TAGS)).map((e=>Object.assign(Object.assign({},e),{campaignIndex:t}))))).flat(1),b=g.filter((e=>h.includes(e.target))));const f=[...m,...b],y=document.cookie.split("; ").map((e=>e.split("=")[0])),k=y.filter((e=>e.includes("lead_submited")));Pe("--listCampaignCodeSubmited",k);const _=y.filter((e=>e.includes("lead_closed")));Pe("--listCampaignCodeClosed",_);const E=[...k,..._],w=f.filter((e=>!E.some((t=>t.includes(c[e.campaignIndex].code))))),C=Ce(w);if(Pe("--listCampaignValid : ",C),C&&C.length){const e=c[C[0].campaignIndex];Pe("CAMPAIGN_SHOW",e);const{rules:t}=e,a=Number(null===(i=t.find((e=>"time"==e.rule)))||void 0===i?void 0:i.value);Pe("timeoutRule",a);const n=Number(null===(r=t.find((e=>"scroll"==e.rule)))||void 0===r?void 0:r.value);Pe("scrollRule",n);const o=Number(null===(s=t.find((e=>"exclude_sponsored"==e.rule)))||void 0===s?void 0:s.value);Pe("excludeSponsored",o);const d=Boolean(document.querySelector(".hhg-disclaimer-text"));if(Pe("💎 LEAD current page isSponsored",d),d&&o)return;let m="TIME";if(Number.isInteger(a)&&(m="TIME",Pe("✨ SHOW AWESOME POPUP AFTER: ",a," seconds"),xe&&clearTimeout(xe),xe=setTimeout((()=>{null==l||l(e,m)}),1e3*a)),Number.isInteger(n)){m="SCROLL",Pe("✨ SHOW AWESOME AFTER: SCROLL",n," %");const t=document.querySelector(`[data-url="${location.pathname}"]`)||document.querySelector("body"),a=t.getBoundingClientRect().top,o=t.offsetHeight;Pe("👓 Element check scroll: ",t);const i=function(){const t=window.pageYOffset||document.documentElement.scrollTop;let r=0;t>=a&&(r=Math.round((t-a)/(o-innerHeight)*100)),Pe("---Scroll",r,n),r>=n&&(window.removeEventListener("scroll",i),null==l||l(e,m))};window.addEventListener("scroll",i,{passive:!0})}}else Pe("🚧 No lead campaigns on current URL, tags")}})).catch((e=>{Pe("Lead error: ",e)}))}const Pe=(...e)=>{("production"!==process.env.NODE_ENV||process.env.NEXT_PUBLIC_DEPLOY_ENV&&"production"!==process.env.NEXT_PUBLIC_DEPLOY_ENV||"undefined"!=typeof localStorage&&"true"===localStorage.getItem("hhg_debug"))&&console.log(...e)};const je=({campaign:e,action:t,onSubmit:l,onClose:n,showThankyou:i,locale:d})=>{var c,m;b();const{apiUrl:h,siteDomain:g}=s(W);r((()=>{const e=u("_ga")||null;fetch(`${h}api/campaign/${_}/impression`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:t,url:location.href.toLowerCase(),title_article:document.title,cookie_id:u("hhg-id"),ga_client_id:e})})}),[]);const{extra_fields:f,image:y,image_desktop:k,code:_,image_background:E,image_overlay_mobile:w,image_overlay_desktop:C}=e,{currentLayout:N}=f,S=f.imageBlocks?JSON.parse(f.imageBlocks):{},T=JSON.parse(f.actionBlocks),x=JSON.parse(f.textBlocks);let O=(null===(m=null===(c=null==x?void 0:x.titleBlock)||void 0===c?void 0:c.data)||void 0===m?void 0:m.value)||"";const P={1:{},2:{},3:{}},j=o("lead-modal-"+v()),B=function(e="Xin chao {{category_2}} extra"){if(e.includes("{{category_")){const t="{{category_".length,a=e.search("{{category_");return+e.charAt(t+a)}return null}(O);if(B){Pe("⚡️ Has categoryLevel",B);const e=Array.from(document.getElementsByTagName("META")),t=e.find((e=>e.name===`content_category_${B}`)),a=e.find((e=>e.name===`content_category_en_${B}`));if(!t||!a)return Pe("⚡️ No META TAG for categoryLevel, not show popup",B),null;P[B]={value:t.content,value_en:a.content},O=O.replace(`{{category_${B}}}`,t.content),Pe("⚡️ Set categoryData ",B)}else Pe("⚡️ No categoryLevel",B);const L=()=>{var t,a,l,o;if(Pe("👌 Other submit click"),document.body.classList.remove("noscroll"),N.includes("Skin")){const e=document.querySelector("#masthead");e&&(e.style.top="0px !important;")}const i=Number(null!==(a=null===(t=e.rules.find((e=>"days_to_show_again"==e.rule)))||void 0===t?void 0:t.value)&&void 0!==a?a:7),r=Number(null!==(o=null===(l=e.rules.find((e=>"show_again_after_submit"==e.rule)))||void 0===l?void 0:l.value)&&void 0!==o?o:0);0===r&&(Pe("⛔ Popup never show again!"),p(`lead_submited_${_}`,`target_${f.popupVersion}`,{domain:"."+g,path:"/"})),1==r&&(Pe(`⌛ Popup will show again after ${i} days!`),p(`lead_submited_${_}`,`target_${f.popupVersion}`,{domain:"."+g,days:i,path:"/"}));const s=u("_ga")||null,d={url:location.href.toLowerCase(),title_article:document.title,meta:[],cookie_id:u("hhg-id"),ga_client_id:s};B&&(d.category=P[B].value_en),fetch(`${h}api/campaign/${_}/lead`,{method:"POST",body:JSON.stringify(d),headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}).then((e=>e.json())).then((e=>{"error"===e.status&&Pe(e)})).catch((e=>{Pe("Error:",e)})),null==n||n()};return"CenterTab"===N?a.createElement(Y,{popupId:j.current,url:S.imageMobile.data.url,newTab:S.imageMobile.data.newtab,imageMobile:y,imageDestkop:k,onClose:n,onOtherSubmit:L}):"Tab"===N?a.createElement(ke,{popupId:j.current,url:S.imageMobile.data.url,newTab:S.imageMobile.data.newtab,image:y,onClose:n,onOtherSubmit:L}):"Floating"===N?a.createElement(J,{popupId:j.current,title:O,titleAlign:x.titleBlock.data.align,subtitle:x.subtitleBlock.data.value,subtitleAlign:x.subtitleBlock.data.align,url:T.linkButtonBlock.data.url,urlText:T.linkButtonBlock.data.value,newTab:T.linkButtonBlock.data.newtab,imageMobile:y,imageDesktop:k,onClose:n,onOtherSubmit:L}):N.includes("LightBox")||N.includes("Inline")||"Fullscreen"==N||"Sidebar"==N||"Slider"==N?a.createElement(fe,{popupId:j.current,extraFields:f,onClose:n,onOtherSubmit:L,imageMobile:y,imageDesktop:k,imageBackground:E,currentLayout:N,title:O,onSubmit:(e,t)=>l(e,t,B,P),key:N,imageOverlayDesktop:C,imageOverlayMobile:w,showThankyou:i,campaignId:e.id,campaign_subot_id:e.bot_id||[],locale:d}):N.includes("Skin")?a.createElement(ye,{popupId:j.current,link:T.linkButtonBlock.data.url,linkNewTab:!!T.linkButtonBlock.data.newtab,linkText:T.linkButtonBlock.data.value,onClose:n,onOtherSubmit:L,imageMobile:y,imageDesktop:k,currentLayout:N}):null},Be=({apiUrl:e,siteDomain:l,siteId:s,locale:h,apiSubotUrl:v,DEBUG_URL:b})=>{var f;const y=o(),k=o(Date.now()),{apiUrl:_}=n((()=>{let t=e;return t.includes("localhost")&&(t="https://dev.leadgen.hellobacsi.com/"),{apiUrl:t}}),[e,l,s]),[w,C]=i(null),[N,S]=i(""),[T,x]=i(null);r((()=>{K.apiLeadUrl=_,K.apiSubotUrl=v}),[_,v]);const O=(e,t)=>{C(e),S(t)},P=()=>{var e,t;if(!w)return;Pe(`👋👋👋 CLOSE POPUP ${w.code} 👋👋👋`);const a=Number(null===(e=w.rules.find((e=>"show_again_after_exit"==e.rule)))||void 0===e?void 0:e.value),n=Number(null===(t=w.rules.find((e=>"days_to_show_again"==e.rule)))||void 0===t?void 0:t.value);0==a&&p(`lead_closed_${w.code}`,`target_${w.extra_fields.popupVersion}`,n?{domain:"."+l,days:n,path:"/"}:{domain:"."+l,path:"/"}),document.body.classList.remove("noscroll"),fetch(`${_}api/campaign/${w.code}/popup_exit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"CLICK",url:location.href.toLowerCase(),title_article:document.title,cookie_id:u("hhg-id"),duration:Math.ceil((Date.now()-k.current)/1e3)})}),C(null),x(null)};r((()=>{if(window.next){const e=d((e=>{Pe("--🌻 routeChangeComplete",e,Date.now());const t=location.pathname;P(),document.querySelectorAll(`[data-popup-url="${t}"]`).length?Pe("🔥 This URL page has show popup!"):(Pe("--Process checkShowPopup"),Oe({leadApi:_,leadDomain:l,leadSiteId:s,onShowPopup:O,DEBUG_URL:b})),y.current&&window.removeEventListener("scroll",y.current)}),500);window.next.router.events.on("routeChangeComplete",e)}Oe({leadApi:_,leadDomain:l,leadSiteId:s,onShowPopup:O,DEBUG_URL:b})}),[]);return r((()=>{w&&(k.current=Date.now())}),[w]),a.createElement(W.Provider,{value:{apiUrl:_,siteDomain:l,siteId:s,locale:h}},a.createElement(m.Provider,{value:{locale:h,values:V(h)}},c(a.createElement(a.Fragment,null,"2.1"===(null===(f=null==w?void 0:w.extra_fields)||void 0===f?void 0:f.popupVersion)&&a.createElement(je,{campaign:w,action:N,onSubmit:(e,a,n,o)=>t(void 0,void 0,void 0,(function*(){var t,i,r,s,d,c,m,h,g,v,b;if(!a)return;Pe("submitHandler",n,o);const f=Object.keys(a).map((e=>({name:e,value:String(a[e])}))),y=u("_ga")||null;window.intlTelInputUtils||(yield require("intl-tel-input/build/js/utils"));const k={url:location.href.toLowerCase(),title_article:document.title,meta:f.map((t=>{var a,l;const n=(null===(a=e.querySelector(`*[name="${t.name}"]`))||void 0===a?void 0:a.getAttribute("data-control"))||(null===(l=e.querySelector(`*[data-extra][data-name="${t.name}"]`))||void 0===l?void 0:l.getAttribute("data-control"))||"text",o="tel"===n?window.intlTelInputUtils.formatNumber(String(t.value),null==M?void 0:M.countryCodeNumber,2).replace(/\s+/g,""):"date"===n?E(t.value).format("YYYY-MM-DD"):t.value;return{key:t.name,value:o,control:n,is_sent_mailchimp:e.querySelector(`div[data-name="${t.name}-mailchimp"]`)?"true":"false"}})),cookie_id:u("hhg-id"),ga_client_id:y};n&&o[n].value_en&&(k.category=o[n].value_en);const C=Number((null===(i=null===(t=w.rules)||void 0===t?void 0:t.find((e=>"days_to_show_again"===e.rule)))||void 0===i?void 0:i.value)||7),N=Number((null===(s=null===(r=w.rules)||void 0===r?void 0:r.find((e=>"show_again_after_submit"===e.rule)))||void 0===s?void 0:s.value)||0);if(0==N&&(Pe("⛔ Popup never show again!"),p(`lead_submited_${w.code}`,`target_${w.extra_fields.targetType}`,{domain:"."+l,path:"/"})),1==N&&(Pe(`⌛ Popup will show again after ${C} days!`),p(`lead_submited_${w.code}`,`target_${w.extra_fields.targetType}`,{domain:"."+l,days:C,path:"/"})),fetch(`${_}api/campaign/${w.code}/lead`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)}),"notshow"==w.extra_fields.popupShowThankYou)return P(),void document.body.classList.remove("noscroll");let S=!0;const T=w.thank_you_image||`${_}admin/img/thanksyou.png`;let O,j,B=w.extra_fields.popupThankyouTitle||"Thank you.",L=w.extra_fields.popupThankyouDesc||"We appreciate your time!",I="",A="",$="";if("2.1"==w.extra_fields.popupVersion){const e=w.extra_fields,t=JSON.parse(e.listBlockThankyou),a=t.find((e=>"TitleBlock"==e.name)),l=t.find((e=>"SubtitleBlock"==e.name)),n=t.find((e=>"LinkButtonBlock"==e.name));B=(null===(d=null==a?void 0:a.data)||void 0===d?void 0:d.value)||"",I=(null===(c=null==a?void 0:a.data)||void 0===c?void 0:c.align)||"",L=(null===(m=null==l?void 0:l.data)||void 0===m?void 0:m.value)||"",A=(null===(h=null==l?void 0:l.data)||void 0===h?void 0:h.align)||"",O=(null===(g=null==n?void 0:n.data)||void 0===g?void 0:g.value)||"",j=(null===(v=null==n?void 0:n.data)||void 0===v?void 0:v.newtab)||!1,$=(null===(b=null==n?void 0:n.data)||void 0===b?void 0:b.url)||"";const o=w.extra_fields.currentLayout;["SkinA","SkinB","Floating","Tab","CenterTab"].includes(o)&&(S=!1)}x(S?{title:B,titleAlign:I,subtitle:L,subtitleAlign:A,link:$,linkNewTab:j,linkText:O,image:T}:null),sessionStorage.getItem("insider_object")?window.insider_object=JSON.parse(sessionStorage.getItem("insider_object")):window.insider_object={user:{email:"",phone_number:"",gdpr_optin:!0,sms_optin:!0,email_optin:!0}},f.map((e=>{const t=e.name,a=e.value;"tel"==t?window.insider_object.user.phone_number=a:"email"==t&&(window.insider_object.user.email=a)})),sessionStorage.setItem("insider_object",JSON.stringify(window.insider_object))})),onClose:P,showThankyou:T,locale:h})),g())))};export{Be as LeadGen};
1
+ import{_ as e,a as t}from"./tslib.es6-f1b9d31e.js";import a,{createContext as l,useMemo as n,useRef as o,useState as i,useEffect as r,useContext as s}from"react";import d from"lodash/debounce";import{createPortal as c}from"react-dom";import{T as m}from"./translationsContext-d4d12e4a.js";import{g as u,s as p}from"./cookieHelper-b88c2be8.js";import{b as h,a as g}from"./utils-049d75fa.js";import{v1 as v}from"uuid";import{u as b}from"./useTranslations-86f7e107.js";import{H as f}from"./index.styled-38864315.js";import{B as y}from"./index-10233643.js";import{CommonGAssets as k}from"./gAssets.js";import"./index.styled-839052ac.js";import"./index-e1e88ca8.js";import{t as _}from"./theme-6dca57c7.js";import"@mantine/core";import"./index.styled-c3d5eff6.js";import"string-format";import"./index-77a5c7ce.js";import"./index.styled-89252990.js";import"date-fns";import"react-day-picker/DayPickerInput";import"./index.styled-981e6c04.js";import"./index-28b8dab6.js";import"lodash/throttle";import"keen-slider/react";import E from"dayjs";import"./screenSizeContext-796cb6e5.js";import"styled-components";import"./index-c9290e7f.js";import"./isProduction-e00482ad.js";import"./Locale-2a1e1450.js";import"@mantine/hooks";import{I as w,N as C}from"./index-881e5990.js";import"react-hook-form";import"date-fns/locale/en-US";import"date-fns/locale/id";import"date-fns/locale/vi";import"date-fns/locale/zh-TW";import"./index.styled-8aca10eb.js";import"@mantine/dates";import{R as N,f as S,D as T,P as x}from"./index-fcef2054.js";import{S as O}from"./index-6d8a955b.js";import{M as P}from"./index-f3de7ff9.js";import{createFormContext as j}from"@mantine/form";import"./index.styled-243d7f64.js";import"./index-43d2bffe.js";import"yup";import{T as B}from"./index-6b049c9f.js";import"./index-65b95e24.js";import"./index-4b19571c.js";import"@hookform/resolvers/yup";import"./index-c2de5d7b.js";import"./index-e2b7ef68.js";import"slugify";import"./routing-6d3d5706.js";import"dayjs/plugin/relativeTime";import"./useScrollbarSize-057c4f10.js";import"./useUniqueId-679a497e.js";import"./Vietnam-dc72e656.js";import"@mantine/carousel";import"./Visible-18cf87ba.js";const L={LINKS:1,TAGS:2};let I="https://dev.leadgen.hellobacsi.com/";const A={MOBILE:1,DESKTOP:2};let $="";I.includes("localhost")&&(I="https://dev.leadgen.hellobacsi.com/"),location.hostname.includes("marrybaby.vn")&&($="pink");let U="https://"+location.hostname+location.pathname+location.search;U=U.toLowerCase(),sessionStorage.getItem("insider_object")&&(window.insider_object=JSON.parse(sessionStorage.getItem("insider_object")));const D={"vi-VN":{popupLang:"vi",countryCode:"vn",countryCodeNumber:84},"id-ID":{popupLang:"id",countryCode:"id",countryCodeNumber:62},"th-TH":{popupLang:"th",countryCode:"th",countryCodeNumber:66},"ms-MY":{popupLang:"ms",countryCode:"my",countryCodeNumber:60},"zh-TW":{popupLang:"zh",countryCode:"tw",countryCodeNumber:886},"km-KH":{popupLang:"km",countryCode:"kh",countryCodeNumber:855},"my-MM":{popupLang:"my",countryCode:"mm",countryCodeNumber:95},"hi-IN":{popupLang:"hi",countryCode:"in",countryCodeNumber:91}},M=D[document.documentElement.lang]||D["vi-VN"];const H={1:"Asia/Ho_Chi_Minh",10:"Asia/Ho_Chi_Minh",11:"Asia/Ho_Chi_Minh",12:"Asia/Ho_Chi_Minh",2:"Asia/Jakarta",3:"Asia/Bangkok",4:"Asia/Phnom_Penh",5:"Asia/Kuala_Lumpur",6:"Asia/Taipei",7:"Asia/Yangon",8:"Asia/Kolkata",9:"Asia/Manila"};var R={"validator.required":"This field is required.","validator.remote":"Please fix this field.","validator.email":"Please enter a valid email address.","validator.phone":"Please input correct phone number.","validator.url":"Please enter a valid URL.","validator.date":"Please enter a valid date.","validator.dateISO":"Please enter a valid date (ISO).","validator.number":"Please enter a valid number.","validator.digits":"Please enter only digits.","validator.creditcard":"Please enter a valid credit card number.","validator.equalTo":"Please enter the same value again.","validator.accept":"Please enter a value with a valid extension.","validator.maxlength":"jQuery.validator.format('Please enter no more than {0} characters.","validator.minlength":"jQuery.validator.format('Please enter at least {0} characters.","validator.rangelength":"jQuery.validator.format('Please enter a value between {0} and {1} characters long.","validator.range":"jQuery.validator.format('Please enter a value between {0} and {1}.","validator.max":"jQuery.validator.format('Please enter a value less than or equal to {0}.","validator.min":"jQuery.validator.format('Please enter a value greater than or equal to {0}.","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"};const F={"en-PH":R,"vi-VN":{"validator.required":"Vui lòng điền mục này","validator.email":"Vui lòng điền email có thật.","validator.number":"Vui lòng điền số có thật","validator.digits":"Vui lòng chỉ điền số","validator.maxlength":"Vui lòng điền dưới {0} số","validator.minlength":"Vui lòng điền hơn {0} số","validator.remote":"Hãy sửa cho đúng.","validator.url":"Hãy nhập URL.","validator.date":"Hãy nhập ngày.","validator.dateISO":"Hãy nhập ngày (ISO).","validator.creditcard":"Hãy nhập số thẻ tín dụng.","validator.equalTo":"Hãy nhập thêm lần nữa.","validator.extension":"Phần mở rộng không đúng.","validator.rangelength":"Hãy nhập từ {0} đến {1} kí tự.","validator.range":"Hãy nhập từ {0} đến {1}.","validator.max":"Hãy nhập từ {0} trở xuống.","validator.min":"Hãy nhập từ {0} trở lên.","validator.phone":"Nhập đúng định dạng số điện thoại","validator.emailUsed":"Email này đã được sử dụng cho chiến dịch.","validator.phoneUsed":"Số điện thoại này đã được sử dụng cho chiến dịch.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"hi-IN":{"validator.required":"इस क्षेत्र की आवश्यकता है।","validator.email":"कृपया एक मान्य ईमेल पता दर्ज करें","validator.number":"कृपया एक वैध संख्या दर्ज करें","validator.digits":"कृपया केवल अंक दर्ज करें","validator.maxlength":"कृपया {0} अक्षर से अधिक दर्ज न करें","validator.minlength":"कृपया कम से कम {0} अक्षर दर्ज करें","validator.phone":"कृपया एक वैध संख्या दर्ज करें","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"id-ID":{"validator.required":"Kolom ini wajib diisi","validator.email":"Tolong daftarkan email yang valid","validator.number":"Tolong daftarkan nomor telepon yang valid","validator.digits":"Tolong masukkan angka saja","validator.maxlength":"Jangan memasukkan lebih dari {0} karakter","validator.minlength":"Tolong ketik sedikitnya {0} karakter","validator.phone":"Tolong daftarkan nomor telepon yang valid","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"ms-MY":{"validator.required":"Bahagian ini wajib diisi.","validator.email":"Sila masukkan alamat emel yang sah.","validator.number":"Sila masukkan no telefon yang sah.","validator.digits":"Sila masukkan nombor digit sahaja.","validator.maxlength":"Sila masukkan tidak lebih dari {0} aksara","validator.minlength":"Sila masukkan sekurang-kurangnya {0} aksara","validator.phone":"Sila masukkan no telefon yang sah.","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"my-MM":{"validator.required":"ဒီနေရာမှာ ဖြည့်ဖို့ လိုအပ်ပါတယ်","validator.email":"မှန်ကန်သော အီးမေးလ်လိပ်စာထည့်သွင်းပါ","validator.number":"မှန်ကန်သော ဖုန်းနံပါတ်ထည့်သွင်းပါ","validator.digits":"နံပါတ်များသာဖြည့်ပါ","validator.maxlength":"ကျေးဇူးပြု၍ {0} ထပ်မပိုသော ဂဏန်းများသာဖြည့်ပါ","validator.minlength":"ကျေးဇူးပြု၍ အနည်းဆုံး {0} ဂဏန်းဖြည့်ပါ","validator.phone":"မှန်ကန်သော ဖုန်းနံပါတ်ထည့်သွင်းပါ","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"km-KH":{"validator.required":"ព័ត៌មាន​ចាំបាច់​ដែល​ត្រូវ​បំពេញ","validator.email":"សូម​វាយ​អាសយដ្ឋាន​អ៊ីម៉ែល​ឲ្យ​បាន​ត្រឹមត្រូវ","validator.number":"សូម​វាយបញ្ចូល​លេខ​ឲ្យ​បាន​ត្រឹមត្រូវ","validator.digits":"វាយ​បញ្ចូល​បាន​តែ​លេខ​ប៉ុណ្ណោះ","validator.maxlength":"សូម​វាយ​បញ្ចូលកុំ​ឲ្យ​លើស {0} តួអក្សរ","validator.minlength":"សូម​វាយ​បញ្ចូល​តិច​បំផុត {0} តួអក្ស","validator.phone":"សូម​វាយបញ្ចូល​លេខ​ឲ្យ​បាន​ត្រឹមត្រូវ","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"zh-TW":{"validator.required":"此為必填欄位","validator.email":"請填入有效的 email 地址","validator.number":"請填入有效的電話號碼","validator.digits":"此欄位僅能輸入數字","validator.maxlength":"請輸入少於 {0} 位數","validator.minlength":"請輸入至少 {0} 位數","validator.phone":"請填入有效的電話號碼","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"th-TH":{"validator.required":"ต้องระบุข้อมูลในช่องนี้","validator.email":"กรุณาใส่อีเมล์ที่ถูกต้อง","validator.number":"กรุณาใส่ตัวเลขที่ถูกต้อง","validator.digits":"กรุณาส่เฉพาะตัวเลข","validator.maxlength":"กรุณาใส่ตัวเลขมากกว่า {0} หลัก","validator.minlength":"กรุณาใส่ตัวเลขอย่างน้อย {0} หลัก","validator.phone":"กรุณาใส่ตัวเลขที่ถูกต้อง","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"tl-PH":R},V=e=>{const t=F[e];return t||F["en-PH"]},W=l({}),q=({onClose:e,containerClassName:t,svgClassName:l})=>a.createElement("button",{onClick:e,className:`le-newbuilder-close-button js-modal__close ${t||""}`},a.createElement("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:l},a.createElement("circle",{cx:"16",cy:"16",r:"16",fill:"white"}),a.createElement("path",{d:"M16 17.05L10.925 22.125C10.7917 22.2584 10.621 22.329 10.413 22.337C10.2044 22.3457 10.025 22.275 9.87502 22.125C9.72502 21.975 9.65002 21.8 9.65002 21.6C9.65002 21.4 9.72502 21.225 9.87502 21.075L14.95 16L9.87502 10.925C9.74169 10.7917 9.67102 10.6207 9.66302 10.412C9.65436 10.204 9.72502 10.025 9.87502 9.87502C10.025 9.72502 10.2 9.65002 10.4 9.65002C10.6 9.65002 10.775 9.72502 10.925 9.87502L16 14.95L21.075 9.87502C21.2084 9.74169 21.3794 9.67069 21.588 9.66202C21.796 9.65402 21.975 9.72502 22.125 9.87502C22.275 10.025 22.35 10.2 22.35 10.4C22.35 10.6 22.275 10.775 22.125 10.925L17.05 16L22.125 21.075C22.2584 21.2084 22.329 21.379 22.337 21.587C22.3457 21.7957 22.275 21.975 22.125 22.125C21.975 22.275 21.8 22.35 21.6 22.35C21.4 22.35 21.225 22.275 21.075 22.125L16 17.05Z",fill:"#595959"}))),Y=({popupId:e,url:t,newTab:l,imageDestkop:n,imageMobile:o,onClose:i,onOtherSubmit:r})=>a.createElement("div",{id:e,className:"lead-modal-wrapper","data-popup-url":location.pathname,"data-popup-type":"center_tab"},a.createElement("div",{className:"le-center-tab-popup"},a.createElement("div",{style:{position:"relative"}},a.createElement("a",{className:"js-popup-other-submit",href:t,target:l?"blank":"_parent",onClick:r},a.createElement("img",{className:"le-only-mobile",src:o}),a.createElement("img",{className:"le-only-desktop",src:n})),a.createElement(q,{onClose:i,containerClassName:"close-button-top-right"})))),J=({popupId:e,url:t,title:l,urlText:n,titleAlign:o,subtitle:i,subtitleAlign:r,newTab:s,imageDesktop:d,imageMobile:c,onClose:m,onOtherSubmit:u})=>a.createElement("div",{id:e,className:"lead-modal-wrapper lead-floating-wrapper","data-popup-url":location.pathname,"data-popup-type":"floating"},a.createElement("aside",{className:"le-only-desktop"},a.createElement("div",{className:"le-floating-desktop"},a.createElement("div",{className:"le-floating-desktop-wrap",style:{position:"relative",background:"#fff"}},d?a.createElement("div",null,a.createElement("img",{style:{maxWidth:120,borderTopLeftRadius:5,borderBottomLeftRadius:5},src:d})):null,a.createElement("div",{style:{padding:20}},a.createElement("div",{className:`le-floating-desktop-title le-text-align-${o}`},l),a.createElement("div",{className:`le-floating-desktop-desc le-text-align-${r}`},i)),a.createElement("a",{target:s?"blank":"_parent",style:{marginLeft:35,textDecoration:"none"},href:t},a.createElement("button",{className:"le-joinbow-floating-btn js-popup-other-submit",onClick:u},n)),a.createElement(q,{onClose:m,containerClassName:"close-button-top-right"})))),a.createElement("aside",{className:"le-only-mobile"},a.createElement("div",{className:"le-floating-mobile"},a.createElement("div",{className:"le-floating-mobile-wrap",style:{position:"relative",background:"#fff"}},a.createElement("aside",{style:{display:"flex",justifyContent:"space-between"}},a.createElement("div",null,a.createElement("div",{className:`le-floating-mobile-title le-text-align-${o}`},l),a.createElement("div",{className:`le-floating-mobile-desc le-text-align-${r}`},i)),c?a.createElement("div",null,a.createElement("img",{style:{marginLeft:15,marginTop:4,maxWidth:100},src:c})):null),a.createElement("div",{style:{textAlign:"center",marginTop:10}},a.createElement("a",{target:s?"blank":"_parent",href:t,style:{textDecoration:"none"}},a.createElement("button",{className:"le-joinbow-floating-btn js-popup-other-submit",onClick:u},n))),a.createElement(q,{onClose:m,containerClassName:"close-button-top-right"}))))),z=({title:e,titleAlign:t,subtitle:l,subtitleAlign:n,link:o,linkNewTab:i,linkText:r,image:s})=>a.createElement("div",{className:"lead-modal__thank-you"},a.createElement("div",{style:{width:"100%"}},a.createElement("img",{src:s,style:{maxHeight:162,objectFit:"cover"}}),e&&a.createElement("h1",{className:`le-thankyou-title le-text-align-${t}`},e),l&&a.createElement("p",{className:`le-thankyou-subtitle le-text-align-${n}`},l),r&&a.createElement("div",null,a.createElement("a",{href:o,target:i?"_blank":"parrent",rel:"noreferrer"},a.createElement("button",{className:`lead-modal__btn ${$}`},r)))));const K=new class{constructor(){this.apiLeadUrl="https://dev.leadgen.hellobacsi.com/",this.apiSubotUrl="https://staging-service-subot.hellohealthgroup.com/"}},G={call(t){var{url:a,data:l}=t,n=e(t,["url","data"]);return n.body=JSON.stringify(l),n.headers={"Content-Type":"application/json"},fetch(`${K.apiLeadUrl}${a}`,n).then((e=>e.json())).catch((e=>({})))}},Q={call(t){var{url:a,data:l}=t,n=e(t,["url","data"]);return n.body=JSON.stringify(l),n.headers={"Content-Type":"application/json"},fetch(`${K.apiSubotUrl}${a}`,n).then((e=>e.json())).catch((e=>({})))}},X=({bot_id:e,email:t,phone:a})=>{let l=a;return l&&l.startsWith("0")&&(l=l.substring(1)),Q.call({url:"frontend/api/subot-campaign/check",method:"post",data:{bot_id:e,email:t,phone:l}})},Z=({campaign_id:e,email:t,phone:a})=>{let l=a;return l&&l.startsWith("0")&&(l=l.substring(1)),G.call({url:"api/subot-campaign/check",method:"post",data:{campaign_id:e,email:t,phone:l}})},ee=({phone:e})=>G.call({url:"api/sms/otp",method:"post",data:{phone_number:e.replace("+","")}}),te=({phone:e,otp:t})=>G.call({url:"api/sms/verify",method:"post",data:{otp_code:t,phone_number:e.replace("+","")}}),ae={email:{},phone:{}},le=(e,a,l)=>t(void 0,void 0,void 0,(function*(){const n="email"in l?"email":"phone",o="email"in l?l.email:l.phone,i="email"in l?"validator.emailUsed":"validator.phoneUsed";if(ae[n][o]){if(ae[n][o].value)return i;if(!ae[n][o].value&&ae[n][o].expire>Date.now())return""}const r=yield((e,a,l)=>t(void 0,void 0,void 0,(function*(){const t="email"in l?"email":"phone",n="email"in l?l.email:l.phone,o="email"in l?"validator.emailUsed":"validator.phoneUsed",i=yield Z({campaign_id:[e],[t]:n});return"SubmitLeadWithBotId_ERR_001"===i._errorCode||"SubmitLeadWithBotId_ERR_002"===i._errorCode||a.length&&"CheckSuBotLeadTool_ERR_001"===(yield X({bot_id:a,[t]:n}))._errorCode?o:void 0})))(e,a,l);return ae[n][o]=r?{value:!0}:{value:!1,expire:Date.now()+6e4},r})),ne=({content:e,inlinePosition:t})=>{const a=n((()=>{if(!t)return null;const e=document.querySelectorAll(`[data-url="${location.pathname}"] .body-content`),a=Array.from(e).reduce(((e,t)=>[...e,...Array.from(t.children)]),[]);if(null==a?void 0:a.length){const e=a.filter((e=>"P"===e.nodeName)),l=a.filter((e=>"H2"===e.nodeName));let n=null;switch(t){case"1th":n=e[0];break;case"2th":n=e[1];break;case"3th":n=e[2];break;case"4th":n=e[3];break;case"5th":n=e[4];break;case"6th":n=e[5];break;case"7th":n=e[6];break;case"8th":n=e[7];break;case"9th":n=e[8];break;case"10th":n=e[9];break;case"11th":n=e[10];break;case"12th":n=e[11];break;case"lastP":n=e[e.length-1];break;case"1thH2":n=l[0];break;case"2thH2":n=l[1];break;case"3thH2":n=l[2];break;case"4thH2":n=l[3];break;case"5thH2":n=l[4];break;case"6thH2":n=l[5];break;case"7thH2":n=l[6];break;case"8thH2":n=l[7];break;case"9thH2":n=l[8];break;case"10thH2":n=l[9];break;case"lastH2":n=l[l.length-1]}if(n){if(n.parentElement.querySelector(".inline-lead-wrapper"))return n.parentElement.querySelector(".inline-lead-wrapper");{const e=document.createElement("div");return e.classList.add("inline-lead-wrapper"),n.nextElementSibling?n.parentElement.insertBefore(e,n.nextElementSibling):n.parentElement.appendChild(e),e}}}}),[t]);return t&&a?c(e,a):null},oe=({content:e})=>{const t=n((()=>{const e=Array.from(document.querySelectorAll(".hc2-sidebar-with-ads,.page-main-col .right-col.f-right,.hhg-lead-sidebar"));return e.forEach((e=>{if(e.querySelector(".sidebar-lead-modal-wrapper"))return;const t=document.createElement("div");t.classList.add("sidebar-lead-modal-wrapper"),e.prepend(t)})),e.map((e=>e.querySelector(".sidebar-lead-modal-wrapper")))}),[]);return a.createElement(a.Fragment,null,t.map((t=>c(e,h(t,"sidebar-lead-modal-wrapper")))))},[ie,re,se]=j(),de="undefined"==typeof window,ce={VN:"vi",ID:"id",TH:"th",MY:"ms",TW:"zh-TW",KH:"km",MM:"my",IN:"hi",PH:"en"},me=(e="",a="",l="",n=500)=>{const[o,s]=i([]),[d,c]=i(!1);return r((()=>{let i;return e?i=window.setTimeout((()=>t(void 0,void 0,void 0,(function*(){var n;if(e)try{c(!0);const o=yield((e="",a="",l="vi")=>t(void 0,void 0,void 0,(function*(){return new Promise(((t,n)=>{if(!e)return n("Need valid text input");if(de)return n("Need valid window object");try{(new window.google.maps.places.AutocompleteService).getPlacePredictions(Object.assign(Object.assign({input:e},a?{componentRestrictions:{country:a}}:{}),{language:ce[l]}),t)}catch(e){n(e)}}))})))(e,a,l);s(!(n=o)||n.length<1?[]:n.map((e=>({placeId:e.place_id,description:e.description}))))}catch(e){console.error(e)}finally{c(!1)}else s([])}))),n):o.length&&s([]),()=>{window.clearTimeout(i)}}),[e,n,a]),{isLoading:d,predictions:o}},ue=["places"],pe=({name:e,placeholder:t,locale:l})=>{var s;const d=re(),[c,m]=i(""),[u,p]=i(""),{predictions:h}=me(c||"15 Lê","","tl-PH"===l?"en":null===(s=null==l?void 0:l.split("-"))||void 0===s?void 0:s[0]),[g,v]=i(null),[b,f]=i(!1),y=o(Math.random().toString(36).substring(7)),k=n((()=>{const e=h.map((e=>({value:e.description,label:e.description}))),t=e.find((e=>e.value===u));return!u||t?e:[{value:u,label:u}].concat(e)}),[h,u]);return r((()=>{var e,t,a;(null===(a=null===(t=null===(e=null===window||void 0===window?void 0:window.google)||void 0===e?void 0:e.maps)||void 0===t?void 0:t.places)||void 0===a?void 0:a.AutocompleteService)?f(!0):import("@react-google-maps/api").then((e=>{v((()=>e.LoadScript)),setTimeout((()=>{f(!0)}),200)}))}),[]),b?a.createElement(a.Fragment,null,g&&a.createElement(g,{googleMapsApiKey:"AIzaSyB9QmhfEYcy2wj5X3Fl38aCD5UkET6n82M",libraries:ue,loadingElement:a.createElement(a.Fragment,null)}),a.createElement("div",{style:{display:"none"},"data-extra":!0,"data-name":e,"data-control":"text"}),a.createElement(O,Object.assign({className:"lead-modal__form-control",label:t,placeholder:t,withAsterisk:!0,name:e,data:k,searchValue:c,onSearchChange:e=>{m(e)},filter:()=>!0,clearable:!0,searchable:!0,onChange:e=>p(e||""),icon:a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.createElement("path",{d:"M9.99999 9.79167C10.4028 9.79167 10.7467 9.64944 11.0317 9.365C11.3161 9.08 11.4583 8.73611 11.4583 8.33333C11.4583 7.93056 11.3161 7.58667 11.0317 7.30167C10.7467 7.01722 10.4028 6.875 9.99999 6.875C9.59721 6.875 9.25332 7.01722 8.96832 7.30167C8.68388 7.58667 8.54166 7.93056 8.54166 8.33333C8.54166 8.73611 8.68388 9.08 8.96832 9.365C9.25332 9.64944 9.59721 9.79167 9.99999 9.79167ZM9.99999 17.875C9.90277 17.875 9.80555 17.8611 9.70832 17.8333C9.6111 17.8056 9.52082 17.7569 9.43749 17.6875C7.46527 15.8958 5.98971 14.2361 5.01082 12.7083C4.03138 11.1806 3.54166 9.77778 3.54166 8.5C3.54166 6.48611 4.1911 4.87833 5.48999 3.67667C6.78832 2.47556 8.29166 1.875 9.99999 1.875C11.7083 1.875 13.2119 2.47556 14.5108 3.67667C15.8092 4.87833 16.4583 6.48611 16.4583 8.5C16.4583 9.77778 15.9689 11.1806 14.99 12.7083C14.0105 14.2361 12.5347 15.8958 10.5625 17.6875C10.4792 17.7569 10.3889 17.8056 10.2917 17.8333C10.1944 17.8611 10.0972 17.875 9.99999 17.875Z",fill:"#8C8C8C"})),autoComplete:"no-auto-complete-"+y.current,rightSection:a.createElement(a.Fragment,null)},d.getInputProps(e)))):a.createElement("div",{style:{height:73}})},he=({children:e,align:t})=>a.createElement("p",{className:`lead-modal__description ${"le-text-align-"+(t||"")} ${$}`},e),ge=({children:e,align:t})=>a.createElement("h2",{className:`lead-modal__title ${"le-text-align-"+(t||"")} ${$}`},e),ve=({listBlockAdded:e,popupId:t,locale:l,onClose:n,onOtherSubmit:o})=>{const i=re();return a.createElement(a.Fragment,null,e.map(((e,r)=>{const{name:s="",data:d={}}=e||{},{placeholder:c,value:m,align:u,listQuestion:p,isSendMailChimp:h=!1,newtab:g,url:v}=d;switch(s){case"TitleBlock":return a.createElement(ge,{key:r,align:u},m);case"SubtitleBlock":return a.createElement(he,{key:r,align:u},m);case"TextBlock":return a.createElement(w,Object.assign({key:r,withAsterisk:!0,spellCheck:!1,type:"text",placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"text",name:m},i.getInputProps(m)));case"NumberBlock":return a.createElement(C,Object.assign({key:r,withAsterisk:!0,spellCheck:!1,type:"number",placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"number",name:m},i.getInputProps(m)));case"EmailBlock":return a.createElement(w,Object.assign({key:r,withAsterisk:!0,spellCheck:!1,placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"email",name:m},i.getInputProps(m)));case"PhoneOtpBlock":case"PhoneBlock":{const e=t+"-"+m+"-"+r;return a.createElement(w.Wrapper,Object.assign({size:"md",withAsterisk:!0,key:r,label:c,className:"lead-modal__form-control",labelProps:{htmlFor:e}},i.getInputProps(m)),a.createElement(x,{name:m,spellCheck:!1,type:"tel",placeholder:c,onChange:e=>{i.setFieldValue(m,e)},id:e,defaultCountry:l&&P[l]||"VN","data-control":"tel"}))}case"LocationBlock":return a.createElement(pe,{key:r,name:m,placeholder:c,locale:l});case"DateBlock":return a.createElement(T,Object.assign({withAsterisk:!0,key:r,type:"date",name:m,placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"date"},i.getInputProps(m)));case"LinkButtonBlock":return a.createElement("div",{key:r},a.createElement("a",{target:g?"blank":"parrent",href:v,style:{textDecoration:"none"}},a.createElement(y,{type:"button",size:"md",className:`lead-modal__btn ${$}`,onClick:()=>{null==n||n(),null==o||o()}},m)));case"CheckboxBlock":return a.createElement(a.Fragment,null,h&&a.createElement("div",{style:{display:"none"},"data-name":m+"-mailchimp"}),a.createElement(S.Group,Object.assign({withAsterisk:!0,className:"lead-modal__form-control",key:r,label:c,size:"md"},i.getInputProps(m)),p.map(((e,t)=>a.createElement(S,{name:m,key:t,value:e.value,label:e.placeholder,"data-control":"checkbox"})))));case"RadioBlock":return a.createElement(a.Fragment,null,h&&a.createElement(w,{type:"hidden",name:m+"-mailchimp",value:h}),a.createElement(N.Group,Object.assign({withAsterisk:!0,className:"lead-modal__form-control",key:r,label:c,size:"md"},i.getInputProps(m)),p.map(((e,t)=>a.createElement(N,{name:m,key:t,value:e.value,label:e.placeholder,"data-control":"radio"})))));case"DropdownBlock":return a.createElement(a.Fragment,null,a.createElement("div",{style:{display:"none"},"data-extra":!0,"data-name":m,"data-control":"dropdown"}),a.createElement(O,Object.assign({key:r,className:"lead-modal__form-control",label:c,withAsterisk:!0,name:m,data:p.map((e=>({value:e.value,label:e.placeholder})))},i.getInputProps(m))))}return null})))},be=({phone:e,onSuccess:l,autoSendWhenOpen:n})=>{const{t:s}=b(),[d,c]=i(""),[m,u]=i(!1),[p,h]=i(0),g=o(null),[v,k]=i(),[E,C]=i(""),N=o();r((()=>{t(void 0,void 0,void 0,(function*(){var t;if(!N.current){const e=yield import("react-phone-number-input");N.current=e.formatPhoneNumberIntl}C((null===(t=N.current)||void 0===t?void 0:t.call(N,e))||e)}))}),[e]);const S=()=>t(void 0,void 0,void 0,(function*(){var t;if(!e)return;const a=yield ee({phone:e}),n=null===(t=null==a?void 0:a._messages)||void 0===t?void 0:t[0];"Send sms successfully"===n?(h(60),setTimeout((()=>{g.current&&(g.current.focus(),g.current.scrollIntoView({block:"center"}))}),100)):"This phone number was verified"===n?l():k(n||"something Wrong")}));return r((()=>{setTimeout((()=>{p>0&&h((e=>e-1))}),1e3)}),[p]),r((()=>{n&&!p&&S()}),[]),a.createElement(a.Fragment,null,a.createElement("form",{onSubmit:a=>{a.preventDefault(),t(void 0,void 0,void 0,(function*(){if(!e||!d)return;const t=yield te({phone:e,otp:d}),a=null==t?void 0:t._messages[0];"Verify successfully"===a||"This phone number was verified"===a?l():k(a||"something Wrong")}))},className:"lead-phone-otp-form"},a.createElement(f,{tag:"h3",fontWeight:"bold",style:{marginBottom:4}},s("lead.otp.title")),a.createElement(B,{size:"p1",color:_.colors.gray600},s("lead.otp.desc",{phone:E})),a.createElement(w,{ref:g,name:"_"+name+"-otp",spellCheck:!1,type:"number",placeholder:"Enter OTP",className:"lead-modal__form-control",label:"Phone OTP","data-control":"otp",withAsterisk:!0,pattern:"[0-9]*",value:d,onChange:e=>{u(!0),c(e),k(m&&!e?"OTP is required":void 0)},error:m?v:void 0}),a.createElement(y,{size:"md",color:"primary",className:`lead-modal__btn ${$}`,disabled:!d},s("lead.otp.verify")),a.createElement(y,{type:"button",size:"md",color:"transparent",className:`lead-modal__btn lead-phone-otp-button ${$}`,onClick:()=>{S()},disabled:!!p},s("lead.otp.resend",{timer:p?` (${p}s)`:""}))))},fe=({popupId:e,extraFields:t,onClose:l,onOtherSubmit:s,imageMobile:d,imageDesktop:c,imageOverlayMobile:m,imageOverlayDesktop:u,imageBackground:p,currentLayout:h,title:g,onSubmit:v,showThankyou:f,campaignId:_,campaign_subot_id:E,locale:w})=>{var C,N,S;const T=JSON.parse(t.listBlockAdded),x=JSON.parse(t.actionBlocks),O=JSON.parse(t.textBlocks),P=x.submitBlock.data.url,j=x.submitBlock.data.text,B=x.submitBlock.data.text2,L=x.submitBlock.data.value,I=location.pathname,A=h.includes("Inline")||"Sidebar"===h,U="Slider"===h,[D,H]=i(!0),[R,F]=i(""),V=o(),W=()=>{R?F(""):null==l||l()};if(window.innerWidth<769&&["Fullscreen","Slider"].includes(h))return console.log("😎 Not show fullscreen, slider on mobile "),null;r((()=>{(h.includes("LightBox")||"Fullscreen"==h)&&document.body.classList.add("noscroll"),window.intlTelInputUtils||require("intl-tel-input/build/js/utils"),ae.email={},ae.phone={}}),[]);const Y=o(!1),J=o(!1),{form:K,validateObj:G}=(({listBlockAdded:e=[],validatingPhoneRef:t,validatingEmailRef:a,campaignId:l,campaign_subot_id:i=[]})=>{const{t:r}=b(),s=n((()=>{const n=["TextBlock","NumberBlock","EmailBlock","PhoneBlock","DateBlock","CheckboxBlock","RadioBlock","DropdownBlock","PhoneOtpBlock","LocationBlock"],o=(e,t)=>a=>{if(c.current.isTouched(e))return void 0===a||""===a||Array.isArray(a)&&0===a.length?r("validator.required"):null==t?void 0:t(a)};return e.filter((e=>n.includes(e.name))).reduce(((e,n)=>"NumberBlock"===n.name?Object.assign(Object.assign({},e),{[n.data.value]:o(n.data.value,(e=>{if(isNaN(Number(e)))return r("validator.number")}))}):"EmailBlock"===n.name?Object.assign(Object.assign({},e),{[n.data.value]:o(n.data.value,(e=>{if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e))return r("validator.email");a.current=!0,setTimeout((()=>{c.current.setFieldError(n.data.value,"Validating..."),le(l,i,{email:e}).then((e=>{e?c.current.setFieldError(n.data.value,r(e)):c.current.clearFieldError(n.data.value),a.current=!1})).catch((e=>{console.error(e),c.current.setFieldError(n.data.value,e.message||"Something went wrong"),a.current=!1}))}),200)}))}):"PhoneBlock"===n.name||"PhoneOtpBlock"===n.name?Object.assign(Object.assign({},e),{[n.data.value]:o(n.data.value,(e=>{if(window.intlTelInputUtils&&!window.intlTelInputUtils.isValidNumber(String(e),M.countryCode))return r("validator.phone");t.current=!0,setTimeout((()=>{c.current.setFieldError(n.data.value,"Validating..."),le(l,i,{phone:e}).then((e=>{e?c.current.setFieldError(n.data.value,r(e)):c.current.clearFieldError(n.data.value),t.current=!1})).catch((e=>{console.error(e),c.current.setFieldError(n.data.value,e.message||"Something went wrong"),t.current=!1}))}),200)}))}):"DateBlock"===n.name?Object.assign(Object.assign({},e),{[n.data.value]:o(n.data.value,(e=>{if(isNaN(Date.parse(e)))return r("validator.date")}))}):Object.assign(Object.assign({},e),{[n.data.value]:o(n.data.value)})),{})}),[e.map((e=>e.name)).join(",")]),d=se({validateInputOnChange:!0,clearInputErrorOnChange:!0,validate:s}),c=o(d);return c.current=d,{form:d,validateObj:s}})({listBlockAdded:T,validatingPhoneRef:Y,validatingEmailRef:J,campaignId:_,campaign_subot_id:E}),Q=a.createElement(a.Fragment,null,a.createElement("style",{dangerouslySetInnerHTML:{__html:`\n .le-newbuilder-overlay {\n background-repeat: no-repeat;\n background-size: cover;\n }\n ${m?`\n .le-newbuilder-overlay {\n background: url(${m}) ;\n }`:""}\n ${u?`\n @media screen and (min-width:768px) {\n .le-newbuilder-overlay {\n background: url(${u}) ;\n }\n }`:""}`}}),a.createElement("div",{id:e,"data-popup-url":I,"data-popup-type":"lightbox-inline",className:`lead-modal lead-modal-wrapper modal--animate-scale ${A?"le-buider-inline":""} ${U?"le-buider-slider":""}`},"Fullscreen"==h?a.createElement("img",{className:"le-only-desktop le-fullscreen-img",draggable:!1,src:p||""}):null,a.createElement("div",{className:`lead-modal__wrapper le-newbuilder-wrap-${h}`},a.createElement("div",{className:`lead-modal__content le-newbuilder-${h}`},f?a.createElement(z,{title:f.title,titleAlign:f.titleAlign,subtitle:f.subtitle,subtitleAlign:f.subtitleAlign,link:f.link,linkNewTab:f.linkNewTab,linkText:f.linkText,image:f.image}):a.createElement(a.Fragment,null,a.createElement("header",{className:"lead-modal__header"},R?a.createElement("img",{src:k.getAssetPath("lead-otp-thumb.png"),draggable:"false",alt:"",style:{width:"100%"}}):a.createElement(a.Fragment,null,["LightBoxA","InlineA","Sidebar","Slider"].includes(h)?d?a.createElement("img",{draggable:"false",className:"lead-modal__image lead-modal-image-cover",src:d,alt:""}):null:a.createElement(a.Fragment,null,c?a.createElement("img",{draggable:"false",className:"le-only-desktop lead-modal__image lead-modal-image-cover",style:{height:"100%",objectFit:"cover"},src:c,alt:""}):null,d?a.createElement("img",{draggable:"false",className:"le-only-mobile lead-modal__image lead-modal-image-cover",src:d,alt:""}):null))),R&&a.createElement(be,{phone:R,autoSendWhenOpen:!0,onSuccess:()=>{null==v||v(V.current,K.values)}}),a.createElement("div",{"data-hidden":!!R,className:"lead-modal__body le-newbuilder-overlay"},a.createElement(ie,{form:K},a.createElement("form",{ref:V,className:`lead-modal__form ${e}`,onSubmit:e=>{e.preventDefault(),K.setTouched(Object.keys(G).reduce(((e,t)=>(e[t]=!0,e)),{})),J.current||Y.current||setTimeout((()=>{K.onSubmit((e=>{var t,a,l;if(!Object.keys(K.errors).length){if(T.findIndex((e=>"PhoneOtpBlock"===e.name))>-1){const n=null===(a=null===(t=T.find((e=>"PhoneOtpBlock"===e.name)))||void 0===t?void 0:t.data)||void 0===a?void 0:a.value;if(null===(l=e[n])||void 0===l?void 0:l.startsWith("+84"))return void F(e[n])}null==v||v(V.current,e)}}))(e)}),100)}},a.createElement("div",{style:{marginBottom:20}},a.createElement("h2",{className:`lead-modal__title ${"le-text-align-"+(null===(C=O.titleBlock.data)||void 0===C?void 0:C.align)} ${$}`},g),a.createElement("p",{className:`lead-modal__description ${"le-text-align-"+(null===(N=O.titleBlock.data)||void 0===N?void 0:N.align)} ${$}`},O.subtitleBlock.data.value)),a.createElement("div",{className:"lead-modal__form-control-wrapper"},a.createElement(ve,{listBlockAdded:T,popupId:e,locale:w,onClose:W,onOtherSubmit:s})),(null===(S=null==x?void 0:x.submitBlock)||void 0===S?void 0:S.isHide)?null:a.createElement(a.Fragment,null,a.createElement("div",{className:`lead-modal__checkbox-wrapper ${$}`},a.createElement("div",{className:"lead-modal__checkbox"},a.createElement("input",{id:"lead-term-checkbox",className:`lead-modal__checkbox__input ${$}`,type:"checkbox","aria-label":"Checkbox label",checked:D,onChange:e=>H(e.currentTarget.checked)}),a.createElement("div",{className:"lead-modal__checkbox__control","aria-hidden":"true"})),a.createElement("label",{htmlFor:"checkbox",className:"lead-modal__checkbox__label"},j," ",a.createElement("span",{style:{fontWeight:"bold"}},a.createElement("a",{target:"blank",href:P||"https://hellobacsi.com/chinh-sach",rel:"noopener noreferrer",style:{textDecoration:"none"}},B)))),a.createElement(y,{size:"md",id:"lead-submit",type:"submit",className:`lead-modal__btn ${$}`,disabled:!D},L))))))),!h.includes("Inline")&&a.createElement(q,{onClose:W,containerClassName:"close-button-top-right"}))));return h.includes("LightBox")||"Fullscreen"==h||"Slider"==h?Q:"Sidebar"==h?a.createElement(oe,{content:Q}):h.includes("Inline")?a.createElement(ne,{content:Q,inlinePosition:t.popupInlinePosition}):null},ye=({popupId:e,link:t,linkText:l,linkNewTab:n,onClose:o,imageMobile:i,imageDesktop:r,currentLayout:s,onOtherSubmit:d})=>{const c=location.pathname;return a.createElement("div",{id:e,className:"lead-modal-wrapper","data-popup-url":c,"data-popup-type":"skin_ab"},"SkinA"==s?a.createElement("aside",{className:"le-only-desktop"},a.createElement("div",{className:"le-skin-a-desktop"},a.createElement("div",{style:{position:"relative"}},a.createElement("img",{src:r}),a.createElement("a",{style:{position:"absolute",top:"75%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",width:"calc(100% - 15px)"},href:t,target:n?"blank":"_parent"},a.createElement("button",{onClick:d,className:"le-joinbow-btn js-popup-other-submit"},l)),a.createElement(q,{onClose:o,containerClassName:"close-button-top-right"})))):"SkinB"==s?a.createElement("aside",{className:"le-only-desktop"},a.createElement("div",{className:""},a.createElement("div",{style:{position:"relative",zIndex:1e4}},a.createElement("img",{src:r,style:{width:"100%"}}),a.createElement("a",{style:{position:"absolute",top:"75%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",width:"100%"},href:t,target:n?"blank":"_parent"},a.createElement("button",{onClick:d,className:"le-joinbow-btn-mobile js-popup-other-submit"},l)),a.createElement(q,{containerClassName:"close-button-top-right",onClose:o})))):null,a.createElement("aside",{className:"le-only-mobile"},a.createElement("div",{className:"le-skin-mobile"},a.createElement("div",{style:{position:"relative"}},a.createElement("img",{src:i,style:{width:"100%"}}),a.createElement("a",{style:{position:"absolute",top:"82%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",maxWidth:"calc(100% - 15px)"},href:t,target:n?"blank":"_parent"},a.createElement("button",{onClick:d,className:"le-joinbow-btn-mobile js-popup-other-submit"},l)),a.createElement(q,{containerClassName:"close-button-top-right",svgClassName:"le-mobile-btn",onClose:o})))))},ke=({popupId:e,url:t,newTab:l,image:n,onClose:o,onOtherSubmit:i})=>a.createElement("div",{id:e,className:"lead-modal-wrapper","data-popup-url":location.pathname,"data-popup-type":"tab"},a.createElement("div",{className:"le-tab-popup"},a.createElement("div",{style:{position:"relative"}},a.createElement("a",{href:t,target:l?"blank":"_parent",onClick:i},a.createElement("img",{className:"js-popup-other-submit",src:n})),a.createElement(q,{onClose:o,containerClassName:"close-button-top-right"})))),_e=[],Ee=[],we=[];const Ce=e=>{const t=[...e];for(let e=t.length-1;e>0;e--){const a=Math.floor(Math.random()*(e+1)),l=t[e];t[e]=t[a],t[a]=l}return t},Ne=(e="UTC")=>{const t=new Date;return new Date(t.toLocaleString("en-US",{timeZone:e}))},Se=e=>{try{const[t,a]=e.split(" "),[l,n,o]=t.split("-").map(Number),[i,r,s]=a.split(":").map(Number);return new Date(l,n-1,o,i,r,s)}catch(e){return null}};const Te=e=>1===e.formatted_status?function(e){var t;if(1===e.forever)return!0;const a=e.started_at,l=e.ended_at,n=Se(a),o=Se(l);if(!n||!o)return!0;const i=(null===(t=e.site)||void 0===t?void 0:t.id)||1,r=H[i];return!(Ne(r).getTime()>o.getTime()&&(we.push(e),1))}(e):0===e.formatted_status&&(_e.push(e),(e=>{var t;const a=(null===(t=e.site)||void 0===t?void 0:t.id)||1,l=e.started_at,n=e.ended_at,o=Se(l),i=Se(n);if(!o||!i)return!1;const r=H[a],s=Ne(r).getTime();return s<=i.getTime()&&s>=o.getTime()&&(Ee.push(e),!0)})(e));let xe=null;function Oe({leadApi:e,leadSiteId:t,leadDomain:a,onShowPopup:l,DEBUG_URL:n}){const o=n||("https://"+location.hostname+location.pathname+location.search).toLowerCase();fetch(e+"api/campaign/"+t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:o,ga_client_id:u("_ga")||null})}).then((e=>e.json())).then((e=>{var t,n,i,r,s;if(Pe("List campagin: ",e),U="https://"+location.hostname+location.pathname+location.search,1==e._status){const d=(null===(n=null===(t=e._data)||void 0===t?void 0:t.campaigns)||void 0===n?void 0:n.filter(Te))||[];u("hhg-id")||(p("hhg-id",v(),{domain:"."+a,path:"/"}),Pe("😍 Set HHG ID cookie"));let c=[];c=/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Kindle|Silk|Opera Mini/i.test(navigator.userAgent)?d.filter((e=>e.device_types.some((e=>e.id==A.MOBILE)))):d.filter((e=>e.device_types.some((e=>e.id==A.DESKTOP)))),Pe("👓 campaignsDevice",c),Pe("--listCampaignScheduled",_e),Pe("--listCampaignScheduledToActivated",Ee),Pe("--listCampaignActiveButExpired",we);let m=c.map(((e,t)=>e.targets.filter((e=>e.type==L.LINKS)).map((e=>Object.assign(Object.assign({},e),{campaignIndex:t}))))).flat(1);m=m.filter((e=>{const t=new URL(String(e.target).toLowerCase());if("exact_match"==e.option)return Boolean(o===t.href);if("start_with"==e.option){if(o.includes(String(e.target))){return!e.sub_target.filter((e=>"excluding"==e.option)).map((e=>e.value)).includes(o.split("?")[0])}return!1}}));const h=Array.from(document.getElementsByTagName("META")).filter((e=>"article:tag"==e.getAttribute("property"))).map((e=>e.content));let g=[],b=[];h&&h.length&&(g=c.map(((e,t)=>e.targets.filter((e=>e.type==L.TAGS)).map((e=>Object.assign(Object.assign({},e),{campaignIndex:t}))))).flat(1),b=g.filter((e=>h.includes(e.target))));const f=[...m,...b],y=document.cookie.split("; ").map((e=>e.split("=")[0])),k=y.filter((e=>e.includes("lead_submited")));Pe("--listCampaignCodeSubmited",k);const _=y.filter((e=>e.includes("lead_closed")));Pe("--listCampaignCodeClosed",_);const E=[...k,..._],w=f.filter((e=>!E.some((t=>t.includes(c[e.campaignIndex].code))))),C=Ce(w);if(Pe("--listCampaignValid : ",C),C&&C.length){const e=c[C[0].campaignIndex];Pe("CAMPAIGN_SHOW",e);const{rules:t}=e,a=Number(null===(i=t.find((e=>"time"==e.rule)))||void 0===i?void 0:i.value);Pe("timeoutRule",a);const n=Number(null===(r=t.find((e=>"scroll"==e.rule)))||void 0===r?void 0:r.value);Pe("scrollRule",n);const o=Number(null===(s=t.find((e=>"exclude_sponsored"==e.rule)))||void 0===s?void 0:s.value);Pe("excludeSponsored",o);const d=Boolean(document.querySelector(".hhg-disclaimer-text"));if(Pe("💎 LEAD current page isSponsored",d),d&&o)return;let m="TIME";if(Number.isInteger(a)&&(m="TIME",Pe("✨ SHOW AWESOME POPUP AFTER: ",a," seconds"),xe&&clearTimeout(xe),xe=setTimeout((()=>{null==l||l(e,m)}),1e3*a)),Number.isInteger(n)){m="SCROLL",Pe("✨ SHOW AWESOME AFTER: SCROLL",n," %");const t=document.querySelector(`[data-url="${location.pathname}"]`)||document.querySelector("body"),a=t.getBoundingClientRect().top,o=t.offsetHeight;Pe("👓 Element check scroll: ",t);const i=function(){const t=window.pageYOffset||document.documentElement.scrollTop;let r=0;t>=a&&(r=Math.round((t-a)/(o-innerHeight)*100)),Pe("---Scroll",r,n),r>=n&&(window.removeEventListener("scroll",i),null==l||l(e,m))};window.addEventListener("scroll",i,{passive:!0})}}else Pe("🚧 No lead campaigns on current URL, tags")}})).catch((e=>{Pe("Lead error: ",e)}))}const Pe=(...e)=>{("production"!==process.env.NODE_ENV||process.env.NEXT_PUBLIC_DEPLOY_ENV&&"production"!==process.env.NEXT_PUBLIC_DEPLOY_ENV||"undefined"!=typeof localStorage&&"true"===localStorage.getItem("hhg_debug"))&&console.log(...e)};const je=({campaign:e,action:t,onSubmit:l,onClose:n,showThankyou:i,locale:d})=>{var c,m;b();const{apiUrl:h,siteDomain:g}=s(W);r((()=>{const e=u("_ga")||null;fetch(`${h}api/campaign/${_}/impression`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:t,url:location.href.toLowerCase(),title_article:document.title,cookie_id:u("hhg-id"),ga_client_id:e})})}),[]);const{extra_fields:f,image:y,image_desktop:k,code:_,image_background:E,image_overlay_mobile:w,image_overlay_desktop:C}=e,{currentLayout:N}=f,S=f.imageBlocks?JSON.parse(f.imageBlocks):{},T=JSON.parse(f.actionBlocks),x=JSON.parse(f.textBlocks);let O=(null===(m=null===(c=null==x?void 0:x.titleBlock)||void 0===c?void 0:c.data)||void 0===m?void 0:m.value)||"";const P={1:{},2:{},3:{}},j=o("lead-modal-"+v()),B=function(e="Xin chao {{category_2}} extra"){if(e.includes("{{category_")){const t="{{category_".length,a=e.search("{{category_");return+e.charAt(t+a)}return null}(O);if(B){Pe("⚡️ Has categoryLevel",B);const e=Array.from(document.getElementsByTagName("META")),t=e.find((e=>e.name===`content_category_${B}`)),a=e.find((e=>e.name===`content_category_en_${B}`));if(!t||!a)return Pe("⚡️ No META TAG for categoryLevel, not show popup",B),null;P[B]={value:t.content,value_en:a.content},O=O.replace(`{{category_${B}}}`,t.content),Pe("⚡️ Set categoryData ",B)}else Pe("⚡️ No categoryLevel",B);const L=()=>{var t,a,l,o;if(Pe("👌 Other submit click"),document.body.classList.remove("noscroll"),N.includes("Skin")){const e=document.querySelector("#masthead");e&&(e.style.top="0px !important;")}const i=Number(null!==(a=null===(t=e.rules.find((e=>"days_to_show_again"==e.rule)))||void 0===t?void 0:t.value)&&void 0!==a?a:7),r=Number(null!==(o=null===(l=e.rules.find((e=>"show_again_after_submit"==e.rule)))||void 0===l?void 0:l.value)&&void 0!==o?o:0);0===r&&(Pe("⛔ Popup never show again!"),p(`lead_submited_${_}`,`target_${f.popupVersion}`,{domain:"."+g,path:"/"})),1==r&&(Pe(`⌛ Popup will show again after ${i} days!`),p(`lead_submited_${_}`,`target_${f.popupVersion}`,{domain:"."+g,days:i,path:"/"}));const s=u("_ga")||null,d={url:location.href.toLowerCase(),title_article:document.title,meta:[],cookie_id:u("hhg-id"),ga_client_id:s};B&&(d.category=P[B].value_en),fetch(`${h}api/campaign/${_}/lead`,{method:"POST",body:JSON.stringify(d),headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}).then((e=>e.json())).then((e=>{"error"===e.status&&Pe(e)})).catch((e=>{Pe("Error:",e)})),null==n||n()};return"CenterTab"===N?a.createElement(Y,{popupId:j.current,url:S.imageMobile.data.url,newTab:S.imageMobile.data.newtab,imageMobile:y,imageDestkop:k,onClose:n,onOtherSubmit:L}):"Tab"===N?a.createElement(ke,{popupId:j.current,url:S.imageMobile.data.url,newTab:S.imageMobile.data.newtab,image:y,onClose:n,onOtherSubmit:L}):"Floating"===N?a.createElement(J,{popupId:j.current,title:O,titleAlign:x.titleBlock.data.align,subtitle:x.subtitleBlock.data.value,subtitleAlign:x.subtitleBlock.data.align,url:T.linkButtonBlock.data.url,urlText:T.linkButtonBlock.data.value,newTab:T.linkButtonBlock.data.newtab,imageMobile:y,imageDesktop:k,onClose:n,onOtherSubmit:L}):N.includes("LightBox")||N.includes("Inline")||"Fullscreen"==N||"Sidebar"==N||"Slider"==N?a.createElement(fe,{popupId:j.current,extraFields:f,onClose:n,onOtherSubmit:L,imageMobile:y,imageDesktop:k,imageBackground:E,currentLayout:N,title:O,onSubmit:(e,t)=>l(e,t,B,P),key:N,imageOverlayDesktop:C,imageOverlayMobile:w,showThankyou:i,campaignId:e.id,campaign_subot_id:e.bot_id||[],locale:d}):N.includes("Skin")?a.createElement(ye,{popupId:j.current,link:T.linkButtonBlock.data.url,linkNewTab:!!T.linkButtonBlock.data.newtab,linkText:T.linkButtonBlock.data.value,onClose:n,onOtherSubmit:L,imageMobile:y,imageDesktop:k,currentLayout:N}):null},Be=({apiUrl:e,siteDomain:l,siteId:s,locale:h,apiSubotUrl:v,DEBUG_URL:b})=>{var f;const y=o(),k=o(Date.now()),{apiUrl:_}=n((()=>{let t=e;return t.includes("localhost")&&(t="https://dev.leadgen.hellobacsi.com/"),{apiUrl:t}}),[e,l,s]),[w,C]=i(null),[N,S]=i(""),[T,x]=i(null);r((()=>{K.apiLeadUrl=_,K.apiSubotUrl=v}),[_,v]);const O=(e,t)=>{C(e),S(t)},P=()=>{var e,t;if(!w)return;Pe(`👋👋👋 CLOSE POPUP ${w.code} 👋👋👋`);const a=Number(null===(e=w.rules.find((e=>"show_again_after_exit"==e.rule)))||void 0===e?void 0:e.value),n=Number(null===(t=w.rules.find((e=>"days_to_show_again"==e.rule)))||void 0===t?void 0:t.value);0==a&&p(`lead_closed_${w.code}`,`target_${w.extra_fields.popupVersion}`,n?{domain:"."+l,days:n,path:"/"}:{domain:"."+l,path:"/"}),document.body.classList.remove("noscroll"),fetch(`${_}api/campaign/${w.code}/popup_exit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"CLICK",url:location.href.toLowerCase(),title_article:document.title,cookie_id:u("hhg-id"),duration:Math.ceil((Date.now()-k.current)/1e3)})}),C(null),x(null)};r((()=>{if(window.next){const e=d((e=>{Pe("--🌻 routeChangeComplete",e,Date.now());const t=location.pathname;P(),document.querySelectorAll(`[data-popup-url="${t}"]`).length?Pe("🔥 This URL page has show popup!"):(Pe("--Process checkShowPopup"),Oe({leadApi:_,leadDomain:l,leadSiteId:s,onShowPopup:O,DEBUG_URL:b})),y.current&&window.removeEventListener("scroll",y.current)}),500);window.next.router.events.on("routeChangeComplete",e)}Oe({leadApi:_,leadDomain:l,leadSiteId:s,onShowPopup:O,DEBUG_URL:b})}),[]);return r((()=>{w&&(k.current=Date.now())}),[w]),a.createElement(W.Provider,{value:{apiUrl:_,siteDomain:l,siteId:s,locale:h}},a.createElement(m.Provider,{value:{locale:h,values:V(h)}},c(a.createElement(a.Fragment,null,"2.1"===(null===(f=null==w?void 0:w.extra_fields)||void 0===f?void 0:f.popupVersion)&&a.createElement(je,{campaign:w,action:N,onSubmit:(e,a,n,o)=>t(void 0,void 0,void 0,(function*(){var t,i,r,s,d,c,m,h,g,v,b;if(!a)return;Pe("submitHandler",n,o);const f=Object.keys(a).map((e=>({name:e,value:String(a[e])}))),y=u("_ga")||null;window.intlTelInputUtils||(yield require("intl-tel-input/build/js/utils"));const k={url:location.href.toLowerCase(),title_article:document.title,meta:f.map((t=>{var a,l;const n=(null===(a=e.querySelector(`*[name="${t.name}"]`))||void 0===a?void 0:a.getAttribute("data-control"))||(null===(l=e.querySelector(`*[data-extra][data-name="${t.name}"]`))||void 0===l?void 0:l.getAttribute("data-control"))||"text",o="tel"===n?window.intlTelInputUtils.formatNumber(String(t.value),null==M?void 0:M.countryCodeNumber,2).replace(/\s+/g,""):"date"===n?E(t.value).format("YYYY-MM-DD"):t.value;return{key:t.name,value:o,control:n,is_sent_mailchimp:e.querySelector(`div[data-name="${t.name}-mailchimp"]`)?"true":"false"}})),cookie_id:u("hhg-id"),ga_client_id:y};n&&o[n].value_en&&(k.category=o[n].value_en);const C=Number((null===(i=null===(t=w.rules)||void 0===t?void 0:t.find((e=>"days_to_show_again"===e.rule)))||void 0===i?void 0:i.value)||7),N=Number((null===(s=null===(r=w.rules)||void 0===r?void 0:r.find((e=>"show_again_after_submit"===e.rule)))||void 0===s?void 0:s.value)||0);if(0==N&&(Pe("⛔ Popup never show again!"),p(`lead_submited_${w.code}`,`target_${w.extra_fields.targetType}`,{domain:"."+l,path:"/"})),1==N&&(Pe(`⌛ Popup will show again after ${C} days!`),p(`lead_submited_${w.code}`,`target_${w.extra_fields.targetType}`,{domain:"."+l,days:C,path:"/"})),fetch(`${_}api/campaign/${w.code}/lead`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)}),"notshow"==w.extra_fields.popupShowThankYou)return P(),void document.body.classList.remove("noscroll");let S=!0;const T=w.thank_you_image||`${_}admin/img/thanksyou.png`;let O,j,B=w.extra_fields.popupThankyouTitle||"Thank you.",L=w.extra_fields.popupThankyouDesc||"We appreciate your time!",I="",A="",$="";if("2.1"==w.extra_fields.popupVersion){const e=w.extra_fields,t=JSON.parse(e.listBlockThankyou),a=t.find((e=>"TitleBlock"==e.name)),l=t.find((e=>"SubtitleBlock"==e.name)),n=t.find((e=>"LinkButtonBlock"==e.name));B=(null===(d=null==a?void 0:a.data)||void 0===d?void 0:d.value)||"",I=(null===(c=null==a?void 0:a.data)||void 0===c?void 0:c.align)||"",L=(null===(m=null==l?void 0:l.data)||void 0===m?void 0:m.value)||"",A=(null===(h=null==l?void 0:l.data)||void 0===h?void 0:h.align)||"",O=(null===(g=null==n?void 0:n.data)||void 0===g?void 0:g.value)||"",j=(null===(v=null==n?void 0:n.data)||void 0===v?void 0:v.newtab)||!1,$=(null===(b=null==n?void 0:n.data)||void 0===b?void 0:b.url)||"";const o=w.extra_fields.currentLayout;["SkinA","SkinB","Floating","Tab","CenterTab"].includes(o)&&(S=!1)}x(S?{title:B,titleAlign:I,subtitle:L,subtitleAlign:A,link:$,linkNewTab:j,linkText:O,image:T}:null),sessionStorage.getItem("insider_object")?window.insider_object=JSON.parse(sessionStorage.getItem("insider_object")):window.insider_object={user:{email:"",phone_number:"",gdpr_optin:!0,sms_optin:!0,email_optin:!0}},f.map((e=>{const t=e.name,a=e.value;"tel"==t?window.insider_object.user.phone_number=a:"email"==t&&(window.insider_object.user.email=a)})),sessionStorage.setItem("insider_object",JSON.stringify(window.insider_object))})),onClose:P,showThankyou:T,locale:h})),g())))};export{Be as LeadGen};
@@ -1 +1 @@
1
- export{S as Select}from"./index-eb79e0cf.js";import{S as r,A as o,a as t,M as a,G as s,u as i}from"./index-45ac44f1.js";export{b as Accordion,c as Avatar,C as Carousel,d as Checkbox,D as DatePicker,M as MAPPED_LOCALE,O as OTP,P as Phone,R as Radio,u as useMantineLocale}from"./index-45ac44f1.js";import{_ as n}from"./tslib.es6-cb3ea48c.js";import l,{useMemo as m}from"react";import{Button as p,AspectRatio as f,Indicator as g,Badge as h,Spoiler as x,LoadingOverlay as y,Switch as j,MantineProvider as v,clsx as E,Title as k,Text as H}from"@mantine/core";import"dayjs";import"./screenSizeContext-88744824.js";import"styled-components";import{t as z}from"./theme-35a76b33.js";import{I as B}from"./index-f1e8b189.js";import"./utils-1fa73d05.js";import"./isProduction-35cc6094.js";import{L as A}from"./Locale-c8320005.js";import"./gAssets.js";export{M as Modal}from"./index-30dfa58f.js";import{T as F}from"./index-db2e1d7b.js";import{u as $}from"./useTranslations-860db584.js";export{I as Input,e as emotionCache}from"./index-bff98440.js";export{C as CentralCarousel}from"./index-054ee498.js";export{S as Slider}from"./index-44a439da.js";import"./Vietnam-3b9acb67.js";import"@mantine/dates";import"@mantine/carousel";import"lodash/throttle";import"./index.styled-75b0ceaa.js";import"./translationsContext-7730f46a.js";import"string-format";import"@mantine/hooks";import"./index-bed3247d.js";const N={primary:"filled",secondary:"outline",tertiary:"default",light:"light",ghost:"subtle",error:"outline"},w=e=>{var{variant:r,styles:o}=e,t=n(e,["variant","styles"]);const a="error"===r;return l.createElement(p,Object.assign({variant:N[r],styles:Object.assign(Object.assign({},a?{root:{color:z.colors.red600,backgroundColor:"#ffffff",border:`1px solid ${z.colors.red600}`,"&:hover":{backgroundColor:z.colors.red50,border:`1px solid ${z.colors.red600}`}}}:{}),o)},t))},L=e=>l.createElement(f,Object.assign({sx:{borderRadius:4,overflow:"hidden"}},e)),T=e=>{var{styles:r}=e,o=n(e,["styles"]);return l.createElement(g,Object.assign({inline:!0,position:"top-end",offset:4,styles:Object.assign({indicator:{backgroundColor:z.colors.red700},processing:{animationDirection:"alternate"}},r)},o))},W=e=>l.createElement(r,Object.assign({minRows:2,maxRows:4},e)),G=e=>{var{color:r=z.colors.primaryBase,styles:o}=e,t=n(e,["color","styles"]);return l.createElement(h,Object.assign({variant:"filled",color:r,styles:Object.assign({root:{borderRadius:"2px",background:r,textTransform:"unset"}},o)},t))},U=e=>{var{children:r,line:o,lineHeight:t,trackingAttributes:a,maxHeight:s,customExpandFn:i}=e,c=n(e,["children","line","lineHeight","trackingAttributes","maxHeight","customExpandFn"]);const{t:d}=$(),p=m((()=>s||(o&&t?o*t:(console.error("[HHG-Comp]:[Spoiler] Please provide maxHeight, or line with lineHeight"),0))),[]);r||console.error("[HHG-Comp]:[Spoiler] Please provide children");const f=m((()=>a?{"data-event-category":a.dataEventCategory,"data-event-action":a.dataEventAction,"data-event-label":a.dataEventLabel}:{}),[a]);return l.createElement(x,Object.assign({showLabel:l.createElement(F,Object.assign({size:"p3",color:z.colors.primaryBase},f,{onClick:i}),d("articlePage.readMore")),hideLabel:l.createElement(F,Object.assign({size:"p3",color:z.colors.primaryBase},f),d("articlePage.showLess"))},c,{maxHeight:p}),r)},J=e=>l.createElement(y,Object.assign({loaderProps:{color:z.colors.primaryBase}},e)),V=j,_={Button:{defaultProps:{size:"md"},styles:(e,r)=>({root:Object.assign(Object.assign(Object.assign({transition:`all ${o} ease-in-out`},(()=>{switch(r.size){case"lg":return{height:48,fontWeight:600,fontSize:"16px",lineHeight:"24px"};case"md":return{height:40,fontWeight:600,fontSize:"14px",lineHeight:"22px"};case"sm":return{height:32,fontWeight:600,fontSize:"14px",lineHeight:"22px"}}})()),(()=>{switch(r.variant){case"filled":return{color:"#ffffff",backgroundColor:e.primaryColor,"&:hover":{backgroundColor:e.colors[e.primaryColor][7]}};case"outline":return{color:e,backgroundColor:"#ffffff",border:`1px solid ${e.primaryColor}`,"&:hover":{backgroundColor:e.colors[e.primaryColor][0],border:`1px solid ${e.primaryColor}`}};case"default":return{color:z.colors.gray800,backgroundColor:"#ffffff",border:`1px solid ${z.colors.neutral200}`,"&:hover":{backgroundColor:z.colors.neutral50,border:`1px solid ${z.colors.neutral50}`}};case"light":return{color:e.primaryColor,backgroundColor:e.colors[e.primaryColor][0],border:"1px solid transparent","&:hover":{backgroundColor:"#ffffff",border:`1px solid ${e.colors[e.primaryColor][0]}`}};case"subtle":return{color:e.primaryColor,backgroundColor:"transparent",border:"1px solid transparent","&:hover":{backgroundColor:e.colors[e.primaryColor][0],border:"1px solid transparent"}}}})()),{"&[data-disabled]":{backgroundColor:z.colors.gray100,color:z.colors.gray400}})})}},Y={Checkbox:{styles:{input:t}}},Z=e=>({InputWrapper:{styles:{label:{marginBottom:"0.25rem",fontWeight:600,fontSize:"14px",lineHeight:"22px",color:z.colors.gray600},description:{fontWeight:400,fontSize:"12px",lineHeight:"18px",color:z.colors.gray600,marginBottom:"0.25rem"},error:{marginTop:"0.25rem"}}},NumberInput:{defaultProps:{decimalSeparator:B[e].separator}},Input:{styles:(e,r)=>({input:{border:`1px solid ${z.colors.gray200}`,transition:`all ${o} ease-in-out`,"&::not(.mantine-Textarea-input)":Object.assign({},(()=>{switch(r.size){case"lg":return{height:48,fontSize:16,lineHeight:24};case"md":return{height:40,fontSize:14,lineHeight:22,minHeight:"unset"};case"sm":return{height:32,fontSize:14,lineHeight:22,minHeight:"unset"}}})()),"&:hover":{border:`1px solid ${e.primaryColor}`},"&:focus":{boxShadow:`0px 0px 0px 2px ${e.colors[e.primaryColor][2]}`}},invalid:{border:`1px solid ${z.colors.red600}`,color:"#000"}})}}),q=(e,r="hb")=>({defaultRadius:"hb"===r?4:16,datesLocale:a[e],dateFormat:B[e].dateFormat,colors:Object.assign({hb:["#e3f2ff","#bcdeff","#91caff","#65b5ff","#45a4ff","#2b94ff","#2d87f3","#2c74df","#2b62cd","#2743ad"],mb:["#FFE9F1","#F8CCDC","#F5B4CB","#F29CBA","#EE84AA","#EB6B99","#E85388","#D34C7C","#BE446F","#A93D63"]},z.colors),primaryColor:r,primaryShade:6,fontFamily:e===A.Cambodia?"Battambang,":"Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI',\n Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif",components:Object.assign(Object.assign(Object.assign(Object.assign({},Z(e)),Y),s),_)}),K=e=>{var{children:r,locale:o,template:t="hb"}=e,a=n(e,["children","locale","template"]);return i(o),l.createElement(v,Object.assign({theme:q(o,t)},a),r)};var Q={container:"MON6sfi",iconContainer:"pS-tJD7",icon:"s3tJ9-5",title:"fNsZr1b",description:"uuxV74v",button:"YohjTDU"};function X(e){const{icon:r,title:o,description:t,button:a,buttonProps:s,style:i,className:c}=e,d=s||{},{size:m="lg",variant:f="outline"}=d,b=n(d,["size","variant"]),g=r;return l.createElement("div",{className:E("result",Q.container,c),style:i},g&&l.createElement("div",{className:E("resultIconContainer",Q.iconContainer)},l.createElement(g,{className:E("resultIcon",Q.icon)})),l.createElement(k,{order:3,size:"h3",className:E("resultTitle",Q.title)},o),l.createElement(H,{className:E("resultDescription",Q.description)},t),a&&l.createElement(p,Object.assign({},b,{size:m,variant:f,className:E("resultButton",Q.button,b.className)}),a))}export{L as AspectRatio,G as Badge,w as Button,T as Indicator,J as LoadingOverlay,K as MantineProvider,X as Result,U as Spoiler,V as Switch,W as TextArea,q as getMantineThemeOverride};
1
+ export{S as Select}from"./index-6d8a955b.js";import{S as r,a as o,A as t,b as a,M as s,G as i,c as n,u as l}from"./index-fcef2054.js";export{d as Accordion,e as Avatar,C as Carousel,f as Checkbox,D as DatePicker,M as MAPPED_LOCALE,g as OTHER_THEME_CONFIG,O as OTP,P as Phone,R as Radio,u as useMantineLocale}from"./index-fcef2054.js";import{_ as c}from"./tslib.es6-f1b9d31e.js";import m,{useMemo as p}from"react";import"dayjs";import"./screenSizeContext-796cb6e5.js";import"styled-components";import{t as b}from"./theme-6dca57c7.js";import{I as h}from"./index-c9290e7f.js";import"./utils-049d75fa.js";import"./isProduction-e00482ad.js";import{L as x}from"./Locale-2a1e1450.js";import"./gAssets.js";import{Button as y,AspectRatio as j,Indicator as v,Badge as E,Spoiler as H,LoadingOverlay as k,Switch as z,MantineProvider as B,clsx as w,Title as A,Text as F}from"@mantine/core";export{M as Modal}from"./index-8f7ffa4b.js";import{T as N}from"./index-6b049c9f.js";import{u as $}from"./useTranslations-86f7e107.js";export{I as Input,e as emotionCache}from"./index-881e5990.js";export{C as CentralCarousel}from"./index-43d2bffe.js";export{S as Slider}from"./index-e2b7ef68.js";import"./Vietnam-dc72e656.js";import"@mantine/dates";import"@mantine/carousel";import"lodash/throttle";import"./index.styled-243d7f64.js";import"./translationsContext-d4d12e4a.js";import"string-format";import"@mantine/hooks";import"./index-10233643.js";const L=e=>{var{size:o,color:t=b.colors.gray800,weight:a="regular",as:s="p"}=e,i=c(e,["size","color","weight","as"]);return m.createElement(r,Object.assign({component:s,"data-weight":a,"data-size":o,color:t},i))},T={primary:"filled",secondary:"outline",tertiary:"default",light:"light",ghost:"subtle",error:"outline"},W=e=>{var{variant:r,styles:o}=e,t=c(e,["variant","styles"]);const a="error"===r;return m.createElement(y,Object.assign({variant:T[r],styles:Object.assign(Object.assign({},a?{root:{color:b.colors.red600,backgroundColor:"#ffffff",border:`1px solid ${b.colors.red600}`,"&:hover":{backgroundColor:b.colors.red50,border:`1px solid ${b.colors.red600}`}}}:{}),o)},t))},G=e=>m.createElement(j,Object.assign({sx:{borderRadius:4,overflow:"hidden"}},e)),_=e=>{var{styles:r}=e,o=c(e,["styles"]);return m.createElement(v,Object.assign({inline:!0,position:"top-end",offset:4,styles:Object.assign({indicator:{backgroundColor:b.colors.red700},processing:{animationDirection:"alternate"}},r)},o))},U=e=>m.createElement(o,Object.assign({minRows:2,maxRows:4},e)),J=e=>{var{color:r=b.colors.primaryBase,styles:o}=e,t=c(e,["color","styles"]);return m.createElement(E,Object.assign({variant:"filled",color:r,styles:Object.assign({root:{borderRadius:"2px",background:r,textTransform:"unset"}},o)},t))},V=e=>{var{children:r,line:o,lineHeight:t,trackingAttributes:a,maxHeight:s,customExpandFn:i}=e,n=c(e,["children","line","lineHeight","trackingAttributes","maxHeight","customExpandFn"]);const{t:l}=$(),d=p((()=>s||(o&&t?o*t:(console.error("[HHG-Comp]:[Spoiler] Please provide maxHeight, or line with lineHeight"),0))),[]);r||console.error("[HHG-Comp]:[Spoiler] Please provide children");const f=p((()=>a?{"data-event-category":a.dataEventCategory,"data-event-action":a.dataEventAction,"data-event-label":a.dataEventLabel}:{}),[a]);return m.createElement(H,Object.assign({showLabel:m.createElement(N,Object.assign({size:"p3",color:b.colors.primaryBase},f,{onClick:i}),l("articlePage.readMore")),hideLabel:m.createElement(N,Object.assign({size:"p3",color:b.colors.primaryBase},f),l("articlePage.showLess"))},n,{maxHeight:d}),r)},Y=e=>m.createElement(k,Object.assign({loaderProps:{color:b.colors.primaryBase}},e)),Z=z,q={Button:{defaultProps:{size:"md"},styles:(e,r)=>({root:Object.assign(Object.assign(Object.assign({transition:`all ${t} ease-in-out`},(()=>{switch(r.size){case"lg":return{height:48,fontWeight:600,fontSize:"16px",lineHeight:"24px"};case"md":return{height:40,fontWeight:600,fontSize:"14px",lineHeight:"22px"};case"sm":return{height:32,fontWeight:600,fontSize:"14px",lineHeight:"22px"}}})()),(()=>{switch(r.variant){case"filled":return{color:"#ffffff",backgroundColor:e.primaryColor,"&:hover":{backgroundColor:e.colors[e.primaryColor][7]}};case"outline":return{color:e,backgroundColor:"#ffffff",border:`1px solid ${e.primaryColor}`,"&:hover":{backgroundColor:e.colors[e.primaryColor][0],border:`1px solid ${e.primaryColor}`}};case"default":return{color:b.colors.gray800,backgroundColor:"#ffffff",border:`1px solid ${b.colors.neutral200}`,"&:hover":{backgroundColor:b.colors.neutral50,border:`1px solid ${b.colors.neutral50}`}};case"light":return{color:e.primaryColor,backgroundColor:e.colors[e.primaryColor][0],border:"1px solid transparent","&:hover":{backgroundColor:"#ffffff",border:`1px solid ${e.colors[e.primaryColor][0]}`}};case"subtle":return{color:e.primaryColor,backgroundColor:"transparent",border:"1px solid transparent","&:hover":{backgroundColor:e.colors[e.primaryColor][0],border:"1px solid transparent"}}}})()),{"&[data-disabled]":{backgroundColor:b.colors.gray100,color:b.colors.gray400}})})}},K={Checkbox:{styles:{input:a}}},Q=e=>({InputWrapper:{styles:{label:{marginBottom:"0.25rem",fontWeight:600,fontSize:"14px",lineHeight:"22px",color:b.colors.gray600},description:{fontWeight:400,fontSize:"12px",lineHeight:"18px",color:b.colors.gray600,marginBottom:"0.25rem"},error:{marginTop:"0.25rem"}}},NumberInput:{defaultProps:{decimalSeparator:h[e].separator}},Input:{styles:(e,r)=>({input:{border:`1px solid ${b.colors.gray200}`,transition:`all ${t} ease-in-out`,"&::not(.mantine-Textarea-input)":Object.assign({},(()=>{switch(r.size){case"lg":return{height:48,fontSize:16,lineHeight:24};case"md":return{height:40,fontSize:14,lineHeight:22,minHeight:"unset"};case"sm":return{height:32,fontSize:14,lineHeight:22,minHeight:"unset"}}})()),"&:hover":{border:`1px solid ${e.primaryColor}`},"&:focus":{boxShadow:`0px 0px 0px 2px ${e.colors[e.primaryColor][2]}`}},invalid:{border:`1px solid ${b.colors.red600}`,color:"#000"}})}}),X=(e,r="hb")=>({defaultRadius:"hb"===r?4:16,datesLocale:s[e],dateFormat:h[e].dateFormat,colors:Object.assign({hb:["#e3f2ff","#bcdeff","#91caff","#65b5ff","#45a4ff","#2b94ff","#2d87f3","#2c74df","#2b62cd","#2743ad"],mb:["#FFE9F1","#F8CCDC","#F5B4CB","#F29CBA","#EE84AA","#EB6B99","#E85388","#D34C7C","#BE446F","#A93D63"]},b.colors),primaryColor:r,primaryShade:6,fontFamily:e===x.Cambodia?"Battambang,":"Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI',\n Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif",components:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Q(e)),K),i),q),n)}),ee=e=>{var{children:r,locale:o,template:t="hb"}=e,a=c(e,["children","locale","template"]);return l(o),m.createElement(B,Object.assign({theme:X(o,t)},a),r)};var re={container:"MON6sfi",iconContainer:"pS-tJD7",icon:"s3tJ9-5",title:"fNsZr1b",description:"uuxV74v",button:"YohjTDU"};function oe(e){const{icon:r,title:o,description:t,button:a,buttonProps:s,style:i,className:n}=e,l=s||{},{size:d="lg",variant:p="outline"}=l,f=c(l,["size","variant"]),g=r;return m.createElement("div",{className:w("result",re.container,n),style:i},g&&m.createElement("div",{className:w("resultIconContainer",re.iconContainer)},m.createElement(g,{className:w("resultIcon",re.icon)})),m.createElement(A,{order:3,size:"h3",className:w("resultTitle",re.title)},o),m.createElement(F,{className:w("resultDescription",re.description)},t),a&&m.createElement(y,Object.assign({},f,{size:d,variant:p,className:w("resultButton",re.button,f.className)}),a))}export{G as AspectRatio,J as Badge,W as Button,_ as Indicator,Y as LoadingOverlay,ee as MantineProvider,oe as Result,V as Spoiler,Z as Switch,L as Text,U as TextArea,X as getMantineThemeOverride};
package/build/esm/misc.js CHANGED
@@ -1 +1 @@
1
- export{a as ageGenerate,c as convertLocalizedStringToNumber,l as localizeNumberFormat}from"./localizeNumberFormat-14832370.js";export{S as ScreenSizeContext,j as ScreenSizeContextProvider,h as fadeIn,i as getWindowSizeGroups,a as slideInDown,b as slideInLeft,c as slideInRight,s as slideInUp,e as slideOutDown,f as slideOutLeft,g as slideOutRight,d as slideOutUp}from"./screenSizeContext-88744824.js";export{d as deleteCookie,g as getCookie,s as setCookie}from"./cookieHelper-46eca077.js";import"react";import"styled-components";export{M as MBTheme,t as theme}from"./theme-35a76b33.js";export{a as abbreviateNumber,f as formatPill}from"./dataTransform-81026524.js";export{d as getCareApiDomain,g as getCurrentBaseUrl,a as getCurrentSsoUrl,c as getDiscoverApiDomain,b as getTogetherApiDomain}from"./routing-065ec7dc.js";export{B as Breakpoints,M as MediaQueries,f as formatUrlWithPageParam,g as getBoundariesFromMediaQueryKey,a as getPopupWrapperDom,b as getWrapperDomWithSelector,m as makeParams,c as safeEncodeURI,s as startCase,t as toggleNoScroll}from"./utils-1fa73d05.js";export{f as formatHealthTool,g as getDynamicHealthTool,a as getDynamicHealthToolWithCache}from"./getDynamicHealthTool-f24e91d5.js";export{g as getSocialList}from"./getSocialList-b4b810ea.js";import"dayjs";import"lodash/throttle";import"./index-f1e8b189.js";import"./Locale-c8320005.js";import"./isProduction-35cc6094.js";import"./tslib.es6-cb3ea48c.js";import"./core-55659962.js";import"./normalizeLink-22f231d9.js";import"./gAssets.js";
1
+ export{a as ageGenerate,c as convertLocalizedStringToNumber,l as localizeNumberFormat}from"./localizeNumberFormat-65181040.js";export{S as ScreenSizeContext,j as ScreenSizeContextProvider,h as fadeIn,i as getWindowSizeGroups,a as slideInDown,b as slideInLeft,c as slideInRight,s as slideInUp,e as slideOutDown,f as slideOutLeft,g as slideOutRight,d as slideOutUp}from"./screenSizeContext-796cb6e5.js";export{d as deleteCookie,g as getCookie,s as setCookie}from"./cookieHelper-b88c2be8.js";import"react";import"styled-components";export{M as MBTheme,t as theme}from"./theme-6dca57c7.js";export{a as abbreviateNumber,f as formatPill}from"./dataTransform-75f1271b.js";export{d as getCareApiDomain,g as getCurrentBaseUrl,a as getCurrentSsoUrl,c as getDiscoverApiDomain,b as getTogetherApiDomain}from"./routing-6d3d5706.js";export{B as Breakpoints,M as MediaQueries,f as formatUrlWithPageParam,g as getBoundariesFromMediaQueryKey,a as getPopupWrapperDom,b as getWrapperDomWithSelector,m as makeParams,c as safeEncodeURI,s as startCase,t as toggleNoScroll}from"./utils-049d75fa.js";export{f as formatHealthTool,g as getDynamicHealthTool,a as getDynamicHealthToolWithCache}from"./getDynamicHealthTool-0aab98fc.js";export{g as getSocialList}from"./getSocialList-03e2a2b1.js";import"dayjs";import"lodash/throttle";import"./index-c9290e7f.js";import"./Locale-2a1e1450.js";import"./isProduction-e00482ad.js";import"./tslib.es6-f1b9d31e.js";import"./core-01abe7a1.js";import"./normalizeLink-1d2dc701.js";import"./gAssets.js";
@@ -1 +1 @@
1
- import"./tslib.es6-cb3ea48c.js";import"react";import"./core-55659962.js";export{N as NavigationV2,g as getNavMenuContent,a as getNavMenuContentWithCache}from"./index-3f781614.js";import"./index-f1e8b189.js";import"./normalizeLink-22f231d9.js";import"./routing-065ec7dc.js";import"./dataTransform-7c7cd603.js";import"./index.styled-53842855.js";import"./isProduction-35cc6094.js";import"./gAssets.js";import"./Locale-c8320005.js";import"./useUniqueId-2654c98c.js";import"./index-db2e1d7b.js";import"./index-8ac32fa0.js";import"./index-7a57bc59.js";import"./utils-1fa73d05.js";import"styled-components";import"./useTranslations-860db584.js";import"./translationsContext-7730f46a.js";import"string-format";import"lodash/throttle";import"./index.styled-e6d05e31.js";import"./theme-35a76b33.js";import"./index.styled-8f59035f.js";import"dayjs";import"./screenSizeContext-88744824.js";import"./index-bed3247d.js";import"@mantine/core";import"./cookieHelper-46eca077.js";import"./index.styled-1c09bfcc.js";import"./index-9f83d332.js";import"./constants-170605f8.js";import"./useIsInit-17c423cc.js";import"lodash/debounce";import"slugify";import"dayjs/plugin/relativeTime";
1
+ import"./tslib.es6-f1b9d31e.js";import"react";import"./core-01abe7a1.js";export{N as NavigationV2,g as getNavMenuContent,a as getNavMenuContentWithCache}from"./index-879836ec.js";import"./index-c9290e7f.js";import"./normalizeLink-1d2dc701.js";import"./routing-6d3d5706.js";import"./dataTransform-b6ffa89e.js";import"./index.styled-981e6c04.js";import"./isProduction-e00482ad.js";import"./gAssets.js";import"./Locale-2a1e1450.js";import"./useUniqueId-679a497e.js";import"./index-6b049c9f.js";import"./index-65b95e24.js";import"./index-e1e88ca8.js";import"./utils-049d75fa.js";import"styled-components";import"./useTranslations-86f7e107.js";import"./translationsContext-d4d12e4a.js";import"string-format";import"lodash/throttle";import"./index.styled-38864315.js";import"./theme-6dca57c7.js";import"./index.styled-839052ac.js";import"dayjs";import"./screenSizeContext-796cb6e5.js";import"./index-10233643.js";import"@mantine/core";import"./cookieHelper-b88c2be8.js";import"./index.styled-c3d5eff6.js";import"./index-77a5c7ce.js";import"./constants-fb47e65c.js";import"./useIsInit-e900b10b.js";import"lodash/debounce";import"slugify";import"dayjs/plugin/relativeTime";
@@ -1 +1 @@
1
- export{M as MAPPED_LOCALE,b as OnboardingForm,O as OnboardingModal,a as OnboardingStep,c as OtpForm}from"./index-e5b9bc02.js";import"./tslib.es6-cb3ea48c.js";import"react";import"@mantine/hooks";import"./index.styled-e6d05e31.js";import"styled-components";import"./theme-35a76b33.js";import"./utils-1fa73d05.js";import"./index.styled-8f59035f.js";import"./index-7a57bc59.js";import"./gAssets.js";import"./index-f1e8b189.js";import"./Locale-c8320005.js";import"./isProduction-35cc6094.js";import"./index-db2e1d7b.js";import"dayjs";import"./screenSizeContext-88744824.js";import"lodash/throttle";import"./index-bed3247d.js";import"@mantine/core";import"./index.styled-1c09bfcc.js";import"./useTranslations-860db584.js";import"./translationsContext-7730f46a.js";import"string-format";import"./index-9f83d332.js";import"lodash/debounce";import"@mantine/form";import"./index-45ac44f1.js";import"./Vietnam-3b9acb67.js";import"@mantine/dates";import"@mantine/carousel";import"./index-bff98440.js";import"yup";import"./index.styled-75b0ceaa.js";import"./index-054ee498.js";import"date-fns";import"./Visible-5d9b1ecd.js";
1
+ export{M as MAPPED_LOCALE,b as OnboardingForm,O as OnboardingModal,a as OnboardingStep,c as OtpForm}from"./index-f3de7ff9.js";import"./tslib.es6-f1b9d31e.js";import"react";import"@mantine/hooks";import"./index.styled-38864315.js";import"styled-components";import"./theme-6dca57c7.js";import"./utils-049d75fa.js";import"./index.styled-839052ac.js";import"./index-e1e88ca8.js";import"./gAssets.js";import"./index-c9290e7f.js";import"./Locale-2a1e1450.js";import"./isProduction-e00482ad.js";import"./index-6b049c9f.js";import"dayjs";import"./screenSizeContext-796cb6e5.js";import"lodash/throttle";import"./index-10233643.js";import"@mantine/core";import"./index.styled-c3d5eff6.js";import"./useTranslations-86f7e107.js";import"./translationsContext-d4d12e4a.js";import"string-format";import"./index-77a5c7ce.js";import"lodash/debounce";import"@mantine/form";import"./index-fcef2054.js";import"./Vietnam-dc72e656.js";import"@mantine/dates";import"@mantine/carousel";import"./index-881e5990.js";import"yup";import"./index.styled-243d7f64.js";import"./index-43d2bffe.js";import"date-fns";import"./Visible-18cf87ba.js";
package/build/esm/pwg.js CHANGED
@@ -1,4 +1,4 @@
1
- import e,{useMemo as t,useState as r,useRef as l}from"react";import{M as a,a as o}from"./index-1212f61e.js";import{T as n}from"./index-db2e1d7b.js";import{P as i}from"./index-eb7126f6.js";import{u as c}from"./useTranslations-860db584.js";import{t as s}from"./theme-35a76b33.js";import{ResponsiveContainer as m,AreaChart as d,CartesianGrid as p,Tooltip as g,XAxis as y,YAxis as u,Area as b,ReferenceDot as h}from"recharts";import{C as f}from"./index-9f83d332.js";import{a as x}from"./useOutsideClick-b3adcf0b.js";import E from"styled-components";import{_ as k}from"./tslib.es6-cb3ea48c.js";import"./index.styled-1c09bfcc.js";import"./Locale-c8320005.js";import"./index.styled-70d2421e.js";import"./gAssets.js";import"./index-f1e8b189.js";import"./isProduction-35cc6094.js";import"./index-054ee498.js";import"@mantine/carousel";import"@mantine/hooks";import"./translationsContext-7730f46a.js";import"string-format";const w=({weightByWeek:e,weightBefore:t,toolTipLabel:r,status:l,activeWeek:a,t:o})=>{const n=o(`bmi.result.${l}`);return e.map((e=>Object.assign({name:e.week,min:t+e.min,difference:e.max-e.min,max:t+e.max},e.week===a?{toolTipLabel:r,translatedStatus:n,status:l}:{})))},v=t=>{const{x:r,y:l,payload:a,activeWeek:o}=t;return o===a.value?e.createElement("g",{transform:`translate(${r},${l})`},e.createElement("circle",{r:12,fill:"marryBaby"===t.siteType?s.mbColors.pink:s.colors.primaryBase}),e.createElement("text",{textAnchor:"middle",alignmentBaseline:"central",fill:s.colors.white,fontFamily:"Inter",fontWeight:"600",fontSize:"12px"},a.value)):e.createElement("g",{transform:`translate(${r},${l})`},e.createElement("text",{textAnchor:"middle",alignmentBaseline:"central",fill:s.colors.gray600,fontFamily:"Inter",fontWeight:"400",fontSize:"12px"},a.value))},j=E.div`
1
+ import e,{useMemo as t,useState as r,useRef as l}from"react";import{M as a,a as o}from"./index-c2de5d7b.js";import{T as n}from"./index-6b049c9f.js";import{P as i}from"./index-1a820ef8.js";import{u as c}from"./useTranslations-86f7e107.js";import{t as s}from"./theme-6dca57c7.js";import{ResponsiveContainer as m,AreaChart as d,CartesianGrid as p,Tooltip as g,XAxis as y,YAxis as u,Area as b,ReferenceDot as f}from"recharts";import{C as h}from"./index-77a5c7ce.js";import{a as x}from"./useOutsideClick-305b5046.js";import E from"styled-components";import{_ as k}from"./tslib.es6-f1b9d31e.js";import"./index.styled-c3d5eff6.js";import"./Locale-2a1e1450.js";import"./index.styled-8aca10eb.js";import"./gAssets.js";import"./index-c9290e7f.js";import"./isProduction-e00482ad.js";import"./index-43d2bffe.js";import"@mantine/carousel";import"@mantine/hooks";import"./translationsContext-d4d12e4a.js";import"string-format";const w=({weightByWeek:e,weightBefore:t,toolTipLabel:r,status:l,activeWeek:a,t:o})=>{const n=o(`bmi.result.${l}`);return e.map((e=>Object.assign({name:e.week,min:t+e.min,difference:e.max-e.min,max:t+e.max},e.week===a?{toolTipLabel:r,translatedStatus:n,status:l}:{})))},v=t=>{const{x:r,y:l,payload:a,activeWeek:o}=t;return o===a.value?e.createElement("g",{transform:`translate(${r},${l})`},e.createElement("circle",{r:12,fill:"marryBaby"===t.siteType?s.mbColors.pink:s.colors.primaryBase}),e.createElement("text",{textAnchor:"middle",alignmentBaseline:"central",fill:s.colors.white,fontFamily:"Inter",fontWeight:"600",fontSize:"12px"},a.value)):e.createElement("g",{transform:`translate(${r},${l})`},e.createElement("text",{textAnchor:"middle",alignmentBaseline:"central",fill:s.colors.gray600,fontFamily:"Inter",fontWeight:"400",fontSize:"12px"},a.value))},j=E.div`
2
2
  /* position: absolute; */
3
3
  display: flex;
4
4
  flex-direction: column;
@@ -55,7 +55,7 @@ import e,{useMemo as t,useState as r,useRef as l}from"react";import{M as a,a as
55
55
  align-items: center;
56
56
  gap: 4px;
57
57
  }
58
- `,B=[{name:"overweight",backgroundColor:s.colors.yellow50,color:s.colors.yellow900},{name:"underweight",backgroundColor:s.colors.yellow50,color:s.colors.yellow900},{name:"healthy",backgroundColor:s.colors.green50,color:s.colors.green900}],W=r=>{var l,a,o,i,c;const{payload:m,active:d}=r,p=null===(l=null==m?void 0:m[0])||void 0===l?void 0:l.payload;if(!p||!p.toolTipLabel||!d)return null;const{backgroundColor:g,color:y}=t((()=>B.find((e=>e.name===p.status))),[null==p?void 0:p.status]);return e.createElement(j,null,e.createElement("div",null,null===(a=p.toolTipLabel)||void 0===a?void 0:a[0]," ",null===(o=p.toolTipLabel)||void 0===o?void 0:o[1]),e.createElement("div",null,(null===(i=p.toolTipLabel)||void 0===i?void 0:i[2])&&e.createElement(n,{as:"span",size:"s3",color:s.colors.gray800,type:"semiBold"},null===(c=p.toolTipLabel)||void 0===c?void 0:c[2]),e.createElement("div",{className:"risk",style:{backgroundColor:g}},e.createElement(n,{size:"n1",color:y},p.translatedStatus))))},L=({weightBefore:o,weightByWeek:i,activeWeek:E,currentWeight:k,toolTipLabel:j=[],status:T,withLine:B=!1,siteType:L})=>{const{t:z}=c(),S="marryBaby"===L,F=t((()=>w({weightByWeek:i,weightBefore:o,toolTipLabel:j,status:T,activeWeek:E,t:z})),[i,o,j,T,E]),[I,M]=r(!1),N=l(null);return x(N,(()=>M(!1))),e.createElement(C,null,S?e.createElement(a,{type:"bodytext-3",color:s.mbColors.dark}," ",z("babyGrowth.weight")," ",z("pregnancyWeightGain.weightInput.desc")):e.createElement(n,{size:"n1",color:s.colors.gray500},z("babyGrowth.weight")," ",z("pregnancyWeightGain.weightInput.desc")),Array.isArray(F)&&F.length>0&&e.createElement(C,null,e.createElement(m,{height:388,className:"chart"},e.createElement(d,{data:F,margin:{top:16,right:0,left:0}},e.createElement(p,{stroke:s.colors.neutral100}),e.createElement(g,{trigger:"click",content:t=>e.createElement(W,Object.assign({active:!B&&I&&void 0!==E&&void 0!==k},t))}),e.createElement(y,{type:"number",scale:"linear",ticks:Array.from({length:40},((e,t)=>t+1)),dataKey:"name",tickLine:!1,tickMargin:12,tick:t=>e.createElement(v,Object.assign({},t,{activeWeek:E,siteType:L})),domain:["dataMin","dataMax"],interval:"preserveStartEnd",tickCount:1,allowDecimals:!1}),e.createElement(u,{domain:[e=>Math.max(e,o-10||e),e=>Math.max(e,o+20||e)],type:"number",scale:"auto",interval:"preserveStartEnd",tickLine:!1,tickMargin:7,width:45,tickCount:10,allowDecimals:!0,tickFormatter:e=>String(Math.round(100*(e+Number.EPSILON))/100),tick:{fontFamily:"Inter",fontWeight:400,fontSize:12,color:s.colors.gray600}}),e.createElement(b,{connectNulls:!0,type:"monotone",dataKey:"min",stackId:"1",stroke:"transparent",fill:"transparent"}),e.createElement(b,{connectNulls:!0,type:"monotone",dataKey:"difference",stackId:"1",stroke:"transparent",fill:S?s.mbColors.tonePink:s.colors.primary100}),void 0!==E&&void 0!==k&&e.createElement(h,{onClick:()=>M(!0),x:0===E?1:E,y:k,r:4,shape:e.createElement(f,{ref:N,r:4}),fill:S?s.mbColors.pink:s.colors.primaryBase,stroke:S?s.mbColors.pink:s.colors.primaryBase}))),e.createElement("div",{className:"custom-chart-label"},e.createElement("i",null),S?e.createElement(a,{type:"bodytext-3",color:s.mbColors.dark},z("pregnancy.week")):e.createElement(n,{size:"n1",color:s.colors.gray500},z("pregnancy.week")))))},z=t=>{var{color:r}=t,l=k(t,["color"]);return e.createElement("svg",Object.assign({width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l),e.createElement("circle",{cx:"4",cy:"4",r:"4",fill:r||s.colors.primaryBase}))},S=({idealWeight:t,siteType:r})=>{const{t:l}=c(),o="marryBaby"===r;return e.createElement(T,null,e.createElement("div",null,o?e.createElement(e.Fragment,null,e.createElement(z,{color:s.mbColors.lightPink}),e.createElement(a,{type:"bodytext-3",color:s.mbColors.dark},l("pregnancyTool.weightSuggested")," ",e.createElement(n,{size:"n1",color:s.colors.gray800,type:"bold",as:"span"},t))):e.createElement(e.Fragment,null,e.createElement(z,{color:s.colors.primary100}),e.createElement(n,{size:"n1",color:s.colors.gray600},e.createElement(n,{size:"n1",as:"span"},l("pregnancyTool.weightSuggested")," "),e.createElement(n,{size:"n1",color:s.colors.gray800,type:"bold",as:"span"},t)))),e.createElement("div",null,o?e.createElement(e.Fragment,null,e.createElement(z,{color:s.mbColors.pink}),e.createElement(a,{type:"bodytext-3",color:s.mbColors.dark},l("pwg.placeholder.weight"))):e.createElement(e.Fragment,null,e.createElement(z,null),e.createElement(n,{size:"n1",color:s.colors.gray600},l("pwg.placeholder.weight")))))},F=E.div`
58
+ `,B=[{name:"overweight",backgroundColor:s.colors.yellow50,color:s.colors.yellow900},{name:"underweight",backgroundColor:s.colors.yellow50,color:s.colors.yellow900},{name:"healthy",backgroundColor:s.colors.green50,color:s.colors.green900}],W=r=>{var l,a,o,i,c;const{payload:m,active:d}=r,p=null===(l=null==m?void 0:m[0])||void 0===l?void 0:l.payload;if(!p||!p.toolTipLabel||!d)return null;const{backgroundColor:g,color:y}=t((()=>B.find((e=>e.name===p.status))),[null==p?void 0:p.status]);return e.createElement(j,null,e.createElement("div",null,null===(a=p.toolTipLabel)||void 0===a?void 0:a[0]," ",null===(o=p.toolTipLabel)||void 0===o?void 0:o[1]),e.createElement("div",null,(null===(i=p.toolTipLabel)||void 0===i?void 0:i[2])&&e.createElement(n,{as:"span",size:"s3",color:s.colors.gray800,type:"semiBold"},null===(c=p.toolTipLabel)||void 0===c?void 0:c[2]),e.createElement("div",{className:"risk",style:{backgroundColor:g}},e.createElement(n,{size:"n1",color:y},p.translatedStatus))))},L=({weightBefore:o,weightByWeek:i,activeWeek:E,currentWeight:k,toolTipLabel:j=[],status:T,withLine:B=!1,siteType:L})=>{const{t:z}=c(),S="marryBaby"===L,F=t((()=>w({weightByWeek:i,weightBefore:o,toolTipLabel:j,status:T,activeWeek:E,t:z})),[i,o,j,T,E]),[I,M]=r(!1),N=l(null);return x(N,(()=>M(!1))),e.createElement(C,null,S?e.createElement(a,{type:"bodytext-3",color:s.mbColors.dark}," ",z("babyGrowth.weight")," ",z("pregnancyWeightGain.weightInput.desc")):e.createElement(n,{size:"n1",color:s.colors.gray500},z("babyGrowth.weight")," ",z("pregnancyWeightGain.weightInput.desc")),Array.isArray(F)&&F.length>0&&e.createElement(C,null,e.createElement(m,{height:388,className:"chart"},e.createElement(d,{data:F,margin:{top:16,right:0,left:0}},e.createElement(p,{stroke:s.colors.neutral100}),e.createElement(g,{trigger:"click",content:t=>e.createElement(W,Object.assign({active:!B&&I&&void 0!==E&&void 0!==k},t))}),e.createElement(y,{type:"number",scale:"linear",ticks:Array.from({length:40},((e,t)=>t+1)),dataKey:"name",tickLine:!1,tickMargin:12,tick:t=>e.createElement(v,Object.assign({},t,{activeWeek:E,siteType:L})),domain:["dataMin","dataMax"],interval:"preserveStartEnd",tickCount:1,allowDecimals:!1}),e.createElement(u,{domain:[e=>Math.max(e,o-10||e),e=>Math.max(e,o+20||e)],type:"number",scale:"auto",interval:"preserveStartEnd",tickLine:!1,tickMargin:7,width:45,tickCount:10,allowDecimals:!0,tickFormatter:e=>String(Math.round(100*(e+Number.EPSILON))/100),tick:{fontFamily:"Inter",fontWeight:400,fontSize:12,color:s.colors.gray600}}),e.createElement(b,{connectNulls:!0,type:"monotone",dataKey:"min",stackId:"1",stroke:"transparent",fill:"transparent"}),e.createElement(b,{connectNulls:!0,type:"monotone",dataKey:"difference",stackId:"1",stroke:"transparent",fill:S?s.mbColors.tonePink:s.colors.primary100}),void 0!==E&&void 0!==k&&e.createElement(f,{onClick:()=>M(!0),x:0===E?1:E,y:k,r:4,shape:e.createElement(h,{ref:N,r:4}),fill:S?s.mbColors.pink:s.colors.primaryBase,stroke:S?s.mbColors.pink:s.colors.primaryBase}))),e.createElement("div",{className:"custom-chart-label"},e.createElement("i",null),S?e.createElement(a,{type:"bodytext-3",color:s.mbColors.dark},z("pregnancy.week")):e.createElement(n,{size:"n1",color:s.colors.gray500},z("pregnancy.week")))))},z=t=>{var{color:r}=t,l=k(t,["color"]);return e.createElement("svg",Object.assign({width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l),e.createElement("circle",{cx:"4",cy:"4",r:"4",fill:r||s.colors.primaryBase}))},S=({idealWeight:t,siteType:r})=>{const{t:l}=c(),o="marryBaby"===r;return e.createElement(T,null,e.createElement("div",null,o?e.createElement(e.Fragment,null,e.createElement(z,{color:s.mbColors.lightPink}),e.createElement(a,{type:"bodytext-3",color:s.mbColors.dark},l("pregnancyTool.weightSuggested")," ",e.createElement(n,{size:"n1",color:s.colors.gray800,type:"bold",as:"span"},t))):e.createElement(e.Fragment,null,e.createElement(z,{color:s.colors.primary100}),e.createElement(n,{size:"n1",color:s.colors.gray600},e.createElement(n,{size:"n1",as:"span"},l("pregnancyTool.weightSuggested")," "),e.createElement(n,{size:"n1",color:s.colors.gray800,type:"bold",as:"span"},t)))),e.createElement("div",null,o?e.createElement(e.Fragment,null,e.createElement(z,{color:s.mbColors.pink}),e.createElement(a,{type:"bodytext-3",color:s.mbColors.dark},l("pwg.placeholder.weight"))):e.createElement(e.Fragment,null,e.createElement(z,null),e.createElement(n,{size:"n1",color:s.colors.gray600},l("pwg.placeholder.weight")))))},F=E.div`
59
59
  display: flex;
60
60
  flex-direction: column;
61
61
  align-items: center;
@@ -1 +1 @@
1
- import{d as e}from"./index-f1e8b189.js";import{i as t}from"./isProduction-35cc6094.js";const s=(s,o)=>{if("undefined"!=typeof window)return window.location.origin;const r="development"===process.env.NEXT_PUBLIC_DEPLOY_ENV;return r?"http://localhost:3000":`https://${!r&&!t?o?"fe.":"discover.":o?"www.":""}${e[o?"vi-VN_MB":s]}`},o=(s,o)=>process.env.UNIFY_SSO_API||`https://${t?"id.":"staging-id."}${e[o?"vi-VN_MB":s]}`,r=()=>process.env.UNIFY_TOGETHER_API||`https://${t?"together.":"staging-together."}hellohealthgroup.com`,i=s=>process.env.UNIFY_DISCOVER_API||`https://${t?"wp.":"staging."}${e[s]}`,n=()=>process.env.UNIFY_CARE_API||`https://${t?"health-care.":"service-health-care."}hellohealthgroup.com`;export{o as a,r as b,i as c,n as d,s as g};
1
+ import{d as e}from"./index-c9290e7f.js";import{i as t}from"./isProduction-e00482ad.js";const s=(s,o)=>{if("undefined"!=typeof window)return window.location.origin;const r="development"===process.env.NEXT_PUBLIC_DEPLOY_ENV;return r?"http://localhost:3000":`https://${!r&&!t?o?"fe.":"discover.":o?"www.":""}${e[o?"vi-VN_MB":s]}`},o=(s,o)=>process.env.UNIFY_SSO_API||`https://${t?"id.":"staging-id."}${e[o?"vi-VN_MB":s]}`,r=()=>process.env.UNIFY_TOGETHER_API||`https://${t?"together.":"staging-together."}hellohealthgroup.com`,i=s=>process.env.UNIFY_DISCOVER_API||`https://${t?"wp.":"staging."}${e[s]}`,n=()=>process.env.UNIFY_CARE_API||`https://${t?"health-care.":"service-health-care."}hellohealthgroup.com`;export{o as a,r as b,i as c,n as d,s as g};
@@ -1,4 +1,4 @@
1
- import{keyframes as t}from"styled-components";import r,{createContext as i,useState as s,useEffect as a,useMemo as n}from"react";import e from"lodash/throttle";import{B as o}from"./utils-1fa73d05.js";const d=t`
1
+ import{keyframes as t}from"styled-components";import r,{createContext as i,useState as s,useEffect as a,useMemo as n}from"react";import e from"lodash/throttle";import{B as o}from"./utils-049d75fa.js";const d=t`
2
2
  from {
3
3
  transform: translate3d(0, 100%, 0);
4
4
  visibility: visible;
@@ -1 +1 @@
1
- export{g as CardAuthor,C as CardLink,D as CardPost,E as CardPostPopoverMore,b as CardReactions,F as CardReply,G as CardReplyPopover,h as CreateNewPostContent,i as CreatePostDescription,j as CreatePostTitle,s as ImagePreviewPopup,I as InputCommentBar,e as LabelPin,d as LabelSortPin,f as LabelSorting,L as Loading,H as PopoverMenu,P as PopupDanger,l as PopupDoctor,k as PopupExpert,o as PopupFrame,m as PopupHospital,r as PostContent,w as PostImagePreview,v as PostSingleImageViewPopup,z as ProfileDetail,y as ProfileDetailModal,q as ShareBox,S as SharePopup,B as SkipQuestionOfExpertBtn,x as SocialLinkPreview,J as SourceList,p as SubmitReportForm,A as TabNameInProfileDetail,c as TagTopic,T as TogetherAuthConfigContext,a as TogetherAuthConfigContextProvider,t as TogetherTypes,n as TopicSelectList,V as VerifiedTag,u as useTogetherAuthRequiredAction}from"./types-8f9ba152.js";export{D as DefaultComponentGlobalContextData,G as GlobalData,T as TogetherComponentGlobalContext,a as TogetherComponentGlobalContextProvider,c as TogetherConstants,U as UserAvatar}from"./index.styled-53842855.js";export{d as TogetherDataTransforms}from"./dataTransform-7c7cd603.js";import"./tslib.es6-cb3ea48c.js";import"react";import"@mantine/core";import"./index-bed3247d.js";import"./index-db2e1d7b.js";import"./index.styled-77b271f5.js";import"styled-components";import"./utils-1fa73d05.js";import"./index-8ac32fa0.js";import"./gAssets.js";import"./index-f1e8b189.js";import"./Locale-c8320005.js";import"./isProduction-35cc6094.js";import"./index-7a57bc59.js";import"./index.styled-e6d05e31.js";import"./theme-35a76b33.js";import"./index.styled-8f59035f.js";import"dayjs";import"./screenSizeContext-88744824.js";import"lodash/throttle";import"./index-e4836320.js";import"./index-bff98440.js";import"@mantine/hooks";import"@hookform/resolvers/yup";import"react-hook-form";import"./index-d24056ce.js";import"./useScrollbarSize-e8a276bb.js";import"lodash/debounce";import"react-dom";import"./useTranslations-860db584.js";import"./translationsContext-7730f46a.js";import"string-format";import"./useUniqueId-2654c98c.js";import"./index-1212f61e.js";import"./index.styled-1c09bfcc.js";import"date-fns";import"./index-9f83d332.js";import"./index-44a439da.js";import"react-day-picker/DayPickerInput";import"innertext";import"./index-f5718bdd.js";import"react-contenteditable";import"./cookieHelper-46eca077.js";import"keen-slider/react";import"date-fns/locale/en-US";import"date-fns/locale/id";import"date-fns/locale/vi";import"date-fns/locale/zh-TW";import"./index.styled-70d2421e.js";import"./index-054ee498.js";import"@mantine/carousel";import"@mantine/dates";import"dayjs/plugin/relativeTime";import"./index-30dfa58f.js";import"./index.styled-75b0ceaa.js";import"./routing-065ec7dc.js";import"slugify";
1
+ export{g as CardAuthor,C as CardLink,D as CardPost,E as CardPostPopoverMore,b as CardReactions,F as CardReply,G as CardReplyPopover,h as CreateNewPostContent,i as CreatePostDescription,j as CreatePostTitle,s as ImagePreviewPopup,I as InputCommentBar,e as LabelPin,d as LabelSortPin,f as LabelSorting,L as Loading,H as PopoverMenu,P as PopupDanger,l as PopupDoctor,k as PopupExpert,o as PopupFrame,m as PopupHospital,r as PostContent,w as PostImagePreview,v as PostSingleImageViewPopup,z as ProfileDetail,y as ProfileDetailModal,q as ShareBox,S as SharePopup,B as SkipQuestionOfExpertBtn,x as SocialLinkPreview,J as SourceList,p as SubmitReportForm,A as TabNameInProfileDetail,c as TagTopic,T as TogetherAuthConfigContext,a as TogetherAuthConfigContextProvider,t as TogetherTypes,n as TopicSelectList,V as VerifiedTag,u as useTogetherAuthRequiredAction}from"./types-e46ef606.js";export{D as DefaultComponentGlobalContextData,G as GlobalData,T as TogetherComponentGlobalContext,a as TogetherComponentGlobalContextProvider,c as TogetherConstants,U as UserAvatar}from"./index.styled-981e6c04.js";export{d as TogetherDataTransforms}from"./dataTransform-b6ffa89e.js";import"./tslib.es6-f1b9d31e.js";import"react";import"@mantine/core";import"./index-10233643.js";import"./index-6b049c9f.js";import"./index.styled-89252990.js";import"styled-components";import"./utils-049d75fa.js";import"./index-65b95e24.js";import"./gAssets.js";import"./index-c9290e7f.js";import"./Locale-2a1e1450.js";import"./isProduction-e00482ad.js";import"./index-e1e88ca8.js";import"./index.styled-38864315.js";import"./theme-6dca57c7.js";import"./index.styled-839052ac.js";import"dayjs";import"./screenSizeContext-796cb6e5.js";import"lodash/throttle";import"./index-4b19571c.js";import"./index-881e5990.js";import"@mantine/hooks";import"@hookform/resolvers/yup";import"react-hook-form";import"./index-28b8dab6.js";import"./useScrollbarSize-057c4f10.js";import"lodash/debounce";import"react-dom";import"./useTranslations-86f7e107.js";import"./translationsContext-d4d12e4a.js";import"string-format";import"./useUniqueId-679a497e.js";import"./index-c2de5d7b.js";import"./index.styled-c3d5eff6.js";import"date-fns";import"./index-77a5c7ce.js";import"./index-e2b7ef68.js";import"react-day-picker/DayPickerInput";import"innertext";import"./index-6f78a19c.js";import"react-contenteditable";import"./cookieHelper-b88c2be8.js";import"keen-slider/react";import"date-fns/locale/en-US";import"date-fns/locale/id";import"date-fns/locale/vi";import"date-fns/locale/zh-TW";import"./index.styled-8aca10eb.js";import"./index-43d2bffe.js";import"@mantine/carousel";import"@mantine/dates";import"dayjs/plugin/relativeTime";import"./index-8f7ffa4b.js";import"./index.styled-243d7f64.js";import"./routing-6d3d5706.js";import"slugify";