@hhgtech/hhg-components 1.29.416 → 1.29.417-beta-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (527) hide show
  1. package/build/{InputDate-460cc7e7.js → InputDate-10ab3c87.js} +14 -20
  2. package/build/{LastPeriod-d9055e31.js → LastPeriod-59498eca.js} +1 -1
  3. package/build/{MobileBottomNavigationIcon-398bbc66.js → MobileBottomNavigationIcon-e145c3c4.js} +3 -3
  4. package/build/{Spinner-8191fb29.js → Spinner-9a52f0fc.js} +1 -1
  5. package/build/{WhatsApp-4b25318c.js → WhatsApp-c6abf93d.js} +1 -1
  6. package/build/adapters.js +20 -20
  7. package/build/atoms.js +49 -49
  8. package/build/babyGrowth.js +84 -84
  9. package/build/cache.js +2 -2
  10. package/build/care.js +17 -17
  11. package/build/careBookingSearchBar.js +14 -14
  12. package/build/careBookingSearchBarV2.js +15 -15
  13. package/build/components/atoms/icons/ErrorIcon.d.ts +4 -0
  14. package/build/components/mantine/styles.d.ts +12 -0
  15. package/build/components/mantine/theme/input.d.ts +7 -6
  16. package/build/components/mantine/theme/text.d.ts +51 -0
  17. package/build/components.js +98 -98
  18. package/build/{constants-02c6edfe.js → constants-c79cfa13.js} +5 -2
  19. package/build/constants.js +3 -3
  20. package/build/constantsDomainLocales.js +1 -1
  21. package/build/constantsRiskScreener.js +2 -2
  22. package/build/constantsSite.js +2 -2
  23. package/build/{core-31621549.js → core-34634848.js} +1 -1
  24. package/build/{dataTransform-4595f9c5.js → dataTransform-36631bd8.js} +1 -1
  25. package/build/ecom.js +4 -4
  26. package/build/{editor-09d36de6.js → editor-919cc92c.js} +11 -11
  27. package/build/embeddedHeathToolCards_babyGrowth.js +24 -24
  28. package/build/embeddedHeathToolCards_babyPoop.js +20 -20
  29. package/build/embeddedHeathToolCards_babyVaccine.js +23 -23
  30. package/build/embeddedHeathToolCards_bmi_bmi.js +26 -26
  31. package/build/embeddedHeathToolCards_bmrBmr.js +26 -26
  32. package/build/embeddedHeathToolCards_dueDate_dueDate.js +23 -23
  33. package/build/embeddedHeathToolCards_ovulation_ovulation.js +23 -23
  34. package/build/embeddedHeathToolCards_pwg_pwg.js +27 -27
  35. package/build/embeddedHeathToolCards_targetHeartRate.js +28 -28
  36. package/build/esm/{InputDate-90201030.js → InputDate-a3a92776.js} +14 -20
  37. package/build/esm/{LastPeriod-d4724e1a.js → LastPeriod-fd096ba3.js} +1 -1
  38. package/build/esm/{MobileBottomNavigationIcon-74749244.js → MobileBottomNavigationIcon-d5a5b65a.js} +3 -3
  39. package/build/esm/{Spinner-a4b3358b.js → Spinner-33cddd07.js} +1 -1
  40. package/build/esm/{WhatsApp-d541cac0.js → WhatsApp-4d7f9c70.js} +1 -1
  41. package/build/esm/adapters.js +20 -20
  42. package/build/esm/atoms.js +49 -49
  43. package/build/esm/babyGrowth.js +84 -84
  44. package/build/esm/cache.js +2 -2
  45. package/build/esm/care.js +17 -17
  46. package/build/esm/careBookingSearchBar.js +14 -14
  47. package/build/esm/careBookingSearchBarV2.js +15 -15
  48. package/build/esm/components/atoms/icons/ErrorIcon.d.ts +4 -0
  49. package/build/esm/components/mantine/styles.d.ts +12 -0
  50. package/build/esm/components/mantine/theme/input.d.ts +7 -6
  51. package/build/esm/components/mantine/theme/text.d.ts +51 -0
  52. package/build/esm/components.js +98 -98
  53. package/build/esm/{constants-a6bd6d1e.js → constants-78df9624.js} +5 -2
  54. package/build/esm/constants.js +3 -3
  55. package/build/esm/constantsDomainLocales.js +1 -1
  56. package/build/esm/constantsRiskScreener.js +2 -2
  57. package/build/esm/constantsSite.js +2 -2
  58. package/build/esm/{core-82b89af5.js → core-4cbcf93f.js} +1 -1
  59. package/build/esm/{dataTransform-d1bf4d7d.js → dataTransform-7ce11bad.js} +1 -1
  60. package/build/esm/ecom.js +4 -4
  61. package/build/esm/{editor-aeae4111.js → editor-a6339164.js} +11 -11
  62. package/build/esm/embeddedHeathToolCards_babyGrowth.js +24 -24
  63. package/build/esm/embeddedHeathToolCards_babyPoop.js +20 -20
  64. package/build/esm/embeddedHeathToolCards_babyVaccine.js +23 -23
  65. package/build/esm/embeddedHeathToolCards_bmi_bmi.js +26 -26
  66. package/build/esm/embeddedHeathToolCards_bmrBmr.js +26 -26
  67. package/build/esm/embeddedHeathToolCards_dueDate_dueDate.js +23 -23
  68. package/build/esm/embeddedHeathToolCards_ovulation_ovulation.js +23 -23
  69. package/build/esm/embeddedHeathToolCards_pwg_pwg.js +27 -27
  70. package/build/esm/embeddedHeathToolCards_targetHeartRate.js +28 -28
  71. package/build/esm/footer.js +22 -22
  72. package/build/esm/gAssets.js +2 -2
  73. package/build/esm/{healthTools-7557e988.js → healthTools-af349b99.js} +1 -1
  74. package/build/esm/healthToolsCardWrapper.js +19 -19
  75. package/build/esm/healthToolsForm.js +34 -34
  76. package/build/esm/hooks/usePlacesAutocomplete.d.ts +1 -1
  77. package/build/esm/hooks.js +13 -13
  78. package/build/esm/i18n.js +2 -2
  79. package/build/esm/i18nV2.js +2 -2
  80. package/build/esm/{index-9c2f5f06.js → index-015ced74.js} +2 -2
  81. package/build/esm/{index-312c0c1a.js → index-021637b7.js} +13 -13
  82. package/build/esm/{index-541bbaf5.js → index-022306e0.js} +4 -4
  83. package/build/esm/{index-a5586f87.js → index-08c6156a.js} +4 -4
  84. package/build/esm/{index-72ec4da1.js → index-0a63ebda.js} +2 -2
  85. package/build/esm/{index-0bee62c4.js → index-0d054218.js} +15 -15
  86. package/build/esm/{index-4c0e28c4.js → index-0dbf6252.js} +2 -2
  87. package/build/esm/{index-fb787f5e.js → index-128f3777.js} +17 -17
  88. package/build/esm/{index-49f04c19.js → index-15ed0b7b.js} +2 -2
  89. package/build/esm/{index-b91bdba3.js → index-160709b1.js} +1 -1
  90. package/build/esm/{index-8825734b.js → index-16d57866.js} +1 -1
  91. package/build/esm/{index-3b8539da.js → index-1da67519.js} +32 -32
  92. package/build/esm/{index-08ad08f5.js → index-2a334259.js} +3 -3
  93. package/build/esm/{index-32581851.js → index-2e203ba1.js} +21 -41
  94. package/build/esm/{index-7297c04c.js → index-2e4d5bb5.js} +3 -3
  95. package/build/esm/{index-14417814.js → index-30439b7c.js} +2 -2
  96. package/build/esm/{index-77cca2f4.js → index-3663e4a3.js} +13 -13
  97. package/build/esm/{index-17ceb8b5.js → index-3db6b857.js} +6 -6
  98. package/build/esm/{index-973ac5c4.js → index-4727ddeb.js} +2 -2
  99. package/build/esm/{index-37ef49b1.js → index-482e1ec9.js} +6 -6
  100. package/build/esm/{index-9bd28301.js → index-4a03a4ac.js} +3 -3
  101. package/build/esm/{index-9d814290.js → index-52ba97df.js} +1 -1
  102. package/build/esm/{index-621cc638.js → index-57f3be57.js} +17 -17
  103. package/build/esm/{index-0b307a4e.js → index-612d1ed4.js} +2 -2
  104. package/build/esm/{index-05350c5b.js → index-64f67183.js} +22 -22
  105. package/build/esm/{index-a067d67b.js → index-701c2b2b.js} +2 -2
  106. package/build/esm/{index-cbd9568f.js → index-727620f5.js} +5 -5
  107. package/build/esm/{index-1a608269.js → index-758fe64b.js} +9 -15
  108. package/build/esm/{index-578f22ff.js → index-780f263f.js} +1 -1
  109. package/build/esm/{index-e86bac18.js → index-7b8af3a6.js} +6 -6
  110. package/build/esm/{index-92928c68.js → index-7e93fea8.js} +2 -2
  111. package/build/esm/{index-b77563ca.js → index-8929870c.js} +16 -16
  112. package/build/esm/{index-5a2b2d00.js → index-8ad8557d.js} +16 -16
  113. package/build/esm/{index-5893db57.js → index-91b97596.js} +3 -3
  114. package/build/esm/{index-eff5cb81.js → index-922f2e2a.js} +15 -15
  115. package/build/esm/{index-dbaf58de.js → index-99d7bc3c.js} +2 -2
  116. package/build/esm/{index-1e24a2c6.js → index-9a5f36f5.js} +25 -25
  117. package/build/esm/{index-b876769a.js → index-a54f298c.js} +3 -3
  118. package/build/esm/{index-bd90707a.js → index-a5c648ea.js} +2 -2
  119. package/build/esm/{index-eb82a32e.js → index-a85d858c.js} +32 -32
  120. package/build/esm/{index-38a04e18.js → index-b0d2269e.js} +10 -10
  121. package/build/esm/{index-5d2c7f16.js → index-b4700f17.js} +3 -3
  122. package/build/esm/{index-1dc41c9e.js → index-b5c4120c.js} +2 -2
  123. package/build/esm/{index-0ba82d61.js → index-b842196b.js} +3 -3
  124. package/build/esm/{index-8d985be7.js → index-b9f64953.js} +1 -1
  125. package/build/esm/{index-827f170c.js → index-bcddf955.js} +5 -5
  126. package/build/esm/{index-d8a96ce6.js → index-bd5de9c1.js} +3 -3
  127. package/build/esm/{index-a56a7e7e.js → index-be6d6968.js} +13 -13
  128. package/build/esm/{index-27008b25.js → index-c0a6eb84.js} +1 -1
  129. package/build/esm/{index-e6360434.js → index-c3cb9cd7.js} +7 -7
  130. package/build/esm/{index-11039009.js → index-c72ec707.js} +1 -1
  131. package/build/esm/{index-49e2befa.js → index-d1ac1d55.js} +2 -2
  132. package/build/esm/{index-811a866d.js → index-d356e439.js} +13 -13
  133. package/build/esm/{index-4a35d73a.js → index-d7b56082.js} +17 -17
  134. package/build/esm/{index-6009b6cd.js → index-d7cd9440.js} +7 -7
  135. package/build/esm/{index-d9e75358.js → index-daa24a2e.js} +6 -6
  136. package/build/esm/{index-3ec225a9.js → index-dd874cb1.js} +13 -13
  137. package/build/esm/{index-2d140c4c.js → index-e54ec864.js} +18 -27
  138. package/build/esm/{index-2283d0f7.js → index-e83c2999.js} +2 -2
  139. package/build/esm/{index-b22d3416.js → index-ea2810cf.js} +6 -6
  140. package/build/esm/{index-a4e44155.js → index-eb170bef.js} +13 -13
  141. package/build/esm/{index-2b77f3a1.js → index-f0c9c25e.js} +30 -30
  142. package/build/esm/{index-94247667.js → index-f1b61177.js} +11 -11
  143. package/build/esm/{index-439bceaa.js → index-f1bdaffc.js} +1 -1
  144. package/build/esm/{index-02d20d87.js → index-f3087826.js} +17 -17
  145. package/build/esm/{index-6f1d51ec.js → index-f45d9162.js} +15 -15
  146. package/build/esm/{index-a1950224.js → index-f8de1f75.js} +2 -2
  147. package/build/esm/{index-a88a878d.js → index-fca58416.js} +24 -24
  148. package/build/esm/index.js +119 -119
  149. package/build/esm/{labelSorting-afbe306c.js → labelSorting-a3c6de38.js} +4 -4
  150. package/build/esm/lead/LeadGen.helpers.d.ts +2 -2
  151. package/build/esm/lead/LeadGen.type.d.ts +4 -3
  152. package/build/esm/lead/LeadGenInline/LeadGenInline.d.ts +8 -0
  153. package/build/esm/lead/LeadGenInline/index.d.ts +2 -0
  154. package/build/esm/lead/LeadGenSubscriptionBox/LeadGenContext.d.ts +21 -15
  155. package/build/esm/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxContainer.d.ts +1 -3
  156. package/build/esm/lead/index.d.ts +5 -1
  157. package/build/esm/lead/layouts/inline.d.ts +3 -2
  158. package/build/esm/lead/layouts/lightbox/fields/textField/index.d.ts +2 -1
  159. package/build/esm/lead/layouts/lightbox/index.d.ts +2 -1
  160. package/build/esm/lead/newLeadPopup.d.ts +2 -1
  161. package/build/esm/lead/services/index.d.ts +5 -1
  162. package/build/esm/lead/services/index.type.d.ts +5 -0
  163. package/build/esm/lead/utils.d.ts +18 -0
  164. package/build/esm/lead.css +1 -1
  165. package/build/esm/lead.js +525 -406
  166. package/build/esm/{logoIcon-d2b8bf2c.js → logoIcon-6ec7eb8c.js} +2 -2
  167. package/build/esm/mantine.js +26 -26
  168. package/build/esm/misc/cachedSystem.d.ts +5 -0
  169. package/build/esm/misc.js +18 -18
  170. package/build/esm/miscGetDynamicHealthTool.js +4 -4
  171. package/build/esm/miscGetSocialList.js +8 -8
  172. package/build/esm/miscScreenSizeContext.js +1 -1
  173. package/build/esm/mobileBottomNavigation.js +5 -5
  174. package/build/esm/mobileBottomNavigationIcon.js +5 -5
  175. package/build/esm/molecules.js +75 -75
  176. package/build/esm/moleculesArticleCard.js +6 -6
  177. package/build/esm/moleculesArticleCardV2.js +17 -17
  178. package/build/esm/navigation.js +47 -47
  179. package/build/esm/navigationLogoutPopup.js +11 -11
  180. package/build/esm/navigationProfileButton.js +27 -27
  181. package/build/esm/onboardingV2.js +30 -30
  182. package/build/esm/organisms.js +51 -51
  183. package/build/esm/{post-4f2e7f2b.js → post-d8f3fc53.js} +2 -2
  184. package/build/esm/profileNavigation.js +20 -20
  185. package/build/esm/progressBar.js +1 -1
  186. package/build/esm/pwg.js +23 -23
  187. package/build/esm/ssoV2/api/featureFlag.d.ts +2 -1
  188. package/build/esm/ssoV2.js +53 -41
  189. package/build/esm/{store-40fc7d8d.js → store-36b69be6.js} +3 -3
  190. package/build/esm/subot.js +37 -37
  191. package/build/esm/surveyOrPremiumBanner.js +34 -34
  192. package/build/esm/surveyQuestionCard.js +11 -11
  193. package/build/esm/{surveyThankyouCard-297f7588.js → surveyThankyouCard-9d2d0b84.js} +5 -5
  194. package/build/esm/{text-59e76dd7.js → text-51330b00.js} +60 -10
  195. package/build/esm/together.js +57 -57
  196. package/build/esm/togetherApiUtils.js +4 -4
  197. package/build/esm/togetherAtoms.js +31 -31
  198. package/build/esm/togetherComponentGlobalContext.js +4 -4
  199. package/build/esm/togetherMolecules.js +52 -52
  200. package/build/esm/togetherMoleculesCardAuthor.js +29 -29
  201. package/build/esm/togetherMoleculesPostImagePreview.js +11 -11
  202. package/build/esm/togetherMoleculesProfileDetail.js +40 -40
  203. package/build/esm/togetherOrganisms.js +51 -51
  204. package/build/esm/togetherRichTextEditor.js +18 -18
  205. package/build/esm/togetherShareBox.js +10 -10
  206. package/build/esm/{translationsProvider-5444daff.js → translationsProvider-8d44b0d4.js} +1 -1
  207. package/build/esm/{treePopoverMenu-d48dce22.js → treePopoverMenu-a8dc8b30.js} +19 -19
  208. package/build/esm/{types-39a8ee7b.js → types-701f6eb0.js} +2 -2
  209. package/build/esm/types.js +2 -2
  210. package/build/esm/{useCategory-bc3dfd8d.js → useCategory-e4f5fbf3.js} +5 -5
  211. package/build/esm/{useHealthToolCache-aaed38ab.js → useHealthToolCache-e7a310db.js} +1 -1
  212. package/build/esm/{usePlacesAutocomplete-e0383a78.js → usePlacesAutocomplete-676f5608.js} +2 -2
  213. package/build/esm/useTogetherAuthRequiredAction.js +10 -10
  214. package/build/esm/{utils-db5fa0f9.js → utils-30116154.js} +2 -2
  215. package/build/esm/{utils-40317fad.js → utils-732bb6b1.js} +5 -5
  216. package/build/esm/{utils-f1d9b65c.js → utils-d9181ffb.js} +2 -2
  217. package/build/esm/{utils-a220ec92.js → utils-f82cec3f.js} +3 -3
  218. package/build/esm/vaccination.js +22 -22
  219. package/build/footer.js +22 -22
  220. package/build/gAssets.js +2 -2
  221. package/build/{healthTools-b38ec114.js → healthTools-84b8d7ac.js} +1 -1
  222. package/build/healthToolsCardWrapper.js +19 -19
  223. package/build/healthToolsForm.js +34 -34
  224. package/build/hooks/usePlacesAutocomplete.d.ts +1 -1
  225. package/build/hooks.js +13 -13
  226. package/build/i18n.js +2 -2
  227. package/build/i18nV2.js +1 -1
  228. package/build/{index-2b29e85c.js → index-02a5ed00.js} +6 -6
  229. package/build/{index-3ed3fab2.js → index-072bf274.js} +24 -24
  230. package/build/{index-77078e28.js → index-0a89635f.js} +13 -13
  231. package/build/{index-239d3b6d.js → index-0caade43.js} +15 -15
  232. package/build/{index-db317575.js → index-140c76d1.js} +2 -2
  233. package/build/{index-1db868c8.js → index-14aec939.js} +3 -3
  234. package/build/{index-1f921f49.js → index-1660dfb1.js} +22 -22
  235. package/build/{index-54c9506b.js → index-18642686.js} +1 -1
  236. package/build/{index-a82aea0d.js → index-1c9ec8a3.js} +13 -13
  237. package/build/{index-9b8aef2d.js → index-1ddb509e.js} +11 -11
  238. package/build/{index-4689ad3f.js → index-2534a8b8.js} +6 -6
  239. package/build/{index-9997da7b.js → index-2b1e3ca6.js} +13 -13
  240. package/build/{index-807bb915.js → index-2d0697f8.js} +2 -2
  241. package/build/{index-c9116f2e.js → index-2d95338b.js} +3 -3
  242. package/build/{index-c1551fe6.js → index-304e531d.js} +2 -2
  243. package/build/{index-b3a7c814.js → index-3124878e.js} +1 -1
  244. package/build/{index-ad84556b.js → index-367519b0.js} +1 -1
  245. package/build/{index-93780b67.js → index-3750a169.js} +6 -6
  246. package/build/{index-376680d9.js → index-3903c056.js} +2 -2
  247. package/build/{index-88e66d62.js → index-39e83a91.js} +5 -5
  248. package/build/{index-0f6cb54e.js → index-3dd5d7df.js} +15 -15
  249. package/build/{index-3834e4c0.js → index-3eb7af41.js} +3 -3
  250. package/build/{index-cd34fbf6.js → index-40b9cb0e.js} +3 -3
  251. package/build/{index-06442836.js → index-43804567.js} +1 -1
  252. package/build/{index-cbbf547b.js → index-4c5e698d.js} +21 -41
  253. package/build/{index-6b182a17.js → index-4dbd5259.js} +17 -17
  254. package/build/{index-20ad809e.js → index-4eb41d78.js} +2 -2
  255. package/build/{index-b0ceb28a.js → index-56ed089d.js} +4 -4
  256. package/build/{index-c794ff25.js → index-58bf6eeb.js} +4 -4
  257. package/build/{index-7525326f.js → index-6a0960fb.js} +7 -7
  258. package/build/{index-3406a07e.js → index-6af26e76.js} +32 -32
  259. package/build/{index-194ded97.js → index-6f94d19c.js} +1 -1
  260. package/build/{index-2d4a6a84.js → index-73dd23b0.js} +16 -16
  261. package/build/{index-8b4b461f.js → index-769a2c36.js} +1 -1
  262. package/build/{index-62a7e1dd.js → index-7db07a55.js} +2 -2
  263. package/build/{index-45a00fcc.js → index-7f271ad9.js} +2 -2
  264. package/build/{index-27d0d281.js → index-82e416aa.js} +5 -5
  265. package/build/{index-51a27c1a.js → index-85f486a7.js} +2 -2
  266. package/build/{index-17558bdc.js → index-89597de1.js} +3 -3
  267. package/build/{index-c6e9f5ba.js → index-9c6092bb.js} +32 -32
  268. package/build/{index-c14f4d51.js → index-9ce4c163.js} +30 -30
  269. package/build/{index-9e28566d.js → index-9df9fa8e.js} +3 -3
  270. package/build/{index-d4202c79.js → index-a321fce1.js} +17 -17
  271. package/build/{index-f7052920.js → index-a414d320.js} +2 -2
  272. package/build/{index-feccbedb.js → index-a627500d.js} +13 -13
  273. package/build/{index-90fa3d0d.js → index-a75a01fd.js} +1 -1
  274. package/build/{index-c134e92d.js → index-b20a58c9.js} +25 -25
  275. package/build/{index-e2855353.js → index-b61a314d.js} +13 -13
  276. package/build/{index-d3d9b838.js → index-b676d6b2.js} +9 -15
  277. package/build/{index-27296b44.js → index-bde334af.js} +3 -3
  278. package/build/{index-c2742dbd.js → index-bf21e951.js} +18 -27
  279. package/build/{index-25f35320.js → index-c9835ab1.js} +2 -2
  280. package/build/{index-fa63bcfc.js → index-c9884478.js} +3 -3
  281. package/build/{index-93751671.js → index-cae0575b.js} +10 -10
  282. package/build/{index-9a9ee559.js → index-cae94b25.js} +13 -13
  283. package/build/{index-e68447bd.js → index-d1b58301.js} +17 -17
  284. package/build/{index-ba13e9e8.js → index-d335ecd3.js} +2 -2
  285. package/build/{index-7e23a534.js → index-d3f79564.js} +6 -6
  286. package/build/{index-3eb9c695.js → index-d6875867.js} +2 -2
  287. package/build/{index-00470319.js → index-d6bd7268.js} +15 -15
  288. package/build/{index-6b7f60da.js → index-de8171ad.js} +7 -7
  289. package/build/{index-6a361713.js → index-de8fb18a.js} +16 -16
  290. package/build/{index-5da02e93.js → index-ec7119c3.js} +6 -6
  291. package/build/{index-dddf1be5.js → index-f272770b.js} +2 -2
  292. package/build/{index-b803a309.js → index-f79c6ea7.js} +1 -1
  293. package/build/{index-078e1321.js → index-f84e14ca.js} +2 -2
  294. package/build/{index-79716dd6.js → index-fa89196c.js} +2 -2
  295. package/build/{index-670c1cf8.js → index-fc41a6d5.js} +17 -17
  296. package/build/index.js +119 -119
  297. package/build/{labelSorting-607d24d0.js → labelSorting-ddc2645b.js} +4 -4
  298. package/build/lead/LeadGen.helpers.d.ts +2 -2
  299. package/build/lead/LeadGen.type.d.ts +4 -3
  300. package/build/lead/LeadGenInline/LeadGenInline.d.ts +8 -0
  301. package/build/lead/LeadGenInline/index.d.ts +2 -0
  302. package/build/lead/LeadGenSubscriptionBox/LeadGenContext.d.ts +21 -15
  303. package/build/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxContainer.d.ts +1 -3
  304. package/build/lead/index.d.ts +5 -1
  305. package/build/lead/layouts/inline.d.ts +3 -2
  306. package/build/lead/layouts/lightbox/fields/textField/index.d.ts +2 -1
  307. package/build/lead/layouts/lightbox/index.d.ts +2 -1
  308. package/build/lead/newLeadPopup.d.ts +2 -1
  309. package/build/lead/services/index.d.ts +5 -1
  310. package/build/lead/services/index.type.d.ts +5 -0
  311. package/build/lead/utils.d.ts +18 -0
  312. package/build/lead.css +1 -1
  313. package/build/lead.js +524 -403
  314. package/build/{logoIcon-25362d51.js → logoIcon-0f5b3004.js} +2 -2
  315. package/build/mantine.js +24 -24
  316. package/build/misc/cachedSystem.d.ts +5 -0
  317. package/build/misc.js +18 -18
  318. package/build/miscGetDynamicHealthTool.js +4 -4
  319. package/build/miscGetSocialList.js +8 -8
  320. package/build/miscScreenSizeContext.js +1 -1
  321. package/build/mobileBottomNavigation.js +5 -5
  322. package/build/mobileBottomNavigationIcon.js +5 -5
  323. package/build/molecules.js +75 -75
  324. package/build/moleculesArticleCard.js +6 -6
  325. package/build/moleculesArticleCardV2.js +17 -17
  326. package/build/navigation.js +47 -47
  327. package/build/navigationLogoutPopup.js +11 -11
  328. package/build/navigationProfileButton.js +27 -27
  329. package/build/onboardingV2.js +29 -29
  330. package/build/organisms.js +51 -51
  331. package/build/{post-2f745621.js → post-fdb2df41.js} +2 -2
  332. package/build/profileNavigation.js +20 -20
  333. package/build/progressBar.js +1 -1
  334. package/build/pwg.js +23 -23
  335. package/build/ssoV2/api/featureFlag.d.ts +2 -1
  336. package/build/ssoV2.js +51 -39
  337. package/build/{store-c4524000.js → store-1b489104.js} +3 -3
  338. package/build/subot.js +36 -36
  339. package/build/surveyOrPremiumBanner.js +34 -34
  340. package/build/surveyQuestionCard.js +11 -11
  341. package/build/{surveyThankyouCard-a3db4ca8.js → surveyThankyouCard-4206245a.js} +5 -5
  342. package/build/{text-b61d7a31.js → text-c3313ee4.js} +60 -9
  343. package/build/together.js +57 -57
  344. package/build/togetherApiUtils.js +4 -4
  345. package/build/togetherAtoms.js +31 -31
  346. package/build/togetherComponentGlobalContext.js +4 -4
  347. package/build/togetherMolecules.js +52 -52
  348. package/build/togetherMoleculesCardAuthor.js +29 -29
  349. package/build/togetherMoleculesPostImagePreview.js +11 -11
  350. package/build/togetherMoleculesProfileDetail.js +40 -40
  351. package/build/togetherOrganisms.js +51 -51
  352. package/build/togetherRichTextEditor.js +18 -18
  353. package/build/togetherShareBox.js +10 -10
  354. package/build/{translationsProvider-f08be05d.js → translationsProvider-a097a986.js} +1 -1
  355. package/build/{treePopoverMenu-53c4d8fd.js → treePopoverMenu-07986abe.js} +19 -19
  356. package/build/{types-c3629610.js → types-3f3f0421.js} +2 -2
  357. package/build/types.js +2 -2
  358. package/build/{useCategory-29a09735.js → useCategory-61398ffc.js} +5 -5
  359. package/build/{useHealthToolCache-b752a977.js → useHealthToolCache-65b8a208.js} +1 -1
  360. package/build/{usePlacesAutocomplete-95df2b33.js → usePlacesAutocomplete-381d7115.js} +2 -2
  361. package/build/useTogetherAuthRequiredAction.js +10 -10
  362. package/build/{utils-714feb5e.js → utils-5b7aa127.js} +3 -3
  363. package/build/{utils-d73c632c.js → utils-6c36ccea.js} +2 -2
  364. package/build/{utils-7aa2f419.js → utils-869de120.js} +2 -2
  365. package/build/{utils-23cbdd2c.js → utils-b9d72531.js} +5 -5
  366. package/build/vaccination.js +22 -22
  367. package/package.json +1 -1
  368. /package/build/{BMI_BOYS.percentile.monthly-9a29e648.js → BMI_BOYS.percentile.monthly-a854bcaa.js} +0 -0
  369. /package/build/{BMI_BOYS.percentile.weekly-803cb2cf.js → BMI_BOYS.percentile.weekly-8cc6557d.js} +0 -0
  370. /package/build/{BMI_BOYS.percentile.yearly-0d488f58.js → BMI_BOYS.percentile.yearly-f830d92e.js} +0 -0
  371. /package/build/{BMI_BOYS.zscore.monthly-650368ba.js → BMI_BOYS.zscore.monthly-e51c9daa.js} +0 -0
  372. /package/build/{BMI_BOYS.zscore.weekly-5c95aa33.js → BMI_BOYS.zscore.weekly-3f9b7fab.js} +0 -0
  373. /package/build/{BMI_BOYS.zscore.yearly-24d579ea.js → BMI_BOYS.zscore.yearly-35413eeb.js} +0 -0
  374. /package/build/{BMI_GIRLS.percentile.monthly-f318cb06.js → BMI_GIRLS.percentile.monthly-8521df6c.js} +0 -0
  375. /package/build/{BMI_GIRLS.percentile.weekly-b70a59bc.js → BMI_GIRLS.percentile.weekly-51d192af.js} +0 -0
  376. /package/build/{BMI_GIRLS.percentile.yearly-01efcd99.js → BMI_GIRLS.percentile.yearly-9c8adc67.js} +0 -0
  377. /package/build/{BMI_GIRLS.zscore.monthly-d317ac24.js → BMI_GIRLS.zscore.monthly-ed1c0fef.js} +0 -0
  378. /package/build/{BMI_GIRLS.zscore.weekly-28e86377.js → BMI_GIRLS.zscore.weekly-7745b8b2.js} +0 -0
  379. /package/build/{BMI_GIRLS.zscore.yearly-7d6d749c.js → BMI_GIRLS.zscore.yearly-7f0fbf92.js} +0 -0
  380. /package/build/{ChevronDown-9bb5b2f1.js → ChevronDown-d436669c.js} +0 -0
  381. /package/build/{Close-d4633e2e.js → Close-47179e40.js} +0 -0
  382. /package/build/{Google-9f667b1a.js → Google-19f80312.js} +0 -0
  383. /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-669ee743.js → HEAD CIRCUM_BOYS.percentile.monthly-f5502866.js} +0 -0
  384. /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-0156de4e.js → HEAD CIRCUM_BOYS.percentile.weekly-bedd3545.js} +0 -0
  385. /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-bfc5fc2c.js → HEAD CIRCUM_BOYS.percentile.yearly-619dc3dd.js} +0 -0
  386. /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-24b56f87.js → HEAD CIRCUM_BOYS.zscore.monthly-350f9027.js} +0 -0
  387. /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-b42abef6.js → HEAD CIRCUM_BOYS.zscore.weekly-01ea38d3.js} +0 -0
  388. /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-5edc3772.js → HEAD CIRCUM_BOYS.zscore.yearly-47e37c80.js} +0 -0
  389. /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-3df0e502.js → HEAD CIRCUM_GIRLS.percentile.monthly-d6ee1119.js} +0 -0
  390. /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-9024f534.js → HEAD CIRCUM_GIRLS.percentile.weekly-3e6963aa.js} +0 -0
  391. /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-ca350787.js → HEAD CIRCUM_GIRLS.percentile.yearly-e7727dfe.js} +0 -0
  392. /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-fdb13a2d.js → HEAD CIRCUM_GIRLS.zscore.monthly-2473eb3a.js} +0 -0
  393. /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-e2322601.js → HEAD CIRCUM_GIRLS.zscore.weekly-e64dd3aa.js} +0 -0
  394. /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-5561070a.js → HEAD CIRCUM_GIRLS.zscore.yearly-5ecaa9b6.js} +0 -0
  395. /package/build/{HEIGHT_BOYS.percentile.monthly-17b9e3a5.js → HEIGHT_BOYS.percentile.monthly-80ac8b58.js} +0 -0
  396. /package/build/{HEIGHT_BOYS.percentile.weekly-02b05774.js → HEIGHT_BOYS.percentile.weekly-d0b14cb0.js} +0 -0
  397. /package/build/{HEIGHT_BOYS.percentile.yearly-452f0891.js → HEIGHT_BOYS.percentile.yearly-de91e04a.js} +0 -0
  398. /package/build/{HEIGHT_BOYS.zscore.monthly-e6fadfaf.js → HEIGHT_BOYS.zscore.monthly-cd8a75f6.js} +0 -0
  399. /package/build/{HEIGHT_BOYS.zscore.weekly-f6ad64b3.js → HEIGHT_BOYS.zscore.weekly-549d54e6.js} +0 -0
  400. /package/build/{HEIGHT_BOYS.zscore.yearly-f18ab57e.js → HEIGHT_BOYS.zscore.yearly-7e8e670a.js} +0 -0
  401. /package/build/{HEIGHT_GIRLS.percentile.monthly-0758e4b1.js → HEIGHT_GIRLS.percentile.monthly-0b379859.js} +0 -0
  402. /package/build/{HEIGHT_GIRLS.percentile.weekly-710a8aa4.js → HEIGHT_GIRLS.percentile.weekly-20c0f2e1.js} +0 -0
  403. /package/build/{HEIGHT_GIRLS.percentile.yearly-2125f01d.js → HEIGHT_GIRLS.percentile.yearly-ce767299.js} +0 -0
  404. /package/build/{HEIGHT_GIRLS.zscore.monthly-7b09786c.js → HEIGHT_GIRLS.zscore.monthly-7d904f97.js} +0 -0
  405. /package/build/{HEIGHT_GIRLS.zscore.weekly-4b7e95c1.js → HEIGHT_GIRLS.zscore.weekly-babeb650.js} +0 -0
  406. /package/build/{HEIGHT_GIRLS.zscore.yearly-4743d1ff.js → HEIGHT_GIRLS.zscore.yearly-051f015f.js} +0 -0
  407. /package/build/{Locale-d8323a57.js → Locale-2416ac56.js} +0 -0
  408. /package/build/{Visible-f78beda4.js → Visible-cd41d8cd.js} +0 -0
  409. /package/build/{WEIGHT_BOYS.percentile.monthly-66c02028.js → WEIGHT_BOYS.percentile.monthly-291ff5dc.js} +0 -0
  410. /package/build/{WEIGHT_BOYS.percentile.weekly-cba4d76c.js → WEIGHT_BOYS.percentile.weekly-a3e5af1a.js} +0 -0
  411. /package/build/{WEIGHT_BOYS.percentile.yearly-6dd23f5d.js → WEIGHT_BOYS.percentile.yearly-f9aea017.js} +0 -0
  412. /package/build/{WEIGHT_BOYS.zscore.monthly-a7c65818.js → WEIGHT_BOYS.zscore.monthly-7dc0a4c2.js} +0 -0
  413. /package/build/{WEIGHT_BOYS.zscore.weekly-bc979437.js → WEIGHT_BOYS.zscore.weekly-ce48f6f8.js} +0 -0
  414. /package/build/{WEIGHT_BOYS.zscore.yearly-07a8582d.js → WEIGHT_BOYS.zscore.yearly-02d1307c.js} +0 -0
  415. /package/build/{WEIGHT_GIRLS.percentile.monthly-5c928480.js → WEIGHT_GIRLS.percentile.monthly-5784551f.js} +0 -0
  416. /package/build/{WEIGHT_GIRLS.percentile.weekly-3788d6b0.js → WEIGHT_GIRLS.percentile.weekly-b4062226.js} +0 -0
  417. /package/build/{WEIGHT_GIRLS.percentile.yearly-09cd78e9.js → WEIGHT_GIRLS.percentile.yearly-3471762d.js} +0 -0
  418. /package/build/{WEIGHT_GIRLS.zscore.monthly-8228182a.js → WEIGHT_GIRLS.zscore.monthly-86d8d223.js} +0 -0
  419. /package/build/{WEIGHT_GIRLS.zscore.weekly-30f5bc2d.js → WEIGHT_GIRLS.zscore.weekly-5a6c48b3.js} +0 -0
  420. /package/build/{WEIGHT_GIRLS.zscore.yearly-67fe47aa.js → WEIGHT_GIRLS.zscore.yearly-3b074768.js} +0 -0
  421. /package/build/{animation-521d84b9.js → animation-b69d9b39.js} +0 -0
  422. /package/build/{constants-47c44643.js → constants-56e8cc26.js} +0 -0
  423. /package/build/{constants-f41956a8.js → constants-62d7a480.js} +0 -0
  424. /package/build/{constants-60466d93.js → constants-ed232079.js} +0 -0
  425. /package/build/{dataTransform-0d9ece63.js → dataTransform-8a85546e.js} +0 -0
  426. /package/build/esm/{BMI_BOYS.percentile.monthly-dc892e80.js → BMI_BOYS.percentile.monthly-7f3c81df.js} +0 -0
  427. /package/build/esm/{BMI_BOYS.percentile.weekly-840e2c5e.js → BMI_BOYS.percentile.weekly-5701bd58.js} +0 -0
  428. /package/build/esm/{BMI_BOYS.percentile.yearly-d8a8e7e4.js → BMI_BOYS.percentile.yearly-450708a1.js} +0 -0
  429. /package/build/esm/{BMI_BOYS.zscore.monthly-6c95dae2.js → BMI_BOYS.zscore.monthly-d0b0e143.js} +0 -0
  430. /package/build/esm/{BMI_BOYS.zscore.weekly-d050c818.js → BMI_BOYS.zscore.weekly-d6031f05.js} +0 -0
  431. /package/build/esm/{BMI_BOYS.zscore.yearly-d1a27f4d.js → BMI_BOYS.zscore.yearly-461089ea.js} +0 -0
  432. /package/build/esm/{BMI_GIRLS.percentile.monthly-fd5e9dcb.js → BMI_GIRLS.percentile.monthly-8b35fbd6.js} +0 -0
  433. /package/build/esm/{BMI_GIRLS.percentile.weekly-437421bb.js → BMI_GIRLS.percentile.weekly-f2367820.js} +0 -0
  434. /package/build/esm/{BMI_GIRLS.percentile.yearly-821d0b60.js → BMI_GIRLS.percentile.yearly-536209fd.js} +0 -0
  435. /package/build/esm/{BMI_GIRLS.zscore.monthly-5cac3960.js → BMI_GIRLS.zscore.monthly-94eaf8c1.js} +0 -0
  436. /package/build/esm/{BMI_GIRLS.zscore.weekly-1fd59b72.js → BMI_GIRLS.zscore.weekly-5491fcaf.js} +0 -0
  437. /package/build/esm/{BMI_GIRLS.zscore.yearly-9c0bdbae.js → BMI_GIRLS.zscore.yearly-dc4017c9.js} +0 -0
  438. /package/build/esm/{ChevronDown-6a7d989b.js → ChevronDown-a7ef8813.js} +0 -0
  439. /package/build/esm/{Close-c64d3014.js → Close-e97c53f9.js} +0 -0
  440. /package/build/esm/{Google-9d754c62.js → Google-81cedc23.js} +0 -0
  441. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-b31fb4b4.js → HEAD CIRCUM_BOYS.percentile.monthly-23c97f34.js} +0 -0
  442. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-ac0a5264.js → HEAD CIRCUM_BOYS.percentile.weekly-62bcde26.js} +0 -0
  443. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-7d20eaff.js → HEAD CIRCUM_BOYS.percentile.yearly-e94bbc9d.js} +0 -0
  444. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-8739e70a.js → HEAD CIRCUM_BOYS.zscore.monthly-67fa0a98.js} +0 -0
  445. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-b8812960.js → HEAD CIRCUM_BOYS.zscore.weekly-8e827e7f.js} +0 -0
  446. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-709a676e.js → HEAD CIRCUM_BOYS.zscore.yearly-0a6a6af8.js} +0 -0
  447. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-1c7e2423.js → HEAD CIRCUM_GIRLS.percentile.monthly-dcd94b91.js} +0 -0
  448. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-fd9f7c5e.js → HEAD CIRCUM_GIRLS.percentile.weekly-be4b6bf8.js} +0 -0
  449. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-1d0c94ef.js → HEAD CIRCUM_GIRLS.percentile.yearly-9955236e.js} +0 -0
  450. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-b1d9fa37.js → HEAD CIRCUM_GIRLS.zscore.monthly-d3357201.js} +0 -0
  451. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-99bd4976.js → HEAD CIRCUM_GIRLS.zscore.weekly-3bb26a74.js} +0 -0
  452. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-b2c2d92a.js → HEAD CIRCUM_GIRLS.zscore.yearly-9c3a9a94.js} +0 -0
  453. /package/build/esm/{HEIGHT_BOYS.percentile.monthly-b76d0b33.js → HEIGHT_BOYS.percentile.monthly-6504b8ae.js} +0 -0
  454. /package/build/esm/{HEIGHT_BOYS.percentile.weekly-8109b0c0.js → HEIGHT_BOYS.percentile.weekly-23973709.js} +0 -0
  455. /package/build/esm/{HEIGHT_BOYS.percentile.yearly-b80934c7.js → HEIGHT_BOYS.percentile.yearly-715e66cf.js} +0 -0
  456. /package/build/esm/{HEIGHT_BOYS.zscore.monthly-4b74fa0e.js → HEIGHT_BOYS.zscore.monthly-5f98fc41.js} +0 -0
  457. /package/build/esm/{HEIGHT_BOYS.zscore.weekly-28abf9d3.js → HEIGHT_BOYS.zscore.weekly-bc07ec44.js} +0 -0
  458. /package/build/esm/{HEIGHT_BOYS.zscore.yearly-7043babb.js → HEIGHT_BOYS.zscore.yearly-510e42ef.js} +0 -0
  459. /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-63e8cab3.js → HEIGHT_GIRLS.percentile.monthly-30f8bde0.js} +0 -0
  460. /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-cdbe09d5.js → HEIGHT_GIRLS.percentile.weekly-e0897ab0.js} +0 -0
  461. /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-6ee4531f.js → HEIGHT_GIRLS.percentile.yearly-fee6592e.js} +0 -0
  462. /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-2c45ea19.js → HEIGHT_GIRLS.zscore.monthly-f7697434.js} +0 -0
  463. /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-2cb19419.js → HEIGHT_GIRLS.zscore.weekly-2c694bc1.js} +0 -0
  464. /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-eca4f1fc.js → HEIGHT_GIRLS.zscore.yearly-0d6e3d3c.js} +0 -0
  465. /package/build/esm/{Locale-78dd91cd.js → Locale-d46afed9.js} +0 -0
  466. /package/build/esm/{Visible-69bafaa2.js → Visible-07a390a4.js} +0 -0
  467. /package/build/esm/{WEIGHT_BOYS.percentile.monthly-091d868c.js → WEIGHT_BOYS.percentile.monthly-9c9d3c0a.js} +0 -0
  468. /package/build/esm/{WEIGHT_BOYS.percentile.weekly-ed6e9efc.js → WEIGHT_BOYS.percentile.weekly-bdb5d364.js} +0 -0
  469. /package/build/esm/{WEIGHT_BOYS.percentile.yearly-23c68a1e.js → WEIGHT_BOYS.percentile.yearly-23622c15.js} +0 -0
  470. /package/build/esm/{WEIGHT_BOYS.zscore.monthly-98d0ef61.js → WEIGHT_BOYS.zscore.monthly-4d3f006b.js} +0 -0
  471. /package/build/esm/{WEIGHT_BOYS.zscore.weekly-9b2c45fe.js → WEIGHT_BOYS.zscore.weekly-03dd1278.js} +0 -0
  472. /package/build/esm/{WEIGHT_BOYS.zscore.yearly-ea18848d.js → WEIGHT_BOYS.zscore.yearly-b56798e0.js} +0 -0
  473. /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-60e07863.js → WEIGHT_GIRLS.percentile.monthly-14bc2c65.js} +0 -0
  474. /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-3507063b.js → WEIGHT_GIRLS.percentile.weekly-c5495d8e.js} +0 -0
  475. /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-9978f885.js → WEIGHT_GIRLS.percentile.yearly-5a304bb0.js} +0 -0
  476. /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-b885a6f6.js → WEIGHT_GIRLS.zscore.monthly-7f40e1dc.js} +0 -0
  477. /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-a38560b6.js → WEIGHT_GIRLS.zscore.weekly-fa880de9.js} +0 -0
  478. /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-138070a8.js → WEIGHT_GIRLS.zscore.yearly-9c6715e8.js} +0 -0
  479. /package/build/esm/{animation-2c75dbd2.js → animation-95c337ba.js} +0 -0
  480. /package/build/esm/{constants-f26939f5.js → constants-17c2e31c.js} +0 -0
  481. /package/build/esm/{constants-9b35ad0b.js → constants-275b93dd.js} +0 -0
  482. /package/build/esm/{constants-10672739.js → constants-7ea26b9a.js} +0 -0
  483. /package/build/esm/{dataTransform-d69afa4d.js → dataTransform-1afcfb0e.js} +0 -0
  484. /package/build/esm/{index-6b9ef138.js → index-048ddd80.js} +0 -0
  485. /package/build/esm/{index-065bf7e9.js → index-1a32b73a.js} +0 -0
  486. /package/build/esm/{index-b50e5b6c.js → index-272df268.js} +0 -0
  487. /package/build/esm/{index-ff4259d8.js → index-5119757a.js} +0 -0
  488. /package/build/esm/{index-84ae9504.js → index-65f4ace5.js} +0 -0
  489. /package/build/esm/{index-56596240.js → index-6966bcc9.js} +0 -0
  490. /package/build/esm/{index-be3e61bd.js → index-770a5411.js} +0 -0
  491. /package/build/esm/{index-d576702b.js → index-f1a253ec.js} +0 -0
  492. /package/build/esm/{index.styles-9fbd164a.js → index.styles-30533b59.js} +0 -0
  493. /package/build/esm/{localizeNumberFormat-665721cc.js → localizeNumberFormat-5e8cf579.js} +0 -0
  494. /package/build/esm/{normalizeLink-80a5acaf.js → normalizeLink-7ddb8730.js} +0 -0
  495. /package/build/esm/{number-9b343f37.js → number-60adc5e7.js} +0 -0
  496. /package/build/esm/{paths-fad80d5a.js → paths-235f8743.js} +0 -0
  497. /package/build/esm/{shared-62c44d53.js → shared-549ac603.js} +0 -0
  498. /package/build/esm/{translationsContext-9f1f49da.js → translationsContext-3814cd1a.js} +0 -0
  499. /package/build/esm/{tslib.es6-438c13d7.js → tslib.es6-885c1a36.js} +0 -0
  500. /package/build/esm/{types-adbda911.js → types-2b96ee53.js} +0 -0
  501. /package/build/esm/{useIsInit-179867a4.js → useIsInit-6efacc90.js} +0 -0
  502. /package/build/esm/{useOutsideClick-610e5bee.js → useOutsideClick-75f974b7.js} +0 -0
  503. /package/build/esm/{useScrollbarSize-83fd1cf8.js → useScrollbarSize-ce896eea.js} +0 -0
  504. /package/build/esm/{useUniqueId-345ebff3.js → useUniqueId-5dd89792.js} +0 -0
  505. /package/build/esm/{utils-19da5326.js → utils-711e190d.js} +0 -0
  506. /package/build/{index-9d933bb7.js → index-072c01d4.js} +0 -0
  507. /package/build/{index-a8c109b7.js → index-1686a7bc.js} +0 -0
  508. /package/build/{index-1ae26665.js → index-33562049.js} +0 -0
  509. /package/build/{index-7f6691ef.js → index-3639e7de.js} +0 -0
  510. /package/build/{index-c03aa380.js → index-6ddfe68a.js} +0 -0
  511. /package/build/{index-62fb22db.js → index-7b2e7862.js} +0 -0
  512. /package/build/{index-97d59516.js → index-a1e28e1e.js} +0 -0
  513. /package/build/{index-68e67841.js → index-b01ecdb3.js} +0 -0
  514. /package/build/{index.styles-54dbd34d.js → index.styles-44595350.js} +0 -0
  515. /package/build/{localizeNumberFormat-e3768335.js → localizeNumberFormat-455edf6f.js} +0 -0
  516. /package/build/{normalizeLink-7689ddb6.js → normalizeLink-79ec3b7c.js} +0 -0
  517. /package/build/{number-a2730dd5.js → number-1eb29a31.js} +0 -0
  518. /package/build/{paths-5a4e7161.js → paths-e84112a8.js} +0 -0
  519. /package/build/{shared-731bc7c1.js → shared-effe732e.js} +0 -0
  520. /package/build/{translationsContext-cd7d6e45.js → translationsContext-05b21136.js} +0 -0
  521. /package/build/{tslib.es6-3cacf75c.js → tslib.es6-8acabd93.js} +0 -0
  522. /package/build/{types-632ff208.js → types-d01664a5.js} +0 -0
  523. /package/build/{useIsInit-01f4811c.js → useIsInit-63e2fcc7.js} +0 -0
  524. /package/build/{useOutsideClick-e7938ae9.js → useOutsideClick-6650fd66.js} +0 -0
  525. /package/build/{useScrollbarSize-26917e9e.js → useScrollbarSize-a52123a6.js} +0 -0
  526. /package/build/{useUniqueId-325ae7f2.js → useUniqueId-d7d4069b.js} +0 -0
  527. /package/build/{utils-c8be48e1.js → utils-8325fa5f.js} +0 -0
package/build/esm/lead.js CHANGED
@@ -1,56 +1,56 @@
1
- import { _ as __rest, a as __awaiter } from './tslib.es6-438c13d7.js';
2
- import React__default, { createContext, useMemo, useEffect, useRef, useState, useContext, useCallback, forwardRef, useImperativeHandle, memo, useLayoutEffect } from 'react';
3
- import { createStyles, Box, Button as Button$1, Input as Input$1, Autocomplete, clsx, Checkbox as Checkbox$1, Radio as Radio$1, Select as Select$1, TextInput, NumberInput as NumberInput$1, Portal, Transition, Overlay } from '@mantine/core';
1
+ import { a as __awaiter, _ as __rest } from './tslib.es6-885c1a36.js';
2
+ import React__default, { createContext, useMemo, useEffect, useRef, useState, useContext, memo, useCallback, forwardRef, useImperativeHandle, useLayoutEffect } from 'react';
3
+ import { createStyles, Box, Button as Button$1, Input as Input$1, Autocomplete, clsx, Checkbox as Checkbox$1, Radio as Radio$1, Select as Select$1, TextInput, NumberInput as NumberInput$1, Flex, Portal, Transition, Overlay } from '@mantine/core';
4
4
  import debounce from 'lodash/debounce';
5
5
  import { createFormContext, useForm } from '@mantine/form';
6
6
  import dayjs from 'dayjs';
7
- import { B as BEARER_TOKEN_COOKIE } from './index-a5586f87.js';
7
+ import { B as BEARER_TOKEN_COOKIE } from './index-08c6156a.js';
8
8
  import { getCookie, setCookie } from './miscCookieHelper.js';
9
- import { u as useTranslations } from './index-578f22ff.js';
10
- import { T as TranslationsContext } from './translationsContext-9f1f49da.js';
11
- import { M as MediaQueries, b as getWrapperDomWithSelector, a as getPopupWrapperDom } from './utils-19da5326.js';
12
- import { T as Text } from './index-0b307a4e.js';
13
- import { S as Select, d as Checkbox, I as Input, R as Radio, P as Phone, N as NumberInput, O as OTP } from './index-1a608269.js';
14
- import { D as DatePicker } from './index-e86bac18.js';
15
- import { B as Button } from './index-5893db57.js';
16
- import './index.styles-9fbd164a.js';
9
+ import { u as useTranslations } from './index-780f263f.js';
10
+ import { T as TranslationsContext } from './translationsContext-3814cd1a.js';
11
+ import { M as MediaQueries, b as getWrapperDomWithSelector, a as getPopupWrapperDom } from './utils-711e190d.js';
12
+ import { T as Text } from './index-612d1ed4.js';
13
+ import { S as Select, d as Checkbox, I as Input, R as Radio, P as Phone, N as NumberInput, O as OTP } from './index-758fe64b.js';
14
+ import { D as DatePicker } from './index-7b8af3a6.js';
15
+ import { B as Button } from './index-91b97596.js';
16
+ import './index.styles-30533b59.js';
17
17
  import { useIntersection, useClickOutside } from '@mantine/hooks';
18
- import './index-2d140c4c.js';
19
- import { C as CustomStylesType } from './text-59e76dd7.js';
20
- import './index-0ba82d61.js';
21
- import { M as MAPPED_LOCALE } from './utils-db5fa0f9.js';
18
+ import './index-e54ec864.js';
19
+ import { C as CustomStylesType, G as GlobalTextStyleNew } from './text-51330b00.js';
20
+ import './index-b842196b.js';
21
+ import { M as MAPPED_LOCALE } from './utils-30116154.js';
22
22
  import { DateInput } from '@mantine/dates';
23
- import { L as LOCALE_SPECS, Z as ZINDEX_SSO, I as ISO_FORMAT } from './index-49f04c19.js';
24
- import { C as COMMON_DATE_TRANSLATE_KEY } from './index-439bceaa.js';
25
- import './index-b50e5b6c.js';
26
- import { u as usePlacesAutocomplete, G as GOOGLE_API_KEY } from './usePlacesAutocomplete-e0383a78.js';
27
- import { H as Heading$1 } from './index-dbaf58de.js';
28
- import { t as translationsMap$1 } from './translationsProvider-5444daff.js';
29
- import { L as LOCALE } from './Locale-78dd91cd.js';
23
+ import { L as LOCALE_SPECS, Z as ZINDEX_SSO, I as ISO_FORMAT } from './index-15ed0b7b.js';
24
+ import { C as COMMON_DATE_TRANSLATE_KEY } from './index-f1bdaffc.js';
25
+ import './index-272df268.js';
26
+ import { u as usePlacesAutocomplete, G as GOOGLE_API_KEY } from './usePlacesAutocomplete-676f5608.js';
27
+ import { H as Heading$1 } from './index-99d7bc3c.js';
28
+ import { t as translationsMap$1 } from './translationsProvider-8d44b0d4.js';
29
+ import { L as LOCALE } from './Locale-d46afed9.js';
30
30
  import { v1 } from 'uuid';
31
31
  import { domainLocales } from './constantsDomainLocales.js';
32
32
  import { parsePhoneNumber } from 'react-phone-number-input';
33
33
  import styled from '@emotion/styled';
34
34
  import { theme } from './miscTheme.js';
35
35
  import { css } from '@emotion/react';
36
- import { T as TogetherComponentGlobalContext } from './utils-a220ec92.js';
37
- import { M as MantineProvider } from './index-d8a96ce6.js';
38
- import { i as isVideo } from './index-065bf7e9.js';
39
- import { u as useScreenSize } from './index-1dc41c9e.js';
36
+ import { T as TogetherComponentGlobalContext } from './utils-f82cec3f.js';
37
+ import { M as MantineProvider } from './index-bd5de9c1.js';
38
+ import { i as isVideo } from './index-1a32b73a.js';
39
+ import { u as useScreenSize } from './index-b5c4120c.js';
40
40
  import { motion } from 'framer-motion';
41
41
  import { createPortal } from 'react-dom';
42
- import { I as InputDate } from './InputDate-90201030.js';
43
- import { D as DrawerComponent } from './index-a1950224.js';
44
- import { C as Close } from './Close-c64d3014.js';
42
+ import { I as InputDate } from './InputDate-a3a92776.js';
43
+ import { D as DrawerComponent } from './index-f8de1f75.js';
44
+ import { C as Close } from './Close-e97c53f9.js';
45
45
  import './constantsIsProduction.js';
46
- import './normalizeLink-80a5acaf.js';
46
+ import './normalizeLink-7ddb8730.js';
47
47
  import '@hhgtech/icons/other';
48
48
  import '@mantine/carousel';
49
49
  import 'classnames';
50
- import './useUniqueId-345ebff3.js';
50
+ import './useUniqueId-5dd89792.js';
51
51
  import './constantsSite.js';
52
52
  import '@hhgtech/icons/core';
53
- import './shared-62c44d53.js';
53
+ import './shared-549ac603.js';
54
54
  import '@mantine/notifications';
55
55
  import 'date-fns/locale';
56
56
  import './constantsRiskScreener.js';
@@ -66,11 +66,11 @@ import './i18n-values/vi-VN.js';
66
66
  import './i18n-values/vi-VN_MB.js';
67
67
  import './i18n-values/zh-SG.js';
68
68
  import './i18n-values/zh-TW.js';
69
- import './index-84ae9504.js';
69
+ import './index-65f4ace5.js';
70
70
  import 'slugify';
71
71
  import 'string-format';
72
72
  import './togetherApiPaths.js';
73
- import './constants-9b35ad0b.js';
73
+ import './constants-275b93dd.js';
74
74
  import 'vaul';
75
75
 
76
76
  const LeadGenComponentContext = createContext({});
@@ -123,33 +123,6 @@ const LEADGEN_BLOCK_INPUT = [
123
123
  LEADGEN_BLOCK.CheckboxBlock,
124
124
  LEADGEN_BLOCK.TncBlock,
125
125
  ];
126
- const leadGenFieldNamePhone = (listBlockAdded) => {
127
- return listBlockAdded
128
- .filter(({ name }) => [
129
- LEADGEN_BLOCK.PhoneBlock,
130
- LEADGEN_BLOCK.PhoneOtpBlock,
131
- LEADGEN_BLOCK.WhatsappOtpBlock,
132
- LEADGEN_BLOCK.ZaloOtpBlock,
133
- ].includes(name))
134
- .map(({ data }) => data.value);
135
- };
136
- const leadGenFieldRequired = (blocks) => {
137
- if (!(blocks === null || blocks === void 0 ? void 0 : blocks.length)) {
138
- return [];
139
- }
140
- return blocks
141
- .map(({ data, name, id }) => {
142
- const { required, value } = data;
143
- if (name === LEADGEN_BLOCK.TncBlock && id && required) {
144
- return `TNC-${id}`;
145
- }
146
- if (required) {
147
- return value;
148
- }
149
- return;
150
- })
151
- .filter(Boolean);
152
- };
153
126
  const SSO_MAP_LEAD = ['name', 'email', 'birthday', 'phone', 'gender'];
154
127
  const LEAD_LOCALE_DATA$1 = {
155
128
  'vi-VN': {
@@ -232,6 +205,33 @@ const mappingSSOToLead = (userInfoProps) => {
232
205
  return;
233
206
  }
234
207
  };
208
+ const leadGenFieldNamePhone = (listBlockAdded) => {
209
+ return listBlockAdded
210
+ .filter(({ name }) => [
211
+ LEADGEN_BLOCK.PhoneBlock,
212
+ LEADGEN_BLOCK.PhoneOtpBlock,
213
+ LEADGEN_BLOCK.WhatsappOtpBlock,
214
+ LEADGEN_BLOCK.ZaloOtpBlock,
215
+ ].includes(name))
216
+ .map(({ data }) => data.value);
217
+ };
218
+ const leadGenFieldRequired = (blocks) => {
219
+ if (!(blocks === null || blocks === void 0 ? void 0 : blocks.length)) {
220
+ return [];
221
+ }
222
+ return blocks
223
+ .map(({ data, name, id }) => {
224
+ const { required, value } = data;
225
+ if (name === LEADGEN_BLOCK.TncBlock && id && required) {
226
+ return `TNC-${id}`;
227
+ }
228
+ if (required) {
229
+ return value;
230
+ }
231
+ return;
232
+ })
233
+ .filter(Boolean);
234
+ };
235
235
  const formatCampaignDetail = (campaign) => {
236
236
  if (!campaign) {
237
237
  return {};
@@ -378,6 +378,55 @@ const formatLeadGenFormValue = (values = {}, blocks) => {
378
378
  return newValues;
379
379
  };
380
380
 
381
+ const TIMEOUT = 30 * 60 * 1000;
382
+ const WAITING_FIRST_RESP = 'waitingTheFirstResponse';
383
+ const CachedSystem = {
384
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
385
+ cached: {},
386
+ clearCached: (prefix) => {
387
+ console.log(CachedSystem.cached);
388
+ Object.keys(CachedSystem.cached)
389
+ .filter((k) => k.startsWith(prefix))
390
+ .forEach((key) => {
391
+ console.log(key);
392
+ CachedSystem.cached[key] = undefined;
393
+ });
394
+ },
395
+ withCached: (key, fnResponse, timeout = TIMEOUT) => __awaiter(void 0, void 0, void 0, function* () {
396
+ if (CachedSystem.cached[key] === WAITING_FIRST_RESP) {
397
+ return new Promise((resolve) => {
398
+ const startDate = new Date().getTime();
399
+ const intervalId = setInterval(() => {
400
+ const currentDate = new Date().getTime();
401
+ if (currentDate - startDate > 3000) {
402
+ clearInterval(intervalId);
403
+ }
404
+ if (typeof CachedSystem.cached[key] === 'object') {
405
+ resolve(CachedSystem.cached[key]);
406
+ clearInterval(intervalId);
407
+ }
408
+ }, 100);
409
+ });
410
+ }
411
+ if (typeof CachedSystem.cached[key] === 'object') {
412
+ return CachedSystem.cached[key];
413
+ }
414
+ CachedSystem.cached[key] = 'waitingTheFirstResponse';
415
+ try {
416
+ const result = yield fnResponse();
417
+ CachedSystem.cached[key] = result;
418
+ setTimeout(() => {
419
+ CachedSystem.cached[key] = undefined;
420
+ }, timeout);
421
+ return result;
422
+ }
423
+ catch (err) {
424
+ CachedSystem.cached[key] = undefined;
425
+ return Promise.reject(err);
426
+ }
427
+ }),
428
+ };
429
+
381
430
  class Store {
382
431
  constructor() {
383
432
  this.apiSsoUrl = 'https://staging-id.hellobacsi.com/';
@@ -387,6 +436,8 @@ class Store {
387
436
  }
388
437
  const leadStore = new Store();
389
438
 
439
+ const LEADGEN_CACHE_KEY = 'LeadGen_';
440
+ const LEADGEN_CACHE_TIME = 5 * 60 * 1000; // 5 minutes
390
441
  const METHOD = {
391
442
  GET: 'get',
392
443
  POST: 'POST',
@@ -573,7 +624,19 @@ const trackingSubscription = (data) => {
573
624
  data,
574
625
  });
575
626
  };
627
+ function getCampaigns({ url, siteId, apiLeadUrl, }) {
628
+ const ga_client_id = getCookie('_ga') || null;
629
+ const AS_PATH = `${apiLeadUrl || leadStore.apiLeadUrl}api/campaign/${siteId}`;
630
+ return CachedSystem.withCached(LEADGEN_CACHE_KEY + AS_PATH, () => fetch(AS_PATH, {
631
+ method: 'POST',
632
+ headers: { 'Content-Type': 'application/json' },
633
+ body: JSON.stringify({ url, ga_client_id }),
634
+ })
635
+ .then((res) => res.json())
636
+ .then(({ _data }) => (_data === null || _data === void 0 ? void 0 : _data.campaigns) || []), LEADGEN_CACHE_TIME);
637
+ }
576
638
  const Service = {
639
+ getCampaigns,
577
640
  campaignGetById,
578
641
  getCampaignByCode,
579
642
  getSubscriptionBoxInfo,
@@ -1626,12 +1689,6 @@ const getTranslations = (locale) => {
1626
1689
  return translationsMap['en-PH'];
1627
1690
  };
1628
1691
 
1629
- const LeadGenTranslationProvider = (props) => {
1630
- const { locale, children } = props;
1631
- const translationContextValue = useMemo(() => ({ locale, values: getTranslations(locale) }), [locale]);
1632
- return (React__default.createElement(TranslationsContext.Provider, { value: translationContextValue }, children));
1633
- };
1634
-
1635
1692
  // import mockLeadData from './mockLeadData'
1636
1693
  const listCampaignScheduled = [];
1637
1694
  const listCampaignScheduledToActivated = [];
@@ -1807,167 +1864,167 @@ function clearPassiveEvent() {
1807
1864
  LEAD_SCROLL_EVENT = null;
1808
1865
  }
1809
1866
  }
1810
- function checkShowPopup({ leadApi, leadSiteId, leadDomain, onShowPopup, DEBUG_URL, }) {
1811
- // clear previous passive event, check for new condition
1812
- clearPassiveEvent();
1813
- const leadCurrentUrl = DEBUG_URL ||
1814
- ('https://' +
1815
- location.hostname +
1816
- location.pathname +
1817
- location.search).toLowerCase();
1818
- fetch(leadApi + 'api/campaign/' + leadSiteId, {
1819
- method: 'POST',
1820
- headers: {
1821
- 'Content-Type': 'application/json',
1822
- },
1823
- body: JSON.stringify({
1824
- url: leadCurrentUrl,
1825
- ga_client_id: getCookie('_ga') || null,
1826
- }),
1827
- })
1828
- .then((response) => {
1829
- return response.json();
1830
- // return mockLeadData || response.json()
1831
- })
1832
- .then((data) => {
1833
- var _a, _b, _c, _d;
1834
- LeadLog('List campagin: ', data);
1835
- LEAD_RESET_VAR();
1836
- if (data._status == 1) {
1837
- const campaigns = (((_b = (_a = data._data) === null || _a === void 0 ? void 0 : _a.campaigns) === null || _b === void 0 ? void 0 : _b.filter(filterFnCampaign)) || []).filter(fillterApprearanceTimeCampaign);
1838
- if (!getCookie('hhg-id')) {
1839
- setCookie('hhg-id', v1(), {
1840
- domain: '.' + leadDomain,
1841
- path: '/',
1842
- });
1843
- LeadLog('😍 Set HHG ID cookie');
1844
- }
1845
- // getCookie('hhg-id')
1846
- // TODO: HP-534 Filter desktop
1847
- let campaignsDevice = [];
1848
- if (isMobile()) {
1849
- campaignsDevice = campaigns.filter((c) => c.device_types.some((d) => d.id == LEAD_DEVICE_TYPE.MOBILE));
1867
+ function getCurrentCampaign({ campaigns = [], leadDomain, leadCurrentUrl, }) {
1868
+ if (!getCookie('hhg-id')) {
1869
+ setCookie('hhg-id', v1(), { domain: `.${leadDomain}`, path: '/' });
1870
+ LeadLog('😍 Set HHG ID cookie');
1871
+ }
1872
+ // TODO: HP-534 Filter desktop
1873
+ let campaignsDevice = [];
1874
+ if (isMobile()) {
1875
+ campaignsDevice = campaigns.filter((c) => c.device_types.some((d) => d.id == LEAD_DEVICE_TYPE.MOBILE));
1876
+ }
1877
+ else {
1878
+ campaignsDevice = campaigns.filter((c) => c.device_types.some((d) => d.id == LEAD_DEVICE_TYPE.DESKTOP));
1879
+ }
1880
+ LeadLog(`👓 campaignsDevice`, campaignsDevice);
1881
+ LeadLog('--listCampaignScheduled', listCampaignScheduled);
1882
+ LeadLog('--listCampaignScheduledToActivated', listCampaignScheduledToActivated);
1883
+ LeadLog('--listCampaignActiveButExpired', listCampaignActiveButExpired);
1884
+ LeadLog('--listCampaignExcludeSonsored', listCampaignExcludeSonsored);
1885
+ LeadLog('--listCampaignDifferentSponsor', listCampaignDifferentSponsor);
1886
+ LeadLog('--listCampaignNotDisplayInRangeOfTime', listCampaignNotDisplayInRangeOfTime);
1887
+ // Check links
1888
+ let listLinksObj = campaignsDevice
1889
+ .map((i, index) => i.targets
1890
+ .filter((i) => i.type == CAMPAIGN_TARGET_TYPE.LINKS)
1891
+ .map((i) => (Object.assign(Object.assign({}, i), { campaignIndex: index }))))
1892
+ .flat(1) || [];
1893
+ // Check list link match current href
1894
+ listLinksObj = listLinksObj.filter((i) => {
1895
+ var _a;
1896
+ const target = new URL(String(i.target).toLowerCase());
1897
+ if (i.option == 'exact_match')
1898
+ // FOR TEST LOCAL:
1899
+ // return Boolean(location.pathname === target.pathname)
1900
+ return Boolean(leadCurrentUrl === ((_a = target.href) === null || _a === void 0 ? void 0 : _a.toLowerCase()));
1901
+ if (i.option == 'start_with') {
1902
+ // FOR TEST LOCAL:
1903
+ // if (location.pathname.includes(target.pathname)) {
1904
+ if (leadCurrentUrl.includes(String(i.target).toLowerCase())) {
1905
+ const listExcluding = i.sub_target
1906
+ .filter((i) => i.option == 'excluding')
1907
+ .map((i) => { var _a; return (_a = i.value) === null || _a === void 0 ? void 0 : _a.toLowerCase(); });
1908
+ return !listExcluding.includes(leadCurrentUrl.split('?')[0]);
1850
1909
  }
1851
1910
  else {
1852
- campaignsDevice = campaigns.filter((c) => c.device_types.some((d) => d.id == LEAD_DEVICE_TYPE.DESKTOP));
1911
+ return false;
1853
1912
  }
1854
- LeadLog(`👓 campaignsDevice`, campaignsDevice);
1855
- LeadLog('--listCampaignScheduled', listCampaignScheduled);
1856
- LeadLog('--listCampaignScheduledToActivated', listCampaignScheduledToActivated);
1857
- LeadLog('--listCampaignActiveButExpired', listCampaignActiveButExpired);
1858
- LeadLog('--listCampaignExcludeSonsored', listCampaignExcludeSonsored);
1859
- LeadLog('--listCampaignDifferentSponsor', listCampaignDifferentSponsor);
1860
- LeadLog('--listCampaignNotDisplayInRangeOfTime', listCampaignNotDisplayInRangeOfTime);
1861
- // Check links
1862
- let listLinksObj = campaignsDevice
1863
- .map((i, index) => i.targets
1864
- .filter((i) => i.type == CAMPAIGN_TARGET_TYPE.LINKS)
1865
- .map((i) => (Object.assign(Object.assign({}, i), { campaignIndex: index }))))
1866
- .flat(1);
1867
- // Check list link match current href
1868
- listLinksObj = listLinksObj.filter((i) => {
1869
- var _a;
1870
- const target = new URL(String(i.target).toLowerCase());
1871
- if (i.option == 'exact_match')
1872
- // FOR TEST LOCAL:
1873
- // return Boolean(location.pathname === target.pathname)
1874
- return Boolean(leadCurrentUrl === ((_a = target.href) === null || _a === void 0 ? void 0 : _a.toLowerCase()));
1875
- if (i.option == 'start_with') {
1876
- // FOR TEST LOCAL:
1877
- // if (location.pathname.includes(target.pathname)) {
1878
- if (leadCurrentUrl.includes(String(i.target).toLowerCase())) {
1879
- const listExcluding = i.sub_target
1880
- .filter((i) => i.option == 'excluding')
1881
- .map((i) => { var _a; return (_a = i.value) === null || _a === void 0 ? void 0 : _a.toLowerCase(); });
1882
- return !listExcluding.includes(leadCurrentUrl.split('?')[0]);
1883
- }
1884
- else {
1885
- return false;
1886
- }
1887
- }
1888
- });
1889
- // Check tags
1890
- const listMetaTag = Array.from(document.getElementsByTagName('META')).filter((i) => i.getAttribute('property') == 'article:tag');
1891
- const listTags = listMetaTag.map((i) => i.content);
1892
- let listCampaignHasTag = [];
1893
- let listTagsObj = [];
1894
- if (listTags && listTags.length) {
1895
- listCampaignHasTag = campaignsDevice
1896
- .map((i, index) => i.targets
1897
- .filter((i) => i.type == CAMPAIGN_TARGET_TYPE.TAGS)
1898
- .map((i) => (Object.assign(Object.assign({}, i), { campaignIndex: index }))))
1899
- .flat(1);
1900
- listTagsObj = listCampaignHasTag.filter((i) => listTags.includes(i.target));
1901
- }
1902
- const listCampaginsMatch = [...listLinksObj, ...listTagsObj];
1903
- const cookieKeys = document.cookie
1904
- .split('; ')
1905
- .map((i) => i.split('=')[0]);
1906
- const listCampaignCodeSubmited = cookieKeys.filter((i) => i.includes('lead_submited'));
1907
- LeadLog(`--listCampaignCodeSubmited`, listCampaignCodeSubmited);
1908
- const listCampaignCodeClosed = cookieKeys.filter((i) => i.includes('lead_closed'));
1909
- LeadLog(`--listCampaignCodeClosed`, listCampaignCodeClosed);
1910
- const listCampaignSubmitedClosed = [
1911
- ...listCampaignCodeSubmited,
1912
- ...listCampaignCodeClosed,
1913
- ];
1914
- const listCampaignNoSubmitedClosed = listCampaginsMatch.filter((i) => {
1915
- const hasSubmited = listCampaignSubmitedClosed.some((k) => k.includes(campaignsDevice[i.campaignIndex].code));
1916
- return !hasSubmited;
1917
- });
1918
- const listCampaignValid = getShuffleArray(listCampaignNoSubmitedClosed);
1919
- // .sort(
1920
- // (a, b) =>
1921
- // (listCampaignValid[a.campaignIndex]?.score || 0) -
1922
- // (listCampaignValid[b.campaignIndex]?.score || 0),
1923
- // )
1924
- LeadLog('--listCampaignValid : ', listCampaignValid);
1925
- if (listCampaignValid && listCampaignValid.length) {
1926
- const CAMPAIGN_SHOW = campaignsDevice[listCampaignValid[0].campaignIndex];
1927
- LeadLog(`CAMPAIGN_SHOW`, CAMPAIGN_SHOW);
1928
- const { rules } = CAMPAIGN_SHOW;
1929
- // CHECK RULE TRIGGER POPUP
1930
- const timeoutRule = Number((_c = rules.find((i) => i.rule == 'time')) === null || _c === void 0 ? void 0 : _c.value);
1931
- LeadLog(`timeoutRule`, timeoutRule);
1932
- const scrollRule = Number((_d = rules.find((i) => i.rule == 'scroll')) === null || _d === void 0 ? void 0 : _d.value);
1933
- LeadLog(`scrollRule`, scrollRule);
1934
- let impressionAction = 'TIME';
1935
- if (Number.isInteger(timeoutRule)) {
1936
- impressionAction = 'TIME';
1937
- LeadLog('✨ SHOW AWESOME POPUP AFTER: ', timeoutRule, ' seconds');
1938
- timeoutRef = setTimeout(() => {
1939
- onShowPopup === null || onShowPopup === void 0 ? void 0 : onShowPopup(CAMPAIGN_SHOW, impressionAction);
1940
- }, timeoutRule * 1000);
1941
- }
1942
- if (Number.isInteger(scrollRule)) {
1943
- impressionAction = 'SCROLL';
1944
- LeadLog('✨ SHOW AWESOME AFTER: SCROLL', scrollRule, ' %');
1945
- const $p = document.querySelector(`[data-url="${location.pathname}"]`) ||
1946
- document.querySelector('body');
1947
- const pct = $p.getBoundingClientRect().top;
1948
- const pb = $p.offsetHeight;
1949
- LeadLog(`👓 Element check scroll: `, $p);
1950
- LEAD_SCROLL_EVENT = function leadScollCheckHandler() {
1951
- const wt = window.pageYOffset || document.documentElement.scrollTop;
1952
- let percent = 0;
1953
- if (wt >= pct) {
1954
- percent = Math.round(((wt - pct) / (pb - innerHeight)) * 100);
1955
- }
1956
- LeadLog('---Scroll', percent, scrollRule);
1957
- // TODO: CHECK FOOTER HEIGHT
1958
- if (percent >= scrollRule) {
1959
- window.removeEventListener('scroll', LEAD_SCROLL_EVENT);
1960
- onShowPopup === null || onShowPopup === void 0 ? void 0 : onShowPopup(CAMPAIGN_SHOW, impressionAction);
1961
- }
1962
- };
1963
- window.addEventListener('scroll', LEAD_SCROLL_EVENT, {
1964
- passive: true,
1965
- });
1966
- }
1913
+ }
1914
+ });
1915
+ // Check tags
1916
+ const listMetaTag = Array.from(document.getElementsByTagName('META')).filter((i) => i.getAttribute('property') == 'article:tag');
1917
+ const listTags = listMetaTag.map((i) => i.content);
1918
+ let listCampaignHasTag = [];
1919
+ let listTagsObj = [];
1920
+ if (listTags && listTags.length) {
1921
+ listCampaignHasTag = campaignsDevice
1922
+ .map((i, index) => i.targets
1923
+ .filter((i) => i.type == CAMPAIGN_TARGET_TYPE.TAGS)
1924
+ .map((i) => (Object.assign(Object.assign({}, i), { campaignIndex: index }))))
1925
+ .flat(1);
1926
+ listTagsObj = listCampaignHasTag.filter((i) => listTags.includes(i.target));
1927
+ }
1928
+ const listCampaginsMatch = [...listLinksObj, ...listTagsObj];
1929
+ const cookieKeys = document.cookie.split('; ').map((i) => i.split('=')[0]);
1930
+ const listCampaignCodeSubmited = cookieKeys.filter((i) => i.includes('lead_submited'));
1931
+ LeadLog(`--listCampaignCodeSubmited`, listCampaignCodeSubmited);
1932
+ const listCampaignCodeClosed = cookieKeys.filter((i) => i.includes('lead_closed'));
1933
+ LeadLog(`--listCampaignCodeClosed`, listCampaignCodeClosed);
1934
+ const listCampaignSubmitedClosed = [
1935
+ ...listCampaignCodeSubmited,
1936
+ ...listCampaignCodeClosed,
1937
+ ];
1938
+ const listCampaignNoSubmitedClosed = listCampaginsMatch.filter((i) => {
1939
+ const hasSubmited = listCampaignSubmitedClosed.some((k) => k.includes(campaignsDevice[i.campaignIndex].code));
1940
+ return !hasSubmited;
1941
+ });
1942
+ const listCampaignValid = getShuffleArray(listCampaignNoSubmitedClosed);
1943
+ // .sort(
1944
+ // (a, b) =>
1945
+ // (listCampaignValid[a.campaignIndex]?.score || 0) -
1946
+ // (listCampaignValid[b.campaignIndex]?.score || 0),
1947
+ // )
1948
+ LeadLog('--listCampaignValid : ', listCampaignValid);
1949
+ if (listCampaignValid && listCampaignValid.length) {
1950
+ const CAMPAIGN_SHOW = campaignsDevice[listCampaignValid[0].campaignIndex];
1951
+ return CAMPAIGN_SHOW;
1952
+ }
1953
+ else {
1954
+ LeadLog('🚧 No lead campaigns on current URL, tags');
1955
+ return null;
1956
+ }
1957
+ }
1958
+ function addEventShowCurrentCampaign({ campaign: CAMPAIGN_SHOW, onShowPopup, }) {
1959
+ var _a, _b;
1960
+ LeadLog(`CAMPAIGN_SHOW`, CAMPAIGN_SHOW);
1961
+ const { rules } = CAMPAIGN_SHOW;
1962
+ // CHECK RULE TRIGGER POPUP
1963
+ const timeoutRule = Number((_a = rules.find((i) => i.rule == 'time')) === null || _a === void 0 ? void 0 : _a.value);
1964
+ LeadLog(`timeoutRule`, timeoutRule);
1965
+ const scrollRule = Number((_b = rules.find((i) => i.rule == 'scroll')) === null || _b === void 0 ? void 0 : _b.value);
1966
+ LeadLog(`scrollRule`, scrollRule);
1967
+ let impressionAction = 'TIME';
1968
+ if (Number.isInteger(timeoutRule)) {
1969
+ impressionAction = 'TIME';
1970
+ LeadLog('✨ SHOW AWESOME POPUP AFTER: ', timeoutRule, ' seconds');
1971
+ timeoutRef = setTimeout(() => {
1972
+ onShowPopup === null || onShowPopup === void 0 ? void 0 : onShowPopup(CAMPAIGN_SHOW, impressionAction);
1973
+ }, timeoutRule * 1000);
1974
+ return { campaign: CAMPAIGN_SHOW, action: impressionAction };
1975
+ }
1976
+ if (Number.isInteger(scrollRule)) {
1977
+ impressionAction = 'SCROLL';
1978
+ LeadLog('✨ SHOW AWESOME AFTER: SCROLL', scrollRule, ' %');
1979
+ const $p = document.querySelector(`[data-url="${location.pathname}"]`) ||
1980
+ document.querySelector('body');
1981
+ const pct = $p.getBoundingClientRect().top;
1982
+ const pb = $p.offsetHeight;
1983
+ LeadLog(`👓 Element check scroll: `, $p);
1984
+ LEAD_SCROLL_EVENT = function leadScollCheckHandler() {
1985
+ const wt = window.pageYOffset || document.documentElement.scrollTop;
1986
+ let percent = 0;
1987
+ if (wt >= pct) {
1988
+ percent = Math.round(((wt - pct) / (pb - innerHeight)) * 100);
1967
1989
  }
1968
- else {
1969
- LeadLog('🚧 No lead campaigns on current URL, tags');
1990
+ LeadLog('---Scroll', percent, scrollRule);
1991
+ // TODO: CHECK FOOTER HEIGHT
1992
+ if (percent >= scrollRule) {
1993
+ window.removeEventListener('scroll', LEAD_SCROLL_EVENT);
1994
+ onShowPopup === null || onShowPopup === void 0 ? void 0 : onShowPopup(CAMPAIGN_SHOW, impressionAction);
1970
1995
  }
1996
+ };
1997
+ window.addEventListener('scroll', LEAD_SCROLL_EVENT, {
1998
+ passive: true,
1999
+ });
2000
+ }
2001
+ }
2002
+ function checkShowPopup({ leadApi, leadSiteId, leadDomain, onShowPopup, DEBUG_URL, }) {
2003
+ // clear previous passive event, check for new condition
2004
+ clearPassiveEvent();
2005
+ let leadCurrentUrl = DEBUG_URL;
2006
+ if (typeof window !== 'undefined') {
2007
+ const { location } = window;
2008
+ leadCurrentUrl = leadCurrentUrl || location.href.toLowerCase();
2009
+ }
2010
+ Service.getCampaigns({
2011
+ url: leadCurrentUrl,
2012
+ siteId: leadSiteId,
2013
+ apiLeadUrl: leadApi,
2014
+ })
2015
+ .then((campRes) => {
2016
+ LeadLog('List campagin: ', campRes);
2017
+ LEAD_RESET_VAR();
2018
+ const campaigns = (campRes || [])
2019
+ .filter(filterFnCampaign)
2020
+ .filter(fillterApprearanceTimeCampaign);
2021
+ const campaign = getCurrentCampaign({
2022
+ campaigns,
2023
+ leadCurrentUrl,
2024
+ leadDomain,
2025
+ });
2026
+ if (campaign && (campaign === null || campaign === void 0 ? void 0 : campaign.id)) {
2027
+ addEventShowCurrentCampaign({ campaign, onShowPopup });
1971
2028
  }
1972
2029
  })
1973
2030
  .catch((err) => {
@@ -1984,147 +2041,149 @@ const LeadLog = (...params) => {
1984
2041
  }
1985
2042
  };
1986
2043
 
2044
+ const LeadGenInlineWithoutMemo = (props) => {
2045
+ const [campaign, setCampaign] = useState();
2046
+ const { forceCampaign, apiUrl, apiLeadUrl, siteId, siteDomain, DEBUG_URL } = props;
2047
+ useEffect(() => {
2048
+ if (forceCampaign) {
2049
+ setCampaign(forceCampaign);
2050
+ return;
2051
+ }
2052
+ (() => __awaiter(void 0, void 0, void 0, function* () {
2053
+ const campaign = yield leadGenInlineGetCampaign({
2054
+ siteId,
2055
+ siteDomain,
2056
+ apiLeadUrl: apiUrl || apiLeadUrl || '',
2057
+ url: DEBUG_URL,
2058
+ });
2059
+ if (campaign) {
2060
+ setCampaign(campaign);
2061
+ }
2062
+ }))();
2063
+ }, [forceCampaign, DEBUG_URL, apiUrl, apiLeadUrl, siteId, siteDomain]);
2064
+ if (!campaign || !(campaign === null || campaign === void 0 ? void 0 : campaign.id)) {
2065
+ return null;
2066
+ }
2067
+ return (React__default.createElement(LeadGen, Object.assign({}, props, { forceCampaign: campaign, apiUrl: apiUrl || apiLeadUrl, flatComponent: true })));
2068
+ };
2069
+ const LeadGenInline = memo(LeadGenInlineWithoutMemo);
2070
+ function leadGenInlineGetCampaign(props) {
2071
+ var _a;
2072
+ return __awaiter(this, void 0, void 0, function* () {
2073
+ const { url, apiLeadUrl, siteId, siteDomain } = props;
2074
+ const campaigns = yield Service.getCampaigns({ url, apiLeadUrl, siteId });
2075
+ const campaignsInline = (_a = (campaigns || [])) === null || _a === void 0 ? void 0 : _a.filter(({ extra_fields }) => {
2076
+ const { currentLayout } = extra_fields || {};
2077
+ return currentLayout === null || currentLayout === void 0 ? void 0 : currentLayout.includes('Inline');
2078
+ });
2079
+ return getCurrentCampaign({
2080
+ campaigns: campaignsInline,
2081
+ leadCurrentUrl: url,
2082
+ leadDomain: siteDomain,
2083
+ });
2084
+ });
2085
+ }
2086
+
2087
+ const LeadGenTranslationProvider = (props) => {
2088
+ const { locale, children } = props;
2089
+ const translationContextValue = useMemo(() => ({ locale, values: getTranslations(locale) }), [locale]);
2090
+ return (React__default.createElement(TranslationsContext.Provider, { value: translationContextValue }, children));
2091
+ };
2092
+
1987
2093
  const LeadGenContext = createContext({
1988
- submit(value) {
2094
+ onSubmit(value) {
1989
2095
  /** Init for FAKING function */
1990
2096
  LeadLog('** LeadGen Submit : ', value);
1991
2097
  return Promise.reject(value);
1992
2098
  },
1993
- submitSubscriptionBox(value) {
2099
+ onImpression(value) {
1994
2100
  /** Init for FAKING function */
1995
- LeadLog('** LeadGen SubmitSubscriptionBox : ', value);
1996
- return Promise.reject(value);
1997
- },
1998
- impression(type) {
1999
- /** Init for FAKING function */
2000
- LeadLog('** LeadGen Impression : ', type);
2101
+ LeadLog('** LeadGen Impression : ', value);
2001
2102
  return Promise.reject();
2002
2103
  },
2003
- /** For Subscription Box */
2004
- subscriptionIcon: '',
2005
- subscriptionTitle: '',
2006
- subscriptionPhoneType: '',
2007
2104
  });
2008
2105
  const LeadGenContextProvider = (props) => {
2009
- const { campaign_code: campaignCodeProps, apiSsoUrl, apiLeadUrl, apiSubotUrl, locale: localeProps, forceCampaign: forceCampaignProps, extraValues, articleId = 1, categoryList, siteDomain: site_domain, children, userInfo } = props, restProps = __rest(props, ["campaign_code", "apiSsoUrl", "apiLeadUrl", "apiSubotUrl", "locale", "forceCampaign", "extraValues", "articleId", "categoryList", "siteDomain", "children", "userInfo"]);
2106
+ const { campaign_code: campaignCodeProps, apiSsoUrl, apiLeadUrl, apiSubotUrl, locale: localeProps, forceCampaign: forceCampaignProps, extraValues, siteId, siteDomain, DEBUG_URL = '', children, articleId, categoryId, userInfo } = props, restProps = __rest(props, ["campaign_code", "apiSsoUrl", "apiLeadUrl", "apiSubotUrl", "locale", "forceCampaign", "extraValues", "siteId", "siteDomain", "DEBUG_URL", "children", "articleId", "categoryId", "userInfo"]);
2010
2107
  const { t } = useTranslations();
2011
- const [forceCampaign, setForceCampaign] = useState(forceCampaignProps);
2108
+ const [rawForceCampaign, setRawForceCampaign] = useState(forceCampaignProps);
2109
+ const [forceCampaign, setForceCampaign] = useState(() => formatCampaignDetail(forceCampaignProps));
2012
2110
  const [subscriptionInfo, setSubscriptionInfo] = useState({
2013
2111
  subscriptionIcon: '',
2014
2112
  subscriptionTitle: '',
2015
2113
  subscriptionType: 'TypeA',
2016
2114
  subscriptionPhoneType: '',
2017
- subcriptionCateId: '',
2018
- subcriptionCateName: '',
2019
2115
  });
2020
2116
  const locale = useMemo(() => {
2021
2117
  return localeProps || LOCALE['PhilippinesEnglish'];
2022
2118
  }, [localeProps]);
2023
- const { url, campaign_id, cookie_id, ga_client_id, category_list, article_id, article_title, } = useMemo(() => ({
2024
- url: location.href.toLowerCase() || '',
2025
- cookie_id: getCookie('hhg-id') || null,
2026
- ga_client_id: getCookie('_ga'),
2027
- campaign_id: forceCampaign === null || forceCampaign === void 0 ? void 0 : forceCampaign.id,
2028
- campaign_code: campaignCodeProps || (forceCampaign === null || forceCampaign === void 0 ? void 0 : forceCampaign.code),
2029
- category_list: categoryList,
2030
- article_id: articleId,
2031
- article_title: (extraValues === null || extraValues === void 0 ? void 0 : extraValues.article_title) || document.title || '',
2032
- }), [
2033
- campaignCodeProps,
2034
- articleId,
2035
- categoryList,
2036
- forceCampaign === null || forceCampaign === void 0 ? void 0 : forceCampaign.id,
2037
- extraValues === null || extraValues === void 0 ? void 0 : extraValues.article_title,
2038
- subscriptionInfo === null || subscriptionInfo === void 0 ? void 0 : subscriptionInfo.subcriptionCateName,
2039
- ]);
2040
- // const fetchCampaign = useCallback(
2041
- // (campaign_code: string) => {
2042
- // Service.getCampaignByCode(campaign_code).then((res) => {
2043
- // const { _data } = res || {}
2044
- // const { campaigns } = _data || {}
2045
- // LeadLog('** LeadGen Campaign : ', campaigns)
2046
- // setForceCampaign(formatCampaignDetail(campaigns))
2047
- // })
2048
- // },
2049
- // [campaignCodeProps],
2050
- // )
2051
2119
  // TODO : Update form for LeadGen
2052
- const submit = useCallback((data) => {
2120
+ const onSubmit = useCallback((data) => {
2053
2121
  return Service.postSubscriptionBoxLead({ data });
2122
+ }, [forceCampaign === null || forceCampaign === void 0 ? void 0 : forceCampaign.blocks]);
2123
+ const onImpression = useCallback((value) => {
2124
+ //
2125
+ console.log('** RYAN LeadGenContext.tsx 188 value : ', value);
2126
+ return Promise.resolve('dfdfdf');
2054
2127
  }, []);
2055
2128
  const submitSubscriptionBox = useCallback((value) => {
2056
- const data = Object.assign(Object.assign({}, value), {
2129
+ const data = Object.assign(Object.assign(Object.assign(Object.assign({}, value), {
2057
2130
  // campaign_id,
2058
- site_domain, url: (value === null || value === void 0 ? void 0 : value.url) || url, cookie_id, ga_client_id: (value === null || value === void 0 ? void 0 : value.ga_client_id) || ga_client_id,
2059
- // ...extraValues,
2060
- article_id, category_id: subscriptionInfo.subcriptionCateId, category_name: subscriptionInfo.subcriptionCateName, article_title });
2131
+ site_domain: siteDomain, url: (value === null || value === void 0 ? void 0 : value.url) || location.href.toLowerCase() || '', cookie_id: getCookie('hhg-id') || null, ga_client_id: getCookie('_ga') }), extraValues), { article_id: articleId, category_id: categoryId, article_title: (extraValues === null || extraValues === void 0 ? void 0 : extraValues.article_title) || document.title || '' });
2061
2132
  return Service.postSubscriptionBoxLead({ data });
2062
2133
  }, [
2063
2134
  extraValues,
2064
- site_domain,
2065
- campaign_id,
2066
- article_id,
2067
- article_title,
2068
- subscriptionInfo.subcriptionCateId,
2069
- subscriptionInfo.subcriptionCateName,
2070
- url,
2071
- cookie_id,
2072
- ga_client_id,
2135
+ extraValues === null || extraValues === void 0 ? void 0 : extraValues.article_title,
2136
+ siteDomain,
2137
+ articleId,
2138
+ categoryId,
2073
2139
  ]);
2074
- const impression = useCallback((type) => {
2075
- const gaCookie = getCookie('_ga') || null;
2140
+ const impressionSubscriptionBox = useCallback((type) => {
2076
2141
  const impression = {
2077
2142
  subscription_title: subscriptionInfo.subscriptionTitle,
2078
2143
  name: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.name) || '',
2079
2144
  area_code: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.area_code) || '',
2080
2145
  phone_number: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.phone) || '',
2081
- site_domain: domainLocales[locale],
2146
+ site_domain: siteDomain,
2082
2147
  url: location.href.toLowerCase(),
2083
2148
  cookie_id: getCookie('hhg-id'),
2084
- ga_client_id: gaCookie,
2085
- article_title,
2086
- article_id,
2087
- category_id: subscriptionInfo.subcriptionCateId,
2088
- category_name: subscriptionInfo.subcriptionCateName,
2149
+ ga_client_id: getCookie('_ga') || null,
2150
+ article_title: (extraValues === null || extraValues === void 0 ? void 0 : extraValues.article_title) || document.title || '',
2151
+ article_id: articleId,
2152
+ category_id: categoryId,
2153
+ category_name: (extraValues === null || extraValues === void 0 ? void 0 : extraValues.category_name) || '',
2089
2154
  type,
2090
2155
  };
2091
2156
  return Service.trackingSubscription(impression);
2092
2157
  }, [
2093
- campaign_id,
2094
- url,
2095
- article_title,
2096
- cookie_id,
2097
- ga_client_id,
2098
- subscriptionInfo.subcriptionCateId,
2099
- subscriptionInfo.subcriptionCateName,
2158
+ articleId,
2159
+ categoryId,
2100
2160
  subscriptionInfo.subscriptionTitle,
2101
- article_id,
2161
+ extraValues === null || extraValues === void 0 ? void 0 : extraValues.category_name,
2102
2162
  userInfo === null || userInfo === void 0 ? void 0 : userInfo.name,
2103
2163
  userInfo === null || userInfo === void 0 ? void 0 : userInfo.area_code,
2104
2164
  userInfo === null || userInfo === void 0 ? void 0 : userInfo.phone,
2105
2165
  ]);
2106
2166
  useEffect(() => {
2167
+ /** Force Campaign */
2107
2168
  if (forceCampaignProps) {
2108
2169
  setForceCampaign(formatCampaignDetail(forceCampaignProps));
2170
+ setRawForceCampaign(forceCampaignProps);
2109
2171
  return;
2110
2172
  }
2111
2173
  /** For Subscription Box */
2112
- if (category_list) {
2174
+ if (categoryId) {
2113
2175
  Service.getSubscriptionBoxInfo({
2114
- category: category_list.map((i) => i.termId).join(','),
2115
- site: site_domain,
2176
+ category: categoryId,
2177
+ site: siteDomain,
2116
2178
  slug: location === null || location === void 0 ? void 0 : location.pathname,
2117
2179
  }).then((res) => {
2118
- var _a;
2119
2180
  const { _data } = res || {};
2120
- const { item = [], btn_type = 'zalo' } = _data || {};
2121
- const { icon, content, cate_id } = ((_a = item.filter((i) => i.cate_id !== 'default')) === null || _a === void 0 ? void 0 : _a[0]) || {};
2181
+ const { item, campaign_code, btn_type = 'zalo' } = _data || {};
2182
+ const { icon, content } = item || {};
2183
+ LeadLog('** LeadGen SubscriptionBox campaign_code : ', campaign_code);
2122
2184
  LeadLog('** LeadGen SubscriptionBox subscription_icon : ', icon);
2123
2185
  LeadLog('** LeadGen SubscriptionBox subscription_title : ', content);
2124
- setSubscriptionInfo((prev) => {
2125
- var _a, _b;
2126
- return (Object.assign(Object.assign({}, prev), { subscriptionIcon: icon, subscriptionTitle: content, subscriptionPhoneType: btn_type, subcriptionCateId: cate_id, subcriptionCateName: (_b = (_a = category_list.filter((i) => i.termId == cate_id)) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.name }));
2127
- });
2186
+ setSubscriptionInfo((prev) => (Object.assign(Object.assign({}, prev), { subscriptionIcon: icon, subscriptionTitle: content, subscriptionPhoneType: btn_type })));
2128
2187
  setForceCampaign(formatCampaignDetail({
2129
2188
  id: 6993,
2130
2189
  name: '',
@@ -2248,10 +2307,39 @@ const LeadGenContextProvider = (props) => {
2248
2307
  });
2249
2308
  return;
2250
2309
  }
2251
- // if (campaignCodeProps) {
2252
- // fetchCampaign(campaignCodeProps)
2310
+ if (campaignCodeProps) {
2311
+ Service.getCampaignByCode(campaignCodeProps).then((res) => {
2312
+ const { _data } = res || {};
2313
+ const { campaigns } = _data || {};
2314
+ LeadLog('** LeadGen Campaign : ', campaigns);
2315
+ setForceCampaign(formatCampaignDetail(campaigns));
2316
+ setRawForceCampaign(campaigns);
2317
+ });
2318
+ return;
2319
+ }
2320
+ // /** For LeadGen */
2321
+ // if (!leadStore.campaigns?.length) {
2322
+ // checkShowPopup({
2323
+ // leadApi: apiLeadUrl,
2324
+ // leadDomain: siteDomain,
2325
+ // leadSiteId: siteId,
2326
+ // onShowPopup(campaign: any, action: string) {
2327
+ // console.log('** RYAN LeadGenContext.tsx 421 action : ', action)
2328
+ // setForceCampaign(formatCampaignDetail(campaign))
2329
+ // setRawForceCampaign(campaign)
2330
+ // },
2331
+ // DEBUG_URL,
2332
+ // })
2253
2333
  // }
2254
- }, [forceCampaignProps, campaignCodeProps, category_list]);
2334
+ }, [
2335
+ forceCampaignProps,
2336
+ campaignCodeProps,
2337
+ categoryId,
2338
+ siteId,
2339
+ siteDomain,
2340
+ apiLeadUrl,
2341
+ DEBUG_URL,
2342
+ ]);
2255
2343
  useEffect(() => {
2256
2344
  leadStore.apiSsoUrl = apiSsoUrl;
2257
2345
  leadStore.apiLeadUrl = apiLeadUrl;
@@ -2262,10 +2350,16 @@ const LeadGenContextProvider = (props) => {
2262
2350
  }
2263
2351
  return (React__default.createElement(LeadGenContext.Provider, { value: Object.assign(Object.assign(Object.assign({}, restProps), subscriptionInfo), { userInfo, campaign_code: campaignCodeProps, apiSsoUrl,
2264
2352
  apiLeadUrl,
2265
- apiSubotUrl, locale: localeProps, articleId, categoryId: subscriptionInfo.subcriptionCateId, siteDomain: site_domain, forceCampaign,
2266
- submit,
2353
+ apiSubotUrl, locale: localeProps, extraValues,
2354
+ articleId,
2355
+ categoryId,
2356
+ siteDomain,
2357
+ forceCampaign,
2358
+ rawForceCampaign,
2359
+ onSubmit,
2360
+ onImpression,
2267
2361
  submitSubscriptionBox,
2268
- impression }) },
2362
+ impressionSubscriptionBox }) },
2269
2363
  React__default.createElement(LeadGenTranslationProvider, { locale: locale }, children)));
2270
2364
  };
2271
2365
  const useLeadGenContext = () => {
@@ -2853,7 +2947,7 @@ const cssWrapperInputNotShrink$1 = css `
2853
2947
  const cssWrapperInputShrink$1 = css `
2854
2948
  height: auto;
2855
2949
  min-height: var(--container-height, 56px);
2856
- padding-block: var(--space-y-shrink, 7px);
2950
+ padding-block: var(--space-y-shrink, 6px);
2857
2951
  cursor: text;
2858
2952
  pointer-events: auto;
2859
2953
  `;
@@ -2865,7 +2959,7 @@ const cssInputWrapperError$1 = css `
2865
2959
  const StyledTextFieldContainer$1 = styled.div `
2866
2960
  --space-x: 16px;
2867
2961
  --space-y-not-shrink: 15px;
2868
- --space-y-shrink: 7px;
2962
+ --space-y-shrink: 6px;
2869
2963
  --container-height: 56px;
2870
2964
  --label-not-shrink: 16px;
2871
2965
  --label-shrink: 12px;
@@ -3278,7 +3372,7 @@ const LeadGenSubscriptionBoxWithoutMemo = ({ locale, userInfo, forceCampaign, ca
3278
3372
  const { image, extra_fields, id: campaign_id, bot_id: campaign_subot_id = [], ThankYouBlock, } = forceCampaign || {};
3279
3373
  const { textBlocks, listBlockAdded, actionBlocks } = extra_fields || {};
3280
3374
  const { submitBlock } = actionBlocks || {};
3281
- const { apiLeadUrl, subscriptionIcon, subscriptionTitle, subscriptionPhoneType, submitSubscriptionBox, onFinish, impression, } = useLeadGenContext();
3375
+ const { apiLeadUrl, subscriptionIcon, subscriptionTitle, subscriptionPhoneType, submitSubscriptionBox, onFinish, impressionSubscriptionBox, } = useLeadGenContext();
3282
3376
  const { t } = useTranslations();
3283
3377
  const { action: { pushNotifications }, } = useContext(TogetherComponentGlobalContext);
3284
3378
  const [loading, setLoading] = useState(false);
@@ -3338,7 +3432,7 @@ const LeadGenSubscriptionBoxWithoutMemo = ({ locale, userInfo, forceCampaign, ca
3338
3432
  const reqValues = Object.assign(Object.assign({}, newValues), ssoValues);
3339
3433
  const [res] = yield Promise.all([
3340
3434
  submitSubscriptionBox(reqValues),
3341
- impression('submit_form'),
3435
+ impressionSubscriptionBox('submit_form'),
3342
3436
  ]);
3343
3437
  const { _data } = res || {};
3344
3438
  const { model } = _data || {};
@@ -3384,7 +3478,7 @@ const LeadGenSubscriptionBoxWithoutMemo = ({ locale, userInfo, forceCampaign, ca
3384
3478
  userInfo === null || userInfo === void 0 ? void 0 : userInfo.uid,
3385
3479
  userInfo === null || userInfo === void 0 ? void 0 : userInfo.phone,
3386
3480
  ]);
3387
- return (React__default.createElement(ImpressionTrackingWrapper, { dependency: categoryId, onImpression: () => impression('impression') },
3481
+ return (React__default.createElement(ImpressionTrackingWrapper, { dependency: categoryId, onImpression: () => impressionSubscriptionBox('impression') },
3388
3482
  React__default.createElement(StyledLeadGenSubscriptionBox, { "data-phone-type": subscriptionPhoneType, "data-type": "subscription_box_A" },
3389
3483
  showThankyou && (React__default.createElement(LeadGenThankYou, { image: Object.assign(Object.assign({}, thankyouImage), { src: thankyouImage.src || `${apiLeadUrl}admin/img/thanksyou.png` }), title: thankyouTitle, description: thankyouDescription, button: thankyouButton })),
3390
3484
  !showThankyou && (React__default.createElement(LeadGenSubscriptionBoxA, { loading: loading, image: subscriptionIcon || image, title: subscription_title, submitText: (_c = submitBlock === null || submitBlock === void 0 ? void 0 : submitBlock.data) === null || _c === void 0 ? void 0 : _c.value, blocks: listBlockAdded, locale: locale, form: form, rules: validateObj, onFinish: middlewareOnSubmit })))));
@@ -3393,8 +3487,11 @@ const LeadGenSubscriptionBox$1 = memo(LeadGenSubscriptionBoxWithoutMemo);
3393
3487
 
3394
3488
  const Container = () => {
3395
3489
  const context = useContext(LeadGenContext);
3396
- const { campaign_code, locale, siteId, siteDomain, userInfo, forceCampaign, subscriptionTitle, } = context;
3397
- return subscriptionTitle ? (React__default.createElement(LeadGenSubscriptionBox$1, { locale: locale, siteId: siteId, siteDomain: siteDomain, userInfo: userInfo, forceCampaign: forceCampaign, campaign_code: campaign_code })) : null;
3490
+ const { campaign_code, locale, siteId, siteDomain, userInfo, forceCampaign } = context;
3491
+ if (!forceCampaign || !(forceCampaign === null || forceCampaign === void 0 ? void 0 : forceCampaign.id)) {
3492
+ return null;
3493
+ }
3494
+ return (React__default.createElement(LeadGenSubscriptionBox$1, { locale: locale, siteId: siteId, siteDomain: siteDomain, userInfo: userInfo, forceCampaign: forceCampaign, campaign_code: campaign_code }));
3398
3495
  };
3399
3496
  Container.displayName = 'LeadGenSubscriptionBox';
3400
3497
  const ALLOW_LOCALE = [LOCALE.Vietnam, LOCALE.Malaysia, LOCALE.Indonesia];
@@ -4116,7 +4213,7 @@ const ThankyouPopup = ({ title, titleAlign, subtitle, subtitleAlign, link, linkN
4116
4213
  React__default.createElement(Button, { className: `lead-modal__btn ${LEAD_CLASS}`, color: primaryColor }, linkText)))))));
4117
4214
  };
4118
4215
 
4119
- const InlineLayout = ({ content, inlinePosition, doImpression, }) => {
4216
+ const InlineLayout = ({ flatComponent, content, inlinePosition, doImpression, }) => {
4120
4217
  const target = useMemo(() => {
4121
4218
  if (!inlinePosition)
4122
4219
  return null;
@@ -4221,6 +4318,9 @@ const InlineLayout = ({ content, inlinePosition, doImpression, }) => {
4221
4318
  }
4222
4319
  }
4223
4320
  }, [inlinePosition]);
4321
+ if (!!flatComponent) {
4322
+ return (React__default.createElement(ImpressionTrackingWrapper, { onImpression: () => __awaiter(void 0, void 0, void 0, function* () { return yield doImpression(); }) }, content));
4323
+ }
4224
4324
  if (!inlinePosition || !target)
4225
4325
  return null;
4226
4326
  return createPortal(React__default.createElement(ImpressionTrackingWrapper, { onImpression: () => __awaiter(void 0, void 0, void 0, function* () { return yield doImpression(); }) }, content), target);
@@ -4261,15 +4361,28 @@ const EmptyComponent = ({ onClose, onContinue, }) => {
4261
4361
  React__default.createElement(Button$1, { onClick: onContinue, size: "lg", variant: "filled", fullWidth: false, className: "leadgen-btn leadgen-btn_empty_again" }, t('lead.empty.submitAgain')))));
4262
4362
  };
4263
4363
 
4364
+ var useTextStyles = createStyles((theme) => {
4365
+ return GlobalTextStyleNew(theme)[CustomStylesType.LEADGEN];
4366
+ });
4367
+
4368
+ const ErrorIcon = (_a) => {
4369
+ var { size } = _a, rest = __rest(_a, ["size"]);
4370
+ const props = Object.assign({ width: size, height: size }, rest);
4371
+ return (React__default.createElement("svg", Object.assign({ width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
4372
+ React__default.createElement("path", { d: "M5.996 6.513q.163 0 .282-.12a.38.38 0 0 0 .118-.28V3.937q0-.15-.118-.268a.4.4 0 0 0-.282-.119.4.4 0 0 0-.281.12.38.38 0 0 0-.119.28v2.175q0 .15.119.269.12.119.281.119m0 1.862a.43.43 0 0 0 .3-.112.4.4 0 0 0 .125-.313.4.4 0 0 0-.125-.3.4.4 0 0 0-.3-.125.4.4 0 0 0-.3.125.4.4 0 0 0-.125.3.4.4 0 0 0 .125.313.43.43 0 0 0 .3.112m0 2.375a4.6 4.6 0 0 1-1.856-.375 4.8 4.8 0 0 1-1.506-1.012A4.8 4.8 0 0 1 1.62 7.857 4.6 4.6 0 0 1 1.246 6q0-.987.375-1.856t1.013-1.506A4.8 4.8 0 0 1 4.14 1.625a4.6 4.6 0 0 1 1.856-.375q.988 0 1.857.375Q8.72 2 9.359 2.638q.637.637 1.012 1.506T10.747 6t-.375 1.857A4.8 4.8 0 0 1 9.36 9.363a4.8 4.8 0 0 1-1.506 1.012q-.87.375-1.857.375", fill: "#F44D2C" })));
4373
+ };
4374
+ ErrorIcon.defaultProps = {
4375
+ size: 18,
4376
+ color: theme.colors.gray600,
4377
+ activeColor: theme.colors.primaryBase,
4378
+ };
4379
+
4264
4380
  const SubtitleBlock = ({ children, align, }) => (React__default.createElement("p", { className: `lead-modal__description ${'le-text-align-' + (align || '')} ${LEAD_CLASS}` }, children));
4265
4381
 
4266
4382
  const cssInputNotShrink = css `
4267
4383
  height: 100% !important;
4268
4384
  min-height: calc(var(--container-height, 56px) * 24 / 56);
4269
- color: ${theme.colors.gray800};
4270
- font-size: var(--input, 15px);
4271
4385
  line-height: calc(var(--container-height, 56px) * 24 / 56);
4272
- letter-spacing: -0.3px;
4273
4386
  border: none !important;
4274
4387
  border-radius: 0 !important;
4275
4388
  outline: none !important;
@@ -4292,11 +4405,6 @@ const cssLabelNotShrink = css `
4292
4405
  position: absolute;
4293
4406
  top: calc(var(--container-height) / 2);
4294
4407
  left: var(--space-x, 16px);
4295
- color: ${theme.colors.gray400};
4296
- font-size: var(--label-not-shrink, 15px);
4297
- font-weight: 500;
4298
- line-height: calc(var(--container-height, 56px) * 24 / 56);
4299
- letter-spacing: -0.3px;
4300
4408
  margin: 0;
4301
4409
  z-index: 1;
4302
4410
  cursor: pointer;
@@ -4304,11 +4412,7 @@ const cssLabelNotShrink = css `
4304
4412
  transition: 0.125s ease-in all;
4305
4413
  `;
4306
4414
  const cssLabelShrink = css `
4307
- color: ${theme.colors.gray400};
4308
- font-size: var(--label-shrink, 12px);
4309
- line-height: calc(var(--container-height, 56px) * 18 / 56);
4310
- letter-spacing: -0.2px;
4311
- top: calc(var(--container-height) * 7 / 56);
4415
+ top: var(--space-y-shrink, 6px);
4312
4416
  transform: none;
4313
4417
  transition: 0.125s ease-out all;
4314
4418
  `;
@@ -4339,7 +4443,7 @@ const cssWrapperInputNotShrink = css `
4339
4443
  const cssWrapperInputShrink = css `
4340
4444
  height: auto;
4341
4445
  min-height: var(--container-height, 56px);
4342
- padding-block: var(--space-y-shrink, 7px);
4446
+ padding-block: var(--space-y-shrink, 6px);
4343
4447
  cursor: text;
4344
4448
  pointer-events: auto;
4345
4449
  `;
@@ -4351,7 +4455,7 @@ const cssInputWrapperError = css `
4351
4455
  const StyledTextFieldContainer = styled.div `
4352
4456
  --space-x: 16px;
4353
4457
  --space-y-not-shrink: 15px;
4354
- --space-y-shrink: 7px;
4458
+ --space-y-shrink: 6px;
4355
4459
  --container-height: 56px;
4356
4460
  --label-not-shrink: 16px;
4357
4461
  --label-shrink: 12px;
@@ -4578,7 +4682,7 @@ const TextField = (props) => {
4578
4682
  setShrink(shrinkProps);
4579
4683
  }, [shrinkProps]);
4580
4684
  return (React__default.createElement(StyledTextFieldContainer, Object.assign({ shrink: shrink, className: clsx(className, 'textField', { textField_shrink: !!shrink }) }, restProps),
4581
- React__default.createElement("div", { ref: containerRef, onClick: onClick, className: "textField_wrapper" }, children)));
4685
+ React__default.createElement("div", { ref: containerRef, onClick: onClick, className: "textField_wrapper" }, typeof children === 'function' ? children(shrink) : children)));
4582
4686
  };
4583
4687
  const ChoiceField = (props) => {
4584
4688
  const { children, className } = props, restProps = __rest(props, ["children", "className"]);
@@ -4589,6 +4693,7 @@ const TitleBlock = ({ children, align, }) => (React__default.createElement("h2",
4589
4693
 
4590
4694
  const LightboxFields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmit, }) => {
4591
4695
  const { t } = useTranslations();
4696
+ const { classes } = useTextStyles();
4592
4697
  const form = useLeadFormContext();
4593
4698
  const formValues = form.values;
4594
4699
  const labelTuples = useMemo(() => {
@@ -4608,24 +4713,44 @@ const LightboxFields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmi
4608
4713
  case 'SubtitleBlock':
4609
4714
  return (React__default.createElement(SubtitleBlock, { key: index, align: align }, value));
4610
4715
  case 'TextBlock':
4611
- return (React__default.createElement(TextField, { key: index, shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field" },
4612
- React__default.createElement(TextInput, Object.assign({ withAsterisk: required, spellCheck: false, type: "text", placeholder: " ",
4613
- // className="lead-modal__form-control leadgen-form_field"
4614
- // onChangeRaw={(e) => inputOnChange('text', e)}
4615
- label: label, "data-control": "text", "data-lead-control": name, "data-is-required": required, inputWrapperOrder: ['label', 'input', 'description', 'error'] }, form.getInputProps(value), { name: value }))));
4716
+ return (React__default.createElement(TextField, { key: index, shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field" }, (shrink) => (React__default.createElement(TextInput, Object.assign({ withAsterisk: required, spellCheck: false, type: "text", placeholder: " ",
4717
+ // className="lead-modal__form-control leadgen-form_field"
4718
+ // onChangeRaw={(e) => inputOnChange('text', e)}
4719
+ label: React__default.createElement(Text, { size: shrink ? 'p3' : 'p2', variant: "secondary", weight: "halfBold" }, label), "data-control": "text", "data-lead-control": name, "data-is-required": required, inputWrapperOrder: [
4720
+ 'label',
4721
+ 'input',
4722
+ 'description',
4723
+ 'error',
4724
+ ] }, form.getInputProps(value), { name: value, error: form.errors[value] && (React__default.createElement(Flex, { align: 'center', gap: 4 },
4725
+ React__default.createElement(ErrorIcon, { size: 12 }),
4726
+ React__default.createElement(Text, { size: "c1", variant: "error" }, form.errors[value]))) })))));
4616
4727
  case 'NumberBlock':
4617
- return (React__default.createElement(TextField, { key: index, shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field" },
4618
- React__default.createElement(NumberInput$1, Object.assign({ withAsterisk: required, spellCheck: false, type: "number", placeholder: " ",
4619
- // className="lead-modal__form-control leadgen-form_field"
4620
- // onChange={(e) => inputOnChange('number', e)}
4621
- label: label, "data-control": "number", "data-lead-control": name, "data-is-required": required, name: value, inputWrapperOrder: ['label', 'input', 'description', 'error'] }, form.getInputProps(value)))));
4728
+ return (React__default.createElement(TextField, { key: index, shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field" }, (shrink) => (React__default.createElement(NumberInput$1, Object.assign({ withAsterisk: required, spellCheck: false, type: "number", placeholder: " ",
4729
+ // className="lead-modal__form-control leadgen-form_field"
4730
+ // onChange={(e) => inputOnChange('number', e)}
4731
+ label: React__default.createElement(Text, { size: shrink ? 'p3' : 'p2', variant: "secondary", weight: "halfBold" }, label), "data-control": "number", "data-lead-control": name, "data-is-required": required, name: value, inputWrapperOrder: [
4732
+ 'label',
4733
+ 'input',
4734
+ 'description',
4735
+ 'error',
4736
+ ] }, form.getInputProps(value), { error: form.errors[value] && (React__default.createElement(Flex, { align: 'center', gap: 4 },
4737
+ React__default.createElement(ErrorIcon, { size: 12 }),
4738
+ React__default.createElement(Text, { size: "c1", variant: "error" }, form.errors[value]))) })))));
4622
4739
  case 'EmailBlock':
4623
- return (React__default.createElement(TextField, { key: index, shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field" },
4624
- React__default.createElement(TextInput, Object.assign({ withAsterisk: required, spellCheck: false,
4625
- // type="email"
4626
- placeholder: " ",
4627
- // className="lead-modal__form-control leadgen-form_field"
4628
- label: label, "data-control": "email", "data-lead-control": name, "data-is-required": required, name: value, inputWrapperOrder: ['label', 'input', 'description', 'error'] }, form.getInputProps(value)))));
4740
+ return (React__default.createElement(TextField, { key: index, shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field" }, (shrink) => (React__default.createElement(TextInput, Object.assign({ withAsterisk: required, spellCheck: false,
4741
+ // type="email"
4742
+ placeholder: " ",
4743
+ // className="lead-modal__form-control leadgen-form_field"
4744
+ label: React__default.createElement(Text, { size: shrink ? 'p3' : 'p2', variant: "secondary", weight: "halfBold" }, label), "data-control": "email", "data-lead-control": name, "data-is-required": required, name: value, inputWrapperOrder: [
4745
+ 'label',
4746
+ 'input',
4747
+ 'description',
4748
+ 'error',
4749
+ ] }, form.getInputProps(value), { error: form.errors[value] && (React__default.createElement(Flex, { align: 'center', gap: 4 },
4750
+ React__default.createElement(ErrorIcon, { size: 12 }),
4751
+ React__default.createElement(Text, { size: "c1", variant: "error" }, form.errors[value]))), styles: (theme) => ({
4752
+ input: GlobalTextStyleNew(theme)[CustomStylesType.LEADGEN].p2,
4753
+ }) })))));
4629
4754
  case 'PhoneOtpBlock':
4630
4755
  case 'WhatsappOtpBlock':
4631
4756
  case 'ZaloOtpBlock':
@@ -4634,20 +4759,30 @@ const LightboxFields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmi
4634
4759
  const _b = form.getInputProps(value), { error } = _b, formPhoneInputWrapper = __rest(_b, ["error"]);
4635
4760
  return (React__default.createElement(TextField, { key: index, shrink: !!formValue, className: clsx('lead-modal__form-control leadgen-form_field', {
4636
4761
  'leadgen-form_field_error': !!error,
4637
- }) },
4638
- React__default.createElement(Input$1.Wrapper, { size: "md", withAsterisk: required, label: label, "data-invalid": !!error, labelProps: { htmlFor: htmlForId }, inputWrapperOrder: ['label', 'input', 'description', 'error'], error: error },
4639
- React__default.createElement("div", { className: "mantine-Input-wrapper" },
4640
- React__default.createElement(Phone, Object.assign({ className: "mantine-Input-input", name: value, spellCheck: false, type: "tel", placeholder: " ",
4641
- // onBlur={(e) => inputOnBlur('tel', e)}
4642
- id: htmlForId, defaultCountry: (locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN'), "data-control": "tel", "data-lead-control": name, "data-is-required": required }, formPhoneInputWrapper))))));
4762
+ }) }, (shrink) => (React__default.createElement(Input$1.Wrapper, { size: "md", withAsterisk: required, label: React__default.createElement(Text, { size: shrink ? 'p3' : 'p2', variant: "secondary", weight: "halfBold" }, label), "data-invalid": !!error, labelProps: { htmlFor: htmlForId }, inputWrapperOrder: [
4763
+ 'label',
4764
+ 'input',
4765
+ 'description',
4766
+ 'error',
4767
+ ], error: error },
4768
+ React__default.createElement("div", { className: "mantine-Input-wrapper" },
4769
+ React__default.createElement(Phone, Object.assign({ className: `mantine-Input-input ${classes.p2}`, name: value, spellCheck: false, type: "tel", placeholder: " ",
4770
+ // onBlur={(e) => inputOnBlur('tel', e)}
4771
+ id: htmlForId, defaultCountry: (locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN'), "data-control": "tel", "data-lead-control": name, "data-is-required": required }, formPhoneInputWrapper)))))));
4643
4772
  }
4644
4773
  case 'LocationBlock': {
4645
- return (React__default.createElement(TextField, { key: index, shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field" },
4646
- React__default.createElement(GoogleLocationBlock, Object.assign({ withAsterisk: required, name: value, placeholder: " ", label: label, "data-control": "text", "data-lead-control": name, "data-is-required": required, locale: locale, inputWrapperOrder: ['label', 'input', 'description', 'error'] }, form.getInputProps(value)))));
4774
+ return (React__default.createElement(TextField, { key: index, shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field" }, (shrink) => (React__default.createElement(GoogleLocationBlock, Object.assign({ withAsterisk: required, name: value, placeholder: " ", label: React__default.createElement(Text, { size: shrink ? 'p3' : 'p2', variant: "secondary", weight: "halfBold" }, label), "data-control": "text", "data-lead-control": name, "data-is-required": required, locale: locale, inputWrapperOrder: [
4775
+ 'label',
4776
+ 'input',
4777
+ 'description',
4778
+ 'error',
4779
+ ] }, form.getInputProps(value))))));
4647
4780
  }
4648
4781
  case 'DateBlock': {
4649
4782
  const _c = form.getInputProps(value), { error } = _c, formInputProps = __rest(_c, ["error"]);
4650
- return (React__default.createElement(Input$1.Wrapper, { key: index, size: "md", withAsterisk: required, label: label, "data-invalid": !!error, inputWrapperOrder: ['label', 'input', 'description', 'error'], error: error, className: "lead-modal__form-control leadgen-form_field" },
4783
+ return (React__default.createElement(Input$1.Wrapper, { key: index, size: "md", withAsterisk: required, label: React__default.createElement(Text, { size: "p2", variant: "primary" }, label), "data-invalid": !!error, inputWrapperOrder: ['label', 'input', 'description', 'error'], error: form.errors[value] && (React__default.createElement(Flex, { align: 'center', gap: 4 },
4784
+ React__default.createElement(ErrorIcon, { size: 12 }),
4785
+ React__default.createElement(Text, { size: "c1", variant: "error" }, form.errors[value]))), className: "lead-modal__form-control leadgen-form_field" },
4651
4786
  React__default.createElement(InputDate, Object.assign({ name: value, error: Boolean(error), locale: locale, "data-extra": true, "data-name": value, "data-control": "date", "data-lead-control": name, "data-is-required": required, className: "leadgen-form_field_date", labelTuples: labelTuples }, formInputProps))));
4652
4787
  }
4653
4788
  case 'LinkButtonBlock':
@@ -4664,7 +4799,7 @@ const LightboxFields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmi
4664
4799
  }, "data-name": value + '-mailchimp' })),
4665
4800
  React__default.createElement(Checkbox.Group, Object.assign({ withAsterisk: required,
4666
4801
  // className="lead-modal__form-control leadgen-form_field"
4667
- label: label, size: "md", sx: {
4802
+ label: React__default.createElement(Text, { size: "p2", variant: "primary" }, label), size: "md", sx: {
4668
4803
  display: 'flex',
4669
4804
  flexDirection: 'column',
4670
4805
  flexWrap: 'wrap',
@@ -4677,20 +4812,22 @@ const LightboxFields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmi
4677
4812
  isSendMailChimp && (React__default.createElement(Input$1, { type: "hidden", name: value + '-mailchimp', value: isSendMailChimp })),
4678
4813
  React__default.createElement(Radio.Group, Object.assign({ withAsterisk: required,
4679
4814
  // className="lead-modal__form-control leadgen-form_field"
4680
- label: label, size: "md", inputWrapperOrder: ['label', 'input', 'description', 'error'], inputContainer: (children) => {
4815
+ label: React__default.createElement(Text, { size: "p2", variant: "primary" }, label), size: "md", inputWrapperOrder: ['label', 'input', 'description', 'error'], inputContainer: (children) => {
4681
4816
  return (React__default.createElement("div", { className: "leadgen-choiceContainer" }, children));
4682
4817
  } }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default.createElement(Radio, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "radio", "data-lead-control": name, "data-is-required": required }))))));
4683
4818
  case 'DropdownBlock':
4684
- return (React__default.createElement(TextField, { shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field DropdownBlock", key: index },
4819
+ return (React__default.createElement(TextField, { shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field DropdownBlock", key: index }, (shrink) => (React__default.createElement(React__default.Fragment, null,
4685
4820
  React__default.createElement("div", { style: { display: 'none' }, "data-extra": true, "data-name": value, "data-control": 'dropdown', "data-lead-control": name, "data-is-required": required }),
4686
4821
  React__default.createElement(Select
4687
4822
  // className="lead-modal__form-control leadgen-form_field"
4688
4823
  , Object.assign({
4689
4824
  // className="lead-modal__form-control leadgen-form_field"
4690
- label: label, placeholder: " ", searchable: true, withAsterisk: required, name: value, data: listQuestion.map((l) => ({
4825
+ label: React__default.createElement(Text, { size: shrink ? 'p3' : 'p2', variant: "secondary", weight: "halfBold" }, label), placeholder: " ", searchable: true, withAsterisk: required, name: value, data: listQuestion.map((l) => ({
4691
4826
  value: l.value,
4692
4827
  label: l.placeholder,
4693
- })), nothingFound: React__default.createElement(NoData, null), styles: {
4828
+ })), nothingFound: React__default.createElement(NoData, null), error: form.errors[value] && (React__default.createElement(Flex, { align: 'center', gap: 4 },
4829
+ React__default.createElement(ErrorIcon, { size: 12 }),
4830
+ React__default.createElement(Text, { size: "c1", variant: "error" }, form.errors[value]))), styles: {
4694
4831
  item: {
4695
4832
  paddingBlock: 12,
4696
4833
  paddingInline: 10,
@@ -4711,20 +4848,19 @@ const LightboxFields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmi
4711
4848
  paddingInline: 0,
4712
4849
  },
4713
4850
  },
4714
- }, maxDropdownHeight: 192 }, form.getInputProps(value)))));
4851
+ }, maxDropdownHeight: 192 }, form.getInputProps(value)))))));
4715
4852
  case 'TncBlock':
4716
4853
  const _d = form.getInputProps(`TNC-${id}`), { error } = _d, tncInputProps = __rest(_d, ["error"]);
4717
4854
  return (React__default.createElement(ChoiceField, { className: "leadgen-form_checkbox", key: id },
4718
4855
  React__default.createElement(Input$1.Wrapper, { error: error },
4719
- React__default.createElement(Checkbox, Object.assign({ name: 'TNC-' + id, label: React__default.createElement(Text, { as: "span", size: "c1", variant: "secondary", dangerouslySetInnerHTML: { __html: data.valueHTML }, styles: (theme) => ({
4856
+ React__default.createElement(Checkbox, Object.assign({ name: 'TNC-' + id, label: React__default.createElement(Text, { as: "span", size: "c1", variant: "secondary", dangerouslySetInnerHTML: { __html: data.valueHTML }, styles: {
4720
4857
  root: {
4721
4858
  a: {
4722
- textDecoration: 'underline !important',
4859
+ textDecoration: 'underline',
4723
4860
  textUnderlineOffset: '3px',
4724
- color: `${theme.colors.gray[7]} !important`,
4725
4861
  },
4726
4862
  },
4727
- }) }), className: "tnc-block", "data-control": "checkbox", "data-lead-control": name, "data-is-required": required }, tncInputProps)))));
4863
+ } }), className: "tnc-block", "data-control": "checkbox", "data-lead-control": name, "data-is-required": required }, tncInputProps)))));
4728
4864
  }
4729
4865
  return null;
4730
4866
  })));
@@ -4977,7 +5113,7 @@ const LEADGEN_SHOW_HEADER = [
4977
5113
  ];
4978
5114
  // const CAMPAGE_CODE_LIST_APPLY_NEW_UI = ['ri3lkoxcetjoj39', 'u0adw7hw8kw7t89']
4979
5115
  const CAMPAGE_CODE_LIST_APPLY_NEW_UI = ['ri3lkoxcetjoj39'];
4980
- const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSubmit, imageMobile, imageDesktop, imageOverlayMobile, imageOverlayDesktop, imageBackground, currentLayout, title, onSubmit, onUnmount, doImpression, showThankyou, campaignId, campaignCode, campaign_subot_id, locale, showEmpty, setShowEmpty, userInfo, action, }) => {
5116
+ const LightboxLayout = ({ flatComponent, popupId, extraFields, onClose: onCloseProp, onOtherSubmit, imageMobile, imageDesktop, imageOverlayMobile, imageOverlayDesktop, imageBackground, currentLayout, title, onSubmit, onUnmount, doImpression, showThankyou, campaignId, campaignCode, campaign_subot_id, locale, showEmpty, setShowEmpty, userInfo, action, }) => {
4981
5117
  var _a, _b;
4982
5118
  const { primaryColor } = useContext(LeadGenContext$1);
4983
5119
  const { isMobile } = useScreenSize();
@@ -5377,7 +5513,7 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
5377
5513
  return React__default.createElement(SideBarLayout, { content: PopupContainer });
5378
5514
  }
5379
5515
  else if (isInline) {
5380
- return (React__default.createElement(InlineLayout, { action: action, content: PopupContainer, campaignCode: campaignCode, inlinePosition: extraFields.popupInlinePosition, doImpression: handleDoImpression }));
5516
+ return (React__default.createElement(InlineLayout, { flatComponent: flatComponent, action: action, content: PopupContainer, campaignCode: campaignCode, inlinePosition: extraFields.popupInlinePosition, doImpression: handleDoImpression }));
5381
5517
  }
5382
5518
  return null;
5383
5519
  };
@@ -5470,7 +5606,7 @@ function getCategoryLevel(t = 'Xin chao {{category_2}} extra') {
5470
5606
  return null;
5471
5607
  }
5472
5608
  }
5473
- const NewLeadPopup = ({ campaign, action, onSubmit, onClose, onUnmount, doImpression, showThankyou, locale, showEmpty, setShowEmpty, userInfo, }) => {
5609
+ const NewLeadPopup = ({ flatComponent, campaign, action, onSubmit, onClose, onUnmount, doImpression, showThankyou, locale, showEmpty, setShowEmpty, userInfo, }) => {
5474
5610
  var _a, _b;
5475
5611
  const { apiUrl, siteDomain } = useContext(LeadGenContext$1);
5476
5612
  const { extra_fields, image, image_desktop, code, image_background, image_overlay_mobile, image_overlay_desktop, } = campaign || {};
@@ -5573,7 +5709,7 @@ const NewLeadPopup = ({ campaign, action, onSubmit, onClose, onUnmount, doImpres
5573
5709
  currentLayout == 'Fullscreen' ||
5574
5710
  currentLayout == 'Sidebar' ||
5575
5711
  currentLayout == 'Slider') {
5576
- return (React__default.createElement(LightboxLayout, { popupId: popupIdRef.current, extraFields: extra_fields, onClose: onClose, onOtherSubmit: onOtherSubmit, onUnmount: onUnmount, doImpression: doImpression, imageMobile: image, imageDesktop: image_desktop, imageBackground: image_background, currentLayout: currentLayout, title: titleText, onSubmit: (params) => onSubmit(params, categoryLevel, categoryData), key: currentLayout, imageOverlayDesktop: image_overlay_desktop, imageOverlayMobile: image_overlay_mobile, showThankyou: showThankyou, campaignId: campaign.id, campaignCode: campaign.code, campaign_subot_id: campaign.bot_id || [], locale: locale, showEmpty: showEmpty, setShowEmpty: setShowEmpty, userInfo: userInfo, action: action }));
5712
+ return (React__default.createElement(LightboxLayout, { flatComponent: flatComponent, popupId: popupIdRef.current, extraFields: extra_fields, onClose: onClose, onOtherSubmit: onOtherSubmit, onUnmount: onUnmount, doImpression: doImpression, imageMobile: image, imageDesktop: image_desktop, imageBackground: image_background, currentLayout: currentLayout, title: titleText, onSubmit: (params) => onSubmit(params, categoryLevel, categoryData), key: currentLayout, imageOverlayDesktop: image_overlay_desktop, imageOverlayMobile: image_overlay_mobile, showThankyou: showThankyou, campaignId: campaign.id, campaignCode: campaign.code, campaign_subot_id: campaign.bot_id || [], locale: locale, showEmpty: showEmpty, setShowEmpty: setShowEmpty, userInfo: userInfo, action: action }));
5577
5713
  }
5578
5714
  else if (currentLayout.includes('Skin')) {
5579
5715
  return (React__default.createElement(SkinLayout, { popupId: popupIdRef.current, link: actionBlocks.linkButtonBlock.data.url, linkNewTab: !!actionBlocks.linkButtonBlock.data.newtab, linkText: actionBlocks.linkButtonBlock.data.value, onClose: onClose, onOtherSubmit: onOtherSubmit, imageMobile: image, imageDesktop: image_desktop, currentLayout: currentLayout }));
@@ -5665,7 +5801,7 @@ const formatTrackingData = (params) => {
5665
5801
  };
5666
5802
 
5667
5803
  // mount css
5668
- const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor, apiSubotUrl, DEBUG_URL, forceCampaign, children, extraPayloadValues = [], excludeExitRulesHandler, userInfo, onClose: onCloseProps, onSubmit: onSubmitProps, }) => {
5804
+ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor, apiSubotUrl, DEBUG_URL, forceCampaign, children, extraPayloadValues = [], excludeExitRulesHandler, userInfo, onClose: onCloseProps, onSubmit: onSubmitProps, flatComponent, }) => {
5669
5805
  var _a, _b;
5670
5806
  const scrollEventHandlerRef = useRef();
5671
5807
  const leadStartTimeRef = useRef(Date.now());
@@ -5777,12 +5913,10 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
5777
5913
  const { listBlockAdded = [] } = params || {};
5778
5914
  if (!TEMPLATE_ALLOW_NEWTRACKING.includes(currentLayout))
5779
5915
  return;
5780
- const gaCookie = getCookie('_ga') || null;
5781
- const cookieId = getCookie('hhg-id') || '';
5782
5916
  const data = formatTrackingData({
5783
5917
  commonData: {
5784
- cookie_id: cookieId,
5785
- ga_client_id: gaCookie,
5918
+ cookie_id: getCookie('hhg-id') || '',
5919
+ ga_client_id: getCookie('_ga') || null,
5786
5920
  country_code: locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN',
5787
5921
  status: 'in_progress',
5788
5922
  campaign_id: showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.id,
@@ -5792,28 +5926,13 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
5792
5926
  currentLayout,
5793
5927
  formParams: Object.assign(Object.assign({}, params), { listBlockAdded, formValues: [] }),
5794
5928
  });
5795
- return Promise.all([
5796
- fetch(`${apiUrl}api/collection/tracking-completion`, {
5797
- method: 'POST',
5798
- headers: {
5799
- 'Content-Type': 'application/json',
5800
- },
5801
- body: JSON.stringify(data),
5802
- }),
5803
- fetch(`${apiUrl}api/campaign/${showCampaign.code}/impression`, {
5804
- method: 'POST',
5805
- headers: {
5806
- 'Content-Type': 'application/json',
5807
- },
5808
- body: JSON.stringify({
5809
- action,
5810
- url: location.href.toLowerCase(),
5811
- title_article: document.title,
5812
- cookie_id: getCookie('hhg-id'),
5813
- ga_client_id: gaCookie,
5814
- }),
5815
- }),
5816
- ]);
5929
+ return fetch(`${apiUrl}api/collection/tracking-completion`, {
5930
+ method: 'POST',
5931
+ headers: {
5932
+ 'Content-Type': 'application/json',
5933
+ },
5934
+ body: JSON.stringify(data),
5935
+ });
5817
5936
  };
5818
5937
  useEffect(() => {
5819
5938
  if (forceCampaign === null || forceCampaign === void 0 ? void 0 : forceCampaign.code)
@@ -6022,7 +6141,7 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
6022
6141
  !!currentLayout &&
6023
6142
  !currentLayout.includes('Inline') &&
6024
6143
  !currentLayout.includes('Sidebar') && (React__default.createElement(Overlay, { color: "#000", opacity: 0.6, center: true, zIndex: 400, pos: 'fixed', onClick: () => onClose() })),
6025
- React__default.createElement(NewLeadPopup, { campaign: showCampaign, action: action, onSubmit: onSubmit, onClose: onClose, onUnmount: onUnmount, doImpression: doImpression, showThankyou: showThankyou, locale: locale, showEmpty: showEmpty, setShowEmpty: setShowEmpty, userInfo: userInfo })))));
6144
+ React__default.createElement(NewLeadPopup, { flatComponent: flatComponent, campaign: showCampaign, action: action, onSubmit: onSubmit, onClose: onClose, onUnmount: onUnmount, doImpression: doImpression, showThankyou: showThankyou, locale: locale, showEmpty: showEmpty, setShowEmpty: setShowEmpty, userInfo: userInfo })))));
6026
6145
  }))))))));
6027
6146
  };
6028
6147
  const LeadGen = _LeadGen;
@@ -6033,4 +6152,4 @@ LeadGen.Thankyou = Thankyou;
6033
6152
  LeadGen.OtpForm = OtpBlock$1;
6034
6153
  LeadGen.Close = Close;
6035
6154
 
6036
- export { LeadGen, LeadGenSubscriptionBox };
6155
+ export { LeadGen, LeadGenInline, LeadGenSubscriptionBox, leadGenInlineGetCampaign };