@hhgtech/hhg-components 1.29.367-beta-10 → 1.29.368
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-d62979c2.js → InputDate-be1dc001.js} +20 -20
- package/build/{LastPeriod-e2f820cf.js → LastPeriod-2f220ba7.js} +1 -1
- package/build/{Locale-84809586.js → Locale-3aef42b0.js} +0 -1
- package/build/{MobileBottomNavigationIcon-f66f283b.js → MobileBottomNavigationIcon-d5a79945.js} +3 -3
- package/build/{Spinner-60a9022d.js → Spinner-113cf810.js} +1 -1
- package/build/{WhatsApp-0ca331b9.js → WhatsApp-d21c0ab7.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/logo/index.d.ts +1 -1
- package/build/components/mantine/phone/index.d.ts +0 -2
- package/build/components.js +96 -96
- package/build/{constants-a41ccf75.js → constants-60e88ec3.js} +0 -1
- package/build/{constants-8ec95641.js → constants-dfcbc36b.js} +1 -1
- package/build/constants.js +3 -3
- package/build/constantsDomainLocales.js +1 -3
- package/build/constantsRiskScreener.js +2 -2
- package/build/constantsSite.js +2 -2
- package/build/{core-7e67a00c.js → core-e895bdb2.js} +1 -1
- package/build/{dataTransform-626b1ab5.js → dataTransform-cf82811f.js} +1 -1
- package/build/ecom.js +4 -4
- package/build/{editor-03353372.js → editor-b4293c16.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-02be7591.js → InputDate-af3d5a1e.js} +20 -20
- package/build/esm/{LastPeriod-649be75b.js → LastPeriod-45d826ee.js} +1 -1
- package/build/esm/{Locale-104cb3a6.js → Locale-a5908a68.js} +0 -1
- package/build/esm/{MobileBottomNavigationIcon-35d1dac2.js → MobileBottomNavigationIcon-d5d450e7.js} +3 -3
- package/build/esm/{Spinner-f2284935.js → Spinner-256d6227.js} +1 -1
- package/build/esm/{WhatsApp-c8491248.js → WhatsApp-4a266384.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/logo/index.d.ts +1 -1
- package/build/esm/components/mantine/phone/index.d.ts +0 -2
- package/build/esm/components.js +96 -96
- package/build/esm/{constants-e4dbc20a.js → constants-4d82bfed.js} +1 -1
- package/build/esm/{constants-621c97ad.js → constants-b8a13e0c.js} +0 -1
- package/build/esm/constants.js +3 -3
- package/build/esm/constantsDomainLocales.js +1 -3
- package/build/esm/constantsRiskScreener.js +2 -2
- package/build/esm/constantsSite.js +2 -2
- package/build/esm/{core-edc7f18a.js → core-d9dedfa0.js} +1 -1
- package/build/esm/{dataTransform-fefd13a1.js → dataTransform-de22b61d.js} +1 -1
- package/build/esm/ecom.js +4 -4
- package/build/esm/{editor-cc9307fb.js → editor-486ec10a.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-ee17c553.js → healthTools-ddea3042.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.js +2 -3
- package/build/esm/i18nV2.js +2 -2
- package/build/esm/{index-bb48660e.js → index-05a1028c.js} +21 -21
- package/build/esm/{index-bdb5c27e.js → index-084a173b.js} +25 -25
- package/build/esm/{index-f1a5b73d.js → index-0b74f3b9.js} +32 -35
- package/build/esm/{index-e469d137.js → index-0b87c8b0.js} +6 -6
- package/build/esm/{index-7c8ba8fe.js → index-0c29ede4.js} +32 -32
- package/build/esm/{index-4cfae667.js → index-0e107b33.js} +1 -1
- package/build/esm/{index-9ee67319.js → index-15c86709.js} +13 -13
- package/build/esm/{index-cce0834a.js → index-176d5c0a.js} +3 -3
- package/build/esm/{index-a2028d87.js → index-246d79ba.js} +7 -7
- package/build/esm/{index-17ec10f3.js → index-253c497b.js} +7 -7
- package/build/esm/{index-9b88e0e2.js → index-25a83e10.js} +17 -17
- package/build/esm/{index-7b9c82a9.js → index-2f129196.js} +4 -4
- package/build/esm/{index-0fc9f096.js → index-2f834f3b.js} +15 -15
- package/build/esm/{index-c3a89410.js → index-31f9a634.js} +18 -18
- package/build/esm/{index-15bc9ee2.js → index-33bd3ea8.js} +18 -18
- package/build/esm/{index-79a7c471.js → index-33d35ee2.js} +2 -2
- package/build/esm/{index-00c626df.js → index-3bfef95e.js} +2 -2
- package/build/esm/{index-aa51729b.js → index-3d3825cc.js} +27 -36
- package/build/esm/{index-0ba1b8b4.js → index-40297052.js} +2 -2
- package/build/esm/{index-113d634d.js → index-41180fb2.js} +13 -13
- package/build/esm/{index-95cb8697.js → index-41ea5ef1.js} +2 -2
- package/build/esm/{index-7c62102b.js → index-4293abfc.js} +3 -3
- package/build/esm/{index-c2696041.js → index-42dd310a.js} +2 -2
- package/build/esm/{index-314741bf.js → index-435dfcc8.js} +3 -3
- package/build/esm/{index-8b080321.js → index-48fcb87d.js} +22 -22
- package/build/esm/{index-68e04e35.js → index-4c9256f4.js} +1 -1
- package/build/esm/{index-628cc44d.js → index-5356a1bf.js} +1 -1
- package/build/esm/{index-e7176020.js → index-58b54ff1.js} +2 -2
- package/build/esm/{index-5ee9cfd6.js → index-5be36e04.js} +1 -1
- package/build/esm/{index-6632a216.js → index-5f5380b1.js} +31 -31
- package/build/esm/{index-9b45406c.js → index-5f5eaee7.js} +16 -16
- package/build/esm/{index-a436e100.js → index-606012e8.js} +2 -2
- package/build/esm/{index-7e84c3e5.js → index-63a4030a.js} +17 -17
- package/build/esm/{index-034ef577.js → index-675b614e.js} +6 -6
- package/build/esm/{index-976ddcd3.js → index-73ee66f0.js} +3 -3
- package/build/esm/{index-648ae6bb.js → index-84a708c5.js} +3 -3
- package/build/esm/{index-2c7321c9.js → index-94758277.js} +13 -13
- package/build/esm/{index-98600b14.js → index-96127754.js} +13 -13
- package/build/esm/{index-bf6b67d8.js → index-9c3124e0.js} +6 -6
- package/build/esm/{index-38866c7c.js → index-9df141a8.js} +2 -39
- package/build/esm/{index-3d7c3359.js → index-9df6e950.js} +17 -17
- package/build/esm/{index-6e2d578d.js → index-9eb38283.js} +16 -16
- package/build/esm/{index-08cec122.js → index-a07d2f53.js} +2 -2
- package/build/esm/{index-5a88d1c1.js → index-a1a6f241.js} +2 -2
- package/build/esm/{index-34dd52fe.js → index-a26d9143.js} +5 -5
- package/build/esm/{index-f8711e1f.js → index-a3147663.js} +5 -5
- package/build/esm/{index-1910aebc.js → index-add7a289.js} +2 -2
- package/build/esm/{index-baa6f7e0.js → index-ae5a89fa.js} +10 -10
- package/build/esm/{index-4ace81e6.js → index-afcd3f02.js} +3 -3
- package/build/esm/{index-eea8eb49.js → index-b051f29b.js} +1 -1
- package/build/esm/{index-9d597466.js → index-b96e6061.js} +1 -1
- package/build/esm/{index-9cb4a89e.js → index-bc2b1672.js} +16 -16
- package/build/esm/{index-65d01b72.js → index-c62287a6.js} +24 -24
- package/build/esm/{index-3b00aaf3.js → index-cbbd9e13.js} +8 -8
- package/build/esm/{index-4b17007d.js → index-d01f9d3e.js} +1 -1
- package/build/esm/{index-bfcf72e2.js → index-d3b0ff0e.js} +1 -1
- package/build/esm/{index-40c94086.js → index-d66259a3.js} +6 -6
- package/build/esm/{index-23b1c86e.js → index-d9b56281.js} +2 -2
- package/build/esm/{index-01192772.js → index-e0180027.js} +1 -1
- package/build/esm/{index-4a26c8fa.js → index-e1610248.js} +2 -2
- package/build/esm/{index-d0c37589.js → index-e9819034.js} +6 -6
- package/build/esm/{index-3c5106d5.js → index-ed0598da.js} +16 -16
- package/build/esm/{index-c11116a3.js → index-f6fcfa9a.js} +17 -17
- package/build/esm/{index-ded67352.js → index-f943299e.js} +2 -2
- package/build/esm/index.js +117 -117
- package/build/esm/interfaces/constants/domainLocales.d.ts +0 -2
- package/build/esm/interfaces/constants/index.d.ts +1 -1
- package/build/esm/interfaces/types/Locale.d.ts +1 -2
- package/build/esm/interfaces/types/index.d.ts +1 -1
- package/build/esm/{labelSorting-3d03e31a.js → labelSorting-711a22ec.js} +4 -4
- package/build/esm/lead/helpers.d.ts +1 -51
- package/build/esm/lead/index.d.ts +1 -2
- package/build/esm/lead/layouts/lightbox/formContext.d.ts +1 -2
- package/build/esm/lead/services/index.d.ts +0 -14
- package/build/esm/lead.css +1 -1
- package/build/esm/lead.js +301 -1302
- package/build/esm/{logoIcon-4726b686.js → logoIcon-ca2abc51.js} +2 -8
- 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 +73 -73
- package/build/esm/moleculesArticleCard.js +6 -6
- package/build/esm/moleculesArticleCardV2.js +16 -16
- package/build/esm/navigation.js +45 -45
- 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 +49 -49
- package/build/esm/{post-fa48da76.js → post-df86ade2.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 +1 -2
- package/build/esm/ssoV2.js +39 -51
- package/build/esm/{store-d2d2fb54.js → store-a7a04a9b.js} +4 -4
- package/build/esm/subot.js +35 -35
- package/build/esm/surveyOrPremiumBanner.js +32 -32
- package/build/esm/surveyQuestionCard.js +10 -10
- package/build/esm/{surveyThankyouCard-cd42ce13.js → surveyThankyouCard-55f86ae1.js} +5 -5
- package/build/esm/together.js +55 -55
- 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 +50 -50
- package/build/esm/togetherMoleculesCardAuthor.js +28 -28
- package/build/esm/togetherMoleculesPostImagePreview.js +11 -11
- package/build/esm/togetherMoleculesProfileDetail.js +38 -38
- package/build/esm/togetherOrganisms.js +49 -49
- package/build/esm/togetherRichTextEditor.js +17 -17
- package/build/esm/togetherShareBox.js +10 -10
- package/build/esm/{treePopoverMenu-5fda21fe.js → treePopoverMenu-ad91b608.js} +19 -19
- package/build/esm/{types-8e1b82b6.js → types-939612d0.js} +2 -2
- package/build/esm/types.js +2 -2
- package/build/esm/{useCategory-65219b49.js → useCategory-702d1e8a.js} +5 -18
- package/build/esm/{useHealthToolCache-22a17402.js → useHealthToolCache-4b1e5e9e.js} +1 -1
- package/build/esm/{useMantineLocale-b2b06639.js → useMantineLocale-4fde4c36.js} +6 -8
- package/build/esm/{usePlacesAutocomplete-c1728643.js → usePlacesAutocomplete-51af42e6.js} +1 -1
- package/build/esm/{useScreenSize-69526e53.js → useScreenSize-be6b7d68.js} +2 -2
- package/build/esm/useTogetherAuthRequiredAction.js +9 -9
- package/build/esm/{utils-54b3a2ff.js → utils-1abba51b.js} +2 -2
- package/build/esm/{utils-f7ef46fb.js → utils-1c5980e6.js} +3 -3
- package/build/esm/{utils-defbbac3.js → utils-29f6b7ff.js} +2 -2
- package/build/esm/{utils-9e621314.js → utils-fa4b2496.js} +4 -4
- package/build/esm/vaccination.js +21 -21
- package/build/footer.js +21 -21
- package/build/gAssets.js +2 -2
- package/build/{healthTools-a6a33ad3.js → healthTools-67e51fc9.js} +1 -1
- package/build/healthToolsCardWrapper.js +18 -18
- package/build/healthToolsForm.js +33 -33
- package/build/hooks.js +13 -13
- package/build/i18n.js +1 -2
- package/build/i18nV2.js +1 -1
- package/build/{index-818782e1.js → index-04eccea0.js} +15 -15
- package/build/{index-001d3874.js → index-06da62f4.js} +24 -24
- package/build/{index-bb80b459.js → index-0765f5cd.js} +6 -6
- package/build/{index-9f02d655.js → index-12991f60.js} +13 -13
- package/build/{index-17f0a38e.js → index-129f8aa9.js} +1 -1
- package/build/{index-89233a3c.js → index-13865828.js} +1 -1
- package/build/{index-561cb371.js → index-19820815.js} +3 -3
- package/build/{index-8a351066.js → index-198257c9.js} +22 -22
- package/build/{index-60fd8bd2.js → index-1c88be63.js} +1 -1
- package/build/{index-3ee4314f.js → index-1eae9e09.js} +6 -6
- package/build/{index-406ce729.js → index-24ae2258.js} +32 -32
- package/build/{index-bcebac5e.js → index-24ccd6f7.js} +31 -31
- package/build/{index-dbe7777a.js → index-2621938e.js} +18 -18
- package/build/{index-f901ca22.js → index-2635cdfd.js} +18 -18
- package/build/{index-294a2c25.js → index-292b2156.js} +1 -1
- package/build/{index-3fe5a148.js → index-2a585f29.js} +17 -17
- package/build/{index-e2c4f81f.js → index-2c59162a.js} +25 -25
- package/build/{index-4a00c8c4.js → index-30cf345c.js} +8 -8
- package/build/{index-bbbeff44.js → index-3611c96a.js} +6 -6
- package/build/{index-35b40257.js → index-399c0e5b.js} +1 -1
- package/build/{index-31c2a69d.js → index-3a75dbb5.js} +2 -2
- package/build/{index-90fd0e8b.js → index-3bdede97.js} +3 -3
- package/build/{index-0c829c49.js → index-3f1b11bd.js} +2 -2
- package/build/{index-7429051e.js → index-4056613d.js} +7 -7
- package/build/{index-94d19bb2.js → index-470da8df.js} +17 -17
- package/build/{index-565bc9b1.js → index-4b5bfa8f.js} +2 -2
- package/build/{index-3c5857d5.js → index-4b9ef079.js} +2 -2
- package/build/{index-cc97c27c.js → index-4df84569.js} +13 -13
- package/build/{index-4edeca2c.js → index-50f07e61.js} +3 -3
- package/build/{index-c3d17717.js → index-5a1e4ac8.js} +13 -13
- package/build/{index-c7e26110.js → index-5fbcbca4.js} +16 -16
- package/build/{index-076865e9.js → index-5fccd4da.js} +2 -2
- package/build/{index-cc00a964.js → index-611e4775.js} +2 -2
- package/build/{index-cd0d043c.js → index-6678a2b2.js} +10 -10
- package/build/{index-d05a1c3d.js → index-73128bc1.js} +6 -6
- package/build/{index-ff2d0446.js → index-75893f6a.js} +3 -3
- package/build/{index-354972d0.js → index-75ddd9ae.js} +6 -6
- package/build/{index-dfbec759.js → index-86574f22.js} +21 -21
- package/build/{index-9a6c88b2.js → index-8734dc17.js} +2 -2
- package/build/{index-c381afc3.js → index-88504943.js} +1 -1
- package/build/{index-3ec32e0c.js → index-88b77596.js} +2 -2
- package/build/{index-1dba25ee.js → index-8b7d6e0b.js} +1 -1
- package/build/{index-599a3f4c.js → index-8c98551d.js} +16 -16
- package/build/{index-4d055c70.js → index-8e5a6b6b.js} +16 -16
- package/build/{index-f3c6a750.js → index-94beb0e2.js} +2 -2
- package/build/{index-160a489c.js → index-95dec080.js} +7 -7
- package/build/{index-a6e2bf56.js → index-96b5ea35.js} +16 -16
- package/build/{index-ed4f0332.js → index-99047c91.js} +4 -4
- package/build/{index-08981efe.js → index-a0adfade.js} +1 -1
- package/build/{index-3381cfa0.js → index-a177c22e.js} +32 -35
- package/build/{index-f3098a4e.js → index-ac46984d.js} +3 -3
- package/build/{index-f1a21215.js → index-b1185763.js} +2 -2
- package/build/{index-40fa574d.js → index-b171abc1.js} +5 -5
- package/build/{index-14f396d7.js → index-b8aa313b.js} +17 -17
- package/build/{index-d4ca1d77.js → index-be58aaf0.js} +3 -3
- package/build/{index-ceba22d1.js → index-c4a0fed3.js} +1 -1
- package/build/{index-2c79fbff.js → index-d90d19c7.js} +2 -2
- package/build/{index-1973d0c7.js → index-df7e968f.js} +13 -13
- package/build/{index-45c56852.js → index-e984e334.js} +17 -17
- package/build/{index-3827e6ad.js → index-e9ed2f96.js} +2 -39
- package/build/{index-28f78e80.js → index-f04ab939.js} +2 -2
- package/build/{index-727dd3c1.js → index-f564bae2.js} +27 -36
- package/build/{index-2c973f1d.js → index-f6320dd1.js} +5 -5
- package/build/{index-56693d86.js → index-fc0f451f.js} +2 -2
- package/build/index.js +117 -117
- package/build/interfaces/constants/domainLocales.d.ts +0 -2
- package/build/interfaces/constants/index.d.ts +1 -1
- package/build/interfaces/types/Locale.d.ts +1 -2
- package/build/interfaces/types/index.d.ts +1 -1
- package/build/{labelSorting-012a8b0e.js → labelSorting-a4cccac0.js} +4 -4
- package/build/lead/helpers.d.ts +1 -51
- package/build/lead/index.d.ts +1 -2
- package/build/lead/layouts/lightbox/formContext.d.ts +1 -2
- package/build/lead/services/index.d.ts +0 -14
- package/build/lead.css +1 -1
- package/build/lead.js +303 -1305
- package/build/{logoIcon-9333c01a.js → logoIcon-2b21dc46.js} +2 -8
- 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 +73 -73
- package/build/moleculesArticleCard.js +6 -6
- package/build/moleculesArticleCardV2.js +16 -16
- package/build/navigation.js +45 -45
- package/build/navigationLogoutPopup.js +9 -9
- package/build/navigationProfileButton.js +23 -23
- package/build/onboardingV2.js +28 -28
- package/build/organisms.js +49 -49
- package/build/{post-65f7b246.js → post-0fe72c61.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 +1 -2
- package/build/ssoV2.js +37 -49
- package/build/{store-226ae5da.js → store-512b1b33.js} +4 -4
- package/build/subot.js +34 -34
- package/build/surveyOrPremiumBanner.js +32 -32
- package/build/surveyQuestionCard.js +10 -10
- package/build/{surveyThankyouCard-115eb622.js → surveyThankyouCard-88204035.js} +5 -5
- package/build/together.js +55 -55
- package/build/togetherApiUtils.js +4 -4
- package/build/togetherAtoms.js +30 -30
- package/build/togetherComponentGlobalContext.js +4 -4
- package/build/togetherMolecules.js +50 -50
- package/build/togetherMoleculesCardAuthor.js +28 -28
- package/build/togetherMoleculesPostImagePreview.js +11 -11
- package/build/togetherMoleculesProfileDetail.js +38 -38
- package/build/togetherOrganisms.js +49 -49
- package/build/togetherRichTextEditor.js +17 -17
- package/build/togetherShareBox.js +10 -10
- package/build/{treePopoverMenu-6294dfc9.js → treePopoverMenu-8b2f7268.js} +19 -19
- package/build/{types-1b103663.js → types-ea3372eb.js} +2 -2
- package/build/types.js +2 -2
- package/build/{useCategory-cde208e3.js → useCategory-c1f18276.js} +5 -18
- package/build/{useHealthToolCache-5baf52f2.js → useHealthToolCache-2df0c7e0.js} +1 -1
- package/build/{useMantineLocale-02d507b8.js → useMantineLocale-d43d68ce.js} +6 -8
- package/build/{usePlacesAutocomplete-5a712ffe.js → usePlacesAutocomplete-4eb987b3.js} +1 -1
- package/build/{useScreenSize-437f8c08.js → useScreenSize-db2f3452.js} +2 -2
- package/build/useTogetherAuthRequiredAction.js +9 -9
- package/build/{utils-5155768d.js → utils-0285c544.js} +2 -2
- package/build/{utils-d00e54a8.js → utils-599fbb30.js} +2 -2
- package/build/{utils-8c3356aa.js → utils-b1338f2e.js} +4 -4
- package/build/{utils-ea7edd52.js → utils-c56d69da.js} +3 -3
- package/build/vaccination.js +21 -21
- package/package.json +3 -3
- package/build/components/mantine/phoneInput/PhoneInput.d.ts +0 -17
- package/build/components/mantine/phoneInput/index.d.ts +0 -1
- package/build/esm/components/mantine/phoneInput/PhoneInput.d.ts +0 -17
- package/build/esm/components/mantine/phoneInput/index.d.ts +0 -1
- package/build/esm/i18n-values/zh-CN.js +0 -855
- package/build/esm/lead/LeadGenForm/LeadGenForm.d.ts +0 -41
- package/build/esm/lead/LeadGenForm/LeadGenForm.styled.d.ts +0 -5
- package/build/esm/lead/LeadGenForm/LeadGenFormPhone.d.ts +0 -17
- package/build/esm/lead/LeadGenForm/LeadGenThankYou.d.ts +0 -20
- package/build/esm/lead/LeadGenForm/index.d.ts +0 -3
- package/build/esm/lead/LeadGenForm/textField/index.d.ts +0 -13
- package/build/esm/lead/LeadGenForm/textField/index.styled.d.ts +0 -11
- package/build/esm/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxContainer.d.ts +0 -25
- package/build/esm/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxContext.d.ts +0 -25
- package/build/esm/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxWrapper.d.ts +0 -30
- package/build/esm/lead/LeadGenSubscriptionBox/index.d.ts +0 -1
- package/build/i18n-values/zh-CN.js +0 -866
- package/build/lead/LeadGenForm/LeadGenForm.d.ts +0 -41
- package/build/lead/LeadGenForm/LeadGenForm.styled.d.ts +0 -5
- package/build/lead/LeadGenForm/LeadGenFormPhone.d.ts +0 -17
- package/build/lead/LeadGenForm/LeadGenThankYou.d.ts +0 -20
- package/build/lead/LeadGenForm/index.d.ts +0 -3
- package/build/lead/LeadGenForm/textField/index.d.ts +0 -13
- package/build/lead/LeadGenForm/textField/index.styled.d.ts +0 -11
- package/build/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxContainer.d.ts +0 -25
- package/build/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxContext.d.ts +0 -25
- package/build/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxWrapper.d.ts +0 -30
- package/build/lead/LeadGenSubscriptionBox/index.d.ts +0 -1
- /package/build/{BMI_BOYS.percentile.monthly-1c03e5de.js → BMI_BOYS.percentile.monthly-946a69c0.js} +0 -0
- /package/build/{BMI_BOYS.percentile.weekly-e1b19e2c.js → BMI_BOYS.percentile.weekly-4b0666ce.js} +0 -0
- /package/build/{BMI_BOYS.percentile.yearly-4f0c2339.js → BMI_BOYS.percentile.yearly-a90aef0a.js} +0 -0
- /package/build/{BMI_BOYS.zscore.monthly-33f8c49c.js → BMI_BOYS.zscore.monthly-cca60c2b.js} +0 -0
- /package/build/{BMI_BOYS.zscore.weekly-bc36c344.js → BMI_BOYS.zscore.weekly-bc217502.js} +0 -0
- /package/build/{BMI_BOYS.zscore.yearly-e734ff41.js → BMI_BOYS.zscore.yearly-3ffa38eb.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.monthly-64cd3aa1.js → BMI_GIRLS.percentile.monthly-91fb7610.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.weekly-353a5941.js → BMI_GIRLS.percentile.weekly-d776ab1c.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.yearly-edecdb39.js → BMI_GIRLS.percentile.yearly-60887244.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.monthly-e1c7ad70.js → BMI_GIRLS.zscore.monthly-0af84e55.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.weekly-663152ce.js → BMI_GIRLS.zscore.weekly-42f97193.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.yearly-432d9d0a.js → BMI_GIRLS.zscore.yearly-0411c340.js} +0 -0
- /package/build/{ChevronDown-d10a2672.js → ChevronDown-db27561b.js} +0 -0
- /package/build/{Close-32efb719.js → Close-67f76f33.js} +0 -0
- /package/build/{Google-7df040a3.js → Google-018fc1d6.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-8e9b4884.js → HEAD CIRCUM_BOYS.percentile.monthly-70f724db.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-9c3477c7.js → HEAD CIRCUM_BOYS.percentile.weekly-a4d9adb8.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-36025f3e.js → HEAD CIRCUM_BOYS.percentile.yearly-dbc1d833.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-fd126b5f.js → HEAD CIRCUM_BOYS.zscore.monthly-046c6f5f.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-4a00e3fd.js → HEAD CIRCUM_BOYS.zscore.weekly-3a56558c.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-0b52bf01.js → HEAD CIRCUM_BOYS.zscore.yearly-6758cf78.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-f7b8d028.js → HEAD CIRCUM_GIRLS.percentile.monthly-bf5760a1.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-72835055.js → HEAD CIRCUM_GIRLS.percentile.weekly-5aa28b38.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-9d6084f3.js → HEAD CIRCUM_GIRLS.percentile.yearly-abc2c609.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-92c12656.js → HEAD CIRCUM_GIRLS.zscore.monthly-2bfa39be.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-66006a19.js → HEAD CIRCUM_GIRLS.zscore.weekly-2b7e591b.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-7c41c6e7.js → HEAD CIRCUM_GIRLS.zscore.yearly-951e420e.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.monthly-b1e3aa23.js → HEIGHT_BOYS.percentile.monthly-bf21136c.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.weekly-6b41343f.js → HEIGHT_BOYS.percentile.weekly-0473d35a.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.yearly-f0490855.js → HEIGHT_BOYS.percentile.yearly-04eac199.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.monthly-b5fe9292.js → HEIGHT_BOYS.zscore.monthly-a38d0355.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.weekly-8bfa1c29.js → HEIGHT_BOYS.zscore.weekly-35a7a814.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.yearly-0fb1980d.js → HEIGHT_BOYS.zscore.yearly-ca82d79c.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.monthly-b6b6dd8e.js → HEIGHT_GIRLS.percentile.monthly-537f5e6d.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.weekly-91aaacd4.js → HEIGHT_GIRLS.percentile.weekly-272cfee9.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.yearly-8865f276.js → HEIGHT_GIRLS.percentile.yearly-e19757aa.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.monthly-98539c87.js → HEIGHT_GIRLS.zscore.monthly-0cdad3ad.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.weekly-0cd7afa1.js → HEIGHT_GIRLS.zscore.weekly-4ccf64b5.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.yearly-e4c33bb4.js → HEIGHT_GIRLS.zscore.yearly-1f040f1f.js} +0 -0
- /package/build/{Visible-9ebcfed3.js → Visible-43a91dd4.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.monthly-4d223257.js → WEIGHT_BOYS.percentile.monthly-29fe888a.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.weekly-a27b416c.js → WEIGHT_BOYS.percentile.weekly-57f26d50.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.yearly-360b3617.js → WEIGHT_BOYS.percentile.yearly-1fea5185.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.monthly-014b1e34.js → WEIGHT_BOYS.zscore.monthly-f31fe67c.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.weekly-a27025bc.js → WEIGHT_BOYS.zscore.weekly-e4294e12.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.yearly-e7b3ed91.js → WEIGHT_BOYS.zscore.yearly-341e676c.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.monthly-e72e1c7e.js → WEIGHT_GIRLS.percentile.monthly-f8739e4e.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.weekly-9180a5fe.js → WEIGHT_GIRLS.percentile.weekly-d6df381c.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.yearly-727fbc20.js → WEIGHT_GIRLS.percentile.yearly-b8c5d9a2.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.monthly-257f52f7.js → WEIGHT_GIRLS.zscore.monthly-5349aaa6.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.weekly-2d6fbb8e.js → WEIGHT_GIRLS.zscore.weekly-e8823bbf.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.yearly-8ca8382c.js → WEIGHT_GIRLS.zscore.yearly-ae3c9401.js} +0 -0
- /package/build/{animation-c4e9aaf8.js → animation-2f1a44fe.js} +0 -0
- /package/build/{constants-16888a46.js → constants-886c9adc.js} +0 -0
- /package/build/{constants-d7410b7f.js → constants-afe76aa7.js} +0 -0
- /package/build/{dataTransform-5b61d3ac.js → dataTransform-8a25c00d.js} +0 -0
- /package/build/{doctor-d835b28e.js → doctor-79fce99f.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.monthly-c9d1536b.js → BMI_BOYS.percentile.monthly-f6524256.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.weekly-77ca8294.js → BMI_BOYS.percentile.weekly-a4e52981.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.yearly-63700e8e.js → BMI_BOYS.percentile.yearly-8b4d9f7f.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.monthly-04f21186.js → BMI_BOYS.zscore.monthly-559ab672.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.weekly-50a3f022.js → BMI_BOYS.zscore.weekly-f16f2314.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.yearly-dde2fef6.js → BMI_BOYS.zscore.yearly-66899f86.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.monthly-657a7f8a.js → BMI_GIRLS.percentile.monthly-188dc95f.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.weekly-2e82787c.js → BMI_GIRLS.percentile.weekly-283ea089.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.yearly-05a56f46.js → BMI_GIRLS.percentile.yearly-cb8ecd11.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.monthly-5b4beb2b.js → BMI_GIRLS.zscore.monthly-b4c2d4ea.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.weekly-be755884.js → BMI_GIRLS.zscore.weekly-99a484e5.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.yearly-a7c448de.js → BMI_GIRLS.zscore.yearly-b3a20b03.js} +0 -0
- /package/build/esm/{ChevronDown-975183d6.js → ChevronDown-7384160e.js} +0 -0
- /package/build/esm/{Close-62c4bf39.js → Close-8747ccc0.js} +0 -0
- /package/build/esm/{Google-f65598c7.js → Google-e2646cfd.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-4ddc9900.js → HEAD CIRCUM_BOYS.percentile.monthly-5abdca84.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-fabab054.js → HEAD CIRCUM_BOYS.percentile.weekly-6e7e5094.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-c8bf5cf3.js → HEAD CIRCUM_BOYS.percentile.yearly-e313e212.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-2175e384.js → HEAD CIRCUM_BOYS.zscore.monthly-94e116b9.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-64c44542.js → HEAD CIRCUM_BOYS.zscore.weekly-b17def9a.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-078bafb7.js → HEAD CIRCUM_BOYS.zscore.yearly-d414cc29.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-9aaecbdd.js → HEAD CIRCUM_GIRLS.percentile.monthly-89545e9f.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-96d7311c.js → HEAD CIRCUM_GIRLS.percentile.weekly-68f5d53e.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-946003bf.js → HEAD CIRCUM_GIRLS.percentile.yearly-b9956436.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-69fd8bde.js → HEAD CIRCUM_GIRLS.zscore.monthly-12b84952.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-618953f2.js → HEAD CIRCUM_GIRLS.zscore.weekly-29d77f83.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-a9e6934c.js → HEAD CIRCUM_GIRLS.zscore.yearly-5760b1c2.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.monthly-784b61c9.js → HEIGHT_BOYS.percentile.monthly-9c804bf2.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.weekly-be086241.js → HEIGHT_BOYS.percentile.weekly-c1beb278.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.yearly-e3e2c3d9.js → HEIGHT_BOYS.percentile.yearly-7736f19a.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.monthly-ba59f5b6.js → HEIGHT_BOYS.zscore.monthly-8ff4efa3.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.weekly-1983a7e3.js → HEIGHT_BOYS.zscore.weekly-f45efd6a.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.yearly-78d61d3a.js → HEIGHT_BOYS.zscore.yearly-7f9b3357.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-962ddb8d.js → HEIGHT_GIRLS.percentile.monthly-89fa6720.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-35701234.js → HEIGHT_GIRLS.percentile.weekly-f171e583.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-fe789a67.js → HEIGHT_GIRLS.percentile.yearly-7cfd0e6d.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-83627fb4.js → HEIGHT_GIRLS.zscore.monthly-eb79bbde.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-a55948c1.js → HEIGHT_GIRLS.zscore.weekly-bf256408.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-172bec49.js → HEIGHT_GIRLS.zscore.yearly-b1b2b5ba.js} +0 -0
- /package/build/esm/{Visible-f703195d.js → Visible-45104a83.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.monthly-74b7a0d3.js → WEIGHT_BOYS.percentile.monthly-d78ec07d.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.weekly-22171af7.js → WEIGHT_BOYS.percentile.weekly-021c313a.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.yearly-818f7a66.js → WEIGHT_BOYS.percentile.yearly-006ec0e9.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.monthly-436c3fb1.js → WEIGHT_BOYS.zscore.monthly-a02428c5.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.weekly-a03fc94d.js → WEIGHT_BOYS.zscore.weekly-7bbcadd8.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.yearly-017cf7ef.js → WEIGHT_BOYS.zscore.yearly-59b736f7.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-c3b0024c.js → WEIGHT_GIRLS.percentile.monthly-b3ff7056.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-123295dc.js → WEIGHT_GIRLS.percentile.weekly-079998e3.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-c1241ae2.js → WEIGHT_GIRLS.percentile.yearly-16ef5580.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-417db248.js → WEIGHT_GIRLS.zscore.monthly-744a56a9.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-e68ebeaa.js → WEIGHT_GIRLS.zscore.weekly-ff68fa40.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-89bd5b5f.js → WEIGHT_GIRLS.zscore.yearly-ccb77a47.js} +0 -0
- /package/build/esm/{animation-752775d1.js → animation-a97a8e95.js} +0 -0
- /package/build/esm/{constants-33d50bcc.js → constants-12ceb72f.js} +0 -0
- /package/build/esm/{constants-e13b9293.js → constants-8de9fb78.js} +0 -0
- /package/build/esm/{dataTransform-f79dcc4b.js → dataTransform-7543d023.js} +0 -0
- /package/build/esm/{doctor-9b2b2026.js → doctor-7a105d0f.js} +0 -0
- /package/build/esm/{index-d696ba71.js → index-0019e5db.js} +0 -0
- /package/build/esm/{index-db921cb2.js → index-438dfbe0.js} +0 -0
- /package/build/esm/{index-2234c916.js → index-59c7d025.js} +0 -0
- /package/build/esm/{index-fe63eb15.js → index-77ac37c2.js} +0 -0
- /package/build/esm/{index-8c4fe301.js → index-982908ff.js} +0 -0
- /package/build/esm/{index-ec7fe439.js → index-a52dd34a.js} +0 -0
- /package/build/esm/{index-c1aeb9d2.js → index-a8a286bd.js} +0 -0
- /package/build/esm/{index-d52394d6.js → index-e0949e74.js} +0 -0
- /package/build/esm/{index.styles-061d7e04.js → index.styles-8902b845.js} +0 -0
- /package/build/esm/{localizeNumberFormat-f48c2d88.js → localizeNumberFormat-71bae74f.js} +0 -0
- /package/build/esm/{normalizeLink-5fd58f6b.js → normalizeLink-effb959b.js} +0 -0
- /package/build/esm/{number-973252cf.js → number-486cd657.js} +0 -0
- /package/build/esm/{other-b9019cc0.js → other-2824b8ce.js} +0 -0
- /package/build/esm/{paths-2bf57c66.js → paths-44af8a36.js} +0 -0
- /package/build/esm/{translationsContext-4d2ef0b8.js → translationsContext-ccaa070b.js} +0 -0
- /package/build/esm/{tslib.es6-483816a5.js → tslib.es6-72910860.js} +0 -0
- /package/build/esm/{types-53fc718b.js → types-d7aeb1e1.js} +0 -0
- /package/build/esm/{useIsInit-e3cb6a16.js → useIsInit-54df9a05.js} +0 -0
- /package/build/esm/{useOutsideClick-d6a0fff8.js → useOutsideClick-cde19271.js} +0 -0
- /package/build/esm/{useScrollbarSize-475675c1.js → useScrollbarSize-48edb55f.js} +0 -0
- /package/build/esm/{useUniqueId-086c068e.js → useUniqueId-3a3c5775.js} +0 -0
- /package/build/esm/{utils-1b106b1e.js → utils-fe433043.js} +0 -0
- /package/build/{index-59b3ecf2.js → index-1e3c697c.js} +0 -0
- /package/build/{index-4e7e431a.js → index-333631a5.js} +0 -0
- /package/build/{index-2ee7ce45.js → index-6c6874a0.js} +0 -0
- /package/build/{index-b805b348.js → index-8403bd87.js} +0 -0
- /package/build/{index-94c26adf.js → index-aad24483.js} +0 -0
- /package/build/{index-d1e13fe8.js → index-b0934494.js} +0 -0
- /package/build/{index-67495b0e.js → index-d444fbf7.js} +0 -0
- /package/build/{index-bb8bbbde.js → index-f6145dbd.js} +0 -0
- /package/build/{index.styles-dc912b73.js → index.styles-93a0261f.js} +0 -0
- /package/build/{localizeNumberFormat-7214e2af.js → localizeNumberFormat-14a960d3.js} +0 -0
- /package/build/{normalizeLink-87c0ca70.js → normalizeLink-545c621a.js} +0 -0
- /package/build/{number-1871604b.js → number-d7fb0566.js} +0 -0
- /package/build/{other-0403e1c7.js → other-bc52d9ee.js} +0 -0
- /package/build/{paths-b452e87a.js → paths-71aa7019.js} +0 -0
- /package/build/{translationsContext-6461dbf8.js → translationsContext-37e610ba.js} +0 -0
- /package/build/{tslib.es6-bbb7bc4d.js → tslib.es6-d2090a49.js} +0 -0
- /package/build/{types-64c1aec6.js → types-334597fc.js} +0 -0
- /package/build/{useIsInit-560965fd.js → useIsInit-76f93b75.js} +0 -0
- /package/build/{useOutsideClick-1948a35b.js → useOutsideClick-5099ce81.js} +0 -0
- /package/build/{useScrollbarSize-5d5c602e.js → useScrollbarSize-19291332.js} +0 -0
- /package/build/{useUniqueId-2fd0e7a6.js → useUniqueId-cea70f59.js} +0 -0
- /package/build/{utils-c7f8e857.js → utils-7aa02d54.js} +0 -0
package/build/esm/lead.js
CHANGED
|
@@ -1,45 +1,44 @@
|
|
|
1
|
-
import { _ as __rest, a as __awaiter } from './tslib.es6-
|
|
2
|
-
import React__default, { createContext, useMemo, useEffect, useRef, useState, useContext,
|
|
3
|
-
import { createStyles, Box,
|
|
1
|
+
import { _ as __rest, a as __awaiter } from './tslib.es6-72910860.js';
|
|
2
|
+
import React__default, { createContext, useMemo, useEffect, useRef, useState, useContext, useCallback } from 'react';
|
|
3
|
+
import { createStyles, Box, Button as Button$2, Autocomplete, clsx, Input as Input$1, TextInput, NumberInput as NumberInput$1, Portal, Transition, Overlay } from '@mantine/core';
|
|
4
4
|
import dayjs from 'dayjs';
|
|
5
5
|
import debounce from 'lodash/debounce';
|
|
6
|
-
import { createFormContext
|
|
7
|
-
import { u as useTranslations } from './index-
|
|
8
|
-
import { T as TranslationsContext } from './translationsContext-
|
|
6
|
+
import { createFormContext } from '@mantine/form';
|
|
7
|
+
import { u as useTranslations } from './index-b051f29b.js';
|
|
8
|
+
import { T as TranslationsContext } from './translationsContext-ccaa070b.js';
|
|
9
9
|
import { getCookie, setCookie } from './miscCookieHelper.js';
|
|
10
|
-
import { b as getWrapperDomWithSelector, a as getPopupWrapperDom } from './utils-
|
|
11
|
-
import { T as Text } from './index-
|
|
12
|
-
import { S as Select, d as Checkbox, I as Input, R as Radio, P as Phone, N as NumberInput, O as OTP } from './index-
|
|
13
|
-
import { D as DatePicker } from './index-
|
|
14
|
-
import { M as MAPPED_LOCALE } from './utils-
|
|
15
|
-
import
|
|
16
|
-
import { Z as ZINDEX_SSO
|
|
17
|
-
import
|
|
18
|
-
import './index-
|
|
19
|
-
import './useMantineLocale-
|
|
20
|
-
import { B as Button$1 } from './index-
|
|
21
|
-
import './index.styles-
|
|
10
|
+
import { b as getWrapperDomWithSelector, a as getPopupWrapperDom } from './utils-fe433043.js';
|
|
11
|
+
import { T as Text } from './index-40297052.js';
|
|
12
|
+
import { S as Select, d as Checkbox, I as Input, R as Radio, P as Phone, N as NumberInput, O as OTP } from './index-3d3825cc.js';
|
|
13
|
+
import { D as DatePicker } from './index-9c3124e0.js';
|
|
14
|
+
import { M as MAPPED_LOCALE } from './utils-1abba51b.js';
|
|
15
|
+
import '@mantine/dates';
|
|
16
|
+
import { Z as ZINDEX_SSO } from './index-9df141a8.js';
|
|
17
|
+
import './index-e0180027.js';
|
|
18
|
+
import './index-a52dd34a.js';
|
|
19
|
+
import './useMantineLocale-4fde4c36.js';
|
|
20
|
+
import { B as Button$1 } from './index-0e107b33.js';
|
|
21
|
+
import './index.styles-8902b845.js';
|
|
22
22
|
import { useClickOutside } from '@mantine/hooks';
|
|
23
|
-
import './other-
|
|
24
|
-
import './index-
|
|
25
|
-
import { u as usePlacesAutocomplete, G as GOOGLE_API_KEY } from './usePlacesAutocomplete-
|
|
26
|
-
import { B as Button } from './index-
|
|
27
|
-
import { H as Heading$1 } from './index-
|
|
28
|
-
import styled from '@emotion/styled';
|
|
23
|
+
import './other-2824b8ce.js';
|
|
24
|
+
import './index-435dfcc8.js';
|
|
25
|
+
import { u as usePlacesAutocomplete, G as GOOGLE_API_KEY } from './usePlacesAutocomplete-51af42e6.js';
|
|
26
|
+
import { B as Button } from './index-e1610248.js';
|
|
27
|
+
import { H as Heading$1 } from './index-42dd310a.js';
|
|
29
28
|
import { v1 } from 'uuid';
|
|
29
|
+
import { i as isVideo } from './index-0019e5db.js';
|
|
30
|
+
import { D as DrawerComponent } from './index-58b54ff1.js';
|
|
31
|
+
import { u as useScreenSize } from './useScreenSize-be6b7d68.js';
|
|
32
|
+
import { createPortal } from 'react-dom';
|
|
30
33
|
import { css } from '@emotion/react';
|
|
34
|
+
import styled from '@emotion/styled';
|
|
31
35
|
import { theme } from './miscTheme.js';
|
|
32
|
-
import {
|
|
33
|
-
import { D as DrawerComponent } from './index-e7176020.js';
|
|
34
|
-
import { u as useScreenSize } from './useScreenSize-69526e53.js';
|
|
35
|
-
import { createPortal } from 'react-dom';
|
|
36
|
-
import { I as InputDate } from './InputDate-02be7591.js';
|
|
37
|
-
import { C as Close } from './Close-62c4bf39.js';
|
|
36
|
+
import { C as Close } from './Close-8747ccc0.js';
|
|
38
37
|
import '@hhgtech/icons/other';
|
|
39
38
|
import '@mantine/carousel';
|
|
40
|
-
import './Locale-
|
|
39
|
+
import './Locale-a5908a68.js';
|
|
41
40
|
import 'classnames';
|
|
42
|
-
import './useUniqueId-
|
|
41
|
+
import './useUniqueId-3a3c5775.js';
|
|
43
42
|
import './constantsSite.js';
|
|
44
43
|
import '@hhgtech/icons/core';
|
|
45
44
|
import 'date-fns/locale';
|
|
@@ -73,7 +72,7 @@ if (sessionStorage.getItem('insider_object')) {
|
|
|
73
72
|
}
|
|
74
73
|
const docLang = document.documentElement.lang;
|
|
75
74
|
// TODO: country code
|
|
76
|
-
const LEAD_LOCALE_DATA
|
|
75
|
+
const LEAD_LOCALE_DATA = {
|
|
77
76
|
'vi-VN': {
|
|
78
77
|
popupLang: 'vi',
|
|
79
78
|
countryCode: 'vn',
|
|
@@ -115,7 +114,7 @@ const LEAD_LOCALE_DATA$1 = {
|
|
|
115
114
|
countryCodeNumber: 91,
|
|
116
115
|
},
|
|
117
116
|
};
|
|
118
|
-
const LEAD_LOCALE = LEAD_LOCALE_DATA
|
|
117
|
+
const LEAD_LOCALE = LEAD_LOCALE_DATA[docLang] || LEAD_LOCALE_DATA['vi-VN'];
|
|
119
118
|
function LEAD_RESET_VAR() {
|
|
120
119
|
// LEAD_CURRENT_URL = location.href.toLowerCase();
|
|
121
120
|
LEAD_CURRENT_URL =
|
|
@@ -136,11 +135,6 @@ const LEAD_TIMEZONE_DATA = {
|
|
|
136
135
|
9: 'Asia/Manila', // Philippines / Filipinos Site
|
|
137
136
|
};
|
|
138
137
|
|
|
139
|
-
const LEADGEN_ACTIONS = {
|
|
140
|
-
SHOW: 'SHOW',
|
|
141
|
-
SCROLL: 'SCROLL',
|
|
142
|
-
TIME: 'TIME',
|
|
143
|
-
};
|
|
144
138
|
const LEADGEN_LAYOUT = {
|
|
145
139
|
LightBoxA: 'LightBoxA',
|
|
146
140
|
LightBoxB: 'LightBoxB',
|
|
@@ -170,10 +164,8 @@ const LEADGEN_BLOCK = {
|
|
|
170
164
|
DropdownBlock: 'DropdownBlock',
|
|
171
165
|
CheckboxBlock: 'CheckboxBlock',
|
|
172
166
|
TncBlock: 'TncBlock',
|
|
173
|
-
TitleBlock: 'TitleBlock',
|
|
174
|
-
SubtitleBlock: 'SubtitleBlock',
|
|
175
167
|
};
|
|
176
|
-
const
|
|
168
|
+
const LEADGEN_BLOCK_IN_FORM = [
|
|
177
169
|
LEADGEN_BLOCK.TextBlock,
|
|
178
170
|
LEADGEN_BLOCK.NumberBlock,
|
|
179
171
|
LEADGEN_BLOCK.DateBlock,
|
|
@@ -189,48 +181,6 @@ const LEADGEN_BLOCK_INPUT = [
|
|
|
189
181
|
LEADGEN_BLOCK.TncBlock,
|
|
190
182
|
];
|
|
191
183
|
const SSO_MAP_LEAD = ['name', 'email', 'birthday', 'phone', 'gender'];
|
|
192
|
-
const LEAD_LOCALE_DATA = {
|
|
193
|
-
'vi-VN': {
|
|
194
|
-
popupLang: 'vi',
|
|
195
|
-
countryCode: 'vn',
|
|
196
|
-
countryCodeNumber: 84,
|
|
197
|
-
},
|
|
198
|
-
'id-ID': {
|
|
199
|
-
popupLang: 'id',
|
|
200
|
-
countryCode: 'id',
|
|
201
|
-
countryCodeNumber: 62,
|
|
202
|
-
},
|
|
203
|
-
'th-TH': {
|
|
204
|
-
popupLang: 'th',
|
|
205
|
-
countryCode: 'th',
|
|
206
|
-
countryCodeNumber: 66,
|
|
207
|
-
},
|
|
208
|
-
'ms-MY': {
|
|
209
|
-
popupLang: 'ms',
|
|
210
|
-
countryCode: 'my',
|
|
211
|
-
countryCodeNumber: 60,
|
|
212
|
-
},
|
|
213
|
-
'zh-TW': {
|
|
214
|
-
popupLang: 'zh',
|
|
215
|
-
countryCode: 'tw',
|
|
216
|
-
countryCodeNumber: 886,
|
|
217
|
-
},
|
|
218
|
-
'km-KH': {
|
|
219
|
-
popupLang: 'km',
|
|
220
|
-
countryCode: 'kh',
|
|
221
|
-
countryCodeNumber: 855,
|
|
222
|
-
},
|
|
223
|
-
'my-MM': {
|
|
224
|
-
popupLang: 'my',
|
|
225
|
-
countryCode: 'mm',
|
|
226
|
-
countryCodeNumber: 95,
|
|
227
|
-
},
|
|
228
|
-
'hi-IN': {
|
|
229
|
-
popupLang: 'hi',
|
|
230
|
-
countryCode: 'in',
|
|
231
|
-
countryCodeNumber: 91,
|
|
232
|
-
},
|
|
233
|
-
};
|
|
234
184
|
const mappingSSOToLead = (userInfoProps) => {
|
|
235
185
|
var _a, _b;
|
|
236
186
|
try {
|
|
@@ -246,7 +196,7 @@ const mappingSSOToLead = (userInfoProps) => {
|
|
|
246
196
|
if (ssoKey === 'birthday') {
|
|
247
197
|
const dob = dayjs(initValue, 'YYYY-MM-DD', true);
|
|
248
198
|
if (dob.isValid()) {
|
|
249
|
-
user.birthday = dob
|
|
199
|
+
user.birthday = dob;
|
|
250
200
|
}
|
|
251
201
|
}
|
|
252
202
|
else if (ssoKey === 'gender') {
|
|
@@ -269,46 +219,6 @@ const mappingSSOToLead = (userInfoProps) => {
|
|
|
269
219
|
catch (error) {
|
|
270
220
|
return;
|
|
271
221
|
}
|
|
272
|
-
};
|
|
273
|
-
const formatCampaignDetail = (campaign) => {
|
|
274
|
-
if (!campaign) {
|
|
275
|
-
return {};
|
|
276
|
-
}
|
|
277
|
-
try {
|
|
278
|
-
const { extra_fields, thank_you_image } = campaign || {};
|
|
279
|
-
const { textBlocks: exTextBlocks, imageBlocks: exImageBlocks, listBlockAdded: exListBlockAdded, listBlockThankyou: exListBlockThankyou, actionBlocks: exActionBlocks, } = extra_fields;
|
|
280
|
-
const textBlocks = JSON.parse(exTextBlocks);
|
|
281
|
-
const imageBlocks = JSON.parse(exImageBlocks);
|
|
282
|
-
const listBlockAdded = JSON.parse(exListBlockAdded);
|
|
283
|
-
const listBlockThankyou = JSON.parse(exListBlockThankyou);
|
|
284
|
-
const actionBlocks = JSON.parse(exActionBlocks);
|
|
285
|
-
const ThankYouBlock = {
|
|
286
|
-
image: { src: thank_you_image },
|
|
287
|
-
};
|
|
288
|
-
listBlockThankyou.forEach((block) => {
|
|
289
|
-
const { name, data } = block || {};
|
|
290
|
-
const { value: htmlText, align, newtab, url } = data || {};
|
|
291
|
-
switch (name) {
|
|
292
|
-
case LEADGEN_BLOCK.TitleBlock: {
|
|
293
|
-
ThankYouBlock.title = { htmlText, align };
|
|
294
|
-
}
|
|
295
|
-
case LEADGEN_BLOCK.SubtitleBlock: {
|
|
296
|
-
ThankYouBlock.description = { htmlText, align };
|
|
297
|
-
}
|
|
298
|
-
case LEADGEN_BLOCK.LinkButtonBlock: {
|
|
299
|
-
ThankYouBlock.button = { htmlText, newtab, url };
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
});
|
|
303
|
-
return Object.assign(Object.assign({}, campaign), { extra_fields: Object.assign(Object.assign({}, extra_fields), { textBlocks,
|
|
304
|
-
imageBlocks,
|
|
305
|
-
listBlockAdded,
|
|
306
|
-
listBlockThankyou,
|
|
307
|
-
actionBlocks }), ThankYouBlock });
|
|
308
|
-
}
|
|
309
|
-
catch (error) {
|
|
310
|
-
return {};
|
|
311
|
-
}
|
|
312
222
|
};
|
|
313
223
|
|
|
314
224
|
class Store {
|
|
@@ -319,13 +229,6 @@ class Store {
|
|
|
319
229
|
}
|
|
320
230
|
const leadStore = new Store();
|
|
321
231
|
|
|
322
|
-
const LEADGEN_API_METHOD = {
|
|
323
|
-
GET: 'get',
|
|
324
|
-
POST: 'POST',
|
|
325
|
-
};
|
|
326
|
-
const LEADGEN_API_PATH = {
|
|
327
|
-
V2_CAMPAIGN: 'api/v2/campaign',
|
|
328
|
-
};
|
|
329
232
|
const leadApi = {
|
|
330
233
|
call(_a) {
|
|
331
234
|
var { url, data = undefined } = _a, config = __rest(_a, ["url", "data"]);
|
|
@@ -429,39 +332,8 @@ const verifyOtpLead = ({ phone, otp, type, }) => {
|
|
|
429
332
|
},
|
|
430
333
|
});
|
|
431
334
|
};
|
|
432
|
-
const campaignGetByCode = (campaign_code) => {
|
|
433
|
-
return leadApi.call({
|
|
434
|
-
url: `${LEADGEN_API_PATH.V2_CAMPAIGN}/${campaign_code}`,
|
|
435
|
-
method: LEADGEN_API_METHOD.GET,
|
|
436
|
-
});
|
|
437
|
-
};
|
|
438
|
-
const campaignPostLead = ({ data }) => {
|
|
439
|
-
return leadApi.call({
|
|
440
|
-
url: 'api/v2/subscription-box',
|
|
441
|
-
method: LEADGEN_API_METHOD.POST,
|
|
442
|
-
data,
|
|
443
|
-
});
|
|
444
|
-
};
|
|
445
|
-
const campaignPostImpression = ({ code, action, title_article, ga_client_id, cookie_id, extra, url, referrer, }) => {
|
|
446
|
-
return leadApi.call({
|
|
447
|
-
url: `api/campaign/${code}/impression`,
|
|
448
|
-
method: LEADGEN_API_METHOD.POST,
|
|
449
|
-
data: {
|
|
450
|
-
action,
|
|
451
|
-
title_article,
|
|
452
|
-
cookie_id,
|
|
453
|
-
ga_client_id,
|
|
454
|
-
url,
|
|
455
|
-
extra,
|
|
456
|
-
referrer,
|
|
457
|
-
},
|
|
458
|
-
});
|
|
459
|
-
};
|
|
460
335
|
const Service = {
|
|
461
336
|
campaignGetById,
|
|
462
|
-
campaignGetByCode,
|
|
463
|
-
campaignPostLead,
|
|
464
|
-
campaignPostImpression,
|
|
465
337
|
validateEmailOrPhoneOnSubot,
|
|
466
338
|
validateEmailOrPhoneOnLeadGen,
|
|
467
339
|
validatePhoneNumberOnLeadGen,
|
|
@@ -1253,7 +1125,6 @@ var enPH = {
|
|
|
1253
1125
|
"validator.min": "jQuery.validator.format('Please enter a value greater than or equal to {0}.",
|
|
1254
1126
|
"validator.emailUsed": "Email already in use for this campaign.",
|
|
1255
1127
|
"validator.phoneUsed": "Your phone number already in use for this campaign.",
|
|
1256
|
-
"validator.dateInvalid": "This date is not valid, please update.",
|
|
1257
1128
|
"lead.otp.title": "Enter OTP",
|
|
1258
1129
|
"lead.otp.desc": "We have sent an OTP to your mobile number {phone}",
|
|
1259
1130
|
"lead.otp.verify": "Verify",
|
|
@@ -1262,10 +1133,7 @@ var enPH = {
|
|
|
1262
1133
|
"lead.otp.phonePlaceholder": "Enter OTP",
|
|
1263
1134
|
"lead.empty.title": "Oops, seem your information is empty, do you want to submit the information again?",
|
|
1264
1135
|
"lead.empty.cancel": "Cancel",
|
|
1265
|
-
"lead.empty.submitAgain": "Submit again"
|
|
1266
|
-
"common.day": "Day",
|
|
1267
|
-
"common.month": "Month",
|
|
1268
|
-
"common.year": "Year"
|
|
1136
|
+
"lead.empty.submitAgain": "Submit again"
|
|
1269
1137
|
};
|
|
1270
1138
|
|
|
1271
1139
|
var hiIN = {
|
|
@@ -1276,7 +1144,6 @@ var hiIN = {
|
|
|
1276
1144
|
"validator.maxlength": "कृपया {0} अक्षर से अधिक दर्ज न करें",
|
|
1277
1145
|
"validator.minlength": "कृपया कम से कम {0} अक्षर दर्ज करें",
|
|
1278
1146
|
"validator.phone": "कृपया एक वैध संख्या दर्ज करें",
|
|
1279
|
-
"validator.dateInvalid": "यह तिथि मान्य नहीं है, कृपया अपडेट करें।",
|
|
1280
1147
|
"validator.emailUsed": "Email already in use for this campaign.",
|
|
1281
1148
|
"validator.phoneUsed": "Your phone number already in use for this campaign.",
|
|
1282
1149
|
"lead.otp.title": "Enter OTP",
|
|
@@ -1285,10 +1152,7 @@ var hiIN = {
|
|
|
1285
1152
|
"lead.otp.resend": "Resend OTP{timer}",
|
|
1286
1153
|
"lead.empty.title": "ऊप्स! लगता है आपकी जानकारी खाली है। क्या आप जानकारी फिर से सबमिट करना चाहते हैं?",
|
|
1287
1154
|
"lead.empty.cancel": "रद्द करें",
|
|
1288
|
-
"lead.empty.submitAgain": "फिर से सबमिट करें"
|
|
1289
|
-
"common.day": "साल",
|
|
1290
|
-
"common.month": "महीना",
|
|
1291
|
-
"common.year": ""
|
|
1155
|
+
"lead.empty.submitAgain": "फिर से सबमिट करें"
|
|
1292
1156
|
};
|
|
1293
1157
|
|
|
1294
1158
|
var idID = {
|
|
@@ -1301,7 +1165,6 @@ var idID = {
|
|
|
1301
1165
|
"validator.phone": "Tolong daftarkan nomor telepon yang valid",
|
|
1302
1166
|
"validator.emailUsed": "Email sudah digunakan untuk kampanye ini.",
|
|
1303
1167
|
"validator.phoneUsed": "Nomor telepon Anda sudah digunakan untuk kampanye ini.",
|
|
1304
|
-
"validator.dateInvalid": "Tanggal ini tidak valid, silakan perbarui",
|
|
1305
1168
|
"lead.otp.title": "Masukkan OTP",
|
|
1306
1169
|
"lead.otp.desc": "Kami telah mengirimkan OTP ke nomor ponsel Anda {phone}",
|
|
1307
1170
|
"lead.otp.verify": "Verifikasi",
|
|
@@ -1310,10 +1173,7 @@ var idID = {
|
|
|
1310
1173
|
"lead.otp.phonePlaceholder": "Masukkan OTP",
|
|
1311
1174
|
"lead.empty.title": "Oops, sepertinya informasi Anda kosong. Apakah Anda ingin mengirimkan informasi lagi?",
|
|
1312
1175
|
"lead.empty.cancel": "Batal",
|
|
1313
|
-
"lead.empty.submitAgain": "Kirim lagi"
|
|
1314
|
-
"common.day": "Hari",
|
|
1315
|
-
"common.month": "Bulan",
|
|
1316
|
-
"common.year": "Tahun"
|
|
1176
|
+
"lead.empty.submitAgain": "Kirim lagi"
|
|
1317
1177
|
};
|
|
1318
1178
|
|
|
1319
1179
|
var kmKH = {
|
|
@@ -1326,7 +1186,6 @@ var kmKH = {
|
|
|
1326
1186
|
"validator.phone": "សូមវាយបញ្ចូលលេខឲ្យបានត្រឹមត្រូវ",
|
|
1327
1187
|
"validator.emailUsed": "អ៊ីមែលត្រូវបានប្រើប្រាស់សម្រាប់យុទ្ធនាការនេះរួចហើយ។",
|
|
1328
1188
|
"validator.phoneUsed": "លេខទូរស័ព្ទរបស់អ្នកត្រូវបានប្រើប្រាស់សម្រាប់យុទ្ធនាការនេះរួចហើយ។",
|
|
1329
|
-
"validator.dateInvalid": "កាលបរិច្ឆេទនេះមិនត្រឹមត្រូវទេ សូមធ្វើបច្ចុប្បន្នភាព។",
|
|
1330
1189
|
"lead.otp.title": "បញ្ចូល OTP",
|
|
1331
1190
|
"lead.otp.desc": "យើងបានផ្ញើ OTP ទៅកាន់លេខទូរសព្ទរបស់អ្នក {phone}",
|
|
1332
1191
|
"lead.otp.verify": "ផ្ទៀងផ្ទាត់",
|
|
@@ -1335,10 +1194,7 @@ var kmKH = {
|
|
|
1335
1194
|
"lead.otp.phonePlaceholder": "បញ្ចូល OTP",
|
|
1336
1195
|
"lead.empty.title": "អូុបស! ហាក់ដូចជាព័ត៌មានរបស់អ្នកទទេ។ តើអ្នកចង់ដាក់ស្នើព័ត៌មានម្តងទៀតទេ?",
|
|
1337
1196
|
"lead.empty.cancel": "លុបចោល",
|
|
1338
|
-
"lead.empty.submitAgain": "ដាក់ស្នើម្ដងទៀត"
|
|
1339
|
-
"common.day": "ឆ្នាំ",
|
|
1340
|
-
"common.month": "ខែ",
|
|
1341
|
-
"common.year": "ថ្ងៃ"
|
|
1197
|
+
"lead.empty.submitAgain": "ដាក់ស្នើម្ដងទៀត"
|
|
1342
1198
|
};
|
|
1343
1199
|
|
|
1344
1200
|
var msMY = {
|
|
@@ -1351,7 +1207,6 @@ var msMY = {
|
|
|
1351
1207
|
"validator.phone": "Sila masukkan no telefon yang sah.",
|
|
1352
1208
|
"validator.emailUsed": "Emel sudah digunakan untuk kempen ini.",
|
|
1353
1209
|
"validator.phoneUsed": "Nombor telefon anda sudah digunakan untuk kempen ini.",
|
|
1354
|
-
"validator.dateInvalid": "Tarikh ini tidak sah, sila kemas kini",
|
|
1355
1210
|
"lead.otp.title": "Masukkan OTP",
|
|
1356
1211
|
"lead.otp.desc": "Kami telah menghantar OTP ke nombor telefon bimbit anda {phone}",
|
|
1357
1212
|
"lead.otp.verify": "Sahkan",
|
|
@@ -1360,10 +1215,7 @@ var msMY = {
|
|
|
1360
1215
|
"lead.otp.phonePlaceholder": "Masukkan OTP",
|
|
1361
1216
|
"lead.empty.title": "Oops, nampaknya maklumat anda kosong. Adakah anda ingin menghantar maklumat semula?",
|
|
1362
1217
|
"lead.empty.cancel": "Batal",
|
|
1363
|
-
"lead.empty.submitAgain": "Hantar semula"
|
|
1364
|
-
"common.day": "Hari",
|
|
1365
|
-
"common.month": "Bulan",
|
|
1366
|
-
"common.year": "Tahun"
|
|
1218
|
+
"lead.empty.submitAgain": "Hantar semula"
|
|
1367
1219
|
};
|
|
1368
1220
|
|
|
1369
1221
|
var myMM = {
|
|
@@ -1376,7 +1228,6 @@ var myMM = {
|
|
|
1376
1228
|
"validator.phone": "မှန်ကန်သော ဖုန်းနံပါတ်ထည့်သွင်းပါ",
|
|
1377
1229
|
"validator.emailUsed": "ဤအေကာင့်အတွက် အီးမေးလ်ကို အသုံးပြုပြီးဖြစ်ပါသည်။",
|
|
1378
1230
|
"validator.phoneUsed": "ဤအေကာင့်အတွက် သင့်ဖုန်းနံပါတ်ကို အသုံးပြုပြီးဖြစ်ပါသည်။",
|
|
1379
|
-
"validator.dateInvalid": "ယနေ့စွဲမှားနေသည်၊ ကျေးဇူးပြု၍ ပြင်ဆင်ပါ။",
|
|
1380
1231
|
"lead.otp.title": "OTP ကိုထည့်ပါ",
|
|
1381
1232
|
"lead.otp.desc": "ကျွန်ုပ်တို့သည် OTP ကိုသင့်ဖုန်းနံပါတ် {phone} သို့ပို့ခဲ့သည်",
|
|
1382
1233
|
"lead.otp.verify": "အတည်ပြုပါ",
|
|
@@ -1385,10 +1236,7 @@ var myMM = {
|
|
|
1385
1236
|
"lead.otp.phonePlaceholder": "OTP ကိုထည့်ပါ",
|
|
1386
1237
|
"lead.empty.title": "အုပ်စ်! သင့်အချက်အလက်သည် ဗလာဖြစ်နေသလိုဖြစ်သည်။ ထပ်မံတင်သွင်းလိုပါသလား?",
|
|
1387
1238
|
"lead.empty.cancel": "မလုပ်ဆောင်ပါ",
|
|
1388
|
-
"lead.empty.submitAgain": "ထပ်မံတင်သွင်းပါ"
|
|
1389
|
-
"common.day": "ရက်",
|
|
1390
|
-
"common.month": "လ",
|
|
1391
|
-
"common.year": "နှစ်"
|
|
1239
|
+
"lead.empty.submitAgain": "ထပ်မံတင်သွင်းပါ"
|
|
1392
1240
|
};
|
|
1393
1241
|
|
|
1394
1242
|
var thTH = {
|
|
@@ -1401,7 +1249,6 @@ var thTH = {
|
|
|
1401
1249
|
"validator.phone": "กรุณาใส่ตัวเลขที่ถูกต้อง",
|
|
1402
1250
|
"validator.emailUsed": "อีเมลนี้ถูกใช้สำหรับแคมเปญนี้แล้ว",
|
|
1403
1251
|
"validator.phoneUsed": "หมายเลขโทรศัพท์ของคุณถูกใช้สำหรับแคมเปญนี้แล้ว",
|
|
1404
|
-
"validator.dateInvalid": "วันที่นี้ไม่ถูกต้อง โปรดอัปเดต",
|
|
1405
1252
|
"lead.otp.title": "ป้อน OTP",
|
|
1406
1253
|
"lead.otp.desc": "เราได้ส่ง OTP ไปยังหมายเลขโทรศัพท์มือถือของคุณ {phone}",
|
|
1407
1254
|
"lead.otp.verify": "ยืนยัน",
|
|
@@ -1410,10 +1257,7 @@ var thTH = {
|
|
|
1410
1257
|
"lead.otp.phonePlaceholder": "ป้อน OTP",
|
|
1411
1258
|
"lead.empty.title": "อุ๊ปส์! ดูเหมือนว่าข้อมูลของคุณว่างเปล่า คุณต้องการส่งข้อมูลอีกครั้งหรือไม่?",
|
|
1412
1259
|
"lead.empty.cancel": "ยกเลิก",
|
|
1413
|
-
"lead.empty.submitAgain": "ส่งอีกครั้ง"
|
|
1414
|
-
"common.day": "วัน",
|
|
1415
|
-
"common.month": "เดือน",
|
|
1416
|
-
"common.year": "ปี"
|
|
1260
|
+
"lead.empty.submitAgain": "ส่งอีกครั้ง"
|
|
1417
1261
|
};
|
|
1418
1262
|
|
|
1419
1263
|
var viVN = {
|
|
@@ -1437,7 +1281,6 @@ var viVN = {
|
|
|
1437
1281
|
"validator.phone": "Nhập đúng định dạng số điện thoại",
|
|
1438
1282
|
"validator.emailUsed": "Email này đã được sử dụng.",
|
|
1439
1283
|
"validator.phoneUsed": "Số điện thoại này đã được sử dụng.",
|
|
1440
|
-
"validator.dateInvalid": "Ngày này không hợp lệ, vui lòng cập nhật.",
|
|
1441
1284
|
"lead.otp.title": "Nhập OTP",
|
|
1442
1285
|
"lead.otp.desc": "Chúng tôi đã gửi OTP đến số điện thoại của bạn {phone}",
|
|
1443
1286
|
"lead.otp.verify": "Xác minh",
|
|
@@ -1446,10 +1289,7 @@ var viVN = {
|
|
|
1446
1289
|
"lead.otp.phonePlaceholder": "Nhập OTP",
|
|
1447
1290
|
"lead.empty.title": "Oops, có vẻ như thông tin của bạn đang trống. Bạn có muốn gửi lại thông tin không?",
|
|
1448
1291
|
"lead.empty.cancel": "Hủy",
|
|
1449
|
-
"lead.empty.submitAgain": "Gửi lại"
|
|
1450
|
-
"common.day": "Ngày",
|
|
1451
|
-
"common.month": "Tháng",
|
|
1452
|
-
"common.year": "Năm"
|
|
1292
|
+
"lead.empty.submitAgain": "Gửi lại"
|
|
1453
1293
|
};
|
|
1454
1294
|
|
|
1455
1295
|
var zhTW = {
|
|
@@ -1462,7 +1302,6 @@ var zhTW = {
|
|
|
1462
1302
|
"validator.phone": "請填入有效的電話號碼",
|
|
1463
1303
|
"validator.emailUsed": "此電子郵件已被使用於此活動。",
|
|
1464
1304
|
"validator.phoneUsed": "您的手機號碼已被使用於此活動。",
|
|
1465
|
-
"validator.dateInvalid": "此日期無效,請更新.",
|
|
1466
1305
|
"lead.otp.title": "輸入 OTP",
|
|
1467
1306
|
"lead.otp.desc": "我們已將 OTP 發送到您的手機號碼 {phone}",
|
|
1468
1307
|
"lead.otp.verify": "驗證",
|
|
@@ -1471,10 +1310,7 @@ var zhTW = {
|
|
|
1471
1310
|
"lead.otp.phonePlaceholder": "輸入 OTP",
|
|
1472
1311
|
"lead.empty.title": "哎呀,您的資訊似乎是空的,您想要重新提交資訊嗎?",
|
|
1473
1312
|
"lead.empty.cancel": "取消",
|
|
1474
|
-
"lead.empty.submitAgain": "重新提交"
|
|
1475
|
-
"common.day": "日",
|
|
1476
|
-
"common.month": "月",
|
|
1477
|
-
"common.year": "年"
|
|
1313
|
+
"lead.empty.submitAgain": "重新提交"
|
|
1478
1314
|
};
|
|
1479
1315
|
|
|
1480
1316
|
const translationsMap = {
|
|
@@ -1486,7 +1322,6 @@ const translationsMap = {
|
|
|
1486
1322
|
'my-MM': myMM,
|
|
1487
1323
|
'km-KH': kmKH,
|
|
1488
1324
|
'zh-TW': zhTW,
|
|
1489
|
-
'zh-CN': zhTW,
|
|
1490
1325
|
'th-TH': thTH,
|
|
1491
1326
|
'tl-PH': enPH,
|
|
1492
1327
|
};
|
|
@@ -1500,1056 +1335,43 @@ const getTranslations = (locale) => {
|
|
|
1500
1335
|
|
|
1501
1336
|
const LeadGenContext = createContext({});
|
|
1502
1337
|
|
|
1503
|
-
const
|
|
1504
|
-
const
|
|
1505
|
-
const
|
|
1506
|
-
const [
|
|
1507
|
-
|
|
1508
|
-
const translationContextValue = { locale, values: getTranslations(locale) };
|
|
1338
|
+
const useImageSize = (src) => {
|
|
1339
|
+
const [width, setWidth] = useState(16);
|
|
1340
|
+
const [height, setHeight] = useState(9);
|
|
1341
|
+
const [loaded, setLoaded] = useState(false);
|
|
1342
|
+
// load src image to get its width and height
|
|
1509
1343
|
useEffect(() => {
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1344
|
+
setLoaded(false);
|
|
1345
|
+
if (src) {
|
|
1346
|
+
const img = new Image();
|
|
1347
|
+
img.addEventListener('load', () => {
|
|
1348
|
+
setWidth(img.naturalWidth);
|
|
1349
|
+
setHeight(img.naturalHeight);
|
|
1350
|
+
setLoaded(true);
|
|
1351
|
+
});
|
|
1352
|
+
img.addEventListener('error', () => {
|
|
1353
|
+
setWidth(16);
|
|
1354
|
+
setHeight(9);
|
|
1355
|
+
setLoaded(true);
|
|
1519
1356
|
});
|
|
1357
|
+
img.src = src;
|
|
1520
1358
|
}
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
}
|
|
1532
|
-
return (React__default.createElement(LeadGenSubscriptionBoxContext.Provider, { value: leadGenSubscriptionBoxValue },
|
|
1533
|
-
React__default.createElement(TranslationsContext.Provider, { value: translationContextValue }, children)));
|
|
1534
|
-
};
|
|
1535
|
-
|
|
1536
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
1537
|
-
const customParseFormat = require('dayjs/plugin/customParseFormat');
|
|
1538
|
-
dayjs.extend(customParseFormat);
|
|
1539
|
-
// You can give context variables any name
|
|
1540
|
-
const [LeadFormProvider, useLeadFormContext, useLeadForm] = createFormContext();
|
|
1541
|
-
const useLeadFormConfig = ({ listBlockAdded = [], validatingPhoneRef, validatingEmailRef, campaignId, campaign_subot_id = [], userInfo, format, }) => {
|
|
1542
|
-
var _a;
|
|
1543
|
-
const { t } = useTranslations();
|
|
1544
|
-
const initialValues = useMemo(() => mappingSSOToLead(userInfo), [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
|
|
1545
|
-
const LEAD_LOCALE = LEAD_LOCALE_DATA[(_a = document === null || document === void 0 ? void 0 : document.documentElement) === null || _a === void 0 ? void 0 : _a.lang] ||
|
|
1546
|
-
LEAD_LOCALE_DATA['vi-VN'];
|
|
1547
|
-
const validateObj = useMemo(() => {
|
|
1548
|
-
const InputBlocks = [
|
|
1549
|
-
'TextBlock',
|
|
1550
|
-
'NumberBlock',
|
|
1551
|
-
'EmailBlock',
|
|
1552
|
-
'PhoneBlock',
|
|
1553
|
-
'DateBlock',
|
|
1554
|
-
'CheckboxBlock',
|
|
1555
|
-
'RadioBlock',
|
|
1556
|
-
'DropdownBlock',
|
|
1557
|
-
'PhoneOtpBlock',
|
|
1558
|
-
'WhatsappOtpBlock',
|
|
1559
|
-
'ZaloOtpBlock',
|
|
1560
|
-
'LocationBlock',
|
|
1561
|
-
'TncBlock',
|
|
1562
|
-
];
|
|
1563
|
-
// ALL are required and can skip if not touched yet
|
|
1564
|
-
const withSharedCheck = (name, cb,
|
|
1565
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1566
|
-
block) => {
|
|
1567
|
-
return (value) => {
|
|
1568
|
-
var _a;
|
|
1569
|
-
const isBLockRequired = (_a = block === null || block === void 0 ? void 0 : block.data) === null || _a === void 0 ? void 0 : _a.required;
|
|
1570
|
-
if (!formRef.current.isTouched(name))
|
|
1571
|
-
return;
|
|
1572
|
-
if ((typeof value === 'string' && value.trim() === '') ||
|
|
1573
|
-
typeof value === 'undefined' ||
|
|
1574
|
-
(Array.isArray(value) && value.length === 0)) {
|
|
1575
|
-
return isBLockRequired
|
|
1576
|
-
? t('validator.required')
|
|
1577
|
-
: cb === null || cb === void 0 ? void 0 : cb(value);
|
|
1578
|
-
}
|
|
1579
|
-
return cb === null || cb === void 0 ? void 0 : cb(value);
|
|
1580
|
-
};
|
|
1581
|
-
};
|
|
1582
|
-
return listBlockAdded
|
|
1583
|
-
.filter((b) => InputBlocks.includes(b.name))
|
|
1584
|
-
.reduce((r, b) => {
|
|
1585
|
-
const { name: fieldType, data } = b || {};
|
|
1586
|
-
const { value: fieldName, required } = data || {};
|
|
1587
|
-
const isRequired = required !== null && required !== void 0 ? required : true;
|
|
1588
|
-
if (fieldType === 'NumberBlock') {
|
|
1589
|
-
return Object.assign(Object.assign({}, r), { [fieldName]: withSharedCheck(fieldName, (value) => {
|
|
1590
|
-
if (value && isNaN(Number(value))) {
|
|
1591
|
-
return t('validator.number');
|
|
1592
|
-
}
|
|
1593
|
-
}, b) });
|
|
1594
|
-
}
|
|
1595
|
-
else if (fieldType === 'EmailBlock') {
|
|
1596
|
-
return Object.assign(Object.assign({}, r), { [fieldName]: withSharedCheck(fieldName, (value) => {
|
|
1597
|
-
if (value && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) {
|
|
1598
|
-
return t('validator.email');
|
|
1599
|
-
}
|
|
1600
|
-
if (!value)
|
|
1601
|
-
return;
|
|
1602
|
-
validatingEmailRef.current = true;
|
|
1603
|
-
setTimeout(() => {
|
|
1604
|
-
formRef.current.setFieldError(fieldName, 'Validating...');
|
|
1605
|
-
checkUsedEmailOrPhoneWithCache(campaignId, campaign_subot_id, {
|
|
1606
|
-
email: value,
|
|
1607
|
-
})
|
|
1608
|
-
.then((tKey) => {
|
|
1609
|
-
if (tKey) {
|
|
1610
|
-
formRef.current.setFieldError(fieldName, t(tKey));
|
|
1611
|
-
}
|
|
1612
|
-
else {
|
|
1613
|
-
formRef.current.clearFieldError(fieldName);
|
|
1614
|
-
}
|
|
1615
|
-
validatingEmailRef.current = false;
|
|
1616
|
-
})
|
|
1617
|
-
.catch((e) => {
|
|
1618
|
-
console.error(e);
|
|
1619
|
-
formRef.current.setFieldError(fieldName, e.message || 'Something went wrong');
|
|
1620
|
-
validatingEmailRef.current = false;
|
|
1621
|
-
});
|
|
1622
|
-
}, 200);
|
|
1623
|
-
}, b) });
|
|
1624
|
-
}
|
|
1625
|
-
else if (fieldType === 'PhoneBlock' ||
|
|
1626
|
-
fieldType === 'PhoneOtpBlock' ||
|
|
1627
|
-
fieldType === 'ZaloOtpBlock' ||
|
|
1628
|
-
fieldType === 'WhatsappOtpBlock') {
|
|
1629
|
-
return Object.assign(Object.assign({}, r), { [fieldName]: withSharedCheck(fieldName, (value) => {
|
|
1630
|
-
if (value &&
|
|
1631
|
-
window.intlTelInputUtils &&
|
|
1632
|
-
!window.intlTelInputUtils.isValidNumber(String(value), LEAD_LOCALE.countryCode)) {
|
|
1633
|
-
return t('validator.phone');
|
|
1634
|
-
}
|
|
1635
|
-
if (!value)
|
|
1636
|
-
return;
|
|
1637
|
-
validatingPhoneRef.current = true;
|
|
1638
|
-
setTimeout(() => {
|
|
1639
|
-
formRef.current.setFieldError(fieldName, 'Validating...');
|
|
1640
|
-
if (b.data.singleSubmission) {
|
|
1641
|
-
checkUsedPhoneOnlyWithCache(campaignId, value)
|
|
1642
|
-
.then((tKey) => {
|
|
1643
|
-
if (tKey) {
|
|
1644
|
-
formRef.current.setFieldError(fieldName, t(tKey));
|
|
1645
|
-
}
|
|
1646
|
-
else {
|
|
1647
|
-
formRef.current.clearFieldError(fieldName);
|
|
1648
|
-
}
|
|
1649
|
-
validatingPhoneRef.current = false;
|
|
1650
|
-
})
|
|
1651
|
-
.catch((err) => {
|
|
1652
|
-
console.error(err);
|
|
1653
|
-
formRef.current.setFieldError(fieldName, err.message || 'Something went wrong');
|
|
1654
|
-
validatingPhoneRef.current = false;
|
|
1655
|
-
});
|
|
1656
|
-
}
|
|
1657
|
-
else {
|
|
1658
|
-
checkUsedEmailOrPhoneWithCache(campaignId, campaign_subot_id, {
|
|
1659
|
-
phone: value,
|
|
1660
|
-
})
|
|
1661
|
-
.then((tKey) => {
|
|
1662
|
-
if (tKey) {
|
|
1663
|
-
formRef.current.setFieldError(fieldName, t(tKey));
|
|
1664
|
-
}
|
|
1665
|
-
else {
|
|
1666
|
-
formRef.current.clearFieldError(fieldName);
|
|
1667
|
-
}
|
|
1668
|
-
validatingPhoneRef.current = false;
|
|
1669
|
-
})
|
|
1670
|
-
.catch((e) => {
|
|
1671
|
-
console.error(e);
|
|
1672
|
-
formRef.current.setFieldError(fieldName, e.message || 'Something went wrong');
|
|
1673
|
-
validatingPhoneRef.current = false;
|
|
1674
|
-
});
|
|
1675
|
-
}
|
|
1676
|
-
}, 200);
|
|
1677
|
-
}, b) });
|
|
1678
|
-
}
|
|
1679
|
-
else if (fieldType === 'DateBlock') {
|
|
1680
|
-
return Object.assign(Object.assign({}, r), { [fieldName]: withSharedCheck(fieldName, (value) => {
|
|
1681
|
-
if (!isRequired && !value) {
|
|
1682
|
-
return;
|
|
1683
|
-
}
|
|
1684
|
-
const errMsg = t('validator.dateInvalid');
|
|
1685
|
-
const dayInJS = typeof value === 'string'
|
|
1686
|
-
? dayjs(value, format, true)
|
|
1687
|
-
: dayjs(value);
|
|
1688
|
-
if (!dayInJS.isValid()) {
|
|
1689
|
-
return errMsg;
|
|
1690
|
-
}
|
|
1691
|
-
}, b) });
|
|
1692
|
-
}
|
|
1693
|
-
else if (fieldType === 'TncBlock') {
|
|
1694
|
-
return Object.assign(Object.assign({}, r), { [`TNC-` + b.id]: withSharedCheck('TNC-' + b.id, (value) => {
|
|
1695
|
-
if (isRequired && !value) {
|
|
1696
|
-
return t('validator.required');
|
|
1697
|
-
}
|
|
1698
|
-
}, b) });
|
|
1699
|
-
}
|
|
1700
|
-
else {
|
|
1701
|
-
return Object.assign(Object.assign({}, r), { [fieldName]: withSharedCheck(fieldName, undefined, b) });
|
|
1702
|
-
}
|
|
1703
|
-
}, {});
|
|
1704
|
-
}, [listBlockAdded.map((b) => b.name).join(','), format]);
|
|
1705
|
-
const form = useLeadForm({
|
|
1706
|
-
validateInputOnChange: true,
|
|
1707
|
-
validateInputOnBlur: true,
|
|
1708
|
-
clearInputErrorOnChange: true,
|
|
1709
|
-
validate: validateObj,
|
|
1710
|
-
initialValues,
|
|
1711
|
-
});
|
|
1712
|
-
const formRef = useRef(form);
|
|
1713
|
-
formRef.current = form;
|
|
1714
|
-
return { form, validateObj };
|
|
1359
|
+
else {
|
|
1360
|
+
setWidth(16);
|
|
1361
|
+
setHeight(9);
|
|
1362
|
+
setLoaded(true);
|
|
1363
|
+
}
|
|
1364
|
+
}, [src]);
|
|
1365
|
+
return {
|
|
1366
|
+
loaded,
|
|
1367
|
+
width,
|
|
1368
|
+
height,
|
|
1369
|
+
};
|
|
1715
1370
|
};
|
|
1716
1371
|
|
|
1717
|
-
const
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
return (React__default.createElement(Input$1.Wrapper, { size: "md", label: label, labelElement: labelElement, labelProps: Object.assign({ htmlFor: id }, labelProps), description: description, descriptionProps: descriptionProps, withAsterisk: withAsterisk, inputMode: inputMode, inputContainer: inputContainer, inputWrapperOrder: inputWrapperOrder, error: error, "data-invalid": !!error, className: className, classNames: classNames, style: style, styles: styles },
|
|
1721
|
-
React__default.createElement("div", { className: "mantine-Input-wrapper" },
|
|
1722
|
-
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" })))));
|
|
1723
|
-
});
|
|
1724
|
-
|
|
1725
|
-
const StyledLeadGenFormInner = styled.div `
|
|
1726
|
-
display: flex;
|
|
1727
|
-
flex-wrap: wrap;
|
|
1728
|
-
gap: 8px;
|
|
1729
|
-
.leadgen-form_input {
|
|
1730
|
-
width: calc(50% - 4px);
|
|
1731
|
-
}
|
|
1732
|
-
|
|
1733
|
-
.leadgen-form_input_checkbox {
|
|
1734
|
-
width: 100%;
|
|
1735
|
-
}
|
|
1736
|
-
`;
|
|
1737
|
-
|
|
1738
|
-
const cssInputNotShrink$1 = css `
|
|
1739
|
-
height: 100% !important;
|
|
1740
|
-
min-height: calc(var(--container-height, 56px) * 22 / 56);
|
|
1741
|
-
color: ${theme.colors.gray800};
|
|
1742
|
-
font-size: var(--input, 16px);
|
|
1743
|
-
line-height: calc(var(--container-height, 56px) * 22 / 56);
|
|
1744
|
-
border: none !important;
|
|
1745
|
-
border-radius: 0 !important;
|
|
1746
|
-
outline: none !important;
|
|
1747
|
-
box-shadow: none !important;
|
|
1748
|
-
padding: 0;
|
|
1749
|
-
cursor: pointer;
|
|
1750
|
-
opacity: 0;
|
|
1751
|
-
|
|
1752
|
-
::placeholder {
|
|
1753
|
-
color: ${theme.colors.gray400};
|
|
1754
|
-
}
|
|
1755
|
-
`;
|
|
1756
|
-
const cssInputShrink$1 = css `
|
|
1757
|
-
height: auto !important;
|
|
1758
|
-
cursor: text;
|
|
1759
|
-
opacity: 1;
|
|
1760
|
-
transition: 0.1s ease-in-out all;
|
|
1761
|
-
`;
|
|
1762
|
-
const cssLabelNotShrink$1 = css `
|
|
1763
|
-
position: absolute;
|
|
1764
|
-
top: calc(var(--container-height) / 2);
|
|
1765
|
-
left: var(--space-x, 16px);
|
|
1766
|
-
color: ${theme.colors.gray400};
|
|
1767
|
-
font-size: var(--label-not-shrink, 16px);
|
|
1768
|
-
font-weight: 400;
|
|
1769
|
-
line-height: calc(var(--container-height, 56px) * 18 / 56);
|
|
1770
|
-
margin: 0;
|
|
1771
|
-
z-index: 1;
|
|
1772
|
-
cursor: pointer;
|
|
1773
|
-
transform: translateY(-50%);
|
|
1774
|
-
transition: 0.125s ease-in all;
|
|
1775
|
-
`;
|
|
1776
|
-
const cssLabelShrink$1 = css `
|
|
1777
|
-
color: ${theme.colors.gray600};
|
|
1778
|
-
font-weight: 600;
|
|
1779
|
-
font-size: var(--label-shrink, 12px);
|
|
1780
|
-
top: calc(var(--container-height) * 7 / 56);
|
|
1781
|
-
transform: none;
|
|
1782
|
-
transition: 0.125s ease-out all;
|
|
1783
|
-
`;
|
|
1784
|
-
const cssWrapperInputNotShrink$1 = css `
|
|
1785
|
-
min-height: var(--container-height, 56px);
|
|
1786
|
-
display: flex;
|
|
1787
|
-
align-items: flex-end;
|
|
1788
|
-
border: 1px solid ${theme.colors.gray200};
|
|
1789
|
-
border-radius: 8px;
|
|
1790
|
-
background-color: #fff;
|
|
1791
|
-
padding-inline: var(--space-x, 16px);
|
|
1792
|
-
padding-block: var(--space-y-not-shrink, 16px);
|
|
1793
|
-
cursor: pointer;
|
|
1794
|
-
pointer-events: none;
|
|
1795
|
-
|
|
1796
|
-
&:has(.mantine-Input-rightSection) {
|
|
1797
|
-
padding-right: var(--container-height, 56px);
|
|
1798
|
-
}
|
|
1799
|
-
|
|
1800
|
-
.mantine-Input-icon {
|
|
1801
|
-
display: none;
|
|
1802
|
-
}
|
|
1803
|
-
|
|
1804
|
-
.mantine-NumberInput-control {
|
|
1805
|
-
border-color: ${theme.colors.gray200};
|
|
1806
|
-
}
|
|
1807
|
-
`;
|
|
1808
|
-
const cssWrapperInputShrink$1 = css `
|
|
1809
|
-
height: auto;
|
|
1810
|
-
min-height: var(--container-height, 56px);
|
|
1811
|
-
padding-block: var(--space-y-shrink, 7px);
|
|
1812
|
-
cursor: text;
|
|
1813
|
-
pointer-events: auto;
|
|
1814
|
-
`;
|
|
1815
|
-
const cssInputWrapperError$1 = css `
|
|
1816
|
-
color: ${theme.colors.red800};
|
|
1817
|
-
font-size: 12px;
|
|
1818
|
-
line-height: 1.5;
|
|
1819
|
-
`;
|
|
1820
|
-
const StyledTextFieldContainer$1 = styled.div `
|
|
1821
|
-
--space-x: 16px;
|
|
1822
|
-
--space-y-not-shrink: 16px;
|
|
1823
|
-
--space-y-shrink: 7px;
|
|
1824
|
-
--container-height: 56px;
|
|
1825
|
-
--label-not-shrink: 16px;
|
|
1826
|
-
--label-shrink: 12px;
|
|
1827
|
-
--input: 16px;
|
|
1828
|
-
|
|
1829
|
-
position: relative;
|
|
1830
|
-
min-width: 100px;
|
|
1831
|
-
max-width: 100%;
|
|
1832
|
-
display: inline-block;
|
|
1833
|
-
|
|
1834
|
-
.textField_wrapper {
|
|
1835
|
-
display: inline-block;
|
|
1836
|
-
width: 100%;
|
|
1837
|
-
cursor: pointer;
|
|
1838
|
-
}
|
|
1839
|
-
|
|
1840
|
-
.mantine-InputWrapper-root {
|
|
1841
|
-
&[data-invalid='true'] {
|
|
1842
|
-
.mantine-Input-wrapper {
|
|
1843
|
-
border-color: ${theme.colors.red400};
|
|
1844
|
-
}
|
|
1845
|
-
}
|
|
1846
|
-
|
|
1847
|
-
.mantine-Input-wrapper {
|
|
1848
|
-
&:has([data-invalid]) {
|
|
1849
|
-
border-color: ${theme.colors.red400};
|
|
1850
|
-
}
|
|
1851
|
-
}
|
|
1852
|
-
|
|
1853
|
-
.mantine-InputWrapper-error {
|
|
1854
|
-
font-size: 12px !important;
|
|
1855
|
-
}
|
|
1856
|
-
}
|
|
1857
|
-
|
|
1858
|
-
.mantine-InputWrapper-label {
|
|
1859
|
-
${cssLabelNotShrink$1}
|
|
1860
|
-
}
|
|
1861
|
-
|
|
1862
|
-
.mantine-Input-wrapper {
|
|
1863
|
-
${cssWrapperInputNotShrink$1}
|
|
1864
|
-
|
|
1865
|
-
+ .mantine-Popover-dropdown[data-position="bottom-start"] {
|
|
1866
|
-
left: 0 !important;
|
|
1867
|
-
}
|
|
1868
|
-
+ .mantine-Popover-dropdown[data-position='top-start'] {
|
|
1869
|
-
top: unset !important;
|
|
1870
|
-
left: 0 !important;
|
|
1871
|
-
bottom: 100% !important;
|
|
1872
|
-
}
|
|
1873
|
-
}
|
|
1874
|
-
|
|
1875
|
-
.mantine-Input-input {
|
|
1876
|
-
${cssInputNotShrink$1}
|
|
1877
|
-
}
|
|
1878
|
-
|
|
1879
|
-
&.textField_shrink,
|
|
1880
|
-
&:focus-within {
|
|
1881
|
-
.mantine-InputWrapper-label {
|
|
1882
|
-
${cssLabelShrink$1}
|
|
1883
|
-
}
|
|
1884
|
-
|
|
1885
|
-
.mantine-Input-wrapper {
|
|
1886
|
-
${cssWrapperInputShrink$1}
|
|
1887
|
-
&.mantine-Select-wrapper {
|
|
1888
|
-
.mantine-Select-rightSection {
|
|
1889
|
-
pointer-events: auto !important;
|
|
1890
|
-
}
|
|
1891
|
-
}
|
|
1892
|
-
}
|
|
1893
|
-
|
|
1894
|
-
.mantine-Input-input {
|
|
1895
|
-
${cssInputShrink$1}
|
|
1896
|
-
}
|
|
1897
|
-
|
|
1898
|
-
&:has(.PhoneInput) {
|
|
1899
|
-
.mantine-InputWrapper-label {
|
|
1900
|
-
left: var(--space-x, 16px);
|
|
1901
|
-
}
|
|
1902
|
-
.PhoneInput {
|
|
1903
|
-
.PhoneInputInput {
|
|
1904
|
-
opacity: 1;
|
|
1905
|
-
}
|
|
1906
|
-
}
|
|
1907
|
-
}
|
|
1908
|
-
}
|
|
1909
|
-
|
|
1910
|
-
.PhoneInput {
|
|
1911
|
-
--phone-select: 75px;
|
|
1912
|
-
--phone-input-space-x: 8px;
|
|
1913
|
-
width: 100%;
|
|
1914
|
-
opacity: 1;
|
|
1915
|
-
border: none;
|
|
1916
|
-
.PhoneInputCountry {
|
|
1917
|
-
background-color: transparent;
|
|
1918
|
-
border: none;
|
|
1919
|
-
padding: 0;
|
|
1920
|
-
width: var(--phone-select, 75px);
|
|
1921
|
-
}
|
|
1922
|
-
.PhoneInputInput {
|
|
1923
|
-
flex: 1;
|
|
1924
|
-
min-width: 0;
|
|
1925
|
-
line-height: 1.5;
|
|
1926
|
-
outline: none !important;
|
|
1927
|
-
border: none;
|
|
1928
|
-
box-shadow: none;
|
|
1929
|
-
padding: 0 var(--phone-input-space-x, 8px);
|
|
1930
|
-
opacity: 0;
|
|
1931
|
-
color: ${theme.colors.gray800} !important;
|
|
1932
|
-
:focus {
|
|
1933
|
-
color: ${theme.colors.gray800} !important;
|
|
1934
|
-
}
|
|
1935
|
-
}
|
|
1936
|
-
}
|
|
1937
|
-
|
|
1938
|
-
&:has(.PhoneInput) {
|
|
1939
|
-
.mantine-InputWrapper-label {
|
|
1940
|
-
left: calc(
|
|
1941
|
-
var(--space-x, 16px) + var(--phone-select, 75px) +
|
|
1942
|
-
var(--phone-input-space-x, 8px)
|
|
1943
|
-
);
|
|
1944
|
-
}
|
|
1945
|
-
}
|
|
1946
|
-
`;
|
|
1947
|
-
const StyledChoiceFieldContainer$1 = styled.div `
|
|
1948
|
-
&.leadgen-form_checkbox,
|
|
1949
|
-
&.leadgen-form_radio {
|
|
1950
|
-
width: 100%;
|
|
1951
|
-
}
|
|
1952
|
-
|
|
1953
|
-
&.leadgen-form_dropdown {
|
|
1954
|
-
width: calc(50% - 12px);
|
|
1955
|
-
}
|
|
1956
|
-
|
|
1957
|
-
.mantine-InputWrapper-root {
|
|
1958
|
-
display: block;
|
|
1959
|
-
.mantine-InputWrapper-error {
|
|
1960
|
-
font-size: 12px !important;
|
|
1961
|
-
}
|
|
1962
|
-
}
|
|
1963
|
-
|
|
1964
|
-
.mantine-InputWrapper-label {
|
|
1965
|
-
margin-bottom: 0.5rem;
|
|
1966
|
-
color: ${theme.colors.gray800};
|
|
1967
|
-
font-size: 16px;
|
|
1968
|
-
font-weight: 400;
|
|
1969
|
-
line-height: 1.5;
|
|
1970
|
-
}
|
|
1971
|
-
|
|
1972
|
-
.mantine-Radio-root,
|
|
1973
|
-
.mantine-Checkbox-root {
|
|
1974
|
-
gap: 8px;
|
|
1975
|
-
min-width: calc(50% - 4px);
|
|
1976
|
-
|
|
1977
|
-
input[type='radio'],
|
|
1978
|
-
input[type='checkbox'] {
|
|
1979
|
-
border-color: ${theme.colors.gray600};
|
|
1980
|
-
width: 18px;
|
|
1981
|
-
height: 18px;
|
|
1982
|
-
}
|
|
1983
|
-
input[type='checkbox'] {
|
|
1984
|
-
border-radius: 4px;
|
|
1985
|
-
}
|
|
1986
|
-
|
|
1987
|
-
&[data-checked='true'] {
|
|
1988
|
-
input[type='radio'],
|
|
1989
|
-
input[type='checkbox'] {
|
|
1990
|
-
border-color: ${theme.colors.primary600};
|
|
1991
|
-
+ svg {
|
|
1992
|
-
color: ${theme.colors.primary600};
|
|
1993
|
-
}
|
|
1994
|
-
}
|
|
1995
|
-
|
|
1996
|
-
input[type='radio'] {
|
|
1997
|
-
background-color: white;
|
|
1998
|
-
}
|
|
1999
|
-
}
|
|
2000
|
-
|
|
2001
|
-
.mantine-Checkbox-input {
|
|
2002
|
-
&:checked {
|
|
2003
|
-
border-color: ${theme.colors.primary600};
|
|
2004
|
-
}
|
|
2005
|
-
}
|
|
2006
|
-
}
|
|
2007
|
-
|
|
2008
|
-
.mantine-Radio-inner,
|
|
2009
|
-
.mantine-Checkbox-inner {
|
|
2010
|
-
width: 24px;
|
|
2011
|
-
height: 24px;
|
|
2012
|
-
display: flex;
|
|
2013
|
-
align-items: center;
|
|
2014
|
-
justify-content: center;
|
|
2015
|
-
}
|
|
2016
|
-
|
|
2017
|
-
.mantine-Radio-body,
|
|
2018
|
-
.mantine-Checkbox-body {
|
|
2019
|
-
display: flex;
|
|
2020
|
-
align-items: center;
|
|
2021
|
-
}
|
|
2022
|
-
|
|
2023
|
-
.mantine-Radio-label,
|
|
2024
|
-
.mantine-Checkbox-label {
|
|
2025
|
-
padding-left: 8px;
|
|
2026
|
-
color: ${theme.colors.gray800};
|
|
2027
|
-
font-size: 14px;
|
|
2028
|
-
line-height: 1.4;
|
|
2029
|
-
letter-spacing: -0.2px;
|
|
2030
|
-
}
|
|
2031
|
-
|
|
2032
|
-
.leadgen-choiceContainer {
|
|
2033
|
-
display: flex;
|
|
2034
|
-
flex-wrap: wrap;
|
|
2035
|
-
align-items: flex-start;
|
|
2036
|
-
gap: 8px;
|
|
2037
|
-
}
|
|
2038
|
-
|
|
2039
|
-
.mantine-InputWrapper-error {
|
|
2040
|
-
${cssInputWrapperError$1}
|
|
2041
|
-
}
|
|
2042
|
-
`;
|
|
2043
|
-
|
|
2044
|
-
const TextField$1 = (props) => {
|
|
2045
|
-
const { shrink: shrinkProps, onChangeShrink, className, children } = props, restProps = __rest(props, ["shrink", "onChangeShrink", "className", "children"]);
|
|
2046
|
-
const containerRef = useClickOutside(() => {
|
|
2047
|
-
if (shrinkProps) {
|
|
2048
|
-
return;
|
|
2049
|
-
}
|
|
2050
|
-
setShrink(false);
|
|
2051
|
-
onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(false);
|
|
2052
|
-
});
|
|
2053
|
-
const [shrink, setShrink] = useState(shrinkProps);
|
|
2054
|
-
const onClick = useCallback((e) => {
|
|
2055
|
-
setShrink(true);
|
|
2056
|
-
onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(true);
|
|
2057
|
-
if (shrink) {
|
|
2058
|
-
return;
|
|
2059
|
-
}
|
|
2060
|
-
const $textEl = e.currentTarget.querySelectorAll('input:not([disabled]):not([type="submit"]),select:not([disabled]),textarea:not([disabled])');
|
|
2061
|
-
const $focusEl = $textEl.item($textEl.length - 1);
|
|
2062
|
-
if ($focusEl) {
|
|
2063
|
-
$focusEl.focus();
|
|
2064
|
-
setTimeout(() => {
|
|
2065
|
-
$focusEl.scrollIntoView({
|
|
2066
|
-
behavior: 'auto',
|
|
2067
|
-
block: 'center',
|
|
2068
|
-
inline: 'start',
|
|
2069
|
-
});
|
|
2070
|
-
}, 100);
|
|
2071
|
-
}
|
|
2072
|
-
}, [shrink]);
|
|
2073
|
-
useEffect(() => {
|
|
2074
|
-
setShrink(shrinkProps);
|
|
2075
|
-
}, [shrinkProps]);
|
|
2076
|
-
return (React__default.createElement(StyledTextFieldContainer$1, Object.assign({ shrink: shrink, className: clsx(className, 'textField', { textField_shrink: !!shrink }) }, restProps),
|
|
2077
|
-
React__default.createElement("div", { ref: containerRef, onClick: onClick, className: "textField_wrapper" }, children)));
|
|
2078
|
-
};
|
|
2079
|
-
const ChoiceField$1 = (props) => {
|
|
2080
|
-
const { children, className } = props, restProps = __rest(props, ["children", "className"]);
|
|
2081
|
-
return (React__default.createElement(StyledChoiceFieldContainer$1, Object.assign({ className: clsx(className, 'choiceField') }, restProps), children));
|
|
2082
|
-
};
|
|
2083
|
-
|
|
2084
|
-
const libraries = ['places'];
|
|
2085
|
-
const GoogleLocationBlock = (props) => {
|
|
2086
|
-
var _a;
|
|
2087
|
-
const { inputWrapperOrder = ['label', 'input', 'description', 'error'], defaultValue, value: valueProps, onChange: onChangeProps, locale } = props, restProps = __rest(props, ["inputWrapperOrder", "defaultValue", "value", "onChange", "locale"]);
|
|
2088
|
-
const [LoadScript, setLoadScript] = useState(null);
|
|
2089
|
-
const [value, setValue] = useState(defaultValue || valueProps);
|
|
2090
|
-
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]);
|
|
2091
|
-
const onChangeAutocomplete = useCallback((s) => {
|
|
2092
|
-
setValue(s);
|
|
2093
|
-
onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(s);
|
|
2094
|
-
}, []);
|
|
2095
|
-
const onClickItem = useCallback((item) => {
|
|
2096
|
-
/** For sure get value */
|
|
2097
|
-
setValue(item.value);
|
|
2098
|
-
const predCur = predictions === null || predictions === void 0 ? void 0 : predictions.find(({ description }) => description === item.value);
|
|
2099
|
-
onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(item.value, predCur === null || predCur === void 0 ? void 0 : predCur.rawData);
|
|
2100
|
-
}, [onChangeProps, predictions]);
|
|
2101
|
-
useEffect(() => {
|
|
2102
|
-
setValue(valueProps);
|
|
2103
|
-
}, [valueProps]);
|
|
2104
|
-
useEffect(() => {
|
|
2105
|
-
var _a, _b, _c;
|
|
2106
|
-
// only load extra google script when not yet loaded
|
|
2107
|
-
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) {
|
|
2108
|
-
import('@react-google-maps/api').then((m) => {
|
|
2109
|
-
setLoadScript(() => m.LoadScript);
|
|
2110
|
-
});
|
|
2111
|
-
}
|
|
2112
|
-
}, []);
|
|
2113
|
-
return (React__default.createElement(Autocomplete, Object.assign({ defaultValue: defaultValue, value: value, onChange: onChangeAutocomplete, data: predictions.map((pred) => {
|
|
2114
|
-
return { value: pred.description, label: pred.description };
|
|
2115
|
-
}), filter: () => true, onItemSubmit: onClickItem, inputWrapperOrder: inputWrapperOrder, zIndex: ZINDEX_SSO - 9e6 + 2, withinPortal: true, styles: { dropdown: { pointerEvents: 'auto' } }, inputContainer: (children) => {
|
|
2116
|
-
return (React__default.createElement(React__default.Fragment, null,
|
|
2117
|
-
LoadScript && (React__default.createElement(LoadScript, { googleMapsApiKey: GOOGLE_API_KEY, libraries: libraries, loadingElement: React__default.createElement(React__default.Fragment, null), style: { width: '100%' } })),
|
|
2118
|
-
children));
|
|
2119
|
-
} }, restProps)));
|
|
2120
|
-
};
|
|
2121
|
-
|
|
2122
|
-
const LeadGenForm = forwardRef((props, ref) => {
|
|
2123
|
-
const { locale, blocks, scrollToErrorField = true, form: formProps, rules: validate, initialValues, onFinish, onFinishFailed, className, style, } = props;
|
|
2124
|
-
const formRef = useRef(null);
|
|
2125
|
-
const form = formProps || useForm({ initialValues, validate });
|
|
2126
|
-
const middlewareFinish = (values, event) => {
|
|
2127
|
-
onFinish === null || onFinish === void 0 ? void 0 : onFinish(values, event);
|
|
2128
|
-
};
|
|
2129
|
-
const middlewareFinishFailed = (errors, values, events) => {
|
|
2130
|
-
if (scrollToErrorField && errors) {
|
|
2131
|
-
const firstErrorKey = Object.keys(errors)[0];
|
|
2132
|
-
const firstErrorElement = document.querySelector(`[name="${firstErrorKey}"]`);
|
|
2133
|
-
if (firstErrorElement && (firstErrorElement === null || firstErrorElement === void 0 ? void 0 : firstErrorElement.focus)) {
|
|
2134
|
-
setTimeout(() => {
|
|
2135
|
-
firstErrorElement === null || firstErrorElement === void 0 ? void 0 : firstErrorElement.focus();
|
|
2136
|
-
firstErrorElement.scrollIntoView({
|
|
2137
|
-
behavior: 'auto',
|
|
2138
|
-
block: 'center',
|
|
2139
|
-
inline: 'center',
|
|
2140
|
-
});
|
|
2141
|
-
}, 100);
|
|
2142
|
-
}
|
|
2143
|
-
}
|
|
2144
|
-
onFinishFailed === null || onFinishFailed === void 0 ? void 0 : onFinishFailed(errors, values, events);
|
|
2145
|
-
};
|
|
2146
|
-
useEffect(() => {
|
|
2147
|
-
(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
2148
|
-
if (!window.intlTelInputUtils) {
|
|
2149
|
-
yield require('intl-tel-input/build/js/utils');
|
|
2150
|
-
}
|
|
2151
|
-
}))();
|
|
2152
|
-
}, []);
|
|
2153
|
-
useImperativeHandle(ref, () => (Object.assign(Object.assign({}, form), { submit: () => formRef.current.requestSubmit() })), [form, formRef]);
|
|
2154
|
-
if (!blocks || !blocks.length) {
|
|
2155
|
-
return null;
|
|
2156
|
-
}
|
|
2157
|
-
return (React__default.createElement("form", { ref: formRef, onSubmit: form.onSubmit(middlewareFinish, middlewareFinishFailed), className: className, style: style },
|
|
2158
|
-
React__default.createElement(StyledLeadGenFormInner, { className: "leadgen-form_inputs" }, blocks.map((block, idx) => {
|
|
2159
|
-
const { id, name: blockName, data } = block;
|
|
2160
|
-
const { placeholder, value: name, required, listQuestion, valueHTML, isSendMailChimp = false, } = data;
|
|
2161
|
-
const formInputProps = form.getInputProps(name);
|
|
2162
|
-
const { value, error } = formInputProps;
|
|
2163
|
-
const reactKey = `${id}-${idx}`;
|
|
2164
|
-
switch (blockName) {
|
|
2165
|
-
case LEADGEN_BLOCK.TextBlock: {
|
|
2166
|
-
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2167
|
-
React__default.createElement(TextInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label: placeholder, placeholder: placeholder, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, type: "text", "data-control": "text" }, formInputProps))));
|
|
2168
|
-
}
|
|
2169
|
-
case LEADGEN_BLOCK.NumberBlock: {
|
|
2170
|
-
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2171
|
-
React__default.createElement(NumberInput$1, Object.assign({ name: value, spellCheck: false, withAsterisk: required, label: placeholder, placeholder: placeholder, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, type: "number", "data-control": "number" }, formInputProps))));
|
|
2172
|
-
}
|
|
2173
|
-
case LEADGEN_BLOCK.EmailBlock: {
|
|
2174
|
-
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2175
|
-
React__default.createElement(TextInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label: placeholder, placeholder: placeholder, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, "data-control": "email" }, formInputProps))));
|
|
2176
|
-
}
|
|
2177
|
-
case LEADGEN_BLOCK.PhoneOtpBlock:
|
|
2178
|
-
case LEADGEN_BLOCK.WhatsappOtpBlock:
|
|
2179
|
-
case LEADGEN_BLOCK.ZaloOtpBlock:
|
|
2180
|
-
case LEADGEN_BLOCK.PhoneBlock: {
|
|
2181
|
-
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2182
|
-
React__default.createElement(PhoneInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label: placeholder, placeholder: placeholder, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, defaultCountry: (locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN'), type: "text", "data-control": "text" }, formInputProps))));
|
|
2183
|
-
}
|
|
2184
|
-
case LEADGEN_BLOCK.LocationBlock: {
|
|
2185
|
-
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2186
|
-
React__default.createElement(GoogleLocationBlock, Object.assign({ name: name, withAsterisk: required, label: placeholder, placeholder: placeholder, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, locale: locale, "data-control": "text" }, formInputProps))));
|
|
2187
|
-
}
|
|
2188
|
-
case LEADGEN_BLOCK.DateBlock: {
|
|
2189
|
-
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2190
|
-
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: placeholder, placeholder: placeholder, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, type: "default", "data-control": "date" }, formInputProps))));
|
|
2191
|
-
}
|
|
2192
|
-
case LEADGEN_BLOCK.DropdownBlock:
|
|
2193
|
-
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2194
|
-
React__default.createElement("div", { style: { display: 'none' }, "data-extra": true, "data-name": value, "data-control": 'dropdown' }),
|
|
2195
|
-
React__default.createElement(Select$1, Object.assign({ name: name, withAsterisk: required, label: placeholder, placeholder: placeholder, data: listQuestion.map((l) => ({
|
|
2196
|
-
value: l.value,
|
|
2197
|
-
label: l.placeholder,
|
|
2198
|
-
})) }, formInputProps))));
|
|
2199
|
-
case LEADGEN_BLOCK.CheckboxBlock: {
|
|
2200
|
-
const formInputCheckboxProps = form.getInputProps(name, {
|
|
2201
|
-
type: 'checkbox',
|
|
2202
|
-
});
|
|
2203
|
-
return (React__default.createElement(ChoiceField$1, { className: "leadgen-form_input leadgen-form_input_checkbox", key: reactKey },
|
|
2204
|
-
isSendMailChimp && (React__default.createElement("div", { style: { display: 'none' }, "data-name": name + '-mailchimp' })),
|
|
2205
|
-
React__default.createElement(Checkbox$1.Group, Object.assign({ size: "md", withAsterisk: required, label: placeholder, value: value, sx: {
|
|
2206
|
-
display: 'flex',
|
|
2207
|
-
flexDirection: 'column',
|
|
2208
|
-
flexWrap: 'wrap',
|
|
2209
|
-
gap: 8,
|
|
2210
|
-
}, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, inputContainer: (children) => {
|
|
2211
|
-
return (React__default.createElement("div", { className: "leadgen-choiceContainer" }, children));
|
|
2212
|
-
} }, formInputCheckboxProps), listQuestion.map((l, _idx) => (React__default.createElement(Checkbox$1, { name: name, key: _idx, value: l.value, label: l.placeholder, "data-control": "checkbox" }))))));
|
|
2213
|
-
}
|
|
2214
|
-
case LEADGEN_BLOCK.RadioBlock: {
|
|
2215
|
-
return (React__default.createElement(ChoiceField$1, { className: "leadgen-form_input leadgen-form_input_checkbox", key: reactKey },
|
|
2216
|
-
isSendMailChimp && (React__default.createElement("div", { style: { display: 'none' }, "data-name": name + '-mailchimp' })),
|
|
2217
|
-
React__default.createElement(Radio$1.Group, Object.assign({ size: "md", withAsterisk: required, label: placeholder, value: value, spellCheck: true, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, inputContainer: (children) => {
|
|
2218
|
-
return (React__default.createElement("div", { className: "leadgen-choiceContainer" }, children));
|
|
2219
|
-
} }, formInputProps), listQuestion.map((l, _index) => (React__default.createElement(Radio$1, { name: name, key: _index, value: l.value, label: l.placeholder, "data-control": "radio" }))))));
|
|
2220
|
-
}
|
|
2221
|
-
case 'TncBlock':
|
|
2222
|
-
return (React__default.createElement(ChoiceField$1, { className: "leadgen-form_input leadgen-form_input_checkbox", key: reactKey },
|
|
2223
|
-
React__default.createElement(Input$1.Wrapper, { error: error },
|
|
2224
|
-
React__default.createElement(Checkbox$1, Object.assign({ value: value, name: 'TNC-' + id, label: React__default.createElement("p", { className: "lead-modal__tnc-link", dangerouslySetInnerHTML: { __html: valueHTML } }), className: "tnc-block", "data-control": "checkbox" }, formInputProps)))));
|
|
2225
|
-
default: {
|
|
2226
|
-
return null;
|
|
2227
|
-
}
|
|
2228
|
-
}
|
|
2229
|
-
}))));
|
|
2230
|
-
});
|
|
2231
|
-
|
|
2232
|
-
const LEADGEN_ORDER_INPUT_WRAPPER = ['label', 'input', 'description', 'error'];
|
|
2233
|
-
|
|
2234
|
-
const StyledLeadGenThankYou = styled.div `
|
|
2235
|
-
display: flex;
|
|
2236
|
-
gap: 8px;
|
|
2237
|
-
flex-direction: column;
|
|
2238
|
-
padding-block: 24px;
|
|
2239
|
-
|
|
2240
|
-
.leadgen-image {
|
|
2241
|
-
width: 120px;
|
|
2242
|
-
height: 120px;
|
|
2243
|
-
margin-inline: auto;
|
|
2244
|
-
object-fit: contain;
|
|
2245
|
-
object-position: center;
|
|
2246
|
-
text-align: center;
|
|
2247
|
-
}
|
|
2248
|
-
|
|
2249
|
-
.leadgen-title {
|
|
2250
|
-
margin-block: 0;
|
|
2251
|
-
color: ${theme.colors.gray900};
|
|
2252
|
-
font-weight: 700;
|
|
2253
|
-
font-size: 18px;
|
|
2254
|
-
line-height: 28px;
|
|
2255
|
-
letter-spacing: -0.2px;
|
|
2256
|
-
}
|
|
2257
|
-
|
|
2258
|
-
.leadgen-description {
|
|
2259
|
-
margin-block: 0;
|
|
2260
|
-
color: ${theme.colors.gray600};
|
|
2261
|
-
font-weight: 400;
|
|
2262
|
-
font-size: 14px;
|
|
2263
|
-
line-height: 22px;
|
|
2264
|
-
letter-spacing: -0.2px;
|
|
2265
|
-
text-align: center;
|
|
2266
|
-
}
|
|
2267
|
-
|
|
2268
|
-
> [data-align] {
|
|
2269
|
-
&[data-align='right'] {
|
|
2270
|
-
text-align: right;
|
|
2271
|
-
}
|
|
2272
|
-
&[data-align='center'] {
|
|
2273
|
-
text-align: center;
|
|
2274
|
-
}
|
|
2275
|
-
}
|
|
2276
|
-
`;
|
|
2277
|
-
const LeadGenThankYou = ({ image, title, description, showButton = false, button, className, style, }) => {
|
|
2278
|
-
const { src } = image;
|
|
2279
|
-
const { htmlText: titleText, align: titleAlign } = title;
|
|
2280
|
-
const { htmlText: descriptionText, align: descriptionAlign } = description;
|
|
2281
|
-
const { htmlText: buttonText, newtab, url, onClick } = button;
|
|
2282
|
-
return (React__default.createElement(StyledLeadGenThankYou, { className: className, style: style },
|
|
2283
|
-
React__default.createElement("img", { src: src, alt: "", className: "leadgen-thankyou_image leadgen-image" }),
|
|
2284
|
-
React__default.createElement("p", { className: "leadgen-thankyou_title leadgen-title", "data-align": titleAlign }, titleText),
|
|
2285
|
-
React__default.createElement("p", { className: "leadgen-thankyou_description leadgen-description", "data-align": descriptionAlign }, descriptionText),
|
|
2286
|
-
!!buttonText && showButton && (React__default.createElement(Button$2, { component: url ? 'a' : 'button', target: newtab ? '_blank' : undefined, href: url, size: "lg", variant: "filled", className: "leadgen-thankyoue_btn leadgen-btn", onClick: onClick }, buttonText))));
|
|
2287
|
-
};
|
|
2288
|
-
|
|
2289
|
-
const StyledLeadGenSubscriptionBoxBody = styled.div `
|
|
2290
|
-
margin-top: 16px;
|
|
2291
|
-
.leadgen-btn {
|
|
2292
|
-
margin-top: 16px;
|
|
2293
|
-
}
|
|
2294
|
-
`;
|
|
2295
|
-
const StyledLeadGenSubscriptionBoxHeaderImage = styled.div `
|
|
2296
|
-
margin-top: 3px;
|
|
2297
|
-
margin-right: 20px;
|
|
2298
|
-
width: 44px;
|
|
2299
|
-
height: 44px;
|
|
2300
|
-
|
|
2301
|
-
img {
|
|
2302
|
-
width: 100%;
|
|
2303
|
-
height: 100%;
|
|
2304
|
-
object-fix: contain;
|
|
2305
|
-
onject-position: center;
|
|
2306
|
-
}
|
|
2307
|
-
|
|
2308
|
-
:has(img[src='']) {
|
|
2309
|
-
display: none;
|
|
2310
|
-
}
|
|
2311
|
-
`;
|
|
2312
|
-
const StyledLeadGenSubscriptionBoxHeader = styled.div `
|
|
2313
|
-
display: flex;
|
|
2314
|
-
align-items: center;
|
|
2315
|
-
margin-bottom: 16px;
|
|
2316
|
-
.leadgen-title {
|
|
2317
|
-
margin-bottom: 0;
|
|
2318
|
-
flex: 1;
|
|
2319
|
-
min-width: 0;
|
|
2320
|
-
color: ${theme.colors.gray900};
|
|
2321
|
-
font-size: 18px;
|
|
2322
|
-
font-weight: 600;
|
|
2323
|
-
line-height: 1.4;
|
|
2324
|
-
letter-spacing: -0.8px;
|
|
2325
|
-
}
|
|
2326
|
-
`;
|
|
2327
|
-
const StyledLeadGenSubscriptionBox = styled.div `
|
|
2328
|
-
padding: 16px;
|
|
2329
|
-
border: 1px solid ${theme.colors.neutral100};
|
|
2330
|
-
border-radius: 12px;
|
|
2331
|
-
margin-inline: auto;
|
|
2332
|
-
.leadgen-form_inputs {
|
|
2333
|
-
.leadgen-form_input {
|
|
2334
|
-
width: 100%;
|
|
2335
|
-
}
|
|
2336
|
-
}
|
|
2337
|
-
|
|
2338
|
-
.leadgen-form_input {
|
|
2339
|
-
.mantine-Input-wrapper {
|
|
2340
|
-
max-height: 56px;
|
|
2341
|
-
}
|
|
2342
|
-
}
|
|
2343
|
-
|
|
2344
|
-
@media screen and (min-width: 768px) {
|
|
2345
|
-
.leadgen-subscription_box_body {
|
|
2346
|
-
display: flex;
|
|
2347
|
-
> form {
|
|
2348
|
-
flex: 1;
|
|
2349
|
-
min-width: 0;
|
|
2350
|
-
|
|
2351
|
-
.leadgen-form_inputs {
|
|
2352
|
-
.leadgen-form_input {
|
|
2353
|
-
width: calc(50% - 4px);
|
|
2354
|
-
}
|
|
2355
|
-
}
|
|
2356
|
-
}
|
|
2357
|
-
|
|
2358
|
-
.leadgen-btn {
|
|
2359
|
-
margin-top: 0;
|
|
2360
|
-
margin-left: 8px;
|
|
2361
|
-
width: auto;
|
|
2362
|
-
min-height: 56px;
|
|
2363
|
-
}
|
|
2364
|
-
}
|
|
2365
|
-
}
|
|
2366
|
-
`;
|
|
2367
|
-
const LeadGenSubscriptionBoxWithoutMemo = ({ locale, userInfo, siteId, siteDomain, forceCampaign, campaign_code, article_id, subscription_title: subscriptionTitleProps, }) => {
|
|
2368
|
-
var _a, _b, _c;
|
|
2369
|
-
const refContainer = useRef(null);
|
|
2370
|
-
const validatingEmailRef = useRef(false);
|
|
2371
|
-
const validatingPhoneRef = useRef(false);
|
|
2372
|
-
const { image, extra_fields, id: campaign_id, bot_id: campaign_subot_id = [], ThankYouBlock, } = forceCampaign || {};
|
|
2373
|
-
const { textBlocks, listBlockAdded, actionBlocks } = extra_fields || {};
|
|
2374
|
-
const { submitBlock } = actionBlocks || {};
|
|
2375
|
-
const [loading, setLoading] = useState(false);
|
|
2376
|
-
const [showThankyou, setShowThankyou] = useState(false);
|
|
2377
|
-
const formRef = useRef(null);
|
|
2378
|
-
const { form, validateObj } = useLeadFormConfig({
|
|
2379
|
-
listBlockAdded,
|
|
2380
|
-
campaignId: campaign_id,
|
|
2381
|
-
campaign_subot_id,
|
|
2382
|
-
validatingEmailRef,
|
|
2383
|
-
validatingPhoneRef,
|
|
2384
|
-
userInfo,
|
|
2385
|
-
});
|
|
2386
|
-
const subscription_title = useMemo(() => { var _a, _b; return subscriptionTitleProps || ((_b = (_a = textBlocks === null || textBlocks === void 0 ? void 0 : textBlocks.titleBlock) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.value); }, [subscriptionTitleProps, (_b = (_a = textBlocks === null || textBlocks === void 0 ? void 0 : textBlocks.titleBlock) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.value]);
|
|
2387
|
-
const { image: thankyouImage, title: thankyouTitle, description: thankyouDescription, button: thankyouButton, } = ThankYouBlock || {};
|
|
2388
|
-
const { apiUrl } = useMemo(() => {
|
|
2389
|
-
let apiUrl = leadStore.apiLeadUrl;
|
|
2390
|
-
if (apiUrl.includes('localhost')) {
|
|
2391
|
-
apiUrl = 'https://dev.leadgen.hellobacsi.com/';
|
|
2392
|
-
}
|
|
2393
|
-
return {
|
|
2394
|
-
apiUrl,
|
|
2395
|
-
};
|
|
2396
|
-
}, [siteDomain, siteId]);
|
|
2397
|
-
const url = useMemo(() => location.href.toLowerCase() || '', []);
|
|
2398
|
-
const article_title = useMemo(() => document.title || '', []);
|
|
2399
|
-
const cookie_id = useMemo(() => getCookie('hhg-id') || null, []);
|
|
2400
|
-
const ga_client_id = useMemo(() => getCookie('_ga') || null, []);
|
|
2401
|
-
const leadgenImpression = useCallback(() => {
|
|
2402
|
-
Service.campaignPostImpression({
|
|
2403
|
-
url,
|
|
2404
|
-
action: LEADGEN_ACTIONS.SCROLL,
|
|
2405
|
-
code: campaign_code,
|
|
2406
|
-
title_article: article_title,
|
|
2407
|
-
cookie_id,
|
|
2408
|
-
ga_client_id,
|
|
2409
|
-
extra: { cookie_id, article_id, subscription_title },
|
|
2410
|
-
});
|
|
2411
|
-
}, [
|
|
2412
|
-
article_id,
|
|
2413
|
-
article_title,
|
|
2414
|
-
cookie_id,
|
|
2415
|
-
ga_client_id,
|
|
2416
|
-
campaign_code,
|
|
2417
|
-
subscription_title,
|
|
2418
|
-
]);
|
|
2419
|
-
const intersectionObserverCallback = useCallback((entries) => {
|
|
2420
|
-
entries.forEach((entry) => {
|
|
2421
|
-
const { isIntersecting, target } = entry;
|
|
2422
|
-
if (isIntersecting && target === refContainer.current) {
|
|
2423
|
-
leadgenImpression();
|
|
2424
|
-
}
|
|
2425
|
-
});
|
|
2426
|
-
}, [leadgenImpression]);
|
|
2427
|
-
const IObserver = new IntersectionObserver(intersectionObserverCallback);
|
|
2428
|
-
const middlewareOnSubmit = useCallback((value) => __awaiter(void 0, void 0, void 0, function* () {
|
|
2429
|
-
const newValue = {
|
|
2430
|
-
url,
|
|
2431
|
-
article_title,
|
|
2432
|
-
cookie_id,
|
|
2433
|
-
ga_client_id,
|
|
2434
|
-
article_id,
|
|
2435
|
-
campaign_id,
|
|
2436
|
-
campaign_code,
|
|
2437
|
-
subscription_title: subscription_title,
|
|
2438
|
-
};
|
|
2439
|
-
listBlockAdded.forEach(({ data: { value: k } }) => {
|
|
2440
|
-
newValue[k] = value[k];
|
|
2441
|
-
});
|
|
2442
|
-
setLoading(true);
|
|
2443
|
-
try {
|
|
2444
|
-
const { _data } = (yield Service.campaignPostLead({ data: newValue })) || {};
|
|
2445
|
-
const { model } = _data;
|
|
2446
|
-
if (model && model.id) {
|
|
2447
|
-
setShowThankyou(true);
|
|
2448
|
-
}
|
|
2449
|
-
}
|
|
2450
|
-
catch (error) {
|
|
2451
|
-
console.log('** Error : ', error);
|
|
2452
|
-
}
|
|
2453
|
-
setLoading(false);
|
|
2454
|
-
}), [
|
|
2455
|
-
url,
|
|
2456
|
-
article_id,
|
|
2457
|
-
article_title,
|
|
2458
|
-
cookie_id,
|
|
2459
|
-
ga_client_id,
|
|
2460
|
-
campaign_code,
|
|
2461
|
-
subscription_title,
|
|
2462
|
-
listBlockAdded,
|
|
2463
|
-
]);
|
|
2464
|
-
useEffect(() => {
|
|
2465
|
-
if (refContainer.current) {
|
|
2466
|
-
IObserver.observe(refContainer.current);
|
|
2467
|
-
}
|
|
2468
|
-
return () => {
|
|
2469
|
-
IObserver.disconnect();
|
|
2470
|
-
};
|
|
2471
|
-
}, [
|
|
2472
|
-
url,
|
|
2473
|
-
article_id,
|
|
2474
|
-
article_title,
|
|
2475
|
-
ga_client_id,
|
|
2476
|
-
campaign_id,
|
|
2477
|
-
campaign_code,
|
|
2478
|
-
subscription_title,
|
|
2479
|
-
]);
|
|
2480
|
-
return (React__default.createElement("div", { ref: refContainer },
|
|
2481
|
-
React__default.createElement(StyledLeadGenSubscriptionBox, null,
|
|
2482
|
-
showThankyou && (React__default.createElement(LeadGenThankYou, { image: Object.assign(Object.assign({}, thankyouImage), { src: thankyouImage.src || `${apiUrl}admin/img/thanksyou.png` }), title: thankyouTitle, description: thankyouDescription, button: thankyouButton })),
|
|
2483
|
-
!showThankyou && (React__default.createElement(React__default.Fragment, null,
|
|
2484
|
-
React__default.createElement(StyledLeadGenSubscriptionBoxHeader, null,
|
|
2485
|
-
!!image && (React__default.createElement(StyledLeadGenSubscriptionBoxHeaderImage, null,
|
|
2486
|
-
React__default.createElement("img", { src: image, alt: "" }))),
|
|
2487
|
-
React__default.createElement("p", { className: "leadgen-title" }, subscription_title)),
|
|
2488
|
-
React__default.createElement(StyledLeadGenSubscriptionBoxBody, { className: "leadgen-subscription_box_body" },
|
|
2489
|
-
React__default.createElement(LeadGenForm, { ref: formRef, form: form, rules: validateObj, blocks: listBlockAdded, locale: locale, onFinish: middlewareOnSubmit }),
|
|
2490
|
-
React__default.createElement(Button$2, { disabled: loading, loading: loading, variant: "filled", size: "lg", onClick: () => { var _a; return (_a = formRef.current) === null || _a === void 0 ? void 0 : _a.submit(); }, className: "leadgen-btn leadgen-btn_action", fullWidth: true }, (_c = submitBlock === null || submitBlock === void 0 ? void 0 : submitBlock.data) === null || _c === void 0 ? void 0 : _c.value)))))));
|
|
2491
|
-
};
|
|
2492
|
-
const LeadGenSubscriptionBoxWithMemo = memo(LeadGenSubscriptionBoxWithoutMemo);
|
|
2493
|
-
|
|
2494
|
-
const Container = () => {
|
|
2495
|
-
const context = useContext(LeadGenSubscriptionBoxContext);
|
|
2496
|
-
const {
|
|
2497
|
-
// apiUrl: apiUrlProps,
|
|
2498
|
-
// apiSubotUrl,
|
|
2499
|
-
campaign_code, article_id, subscription_title, locale, siteId, siteDomain, userInfo, forceCampaign, } = context;
|
|
2500
|
-
if (!forceCampaign || !(forceCampaign === null || forceCampaign === void 0 ? void 0 : forceCampaign.id)) {
|
|
2501
|
-
return null;
|
|
2502
|
-
}
|
|
2503
|
-
return (React__default.createElement(LeadGenSubscriptionBoxWithMemo, { locale: locale, userInfo: userInfo, siteId: siteId, siteDomain: siteDomain, forceCampaign: forceCampaign, campaign_code: campaign_code, article_id: article_id, subscription_title: subscription_title }));
|
|
2504
|
-
};
|
|
2505
|
-
Container.displayName = 'LeadGenSubscriptionBox';
|
|
2506
|
-
const LeadGenSubscriptionBoxContainer = (props) => {
|
|
2507
|
-
const { campaign_code } = props;
|
|
2508
|
-
if (!campaign_code) {
|
|
2509
|
-
return null;
|
|
2510
|
-
}
|
|
2511
|
-
return (React__default.createElement(LeadGenSubscriptionBoxProvider, Object.assign({}, props),
|
|
2512
|
-
React__default.createElement(Container, null)));
|
|
2513
|
-
};
|
|
2514
|
-
const LeadGenSubscriptionBox = LeadGenSubscriptionBoxContainer;
|
|
2515
|
-
|
|
2516
|
-
const useImageSize = (src) => {
|
|
2517
|
-
const [width, setWidth] = useState(16);
|
|
2518
|
-
const [height, setHeight] = useState(9);
|
|
2519
|
-
const [loaded, setLoaded] = useState(false);
|
|
2520
|
-
// load src image to get its width and height
|
|
2521
|
-
useEffect(() => {
|
|
2522
|
-
setLoaded(false);
|
|
2523
|
-
if (src) {
|
|
2524
|
-
const img = new Image();
|
|
2525
|
-
img.addEventListener('load', () => {
|
|
2526
|
-
setWidth(img.naturalWidth);
|
|
2527
|
-
setHeight(img.naturalHeight);
|
|
2528
|
-
setLoaded(true);
|
|
2529
|
-
});
|
|
2530
|
-
img.addEventListener('error', () => {
|
|
2531
|
-
setWidth(16);
|
|
2532
|
-
setHeight(9);
|
|
2533
|
-
setLoaded(true);
|
|
2534
|
-
});
|
|
2535
|
-
img.src = src;
|
|
2536
|
-
}
|
|
2537
|
-
else {
|
|
2538
|
-
setWidth(16);
|
|
2539
|
-
setHeight(9);
|
|
2540
|
-
setLoaded(true);
|
|
2541
|
-
}
|
|
2542
|
-
}, [src]);
|
|
2543
|
-
return {
|
|
2544
|
-
loaded,
|
|
2545
|
-
width,
|
|
2546
|
-
height,
|
|
2547
|
-
};
|
|
2548
|
-
};
|
|
2549
|
-
|
|
2550
|
-
const CloseButton = ({ onClose, containerClassName, svgClassName, }) => (React__default.createElement("button", { onClick: onClose, className: `le-newbuilder-close-button js-modal__close ${containerClassName || ''}` },
|
|
2551
|
-
React__default.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 20 20", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", className: svgClassName },
|
|
2552
|
-
React__default.createElement("path", { d: "M9.99981 10.8432L14.0583 14.9017C14.1691 15.0125 14.3083 15.0691 14.476 15.0717C14.6437 15.0743 14.7854 15.0176 14.9013 14.9017C15.0172 14.7858 15.0752 14.6453 15.0752 14.4802C15.0752 14.3151 15.0172 14.1746 14.9013 14.0587L10.8429 10.0002L14.9013 5.9417C15.0121 5.83094 15.0688 5.69172 15.0713 5.52402C15.0739 5.35634 15.0172 5.21456 14.9013 5.09866C14.7854 4.98276 14.6449 4.9248 14.4798 4.9248C14.3147 4.9248 14.1742 4.98276 14.0583 5.09866L9.99981 9.15712L5.94133 5.09866C5.83057 4.98789 5.69135 4.93122 5.52365 4.92866C5.35598 4.92609 5.21419 4.98276 5.09829 5.09866C4.98239 5.21456 4.92444 5.35506 4.92444 5.52018C4.92444 5.6853 4.98239 5.82581 5.09829 5.9417L9.15675 10.0002L5.09829 14.0587C4.98752 14.1694 4.93085 14.3087 4.9283 14.4763C4.92572 14.644 4.98239 14.7858 5.09829 14.9017C5.21419 15.0176 5.3547 15.0756 5.51982 15.0756C5.68493 15.0756 5.82544 15.0176 5.94133 14.9017L9.99981 10.8432Z" }))));
|
|
1372
|
+
const CloseButton = ({ onClose, containerClassName, svgClassName, }) => (React__default.createElement("button", { onClick: onClose, className: `le-newbuilder-close-button js-modal__close ${containerClassName || ''}` },
|
|
1373
|
+
React__default.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 20 20", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", className: svgClassName },
|
|
1374
|
+
React__default.createElement("path", { d: "M9.99981 10.8432L14.0583 14.9017C14.1691 15.0125 14.3083 15.0691 14.476 15.0717C14.6437 15.0743 14.7854 15.0176 14.9013 14.9017C15.0172 14.7858 15.0752 14.6453 15.0752 14.4802C15.0752 14.3151 15.0172 14.1746 14.9013 14.0587L10.8429 10.0002L14.9013 5.9417C15.0121 5.83094 15.0688 5.69172 15.0713 5.52402C15.0739 5.35634 15.0172 5.21456 14.9013 5.09866C14.7854 4.98276 14.6449 4.9248 14.4798 4.9248C14.3147 4.9248 14.1742 4.98276 14.0583 5.09866L9.99981 9.15712L5.94133 5.09866C5.83057 4.98789 5.69135 4.93122 5.52365 4.92866C5.35598 4.92609 5.21419 4.98276 5.09829 5.09866C4.98239 5.21456 4.92444 5.35506 4.92444 5.52018C4.92444 5.6853 4.98239 5.82581 5.09829 5.9417L9.15675 10.0002L5.09829 14.0587C4.98752 14.1694 4.93085 14.3087 4.9283 14.4763C4.92572 14.644 4.98239 14.7858 5.09829 14.9017C5.21419 15.0176 5.3547 15.0756 5.51982 15.0756C5.68493 15.0756 5.82544 15.0176 5.94133 14.9017L9.99981 10.8432Z" }))));
|
|
2553
1375
|
|
|
2554
1376
|
// url: imageBlocks.imageMobile.data.url
|
|
2555
1377
|
// newTab: imageBlocks.imageMobile.data.newtab
|
|
@@ -2794,6 +1616,211 @@ const EmptyComponent = ({ onClose, onContinue, }) => {
|
|
|
2794
1616
|
React__default.createElement(Button$2, { onClick: onContinue, size: "lg", variant: "filled", fullWidth: false, className: "leadgen-btn leadgen-btn_empty_again" }, t('lead.empty.submitAgain')))));
|
|
2795
1617
|
};
|
|
2796
1618
|
|
|
1619
|
+
const libraries = ['places'];
|
|
1620
|
+
const GoogleLocationBlock = (props) => {
|
|
1621
|
+
var _a;
|
|
1622
|
+
const { inputWrapperOrder = ['label', 'input', 'description', 'error'], defaultValue, value: valueProps, onChange: onChangeProps, locale } = props, restProps = __rest(props, ["inputWrapperOrder", "defaultValue", "value", "onChange", "locale"]);
|
|
1623
|
+
const [LoadScript, setLoadScript] = useState(null);
|
|
1624
|
+
const [value, setValue] = useState(defaultValue || valueProps);
|
|
1625
|
+
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]);
|
|
1626
|
+
const onChangeAutocomplete = useCallback((s) => {
|
|
1627
|
+
setValue(s);
|
|
1628
|
+
onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(s);
|
|
1629
|
+
}, []);
|
|
1630
|
+
const onClickItem = useCallback((item) => {
|
|
1631
|
+
/** For sure get value */
|
|
1632
|
+
setValue(item.value);
|
|
1633
|
+
const predCur = predictions === null || predictions === void 0 ? void 0 : predictions.find(({ description }) => description === item.value);
|
|
1634
|
+
onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(item.value, predCur === null || predCur === void 0 ? void 0 : predCur.rawData);
|
|
1635
|
+
}, [onChangeProps, predictions]);
|
|
1636
|
+
useEffect(() => {
|
|
1637
|
+
setValue(valueProps);
|
|
1638
|
+
}, [valueProps]);
|
|
1639
|
+
useEffect(() => {
|
|
1640
|
+
var _a, _b, _c;
|
|
1641
|
+
// only load extra google script when not yet loaded
|
|
1642
|
+
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) {
|
|
1643
|
+
import('@react-google-maps/api').then((m) => {
|
|
1644
|
+
setLoadScript(() => m.LoadScript);
|
|
1645
|
+
});
|
|
1646
|
+
}
|
|
1647
|
+
}, []);
|
|
1648
|
+
return (React__default.createElement(Autocomplete, Object.assign({ defaultValue: defaultValue, value: value, onChange: onChangeAutocomplete, data: predictions.map((pred) => {
|
|
1649
|
+
return { value: pred.description, label: pred.description };
|
|
1650
|
+
}), filter: () => true, onItemSubmit: onClickItem, inputWrapperOrder: inputWrapperOrder, zIndex: ZINDEX_SSO - 9e6 + 2, withinPortal: true, styles: { dropdown: { pointerEvents: 'auto' } }, inputContainer: (children) => {
|
|
1651
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
1652
|
+
LoadScript && (React__default.createElement(LoadScript, { googleMapsApiKey: GOOGLE_API_KEY, libraries: libraries, loadingElement: React__default.createElement(React__default.Fragment, null), style: { width: '100%' } })),
|
|
1653
|
+
children));
|
|
1654
|
+
} }, restProps)));
|
|
1655
|
+
};
|
|
1656
|
+
|
|
1657
|
+
// You can give context variables any name
|
|
1658
|
+
const [LeadFormProvider, useLeadFormContext, useLeadForm] = createFormContext();
|
|
1659
|
+
const useLeadFormConfig = ({ listBlockAdded = [], validatingPhoneRef, validatingEmailRef, campaignId, campaign_subot_id = [], userInfo, }) => {
|
|
1660
|
+
const { t } = useTranslations();
|
|
1661
|
+
const initialValues = useMemo(() => mappingSSOToLead(userInfo), [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
|
|
1662
|
+
const validateObj = useMemo(() => {
|
|
1663
|
+
const InputBlocks = [
|
|
1664
|
+
'TextBlock',
|
|
1665
|
+
'NumberBlock',
|
|
1666
|
+
'EmailBlock',
|
|
1667
|
+
'PhoneBlock',
|
|
1668
|
+
'DateBlock',
|
|
1669
|
+
'CheckboxBlock',
|
|
1670
|
+
'RadioBlock',
|
|
1671
|
+
'DropdownBlock',
|
|
1672
|
+
'PhoneOtpBlock',
|
|
1673
|
+
'WhatsappOtpBlock',
|
|
1674
|
+
'ZaloOtpBlock',
|
|
1675
|
+
'LocationBlock',
|
|
1676
|
+
'TncBlock',
|
|
1677
|
+
];
|
|
1678
|
+
// ALL are required and can skip if not touched yet
|
|
1679
|
+
const withSharedCheck = (name, cb,
|
|
1680
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1681
|
+
block) => {
|
|
1682
|
+
return (value) => {
|
|
1683
|
+
var _a;
|
|
1684
|
+
const isBLockRequired = (_a = block === null || block === void 0 ? void 0 : block.data) === null || _a === void 0 ? void 0 : _a.required;
|
|
1685
|
+
if (!formRef.current.isTouched(name))
|
|
1686
|
+
return;
|
|
1687
|
+
if ((typeof value === 'string' && value.replace(' ', '') === '') ||
|
|
1688
|
+
typeof value === 'undefined' ||
|
|
1689
|
+
value === '' ||
|
|
1690
|
+
(Array.isArray(value) && value.length === 0)) {
|
|
1691
|
+
return isBLockRequired
|
|
1692
|
+
? t('validator.required')
|
|
1693
|
+
: cb === null || cb === void 0 ? void 0 : cb(value);
|
|
1694
|
+
}
|
|
1695
|
+
return cb === null || cb === void 0 ? void 0 : cb(value);
|
|
1696
|
+
};
|
|
1697
|
+
};
|
|
1698
|
+
return listBlockAdded
|
|
1699
|
+
.filter((b) => InputBlocks.includes(b.name))
|
|
1700
|
+
.reduce((r, b) => {
|
|
1701
|
+
var _a;
|
|
1702
|
+
const isRequired = (_a = b.data.required) !== null && _a !== void 0 ? _a : true;
|
|
1703
|
+
if (b.name === 'NumberBlock') {
|
|
1704
|
+
return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
|
|
1705
|
+
if (value && isNaN(Number(value))) {
|
|
1706
|
+
return t('validator.number');
|
|
1707
|
+
}
|
|
1708
|
+
}, b) });
|
|
1709
|
+
}
|
|
1710
|
+
else if (b.name === 'EmailBlock') {
|
|
1711
|
+
return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
|
|
1712
|
+
if (value && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) {
|
|
1713
|
+
return t('validator.email');
|
|
1714
|
+
}
|
|
1715
|
+
if (!value)
|
|
1716
|
+
return;
|
|
1717
|
+
validatingEmailRef.current = true;
|
|
1718
|
+
setTimeout(() => {
|
|
1719
|
+
formRef.current.setFieldError(b.data.value, 'Validating...');
|
|
1720
|
+
checkUsedEmailOrPhoneWithCache(campaignId, campaign_subot_id, {
|
|
1721
|
+
email: value,
|
|
1722
|
+
})
|
|
1723
|
+
.then((tKey) => {
|
|
1724
|
+
if (tKey) {
|
|
1725
|
+
formRef.current.setFieldError(b.data.value, t(tKey));
|
|
1726
|
+
}
|
|
1727
|
+
else {
|
|
1728
|
+
formRef.current.clearFieldError(b.data.value);
|
|
1729
|
+
}
|
|
1730
|
+
validatingEmailRef.current = false;
|
|
1731
|
+
})
|
|
1732
|
+
.catch((e) => {
|
|
1733
|
+
console.error(e);
|
|
1734
|
+
formRef.current.setFieldError(b.data.value, e.message || 'Something went wrong');
|
|
1735
|
+
validatingEmailRef.current = false;
|
|
1736
|
+
});
|
|
1737
|
+
}, 200);
|
|
1738
|
+
}, b) });
|
|
1739
|
+
}
|
|
1740
|
+
else if (b.name === 'PhoneBlock' ||
|
|
1741
|
+
b.name === 'PhoneOtpBlock' ||
|
|
1742
|
+
b.name === 'ZaloOtpBlock' ||
|
|
1743
|
+
b.name === 'WhatsappOtpBlock') {
|
|
1744
|
+
return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
|
|
1745
|
+
if (value &&
|
|
1746
|
+
window.intlTelInputUtils &&
|
|
1747
|
+
!window.intlTelInputUtils.isValidNumber(String(value), LEAD_LOCALE.countryCode)) {
|
|
1748
|
+
return t('validator.phone');
|
|
1749
|
+
}
|
|
1750
|
+
if (!value)
|
|
1751
|
+
return;
|
|
1752
|
+
validatingPhoneRef.current = true;
|
|
1753
|
+
setTimeout(() => {
|
|
1754
|
+
formRef.current.setFieldError(b.data.value, 'Validating...');
|
|
1755
|
+
if (b.data.singleSubmission) {
|
|
1756
|
+
checkUsedPhoneOnlyWithCache(campaignId, value)
|
|
1757
|
+
.then((tKey) => {
|
|
1758
|
+
if (tKey) {
|
|
1759
|
+
formRef.current.setFieldError(b.data.value, t(tKey));
|
|
1760
|
+
}
|
|
1761
|
+
else {
|
|
1762
|
+
formRef.current.clearFieldError(b.data.value);
|
|
1763
|
+
}
|
|
1764
|
+
validatingPhoneRef.current = false;
|
|
1765
|
+
})
|
|
1766
|
+
.catch((err) => {
|
|
1767
|
+
console.error(err);
|
|
1768
|
+
formRef.current.setFieldError(b.data.value, err.message || 'Something went wrong');
|
|
1769
|
+
validatingPhoneRef.current = false;
|
|
1770
|
+
});
|
|
1771
|
+
}
|
|
1772
|
+
else {
|
|
1773
|
+
checkUsedEmailOrPhoneWithCache(campaignId, campaign_subot_id, {
|
|
1774
|
+
phone: value,
|
|
1775
|
+
})
|
|
1776
|
+
.then((tKey) => {
|
|
1777
|
+
if (tKey) {
|
|
1778
|
+
formRef.current.setFieldError(b.data.value, t(tKey));
|
|
1779
|
+
}
|
|
1780
|
+
else {
|
|
1781
|
+
formRef.current.clearFieldError(b.data.value);
|
|
1782
|
+
}
|
|
1783
|
+
validatingPhoneRef.current = false;
|
|
1784
|
+
})
|
|
1785
|
+
.catch((e) => {
|
|
1786
|
+
console.error(e);
|
|
1787
|
+
formRef.current.setFieldError(b.data.value, e.message || 'Something went wrong');
|
|
1788
|
+
validatingPhoneRef.current = false;
|
|
1789
|
+
});
|
|
1790
|
+
}
|
|
1791
|
+
}, 200);
|
|
1792
|
+
}, b) });
|
|
1793
|
+
}
|
|
1794
|
+
else if (b.name === 'DateBlock') {
|
|
1795
|
+
return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
|
|
1796
|
+
if (value && isNaN(Date.parse(value))) {
|
|
1797
|
+
return t('validator.date');
|
|
1798
|
+
}
|
|
1799
|
+
}, b) });
|
|
1800
|
+
}
|
|
1801
|
+
else if (b.name === 'TncBlock') {
|
|
1802
|
+
return Object.assign(Object.assign({}, r), { [`TNC-` + b.id]: withSharedCheck('TNC-' + b.id, (value) => {
|
|
1803
|
+
if (isRequired && !value) {
|
|
1804
|
+
return t('validator.required');
|
|
1805
|
+
}
|
|
1806
|
+
}, b) });
|
|
1807
|
+
}
|
|
1808
|
+
else {
|
|
1809
|
+
return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, undefined, b) });
|
|
1810
|
+
}
|
|
1811
|
+
}, {});
|
|
1812
|
+
}, [listBlockAdded.map((b) => b.name).join(',')]);
|
|
1813
|
+
const form = useLeadForm({
|
|
1814
|
+
validateInputOnChange: true,
|
|
1815
|
+
clearInputErrorOnChange: true,
|
|
1816
|
+
validate: validateObj,
|
|
1817
|
+
initialValues,
|
|
1818
|
+
});
|
|
1819
|
+
const formRef = useRef(form);
|
|
1820
|
+
formRef.current = form;
|
|
1821
|
+
return { form, validateObj };
|
|
1822
|
+
};
|
|
1823
|
+
|
|
2797
1824
|
const SubtitleBlock = ({ children, align, }) => (React__default.createElement("p", { className: `lead-modal__description ${'le-text-align-' + (align || '')} ${LEAD_CLASS}` }, children));
|
|
2798
1825
|
|
|
2799
1826
|
const cssInputNotShrink = css `
|
|
@@ -2964,14 +1991,6 @@ const StyledTextFieldContainer = styled.div `
|
|
|
2964
1991
|
}
|
|
2965
1992
|
}
|
|
2966
1993
|
|
|
2967
|
-
&:focus-within {
|
|
2968
|
-
.mantine-Input-wrapper {
|
|
2969
|
-
transition: 0.25s linear border;
|
|
2970
|
-
border-color: ${theme.colors.primary600};
|
|
2971
|
-
box-shadow: 0 0 4px ${theme.colors.primary200};
|
|
2972
|
-
}
|
|
2973
|
-
}
|
|
2974
|
-
|
|
2975
1994
|
.PhoneInput {
|
|
2976
1995
|
--phone-select: 75px;
|
|
2977
1996
|
--phone-input-space-x: 8px;
|
|
@@ -3120,13 +2139,11 @@ const TextField = (props) => {
|
|
|
3120
2139
|
const $focusEl = $textEl.item($textEl.length - 1);
|
|
3121
2140
|
if ($focusEl) {
|
|
3122
2141
|
$focusEl.focus();
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
});
|
|
3129
|
-
}, 100);
|
|
2142
|
+
$focusEl.scrollIntoView({
|
|
2143
|
+
behavior: 'auto',
|
|
2144
|
+
block: 'center',
|
|
2145
|
+
inline: 'start',
|
|
2146
|
+
});
|
|
3130
2147
|
}
|
|
3131
2148
|
}, [shrink]);
|
|
3132
2149
|
useEffect(() => {
|
|
@@ -3143,14 +2160,8 @@ const ChoiceField = (props) => {
|
|
|
3143
2160
|
const TitleBlock = ({ children, align, }) => (React__default.createElement("h2", { className: `lead-modal__title ${'le-text-align-' + (align || '')} ${LEAD_CLASS}` }, children));
|
|
3144
2161
|
|
|
3145
2162
|
const LightboxFields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmit, }) => {
|
|
3146
|
-
const { t } = useTranslations();
|
|
3147
2163
|
const form = useLeadFormContext();
|
|
3148
2164
|
const formValues = form.values;
|
|
3149
|
-
const labelTuples = useMemo(() => {
|
|
3150
|
-
return ((ISO_FORMAT === null || ISO_FORMAT === void 0 ? void 0 : ISO_FORMAT[locale]) || ISO_FORMAT['vi-VN']).dateFormat
|
|
3151
|
-
.split('/')
|
|
3152
|
-
.map((key) => { var _a; return t((_a = COMMON_DATE_TRANSLATE_KEY === null || COMMON_DATE_TRANSLATE_KEY === void 0 ? void 0 : COMMON_DATE_TRANSLATE_KEY[key]) === null || _a === void 0 ? void 0 : _a.id); });
|
|
3153
|
-
}, [locale]);
|
|
3154
2165
|
return (React__default.createElement(React__default.Fragment, null, listBlockAdded.map((b, index) => {
|
|
3155
2166
|
var _a;
|
|
3156
2167
|
const { name = '', data = {}, id } = b || {};
|
|
@@ -3200,11 +2211,13 @@ const LightboxFields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmi
|
|
|
3200
2211
|
return (React__default.createElement(TextField, { key: index, shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field" },
|
|
3201
2212
|
React__default.createElement(GoogleLocationBlock, Object.assign({ withAsterisk: required, name: value, placeholder: placeholder, label: placeholder, "data-control": "text", locale: locale, inputWrapperOrder: ['label', 'input', 'description', 'error'] }, form.getInputProps(value)))));
|
|
3202
2213
|
}
|
|
3203
|
-
case 'DateBlock':
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
2214
|
+
case 'DateBlock':
|
|
2215
|
+
return (React__default.createElement(TextField, { key: index, shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field" },
|
|
2216
|
+
React__default.createElement(DatePicker, Object.assign({ clearable: true, withAsterisk: required, type: "default", name: value, placeholder: placeholder, label: placeholder, inputWrapperOrder: ['label', 'input', 'description', 'error'], inputContainer: (children) => {
|
|
2217
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
2218
|
+
children,
|
|
2219
|
+
React__default.createElement("input", { type: "hidden", "data-control": "date", name: value, value: formValue })));
|
|
2220
|
+
} }, form.getInputProps(value)))));
|
|
3208
2221
|
case 'LinkButtonBlock':
|
|
3209
2222
|
return (React__default.createElement("div", { key: index },
|
|
3210
2223
|
React__default.createElement("a", { target: newtab ? 'blank' : 'parrent', href: url, style: { textDecoration: 'none' } },
|
|
@@ -3247,7 +2260,7 @@ const LightboxFields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmi
|
|
|
3247
2260
|
label: l.placeholder,
|
|
3248
2261
|
})) }, form.getInputProps(value)))));
|
|
3249
2262
|
case 'TncBlock':
|
|
3250
|
-
const
|
|
2263
|
+
const _c = form.getInputProps(`TNC-${id}`), { error } = _c, tncInputProps = __rest(_c, ["error"]);
|
|
3251
2264
|
return (React__default.createElement(ChoiceField, { className: "leadgen-form_checkbox", key: id },
|
|
3252
2265
|
React__default.createElement(Input$1.Wrapper, { error: error },
|
|
3253
2266
|
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)))));
|
|
@@ -3497,7 +2510,7 @@ const LEADGEN_SHOW_HEADER = [
|
|
|
3497
2510
|
LEADGEN_LAYOUT.Slider,
|
|
3498
2511
|
];
|
|
3499
2512
|
const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSubmit, imageMobile, imageDesktop, imageOverlayMobile, imageOverlayDesktop, imageBackground, currentLayout, title, onSubmit, showThankyou, campaignId, campaign_subot_id, locale, showEmpty, setShowEmpty, userInfo, }) => {
|
|
3500
|
-
var _a
|
|
2513
|
+
var _a;
|
|
3501
2514
|
const { isMobile } = useScreenSize();
|
|
3502
2515
|
const [open, setOpen] = useState(!!campaignId);
|
|
3503
2516
|
const [showOtpPhone, setShowOtpPhone] = useState(null);
|
|
@@ -3530,7 +2543,7 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
3530
2543
|
const isDrawer = isLightBoxB && isMobile;
|
|
3531
2544
|
const limitFieldsLightBoxB = isLightBoxB && listBlockAdded.length <= LEADGEN_LIMIT_LIGHTBOXB;
|
|
3532
2545
|
const hasForm = isLightBoxA
|
|
3533
|
-
? listBlockAdded.some((item) =>
|
|
2546
|
+
? listBlockAdded.some((item) => LEADGEN_BLOCK_IN_FORM.some((k) => k === (item === null || item === void 0 ? void 0 : item.name)))
|
|
3534
2547
|
: true;
|
|
3535
2548
|
const headerInsideFormContainer = isSlider || isLightBoxA || isFullscreen;
|
|
3536
2549
|
const showHeader = !!imageMobile || !!imageDesktop;
|
|
@@ -3559,25 +2572,14 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
3559
2572
|
campaignId,
|
|
3560
2573
|
campaign_subot_id,
|
|
3561
2574
|
userInfo,
|
|
3562
|
-
format: (_a = (ISO_FORMAT[locale] || ISO_FORMAT['vi-VN'])) === null || _a === void 0 ? void 0 : _a.dateFormat,
|
|
3563
2575
|
});
|
|
3564
|
-
const onFocus = (e) => {
|
|
3565
|
-
const target = e.target;
|
|
3566
|
-
target.scrollIntoView({
|
|
3567
|
-
block: 'center',
|
|
3568
|
-
inline: 'nearest',
|
|
3569
|
-
behavior: 'auto',
|
|
3570
|
-
});
|
|
3571
|
-
};
|
|
3572
2576
|
const middlewareOnSubmit = (e) => {
|
|
3573
2577
|
e.preventDefault();
|
|
3574
2578
|
// mark all as touched to allow validation
|
|
3575
|
-
|
|
3576
|
-
const fieldStatus = fields.reduce((acc, cur) => {
|
|
2579
|
+
form.setTouched(Object.keys(validateObj).reduce((acc, cur) => {
|
|
3577
2580
|
acc[cur] = true;
|
|
3578
2581
|
return acc;
|
|
3579
|
-
}, {});
|
|
3580
|
-
form.setTouched(fieldStatus);
|
|
2582
|
+
}, {}));
|
|
3581
2583
|
if (validatingEmailRef.current || validatingPhoneRef.current) {
|
|
3582
2584
|
return;
|
|
3583
2585
|
}
|
|
@@ -3652,10 +2654,7 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
3652
2654
|
const renderAfterImageSizes = imageMobileLoaded &&
|
|
3653
2655
|
imageDesktopLoaded &&
|
|
3654
2656
|
(isFullscreen ? imageBackgroundLoaded : true);
|
|
3655
|
-
const ButtonSubmit =
|
|
3656
|
-
var _a;
|
|
3657
|
-
return !((_a = actionBlocks === null || actionBlocks === void 0 ? void 0 : actionBlocks.submitBlock) === null || _a === void 0 ? void 0 : _a.isHide) && (React__default.createElement(Button$2, { size: "lg", id: "lead-submit", type: "submit", variant: "filled", className: "leadgen-btn leadgen-btn_action", loading: isSubmitLoading }, popUpSubmitText));
|
|
3658
|
-
}, [popUpSubmitText, isSubmitLoading, (_b = actionBlocks === null || actionBlocks === void 0 ? void 0 : actionBlocks.submitBlock) === null || _b === void 0 ? void 0 : _b.isHide]);
|
|
2657
|
+
const ButtonSubmit = !((_a = actionBlocks === null || actionBlocks === void 0 ? void 0 : actionBlocks.submitBlock) === null || _a === void 0 ? void 0 : _a.isHide) && (React__default.createElement(Button$2, { size: "lg", id: "lead-submit", type: "submit", variant: "filled", className: "leadgen-btn leadgen-btn_action", loading: isSubmitLoading }, popUpSubmitText));
|
|
3659
2658
|
const LinkButtonBlock = listBlockAdded.filter(({ name }) => name == LEADGEN_BLOCK.LinkButtonBlock);
|
|
3660
2659
|
const ButtonLink = !!(LinkButtonBlock === null || LinkButtonBlock === void 0 ? void 0 : LinkButtonBlock.length) && (React__default.createElement(React__default.Fragment, null, LinkButtonBlock.map((item, index) => {
|
|
3661
2660
|
var _a, _b, _c;
|
|
@@ -3669,7 +2668,7 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
3669
2668
|
React__default.createElement(HeaderImage, { src: imageMobile, className: "le-only-mobile lead-modal__image" })))));
|
|
3670
2669
|
const PopupEmpty = showEmpty && (React__default.createElement(EmptyComponent, { onClose: onClose, onContinue: () => setShowEmpty(false) }));
|
|
3671
2670
|
const PopupForm = (React__default.createElement(LeadFormProvider, { form: form },
|
|
3672
|
-
React__default.createElement("form", { ref: formRef, className: "leadgen-form",
|
|
2671
|
+
React__default.createElement("form", { ref: formRef, className: "leadgen-form", onSubmit: middlewareOnSubmit },
|
|
3673
2672
|
React__default.createElement(FormContainer, { title: title, titleAlign: titleAlign, description: description, descriptionAlign: descriptionAlign, header: headerInsideFormContainer && PopupHeader, footer: hasForm ? ButtonSubmit : ButtonLink, "data-hidden-form": !hasForm },
|
|
3674
2673
|
React__default.createElement("div", { className: "leadgen-form_inner" },
|
|
3675
2674
|
React__default.createElement(LightboxFields, { listBlockAdded: listBlockAdded, popupId: popupId, locale: locale, onClose: onClose, onOtherSubmit: onOtherSubmit }))))));
|
|
@@ -4588,4 +3587,4 @@ LeadGen.Thankyou = Thankyou;
|
|
|
4588
3587
|
LeadGen.OtpForm = OtpBlock$1;
|
|
4589
3588
|
LeadGen.Close = Close;
|
|
4590
3589
|
|
|
4591
|
-
export { LeadGen
|
|
3590
|
+
export { LeadGen };
|