@hhgtech/hhg-components 1.29.396 → 1.29.397-beta-1
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.
- package/build/{InputDate-87c0ebb8.js → InputDate-5331c552.js} +17 -7
- package/build/{LastPeriod-fea79cc1.js → LastPeriod-64176202.js} +1 -1
- package/build/{MobileBottomNavigationIcon-6033022a.js → MobileBottomNavigationIcon-1277136e.js} +3 -3
- package/build/{Spinner-6fc329d5.js → Spinner-65a7a5d8.js} +1 -1
- package/build/{WhatsApp-c66b98f0.js → WhatsApp-008ac3cb.js} +1 -1
- package/build/adapters.js +19 -19
- package/build/atoms.js +48 -48
- package/build/babyGrowth.js +83 -83
- package/build/cache.js +2 -2
- package/build/care.js +17 -17
- package/build/careBookingSearchBar.js +14 -14
- package/build/careBookingSearchBarV2.js +15 -15
- package/build/components/atoms/drawerComponent/index.d.ts +7 -0
- package/build/components.js +97 -97
- package/build/{constants-5aaf7ea1.js → constants-b3d74044.js} +1 -1
- package/build/constants.js +3 -3
- package/build/constantsDomainLocales.js +1 -1
- package/build/constantsRiskScreener.js +2 -2
- package/build/constantsSite.js +2 -2
- package/build/{core-adb66af1.js → core-48737d3c.js} +1 -1
- package/build/{dataTransform-f81e2533.js → dataTransform-fd6f52e7.js} +1 -1
- package/build/ecom.js +4 -4
- package/build/{editor-16ae9ec5.js → editor-b8de4697.js} +11 -11
- package/build/embeddedHeathToolCards_babyGrowth.js +23 -23
- package/build/embeddedHeathToolCards_babyPoop.js +19 -19
- package/build/embeddedHeathToolCards_babyVaccine.js +22 -22
- package/build/embeddedHeathToolCards_bmi_bmi.js +25 -25
- package/build/embeddedHeathToolCards_bmrBmr.js +25 -25
- package/build/embeddedHeathToolCards_dueDate_dueDate.js +22 -22
- package/build/embeddedHeathToolCards_ovulation_ovulation.js +22 -22
- package/build/embeddedHeathToolCards_pwg_pwg.js +26 -26
- package/build/embeddedHeathToolCards_targetHeartRate.js +27 -27
- package/build/esm/{InputDate-95582cb9.js → InputDate-c206ae02.js} +17 -7
- package/build/esm/{LastPeriod-6bd7ad93.js → LastPeriod-6759bed7.js} +1 -1
- package/build/esm/{MobileBottomNavigationIcon-b87f8b35.js → MobileBottomNavigationIcon-e3386b67.js} +3 -3
- package/build/esm/{Spinner-a9620d7f.js → Spinner-f0747302.js} +1 -1
- package/build/esm/{WhatsApp-9e19b7fb.js → WhatsApp-8f647b91.js} +1 -1
- package/build/esm/adapters.js +19 -19
- package/build/esm/atoms.js +48 -48
- package/build/esm/babyGrowth.js +83 -83
- package/build/esm/cache.js +2 -2
- package/build/esm/care.js +17 -17
- package/build/esm/careBookingSearchBar.js +14 -14
- package/build/esm/careBookingSearchBarV2.js +15 -15
- package/build/esm/components/atoms/drawerComponent/index.d.ts +7 -0
- package/build/esm/components.js +97 -97
- package/build/esm/{constants-a5b1bd3d.js → constants-5554e8fb.js} +1 -1
- package/build/esm/constants.js +3 -3
- package/build/esm/constantsDomainLocales.js +1 -1
- package/build/esm/constantsRiskScreener.js +2 -2
- package/build/esm/constantsSite.js +2 -2
- package/build/esm/{core-b54de4ea.js → core-a98d7b49.js} +1 -1
- package/build/esm/{dataTransform-192c6c28.js → dataTransform-c15abb49.js} +1 -1
- package/build/esm/ecom.js +4 -4
- package/build/esm/{editor-c3bfd985.js → editor-d97a9993.js} +11 -11
- package/build/esm/embeddedHeathToolCards_babyGrowth.js +23 -23
- package/build/esm/embeddedHeathToolCards_babyPoop.js +19 -19
- package/build/esm/embeddedHeathToolCards_babyVaccine.js +22 -22
- package/build/esm/embeddedHeathToolCards_bmi_bmi.js +25 -25
- package/build/esm/embeddedHeathToolCards_bmrBmr.js +25 -25
- package/build/esm/embeddedHeathToolCards_dueDate_dueDate.js +22 -22
- package/build/esm/embeddedHeathToolCards_ovulation_ovulation.js +22 -22
- package/build/esm/embeddedHeathToolCards_pwg_pwg.js +26 -26
- package/build/esm/embeddedHeathToolCards_targetHeartRate.js +27 -27
- package/build/esm/footer.js +21 -21
- package/build/esm/gAssets.js +2 -2
- package/build/esm/{healthTools-4f489b7e.js → healthTools-5c570da4.js} +1 -1
- package/build/esm/healthToolsCardWrapper.js +18 -18
- package/build/esm/healthToolsForm.js +33 -33
- package/build/esm/hooks.js +13 -13
- package/build/esm/i18n/translationKeys.d.ts +1 -1
- package/build/esm/i18n-values/en-PH.js +2 -1
- package/build/esm/i18n-values/hi-IN.js +2 -1
- package/build/esm/i18n-values/id-ID.js +4 -3
- package/build/esm/i18n-values/km-KH.js +2 -1
- package/build/esm/i18n-values/ms-MY.js +2 -1
- package/build/esm/i18n-values/my-MM.js +4 -3
- package/build/esm/i18n-values/th-TH.js +4 -3
- package/build/esm/i18n-values/tl-PH.js +2 -1
- package/build/esm/i18n-values/vi-VN.js +2 -1
- package/build/esm/i18n-values/vi-VN_MB.js +2 -1
- package/build/esm/i18n-values/zh-CN.js +2 -1
- package/build/esm/i18n-values/zh-TW.js +2 -1
- package/build/esm/i18n.js +2 -2
- package/build/esm/i18nV2.js +2 -2
- package/build/esm/{index-df117190.js → index-0e477708.js} +2 -2
- package/build/esm/{index-47f3dddb.js → index-1474a156.js} +17 -17
- package/build/esm/{index-5f64e4d5.js → index-1500f21b.js} +2 -2
- package/build/esm/{index-cb56f721.js → index-179a99bd.js} +6 -6
- package/build/esm/{index-376d494b.js → index-21ea161d.js} +15 -15
- package/build/esm/{index-2b657776.js → index-2a74af5d.js} +18 -18
- package/build/esm/{index-aacbc3ef.js → index-2ba53293.js} +3 -3
- package/build/esm/{index-fb95233f.js → index-2cc44301.js} +13 -13
- package/build/esm/{index-608aa404.js → index-3122cd80.js} +10 -10
- package/build/esm/{index-670e69cb.js → index-43b60610.js} +2 -2
- package/build/esm/{index-f122e041.js → index-44f0ae43.js} +17 -17
- package/build/esm/{index-3851a867.js → index-45a645d6.js} +1 -1
- package/build/esm/{index-496904b6.js → index-470e09a9.js} +25 -25
- package/build/esm/{index-4f901e4d.js → index-489b566e.js} +1 -1
- package/build/esm/{index-f5c1e2c9.js → index-493cae6d.js} +6 -6
- package/build/esm/{index-3076c7d5.js → index-4e04114c.js} +2 -2
- package/build/esm/{index-2bad4106.js → index-4e253706.js} +17 -17
- package/build/esm/{index-ec1bb54b.js → index-4fb76de9.js} +1 -1
- package/build/esm/{index-8bb32149.js → index-58ed29a1.js} +2 -2
- package/build/esm/{index-140dcfdc.js → index-591da165.js} +21 -21
- package/build/esm/{index-f7ac6a0a.js → index-5a1b18fe.js} +11 -11
- package/build/esm/{index-d34c5e3d.js → index-5e6a0609.js} +4 -4
- package/build/esm/{index-1f219095.js → index-6a67cfd9.js} +2 -2
- package/build/esm/{index-3b1aa0b8.js → index-6e0b2ec9.js} +3 -3
- package/build/esm/{index-f89a38f9.js → index-7442158d.js} +24 -24
- package/build/esm/{index-c3285710.js → index-77e3dacb.js} +2 -2
- package/build/esm/{index-c3f0d9a6.js → index-7cbb50a6.js} +3 -3
- package/build/esm/{index-9c40bee4.js → index-7e5b02e9.js} +7 -7
- package/build/esm/{index-11c03693.js → index-84d86b55.js} +13 -13
- package/build/esm/{index-c23bc927.js → index-8910c1d7.js} +6 -6
- package/build/esm/{index-d39d14e2.js → index-8afffc50.js} +2 -2
- package/build/esm/{index-b951a466.js → index-9154a4b5.js} +2 -2
- package/build/esm/{index-f8c6adf5.js → index-91c967e5.js} +4 -4
- package/build/esm/{index-33433fc2.js → index-97b65eb1.js} +8 -8
- package/build/esm/{index-45101bb7.js → index-9878428a.js} +17 -17
- package/build/esm/{index-e0d52f7d.js → index-9b5a1b01.js} +5 -5
- package/build/esm/{index-ba156e99.js → index-9c8a599d.js} +2 -2
- package/build/esm/{index-a03cc137.js → index-9f25a4c6.js} +2 -2
- package/build/esm/{index-5f7999af.js → index-a8e8c83d.js} +3 -3
- package/build/esm/{index-bf6ed587.js → index-ab464f29.js} +2 -2
- package/build/esm/{index-119711b9.js → index-b0374861.js} +2 -2
- package/build/esm/{index-5aebff86.js → index-b05b6e2a.js} +16 -16
- package/build/esm/{index-bcfaa0e6.js → index-b28c7e2d.js} +31 -31
- package/build/esm/{index-169105b8.js → index-ba1ec29e.js} +6 -6
- package/build/esm/{index-ed2b3f2f.js → index-bd0c1846.js} +1 -1
- package/build/esm/{index-a9f213a6.js → index-be5ba37e.js} +1 -1
- package/build/esm/{index-59bd98a3.js → index-c0e68669.js} +6 -6
- package/build/esm/{index-02a71e66.js → index-c2fca24a.js} +31 -31
- package/build/esm/{index-2f78ddf9.js → index-ceb1e14f.js} +5 -5
- package/build/esm/{index-33750331.js → index-d1b079a0.js} +1 -1
- package/build/esm/{index-46ad822c.js → index-d1ee3ee2.js} +1 -1
- package/build/esm/{index-c60ec065.js → index-d1f457f8.js} +3 -3
- package/build/esm/{index-d17b8e2c.js → index-da880edd.js} +16 -16
- package/build/esm/{index-b0f23553.js → index-db09a34c.js} +7 -7
- package/build/esm/{index-b3bde8eb.js → index-dbb8cb62.js} +13 -13
- package/build/esm/{index-3e5d8e7a.js → index-dd669103.js} +13 -13
- package/build/esm/{index-03e245b2.js → index-ddcdd8f2.js} +18 -18
- package/build/esm/{index-912e5964.js → index-e09f7e4a.js} +231 -147
- package/build/esm/{index-8d285723.js → index-e319f244.js} +1 -1
- package/build/esm/{index-c539556e.js → index-e92ffe7c.js} +16 -16
- package/build/esm/{index-adbe75fa.js → index-ec0741a1.js} +1 -1
- package/build/esm/{index-d75c3fb7.js → index-f7a5f7fa.js} +22 -22
- package/build/esm/{index-f437bfc4.js → index-fa857263.js} +16 -16
- package/build/esm/{index-2892eb0a.js → index-faacee56.js} +3 -3
- package/build/esm/{index-4ae1a48c.js → index-fb1047f7.js} +2 -2
- package/build/esm/index.js +118 -118
- package/build/esm/{labelSorting-71895de3.js → labelSorting-5e39cf19.js} +4 -4
- package/build/esm/lead/LeadGen.helpers.d.ts +14 -14
- package/build/esm/lead/LeadGen.type.d.ts +19 -0
- package/build/esm/lead/LeadGenForm/LeadGenEmpty.d.ts +8 -0
- package/build/esm/lead/LeadGenForm/LeadGenForm.helpers.d.ts +1 -1
- package/build/esm/lead/LeadGenLightBoxB/LeadGenLightBoxB.styled.d.ts +262 -0
- package/build/esm/lead/components/context.d.ts +3 -2
- package/build/esm/lead/components/index.d.ts +3 -2
- package/build/esm/lead/icons/NoData.d.ts +3 -0
- package/build/esm/lead/icons/index.d.ts +5 -0
- package/build/esm/lead/layouts/lightbox/index.d.ts +8 -4
- package/build/esm/lead/leadGenContext.d.ts +7 -0
- package/build/esm/lead/newLeadPopup.d.ts +5 -3
- package/build/esm/lead/services/index.d.ts +2 -1
- package/build/esm/lead/utils/formatFormData.d.ts +1 -0
- package/build/esm/lead/utils/formatTrackingData.d.ts +14 -0
- package/build/esm/lead.css +1 -1
- package/build/esm/lead.js +738 -275
- package/build/esm/{logoIcon-5b62cfe4.js → logoIcon-cadbecbe.js} +2 -2
- package/build/esm/mantine.js +25 -25
- package/build/esm/misc.js +17 -17
- package/build/esm/miscGetDynamicHealthTool.js +4 -4
- package/build/esm/miscGetSocialList.js +8 -8
- package/build/esm/miscScreenSizeContext.js +1 -1
- package/build/esm/mobileBottomNavigation.js +5 -5
- package/build/esm/mobileBottomNavigationIcon.js +5 -5
- package/build/esm/molecules.js +74 -74
- package/build/esm/moleculesArticleCard.js +6 -6
- package/build/esm/moleculesArticleCardV2.js +16 -16
- package/build/esm/navigation.js +46 -46
- package/build/esm/navigationLogoutPopup.js +9 -9
- package/build/esm/navigationProfileButton.js +23 -23
- package/build/esm/onboardingV2.js +29 -29
- package/build/esm/organisms.js +50 -50
- package/build/esm/{post-0526421c.js → post-d791db36.js} +2 -2
- package/build/esm/profileNavigation.js +19 -19
- package/build/esm/progressBar.js +1 -1
- package/build/esm/pwg.js +22 -22
- package/build/esm/ssoV2/api/featureFlag.d.ts +2 -1
- package/build/esm/ssoV2.js +52 -40
- package/build/esm/{store-99ea3c78.js → store-e4f706d3.js} +3 -3
- package/build/esm/subot.js +36 -36
- package/build/esm/surveyOrPremiumBanner.js +33 -33
- package/build/esm/surveyQuestionCard.js +10 -10
- package/build/esm/{surveyThankyouCard-d85babb0.js → surveyThankyouCard-5dad0d9f.js} +5 -5
- package/build/esm/together/components/molecules/createNewPostContentV2/index.styled.d.ts +7 -0
- package/build/esm/together/utils/index.d.ts +1 -0
- package/build/esm/together.js +56 -56
- package/build/esm/togetherApiUtils.js +4 -4
- package/build/esm/togetherAtoms.js +30 -30
- package/build/esm/togetherComponentGlobalContext.js +4 -4
- package/build/esm/togetherMolecules.js +51 -51
- package/build/esm/togetherMoleculesCardAuthor.js +28 -28
- package/build/esm/togetherMoleculesPostImagePreview.js +11 -11
- package/build/esm/togetherMoleculesProfileDetail.js +39 -39
- package/build/esm/togetherOrganisms.js +50 -50
- package/build/esm/togetherRichTextEditor.js +17 -17
- package/build/esm/togetherShareBox.js +10 -10
- package/build/esm/{translationsProvider-81221859.js → translationsProvider-758b393c.js} +1 -1
- package/build/esm/{treePopoverMenu-01379a96.js → treePopoverMenu-a7be6fa9.js} +19 -19
- package/build/esm/{types-106c6788.js → types-09234d12.js} +2 -2
- package/build/esm/types.js +2 -2
- package/build/esm/{useCategory-0dcc4c18.js → useCategory-439c36ec.js} +5 -5
- package/build/esm/{useHealthToolCache-3040ff0e.js → useHealthToolCache-ff826646.js} +1 -1
- package/build/esm/{useMantineLocale-a938a312.js → useMantineLocale-4f58a092.js} +6 -6
- package/build/esm/{usePlacesAutocomplete-b70b7ce0.js → usePlacesAutocomplete-3ac7fb5b.js} +1 -1
- package/build/esm/{useScreenSize-fb33da04.js → useScreenSize-4a774778.js} +2 -2
- package/build/esm/useTogetherAuthRequiredAction.js +10 -10
- package/build/esm/{utils-1628a5f4.js → utils-237e606e.js} +2 -2
- package/build/esm/{utils-8307e0f2.js → utils-4185ec0e.js} +5 -5
- package/build/esm/{utils-58628779.js → utils-9c7b9df3.js} +3 -3
- package/build/esm/{utils-b033a48d.js → utils-a009879a.js} +2 -2
- package/build/esm/vaccination.js +21 -21
- package/build/footer.js +21 -21
- package/build/gAssets.js +2 -2
- package/build/{healthTools-ef3f356e.js → healthTools-573b7c4e.js} +1 -1
- package/build/healthToolsCardWrapper.js +18 -18
- package/build/healthToolsForm.js +33 -33
- package/build/hooks.js +13 -13
- package/build/i18n/translationKeys.d.ts +1 -1
- package/build/i18n-values/en-PH.js +2 -1
- package/build/i18n-values/hi-IN.js +2 -1
- package/build/i18n-values/id-ID.js +4 -3
- package/build/i18n-values/km-KH.js +2 -1
- package/build/i18n-values/ms-MY.js +2 -1
- package/build/i18n-values/my-MM.js +4 -3
- package/build/i18n-values/th-TH.js +4 -3
- package/build/i18n-values/tl-PH.js +2 -1
- package/build/i18n-values/vi-VN.js +2 -1
- package/build/i18n-values/vi-VN_MB.js +2 -1
- package/build/i18n-values/zh-CN.js +2 -1
- package/build/i18n-values/zh-TW.js +2 -1
- package/build/i18n.js +2 -2
- package/build/i18nV2.js +1 -1
- package/build/{index-6eed2bd0.js → index-0301c8c1.js} +6 -6
- package/build/{index-680ab921.js → index-0a89a6c5.js} +25 -25
- package/build/{index-452f1eb5.js → index-0ae1731a.js} +1 -1
- package/build/{index-421eca75.js → index-0b74c3a7.js} +1 -1
- package/build/{index-d9e7c442.js → index-0b79d267.js} +7 -7
- package/build/{index-32de8260.js → index-0be303cf.js} +16 -16
- package/build/{index-3e936ef5.js → index-10dc0a81.js} +2 -2
- package/build/{index-db8fadeb.js → index-14f9daee.js} +3 -3
- package/build/{index-de153206.js → index-15acc379.js} +3 -3
- package/build/{index-4c660f74.js → index-16078611.js} +1 -1
- package/build/{index-c32c7d30.js → index-1df6d6f1.js} +15 -15
- package/build/{index-559e5501.js → index-2ee722e4.js} +3 -3
- package/build/{index-41864bfb.js → index-328a6f00.js} +2 -2
- package/build/{index-a8d0cfdb.js → index-3a1c1349.js} +2 -2
- package/build/{index-75a9eb0b.js → index-4220f03e.js} +31 -31
- package/build/{index-67083665.js → index-42832d74.js} +4 -4
- package/build/{index-32ff35c0.js → index-510cd5d8.js} +17 -17
- package/build/{index-594452e3.js → index-52c688e0.js} +2 -2
- package/build/{index-f3df9d5a.js → index-53cea17c.js} +2 -2
- package/build/{index-489453d0.js → index-5c04d82c.js} +1 -1
- package/build/{index-643c6e04.js → index-5c5b0d7a.js} +1 -1
- package/build/{index-7d75fcfc.js → index-6609c397.js} +13 -13
- package/build/{index-02dab628.js → index-6e7e3c83.js} +1 -1
- package/build/{index-46a9a7d0.js → index-6e976e69.js} +3 -3
- package/build/{index-afc8b11a.js → index-7135ab38.js} +17 -17
- package/build/{index-d60f043e.js → index-73c50e6a.js} +31 -31
- package/build/{index-e8b11e75.js → index-7578a98b.js} +6 -6
- package/build/{index-6ee435b6.js → index-7a0b4e4c.js} +17 -17
- package/build/{index-c6008b7f.js → index-7c181401.js} +13 -13
- package/build/{index-4371c483.js → index-7d99e425.js} +10 -10
- package/build/{index-9f32ab48.js → index-86d2e33e.js} +16 -16
- package/build/{index-5f147d35.js → index-894de8e5.js} +22 -22
- package/build/{index-35d14d51.js → index-8c5a772d.js} +2 -2
- package/build/{index-d75ddba4.js → index-8e2028b1.js} +5 -5
- package/build/{index-55f0a158.js → index-929827df.js} +16 -16
- package/build/{index-4eadb6ba.js → index-9302a2ba.js} +17 -17
- package/build/{index-4108e3bd.js → index-9373d295.js} +7 -7
- package/build/{index-61953c36.js → index-95b9acb2.js} +2 -2
- package/build/{index-4969f8b1.js → index-960c740f.js} +18 -18
- package/build/{index-4c7f641f.js → index-9affc8c8.js} +13 -13
- package/build/{index-f7e54e43.js → index-a00370d2.js} +6 -6
- package/build/{index-02559d27.js → index-a4054d6f.js} +2 -2
- package/build/{index-a7b14ca9.js → index-bb7eb3ba.js} +8 -8
- package/build/{index-7e08e497.js → index-bf9d1bd1.js} +5 -5
- package/build/{index-c9f1f650.js → index-c0df48e7.js} +2 -2
- package/build/{index-e9a7b940.js → index-c0e89bf1.js} +13 -13
- package/build/{index-31054a1b.js → index-c784e708.js} +24 -24
- package/build/{index-073c424b.js → index-c91511d7.js} +1 -1
- package/build/{index-2dc187b5.js → index-cb970cf4.js} +1 -1
- package/build/{index-0c5952a5.js → index-cdc87700.js} +2 -2
- package/build/{index-55a8b4bd.js → index-de075e9f.js} +2 -2
- package/build/{index-a44a04cc.js → index-deea70cf.js} +6 -6
- package/build/{index-3e9a3e81.js → index-e4ecee0e.js} +2 -2
- package/build/{index-d139926a.js → index-e611fdb0.js} +2 -2
- package/build/{index-155eb40c.js → index-e70edd5b.js} +3 -3
- package/build/{index-112ee36d.js → index-e897fc1f.js} +3 -3
- package/build/{index-daac6272.js → index-e91c793a.js} +230 -146
- package/build/{index-47f90fa7.js → index-eae4ff4f.js} +21 -21
- package/build/{index-2ad920e4.js → index-ec9686cc.js} +4 -4
- package/build/{index-789b8839.js → index-efec23d7.js} +18 -18
- package/build/{index-c65f351d.js → index-f371d961.js} +1 -1
- package/build/{index-0579b04b.js → index-f3fbda04.js} +2 -2
- package/build/{index-0d40fbb1.js → index-f49d538c.js} +6 -6
- package/build/{index-010e7c77.js → index-f86566d5.js} +11 -11
- package/build/{index-d79537c0.js → index-ffed6397.js} +16 -16
- package/build/index.js +118 -118
- package/build/{labelSorting-fdf79870.js → labelSorting-55531d4b.js} +4 -4
- package/build/lead/LeadGen.helpers.d.ts +14 -14
- package/build/lead/LeadGen.type.d.ts +19 -0
- package/build/lead/LeadGenForm/LeadGenEmpty.d.ts +8 -0
- package/build/lead/LeadGenForm/LeadGenForm.helpers.d.ts +1 -1
- package/build/lead/LeadGenLightBoxB/LeadGenLightBoxB.styled.d.ts +262 -0
- package/build/lead/components/context.d.ts +3 -2
- package/build/lead/components/index.d.ts +3 -2
- package/build/lead/icons/NoData.d.ts +3 -0
- package/build/lead/icons/index.d.ts +5 -0
- package/build/lead/layouts/lightbox/index.d.ts +8 -4
- package/build/lead/leadGenContext.d.ts +7 -0
- package/build/lead/newLeadPopup.d.ts +5 -3
- package/build/lead/services/index.d.ts +2 -1
- package/build/lead/utils/formatFormData.d.ts +1 -0
- package/build/lead/utils/formatTrackingData.d.ts +14 -0
- package/build/lead.css +1 -1
- package/build/lead.js +738 -275
- package/build/{logoIcon-4722afa4.js → logoIcon-22144be3.js} +2 -2
- package/build/mantine.js +22 -22
- package/build/misc.js +17 -17
- package/build/miscGetDynamicHealthTool.js +4 -4
- package/build/miscGetSocialList.js +8 -8
- package/build/miscScreenSizeContext.js +1 -1
- package/build/mobileBottomNavigation.js +5 -5
- package/build/mobileBottomNavigationIcon.js +5 -5
- package/build/molecules.js +74 -74
- package/build/moleculesArticleCard.js +6 -6
- package/build/moleculesArticleCardV2.js +16 -16
- package/build/navigation.js +46 -46
- package/build/navigationLogoutPopup.js +9 -9
- package/build/navigationProfileButton.js +23 -23
- package/build/onboardingV2.js +28 -28
- package/build/organisms.js +50 -50
- package/build/{post-0950ef7f.js → post-b38dfffb.js} +2 -2
- package/build/profileNavigation.js +19 -19
- package/build/progressBar.js +1 -1
- package/build/pwg.js +22 -22
- package/build/ssoV2/api/featureFlag.d.ts +2 -1
- package/build/ssoV2.js +50 -38
- package/build/{store-b11d784b.js → store-19113253.js} +3 -3
- package/build/subot.js +35 -35
- package/build/surveyOrPremiumBanner.js +33 -33
- package/build/surveyQuestionCard.js +10 -10
- package/build/{surveyThankyouCard-2b36d7a8.js → surveyThankyouCard-2aabad24.js} +5 -5
- package/build/together/components/molecules/createNewPostContentV2/index.styled.d.ts +7 -0
- package/build/together/utils/index.d.ts +1 -0
- package/build/together.js +56 -56
- package/build/togetherApiUtils.js +4 -4
- package/build/togetherAtoms.js +30 -30
- package/build/togetherComponentGlobalContext.js +4 -4
- package/build/togetherMolecules.js +51 -51
- package/build/togetherMoleculesCardAuthor.js +28 -28
- package/build/togetherMoleculesPostImagePreview.js +11 -11
- package/build/togetherMoleculesProfileDetail.js +39 -39
- package/build/togetherOrganisms.js +50 -50
- package/build/togetherRichTextEditor.js +17 -17
- package/build/togetherShareBox.js +10 -10
- package/build/{translationsProvider-90d21e5c.js → translationsProvider-219524af.js} +1 -1
- package/build/{treePopoverMenu-b79c47b2.js → treePopoverMenu-495600da.js} +19 -19
- package/build/{types-7acb1092.js → types-297843f7.js} +2 -2
- package/build/types.js +2 -2
- package/build/{useCategory-7e682543.js → useCategory-6077013c.js} +5 -5
- package/build/{useHealthToolCache-ea23d86b.js → useHealthToolCache-127e942c.js} +1 -1
- package/build/{useMantineLocale-ec184683.js → useMantineLocale-8b5328da.js} +6 -6
- package/build/{usePlacesAutocomplete-b1cef70f.js → usePlacesAutocomplete-c4096401.js} +1 -1
- package/build/{useScreenSize-03555d45.js → useScreenSize-1e356362.js} +2 -2
- package/build/useTogetherAuthRequiredAction.js +10 -10
- package/build/{utils-406b2205.js → utils-2d5c2270.js} +5 -5
- package/build/{utils-ebffddc8.js → utils-5316edfa.js} +3 -3
- package/build/{utils-2d61d335.js → utils-6b741a52.js} +2 -2
- package/build/{utils-bd12e381.js → utils-ea7ed7d8.js} +2 -2
- package/build/vaccination.js +21 -21
- package/package.json +1 -1
- /package/build/{BMI_BOYS.percentile.monthly-8c9db15a.js → BMI_BOYS.percentile.monthly-8c87dbb9.js} +0 -0
- /package/build/{BMI_BOYS.percentile.weekly-a689769b.js → BMI_BOYS.percentile.weekly-a95e009a.js} +0 -0
- /package/build/{BMI_BOYS.percentile.yearly-e1ebccf8.js → BMI_BOYS.percentile.yearly-06d1b212.js} +0 -0
- /package/build/{BMI_BOYS.zscore.monthly-7e63d878.js → BMI_BOYS.zscore.monthly-c7dfdddb.js} +0 -0
- /package/build/{BMI_BOYS.zscore.weekly-07720b7b.js → BMI_BOYS.zscore.weekly-88adf7d3.js} +0 -0
- /package/build/{BMI_BOYS.zscore.yearly-f7db7131.js → BMI_BOYS.zscore.yearly-c1aa3e51.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.monthly-201cb258.js → BMI_GIRLS.percentile.monthly-cd4bd461.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.weekly-0ece140c.js → BMI_GIRLS.percentile.weekly-16c5f35a.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.yearly-468fe324.js → BMI_GIRLS.percentile.yearly-03800789.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.monthly-cf26ac1d.js → BMI_GIRLS.zscore.monthly-e93abe06.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.weekly-7b93dc72.js → BMI_GIRLS.zscore.weekly-9625ac78.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.yearly-f874af51.js → BMI_GIRLS.zscore.yearly-561f33b4.js} +0 -0
- /package/build/{ChevronDown-bff6582f.js → ChevronDown-e4dd2c7b.js} +0 -0
- /package/build/{Close-539a8ab1.js → Close-bcd0f86d.js} +0 -0
- /package/build/{Google-550c0f4d.js → Google-b5b22431.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-5a4e8b87.js → HEAD CIRCUM_BOYS.percentile.monthly-2c6ced17.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-1f55d2ba.js → HEAD CIRCUM_BOYS.percentile.weekly-95f8b51d.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-e1ef2dc7.js → HEAD CIRCUM_BOYS.percentile.yearly-554a0464.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-165874ce.js → HEAD CIRCUM_BOYS.zscore.monthly-ed29d930.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-9cc6d575.js → HEAD CIRCUM_BOYS.zscore.weekly-e5c9d342.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-90ed27d1.js → HEAD CIRCUM_BOYS.zscore.yearly-defc072e.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-875f0106.js → HEAD CIRCUM_GIRLS.percentile.monthly-030f9924.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-647840ea.js → HEAD CIRCUM_GIRLS.percentile.weekly-b373d1ea.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-17885f9f.js → HEAD CIRCUM_GIRLS.percentile.yearly-d902e37e.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-fcc741aa.js → HEAD CIRCUM_GIRLS.zscore.monthly-03076a18.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-d8557fdd.js → HEAD CIRCUM_GIRLS.zscore.weekly-9a112900.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-cda06d21.js → HEAD CIRCUM_GIRLS.zscore.yearly-2f398dda.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.monthly-23de96e5.js → HEIGHT_BOYS.percentile.monthly-03a52d0e.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.weekly-d7fdaee3.js → HEIGHT_BOYS.percentile.weekly-7562b29e.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.yearly-539c0d26.js → HEIGHT_BOYS.percentile.yearly-be8f3d6d.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.monthly-ec859f90.js → HEIGHT_BOYS.zscore.monthly-3054fee2.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.weekly-d73df3e0.js → HEIGHT_BOYS.zscore.weekly-4e228a18.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.yearly-13c44198.js → HEIGHT_BOYS.zscore.yearly-f52b208d.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.monthly-846127be.js → HEIGHT_GIRLS.percentile.monthly-3e9bf11f.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.weekly-7103bf04.js → HEIGHT_GIRLS.percentile.weekly-c3259328.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.yearly-ba7949c5.js → HEIGHT_GIRLS.percentile.yearly-1fda6433.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.monthly-2b71db1d.js → HEIGHT_GIRLS.zscore.monthly-e5594055.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.weekly-ff81a4fc.js → HEIGHT_GIRLS.zscore.weekly-ae91bcb2.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.yearly-c29cf18e.js → HEIGHT_GIRLS.zscore.yearly-7ebba771.js} +0 -0
- /package/build/{Locale-7978c9cc.js → Locale-764d0fe0.js} +0 -0
- /package/build/{Visible-516f027e.js → Visible-8f3abc2a.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.monthly-88977b50.js → WEIGHT_BOYS.percentile.monthly-742e3b01.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.weekly-98331f0b.js → WEIGHT_BOYS.percentile.weekly-a189ae12.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.yearly-e7945da5.js → WEIGHT_BOYS.percentile.yearly-ccf99262.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.monthly-c04658e6.js → WEIGHT_BOYS.zscore.monthly-26ec10b2.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.weekly-98b9b101.js → WEIGHT_BOYS.zscore.weekly-ae8b99e9.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.yearly-a220a344.js → WEIGHT_BOYS.zscore.yearly-ecc51a68.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.monthly-051c5ec2.js → WEIGHT_GIRLS.percentile.monthly-958728a2.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.weekly-f58b6b99.js → WEIGHT_GIRLS.percentile.weekly-be5ac197.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.yearly-4b5240ec.js → WEIGHT_GIRLS.percentile.yearly-b7493047.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.monthly-e01b1eac.js → WEIGHT_GIRLS.zscore.monthly-e507cc87.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.weekly-a708b96b.js → WEIGHT_GIRLS.zscore.weekly-558e4c47.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.yearly-6ed95997.js → WEIGHT_GIRLS.zscore.yearly-c509cc17.js} +0 -0
- /package/build/{animation-6a6f59d2.js → animation-b6d63455.js} +0 -0
- /package/build/{constants-709311e0.js → constants-08c8503c.js} +0 -0
- /package/build/{constants-6502967a.js → constants-1def5869.js} +0 -0
- /package/build/{constants-11de5f84.js → constants-aa94cfb3.js} +0 -0
- /package/build/{dataTransform-c89de3b2.js → dataTransform-3a47799a.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.monthly-2d868e0c.js → BMI_BOYS.percentile.monthly-f2b0325e.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.weekly-ac1b69d6.js → BMI_BOYS.percentile.weekly-875d1828.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.yearly-602fbd5f.js → BMI_BOYS.percentile.yearly-de9ef920.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.monthly-7893698e.js → BMI_BOYS.zscore.monthly-f930cc1f.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.weekly-c46ff024.js → BMI_BOYS.zscore.weekly-7ec4145d.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.yearly-232bcb49.js → BMI_BOYS.zscore.yearly-43d7922a.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.monthly-e3867d77.js → BMI_GIRLS.percentile.monthly-a45d89ae.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.weekly-e632c7b9.js → BMI_GIRLS.percentile.weekly-ad981320.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.yearly-5c5b660b.js → BMI_GIRLS.percentile.yearly-43bcf39e.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.monthly-cffd34cd.js → BMI_GIRLS.zscore.monthly-2ed18934.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.weekly-1419f794.js → BMI_GIRLS.zscore.weekly-e2abe780.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.yearly-bd701532.js → BMI_GIRLS.zscore.yearly-b8703f79.js} +0 -0
- /package/build/esm/{ChevronDown-3b3c3b11.js → ChevronDown-9d4502b8.js} +0 -0
- /package/build/esm/{Close-c214dfa7.js → Close-cdcf7f34.js} +0 -0
- /package/build/esm/{Google-afd75689.js → Google-f1ba73bb.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-bae7c034.js → HEAD CIRCUM_BOYS.percentile.monthly-c3ac7f15.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-55e5bf84.js → HEAD CIRCUM_BOYS.percentile.weekly-8f341e02.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-f2bdc060.js → HEAD CIRCUM_BOYS.percentile.yearly-474d437f.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-77f983fe.js → HEAD CIRCUM_BOYS.zscore.monthly-7536cea6.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-811b1a1b.js → HEAD CIRCUM_BOYS.zscore.weekly-e8dcd6e7.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-6fed0fd8.js → HEAD CIRCUM_BOYS.zscore.yearly-19e81e31.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-0c53afce.js → HEAD CIRCUM_GIRLS.percentile.monthly-cd4951df.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-9e9e04f5.js → HEAD CIRCUM_GIRLS.percentile.weekly-57269718.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-ee3dd4ff.js → HEAD CIRCUM_GIRLS.percentile.yearly-50e398a3.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-bf037d95.js → HEAD CIRCUM_GIRLS.zscore.monthly-c52954fd.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-3cfe94a6.js → HEAD CIRCUM_GIRLS.zscore.weekly-4b2e158a.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-229833dd.js → HEAD CIRCUM_GIRLS.zscore.yearly-e27bb59b.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.monthly-deb1db57.js → HEIGHT_BOYS.percentile.monthly-61e22fac.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.weekly-0f0eb34e.js → HEIGHT_BOYS.percentile.weekly-222868de.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.yearly-af19ac11.js → HEIGHT_BOYS.percentile.yearly-42934db4.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.monthly-c77f2195.js → HEIGHT_BOYS.zscore.monthly-b7ccce93.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.weekly-ea779b14.js → HEIGHT_BOYS.zscore.weekly-f07f0785.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.yearly-60bfb51f.js → HEIGHT_BOYS.zscore.yearly-d5116dc8.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-9f813296.js → HEIGHT_GIRLS.percentile.monthly-08751df2.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-31a888f2.js → HEIGHT_GIRLS.percentile.weekly-4bd8e4e8.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-f5b633ab.js → HEIGHT_GIRLS.percentile.yearly-d62cbdf7.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-84fbd8ad.js → HEIGHT_GIRLS.zscore.monthly-36ca108f.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-8563c02b.js → HEIGHT_GIRLS.zscore.weekly-b251e8bf.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-d508d9c2.js → HEIGHT_GIRLS.zscore.yearly-b95dc445.js} +0 -0
- /package/build/esm/{Locale-ce7c9574.js → Locale-2f050a8d.js} +0 -0
- /package/build/esm/{Visible-2b74bc97.js → Visible-4f1c6c65.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.monthly-bcab94ad.js → WEIGHT_BOYS.percentile.monthly-958090ba.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.weekly-edc41c40.js → WEIGHT_BOYS.percentile.weekly-5def56a5.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.yearly-1484930e.js → WEIGHT_BOYS.percentile.yearly-9a065853.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.monthly-9db45a44.js → WEIGHT_BOYS.zscore.monthly-22619dee.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.weekly-1a71c413.js → WEIGHT_BOYS.zscore.weekly-c07832d3.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.yearly-c2bc9e67.js → WEIGHT_BOYS.zscore.yearly-8988e7f1.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-2e1c85e0.js → WEIGHT_GIRLS.percentile.monthly-fe1b2278.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-74360200.js → WEIGHT_GIRLS.percentile.weekly-e1de02ea.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-f34f0558.js → WEIGHT_GIRLS.percentile.yearly-57a685e8.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-059ac703.js → WEIGHT_GIRLS.zscore.monthly-05c7452e.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-e1fb2fd8.js → WEIGHT_GIRLS.zscore.weekly-2436f9ee.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-77eb5efd.js → WEIGHT_GIRLS.zscore.yearly-41f599b0.js} +0 -0
- /package/build/esm/{animation-27d62e38.js → animation-d183eff6.js} +0 -0
- /package/build/esm/{constants-224a9c9d.js → constants-1c442ee9.js} +0 -0
- /package/build/esm/{constants-3cb473c5.js → constants-1ce7a0c8.js} +0 -0
- /package/build/esm/{constants-ca7208a4.js → constants-dd5c7e21.js} +0 -0
- /package/build/esm/{dataTransform-7141f77c.js → dataTransform-43dd3ad8.js} +0 -0
- /package/build/esm/{index-2e9997c5.js → index-1888a823.js} +0 -0
- /package/build/esm/{index-243017fd.js → index-67ade6b4.js} +0 -0
- /package/build/esm/{index-16a5ad99.js → index-6c4db0e7.js} +0 -0
- /package/build/esm/{index-6ef9420b.js → index-86beec3b.js} +0 -0
- /package/build/esm/{index-6f28b547.js → index-a4e33581.js} +0 -0
- /package/build/esm/{index-8ca926b3.js → index-b8bab345.js} +0 -0
- /package/build/esm/{index-e31e78b8.js → index-b98a4ccb.js} +0 -0
- /package/build/esm/{index-725acd8e.js → index-ebfab7bd.js} +0 -0
- /package/build/esm/{index.styles-d2bdab8c.js → index.styles-84a7085d.js} +0 -0
- /package/build/esm/lead/layouts/{ emptyIcon.d.ts → emptyIcon.d.ts} +0 -0
- /package/build/esm/{localizeNumberFormat-7fbc5ef2.js → localizeNumberFormat-39c041df.js} +0 -0
- /package/build/esm/{normalizeLink-2e955111.js → normalizeLink-c69706f9.js} +0 -0
- /package/build/esm/{number-2c21651a.js → number-9e1e33b6.js} +0 -0
- /package/build/esm/{other-9f3029ec.js → other-b55c2cac.js} +0 -0
- /package/build/esm/{paths-badc1b3b.js → paths-8049aab1.js} +0 -0
- /package/build/esm/{translationsContext-8059f988.js → translationsContext-8bed8935.js} +0 -0
- /package/build/esm/{tslib.es6-920542f4.js → tslib.es6-11765615.js} +0 -0
- /package/build/esm/{types-d19dcc16.js → types-487284bc.js} +0 -0
- /package/build/esm/{useIsInit-80a86f68.js → useIsInit-98fef9f5.js} +0 -0
- /package/build/esm/{useOutsideClick-ee68528a.js → useOutsideClick-06ae1afa.js} +0 -0
- /package/build/esm/{useScrollbarSize-a550eea1.js → useScrollbarSize-3dc0c03a.js} +0 -0
- /package/build/esm/{useUniqueId-c8370483.js → useUniqueId-4ecc826a.js} +0 -0
- /package/build/esm/{utils-2369b642.js → utils-860b86e8.js} +0 -0
- /package/build/{index-6f22b55e.js → index-1aa847ab.js} +0 -0
- /package/build/{index-c895266c.js → index-24c4277b.js} +0 -0
- /package/build/{index-a200e69c.js → index-625743b3.js} +0 -0
- /package/build/{index-6d1e1360.js → index-7d894a46.js} +0 -0
- /package/build/{index-8223092b.js → index-8d730e72.js} +0 -0
- /package/build/{index-55b1bfa8.js → index-a072750b.js} +0 -0
- /package/build/{index-1f64a5dc.js → index-d3461fe7.js} +0 -0
- /package/build/{index-6625747d.js → index-eb89eb77.js} +0 -0
- /package/build/{index.styles-e555d060.js → index.styles-f9408092.js} +0 -0
- /package/build/lead/layouts/{ emptyIcon.d.ts → emptyIcon.d.ts} +0 -0
- /package/build/{localizeNumberFormat-cbba4877.js → localizeNumberFormat-d03061a6.js} +0 -0
- /package/build/{normalizeLink-4008bb97.js → normalizeLink-8aa84155.js} +0 -0
- /package/build/{number-2bb6487c.js → number-d3ca8272.js} +0 -0
- /package/build/{other-3d614c90.js → other-8f691b82.js} +0 -0
- /package/build/{paths-e0e4a30a.js → paths-b04efd22.js} +0 -0
- /package/build/{translationsContext-ae3c7cbc.js → translationsContext-a3e31b9e.js} +0 -0
- /package/build/{tslib.es6-bd4b6f69.js → tslib.es6-ecad3526.js} +0 -0
- /package/build/{types-160c4161.js → types-c43067bb.js} +0 -0
- /package/build/{useIsInit-6ed13d1d.js → useIsInit-a9d121eb.js} +0 -0
- /package/build/{useOutsideClick-0864ce66.js → useOutsideClick-20154526.js} +0 -0
- /package/build/{useScrollbarSize-7c9c913d.js → useScrollbarSize-95baac26.js} +0 -0
- /package/build/{useUniqueId-3ad4fe36.js → useUniqueId-42fb6d03.js} +0 -0
- /package/build/{utils-e56bcd6e.js → utils-f619e399.js} +0 -0
package/build/esm/lead.js
CHANGED
|
@@ -1,52 +1,53 @@
|
|
|
1
|
-
import { _ as __rest, a as __awaiter } from './tslib.es6-
|
|
1
|
+
import { _ as __rest, a as __awaiter } from './tslib.es6-11765615.js';
|
|
2
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,
|
|
4
|
-
import dayjs from 'dayjs';
|
|
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';
|
|
5
4
|
import debounce from 'lodash/debounce';
|
|
6
5
|
import { createFormContext, useForm } from '@mantine/form';
|
|
7
|
-
import
|
|
6
|
+
import dayjs from 'dayjs';
|
|
7
|
+
import { B as BEARER_TOKEN_COOKIE } from './index-5e6a0609.js';
|
|
8
8
|
import { getCookie, setCookie } from './miscCookieHelper.js';
|
|
9
|
-
import { u as useTranslations } from './index-
|
|
10
|
-
import { T as TranslationsContext } from './translationsContext-
|
|
11
|
-
import { M as MediaQueries, b as getWrapperDomWithSelector, a as getPopupWrapperDom } from './utils-
|
|
12
|
-
import { T as Text } from './index-
|
|
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-
|
|
14
|
-
import { D as DatePicker } from './index-
|
|
15
|
-
import { B as Button } from './index-
|
|
16
|
-
import './index.styles-
|
|
9
|
+
import { u as useTranslations } from './index-be5ba37e.js';
|
|
10
|
+
import { T as TranslationsContext } from './translationsContext-8bed8935.js';
|
|
11
|
+
import { M as MediaQueries, b as getWrapperDomWithSelector, a as getPopupWrapperDom } from './utils-860b86e8.js';
|
|
12
|
+
import { T as Text } from './index-9c8a599d.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-5a1b18fe.js';
|
|
14
|
+
import { D as DatePicker } from './index-493cae6d.js';
|
|
15
|
+
import { B as Button } from './index-45a645d6.js';
|
|
16
|
+
import './index.styles-84a7085d.js';
|
|
17
17
|
import { useClickOutside } from '@mantine/hooks';
|
|
18
|
-
import './useMantineLocale-
|
|
19
|
-
import { C as COMMON_DATE_TRANSLATE_KEY } from './index-
|
|
20
|
-
import './index-
|
|
21
|
-
import { Z as ZINDEX_SSO, I as ISO_FORMAT } from './index-
|
|
22
|
-
import './other-
|
|
23
|
-
import './index-
|
|
24
|
-
import { M as MAPPED_LOCALE } from './utils-
|
|
18
|
+
import './useMantineLocale-4f58a092.js';
|
|
19
|
+
import { C as COMMON_DATE_TRANSLATE_KEY } from './index-bd0c1846.js';
|
|
20
|
+
import './index-6c4db0e7.js';
|
|
21
|
+
import { Z as ZINDEX_SSO, I as ISO_FORMAT } from './index-4e04114c.js';
|
|
22
|
+
import './other-b55c2cac.js';
|
|
23
|
+
import './index-6e0b2ec9.js';
|
|
24
|
+
import { M as MAPPED_LOCALE } from './utils-a009879a.js';
|
|
25
25
|
import { DateInput } from '@mantine/dates';
|
|
26
|
-
import { u as usePlacesAutocomplete, G as GOOGLE_API_KEY } from './usePlacesAutocomplete-
|
|
27
|
-
import { H as Heading$1 } from './index-
|
|
28
|
-
import { t as translationsMap$1 } from './translationsProvider-
|
|
29
|
-
import { L as LOCALE } from './Locale-
|
|
26
|
+
import { u as usePlacesAutocomplete, G as GOOGLE_API_KEY } from './usePlacesAutocomplete-3ac7fb5b.js';
|
|
27
|
+
import { H as Heading$1 } from './index-8afffc50.js';
|
|
28
|
+
import { t as translationsMap$1 } from './translationsProvider-758b393c.js';
|
|
29
|
+
import { L as LOCALE } from './Locale-2f050a8d.js';
|
|
30
30
|
import { v1 } from 'uuid';
|
|
31
31
|
import { parsePhoneNumber } from 'react-phone-number-input';
|
|
32
32
|
import styled from '@emotion/styled';
|
|
33
33
|
import { theme } from './miscTheme.js';
|
|
34
34
|
import { css } from '@emotion/react';
|
|
35
|
-
import { T as TogetherComponentGlobalContext } from './utils-
|
|
36
|
-
import { i as isVideo } from './index-
|
|
37
|
-
import { u as useScreenSize } from './useScreenSize-
|
|
35
|
+
import { T as TogetherComponentGlobalContext } from './utils-9c7b9df3.js';
|
|
36
|
+
import { i as isVideo } from './index-1888a823.js';
|
|
37
|
+
import { u as useScreenSize } from './useScreenSize-4a774778.js';
|
|
38
|
+
import { motion } from 'framer-motion';
|
|
38
39
|
import { createPortal } from 'react-dom';
|
|
39
|
-
import { B as Button$2 } from './index-
|
|
40
|
-
import { I as InputDate } from './InputDate-
|
|
41
|
-
import { D as DrawerComponent } from './index-
|
|
42
|
-
import { C as Close } from './Close-
|
|
40
|
+
import { B as Button$2 } from './index-ab464f29.js';
|
|
41
|
+
import { I as InputDate } from './InputDate-c206ae02.js';
|
|
42
|
+
import { D as DrawerComponent } from './index-9154a4b5.js';
|
|
43
|
+
import { C as Close } from './Close-cdcf7f34.js';
|
|
43
44
|
import './constantsIsProduction.js';
|
|
44
|
-
import './normalizeLink-
|
|
45
|
+
import './normalizeLink-c69706f9.js';
|
|
45
46
|
import './constantsDomainLocales.js';
|
|
46
47
|
import '@hhgtech/icons/other';
|
|
47
48
|
import '@mantine/carousel';
|
|
48
49
|
import 'classnames';
|
|
49
|
-
import './useUniqueId-
|
|
50
|
+
import './useUniqueId-4ecc826a.js';
|
|
50
51
|
import './constantsSite.js';
|
|
51
52
|
import '@hhgtech/icons/core';
|
|
52
53
|
import '@mantine/notifications';
|
|
@@ -63,11 +64,11 @@ import './i18n-values/tl-PH.js';
|
|
|
63
64
|
import './i18n-values/vi-VN.js';
|
|
64
65
|
import './i18n-values/vi-VN_MB.js';
|
|
65
66
|
import './i18n-values/zh-TW.js';
|
|
66
|
-
import './index-
|
|
67
|
+
import './index-a4e33581.js';
|
|
67
68
|
import 'slugify';
|
|
68
69
|
import 'string-format';
|
|
69
70
|
import './togetherApiPaths.js';
|
|
70
|
-
import './constants-
|
|
71
|
+
import './constants-dd5c7e21.js';
|
|
71
72
|
import 'vaul';
|
|
72
73
|
|
|
73
74
|
const LeadGenComponentContext = createContext({});
|
|
@@ -162,20 +163,21 @@ const LEADGEN_ACTIONS = {
|
|
|
162
163
|
SCROLL: 'SCROLL',
|
|
163
164
|
TIME: 'TIME',
|
|
164
165
|
};
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
166
|
+
var LEADGEN_LAYOUT;
|
|
167
|
+
(function (LEADGEN_LAYOUT) {
|
|
168
|
+
LEADGEN_LAYOUT["LightBoxA"] = "LightBoxA";
|
|
169
|
+
LEADGEN_LAYOUT["LightBoxB"] = "LightBoxB";
|
|
170
|
+
LEADGEN_LAYOUT["SkinA"] = "SkinA";
|
|
171
|
+
LEADGEN_LAYOUT["SkinB"] = "SkinB";
|
|
172
|
+
LEADGEN_LAYOUT["Floating"] = "Floating";
|
|
173
|
+
LEADGEN_LAYOUT["Tab"] = "Tab";
|
|
174
|
+
LEADGEN_LAYOUT["InlineA"] = "InlineA";
|
|
175
|
+
LEADGEN_LAYOUT["InlineB"] = "InlineB";
|
|
176
|
+
LEADGEN_LAYOUT["CenterTab"] = "CenterTab";
|
|
177
|
+
LEADGEN_LAYOUT["Sidebar"] = "Sidebar";
|
|
178
|
+
LEADGEN_LAYOUT["Fullscreen"] = "Fullscreen";
|
|
179
|
+
LEADGEN_LAYOUT["Slider"] = "Slider";
|
|
180
|
+
})(LEADGEN_LAYOUT || (LEADGEN_LAYOUT = {}));
|
|
179
181
|
const LEADGEN_BLOCK = {
|
|
180
182
|
TextBlock: 'TextBlock',
|
|
181
183
|
NumberBlock: 'NumberBlock',
|
|
@@ -359,6 +361,18 @@ const formatCampaignDetail = (campaign) => {
|
|
|
359
361
|
}
|
|
360
362
|
};
|
|
361
363
|
|
|
364
|
+
const formatLeadGenFormValue = (values = {}, blocks) => {
|
|
365
|
+
const newValues = {};
|
|
366
|
+
for (const block of blocks) {
|
|
367
|
+
const { data } = block || {};
|
|
368
|
+
const { value: fieldName } = data || {};
|
|
369
|
+
if (fieldName in values) {
|
|
370
|
+
newValues[fieldName] = values[fieldName];
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
return newValues;
|
|
374
|
+
};
|
|
375
|
+
|
|
362
376
|
class Store {
|
|
363
377
|
constructor() {
|
|
364
378
|
this.apiSsoUrl = 'https://staging-id.hellobacsi.com/';
|
|
@@ -512,9 +526,9 @@ const getCampaignByCode = (campaign_code) => {
|
|
|
512
526
|
method: METHOD.GET,
|
|
513
527
|
});
|
|
514
528
|
};
|
|
515
|
-
const getSubscriptionBoxInfo = ({ category, site, }) => {
|
|
529
|
+
const getSubscriptionBoxInfo = ({ category, site, slug, }) => {
|
|
516
530
|
return leadApi.call({
|
|
517
|
-
url: `${LEADGEN_API_PATH.V2_SUBSCRIPTION_INFO}?category=${category}&site=${site}`,
|
|
531
|
+
url: `${LEADGEN_API_PATH.V2_SUBSCRIPTION_INFO}?category=${category}&site=${site}&slug=${slug}`,
|
|
518
532
|
method: METHOD.GET,
|
|
519
533
|
});
|
|
520
534
|
};
|
|
@@ -661,7 +675,7 @@ const clearCacheUsedEmailOrPhone = () => {
|
|
|
661
675
|
const [LeadFormProvider$1, useLeadFormContext$1, useLeadForm$1] = createFormContext();
|
|
662
676
|
const useLeadFormConfig$1 = ({ listBlockAdded = [], validatingPhoneRef, validatingEmailRef, campaignId, campaign_subot_id = [], userInfo, }) => {
|
|
663
677
|
const { t } = useTranslations();
|
|
664
|
-
const initialValues = useMemo(() => mappingSSOToLead(userInfo), [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
|
|
678
|
+
const initialValues = useMemo(() => formatLeadGenFormValue(mappingSSOToLead(userInfo), listBlockAdded), [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
|
|
665
679
|
useEffect(() => {
|
|
666
680
|
if (!window.intlTelInputUtils) {
|
|
667
681
|
require('intl-tel-input/build/js/utils');
|
|
@@ -977,15 +991,15 @@ const Fields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmit, style
|
|
|
977
991
|
case 'TextBlock':
|
|
978
992
|
return (React__default.createElement(Input, Object.assign({ key: index, withAsterisk: required, spellCheck: false, type: "text", placeholder: placeholder, className: cx('leadgen-control', classes.control),
|
|
979
993
|
// onChangeRaw={(e) => inputOnChange('text', e)}
|
|
980
|
-
label: placeholder, "data-control": "text", name: value }, form.getInputProps(value))));
|
|
994
|
+
label: placeholder, "data-control": "text", "data-lead-control": name, name: value }, form.getInputProps(value))));
|
|
981
995
|
case 'NumberBlock':
|
|
982
996
|
return (React__default.createElement(NumberInput, Object.assign({ key: index, withAsterisk: required, spellCheck: false, type: "number", placeholder: placeholder, className: cx('leadgen-control', classes.control),
|
|
983
997
|
// onChange={(e) => inputOnChange('number', e)}
|
|
984
|
-
label: placeholder, "data-control": "number", name: value }, form.getInputProps(value))));
|
|
998
|
+
label: placeholder, "data-control": "number", "data-lead-control": name, name: value }, form.getInputProps(value))));
|
|
985
999
|
case 'EmailBlock':
|
|
986
1000
|
return (React__default.createElement(Input, Object.assign({ key: index, withAsterisk: required, spellCheck: false,
|
|
987
1001
|
// type="email"
|
|
988
|
-
placeholder: placeholder, className: cx('leadgen-control', classes.control), label: placeholder, "data-control": "email", name: value }, form.getInputProps(value))));
|
|
1002
|
+
placeholder: placeholder, className: cx('leadgen-control', classes.control), label: placeholder, "data-control": "email", "data-lead-control": name, name: value }, form.getInputProps(value))));
|
|
989
1003
|
case 'PhoneOtpBlock':
|
|
990
1004
|
case 'WhatsappOtpBlock':
|
|
991
1005
|
case 'ZaloOtpBlock':
|
|
@@ -1000,14 +1014,14 @@ const Fields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmit, style
|
|
|
1000
1014
|
form.setFieldValue(value, v);
|
|
1001
1015
|
},
|
|
1002
1016
|
// onBlur={(e) => inputOnBlur('tel', e)}
|
|
1003
|
-
id: id, defaultCountry: (locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN'), "data-control": "tel" })));
|
|
1017
|
+
id: id, defaultCountry: (locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN'), "data-control": "tel", "data-lead-control": name })));
|
|
1004
1018
|
}
|
|
1005
1019
|
case 'LocationBlock': {
|
|
1006
1020
|
return (React__default.createElement(LocationBlock, { key: index, name: value, placeholder: placeholder, locale: locale, required: required }));
|
|
1007
1021
|
}
|
|
1008
1022
|
case 'DateBlock':
|
|
1009
1023
|
return (React__default.createElement(React__default.Fragment, null,
|
|
1010
|
-
React__default.createElement(DatePicker, Object.assign({ withAsterisk: required, key: index, type: "default", name: value, placeholder: placeholder, className: cx('leadgen-control', classes.control), label: placeholder, "data-control": "date", popoverProps: popoverProps }, form.getInputProps(value))),
|
|
1024
|
+
React__default.createElement(DatePicker, Object.assign({ withAsterisk: required, key: index, type: "default", name: value, placeholder: placeholder, className: cx('leadgen-control', classes.control), label: placeholder, "data-control": "date", "data-lead-control": name, popoverProps: popoverProps }, form.getInputProps(value))),
|
|
1011
1025
|
React__default.createElement("input", { type: "hidden", name: value, "data-control": "date" })));
|
|
1012
1026
|
case 'LinkButtonBlock':
|
|
1013
1027
|
return (React__default.createElement("div", { key: index },
|
|
@@ -1025,11 +1039,11 @@ const Fields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmit, style
|
|
|
1025
1039
|
display: 'flex',
|
|
1026
1040
|
flexDirection: 'column',
|
|
1027
1041
|
gap: 8,
|
|
1028
|
-
} }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default.createElement(Checkbox, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "checkbox" }))))));
|
|
1042
|
+
} }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default.createElement(Checkbox, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "checkbox", "data-lead-control": name }))))));
|
|
1029
1043
|
case 'RadioBlock':
|
|
1030
1044
|
return (React__default.createElement(React__default.Fragment, null,
|
|
1031
1045
|
isSendMailChimp && (React__default.createElement(Input, { type: "hidden", name: value + '-mailchimp', value: isSendMailChimp })),
|
|
1032
|
-
React__default.createElement(Radio.Group, Object.assign({ withAsterisk: required, className: cx('leadgen-control', classes.control), key: index, label: placeholder, size: "md" }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default.createElement(Radio, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "radio" }))))));
|
|
1046
|
+
React__default.createElement(Radio.Group, Object.assign({ withAsterisk: required, className: cx('leadgen-control', classes.control), key: index, label: placeholder, size: "md" }, 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 }))))));
|
|
1033
1047
|
case 'DropdownBlock':
|
|
1034
1048
|
return (React__default.createElement(React__default.Fragment, null,
|
|
1035
1049
|
React__default.createElement("div", { style: { display: 'none' }, "data-extra": true, "data-name": value, "data-control": 'dropdown' }),
|
|
@@ -1040,7 +1054,7 @@ const Fields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmit, style
|
|
|
1040
1054
|
case 'TncBlock':
|
|
1041
1055
|
const tncInputProps = form.getInputProps('TNC-' + b.id);
|
|
1042
1056
|
return (React__default.createElement(React__default.Fragment, null,
|
|
1043
|
-
React__default.createElement(Checkbox, Object.assign({ name: 'TNC-' + b.id, key: b.id, label: React__default.createElement("p", { className: "lead-modal__tnc-link", dangerouslySetInnerHTML: { __html: data.valueHTML } }), className: "tnc-block", "data-control": "checkbox" }, tncInputProps, { error: tncInputProps.error ? tncInputProps.error : undefined }))));
|
|
1057
|
+
React__default.createElement(Checkbox, Object.assign({ name: 'TNC-' + b.id, key: b.id, label: React__default.createElement("p", { className: "lead-modal__tnc-link", dangerouslySetInnerHTML: { __html: data.valueHTML } }), className: "tnc-block", "data-control": "checkbox", "data-lead-control": name }, tncInputProps, { error: tncInputProps.error ? tncInputProps.error : undefined }))));
|
|
1044
1058
|
}
|
|
1045
1059
|
return null;
|
|
1046
1060
|
})));
|
|
@@ -1073,7 +1087,9 @@ const Heading = (_a) => {
|
|
|
1073
1087
|
const FormComponent = ({ styles, className, classNames, fillInfo, popoverProps, submitProps, }) => {
|
|
1074
1088
|
var _a;
|
|
1075
1089
|
const { primaryColor } = useContext(LeadGenContext$1);
|
|
1076
|
-
const { listBlockAdded, leadFormConfig: { form, validateObj }, validatingEmailRef, validatingPhoneRef,
|
|
1090
|
+
const { listBlockAdded, leadFormConfig: { form, validateObj }, validatingEmailRef, validatingPhoneRef,
|
|
1091
|
+
// formRef,
|
|
1092
|
+
setFormRef, onClose, onOtherSubmit, actionBlocks, locale, setShowOtpPhone, onSubmit, } = useContext(LeadGenComponentContext);
|
|
1077
1093
|
const { classes, cx } = useStyles$1(undefined, {
|
|
1078
1094
|
name: 'LeadGen__FormComponent',
|
|
1079
1095
|
styles,
|
|
@@ -1134,7 +1150,7 @@ const FormComponent = ({ styles, className, classNames, fillInfo, popoverProps,
|
|
|
1134
1150
|
var _a;
|
|
1135
1151
|
const respMessage = (_a = res === null || res === void 0 ? void 0 : res._messages) === null || _a === void 0 ? void 0 : _a[0];
|
|
1136
1152
|
if (respMessage === 'This phone number was verified') {
|
|
1137
|
-
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(
|
|
1153
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
|
|
1138
1154
|
return;
|
|
1139
1155
|
}
|
|
1140
1156
|
setShowOtpPhone(newShowOtpPhone);
|
|
@@ -1144,7 +1160,7 @@ const FormComponent = ({ styles, className, classNames, fillInfo, popoverProps,
|
|
|
1144
1160
|
});
|
|
1145
1161
|
return;
|
|
1146
1162
|
}
|
|
1147
|
-
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(
|
|
1163
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
|
|
1148
1164
|
})(e);
|
|
1149
1165
|
}, 100);
|
|
1150
1166
|
};
|
|
@@ -1314,10 +1330,13 @@ const OtpBlockComponent = ({ otpData, onSuccess, autoSendWhenOpen, className, st
|
|
|
1314
1330
|
};
|
|
1315
1331
|
const OtpBlock$1 = (_a) => {
|
|
1316
1332
|
var rest = __rest(_a, []);
|
|
1317
|
-
const { showOtpPhone, setShowOtpPhone, onSubmit,
|
|
1333
|
+
const { showOtpPhone, setShowOtpPhone, onSubmit,
|
|
1334
|
+
// formRef,
|
|
1335
|
+
// leadFormConfig: { form },
|
|
1336
|
+
} = useContext(LeadGenComponentContext);
|
|
1318
1337
|
return showOtpPhone ? (React__default.createElement(OtpBlockComponent, Object.assign({ otpData: showOtpPhone, autoSendWhenOpen: false, onSuccess: () => {
|
|
1319
1338
|
setShowOtpPhone(null);
|
|
1320
|
-
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(
|
|
1339
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
|
|
1321
1340
|
} }, rest))) : null;
|
|
1322
1341
|
};
|
|
1323
1342
|
|
|
@@ -2066,6 +2085,7 @@ const LeadGenContextProvider = (props) => {
|
|
|
2066
2085
|
Service.getSubscriptionBoxInfo({
|
|
2067
2086
|
category: categoryId,
|
|
2068
2087
|
site: site_domain,
|
|
2088
|
+
slug: location === null || location === void 0 ? void 0 : location.pathname,
|
|
2069
2089
|
}).then((res) => {
|
|
2070
2090
|
const { _data } = res || {};
|
|
2071
2091
|
const { item, campaign_code } = _data || {};
|
|
@@ -2119,7 +2139,7 @@ const [LeadFormProvider, useLeadFormContext, useLeadForm] = createFormContext();
|
|
|
2119
2139
|
const useLeadFormConfig = ({ listBlockAdded = [], validatingPhoneRef, validatingEmailRef, campaignId, campaign_subot_id = [], userInfo, format, }) => {
|
|
2120
2140
|
var _a;
|
|
2121
2141
|
const { t } = useTranslations();
|
|
2122
|
-
const initialValues = useMemo(() => mappingSSOToLead(userInfo), [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
|
|
2142
|
+
const initialValues = useMemo(() => formatLeadGenFormValue(mappingSSOToLead(userInfo), listBlockAdded), [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
|
|
2123
2143
|
const LEAD_LOCALE = LEAD_LOCALE_DATA[(_a = document === null || document === void 0 ? void 0 : document.documentElement) === null || _a === void 0 ? void 0 : _a.lang] ||
|
|
2124
2144
|
LEAD_LOCALE_DATA['vi-VN'];
|
|
2125
2145
|
const validateObj = useMemo(() => {
|
|
@@ -2281,7 +2301,7 @@ const useLeadFormConfig = ({ listBlockAdded = [], validatingPhoneRef, validating
|
|
|
2281
2301
|
}, {});
|
|
2282
2302
|
}, [listBlockAdded.map((b) => b.name).join(','), format]);
|
|
2283
2303
|
const form = useLeadForm({
|
|
2284
|
-
validateInputOnChange:
|
|
2304
|
+
validateInputOnChange: false,
|
|
2285
2305
|
validateInputOnBlur: true,
|
|
2286
2306
|
clearInputErrorOnChange: true,
|
|
2287
2307
|
validate: validateObj,
|
|
@@ -2354,15 +2374,14 @@ const StyledLeadGenSubscriptionBoxBody = styled.div `
|
|
|
2354
2374
|
}
|
|
2355
2375
|
`;
|
|
2356
2376
|
const StyledLeadGenSubscriptionBoxHeaderImage = styled.div `
|
|
2357
|
-
margin-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
height: 44px;
|
|
2377
|
+
margin-left: 24px;
|
|
2378
|
+
width: 68px;
|
|
2379
|
+
height: 68px;
|
|
2361
2380
|
|
|
2362
2381
|
img {
|
|
2363
2382
|
width: 100%;
|
|
2364
2383
|
height: 100%;
|
|
2365
|
-
object-
|
|
2384
|
+
object-fit: contain;
|
|
2366
2385
|
onject-position: center;
|
|
2367
2386
|
}
|
|
2368
2387
|
|
|
@@ -2379,7 +2398,7 @@ const StyledLeadGenSubscriptionBoxHeader = styled.div `
|
|
|
2379
2398
|
flex: 1;
|
|
2380
2399
|
min-width: 0;
|
|
2381
2400
|
color: ${theme.colors.gray900};
|
|
2382
|
-
font-size:
|
|
2401
|
+
font-size: 17px;
|
|
2383
2402
|
font-weight: 400;
|
|
2384
2403
|
line-height: 1.4;
|
|
2385
2404
|
letter-spacing: -0.4px;
|
|
@@ -2395,6 +2414,12 @@ const StyledLeadGenSubscriptionBoxHeader = styled.div `
|
|
|
2395
2414
|
const StyledLeadGenSubscriptionBox = styled.div `
|
|
2396
2415
|
padding: 16px;
|
|
2397
2416
|
border: 1px solid ${theme.colors.neutral100};
|
|
2417
|
+
background: linear-gradient(
|
|
2418
|
+
180.71deg,
|
|
2419
|
+
#7bc2ff -18.54%,
|
|
2420
|
+
#e3f2ff 17.12%,
|
|
2421
|
+
#ffffff 99.25%
|
|
2422
|
+
);
|
|
2398
2423
|
border-radius: 12px;
|
|
2399
2424
|
margin-inline: auto;
|
|
2400
2425
|
.leadgen-form_inputs {
|
|
@@ -2428,6 +2453,7 @@ const StyledLeadGenSubscriptionBox = styled.div `
|
|
|
2428
2453
|
margin-left: 8px;
|
|
2429
2454
|
width: auto;
|
|
2430
2455
|
min-height: 56px;
|
|
2456
|
+
font-size: 16px;
|
|
2431
2457
|
}
|
|
2432
2458
|
}
|
|
2433
2459
|
}
|
|
@@ -2467,16 +2493,64 @@ const PhoneInput = forwardRef((props, ref) => {
|
|
|
2467
2493
|
React__default.createElement(Phone, Object.assign({}, restProps, { id: id, ref: ref, name: name, spellCheck: false, placeholder: placeholder, defaultCountry: defaultCountry, className: "mantine-Input-input", type: "tel", "data-control": "tel" })))));
|
|
2468
2494
|
});
|
|
2469
2495
|
|
|
2470
|
-
const
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2496
|
+
const NoData = ({ className, style }) => {
|
|
2497
|
+
return (React__default.createElement("svg", { width: "64", height: "55", viewBox: "0 0 64 55", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, style: style },
|
|
2498
|
+
React__default.createElement("path", { d: "M32.6226 54.0001C46.2852 54.0001 57.3652 43.0033 57.3652 29.4239C57.3652 15.8446 46.2852 4.84778 32.6226 4.84778C18.9599 4.84778 7.87988 15.8446 7.87988 29.4239C7.87988 43.0033 18.9599 54.0001 32.6226 54.0001Z", fill: "#E6EAF5" }),
|
|
2499
|
+
React__default.createElement("path", { d: "M51.5751 26.2165V41.2537C51.5751 44.3778 49.0342 46.9187 45.8684 46.9187H19.4596C16.3355 46.9187 13.7946 44.4195 13.7529 41.2954C13.7529 41.2537 13.7529 41.2537 13.7529 41.2121V26.2165C13.7529 26.1748 13.7529 26.1748 13.7529 26.1332C13.7529 26.0498 13.7529 25.9665 13.7946 25.8832C13.8362 25.7583 13.8779 25.675 13.9195 25.55L21.0008 12.0123C21.2507 11.4708 21.7922 11.1792 22.3754 11.1792H42.911C43.4941 11.1792 43.994 11.4708 44.2856 12.0123L51.3668 25.55C51.4085 25.6333 51.4501 25.7583 51.4918 25.8832C51.5751 25.9665 51.5751 26.0915 51.5751 26.2165Z", fill: "#D5DDEA" }),
|
|
2500
|
+
React__default.createElement("path", { d: "M51.5751 26.2164V42.7949C51.5751 45.0859 49.7423 46.9187 47.4096 46.9187H17.9184C15.6274 46.9187 13.7529 45.0859 13.7529 42.7949V26.1331C13.7529 26.0498 13.7529 25.9665 13.7946 25.8832H23.2918C24.708 25.8832 25.8743 27.0078 25.8743 28.4658C25.8743 29.1739 26.1659 29.8404 26.6241 30.2986C27.124 30.7984 27.7071 31.0483 28.4569 31.0483H36.9127C38.329 31.0483 39.4953 29.9237 39.4953 28.4658C39.4953 27.7576 39.7869 27.0912 40.2451 26.633C40.7449 26.1331 41.3281 25.8832 42.0362 25.8832H51.4918C51.5751 25.9665 51.5751 26.0915 51.5751 26.2164Z", fill: "url(#paint0_linear_2578_27197)" }),
|
|
2501
|
+
React__default.createElement("path", { d: "M56.7342 17.6773C57.6774 17.6773 58.442 16.9126 58.442 15.9694C58.442 15.0262 57.6774 14.2616 56.7342 14.2616C55.791 14.2616 55.0264 15.0262 55.0264 15.9694C55.0264 16.9126 55.791 17.6773 56.7342 17.6773Z", fill: "#EAEEF9" }),
|
|
2502
|
+
React__default.createElement("path", { d: "M55.0257 12.1373C55.6698 12.1373 56.192 11.6152 56.192 10.971C56.192 10.3269 55.6698 9.80469 55.0257 9.80469C54.3816 9.80469 53.8594 10.3269 53.8594 10.971C53.8594 11.6152 54.3816 12.1373 55.0257 12.1373Z", fill: "#EAEEF9" }),
|
|
2503
|
+
React__default.createElement("path", { d: "M7.79034 15.9694C8.43449 15.9694 8.95667 15.4472 8.95667 14.803C8.95667 14.1589 8.43449 13.6367 7.79034 13.6367C7.1462 13.6367 6.62402 14.1589 6.62402 14.803C6.62402 15.4472 7.1462 15.9694 7.79034 15.9694Z", fill: "#EAEEF9" }),
|
|
2504
|
+
React__default.createElement("path", { d: "M5.16603 41.6286C6.36229 41.6286 7.33205 40.6588 7.33205 39.4625C7.33205 38.2663 6.36229 37.2965 5.16603 37.2965C3.96976 37.2965 3 38.2663 3 39.4625C3 40.6588 3.96976 41.6286 5.16603 41.6286Z", fill: "#EAEEF9" }),
|
|
2505
|
+
React__default.createElement("path", { d: "M43.0864 6.16785C43.6301 12.1024 43.9019 13.4615 42.6711 18.8361C42.2708 20.0309 41.8705 21.3396 41.0128 22.25C39.812 23.6725 37.6392 24.2984 35.8666 23.8432C34.0368 23.388 32.5501 21.7948 32.2071 19.8602C31.9212 18.6654 32.3214 17.2429 33.3507 16.5032C34.4371 15.8204 35.981 15.9911 36.8958 16.8446C37.9251 17.6981 38.3254 19.0068 38.2682 20.2585C38.211 21.5103 37.7536 22.7621 37.1246 23.8432C35.7027 26.5014 35.1173 26.4916 32.2071 30.8575", stroke: "#ABB5CC", strokeMiterlimit: "10", strokeDasharray: "4 4" }),
|
|
2506
|
+
React__default.createElement("path", { d: "M46.2749 3.95757C46.0575 4.75059 45.1881 5.03896 44.3187 4.53431C43.3769 4.10176 42.7249 3.74129 42.8698 3.02037C43.0871 2.29945 43.9565 2.22735 44.9708 2.15526C46.2024 2.01108 46.4198 3.16455 46.2749 3.95757Z", fill: "#DAE2EB" }),
|
|
2507
|
+
React__default.createElement("path", { d: "M39.2479 4.67842C39.6102 5.32726 40.6245 5.75981 41.3489 5.11098C42.1459 4.39005 42.7979 3.88541 42.4357 3.16448C42.0734 2.51565 41.4938 2.73193 40.2622 2.87611C39.2479 3.09239 38.8132 3.9575 39.2479 4.67842Z", fill: "#DAE2EB" }),
|
|
2508
|
+
React__default.createElement("path", { d: "M42.4358 2.01104C42.9429 1.93895 43.4501 2.22732 43.595 2.65987C43.6674 2.80406 43.7399 3.02034 43.7399 3.16452C43.8848 4.17381 43.5225 5.03892 42.9429 5.11102C42.2909 5.2552 41.6389 4.53428 41.5664 3.59707C41.5664 3.3087 41.5664 3.16452 41.5664 2.94824C41.6389 2.4436 41.9286 2.08313 42.4358 2.01104C42.5082 2.01104 42.4358 2.01104 42.4358 2.01104Z", fill: "#989FB0" }),
|
|
2509
|
+
React__default.createElement("path", { d: "M27.9127 37.0298C28.4405 37.0298 28.8684 36.6019 28.8684 36.0741C28.8684 35.5463 28.4405 35.1184 27.9127 35.1184C27.3849 35.1184 26.957 35.5463 26.957 36.0741C26.957 36.6019 27.3849 37.0298 27.9127 37.0298Z", fill: "#989FB0" }),
|
|
2510
|
+
React__default.createElement("path", { d: "M37.4186 37.0298C37.9464 37.0298 38.3742 36.6019 38.3742 36.0741C38.3742 35.5463 37.9464 35.1184 37.4186 35.1184C36.8908 35.1184 36.4629 35.5463 36.4629 36.0741C36.4629 36.6019 36.8908 37.0298 37.4186 37.0298Z", fill: "#989FB0" }),
|
|
2511
|
+
React__default.createElement("path", { d: "M34.2147 43.3063H31.2186C30.7536 43.3063 30.3662 42.9188 30.3662 42.4539C30.3662 41.989 30.7536 41.6016 31.2186 41.6016H34.1889C34.6538 41.6016 35.0413 41.989 35.0413 42.4539C35.0671 42.9188 34.6797 43.3063 34.2147 43.3063Z", fill: "#989FB0" }),
|
|
2512
|
+
React__default.createElement("defs", null,
|
|
2513
|
+
React__default.createElement("linearGradient", { id: "paint0_linear_2578_27197", x1: "32.6517", y1: "25.3966", x2: "32.6517", y2: "47.1455", gradientUnits: "userSpaceOnUse" },
|
|
2514
|
+
React__default.createElement("stop", { stopColor: "#FDFEFF" }),
|
|
2515
|
+
React__default.createElement("stop", { offset: "0.9964", stopColor: "#ECF0F5" })))));
|
|
2516
|
+
};
|
|
2517
|
+
|
|
2518
|
+
const libraries = ['places'];
|
|
2519
|
+
const GoogleLocationBlock = (props) => {
|
|
2520
|
+
var _a;
|
|
2521
|
+
const { inputWrapperOrder = ['label', 'input', 'description', 'error'], defaultValue, value: valueProps, onChange: onChangeProps, locale } = props, restProps = __rest(props, ["inputWrapperOrder", "defaultValue", "value", "onChange", "locale"]);
|
|
2522
|
+
const [LoadScript, setLoadScript] = useState(null);
|
|
2523
|
+
const [value, setValue] = useState(defaultValue || valueProps);
|
|
2524
|
+
const { predictions } = usePlacesAutocomplete(value, '', locale === 'tl-PH' ? 'en' : (_a = locale === null || locale === void 0 ? void 0 : locale.split('-')) === null || _a === void 0 ? void 0 : _a[0]);
|
|
2525
|
+
const onChangeAutocomplete = useCallback((s) => {
|
|
2526
|
+
setValue(s);
|
|
2527
|
+
onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(s);
|
|
2528
|
+
}, []);
|
|
2529
|
+
const onClickItem = useCallback((item) => {
|
|
2530
|
+
/** For sure get value */
|
|
2531
|
+
setValue(item.value);
|
|
2532
|
+
const predCur = predictions === null || predictions === void 0 ? void 0 : predictions.find(({ description }) => description === item.value);
|
|
2533
|
+
onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(item.value, predCur === null || predCur === void 0 ? void 0 : predCur.rawData);
|
|
2534
|
+
}, [onChangeProps, predictions]);
|
|
2535
|
+
useEffect(() => {
|
|
2536
|
+
setValue(valueProps);
|
|
2537
|
+
}, [valueProps]);
|
|
2538
|
+
useEffect(() => {
|
|
2539
|
+
var _a, _b, _c;
|
|
2540
|
+
// only load extra google script when not yet loaded
|
|
2541
|
+
if (!((_c = (_b = (_a = window === null || window === void 0 ? void 0 : window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.places) === null || _c === void 0 ? void 0 : _c.AutocompleteService) && !LoadScript) {
|
|
2542
|
+
import('@react-google-maps/api').then((m) => {
|
|
2543
|
+
setLoadScript(() => m.LoadScript);
|
|
2544
|
+
});
|
|
2477
2545
|
}
|
|
2478
|
-
}
|
|
2479
|
-
return
|
|
2546
|
+
}, []);
|
|
2547
|
+
return (React__default.createElement(Autocomplete, Object.assign({ defaultValue: defaultValue, value: value, onChange: onChangeAutocomplete, data: predictions.map((pred) => {
|
|
2548
|
+
return { value: pred.description, label: pred.description };
|
|
2549
|
+
}), filter: () => true, onItemSubmit: onClickItem, inputWrapperOrder: inputWrapperOrder, zIndex: ZINDEX_SSO - 9e6 + 2, withinPortal: true, styles: { dropdown: { pointerEvents: 'auto' } }, inputContainer: (children) => {
|
|
2550
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
2551
|
+
LoadScript && (React__default.createElement(LoadScript, { googleMapsApiKey: GOOGLE_API_KEY, libraries: libraries, loadingElement: React__default.createElement(React__default.Fragment, null), style: { width: '100%' } })),
|
|
2552
|
+
children));
|
|
2553
|
+
} }, restProps)));
|
|
2480
2554
|
};
|
|
2481
2555
|
|
|
2482
2556
|
const StyledLeadGenFormInner = styled.div `
|
|
@@ -2815,17 +2889,22 @@ const TextField$1 = (props) => {
|
|
|
2815
2889
|
onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(false);
|
|
2816
2890
|
});
|
|
2817
2891
|
const [shrink, setShrink] = useState(shrinkProps);
|
|
2892
|
+
const focusInput = (target) => {
|
|
2893
|
+
const $textEl = target.querySelectorAll('input:not([disabled]):not([type="submit"]),select:not([disabled]),textarea:not([disabled])');
|
|
2894
|
+
const $focusEl = $textEl.item($textEl.length - 1);
|
|
2895
|
+
if ($focusEl) {
|
|
2896
|
+
$focusEl.focus({ preventScroll: true });
|
|
2897
|
+
}
|
|
2898
|
+
};
|
|
2818
2899
|
const onClick = useCallback((e) => {
|
|
2819
|
-
setShrink(true);
|
|
2820
|
-
onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(true);
|
|
2821
2900
|
if (shrink) {
|
|
2901
|
+
e.preventDefault();
|
|
2902
|
+
focusInput(e.currentTarget);
|
|
2822
2903
|
return;
|
|
2823
2904
|
}
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
$focusEl.focus();
|
|
2828
|
-
}
|
|
2905
|
+
setShrink(true);
|
|
2906
|
+
onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(true);
|
|
2907
|
+
focusInput(e.currentTarget);
|
|
2829
2908
|
}, [shrink]);
|
|
2830
2909
|
useEffect(() => {
|
|
2831
2910
|
setShrink(shrinkProps);
|
|
@@ -2838,44 +2917,6 @@ const ChoiceField$1 = (props) => {
|
|
|
2838
2917
|
return (React__default.createElement(StyledChoiceFieldContainer$1, Object.assign({ className: clsx(className, 'choiceField') }, restProps), children));
|
|
2839
2918
|
};
|
|
2840
2919
|
|
|
2841
|
-
const libraries = ['places'];
|
|
2842
|
-
const GoogleLocationBlock = (props) => {
|
|
2843
|
-
var _a;
|
|
2844
|
-
const { inputWrapperOrder = ['label', 'input', 'description', 'error'], defaultValue, value: valueProps, onChange: onChangeProps, locale } = props, restProps = __rest(props, ["inputWrapperOrder", "defaultValue", "value", "onChange", "locale"]);
|
|
2845
|
-
const [LoadScript, setLoadScript] = useState(null);
|
|
2846
|
-
const [value, setValue] = useState(defaultValue || valueProps);
|
|
2847
|
-
const { predictions } = usePlacesAutocomplete(value, '', locale === 'tl-PH' ? 'en' : (_a = locale === null || locale === void 0 ? void 0 : locale.split('-')) === null || _a === void 0 ? void 0 : _a[0]);
|
|
2848
|
-
const onChangeAutocomplete = useCallback((s) => {
|
|
2849
|
-
setValue(s);
|
|
2850
|
-
onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(s);
|
|
2851
|
-
}, []);
|
|
2852
|
-
const onClickItem = useCallback((item) => {
|
|
2853
|
-
/** For sure get value */
|
|
2854
|
-
setValue(item.value);
|
|
2855
|
-
const predCur = predictions === null || predictions === void 0 ? void 0 : predictions.find(({ description }) => description === item.value);
|
|
2856
|
-
onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(item.value, predCur === null || predCur === void 0 ? void 0 : predCur.rawData);
|
|
2857
|
-
}, [onChangeProps, predictions]);
|
|
2858
|
-
useEffect(() => {
|
|
2859
|
-
setValue(valueProps);
|
|
2860
|
-
}, [valueProps]);
|
|
2861
|
-
useEffect(() => {
|
|
2862
|
-
var _a, _b, _c;
|
|
2863
|
-
// only load extra google script when not yet loaded
|
|
2864
|
-
if (!((_c = (_b = (_a = window === null || window === void 0 ? void 0 : window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.places) === null || _c === void 0 ? void 0 : _c.AutocompleteService) && !LoadScript) {
|
|
2865
|
-
import('@react-google-maps/api').then((m) => {
|
|
2866
|
-
setLoadScript(() => m.LoadScript);
|
|
2867
|
-
});
|
|
2868
|
-
}
|
|
2869
|
-
}, []);
|
|
2870
|
-
return (React__default.createElement(Autocomplete, Object.assign({ defaultValue: defaultValue, value: value, onChange: onChangeAutocomplete, data: predictions.map((pred) => {
|
|
2871
|
-
return { value: pred.description, label: pred.description };
|
|
2872
|
-
}), filter: () => true, onItemSubmit: onClickItem, inputWrapperOrder: inputWrapperOrder, zIndex: ZINDEX_SSO - 9e6 + 2, withinPortal: true, styles: { dropdown: { pointerEvents: 'auto' } }, inputContainer: (children) => {
|
|
2873
|
-
return (React__default.createElement(React__default.Fragment, null,
|
|
2874
|
-
LoadScript && (React__default.createElement(LoadScript, { googleMapsApiKey: GOOGLE_API_KEY, libraries: libraries, loadingElement: React__default.createElement(React__default.Fragment, null), style: { width: '100%' } })),
|
|
2875
|
-
children));
|
|
2876
|
-
} }, restProps)));
|
|
2877
|
-
};
|
|
2878
|
-
|
|
2879
2920
|
const LeadGenForm = forwardRef((props, ref) => {
|
|
2880
2921
|
const { locale, blocks, scrollToErrorField = true, form: formProps, rules: validate, initialValues, onFinish, onFinishFailed, className, style, } = props;
|
|
2881
2922
|
const formRef = useRef(null);
|
|
@@ -2929,52 +2970,73 @@ const LeadGenForm = forwardRef((props, ref) => {
|
|
|
2929
2970
|
return (React__default.createElement("form", { ref: formRef, onSubmit: form.onSubmit(middlewareFinish, middlewareFinishFailed), className: className, style: style },
|
|
2930
2971
|
React__default.createElement(StyledLeadGenFormInner, { className: "leadgen-form_inputs" }, blocks.map((block, idx) => {
|
|
2931
2972
|
const { id, name: blockName, data } = block;
|
|
2932
|
-
const { placeholder, value: name, required, listQuestion, valueHTML, isSendMailChimp = false, } = data;
|
|
2973
|
+
const { placeholder: label, value: name, required, listQuestion, valueHTML, isSendMailChimp = false, } = data;
|
|
2933
2974
|
const formInputProps = form.getInputProps(name);
|
|
2934
2975
|
const { value, error } = formInputProps;
|
|
2935
2976
|
const reactKey = `${id}-${idx}`;
|
|
2936
2977
|
switch (blockName) {
|
|
2937
2978
|
case LEADGEN_BLOCK.TextBlock: {
|
|
2938
2979
|
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2939
|
-
React__default.createElement(TextInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label:
|
|
2980
|
+
React__default.createElement(TextInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label: label, placeholder: " ", inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, type: "text", "data-control": "text" }, formInputProps))));
|
|
2940
2981
|
}
|
|
2941
2982
|
case LEADGEN_BLOCK.NumberBlock: {
|
|
2942
2983
|
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2943
|
-
React__default.createElement(NumberInput$1, Object.assign({ name: value, spellCheck: false, withAsterisk: required, label:
|
|
2984
|
+
React__default.createElement(NumberInput$1, Object.assign({ name: value, spellCheck: false, withAsterisk: required, label: label, placeholder: " ", inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, type: "number", "data-control": "number" }, formInputProps))));
|
|
2944
2985
|
}
|
|
2945
2986
|
case LEADGEN_BLOCK.EmailBlock: {
|
|
2946
2987
|
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2947
|
-
React__default.createElement(TextInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label:
|
|
2988
|
+
React__default.createElement(TextInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label: label, placeholder: " ", inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, "data-control": "email" }, formInputProps))));
|
|
2948
2989
|
}
|
|
2949
2990
|
case LEADGEN_BLOCK.PhoneOtpBlock:
|
|
2950
2991
|
case LEADGEN_BLOCK.WhatsappOtpBlock:
|
|
2951
2992
|
case LEADGEN_BLOCK.ZaloOtpBlock:
|
|
2952
2993
|
case LEADGEN_BLOCK.PhoneBlock: {
|
|
2953
2994
|
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2954
|
-
React__default.createElement(PhoneInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label:
|
|
2995
|
+
React__default.createElement(PhoneInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label: label, placeholder: " ", inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, defaultCountry: (locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN'), type: "text", "data-control": "tel" }, formInputProps))));
|
|
2955
2996
|
}
|
|
2956
2997
|
case LEADGEN_BLOCK.LocationBlock: {
|
|
2957
2998
|
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2958
|
-
React__default.createElement(GoogleLocationBlock, Object.assign({ name: name, withAsterisk: required, label:
|
|
2999
|
+
React__default.createElement(GoogleLocationBlock, Object.assign({ name: name, withAsterisk: required, label: label, placeholder: " ", inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, locale: locale, "data-control": "text" }, formInputProps))));
|
|
2959
3000
|
}
|
|
2960
3001
|
case LEADGEN_BLOCK.DateBlock: {
|
|
2961
3002
|
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2962
|
-
React__default.createElement(DateInput, Object.assign({ locale: (MAPPED_LOCALE === null || MAPPED_LOCALE === void 0 ? void 0 : MAPPED_LOCALE[locale]) || MAPPED_LOCALE['vi-VN'], valueFormat: "DD/MM/YYYY", name: name, withAsterisk: required, label:
|
|
3003
|
+
React__default.createElement(DateInput, Object.assign({ locale: (MAPPED_LOCALE === null || MAPPED_LOCALE === void 0 ? void 0 : MAPPED_LOCALE[locale]) || MAPPED_LOCALE['vi-VN'], valueFormat: "DD/MM/YYYY", name: name, withAsterisk: required, label: label, placeholder: " ", inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, type: "default", "data-control": "date" }, formInputProps))));
|
|
2963
3004
|
}
|
|
2964
3005
|
case LEADGEN_BLOCK.DropdownBlock:
|
|
2965
3006
|
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2966
3007
|
React__default.createElement("div", { style: { display: 'none' }, "data-extra": true, "data-name": value, "data-control": 'dropdown' }),
|
|
2967
|
-
React__default.createElement(Select$1, Object.assign({ name: name, withAsterisk: required, label:
|
|
3008
|
+
React__default.createElement(Select$1, Object.assign({ name: name, withAsterisk: required, label: label, placeholder: " ", searchable: true, data: listQuestion.map((l) => ({
|
|
2968
3009
|
value: l.value,
|
|
2969
3010
|
label: l.placeholder,
|
|
2970
|
-
}))
|
|
3011
|
+
})), nothingFound: React__default.createElement(NoData, null), styles: {
|
|
3012
|
+
item: {
|
|
3013
|
+
paddingBlock: 12,
|
|
3014
|
+
paddingInline: 10,
|
|
3015
|
+
fontSize: 16,
|
|
3016
|
+
lineHeight: 1.5,
|
|
3017
|
+
},
|
|
3018
|
+
nothingFound: {
|
|
3019
|
+
fontSize: 54,
|
|
3020
|
+
paddingBlock: 30,
|
|
3021
|
+
},
|
|
3022
|
+
itemsWrapper: {
|
|
3023
|
+
padding: 6,
|
|
3024
|
+
},
|
|
3025
|
+
dropdown: {
|
|
3026
|
+
'.mantine-ScrollArea-scrollbar[data-orientation="vertical"]': {
|
|
3027
|
+
'--radix-scroll-area-thumb-width': '6px',
|
|
3028
|
+
width: 'var(--radix-scroll-area-thumb-width)',
|
|
3029
|
+
paddingInline: 0,
|
|
3030
|
+
},
|
|
3031
|
+
},
|
|
3032
|
+
}, maxDropdownHeight: 192 }, formInputProps))));
|
|
2971
3033
|
case LEADGEN_BLOCK.CheckboxBlock: {
|
|
2972
3034
|
const formInputCheckboxProps = form.getInputProps(name, {
|
|
2973
3035
|
type: 'checkbox',
|
|
2974
3036
|
});
|
|
2975
3037
|
return (React__default.createElement(ChoiceField$1, { className: "leadgen-form_input leadgen-form_input_checkbox", key: reactKey },
|
|
2976
3038
|
isSendMailChimp && (React__default.createElement("div", { style: { display: 'none' }, "data-name": name + '-mailchimp' })),
|
|
2977
|
-
React__default.createElement(Checkbox$1.Group, Object.assign({ size: "md", withAsterisk: required, label:
|
|
3039
|
+
React__default.createElement(Checkbox$1.Group, Object.assign({ size: "md", withAsterisk: required, label: label, value: value, sx: {
|
|
2978
3040
|
display: 'flex',
|
|
2979
3041
|
flexDirection: 'column',
|
|
2980
3042
|
flexWrap: 'wrap',
|
|
@@ -2986,7 +3048,7 @@ const LeadGenForm = forwardRef((props, ref) => {
|
|
|
2986
3048
|
case LEADGEN_BLOCK.RadioBlock: {
|
|
2987
3049
|
return (React__default.createElement(ChoiceField$1, { className: "leadgen-form_input leadgen-form_input_checkbox", key: reactKey },
|
|
2988
3050
|
isSendMailChimp && (React__default.createElement("div", { style: { display: 'none' }, "data-name": name + '-mailchimp' })),
|
|
2989
|
-
React__default.createElement(Radio$1.Group, Object.assign({ size: "md", withAsterisk: required, label:
|
|
3051
|
+
React__default.createElement(Radio$1.Group, Object.assign({ size: "md", withAsterisk: required, label: label, value: value, spellCheck: true, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, inputContainer: (children) => {
|
|
2990
3052
|
return (React__default.createElement("div", { className: "leadgen-choiceContainer" }, children));
|
|
2991
3053
|
} }, formInputProps), listQuestion.map((l, _index) => (React__default.createElement(Radio$1, { name: name, key: _index, value: l.value, label: l.placeholder, "data-control": "radio" }))))));
|
|
2992
3054
|
}
|
|
@@ -3021,8 +3083,8 @@ const LeadGenSubscriptionBoxA = (props) => {
|
|
|
3021
3083
|
}, [title]);
|
|
3022
3084
|
return (React__default.createElement(StyledLeadGenSubscriptionBoxA, { className: "subcription_box_A" },
|
|
3023
3085
|
React__default.createElement(StyledLeadGenSubscriptionBoxHeader, { className: "leadgen-subscription_box_header" },
|
|
3024
|
-
|
|
3025
|
-
|
|
3086
|
+
titleComp,
|
|
3087
|
+
imageComp),
|
|
3026
3088
|
React__default.createElement(StyledLeadGenSubscriptionBoxBody, { className: "leadgen-subscription_box_body" },
|
|
3027
3089
|
React__default.createElement(LeadGenForm, { ref: formRef, form: form, rules: rules, blocks: blocks, locale: locale, onFinish: onFinish, className: "leadgen-subscription_box_form" }),
|
|
3028
3090
|
React__default.createElement(Button$1, { disabled: loading, loading: loading, variant: "filled", size: "lg", onClick: () => {
|
|
@@ -3605,6 +3667,182 @@ const useViewportDimensions = () => {
|
|
|
3605
3667
|
return useMemo(() => (Object.assign({}, dimensions)), [dimensions.height, dimensions.width]);
|
|
3606
3668
|
};
|
|
3607
3669
|
|
|
3670
|
+
const StyledLeadGenLightBoxBFooter = styled.div `
|
|
3671
|
+
padding-top: calc(var(--spacing-y, 20px) * 8 / 20);
|
|
3672
|
+
padding-inline: var(--spacing-x, 20px);
|
|
3673
|
+
padding-bottom: var(--spacing-y, 20px);
|
|
3674
|
+
`;
|
|
3675
|
+
const StyledLeadGenLightBoxBBody = styled.div `
|
|
3676
|
+
flex: 1;
|
|
3677
|
+
min-height: 0;
|
|
3678
|
+
overflow: auto;
|
|
3679
|
+
padding-inline: var(--spacing-y, 20px);
|
|
3680
|
+
padding-block: calc(var(--spacing-x, 20px) * 8 / 20);
|
|
3681
|
+
&::-webkit-scrollbar {
|
|
3682
|
+
width: 6px;
|
|
3683
|
+
height: 6px;
|
|
3684
|
+
}
|
|
3685
|
+
|
|
3686
|
+
&::-webkit-scrollbar-track {
|
|
3687
|
+
background-color: transparent;
|
|
3688
|
+
}
|
|
3689
|
+
|
|
3690
|
+
&::-webkit-scrollbar-thumb {
|
|
3691
|
+
background-color: rgba(0, 0, 0, 0.4);
|
|
3692
|
+
border-radius: 6px;
|
|
3693
|
+
}
|
|
3694
|
+
`;
|
|
3695
|
+
const StyledLeadGenLightBoxBHeader = styled.div `
|
|
3696
|
+
display: flex;
|
|
3697
|
+
padding-top: var(--spacing-y, 20px);
|
|
3698
|
+
padding-inline: var(--spacing-x, 20px);
|
|
3699
|
+
padding-bottom: calc(var(--spacing-y, 20px) * 8 / 20);
|
|
3700
|
+
`;
|
|
3701
|
+
const StyledLeadGenLightBoxBWrapper = styled.div `
|
|
3702
|
+
height: 100%;
|
|
3703
|
+
display: flex;
|
|
3704
|
+
flex-direction: column;
|
|
3705
|
+
`;
|
|
3706
|
+
const StyledLeadGenLightBoxB = styled.div `
|
|
3707
|
+
--spacing-x: 20px;
|
|
3708
|
+
--spacing-y: 20px;
|
|
3709
|
+
--close-width: 24px;
|
|
3710
|
+
--close-height: 24px;
|
|
3711
|
+
|
|
3712
|
+
// For old version, Wrap every thing in children
|
|
3713
|
+
&[data-type='LightBoxB_typeA'] {
|
|
3714
|
+
height: 100%;
|
|
3715
|
+
width: 100%;
|
|
3716
|
+
.leadgen-wrapper,
|
|
3717
|
+
.leadgen-inner,
|
|
3718
|
+
.leadgen-form {
|
|
3719
|
+
height: 100%;
|
|
3720
|
+
}
|
|
3721
|
+
.leadgen-content {
|
|
3722
|
+
height: 100%;
|
|
3723
|
+
display: flex;
|
|
3724
|
+
flex-direction: column;
|
|
3725
|
+
}
|
|
3726
|
+
.leadgen-header {
|
|
3727
|
+
display: none;
|
|
3728
|
+
}
|
|
3729
|
+
.leadgen-title {
|
|
3730
|
+
padding-right: calc(var(--close-width, 24px) * 50 / 24);
|
|
3731
|
+
}
|
|
3732
|
+
.leadgen-description {
|
|
3733
|
+
display: none;
|
|
3734
|
+
}
|
|
3735
|
+
.leadgen-body {
|
|
3736
|
+
flex: 1;
|
|
3737
|
+
min-height: 0;
|
|
3738
|
+
}
|
|
3739
|
+
|
|
3740
|
+
.leadgen-close_btn {
|
|
3741
|
+
top: var(--spacing-y, 20px);
|
|
3742
|
+
right: var(--spacing-x, 20px);
|
|
3743
|
+
width: var(--close-width, 24px) !important;
|
|
3744
|
+
height: var(--close-height, 24px);
|
|
3745
|
+
box-shadow: none;
|
|
3746
|
+
font-size: 24px;
|
|
3747
|
+
}
|
|
3748
|
+
|
|
3749
|
+
.leadgen-empty_footer {
|
|
3750
|
+
.leadgen-btn {
|
|
3751
|
+
flex: 1;
|
|
3752
|
+
min-width: 0;
|
|
3753
|
+
}
|
|
3754
|
+
}
|
|
3755
|
+
|
|
3756
|
+
.leadgen-form_body {
|
|
3757
|
+
overflow: auto;
|
|
3758
|
+
animation: scrolling forwards;
|
|
3759
|
+
animation-timeline: scroll(self);
|
|
3760
|
+
}
|
|
3761
|
+
@keyframes scrolling {
|
|
3762
|
+
0%,
|
|
3763
|
+
to {
|
|
3764
|
+
border-bottom: 1px solid ${theme.colors.neutral100};
|
|
3765
|
+
}
|
|
3766
|
+
}
|
|
3767
|
+
}
|
|
3768
|
+
`;
|
|
3769
|
+
const StyledMotionContainer = styled(motion.div) `
|
|
3770
|
+
position: fixed;
|
|
3771
|
+
inset: 0;
|
|
3772
|
+
z-index: ${ZINDEX_SSO + 1};
|
|
3773
|
+
background-color: #fff;
|
|
3774
|
+
`;
|
|
3775
|
+
|
|
3776
|
+
const PREFIX_CLS = 'LightBoxB_typeA';
|
|
3777
|
+
const DURATION = 1000 * 0.5;
|
|
3778
|
+
const DRAWER_STYLE = {
|
|
3779
|
+
visible: {
|
|
3780
|
+
opacity: 1,
|
|
3781
|
+
translateY: '0px',
|
|
3782
|
+
transitionProperty: 'translate',
|
|
3783
|
+
transitionDuration: '0.25s',
|
|
3784
|
+
},
|
|
3785
|
+
hidden: {
|
|
3786
|
+
opacity: 0,
|
|
3787
|
+
translateY: '100%',
|
|
3788
|
+
transitionProperty: 'translate',
|
|
3789
|
+
transitionDuration: '0.25s',
|
|
3790
|
+
},
|
|
3791
|
+
};
|
|
3792
|
+
const LeadGenLightBoxBTypeA = (props) => {
|
|
3793
|
+
const { visible, onVisible, icon, title, buttonText, blocks, children } = props, restProps = __rest(props, ["visible", "onVisible", "icon", "title", "buttonText", "blocks", "children"]);
|
|
3794
|
+
const formRef = useRef();
|
|
3795
|
+
const [open, setOpen] = useState(visible);
|
|
3796
|
+
const { height } = useViewportDimensions();
|
|
3797
|
+
usePreventScroll();
|
|
3798
|
+
const onOpenChange = useCallback((open) => {
|
|
3799
|
+
if (!open) {
|
|
3800
|
+
// Wait for duration of animation
|
|
3801
|
+
setTimeout(() => {
|
|
3802
|
+
onVisible === null || onVisible === void 0 ? void 0 : onVisible(open);
|
|
3803
|
+
}, DURATION);
|
|
3804
|
+
return;
|
|
3805
|
+
}
|
|
3806
|
+
onVisible === null || onVisible === void 0 ? void 0 : onVisible(open);
|
|
3807
|
+
}, [onVisible]);
|
|
3808
|
+
const iconComp = useMemo(() => {
|
|
3809
|
+
if (!icon) {
|
|
3810
|
+
return null;
|
|
3811
|
+
}
|
|
3812
|
+
return React__default.createElement(React__default.Fragment, null);
|
|
3813
|
+
}, [icon]);
|
|
3814
|
+
const titleComp = useMemo(() => {
|
|
3815
|
+
if (!title) {
|
|
3816
|
+
return null;
|
|
3817
|
+
}
|
|
3818
|
+
return title;
|
|
3819
|
+
}, [title]);
|
|
3820
|
+
const childrenComp = useMemo(() => {
|
|
3821
|
+
if (children) {
|
|
3822
|
+
return children;
|
|
3823
|
+
}
|
|
3824
|
+
return (React__default.createElement(StyledLeadGenLightBoxBWrapper, { className: `${PREFIX_CLS}_wrapper lightboxB_wrapper` },
|
|
3825
|
+
React__default.createElement(StyledLeadGenLightBoxBHeader, { className: `${PREFIX_CLS}_header lightboxB_header` },
|
|
3826
|
+
React__default.createElement("div", { className: "lightBoxB_header_icon" }, iconComp),
|
|
3827
|
+
React__default.createElement("div", { className: "lightBoxB_header_title" }, titleComp),
|
|
3828
|
+
React__default.createElement("div", { className: "lightBoxB_header_close", onClick: () => onOpenChange(false) },
|
|
3829
|
+
React__default.createElement(CloseButton, null))),
|
|
3830
|
+
React__default.createElement(StyledLeadGenLightBoxBBody, { className: `${PREFIX_CLS}_body lightboxB_body` },
|
|
3831
|
+
React__default.createElement(LeadGenForm, Object.assign({ ref: formRef, blocks: blocks }, restProps))),
|
|
3832
|
+
React__default.createElement(StyledLeadGenLightBoxBFooter, { className: `${PREFIX_CLS}_footer lightboxB_footer` },
|
|
3833
|
+
React__default.createElement(Button, { onClick: () => { var _a; return (_a = formRef.current) === null || _a === void 0 ? void 0 : _a.submit(); } }, buttonText))));
|
|
3834
|
+
}, [children, onOpenChange]);
|
|
3835
|
+
useEffect(() => {
|
|
3836
|
+
setOpen(visible);
|
|
3837
|
+
}, [visible]);
|
|
3838
|
+
return (React__default.createElement(StyledMotionContainer, { animate: open ? 'visible' : 'hidden', variants: DRAWER_STYLE },
|
|
3839
|
+
React__default.createElement(StyledLeadGenLightBoxB, { "data-type": "LightBoxB_typeA", style: height ? { maxHeight: height } : undefined }, childrenComp)));
|
|
3840
|
+
};
|
|
3841
|
+
|
|
3842
|
+
const LeadGenLightBoxB = (props) => {
|
|
3843
|
+
return React__default.createElement(LeadGenLightBoxBTypeA, Object.assign({}, props));
|
|
3844
|
+
};
|
|
3845
|
+
|
|
3608
3846
|
const ThankyouPopup = ({ title, titleAlign, subtitle, subtitleAlign, link, linkNewTab, linkText, image, }) => {
|
|
3609
3847
|
const { primaryColor } = useContext(LeadGenContext$1);
|
|
3610
3848
|
const { width: imageWidth, height: imageHeight, loaded: imageLoaded, } = useImageSize(image);
|
|
@@ -3974,6 +4212,7 @@ const StyledTextFieldContainer = styled.div `
|
|
|
3974
4212
|
outline: none !important;
|
|
3975
4213
|
border: none;
|
|
3976
4214
|
box-shadow: none;
|
|
4215
|
+
font-size: var(--input, 15px);
|
|
3977
4216
|
padding: 0 var(--phone-input-space-x, 8px);
|
|
3978
4217
|
opacity: 0;
|
|
3979
4218
|
color: ${theme.colors.gray800} !important;
|
|
@@ -4093,17 +4332,22 @@ const TextField = (props) => {
|
|
|
4093
4332
|
onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(false);
|
|
4094
4333
|
});
|
|
4095
4334
|
const [shrink, setShrink] = useState(shrinkProps);
|
|
4335
|
+
const focusInput = (target) => {
|
|
4336
|
+
const $textEl = target.querySelectorAll('input:not([disabled]):not([type="submit"]),select:not([disabled]),textarea:not([disabled])');
|
|
4337
|
+
const $focusEl = $textEl.item($textEl.length - 1);
|
|
4338
|
+
if ($focusEl) {
|
|
4339
|
+
$focusEl.focus({ preventScroll: true });
|
|
4340
|
+
}
|
|
4341
|
+
};
|
|
4096
4342
|
const onClick = useCallback((e) => {
|
|
4097
|
-
setShrink(true);
|
|
4098
|
-
onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(true);
|
|
4099
4343
|
if (shrink) {
|
|
4344
|
+
e.preventDefault();
|
|
4345
|
+
focusInput(e.currentTarget);
|
|
4100
4346
|
return;
|
|
4101
4347
|
}
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
$focusEl.focus();
|
|
4106
|
-
}
|
|
4348
|
+
setShrink(true);
|
|
4349
|
+
onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(true);
|
|
4350
|
+
focusInput(e.currentTarget);
|
|
4107
4351
|
}, [shrink]);
|
|
4108
4352
|
useEffect(() => {
|
|
4109
4353
|
setShrink(shrinkProps);
|
|
@@ -4130,7 +4374,7 @@ const LightboxFields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmi
|
|
|
4130
4374
|
return (React__default.createElement(React__default.Fragment, null, listBlockAdded.map((b, index) => {
|
|
4131
4375
|
var _a;
|
|
4132
4376
|
const { name = '', data = {}, id } = b || {};
|
|
4133
|
-
const { placeholder, value, align, listQuestion, isSendMailChimp = false, newtab, url, } = data;
|
|
4377
|
+
const { placeholder: label, value, align, listQuestion, isSendMailChimp = false, newtab, url, } = data;
|
|
4134
4378
|
const required = (_a = data.required) !== null && _a !== void 0 ? _a : true;
|
|
4135
4379
|
const formValue = (formValues === null || formValues === void 0 ? void 0 : formValues[value]) || null;
|
|
4136
4380
|
switch (name) {
|
|
@@ -4140,23 +4384,23 @@ const LightboxFields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmi
|
|
|
4140
4384
|
return (React__default.createElement(SubtitleBlock, { key: index, align: align }, value));
|
|
4141
4385
|
case 'TextBlock':
|
|
4142
4386
|
return (React__default.createElement(TextField, { key: index, shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field" },
|
|
4143
|
-
React__default.createElement(TextInput, Object.assign({ withAsterisk: required, spellCheck: false, type: "text", placeholder:
|
|
4387
|
+
React__default.createElement(TextInput, Object.assign({ withAsterisk: required, spellCheck: false, type: "text", placeholder: " ",
|
|
4144
4388
|
// className="lead-modal__form-control leadgen-form_field"
|
|
4145
4389
|
// onChangeRaw={(e) => inputOnChange('text', e)}
|
|
4146
|
-
label:
|
|
4390
|
+
label: label, "data-control": "text", "data-lead-control": 'TextBlock', inputWrapperOrder: ['label', 'input', 'description', 'error'] }, form.getInputProps(value), { name: value }))));
|
|
4147
4391
|
case 'NumberBlock':
|
|
4148
4392
|
return (React__default.createElement(TextField, { key: index, shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field" },
|
|
4149
|
-
React__default.createElement(NumberInput$1, Object.assign({ withAsterisk: required, spellCheck: false, type: "number", placeholder:
|
|
4393
|
+
React__default.createElement(NumberInput$1, Object.assign({ withAsterisk: required, spellCheck: false, type: "number", placeholder: " ",
|
|
4150
4394
|
// className="lead-modal__form-control leadgen-form_field"
|
|
4151
4395
|
// onChange={(e) => inputOnChange('number', e)}
|
|
4152
|
-
label:
|
|
4396
|
+
label: label, "data-control": "number", "data-lead-control": name, name: value, inputWrapperOrder: ['label', 'input', 'description', 'error'] }, form.getInputProps(value)))));
|
|
4153
4397
|
case 'EmailBlock':
|
|
4154
4398
|
return (React__default.createElement(TextField, { key: index, shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field" },
|
|
4155
4399
|
React__default.createElement(TextInput, Object.assign({ withAsterisk: required, spellCheck: false,
|
|
4156
4400
|
// type="email"
|
|
4157
|
-
placeholder:
|
|
4401
|
+
placeholder: " ",
|
|
4158
4402
|
// className="lead-modal__form-control leadgen-form_field"
|
|
4159
|
-
label:
|
|
4403
|
+
label: label, "data-control": "email", "data-lead-control": name, name: value, inputWrapperOrder: ['label', 'input', 'description', 'error'] }, form.getInputProps(value)))));
|
|
4160
4404
|
case 'PhoneOtpBlock':
|
|
4161
4405
|
case 'WhatsappOtpBlock':
|
|
4162
4406
|
case 'ZaloOtpBlock':
|
|
@@ -4166,20 +4410,20 @@ const LightboxFields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmi
|
|
|
4166
4410
|
return (React__default.createElement(TextField, { key: index, shrink: !!formValue, className: clsx('lead-modal__form-control leadgen-form_field', {
|
|
4167
4411
|
'leadgen-form_field_error': !!error,
|
|
4168
4412
|
}) },
|
|
4169
|
-
React__default.createElement(Input$1.Wrapper, { size: "md", withAsterisk: required, label:
|
|
4413
|
+
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 },
|
|
4170
4414
|
React__default.createElement("div", { className: "mantine-Input-wrapper" },
|
|
4171
|
-
React__default.createElement(Phone, Object.assign({ className: "mantine-Input-input", name: value, spellCheck: false, type: "tel", placeholder:
|
|
4415
|
+
React__default.createElement(Phone, Object.assign({ className: "mantine-Input-input", name: value, spellCheck: false, type: "tel", placeholder: " ",
|
|
4172
4416
|
// onBlur={(e) => inputOnBlur('tel', e)}
|
|
4173
|
-
id: htmlForId, defaultCountry: (locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN'), "data-control": "tel" }, formPhoneInputWrapper))))));
|
|
4417
|
+
id: htmlForId, defaultCountry: (locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN'), "data-control": "tel", "data-lead-control": name }, formPhoneInputWrapper))))));
|
|
4174
4418
|
}
|
|
4175
4419
|
case 'LocationBlock': {
|
|
4176
4420
|
return (React__default.createElement(TextField, { key: index, shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field" },
|
|
4177
|
-
React__default.createElement(GoogleLocationBlock, Object.assign({ withAsterisk: required, name: value, placeholder:
|
|
4421
|
+
React__default.createElement(GoogleLocationBlock, Object.assign({ withAsterisk: required, name: value, placeholder: " ", label: label, "data-control": "text", locale: locale, inputWrapperOrder: ['label', 'input', 'description', 'error'] }, form.getInputProps(value)))));
|
|
4178
4422
|
}
|
|
4179
4423
|
case 'DateBlock': {
|
|
4180
4424
|
const _c = form.getInputProps(value), { error } = _c, formInputProps = __rest(_c, ["error"]);
|
|
4181
|
-
return (React__default.createElement(Input$1.Wrapper, { key: index, size: "md", withAsterisk: required, label:
|
|
4182
|
-
React__default.createElement(InputDate, Object.assign({ name: value, error: Boolean(error), locale: locale, "data-extra": true, "data-name": value, "data-control": "date", className: "leadgen-form_field_date", labelTuples: labelTuples }, formInputProps))));
|
|
4425
|
+
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" },
|
|
4426
|
+
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, className: "leadgen-form_field_date", labelTuples: labelTuples }, formInputProps))));
|
|
4183
4427
|
}
|
|
4184
4428
|
case 'LinkButtonBlock':
|
|
4185
4429
|
return (React__default.createElement("div", { key: index },
|
|
@@ -4195,38 +4439,59 @@ const LightboxFields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmi
|
|
|
4195
4439
|
}, "data-name": value + '-mailchimp' })),
|
|
4196
4440
|
React__default.createElement(Checkbox.Group, Object.assign({ withAsterisk: required,
|
|
4197
4441
|
// className="lead-modal__form-control leadgen-form_field"
|
|
4198
|
-
label:
|
|
4442
|
+
label: label, size: "md", sx: {
|
|
4199
4443
|
display: 'flex',
|
|
4200
4444
|
flexDirection: 'column',
|
|
4201
4445
|
flexWrap: 'wrap',
|
|
4202
4446
|
gap: 8,
|
|
4203
4447
|
}, inputWrapperOrder: ['label', 'input', 'description', 'error'], inputContainer: (children) => {
|
|
4204
4448
|
return (React__default.createElement("div", { className: "leadgen-choiceContainer" }, children));
|
|
4205
|
-
} }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default.createElement(Checkbox, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "checkbox" }))))));
|
|
4449
|
+
} }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default.createElement(Checkbox, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "checkbox", "data-lead-control": name }))))));
|
|
4206
4450
|
case 'RadioBlock':
|
|
4207
4451
|
return (React__default.createElement(ChoiceField, { className: "leadgen-form_radio", key: index },
|
|
4208
4452
|
isSendMailChimp && (React__default.createElement(Input$1, { type: "hidden", name: value + '-mailchimp', value: isSendMailChimp })),
|
|
4209
4453
|
React__default.createElement(Radio.Group, Object.assign({ withAsterisk: required,
|
|
4210
4454
|
// className="lead-modal__form-control leadgen-form_field"
|
|
4211
|
-
label:
|
|
4455
|
+
label: label, size: "md", inputWrapperOrder: ['label', 'input', 'description', 'error'], inputContainer: (children) => {
|
|
4212
4456
|
return (React__default.createElement("div", { className: "leadgen-choiceContainer" }, children));
|
|
4213
|
-
} }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default.createElement(Radio, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "radio" }))))));
|
|
4457
|
+
} }, 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 }))))));
|
|
4214
4458
|
case 'DropdownBlock':
|
|
4215
|
-
return (React__default.createElement(TextField, { shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field", key: index },
|
|
4459
|
+
return (React__default.createElement(TextField, { shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field DropdownBlock", key: index },
|
|
4216
4460
|
React__default.createElement("div", { style: { display: 'none' }, "data-extra": true, "data-name": value, "data-control": 'dropdown' }),
|
|
4217
4461
|
React__default.createElement(Select
|
|
4218
4462
|
// className="lead-modal__form-control leadgen-form_field"
|
|
4219
4463
|
, Object.assign({
|
|
4220
4464
|
// className="lead-modal__form-control leadgen-form_field"
|
|
4221
|
-
label:
|
|
4465
|
+
label: label, placeholder: " ", searchable: true, withAsterisk: required, name: value, data: listQuestion.map((l) => ({
|
|
4222
4466
|
value: l.value,
|
|
4223
4467
|
label: l.placeholder,
|
|
4224
|
-
}))
|
|
4468
|
+
})), nothingFound: React__default.createElement(NoData, null), styles: {
|
|
4469
|
+
item: {
|
|
4470
|
+
paddingBlock: 12,
|
|
4471
|
+
paddingInline: 10,
|
|
4472
|
+
fontSize: 16,
|
|
4473
|
+
lineHeight: 1.5,
|
|
4474
|
+
},
|
|
4475
|
+
nothingFound: {
|
|
4476
|
+
fontSize: 54,
|
|
4477
|
+
paddingBlock: 30,
|
|
4478
|
+
},
|
|
4479
|
+
itemsWrapper: {
|
|
4480
|
+
padding: 6,
|
|
4481
|
+
},
|
|
4482
|
+
dropdown: {
|
|
4483
|
+
'.mantine-ScrollArea-scrollbar[data-orientation="vertical"]': {
|
|
4484
|
+
'--radix-scroll-area-thumb-width': '6px',
|
|
4485
|
+
width: 'var(--radix-scroll-area-thumb-width)',
|
|
4486
|
+
paddingInline: 0,
|
|
4487
|
+
},
|
|
4488
|
+
},
|
|
4489
|
+
}, maxDropdownHeight: 192 }, form.getInputProps(value)))));
|
|
4225
4490
|
case 'TncBlock':
|
|
4226
4491
|
const _d = form.getInputProps(`TNC-${id}`), { error } = _d, tncInputProps = __rest(_d, ["error"]);
|
|
4227
4492
|
return (React__default.createElement(ChoiceField, { className: "leadgen-form_checkbox", key: id },
|
|
4228
4493
|
React__default.createElement(Input$1.Wrapper, { error: error },
|
|
4229
|
-
React__default.createElement(Checkbox, Object.assign({ name: 'TNC-' + id, label: React__default.createElement("p", { className: "lead-modal__tnc-link", dangerouslySetInnerHTML: { __html: data.valueHTML } }), className: "tnc-block", "data-control": "checkbox" }, tncInputProps)))));
|
|
4494
|
+
React__default.createElement(Checkbox, Object.assign({ name: 'TNC-' + id, label: React__default.createElement("p", { className: "lead-modal__tnc-link", dangerouslySetInnerHTML: { __html: data.valueHTML } }), className: "tnc-block", "data-control": "checkbox", "data-lead-control": name }, tncInputProps)))));
|
|
4230
4495
|
}
|
|
4231
4496
|
return null;
|
|
4232
4497
|
})));
|
|
@@ -4474,7 +4739,9 @@ const LEADGEN_SHOW_HEADER = [
|
|
|
4474
4739
|
LEADGEN_LAYOUT.Sidebar,
|
|
4475
4740
|
LEADGEN_LAYOUT.Slider,
|
|
4476
4741
|
];
|
|
4477
|
-
const
|
|
4742
|
+
// const CAMPAGE_CODE_LIST_APPLY_NEW_UI = ['ri3lkoxcetjoj39', 'u0adw7hw8kw7t89']
|
|
4743
|
+
const CAMPAGE_CODE_LIST_APPLY_NEW_UI = ['ri3lkoxcetjoj39'];
|
|
4744
|
+
const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSubmit, imageMobile, imageDesktop, imageOverlayMobile, imageOverlayDesktop, imageBackground, currentLayout, title, onSubmit, onUnmount, showThankyou, campaignId, campaignCode, campaign_subot_id, locale, showEmpty, setShowEmpty, userInfo, }) => {
|
|
4478
4745
|
var _a, _b;
|
|
4479
4746
|
const { primaryColor } = useContext(LeadGenContext$1);
|
|
4480
4747
|
const { isMobile } = useScreenSize();
|
|
@@ -4482,17 +4749,25 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4482
4749
|
const [showOtpPhone, setShowOtpPhone] = useState(null);
|
|
4483
4750
|
const [isSubmitLoading, setIsSubmitLoading] = useState(false);
|
|
4484
4751
|
const [snap, setSnap] = useState(0.8);
|
|
4752
|
+
const isTrackedForm = useRef(false);
|
|
4485
4753
|
const formRef = useRef();
|
|
4754
|
+
const [lastFormRef, setLastFormRef] = useState();
|
|
4486
4755
|
const onClose = () => {
|
|
4487
4756
|
if (showOtpPhone) {
|
|
4488
4757
|
setShowOtpPhone(null);
|
|
4489
4758
|
}
|
|
4490
4759
|
else {
|
|
4491
|
-
onCloseProp === null || onCloseProp === void 0 ? void 0 : onCloseProp(
|
|
4760
|
+
onCloseProp === null || onCloseProp === void 0 ? void 0 : onCloseProp({
|
|
4761
|
+
formValues: form.values,
|
|
4762
|
+
formActiveTime: formActiveTime.current,
|
|
4763
|
+
formRef: formRef.current,
|
|
4764
|
+
listBlockAdded,
|
|
4765
|
+
});
|
|
4492
4766
|
}
|
|
4493
4767
|
};
|
|
4494
4768
|
const { height } = useViewportDimensions();
|
|
4495
4769
|
usePreventScroll();
|
|
4770
|
+
const formActiveTime = useRef(0);
|
|
4496
4771
|
const textBlocks = JSON.parse(extraFields.textBlocks);
|
|
4497
4772
|
const listBlockAdded = JSON.parse(extraFields.listBlockAdded);
|
|
4498
4773
|
const actionBlocks = JSON.parse(extraFields.actionBlocks);
|
|
@@ -4509,6 +4784,7 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4509
4784
|
const isFullscreen = currentLayout === LEADGEN_LAYOUT.Fullscreen;
|
|
4510
4785
|
const isInPage = isInline || isSidebar;
|
|
4511
4786
|
const isDrawer = isLightBoxB && isMobile;
|
|
4787
|
+
const isNewUI = useMemo(() => CAMPAGE_CODE_LIST_APPLY_NEW_UI.includes(campaignCode), [campaignCode]);
|
|
4512
4788
|
const limitFieldsLightBoxB = isLightBoxB && listBlockAdded.length <= LEADGEN_LIMIT_LIGHTBOXB;
|
|
4513
4789
|
const hasForm = isLightBoxA
|
|
4514
4790
|
? listBlockAdded.some((item) => LEADGEN_BLOCK_INPUT.some((k) => k === (item === null || item === void 0 ? void 0 : item.name)))
|
|
@@ -4517,6 +4793,17 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4517
4793
|
const showHeader = !!imageMobile || !!imageDesktop;
|
|
4518
4794
|
const onlyHeader = !title && !description;
|
|
4519
4795
|
const showButtonClose = !isInline;
|
|
4796
|
+
const validatingPhoneRef = useRef(false);
|
|
4797
|
+
const validatingEmailRef = useRef(false);
|
|
4798
|
+
const { form, validateObj } = useLeadFormConfig({
|
|
4799
|
+
listBlockAdded,
|
|
4800
|
+
validatingPhoneRef,
|
|
4801
|
+
validatingEmailRef,
|
|
4802
|
+
campaignId,
|
|
4803
|
+
campaign_subot_id,
|
|
4804
|
+
userInfo,
|
|
4805
|
+
format: (_a = (ISO_FORMAT[locale] || ISO_FORMAT['vi-VN'])) === null || _a === void 0 ? void 0 : _a.dateFormat,
|
|
4806
|
+
});
|
|
4520
4807
|
if (window.innerWidth < 769 &&
|
|
4521
4808
|
LEADGEN_LAYOUT_NOT_SHOW_IN_MOBILE.includes(currentLayout)) {
|
|
4522
4809
|
console.log('😎 Not show fullscreen, slider on mobile ');
|
|
@@ -4531,17 +4818,33 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4531
4818
|
}
|
|
4532
4819
|
clearCacheUsedEmailOrPhone();
|
|
4533
4820
|
}, []);
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4821
|
+
useEffect(() => {
|
|
4822
|
+
formRef.current && setLastFormRef(formRef.current);
|
|
4823
|
+
}, [formRef.current]);
|
|
4824
|
+
useEffect(() => {
|
|
4825
|
+
const handleBeforeUnload = () => {
|
|
4826
|
+
!isTrackedForm.current &&
|
|
4827
|
+
!showThankyou &&
|
|
4828
|
+
(onUnmount === null || onUnmount === void 0 ? void 0 : onUnmount({
|
|
4829
|
+
formValues: form.values,
|
|
4830
|
+
formActiveTime: formActiveTime.current,
|
|
4831
|
+
formRef: lastFormRef,
|
|
4832
|
+
listBlockAdded,
|
|
4833
|
+
}));
|
|
4834
|
+
};
|
|
4835
|
+
window.addEventListener('beforeunload', handleBeforeUnload);
|
|
4836
|
+
return () => window.removeEventListener('beforeunload', handleBeforeUnload);
|
|
4837
|
+
}, [lastFormRef, form.values, showThankyou]);
|
|
4838
|
+
useEffect(() => {
|
|
4839
|
+
let intervalId = null;
|
|
4840
|
+
if (isLightBox && !showThankyou) {
|
|
4841
|
+
intervalId = setInterval(() => {
|
|
4842
|
+
formActiveTime.current += 1;
|
|
4843
|
+
// console.log({ formActiveTime: formActiveTime.current })
|
|
4844
|
+
}, 1000);
|
|
4845
|
+
}
|
|
4846
|
+
return () => clearInterval(intervalId);
|
|
4847
|
+
}, [showThankyou]);
|
|
4545
4848
|
const listBlockAddedRequired = useMemo(() => leadGenFieldRequired(listBlockAdded), listBlockAdded);
|
|
4546
4849
|
const disabledButtonSubmit = useMemo(() => {
|
|
4547
4850
|
if (listBlockAddedRequired.length) {
|
|
@@ -4551,10 +4854,46 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4551
4854
|
}, [...listBlockAddedRequired.map((k) => form.values[k])]);
|
|
4552
4855
|
const onFocus = (e) => {
|
|
4553
4856
|
e.preventDefault();
|
|
4554
|
-
|
|
4555
|
-
const
|
|
4556
|
-
|
|
4557
|
-
|
|
4857
|
+
function scrollIntoView() {
|
|
4858
|
+
const $Input = e.target;
|
|
4859
|
+
const $TextField = $Input.closest('.leadgen-form_field');
|
|
4860
|
+
const scrollIntoView = {
|
|
4861
|
+
block: 'center',
|
|
4862
|
+
behavior: 'auto',
|
|
4863
|
+
};
|
|
4864
|
+
if ($TextField.classList.contains('DropdownBlock')) {
|
|
4865
|
+
scrollIntoView.block = 'start';
|
|
4866
|
+
const tfOffsetTop = ($TextField === null || $TextField === void 0 ? void 0 : $TextField.offsetTop) || 0;
|
|
4867
|
+
const tfHeight = $TextField.clientHeight;
|
|
4868
|
+
const $ScrollableElement = getParentScroll($TextField);
|
|
4869
|
+
if ($ScrollableElement) {
|
|
4870
|
+
// https://hhgdev.atlassian.net/browse/EL-682
|
|
4871
|
+
const scrollHeight = $ScrollableElement.scrollHeight;
|
|
4872
|
+
if (scrollHeight - (tfOffsetTop + tfHeight) < 192) {
|
|
4873
|
+
scrollIntoView.block = 'end';
|
|
4874
|
+
}
|
|
4875
|
+
}
|
|
4876
|
+
}
|
|
4877
|
+
if (isMobile) {
|
|
4878
|
+
window.scrollTo(0, 0);
|
|
4879
|
+
}
|
|
4880
|
+
$TextField.scrollIntoView(scrollIntoView);
|
|
4881
|
+
}
|
|
4882
|
+
let time = 0;
|
|
4883
|
+
function requestFrame(timestamp) {
|
|
4884
|
+
if (time === 0) {
|
|
4885
|
+
time = timestamp;
|
|
4886
|
+
}
|
|
4887
|
+
if (timestamp - time <= 250) {
|
|
4888
|
+
requestAnimationFrame(requestFrame);
|
|
4889
|
+
}
|
|
4890
|
+
else {
|
|
4891
|
+
scrollIntoView();
|
|
4892
|
+
}
|
|
4893
|
+
}
|
|
4894
|
+
if (isMobile) {
|
|
4895
|
+
requestAnimationFrame(requestFrame);
|
|
4896
|
+
}
|
|
4558
4897
|
};
|
|
4559
4898
|
const middlewareOnSubmit = (e) => {
|
|
4560
4899
|
e.preventDefault();
|
|
@@ -4611,7 +4950,12 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4611
4950
|
var _a;
|
|
4612
4951
|
const respMessage = (_a = res === null || res === void 0 ? void 0 : res._messages) === null || _a === void 0 ? void 0 : _a[0];
|
|
4613
4952
|
if (respMessage === 'This phone number was verified') {
|
|
4614
|
-
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(
|
|
4953
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit({
|
|
4954
|
+
formValues: v,
|
|
4955
|
+
formActiveTime: formActiveTime.current,
|
|
4956
|
+
formRef: formRef.current,
|
|
4957
|
+
listBlockAdded,
|
|
4958
|
+
});
|
|
4615
4959
|
return;
|
|
4616
4960
|
}
|
|
4617
4961
|
setShowOtpPhone(newShowOtpPhone);
|
|
@@ -4621,7 +4965,12 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4621
4965
|
});
|
|
4622
4966
|
return;
|
|
4623
4967
|
}
|
|
4624
|
-
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(
|
|
4968
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit({
|
|
4969
|
+
formValues: v,
|
|
4970
|
+
formActiveTime: formActiveTime.current,
|
|
4971
|
+
formRef: formRef.current,
|
|
4972
|
+
listBlockAdded,
|
|
4973
|
+
});
|
|
4625
4974
|
})(e);
|
|
4626
4975
|
}, 100);
|
|
4627
4976
|
};
|
|
@@ -4667,7 +5016,12 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4667
5016
|
React__default.createElement(LightboxFields, { listBlockAdded: listBlockAdded, popupId: popupId, locale: locale, onClose: onClose, onOtherSubmit: onOtherSubmit }))))));
|
|
4668
5017
|
const PopupOtp = showOtpPhone && (React__default.createElement(OtpBlock, { otpData: showOtpPhone, autoSendWhenOpen: false, onSuccess: () => {
|
|
4669
5018
|
setShowOtpPhone(null);
|
|
4670
|
-
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(
|
|
5019
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit({
|
|
5020
|
+
formValues: form.values,
|
|
5021
|
+
formActiveTime: formActiveTime.current,
|
|
5022
|
+
formRef: formRef.current,
|
|
5023
|
+
listBlockAdded,
|
|
5024
|
+
});
|
|
4671
5025
|
} }));
|
|
4672
5026
|
const PopupThankYou = showThankyou && (React__default.createElement(ThankyouPopup, { title: showThankyou.title, titleAlign: showThankyou.titleAlign, subtitle: showThankyou.subtitle, subtitleAlign: showThankyou.subtitleAlign, link: showThankyou.link, linkNewTab: showThankyou.linkNewTab, linkText: showThankyou.linkText, image: showThankyou.image }));
|
|
4673
5027
|
const PopupContent = (React__default.createElement("div", { className: clsx('leadgen-content', {
|
|
@@ -4702,18 +5056,13 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4702
5056
|
'leadgen-inline': isInPage,
|
|
4703
5057
|
'leadgen-slider': isSlider,
|
|
4704
5058
|
});
|
|
4705
|
-
const PopupContainer = isDrawer ? (
|
|
4706
|
-
// <LeadGenLightBoxB
|
|
4707
|
-
// form={form}
|
|
4708
|
-
// loading={isSubmitLoading}
|
|
4709
|
-
// visible={open}
|
|
4710
|
-
// onVisible={() => onOpenChange(false)}
|
|
4711
|
-
// >
|
|
4712
|
-
// {PopupWrapper}
|
|
4713
|
-
// </LeadGenLightBoxB>
|
|
4714
|
-
React__default.createElement(DrawerComponent, { fadeFromIndex: ZINDEX_SSO - 9e6, open: open, snapPoints: [0.8, 1], activeSnapPoint: snap, setActiveSnapPoint: setSnap, onOpenChange: onOpenChange, overlayClassName: popupContainerClassName, className: "leadgen-drawer" },
|
|
5059
|
+
const PopupContainer = isDrawer ? (isNewUI ? (React__default.createElement(LeadGenLightBoxB, { form: form, loading: isSubmitLoading, visible: open, onVisible: () => onOpenChange(false) }, PopupWrapper)) : (React__default.createElement(DrawerComponent, { fadeFromIndex: ZINDEX_SSO - 9e6, open: open, snapPoints: [0.8, 1], activeSnapPoint: snap, setActiveSnapPoint: setSnap, onOpenChange: onOpenChange, overlayClassName: popupContainerClassName, className: "leadgen-drawer" },
|
|
4715
5060
|
PopupWrapper,
|
|
4716
|
-
React__default.createElement("div", { style: {
|
|
5061
|
+
React__default.createElement("div", { style: {
|
|
5062
|
+
position: 'absolute',
|
|
5063
|
+
inset: 0,
|
|
5064
|
+
zIndex: snap === 1 ? -1 : 1,
|
|
5065
|
+
}, onClick: () => setSnap(1) })))) : (React__default.createElement("div", { id: popupId, "data-popup-url": currentPath, "data-popup-type": "lightbox-inline", className: popupContainerClassName, style: isMobile ? { maxHeight: height } : undefined },
|
|
4717
5066
|
isFullscreen ? (React__default.createElement("img", { className: "le-only-desktop le-fullscreen-img", draggable: false, src: imageBackground || '', style: {
|
|
4718
5067
|
aspectRatio: `${imageBackgroundWidth}/${imageBackgroundHeight}`,
|
|
4719
5068
|
} })) : null,
|
|
@@ -4820,7 +5169,7 @@ function getCategoryLevel(t = 'Xin chao {{category_2}} extra') {
|
|
|
4820
5169
|
return null;
|
|
4821
5170
|
}
|
|
4822
5171
|
}
|
|
4823
|
-
const NewLeadPopup = ({ campaign, action, onSubmit, onClose, showThankyou, locale, showEmpty, setShowEmpty, userInfo, }) => {
|
|
5172
|
+
const NewLeadPopup = ({ campaign, action, onSubmit, onClose, onUnmount, showThankyou, locale, showEmpty, setShowEmpty, userInfo, }) => {
|
|
4824
5173
|
var _a, _b;
|
|
4825
5174
|
const { apiUrl, siteDomain } = useContext(LeadGenContext$1);
|
|
4826
5175
|
useEffect(() => {
|
|
@@ -4939,7 +5288,7 @@ const NewLeadPopup = ({ campaign, action, onSubmit, onClose, showThankyou, local
|
|
|
4939
5288
|
currentLayout == 'Fullscreen' ||
|
|
4940
5289
|
currentLayout == 'Sidebar' ||
|
|
4941
5290
|
currentLayout == 'Slider') {
|
|
4942
|
-
return (React__default.createElement(LightboxLayout, { popupId: popupIdRef.current, extraFields: extra_fields, onClose: onClose, onOtherSubmit: onOtherSubmit, imageMobile: image, imageDesktop: image_desktop, imageBackground: image_background, currentLayout: currentLayout, title: titleText, onSubmit: (
|
|
5291
|
+
return (React__default.createElement(LightboxLayout, { popupId: popupIdRef.current, extraFields: extra_fields, onClose: onClose, onOtherSubmit: onOtherSubmit, onUnmount: onUnmount, 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 }));
|
|
4943
5292
|
}
|
|
4944
5293
|
else if (currentLayout.includes('Skin')) {
|
|
4945
5294
|
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 }));
|
|
@@ -4947,9 +5296,69 @@ const NewLeadPopup = ({ campaign, action, onSubmit, onClose, showThankyou, local
|
|
|
4947
5296
|
return null;
|
|
4948
5297
|
};
|
|
4949
5298
|
|
|
5299
|
+
const numberFormatType = 2; // i18n.phonenumbers.PhoneNumberFormat.NATIONAL
|
|
5300
|
+
const formatFormData = (currentForm, formData) => formData.map((i) => {
|
|
5301
|
+
var _a, _b, _c, _d;
|
|
5302
|
+
const control = ((_a = currentForm
|
|
5303
|
+
.querySelector(`*[name="${i.name}"][data-control]`)) === null || _a === void 0 ? void 0 : _a.getAttribute('data-control')) ||
|
|
5304
|
+
((_b = currentForm
|
|
5305
|
+
.querySelector(`*[data-extra][data-name="${i.name}"]`)) === null || _b === void 0 ? void 0 : _b.getAttribute('data-control')) ||
|
|
5306
|
+
'text';
|
|
5307
|
+
const leadControl = ((_c = currentForm
|
|
5308
|
+
.querySelector(`*[name="${i.name}"][data-lead-control]`)) === null || _c === void 0 ? void 0 : _c.getAttribute('data-lead-control')) ||
|
|
5309
|
+
((_d = currentForm
|
|
5310
|
+
.querySelector(`*[data-extra][data-name="${i.name}"]`)) === null || _d === void 0 ? void 0 : _d.getAttribute('data-lead-control')) ||
|
|
5311
|
+
'text';
|
|
5312
|
+
const value = control === 'tel'
|
|
5313
|
+
? window.intlTelInputUtils
|
|
5314
|
+
.formatNumber(String(i.value), LEAD_LOCALE === null || LEAD_LOCALE === void 0 ? void 0 : LEAD_LOCALE.countryCodeNumber, numberFormatType)
|
|
5315
|
+
.replace(/\s+/g, '')
|
|
5316
|
+
: control === 'date'
|
|
5317
|
+
? dayjs(i.value).format('YYYY-MM-DD')
|
|
5318
|
+
: i.value;
|
|
5319
|
+
return {
|
|
5320
|
+
key: i.name,
|
|
5321
|
+
value,
|
|
5322
|
+
control,
|
|
5323
|
+
leadControl,
|
|
5324
|
+
// is_sent_mailchimp: currentForm.querySelector(
|
|
5325
|
+
// `div[data-name="${i.name}-mailchimp"]`,
|
|
5326
|
+
// )
|
|
5327
|
+
// ? 'true'
|
|
5328
|
+
// : 'false',
|
|
5329
|
+
};
|
|
5330
|
+
});
|
|
5331
|
+
|
|
5332
|
+
const formatTrackingData = (params) => {
|
|
5333
|
+
const { formParams = {}, currentLayout, commonData } = params;
|
|
5334
|
+
const { formValues, formActiveTime, listBlockAdded } = formParams;
|
|
5335
|
+
const listFieldHasValue = [];
|
|
5336
|
+
const data = Object.assign(Object.assign({ template_type: currentLayout, time_on_form: [LEADGEN_LAYOUT.LightBoxA, LEADGEN_LAYOUT.LightBoxB].includes(currentLayout)
|
|
5337
|
+
? formActiveTime
|
|
5338
|
+
: 0 }, commonData), { data_input: formValues.map((control) => {
|
|
5339
|
+
listFieldHasValue.push(control.leadControl);
|
|
5340
|
+
return {
|
|
5341
|
+
field_name: control.key,
|
|
5342
|
+
component_type: control.leadControl,
|
|
5343
|
+
value: control.value,
|
|
5344
|
+
};
|
|
5345
|
+
}), data_not_input: listBlockAdded
|
|
5346
|
+
.map((item) => {
|
|
5347
|
+
const leadControlName = item.name;
|
|
5348
|
+
if (!listFieldHasValue.includes(leadControlName)) {
|
|
5349
|
+
return {
|
|
5350
|
+
field_name: item.data.value,
|
|
5351
|
+
component_type: leadControlName,
|
|
5352
|
+
};
|
|
5353
|
+
}
|
|
5354
|
+
})
|
|
5355
|
+
.filter(Boolean) });
|
|
5356
|
+
return data;
|
|
5357
|
+
};
|
|
5358
|
+
|
|
4950
5359
|
// mount css
|
|
4951
5360
|
const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor, apiSubotUrl, DEBUG_URL, forceCampaign, children, extraPayloadValues = [], excludeExitRulesHandler, userInfo, onClose: onCloseProps, onSubmit: onSubmitProps, }) => {
|
|
4952
|
-
var _a;
|
|
5361
|
+
var _a, _b;
|
|
4953
5362
|
const scrollEventHandlerRef = useRef();
|
|
4954
5363
|
const leadStartTimeRef = useRef(Date.now());
|
|
4955
5364
|
const { apiUrl } = useMemo(() => {
|
|
@@ -4965,6 +5374,7 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
|
|
|
4965
5374
|
const [action, setAction] = useState('');
|
|
4966
5375
|
const [showThankyou, setShowThankyou] = useState(null);
|
|
4967
5376
|
const [showEmpty, setShowEmpty] = useState(false);
|
|
5377
|
+
const currentLayout = useMemo(() => showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields.currentLayout, [showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields.currentLayout]);
|
|
4968
5378
|
useEffect(() => {
|
|
4969
5379
|
if (forceCampaign) {
|
|
4970
5380
|
setShowCampaign(forceCampaign);
|
|
@@ -4987,14 +5397,15 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
|
|
|
4987
5397
|
setAction('HIDE');
|
|
4988
5398
|
onCloseProps === null || onCloseProps === void 0 ? void 0 : onCloseProps();
|
|
4989
5399
|
};
|
|
4990
|
-
const onClose = () => {
|
|
4991
|
-
var
|
|
5400
|
+
const onClose = (params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
5401
|
+
var _c, _d;
|
|
5402
|
+
const { formRef, listBlockAdded, formValues: formDataObj } = params;
|
|
4992
5403
|
if (!showCampaign)
|
|
4993
5404
|
return;
|
|
4994
5405
|
LeadLog(`👋👋👋 CLOSE POPUP ${showCampaign.code} 👋👋👋`);
|
|
4995
5406
|
if (!excludeExitRulesHandler) {
|
|
4996
|
-
const showAfterExit = Number((
|
|
4997
|
-
const expiresDay = Number((
|
|
5407
|
+
const showAfterExit = Number((_c = showCampaign.rules.find((rule) => rule.rule == 'show_again_after_exit')) === null || _c === void 0 ? void 0 : _c.value);
|
|
5408
|
+
const expiresDay = Number((_d = showCampaign.rules.find((rule) => rule.rule == 'days_to_show_again')) === null || _d === void 0 ? void 0 : _d.value);
|
|
4998
5409
|
if (showAfterExit == 0) {
|
|
4999
5410
|
if (!expiresDay) {
|
|
5000
5411
|
setCookie(`lead_closed_${showCampaign.code}`, `target_${showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields.popupVersion}`, { domain: '.' + siteDomain, path: '/' });
|
|
@@ -5004,21 +5415,73 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
|
|
|
5004
5415
|
}
|
|
5005
5416
|
}
|
|
5006
5417
|
}
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5418
|
+
const formData = Object.keys(formDataObj)
|
|
5419
|
+
.filter((key) => !!formDataObj[key])
|
|
5420
|
+
.map((key) => ({
|
|
5421
|
+
name: key,
|
|
5422
|
+
value: String(formDataObj[key]),
|
|
5423
|
+
}));
|
|
5424
|
+
let formatedFormData = null;
|
|
5425
|
+
if (!showThankyou) {
|
|
5426
|
+
formatedFormData = formatFormData(formRef, formData);
|
|
5427
|
+
}
|
|
5428
|
+
yield Promise.all([
|
|
5429
|
+
fetch(`${apiUrl}api/campaign/${showCampaign.code}/popup_exit`, {
|
|
5430
|
+
method: 'POST',
|
|
5431
|
+
headers: {
|
|
5432
|
+
'Content-Type': 'application/json',
|
|
5433
|
+
},
|
|
5434
|
+
body: JSON.stringify({
|
|
5435
|
+
action: 'CLICK',
|
|
5436
|
+
url: location.href.toLowerCase(),
|
|
5437
|
+
title_article: document.title,
|
|
5438
|
+
cookie_id: getCookie('hhg-id'),
|
|
5439
|
+
duration: Math.ceil((Date.now() - leadStartTimeRef.current) / 1000),
|
|
5440
|
+
}),
|
|
5018
5441
|
}),
|
|
5019
|
-
|
|
5442
|
+
!showThankyou &&
|
|
5443
|
+
trackingCompletionForm({
|
|
5444
|
+
commonData: {
|
|
5445
|
+
cookie_id: getCookie('hhg-id'),
|
|
5446
|
+
ga_client_id: getCookie('_ga') || null,
|
|
5447
|
+
country_code: locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN',
|
|
5448
|
+
status: 'in_progress',
|
|
5449
|
+
campaign_id: showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.id,
|
|
5450
|
+
total_fields: listBlockAdded.length,
|
|
5451
|
+
},
|
|
5452
|
+
currentLayout,
|
|
5453
|
+
formParams: Object.assign(Object.assign({}, params), { formValues: formatedFormData }),
|
|
5454
|
+
}),
|
|
5455
|
+
]);
|
|
5020
5456
|
onCloseBase();
|
|
5021
|
-
};
|
|
5457
|
+
});
|
|
5458
|
+
const onUnmount = (params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
5459
|
+
const { formRef, listBlockAdded, formValues: formDataObj } = params;
|
|
5460
|
+
if ([LEADGEN_LAYOUT.InlineA, LEADGEN_LAYOUT.InlineB].includes(currentLayout) &&
|
|
5461
|
+
Object.keys(formDataObj).length === 0)
|
|
5462
|
+
return;
|
|
5463
|
+
const formData = Object.keys(formDataObj)
|
|
5464
|
+
.filter((key) => !!formDataObj[key])
|
|
5465
|
+
.map((key) => ({
|
|
5466
|
+
name: key,
|
|
5467
|
+
value: String(formDataObj[key]),
|
|
5468
|
+
}));
|
|
5469
|
+
const formatedFormData = formatFormData(formRef, formData);
|
|
5470
|
+
const data = formatTrackingData({
|
|
5471
|
+
commonData: {
|
|
5472
|
+
cookie_id: getCookie('hhg-id'),
|
|
5473
|
+
ga_client_id: getCookie('_ga') || null,
|
|
5474
|
+
country_code: locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN',
|
|
5475
|
+
status: 'in_progress',
|
|
5476
|
+
campaign_id: showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.id,
|
|
5477
|
+
total_fields: listBlockAdded.length,
|
|
5478
|
+
},
|
|
5479
|
+
currentLayout,
|
|
5480
|
+
formParams: Object.assign(Object.assign({}, params), { formValues: formatedFormData }),
|
|
5481
|
+
});
|
|
5482
|
+
const blob = new Blob([JSON.stringify(data)], { type: 'application/json' });
|
|
5483
|
+
navigator.sendBeacon(`${apiUrl}api/collection/tracking-completion`, blob);
|
|
5484
|
+
});
|
|
5022
5485
|
useEffect(() => {
|
|
5023
5486
|
if (forceCampaign === null || forceCampaign === void 0 ? void 0 : forceCampaign.code)
|
|
5024
5487
|
return;
|
|
@@ -5057,8 +5520,24 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
|
|
|
5057
5520
|
DEBUG_URL,
|
|
5058
5521
|
});
|
|
5059
5522
|
}, []);
|
|
5060
|
-
const
|
|
5061
|
-
|
|
5523
|
+
const trackingCompletionForm = useCallback((params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
5524
|
+
const { currentLayout, formParams } = params;
|
|
5525
|
+
const { formValues } = formParams;
|
|
5526
|
+
if ([LEADGEN_LAYOUT.InlineA, LEADGEN_LAYOUT.InlineB].includes(currentLayout) &&
|
|
5527
|
+
Object.keys(formValues).length === 0)
|
|
5528
|
+
return;
|
|
5529
|
+
const data = formatTrackingData(params);
|
|
5530
|
+
return fetch(`${apiUrl}api/collection/tracking-completion`, {
|
|
5531
|
+
method: 'POST',
|
|
5532
|
+
headers: {
|
|
5533
|
+
'Content-Type': 'application/json',
|
|
5534
|
+
},
|
|
5535
|
+
body: JSON.stringify(data),
|
|
5536
|
+
});
|
|
5537
|
+
}), [(_a = showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields) === null || _a === void 0 ? void 0 : _a.currentLayout]);
|
|
5538
|
+
const onSubmit = (params, categoryLevel, categoryData) => __awaiter(void 0, void 0, void 0, function* () {
|
|
5539
|
+
var _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
5540
|
+
const { formRef, listBlockAdded, formValues: formDataObj } = params;
|
|
5062
5541
|
if (!formDataObj || Object.values(formDataObj).every((v) => !Boolean(v))) {
|
|
5063
5542
|
setShowEmpty(true);
|
|
5064
5543
|
return;
|
|
@@ -5071,55 +5550,26 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
|
|
|
5071
5550
|
value: String(formDataObj[key]),
|
|
5072
5551
|
}));
|
|
5073
5552
|
console.log('** RYAN index.tsx 218 formData : ', formData);
|
|
5074
|
-
const numberFormatType = 2; // i18n.phonenumbers.PhoneNumberFormat.NATIONAL
|
|
5075
5553
|
// Get ga_client_id from cookies
|
|
5076
5554
|
const gaCookie = getCookie('_ga') || null;
|
|
5077
5555
|
if (!window.intlTelInputUtils) {
|
|
5078
5556
|
yield require('intl-tel-input/build/js/utils');
|
|
5079
5557
|
}
|
|
5080
|
-
const
|
|
5081
|
-
|
|
5082
|
-
title_article: document.title,
|
|
5083
|
-
meta: [
|
|
5084
|
-
...formData.map((i) => {
|
|
5085
|
-
var _a, _b;
|
|
5086
|
-
const control = ((_a = currentForm
|
|
5087
|
-
.querySelector(`*[name="${i.name}"][data-control]`)) === null || _a === void 0 ? void 0 : _a.getAttribute('data-control')) ||
|
|
5088
|
-
((_b = currentForm
|
|
5089
|
-
.querySelector(`*[data-extra][data-name="${i.name}"]`)) === null || _b === void 0 ? void 0 : _b.getAttribute('data-control')) ||
|
|
5090
|
-
'text';
|
|
5091
|
-
const value = control === 'tel'
|
|
5092
|
-
? window.intlTelInputUtils
|
|
5093
|
-
.formatNumber(String(i.value), LEAD_LOCALE === null || LEAD_LOCALE === void 0 ? void 0 : LEAD_LOCALE.countryCodeNumber, numberFormatType)
|
|
5094
|
-
.replace(/\s+/g, '')
|
|
5095
|
-
: control === 'date'
|
|
5096
|
-
? dayjs(i.value).format('YYYY-MM-DD')
|
|
5097
|
-
: i.value;
|
|
5098
|
-
return {
|
|
5099
|
-
key: i.name,
|
|
5100
|
-
value,
|
|
5101
|
-
control,
|
|
5102
|
-
// is_sent_mailchimp: currentForm.querySelector(
|
|
5103
|
-
// `div[data-name="${i.name}-mailchimp"]`,
|
|
5104
|
-
// )
|
|
5105
|
-
// ? 'true'
|
|
5106
|
-
// : 'false',
|
|
5107
|
-
};
|
|
5108
|
-
}),
|
|
5109
|
-
...extraPayloadValues,
|
|
5110
|
-
],
|
|
5558
|
+
const formatedFormData = formatFormData(formRef, formData);
|
|
5559
|
+
const commonData = {
|
|
5111
5560
|
cookie_id: getCookie('hhg-id'),
|
|
5112
5561
|
ga_client_id: gaCookie,
|
|
5113
5562
|
};
|
|
5563
|
+
const data = Object.assign({ url: location.href.toLowerCase(), title_article: document.title, meta: [...formatedFormData, ...extraPayloadValues] }, commonData);
|
|
5114
5564
|
// categoryLevel
|
|
5115
5565
|
if (categoryLevel) {
|
|
5116
5566
|
if (categoryData[categoryLevel].value_en) {
|
|
5117
5567
|
data['category'] = categoryData[categoryLevel].value_en;
|
|
5118
5568
|
}
|
|
5119
5569
|
}
|
|
5120
|
-
const expiresDay = Number(((
|
|
5570
|
+
const expiresDay = Number(((_f = (_e = showCampaign.rules) === null || _e === void 0 ? void 0 : _e.find((r) => r.rule === 'days_to_show_again')) === null || _f === void 0 ? void 0 : _f.value) ||
|
|
5121
5571
|
7);
|
|
5122
|
-
const showAgain = Number(((
|
|
5572
|
+
const showAgain = Number(((_h = (_g = showCampaign.rules) === null || _g === void 0 ? void 0 : _g.find((r) => r.rule === 'show_again_after_submit')) === null || _h === void 0 ? void 0 : _h.value) || 0);
|
|
5123
5573
|
if (showAgain == 0) {
|
|
5124
5574
|
LeadLog('⛔ Popup never show again!');
|
|
5125
5575
|
setCookie(`lead_submited_${showCampaign.code}`, `target_${showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields.targetType}`, { domain: '.' + siteDomain, path: '/' });
|
|
@@ -5128,13 +5578,20 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
|
|
|
5128
5578
|
LeadLog(`⌛ Popup will show again after ${expiresDay} days!`);
|
|
5129
5579
|
setCookie(`lead_submited_${showCampaign.code}`, `target_${showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields.targetType}`, { domain: '.' + siteDomain, days: expiresDay, path: '/' });
|
|
5130
5580
|
}
|
|
5131
|
-
|
|
5132
|
-
|
|
5133
|
-
|
|
5134
|
-
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5581
|
+
yield Promise.all([
|
|
5582
|
+
fetch(`${apiUrl}api/campaign/${showCampaign.code}/lead`, {
|
|
5583
|
+
method: 'POST',
|
|
5584
|
+
headers: {
|
|
5585
|
+
'Content-Type': 'application/json',
|
|
5586
|
+
},
|
|
5587
|
+
body: JSON.stringify(data),
|
|
5588
|
+
}),
|
|
5589
|
+
trackingCompletionForm({
|
|
5590
|
+
commonData: Object.assign(Object.assign({}, commonData), { country_code: locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN', status: 'complete', campaign_id: showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.id, total_fields: listBlockAdded.length }),
|
|
5591
|
+
currentLayout,
|
|
5592
|
+
formParams: Object.assign(Object.assign({}, params), { formValues: formatedFormData }),
|
|
5593
|
+
}),
|
|
5594
|
+
]);
|
|
5138
5595
|
onSubmitProps === null || onSubmitProps === void 0 ? void 0 : onSubmitProps(formDataObj);
|
|
5139
5596
|
if ((showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields.popupShowThankYou) == 'notshow') {
|
|
5140
5597
|
onClose();
|
|
@@ -5153,15 +5610,15 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
|
|
|
5153
5610
|
const titleBlock = listBlockThankyou.find((i) => i.name == 'TitleBlock');
|
|
5154
5611
|
const subtitleBlock = listBlockThankyou.find((i) => i.name == 'SubtitleBlock');
|
|
5155
5612
|
const linkButtonBlock = listBlockThankyou.find((i) => i.name == 'LinkButtonBlock');
|
|
5156
|
-
thankTitle = ((
|
|
5157
|
-
titleAlign = ((
|
|
5158
|
-
thankDesc = ((
|
|
5159
|
-
descAlign = ((
|
|
5160
|
-
linkText = ((
|
|
5161
|
-
linkNewTab = ((
|
|
5162
|
-
linkUrl = ((
|
|
5613
|
+
thankTitle = ((_j = titleBlock === null || titleBlock === void 0 ? void 0 : titleBlock.data) === null || _j === void 0 ? void 0 : _j.value) || '';
|
|
5614
|
+
titleAlign = ((_k = titleBlock === null || titleBlock === void 0 ? void 0 : titleBlock.data) === null || _k === void 0 ? void 0 : _k.align) || '';
|
|
5615
|
+
thankDesc = ((_l = subtitleBlock === null || subtitleBlock === void 0 ? void 0 : subtitleBlock.data) === null || _l === void 0 ? void 0 : _l.value) || '';
|
|
5616
|
+
descAlign = ((_m = subtitleBlock === null || subtitleBlock === void 0 ? void 0 : subtitleBlock.data) === null || _m === void 0 ? void 0 : _m.align) || '';
|
|
5617
|
+
linkText = ((_o = linkButtonBlock === null || linkButtonBlock === void 0 ? void 0 : linkButtonBlock.data) === null || _o === void 0 ? void 0 : _o.value) || '';
|
|
5618
|
+
linkNewTab = ((_p = linkButtonBlock === null || linkButtonBlock === void 0 ? void 0 : linkButtonBlock.data) === null || _p === void 0 ? void 0 : _p.newtab) || false;
|
|
5619
|
+
linkUrl = ((_q = linkButtonBlock === null || linkButtonBlock === void 0 ? void 0 : linkButtonBlock.data) === null || _q === void 0 ? void 0 : _q.url) || '';
|
|
5163
5620
|
// ALWAYS SHOW THANK YOU ON COMPOUND COMP
|
|
5164
|
-
// const curLayout =
|
|
5621
|
+
// const curLayout = currentLayout
|
|
5165
5622
|
// TODO: newbuilder thank you
|
|
5166
5623
|
// List layout not show thanks you
|
|
5167
5624
|
// if (
|
|
@@ -5218,16 +5675,22 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
|
|
|
5218
5675
|
leadStartTimeRef.current = Date.now();
|
|
5219
5676
|
}
|
|
5220
5677
|
}, [showCampaign]);
|
|
5221
|
-
return (React__default.createElement(LeadGenContext$1.Provider, { value: {
|
|
5678
|
+
return (React__default.createElement(LeadGenContext$1.Provider, { value: {
|
|
5679
|
+
primaryColor,
|
|
5680
|
+
apiUrl,
|
|
5681
|
+
siteDomain,
|
|
5682
|
+
siteId,
|
|
5683
|
+
locale,
|
|
5684
|
+
} },
|
|
5222
5685
|
React__default.createElement(TranslationsContext.Provider, { value: { locale, values: getTranslations(locale) } }, children ? (React__default.createElement(Component, { campaign: showCampaign, onSubmit: onSubmit, onClose: onClose, showThankyou: showThankyou, setShowThankyou: setShowThankyou, locale: locale, showEmpty: showEmpty, setShowEmpty: setShowEmpty, userInfo: userInfo }, children)) : (React__default.createElement(Portal, { target: getPopupWrapperDom() },
|
|
5223
5686
|
React__default.createElement(Box, { sx: { position: 'fixed', zIndex: ZINDEX_SSO - 9e6 } },
|
|
5224
|
-
React__default.createElement(Transition, { mounted: Boolean(((
|
|
5687
|
+
React__default.createElement(Transition, { mounted: Boolean(((_b = showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields) === null || _b === void 0 ? void 0 : _b.popupVersion) === '2.1'), transition: "fade", duration: 600, timingFunction: "ease", exitDuration: 200 }, (styles) => {
|
|
5225
5688
|
var _a;
|
|
5226
5689
|
return (React__default.createElement(Box, { style: styles }, ((_a = showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields) === null || _a === void 0 ? void 0 : _a.popupVersion) === '2.1' && (React__default.createElement(React__default.Fragment, null,
|
|
5227
|
-
!!
|
|
5228
|
-
!
|
|
5229
|
-
!
|
|
5230
|
-
React__default.createElement(NewLeadPopup, { campaign: showCampaign, action: action, onSubmit: onSubmit, onClose: onClose, showThankyou: showThankyou, locale: locale, showEmpty: showEmpty, setShowEmpty: setShowEmpty, userInfo: userInfo })))));
|
|
5690
|
+
!!currentLayout &&
|
|
5691
|
+
!currentLayout.includes('Inline') &&
|
|
5692
|
+
!currentLayout.includes('Sidebar') && (React__default.createElement(Overlay, { color: "#000", opacity: 0.6, center: true, zIndex: 400, pos: 'fixed', onClick: () => onClose() })),
|
|
5693
|
+
React__default.createElement(NewLeadPopup, { campaign: showCampaign, action: action, onSubmit: onSubmit, onClose: onClose, onUnmount: onUnmount, showThankyou: showThankyou, locale: locale, showEmpty: showEmpty, setShowEmpty: setShowEmpty, userInfo: userInfo })))));
|
|
5231
5694
|
})))))));
|
|
5232
5695
|
};
|
|
5233
5696
|
const LeadGen = _LeadGen;
|