@hhgtech/hhg-components 1.29.361-beta-1 → 1.29.362
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/{LastPeriod-1e3a4dd6.js → LastPeriod-eb5cfea6.js} +1 -1
- package/build/{MobileBottomNavigationIcon-5916f647.js → MobileBottomNavigationIcon-1c8f1782.js} +3 -3
- package/build/{Spinner-e0f2304c.js → Spinner-b9257ddf.js} +1 -1
- package/build/{WhatsApp-e9a27204.js → WhatsApp-b20d8887.js} +1 -1
- package/build/adapters.js +19 -19
- package/build/atoms.js +47 -47
- 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/inputDate/InputDate.d.ts +19 -0
- package/build/components/atoms/inputDate/InputDate.helpers.d.ts +11 -0
- package/build/{esm/lead/LeadGenForm/LeadGenForm.styled.d.ts → components/atoms/inputDate/InputDate.styled.d.ts} +1 -1
- package/build/components/atoms/inputDate/index.d.ts +1 -0
- package/build/components/atoms/inputMB/index.styled.d.ts +2 -2
- package/build/components/navigationV2/components/molecules/navigationBar/index.styled.d.ts +0 -2
- package/build/components/navigationV2/hooks/useNavConfig.d.ts +0 -1
- package/build/components/navigationV2/types.d.ts +1 -1
- package/build/components.js +96 -96
- package/build/{constants-cb5c4ca3.js → constants-bf5a6242.js} +1 -1
- package/build/constants.js +3 -3
- package/build/constantsDomainLocales.js +1 -1
- package/build/constantsRiskScreener.js +2 -2
- package/build/constantsSite.js +2 -2
- package/build/{core-729539d7.js → core-fc1b679c.js} +1 -1
- package/build/{dataTransform-e9ed2437.js → dataTransform-99aef06b.js} +1 -1
- package/build/ecom.js +4 -4
- package/build/{editor-1212f5b8.js → editor-0234fb2f.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/{LastPeriod-b71490c0.js → LastPeriod-e8d99ec6.js} +1 -1
- package/build/esm/{MobileBottomNavigationIcon-8d94f4ba.js → MobileBottomNavigationIcon-5f4ee3f4.js} +3 -3
- package/build/esm/{Spinner-99c2fbb3.js → Spinner-6ffe5c0f.js} +1 -1
- package/build/esm/{WhatsApp-3c65161b.js → WhatsApp-1c55868a.js} +1 -1
- package/build/esm/adapters.js +19 -19
- package/build/esm/atoms.js +47 -47
- 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/inputDate/InputDate.d.ts +19 -0
- package/build/esm/components/atoms/inputDate/InputDate.helpers.d.ts +11 -0
- package/build/{lead/LeadGenForm/LeadGenForm.styled.d.ts → esm/components/atoms/inputDate/InputDate.styled.d.ts} +1 -1
- package/build/esm/components/atoms/inputDate/index.d.ts +1 -0
- package/build/esm/components/atoms/inputMB/index.styled.d.ts +2 -2
- package/build/esm/components/navigationV2/components/molecules/navigationBar/index.styled.d.ts +0 -2
- package/build/esm/components/navigationV2/hooks/useNavConfig.d.ts +0 -1
- package/build/esm/components/navigationV2/types.d.ts +1 -1
- package/build/esm/components.js +96 -96
- package/build/esm/{constants-6341499d.js → constants-343513d8.js} +1 -1
- package/build/esm/constants.js +3 -3
- package/build/esm/constantsDomainLocales.js +1 -1
- package/build/esm/constantsRiskScreener.js +2 -2
- package/build/esm/constantsSite.js +2 -2
- package/build/esm/{core-d24c8960.js → core-d9fb3c8c.js} +1 -1
- package/build/esm/{dataTransform-6beebce6.js → dataTransform-fa355ead.js} +1 -1
- package/build/esm/ecom.js +4 -4
- package/build/esm/{editor-7870b558.js → editor-8c46a4c4.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-8680cb70.js → healthTools-4cffe096.js} +1 -1
- package/build/esm/healthToolsCardWrapper.js +18 -18
- package/build/esm/healthToolsForm.js +33 -33
- package/build/esm/hooks/useCSSFocusPopupHelper.d.ts +0 -1
- package/build/esm/hooks.js +13 -13
- package/build/esm/i18n.js +2 -2
- package/build/esm/i18nV2.js +2 -2
- package/build/esm/{index-90a2d72f.js → index-004e7f99.js} +2 -2
- package/build/esm/{index-49eb323b.js → index-02b8ada7.js} +3 -3
- package/build/esm/{index-cef28d7c.js → index-02e3a578.js} +6 -6
- package/build/esm/{index-96226c21.js → index-0e0b8184.js} +11 -18
- package/build/esm/{index-00bc9d15.js → index-11c1e9b1.js} +1 -1
- package/build/esm/{index-47f7f864.js → index-1a18f0d3.js} +1 -1
- package/build/esm/{index-3df28aa1.js → index-1bd2d4fd.js} +7 -7
- package/build/esm/{index-5b92c467.js → index-1c7f348a.js} +1 -1
- package/build/esm/{index-b10ca0ad.js → index-1fb033dd.js} +16 -16
- package/build/esm/{index-fbcbb083.js → index-1fd51a1e.js} +3 -3
- package/build/esm/{index-e7579fcb.js → index-264f679d.js} +15 -15
- package/build/esm/{index-f2dc7079.js → index-2d4afd18.js} +13 -13
- package/build/esm/{index-5c846d71.js → index-2d8c745d.js} +1 -1
- package/build/esm/{index-1ffb599d.js → index-2e1e583c.js} +25 -25
- package/build/esm/{index-062c5976.js → index-33f74b99.js} +2 -2
- package/build/esm/{index-a39f198f.js → index-345a0cd5.js} +16 -16
- package/build/esm/{index-a6744510.js → index-34e46c3b.js} +2 -2
- package/build/esm/{index-7955003f.js → index-3504643c.js} +2 -2
- package/build/esm/{index-becd0fee.js → index-3cb8cb4b.js} +1 -1
- package/build/esm/{index-e37b41df.js → index-3d551854.js} +21 -21
- package/build/esm/{index-ed02b87c.js → index-4157d466.js} +6 -6
- package/build/esm/{index-9c3b5959.js → index-41831dd2.js} +42 -69
- package/build/esm/{index-fbfb2e92.js → index-419ed52f.js} +2 -2
- package/build/esm/{index-0974a308.js → index-423a6b89.js} +6 -6
- package/build/esm/{index-5db02d1c.js → index-4364ba68.js} +13 -13
- package/build/esm/{index-1246e4a4.js → index-4b4487ff.js} +3 -3
- package/build/esm/{index-bf09e2d4.js → index-4df7bd0e.js} +2 -2
- package/build/esm/{index-94209fbe.js → index-4ea9c741.js} +3 -3
- package/build/esm/{index-b4f08356.js → index-4eb912b7.js} +22 -22
- package/build/esm/{index-a04a8089.js → index-5b2d87c3.js} +13 -13
- package/build/esm/{index-9f08c7df.js → index-61d13d80.js} +1 -1
- package/build/esm/{index-90c0bea0.js → index-65c29124.js} +18 -18
- package/build/esm/{index-a7c56e5d.js → index-69598671.js} +2 -2
- package/build/esm/{index-d146d365.js → index-6c04281f.js} +2 -2
- package/build/esm/{index-17775f87.js → index-6ecbccef.js} +1 -1
- package/build/esm/{index-86fffcc8.js → index-6f2df485.js} +17 -17
- package/build/esm/{index-e2aff6a8.js → index-71a0ce1b.js} +3 -3
- package/build/esm/{index-086be20d.js → index-74bc8897.js} +31 -31
- package/build/esm/{index-bba05381.js → index-765bca50.js} +13 -13
- package/build/esm/{index-88daf0a5.js → index-7665c530.js} +16 -16
- package/build/esm/{index-c7d8ff21.js → index-77f49076.js} +2 -2
- package/build/esm/{index-63222337.js → index-7c39e7fe.js} +6 -6
- package/build/esm/{index-35515a70.js → index-7dfd3707.js} +16 -16
- package/build/esm/{index-ce4c988c.js → index-7e805ed6.js} +5 -5
- package/build/esm/{index-8a6a9b40.js → index-7fe3b2e9.js} +6 -6
- package/build/esm/{index-d2f8052d.js → index-85965d53.js} +32 -32
- package/build/esm/{index-cbe15386.js → index-8b789e0b.js} +17 -17
- package/build/esm/{index-a43b7dd3.js → index-8d885690.js} +3 -3
- package/build/esm/{index-c0198e4a.js → index-90917b32.js} +17 -17
- package/build/esm/{index-ad569b96.js → index-93f05cbd.js} +1 -1
- package/build/esm/{index-84d7459b.js → index-98df08d3.js} +1 -1
- package/build/esm/{index-70435256.js → index-9b470a3d.js} +16 -16
- package/build/esm/{index-8ec915a3.js → index-a0ef2f51.js} +11 -11
- package/build/esm/{index-1d1047ac.js → index-a7ef127e.js} +2 -2
- package/build/esm/{index-10f5873c.js → index-ab71391f.js} +2 -2
- package/build/esm/{index-767d3f92.js → index-b61495a6.js} +18 -18
- package/build/esm/{index-a4e847bc.js → index-c167c204.js} +2 -2
- package/build/esm/{index-2b8cedcb.js → index-c17eb826.js} +2 -2
- package/build/esm/{index-032bf5cb.js → index-c57e9049.js} +24 -24
- package/build/esm/{index-c5d9bd94.js → index-cba80946.js} +5 -5
- package/build/esm/{index-c044e2d8.js → index-cd0bc16f.js} +4 -4
- package/build/esm/{index-416d4906.js → index-cf3b66bf.js} +10 -10
- package/build/esm/{index-e011bbd8.js → index-e9206ea6.js} +2 -2
- package/build/esm/{index-d1946a8e.js → index-f4d43595.js} +7 -7
- package/build/esm/index.js +117 -117
- package/build/esm/{labelSorting-9f03dd6c.js → labelSorting-abc38cd3.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/services/index.d.ts +0 -14
- package/build/esm/lead.js +303 -1226
- package/build/esm/{logoIcon-54c7a908.js → logoIcon-63898b50.js} +2 -2
- package/build/esm/mantine.js +25 -25
- package/build/esm/misc.js +17 -17
- package/build/esm/miscGetDynamicHealthTool.js +4 -4
- package/build/esm/miscGetSocialList.js +8 -8
- package/build/esm/miscScreenSizeContext.js +1 -1
- package/build/esm/mobileBottomNavigation.js +5 -5
- package/build/esm/mobileBottomNavigationIcon.js +5 -5
- package/build/esm/molecules.js +74 -74
- package/build/esm/moleculesArticleCard.js +6 -6
- package/build/esm/moleculesArticleCardV2.js +16 -16
- package/build/esm/navigation.js +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-4a3ff1a0.js → post-aca2b953.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-129e3fcb.js → store-55bc0306.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-7fdbaefb.js → surveyThankyouCard-dea7be18.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-7dea0335.js → treePopoverMenu-958e524b.js} +19 -19
- package/build/esm/{types-d3becc85.js → types-079b1d47.js} +2 -2
- package/build/esm/types.js +2 -2
- package/build/esm/{useCategory-a751e6bf.js → useCategory-455d8510.js} +5 -5
- package/build/esm/{useHealthToolCache-e5f37e0e.js → useHealthToolCache-1db108ec.js} +1 -1
- package/build/esm/{useMantineLocale-55437870.js → useMantineLocale-1d78bb2f.js} +6 -6
- package/build/esm/{usePlacesAutocomplete-76552e60.js → usePlacesAutocomplete-ba00126b.js} +1 -1
- package/build/esm/{useScreenSize-5dfcff9a.js → useScreenSize-245884d6.js} +2 -2
- package/build/esm/useTogetherAuthRequiredAction.js +9 -9
- package/build/esm/{utils-6fdbff97.js → utils-5b23c988.js} +2 -2
- package/build/esm/{utils-fc818da7.js → utils-69c2b171.js} +4 -4
- package/build/esm/{utils-084b7803.js → utils-951a523a.js} +2 -2
- package/build/esm/{utils-ceaf71c3.js → utils-fb814a53.js} +3 -3
- package/build/esm/vaccination.js +21 -21
- package/build/footer.js +21 -21
- package/build/gAssets.js +2 -2
- package/build/{healthTools-9faecef9.js → healthTools-8d4d21e8.js} +1 -1
- package/build/healthToolsCardWrapper.js +18 -18
- package/build/healthToolsForm.js +33 -33
- package/build/hooks/useCSSFocusPopupHelper.d.ts +0 -1
- package/build/hooks.js +13 -13
- package/build/i18n.js +1 -1
- package/build/i18nV2.js +1 -1
- package/build/{index-be199de9.js → index-045c0fb5.js} +2 -2
- package/build/{index-7c60ded5.js → index-06d8f4c6.js} +1 -1
- package/build/{index-588a71af.js → index-167e1ca6.js} +1 -1
- package/build/{index-6f508c09.js → index-17b8cc3b.js} +2 -2
- package/build/{index-7b782643.js → index-1ad6dabc.js} +16 -16
- package/build/{index-4095bae8.js → index-1e69287b.js} +2 -2
- package/build/{index-2959b04f.js → index-1e9e3c74.js} +15 -15
- package/build/{index-9cb679a6.js → index-24dfd213.js} +2 -2
- package/build/{index-c02e8354.js → index-2a91877d.js} +1 -1
- package/build/{index-627013fa.js → index-369fc772.js} +6 -6
- package/build/{index-67e41baa.js → index-3b8a44be.js} +2 -2
- package/build/{index-77cc52a0.js → index-4896bce9.js} +31 -31
- package/build/{index-a3320154.js → index-54decaa7.js} +16 -16
- package/build/{index-8733048c.js → index-5cd23f1e.js} +16 -16
- package/build/{index-24ce1942.js → index-6025ae75.js} +6 -6
- package/build/{index-b1f5562e.js → index-61c62e0f.js} +3 -3
- package/build/{index-be46ed0e.js → index-6528e7a9.js} +24 -24
- package/build/{index-217ba3eb.js → index-652b939b.js} +21 -21
- package/build/{index-40fcfd89.js → index-684bf9d8.js} +3 -3
- package/build/{index-865b4577.js → index-6881089f.js} +1 -1
- package/build/{index-2913a22f.js → index-6cb86f78.js} +11 -11
- package/build/{index-8b27bc8b.js → index-6de5d67e.js} +16 -16
- package/build/{index-c5328c6c.js → index-6e720c8f.js} +4 -4
- package/build/{index-0962a6b0.js → index-74e3f2df.js} +2 -2
- package/build/{index-e2e56d71.js → index-80d7b6b7.js} +13 -13
- package/build/{index-41572306.js → index-80d944f3.js} +13 -13
- package/build/{index-a1afcde7.js → index-81ce2d77.js} +13 -13
- package/build/{index-732d54c4.js → index-82b1fba7.js} +25 -25
- package/build/{index-b2f7e794.js → index-8e577b03.js} +6 -6
- package/build/{index-8c4675ad.js → index-8f7ccbb3.js} +1 -1
- package/build/{index-adc245ae.js → index-90b88af0.js} +3 -3
- package/build/{index-6bc0c7a2.js → index-9115b007.js} +2 -2
- package/build/{index-f253a38c.js → index-93c19a42.js} +5 -5
- package/build/{index-3b018bf8.js → index-95159081.js} +3 -3
- package/build/{index-cc2bed5e.js → index-99d339ff.js} +17 -17
- package/build/{index-2bd8cfe6.js → index-9e62bfa0.js} +3 -3
- package/build/{index-5f898245.js → index-9eccde6f.js} +2 -2
- package/build/{index-82070fc5.js → index-9f31bdf3.js} +2 -2
- package/build/{index-1af4d972.js → index-a7e501b8.js} +3 -3
- package/build/{index-43aac258.js → index-a8c2eeb9.js} +13 -13
- package/build/{index-f8050d0a.js → index-ae5aa3a2.js} +18 -18
- package/build/{index-802178e4.js → index-b2826d24.js} +6 -6
- package/build/{index-bee470e8.js → index-b9e15de3.js} +2 -2
- package/build/{index-7857ab1f.js → index-bc1e7b8f.js} +42 -69
- package/build/{index-f71d9ef2.js → index-c0b7233b.js} +22 -22
- package/build/{index-73f1e2a5.js → index-c6ed23e0.js} +2 -2
- package/build/{index-d66e037f.js → index-cb5353f3.js} +32 -32
- package/build/{index-710cf66d.js → index-cd8cdac0.js} +2 -2
- package/build/{index-6b66b710.js → index-cde3684e.js} +5 -5
- package/build/{index-b4c4e2f6.js → index-cf24b488.js} +17 -17
- package/build/{index-a3751eb3.js → index-cf5ab11f.js} +7 -7
- package/build/{index-2b809d10.js → index-d4f98d06.js} +16 -16
- package/build/{index-d69b410f.js → index-dad75e0a.js} +2 -2
- package/build/{index-4cb6d92f.js → index-e502976f.js} +17 -17
- package/build/{index-6e62f595.js → index-e9c7436a.js} +1 -1
- package/build/{index-3160778e.js → index-e9f022f9.js} +11 -18
- package/build/{index-678e9f82.js → index-e9fb386a.js} +2 -2
- package/build/{index-b789cdea.js → index-eafbbe5d.js} +6 -6
- package/build/{index-ef09c144.js → index-eb61030b.js} +10 -10
- package/build/{index-3954cdd0.js → index-ef154db0.js} +1 -1
- package/build/{index-450a27f3.js → index-f0827e71.js} +7 -7
- package/build/{index-5ea60ab5.js → index-f3a871c5.js} +1 -1
- package/build/{index-36820903.js → index-f68d8f40.js} +1 -1
- package/build/{index-fe813a71.js → index-f987d8ac.js} +18 -18
- package/build/index.js +117 -117
- package/build/{labelSorting-7550b906.js → labelSorting-cdab818b.js} +4 -4
- package/build/lead/helpers.d.ts +1 -51
- package/build/lead/index.d.ts +1 -2
- package/build/lead/services/index.d.ts +0 -14
- package/build/lead.js +303 -1227
- package/build/{logoIcon-2198a6cf.js → logoIcon-0e2a19d8.js} +2 -2
- package/build/mantine.js +22 -22
- package/build/misc.js +17 -17
- package/build/miscGetDynamicHealthTool.js +4 -4
- package/build/miscGetSocialList.js +8 -8
- package/build/miscScreenSizeContext.js +1 -1
- package/build/mobileBottomNavigation.js +5 -5
- package/build/mobileBottomNavigationIcon.js +5 -5
- package/build/molecules.js +74 -74
- package/build/moleculesArticleCard.js +6 -6
- package/build/moleculesArticleCardV2.js +16 -16
- package/build/navigation.js +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-2c5aae3d.js → post-cd894bd5.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-dd807202.js → store-f713fb4f.js} +4 -4
- package/build/subot.js +34 -34
- package/build/surveyOrPremiumBanner.js +32 -32
- package/build/surveyQuestionCard.js +10 -10
- package/build/{surveyThankyouCard-71fd8153.js → surveyThankyouCard-1d7606f1.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-c32f6666.js → treePopoverMenu-a243163c.js} +19 -19
- package/build/{types-27d92fe1.js → types-5a9f59b9.js} +2 -2
- package/build/types.js +2 -2
- package/build/{useCategory-db7ef553.js → useCategory-52540c0e.js} +5 -5
- package/build/{useHealthToolCache-44b62d5b.js → useHealthToolCache-0c768f4c.js} +1 -1
- package/build/{useMantineLocale-8146a689.js → useMantineLocale-b8a79d56.js} +6 -6
- package/build/{usePlacesAutocomplete-d46f3a91.js → usePlacesAutocomplete-23fb3031.js} +1 -1
- package/build/{useScreenSize-7b8652ca.js → useScreenSize-7806176e.js} +2 -2
- package/build/useTogetherAuthRequiredAction.js +9 -9
- package/build/{utils-5570c388.js → utils-4ee2cb9c.js} +4 -4
- package/build/{utils-c203ac13.js → utils-54be35b1.js} +3 -3
- package/build/{utils-2b62f9f5.js → utils-a2cd3f70.js} +2 -2
- package/build/{utils-21fc3d78.js → utils-e6efa11e.js} +2 -2
- package/build/vaccination.js +21 -21
- package/package.json +3 -3
- package/build/components/mantine/phoneInput/PhoneInput.d.ts +0 -15
- package/build/components/mantine/phoneInput/index.d.ts +0 -1
- package/build/esm/components/mantine/phoneInput/PhoneInput.d.ts +0 -15
- package/build/esm/components/mantine/phoneInput/index.d.ts +0 -1
- package/build/esm/lead/LeadGenForm/LeadGenForm.d.ts +0 -41
- package/build/esm/lead/LeadGenForm/LeadGenThankYou.d.ts +0 -20
- package/build/esm/lead/LeadGenForm/index.d.ts +0 -1
- 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/lead/LeadGenForm/LeadGenForm.d.ts +0 -41
- package/build/lead/LeadGenForm/LeadGenThankYou.d.ts +0 -20
- package/build/lead/LeadGenForm/index.d.ts +0 -1
- 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-f83d0242.js → BMI_BOYS.percentile.monthly-7bd9cca9.js} +0 -0
- /package/build/{BMI_BOYS.percentile.weekly-db859897.js → BMI_BOYS.percentile.weekly-821e86aa.js} +0 -0
- /package/build/{BMI_BOYS.percentile.yearly-0a039425.js → BMI_BOYS.percentile.yearly-1ce7e28b.js} +0 -0
- /package/build/{BMI_BOYS.zscore.monthly-b82f9313.js → BMI_BOYS.zscore.monthly-d5358fcc.js} +0 -0
- /package/build/{BMI_BOYS.zscore.weekly-cf458186.js → BMI_BOYS.zscore.weekly-ff90aead.js} +0 -0
- /package/build/{BMI_BOYS.zscore.yearly-23633ed6.js → BMI_BOYS.zscore.yearly-381df8e7.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.monthly-a195d3e8.js → BMI_GIRLS.percentile.monthly-6b514dd8.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.weekly-26a0e155.js → BMI_GIRLS.percentile.weekly-ba4fca15.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.yearly-72a13496.js → BMI_GIRLS.percentile.yearly-a1eafb9e.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.monthly-71ea5c36.js → BMI_GIRLS.zscore.monthly-2d5679c7.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.weekly-c3b5a41d.js → BMI_GIRLS.zscore.weekly-820e90ba.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.yearly-cfc420b0.js → BMI_GIRLS.zscore.yearly-93be0423.js} +0 -0
- /package/build/{ChevronDown-ccfd21a6.js → ChevronDown-8db65738.js} +0 -0
- /package/build/{Close-4bdc25d9.js → Close-6f1a29c2.js} +0 -0
- /package/build/{Google-32f6e9ae.js → Google-b3858fb2.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-c7425207.js → HEAD CIRCUM_BOYS.percentile.monthly-c6537dae.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-11bbd192.js → HEAD CIRCUM_BOYS.percentile.weekly-a9409c76.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-85dfe539.js → HEAD CIRCUM_BOYS.percentile.yearly-fcb76bd5.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-7d1301a5.js → HEAD CIRCUM_BOYS.zscore.monthly-088cfc6b.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-497aa967.js → HEAD CIRCUM_BOYS.zscore.weekly-e85d79b9.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-9322e349.js → HEAD CIRCUM_BOYS.zscore.yearly-26396c15.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-13e1c2c2.js → HEAD CIRCUM_GIRLS.percentile.monthly-466e611e.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-0940db8b.js → HEAD CIRCUM_GIRLS.percentile.weekly-3884eef6.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-b91da0f0.js → HEAD CIRCUM_GIRLS.percentile.yearly-bdb12ec2.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-56cbba76.js → HEAD CIRCUM_GIRLS.zscore.monthly-1414b5bb.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-ba6755bf.js → HEAD CIRCUM_GIRLS.zscore.weekly-ecca5443.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-35e6a30c.js → HEAD CIRCUM_GIRLS.zscore.yearly-b83f13da.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.monthly-34d3fdc4.js → HEIGHT_BOYS.percentile.monthly-757826fd.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.weekly-a3eaff24.js → HEIGHT_BOYS.percentile.weekly-7d469cc8.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.yearly-d2444c3f.js → HEIGHT_BOYS.percentile.yearly-436a8da0.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.monthly-f8be0c41.js → HEIGHT_BOYS.zscore.monthly-c606ab30.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.weekly-8dbb3814.js → HEIGHT_BOYS.zscore.weekly-b567ca19.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.yearly-1b27b566.js → HEIGHT_BOYS.zscore.yearly-2b101282.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.monthly-e43bf4a8.js → HEIGHT_GIRLS.percentile.monthly-3834b792.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.weekly-63128c3e.js → HEIGHT_GIRLS.percentile.weekly-b0cb287b.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.yearly-8568f0a9.js → HEIGHT_GIRLS.percentile.yearly-78a93718.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.monthly-2c215347.js → HEIGHT_GIRLS.zscore.monthly-5ba760ed.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.weekly-15ce8d55.js → HEIGHT_GIRLS.zscore.weekly-a1bcb8c5.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.yearly-f02101c0.js → HEIGHT_GIRLS.zscore.yearly-500a14ff.js} +0 -0
- /package/build/{Locale-bd59384d.js → Locale-8424b413.js} +0 -0
- /package/build/{Visible-92287ae1.js → Visible-047d1970.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.monthly-3c53ce2b.js → WEIGHT_BOYS.percentile.monthly-df68990f.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.weekly-0b4dfdc1.js → WEIGHT_BOYS.percentile.weekly-b022cb25.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.yearly-7e0f4e61.js → WEIGHT_BOYS.percentile.yearly-5d8ca4e9.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.monthly-a847e3b8.js → WEIGHT_BOYS.zscore.monthly-9a645a93.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.weekly-73e11170.js → WEIGHT_BOYS.zscore.weekly-509ec466.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.yearly-9ac3acb2.js → WEIGHT_BOYS.zscore.yearly-a0c4faae.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.monthly-ecb9c9d9.js → WEIGHT_GIRLS.percentile.monthly-33cb1313.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.weekly-8b2d126a.js → WEIGHT_GIRLS.percentile.weekly-ac0690b5.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.yearly-80d6691d.js → WEIGHT_GIRLS.percentile.yearly-0b68de4d.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.monthly-2b5cc87c.js → WEIGHT_GIRLS.zscore.monthly-51cd36f2.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.weekly-eb17366f.js → WEIGHT_GIRLS.zscore.weekly-7e18c745.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.yearly-3813bf19.js → WEIGHT_GIRLS.zscore.yearly-e14b0b34.js} +0 -0
- /package/build/{animation-c368926c.js → animation-fcea7611.js} +0 -0
- /package/build/{constants-29fd5d65.js → constants-346f1e34.js} +0 -0
- /package/build/{constants-bd2e9a70.js → constants-a79017ab.js} +0 -0
- /package/build/{constants-78c956e4.js → constants-b5640ab3.js} +0 -0
- /package/build/{dataTransform-98f1dd92.js → dataTransform-64ef46ac.js} +0 -0
- /package/build/{doctor-09a95c49.js → doctor-9bed311e.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.monthly-e380fd79.js → BMI_BOYS.percentile.monthly-ffa66b36.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.weekly-55f8a9cf.js → BMI_BOYS.percentile.weekly-ac9a5856.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.yearly-8ef771b4.js → BMI_BOYS.percentile.yearly-902f0b93.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.monthly-b4cd99ce.js → BMI_BOYS.zscore.monthly-d5849e19.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.weekly-2f51eed4.js → BMI_BOYS.zscore.weekly-6178c788.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.yearly-4388a844.js → BMI_BOYS.zscore.yearly-2ff5db4d.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.monthly-79579370.js → BMI_GIRLS.percentile.monthly-7f857304.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.weekly-4325a562.js → BMI_GIRLS.percentile.weekly-9b81d7a8.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.yearly-80cb63c3.js → BMI_GIRLS.percentile.yearly-854701a4.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.monthly-75a23515.js → BMI_GIRLS.zscore.monthly-9ffe688d.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.weekly-404ae543.js → BMI_GIRLS.zscore.weekly-58e51b14.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.yearly-21af74ac.js → BMI_GIRLS.zscore.yearly-98018354.js} +0 -0
- /package/build/esm/{ChevronDown-8dc4a472.js → ChevronDown-1e80d818.js} +0 -0
- /package/build/esm/{Close-92688f4f.js → Close-218e750a.js} +0 -0
- /package/build/esm/{Google-cffaa0bb.js → Google-370a6f1a.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-628a2084.js → HEAD CIRCUM_BOYS.percentile.monthly-9120321c.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-3abb626a.js → HEAD CIRCUM_BOYS.percentile.weekly-d4a8532e.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-ef24237d.js → HEAD CIRCUM_BOYS.percentile.yearly-a9210cf2.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-7a2680b3.js → HEAD CIRCUM_BOYS.zscore.monthly-4c111e5c.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-906eed27.js → HEAD CIRCUM_BOYS.zscore.weekly-651972ff.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-24cce7f9.js → HEAD CIRCUM_BOYS.zscore.yearly-fec03c75.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-392f3c6d.js → HEAD CIRCUM_GIRLS.percentile.monthly-3dc39954.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-85724b5f.js → HEAD CIRCUM_GIRLS.percentile.weekly-49da4f7f.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-f5b3ea5f.js → HEAD CIRCUM_GIRLS.percentile.yearly-91d18834.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-51af5ab5.js → HEAD CIRCUM_GIRLS.zscore.monthly-db82e848.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-05c3f036.js → HEAD CIRCUM_GIRLS.zscore.weekly-0fb52b88.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-72a30df5.js → HEAD CIRCUM_GIRLS.zscore.yearly-a2db290d.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.monthly-6e5a2f2d.js → HEIGHT_BOYS.percentile.monthly-6e710248.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.weekly-efd39949.js → HEIGHT_BOYS.percentile.weekly-3fb3fe32.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.yearly-0c99b795.js → HEIGHT_BOYS.percentile.yearly-9a5f599a.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.monthly-182ec26e.js → HEIGHT_BOYS.zscore.monthly-b46ef65d.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.weekly-ca821dc5.js → HEIGHT_BOYS.zscore.weekly-952421e8.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.yearly-d4b55d1e.js → HEIGHT_BOYS.zscore.yearly-a01537be.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-d732f78f.js → HEIGHT_GIRLS.percentile.monthly-f8d50e2a.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-1f8ac2b4.js → HEIGHT_GIRLS.percentile.weekly-b9120261.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-aab892cd.js → HEIGHT_GIRLS.percentile.yearly-87951788.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-966d7757.js → HEIGHT_GIRLS.zscore.monthly-b92ea262.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-9d6152fe.js → HEIGHT_GIRLS.zscore.weekly-30900806.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-beb3f557.js → HEIGHT_GIRLS.zscore.yearly-a1b819bb.js} +0 -0
- /package/build/esm/{Locale-d2c107b5.js → Locale-23142efe.js} +0 -0
- /package/build/esm/{Visible-04146e00.js → Visible-4de68fea.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.monthly-a0ad8d73.js → WEIGHT_BOYS.percentile.monthly-bedc7af5.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.weekly-1ff70d05.js → WEIGHT_BOYS.percentile.weekly-79bed6e4.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.yearly-b5c7f873.js → WEIGHT_BOYS.percentile.yearly-df4f20d6.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.monthly-83b9c79f.js → WEIGHT_BOYS.zscore.monthly-9659fdeb.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.weekly-aed9472c.js → WEIGHT_BOYS.zscore.weekly-ea4c0332.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.yearly-5c0bafcf.js → WEIGHT_BOYS.zscore.yearly-02ea0da7.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-3c54cdc8.js → WEIGHT_GIRLS.percentile.monthly-d39d355c.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-a726acfa.js → WEIGHT_GIRLS.percentile.weekly-a0c92336.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-81e7c09b.js → WEIGHT_GIRLS.percentile.yearly-ec031e52.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-fd6bf4be.js → WEIGHT_GIRLS.zscore.monthly-fc78e900.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-8a4e2b0b.js → WEIGHT_GIRLS.zscore.weekly-bf56ff58.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-57ad5159.js → WEIGHT_GIRLS.zscore.yearly-1c519e0d.js} +0 -0
- /package/build/esm/{animation-2c87bd05.js → animation-4e80d44f.js} +0 -0
- /package/build/esm/{constants-25a0420c.js → constants-7e8a9103.js} +0 -0
- /package/build/esm/{constants-7b1877ec.js → constants-9df11f36.js} +0 -0
- /package/build/esm/{constants-deeb4d52.js → constants-fc431ad1.js} +0 -0
- /package/build/esm/{dataTransform-de91215a.js → dataTransform-d489f6a8.js} +0 -0
- /package/build/esm/{doctor-e90b52ca.js → doctor-3d4909a0.js} +0 -0
- /package/build/esm/{index-c2209669.js → index-0167ffe4.js} +0 -0
- /package/build/esm/{index-a0a30c17.js → index-0a460405.js} +0 -0
- /package/build/esm/{index-e74f696a.js → index-1ae63c79.js} +0 -0
- /package/build/esm/{index-d9c00d74.js → index-4f082205.js} +0 -0
- /package/build/esm/{index-ed8a21dd.js → index-4fadd89c.js} +0 -0
- /package/build/esm/{index-50a50724.js → index-9f9fa32d.js} +0 -0
- /package/build/esm/{index-a8ca5aeb.js → index-d50723f9.js} +0 -0
- /package/build/esm/{index-6f1aba31.js → index-fa4aed4f.js} +0 -0
- /package/build/esm/{index-7843fb5f.js → index-fbf3c6e1.js} +0 -0
- /package/build/esm/{index.styles-cdf78679.js → index.styles-756b61f3.js} +0 -0
- /package/build/esm/{localizeNumberFormat-8c01e2ef.js → localizeNumberFormat-2d28ab00.js} +0 -0
- /package/build/esm/{normalizeLink-f1c2f1a6.js → normalizeLink-6b1a2f2a.js} +0 -0
- /package/build/esm/{number-643052be.js → number-49291c9b.js} +0 -0
- /package/build/esm/{other-c0cc5584.js → other-9f3c0383.js} +0 -0
- /package/build/esm/{paths-4737ee59.js → paths-eefeda8b.js} +0 -0
- /package/build/esm/{translationsContext-045786e4.js → translationsContext-feb0f31b.js} +0 -0
- /package/build/esm/{tslib.es6-913c164a.js → tslib.es6-2571f98c.js} +0 -0
- /package/build/esm/{types-08548ac0.js → types-043c25d4.js} +0 -0
- /package/build/esm/{useIsInit-7fe00a6e.js → useIsInit-86319274.js} +0 -0
- /package/build/esm/{useOutsideClick-2c1abf56.js → useOutsideClick-9225f4e5.js} +0 -0
- /package/build/esm/{useScrollbarSize-4a361956.js → useScrollbarSize-f614e3bf.js} +0 -0
- /package/build/esm/{useUniqueId-dc775b08.js → useUniqueId-31d70d4b.js} +0 -0
- /package/build/esm/{utils-cea86c7b.js → utils-213d1bf3.js} +0 -0
- /package/build/{index-6bfb59f4.js → index-17063ec3.js} +0 -0
- /package/build/{index-bfa5c241.js → index-20253671.js} +0 -0
- /package/build/{index-cc012b11.js → index-2f650ddf.js} +0 -0
- /package/build/{index-175813bc.js → index-52b55bf6.js} +0 -0
- /package/build/{index-4b72e83e.js → index-76bc8ed0.js} +0 -0
- /package/build/{index-59472ea2.js → index-af3a7e2b.js} +0 -0
- /package/build/{index-5a138fcc.js → index-d95a2116.js} +0 -0
- /package/build/{index-fdf38e42.js → index-f8312234.js} +0 -0
- /package/build/{index-0e1942ed.js → index-feab9a46.js} +0 -0
- /package/build/{index.styles-89ab190d.js → index.styles-ff03980e.js} +0 -0
- /package/build/{localizeNumberFormat-07e9360c.js → localizeNumberFormat-b36cb8e4.js} +0 -0
- /package/build/{normalizeLink-28d21e3a.js → normalizeLink-3c8a02ba.js} +0 -0
- /package/build/{number-af276dca.js → number-f0767903.js} +0 -0
- /package/build/{other-763dcd40.js → other-6c620bcf.js} +0 -0
- /package/build/{paths-c76a3551.js → paths-86f60a67.js} +0 -0
- /package/build/{translationsContext-98a72507.js → translationsContext-776c1d5f.js} +0 -0
- /package/build/{tslib.es6-db3140a3.js → tslib.es6-b6754243.js} +0 -0
- /package/build/{types-95744672.js → types-7694bb3e.js} +0 -0
- /package/build/{useIsInit-81cd34a6.js → useIsInit-4ff2343b.js} +0 -0
- /package/build/{useOutsideClick-e738361b.js → useOutsideClick-572163cd.js} +0 -0
- /package/build/{useScrollbarSize-616206df.js → useScrollbarSize-135fa94c.js} +0 -0
- /package/build/{useUniqueId-cc1feaa4.js → useUniqueId-490497d9.js} +0 -0
- /package/build/{utils-f3cc3b6c.js → utils-22ce9f9e.js} +0 -0
package/build/esm/lead.js
CHANGED
|
@@ -1,44 +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-2571f98c.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-11c1e9b1.js';
|
|
8
|
+
import { T as TranslationsContext } from './translationsContext-feb0f31b.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 } from './index-
|
|
17
|
-
import './index-
|
|
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-213d1bf3.js';
|
|
11
|
+
import { T as Text } from './index-c17eb826.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-a0ef2f51.js';
|
|
13
|
+
import { D as DatePicker } from './index-4157d466.js';
|
|
14
|
+
import { M as MAPPED_LOCALE } from './utils-5b23c988.js';
|
|
15
|
+
import '@mantine/dates';
|
|
16
|
+
import { Z as ZINDEX_SSO } from './index-a7ef127e.js';
|
|
17
|
+
import './index-93f05cbd.js';
|
|
18
|
+
import './index-fa4aed4f.js';
|
|
19
|
+
import './useMantineLocale-1d78bb2f.js';
|
|
20
|
+
import { B as Button$1 } from './index-3cb8cb4b.js';
|
|
21
|
+
import './index.styles-756b61f3.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-9f3c0383.js';
|
|
24
|
+
import './index-4ea9c741.js';
|
|
25
|
+
import { u as usePlacesAutocomplete, G as GOOGLE_API_KEY } from './usePlacesAutocomplete-ba00126b.js';
|
|
26
|
+
import { B as Button } from './index-419ed52f.js';
|
|
27
|
+
import { H as Heading$1 } from './index-3504643c.js';
|
|
29
28
|
import { v1 } from 'uuid';
|
|
29
|
+
import { i as isVideo } from './index-9f9fa32d.js';
|
|
30
|
+
import { D as DrawerComponent } from './index-6c04281f.js';
|
|
31
|
+
import { u as useScreenSize } from './useScreenSize-245884d6.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-d146d365.js';
|
|
34
|
-
import { u as useScreenSize } from './useScreenSize-5dfcff9a.js';
|
|
35
|
-
import { createPortal } from 'react-dom';
|
|
36
|
-
import { C as Close } from './Close-92688f4f.js';
|
|
36
|
+
import { C as Close } from './Close-218e750a.js';
|
|
37
37
|
import '@hhgtech/icons/other';
|
|
38
38
|
import '@mantine/carousel';
|
|
39
|
-
import './Locale-
|
|
39
|
+
import './Locale-23142efe.js';
|
|
40
40
|
import 'classnames';
|
|
41
|
-
import './useUniqueId-
|
|
41
|
+
import './useUniqueId-31d70d4b.js';
|
|
42
42
|
import './constantsSite.js';
|
|
43
43
|
import '@hhgtech/icons/core';
|
|
44
44
|
import 'date-fns/locale';
|
|
@@ -72,7 +72,7 @@ if (sessionStorage.getItem('insider_object')) {
|
|
|
72
72
|
}
|
|
73
73
|
const docLang = document.documentElement.lang;
|
|
74
74
|
// TODO: country code
|
|
75
|
-
const LEAD_LOCALE_DATA
|
|
75
|
+
const LEAD_LOCALE_DATA = {
|
|
76
76
|
'vi-VN': {
|
|
77
77
|
popupLang: 'vi',
|
|
78
78
|
countryCode: 'vn',
|
|
@@ -114,7 +114,7 @@ const LEAD_LOCALE_DATA$1 = {
|
|
|
114
114
|
countryCodeNumber: 91,
|
|
115
115
|
},
|
|
116
116
|
};
|
|
117
|
-
const LEAD_LOCALE = LEAD_LOCALE_DATA
|
|
117
|
+
const LEAD_LOCALE = LEAD_LOCALE_DATA[docLang] || LEAD_LOCALE_DATA['vi-VN'];
|
|
118
118
|
function LEAD_RESET_VAR() {
|
|
119
119
|
// LEAD_CURRENT_URL = location.href.toLowerCase();
|
|
120
120
|
LEAD_CURRENT_URL =
|
|
@@ -135,11 +135,6 @@ const LEAD_TIMEZONE_DATA = {
|
|
|
135
135
|
9: 'Asia/Manila', // Philippines / Filipinos Site
|
|
136
136
|
};
|
|
137
137
|
|
|
138
|
-
const LEADGEN_ACTIONS = {
|
|
139
|
-
SHOW: 'SHOW',
|
|
140
|
-
SCROLL: 'SCROLL',
|
|
141
|
-
TIME: 'TIME',
|
|
142
|
-
};
|
|
143
138
|
const LEADGEN_LAYOUT = {
|
|
144
139
|
LightBoxA: 'LightBoxA',
|
|
145
140
|
LightBoxB: 'LightBoxB',
|
|
@@ -169,10 +164,8 @@ const LEADGEN_BLOCK = {
|
|
|
169
164
|
DropdownBlock: 'DropdownBlock',
|
|
170
165
|
CheckboxBlock: 'CheckboxBlock',
|
|
171
166
|
TncBlock: 'TncBlock',
|
|
172
|
-
TitleBlock: 'TitleBlock',
|
|
173
|
-
SubtitleBlock: 'SubtitleBlock',
|
|
174
167
|
};
|
|
175
|
-
const
|
|
168
|
+
const LEADGEN_BLOCK_IN_FORM = [
|
|
176
169
|
LEADGEN_BLOCK.TextBlock,
|
|
177
170
|
LEADGEN_BLOCK.NumberBlock,
|
|
178
171
|
LEADGEN_BLOCK.DateBlock,
|
|
@@ -188,48 +181,6 @@ const LEADGEN_BLOCK_INPUT = [
|
|
|
188
181
|
LEADGEN_BLOCK.TncBlock,
|
|
189
182
|
];
|
|
190
183
|
const SSO_MAP_LEAD = ['name', 'email', 'birthday', 'phone', 'gender'];
|
|
191
|
-
const LEAD_LOCALE_DATA = {
|
|
192
|
-
'vi-VN': {
|
|
193
|
-
popupLang: 'vi',
|
|
194
|
-
countryCode: 'vn',
|
|
195
|
-
countryCodeNumber: 84,
|
|
196
|
-
},
|
|
197
|
-
'id-ID': {
|
|
198
|
-
popupLang: 'id',
|
|
199
|
-
countryCode: 'id',
|
|
200
|
-
countryCodeNumber: 62,
|
|
201
|
-
},
|
|
202
|
-
'th-TH': {
|
|
203
|
-
popupLang: 'th',
|
|
204
|
-
countryCode: 'th',
|
|
205
|
-
countryCodeNumber: 66,
|
|
206
|
-
},
|
|
207
|
-
'ms-MY': {
|
|
208
|
-
popupLang: 'ms',
|
|
209
|
-
countryCode: 'my',
|
|
210
|
-
countryCodeNumber: 60,
|
|
211
|
-
},
|
|
212
|
-
'zh-TW': {
|
|
213
|
-
popupLang: 'zh',
|
|
214
|
-
countryCode: 'tw',
|
|
215
|
-
countryCodeNumber: 886,
|
|
216
|
-
},
|
|
217
|
-
'km-KH': {
|
|
218
|
-
popupLang: 'km',
|
|
219
|
-
countryCode: 'kh',
|
|
220
|
-
countryCodeNumber: 855,
|
|
221
|
-
},
|
|
222
|
-
'my-MM': {
|
|
223
|
-
popupLang: 'my',
|
|
224
|
-
countryCode: 'mm',
|
|
225
|
-
countryCodeNumber: 95,
|
|
226
|
-
},
|
|
227
|
-
'hi-IN': {
|
|
228
|
-
popupLang: 'hi',
|
|
229
|
-
countryCode: 'in',
|
|
230
|
-
countryCodeNumber: 91,
|
|
231
|
-
},
|
|
232
|
-
};
|
|
233
184
|
const mappingSSOToLead = (userInfoProps) => {
|
|
234
185
|
var _a, _b;
|
|
235
186
|
try {
|
|
@@ -245,7 +196,7 @@ const mappingSSOToLead = (userInfoProps) => {
|
|
|
245
196
|
if (ssoKey === 'birthday') {
|
|
246
197
|
const dob = dayjs(initValue, 'YYYY-MM-DD', true);
|
|
247
198
|
if (dob.isValid()) {
|
|
248
|
-
user.birthday = dob
|
|
199
|
+
user.birthday = dob;
|
|
249
200
|
}
|
|
250
201
|
}
|
|
251
202
|
else if (ssoKey === 'gender') {
|
|
@@ -268,46 +219,6 @@ const mappingSSOToLead = (userInfoProps) => {
|
|
|
268
219
|
catch (error) {
|
|
269
220
|
return;
|
|
270
221
|
}
|
|
271
|
-
};
|
|
272
|
-
const formatCampaignDetail = (campaign) => {
|
|
273
|
-
if (!campaign) {
|
|
274
|
-
return {};
|
|
275
|
-
}
|
|
276
|
-
try {
|
|
277
|
-
const { extra_fields, thank_you_image } = campaign || {};
|
|
278
|
-
const { textBlocks: exTextBlocks, imageBlocks: exImageBlocks, listBlockAdded: exListBlockAdded, listBlockThankyou: exListBlockThankyou, actionBlocks: exActionBlocks, } = extra_fields;
|
|
279
|
-
const textBlocks = JSON.parse(exTextBlocks);
|
|
280
|
-
const imageBlocks = JSON.parse(exImageBlocks);
|
|
281
|
-
const listBlockAdded = JSON.parse(exListBlockAdded);
|
|
282
|
-
const listBlockThankyou = JSON.parse(exListBlockThankyou);
|
|
283
|
-
const actionBlocks = JSON.parse(exActionBlocks);
|
|
284
|
-
const ThankYouBlock = {
|
|
285
|
-
image: { src: thank_you_image },
|
|
286
|
-
};
|
|
287
|
-
listBlockThankyou.forEach((block) => {
|
|
288
|
-
const { name, data } = block || {};
|
|
289
|
-
const { value: htmlText, align, newtab, url } = data || {};
|
|
290
|
-
switch (name) {
|
|
291
|
-
case LEADGEN_BLOCK.TitleBlock: {
|
|
292
|
-
ThankYouBlock.title = { htmlText, align };
|
|
293
|
-
}
|
|
294
|
-
case LEADGEN_BLOCK.SubtitleBlock: {
|
|
295
|
-
ThankYouBlock.description = { htmlText, align };
|
|
296
|
-
}
|
|
297
|
-
case LEADGEN_BLOCK.LinkButtonBlock: {
|
|
298
|
-
ThankYouBlock.button = { htmlText, newtab, url };
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
});
|
|
302
|
-
return Object.assign(Object.assign({}, campaign), { extra_fields: Object.assign(Object.assign({}, extra_fields), { textBlocks,
|
|
303
|
-
imageBlocks,
|
|
304
|
-
listBlockAdded,
|
|
305
|
-
listBlockThankyou,
|
|
306
|
-
actionBlocks }), ThankYouBlock });
|
|
307
|
-
}
|
|
308
|
-
catch (error) {
|
|
309
|
-
return {};
|
|
310
|
-
}
|
|
311
222
|
};
|
|
312
223
|
|
|
313
224
|
class Store {
|
|
@@ -318,13 +229,6 @@ class Store {
|
|
|
318
229
|
}
|
|
319
230
|
const leadStore = new Store();
|
|
320
231
|
|
|
321
|
-
const LEADGEN_API_METHOD = {
|
|
322
|
-
GET: 'get',
|
|
323
|
-
POST: 'POST',
|
|
324
|
-
};
|
|
325
|
-
const LEADGEN_API_PATH = {
|
|
326
|
-
V2_CAMPAIGN: 'api/v2/campaign',
|
|
327
|
-
};
|
|
328
232
|
const leadApi = {
|
|
329
233
|
call(_a) {
|
|
330
234
|
var { url, data = undefined } = _a, config = __rest(_a, ["url", "data"]);
|
|
@@ -428,39 +332,8 @@ const verifyOtpLead = ({ phone, otp, type, }) => {
|
|
|
428
332
|
},
|
|
429
333
|
});
|
|
430
334
|
};
|
|
431
|
-
const campaignGetByCode = (campaign_code) => {
|
|
432
|
-
return leadApi.call({
|
|
433
|
-
url: `${LEADGEN_API_PATH.V2_CAMPAIGN}/${campaign_code}`,
|
|
434
|
-
method: LEADGEN_API_METHOD.GET,
|
|
435
|
-
});
|
|
436
|
-
};
|
|
437
|
-
const campaignPostLead = ({ data }) => {
|
|
438
|
-
return leadApi.call({
|
|
439
|
-
url: 'api/v2/subscription-box',
|
|
440
|
-
method: LEADGEN_API_METHOD.POST,
|
|
441
|
-
data,
|
|
442
|
-
});
|
|
443
|
-
};
|
|
444
|
-
const campaignPostImpression = ({ code, action, title_article, ga_client_id, cookie_id, extra, url, referrer, }) => {
|
|
445
|
-
return leadApi.call({
|
|
446
|
-
url: `api/campaign/${code}/impression`,
|
|
447
|
-
method: LEADGEN_API_METHOD.POST,
|
|
448
|
-
data: {
|
|
449
|
-
action,
|
|
450
|
-
title_article,
|
|
451
|
-
cookie_id,
|
|
452
|
-
ga_client_id,
|
|
453
|
-
url,
|
|
454
|
-
extra,
|
|
455
|
-
referrer,
|
|
456
|
-
},
|
|
457
|
-
});
|
|
458
|
-
};
|
|
459
335
|
const Service = {
|
|
460
336
|
campaignGetById,
|
|
461
|
-
campaignGetByCode,
|
|
462
|
-
campaignPostLead,
|
|
463
|
-
campaignPostImpression,
|
|
464
337
|
validateEmailOrPhoneOnSubot,
|
|
465
338
|
validateEmailOrPhoneOnLeadGen,
|
|
466
339
|
validatePhoneNumberOnLeadGen,
|
|
@@ -1462,1065 +1335,66 @@ const getTranslations = (locale) => {
|
|
|
1462
1335
|
|
|
1463
1336
|
const LeadGenContext = createContext({});
|
|
1464
1337
|
|
|
1465
|
-
const
|
|
1466
|
-
const
|
|
1467
|
-
const
|
|
1468
|
-
const [
|
|
1469
|
-
|
|
1470
|
-
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
|
|
1471
1343
|
useEffect(() => {
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
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);
|
|
1481
1356
|
});
|
|
1357
|
+
img.src = src;
|
|
1482
1358
|
}
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1359
|
+
else {
|
|
1360
|
+
setWidth(16);
|
|
1361
|
+
setHeight(9);
|
|
1362
|
+
setLoaded(true);
|
|
1363
|
+
}
|
|
1364
|
+
}, [src]);
|
|
1365
|
+
return {
|
|
1366
|
+
loaded,
|
|
1367
|
+
width,
|
|
1368
|
+
height,
|
|
1369
|
+
};
|
|
1370
|
+
};
|
|
1371
|
+
|
|
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" }))));
|
|
1375
|
+
|
|
1376
|
+
// url: imageBlocks.imageMobile.data.url
|
|
1377
|
+
// newTab: imageBlocks.imageMobile.data.newtab
|
|
1378
|
+
// imageMobile: campaignShow.image
|
|
1379
|
+
// imageDestkop: campaignShow.image_desktop
|
|
1380
|
+
const CenterTabLayout = ({ popupId, url, newTab, imageDestkop, imageMobile, onClose, onOtherSubmit, }) => {
|
|
1381
|
+
const { width: imageMobileWidth, height: imageMobileHeight, loaded: imageMobileLoaded, } = useImageSize(imageMobile);
|
|
1382
|
+
const { width: imageDestkopWidth, height: imageDestkopHeight, loaded: imageDestkopLoaded, } = useImageSize(imageDestkop);
|
|
1383
|
+
if (!imageMobileLoaded || !imageDestkopLoaded)
|
|
1492
1384
|
return null;
|
|
1493
|
-
}
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
}
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
const validateObj = useMemo(() => {
|
|
1507
|
-
const InputBlocks = [
|
|
1508
|
-
'TextBlock',
|
|
1509
|
-
'NumberBlock',
|
|
1510
|
-
'EmailBlock',
|
|
1511
|
-
'PhoneBlock',
|
|
1512
|
-
'DateBlock',
|
|
1513
|
-
'CheckboxBlock',
|
|
1514
|
-
'RadioBlock',
|
|
1515
|
-
'DropdownBlock',
|
|
1516
|
-
'PhoneOtpBlock',
|
|
1517
|
-
'WhatsappOtpBlock',
|
|
1518
|
-
'ZaloOtpBlock',
|
|
1519
|
-
'LocationBlock',
|
|
1520
|
-
'TncBlock',
|
|
1521
|
-
];
|
|
1522
|
-
// ALL are required and can skip if not touched yet
|
|
1523
|
-
const withSharedCheck = (name, cb,
|
|
1524
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1525
|
-
block) => {
|
|
1526
|
-
return (value) => {
|
|
1527
|
-
var _a;
|
|
1528
|
-
const isBLockRequired = (_a = block === null || block === void 0 ? void 0 : block.data) === null || _a === void 0 ? void 0 : _a.required;
|
|
1529
|
-
if (!formRef.current.isTouched(name))
|
|
1530
|
-
return;
|
|
1531
|
-
if ((typeof value === 'string' && value.replace(' ', '') === '') ||
|
|
1532
|
-
typeof value === 'undefined' ||
|
|
1533
|
-
value === '' ||
|
|
1534
|
-
(Array.isArray(value) && value.length === 0)) {
|
|
1535
|
-
return isBLockRequired
|
|
1536
|
-
? t('validator.required')
|
|
1537
|
-
: cb === null || cb === void 0 ? void 0 : cb(value);
|
|
1538
|
-
}
|
|
1539
|
-
return cb === null || cb === void 0 ? void 0 : cb(value);
|
|
1540
|
-
};
|
|
1541
|
-
};
|
|
1542
|
-
return listBlockAdded
|
|
1543
|
-
.filter((b) => InputBlocks.includes(b.name))
|
|
1544
|
-
.reduce((r, b) => {
|
|
1545
|
-
var _a;
|
|
1546
|
-
const isRequired = (_a = b.data.required) !== null && _a !== void 0 ? _a : true;
|
|
1547
|
-
if (b.name === 'NumberBlock') {
|
|
1548
|
-
return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
|
|
1549
|
-
if (value && isNaN(Number(value))) {
|
|
1550
|
-
return t('validator.number');
|
|
1551
|
-
}
|
|
1552
|
-
}, b) });
|
|
1553
|
-
}
|
|
1554
|
-
else if (b.name === 'EmailBlock') {
|
|
1555
|
-
return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
|
|
1556
|
-
if (value && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) {
|
|
1557
|
-
return t('validator.email');
|
|
1558
|
-
}
|
|
1559
|
-
if (!value)
|
|
1560
|
-
return;
|
|
1561
|
-
validatingEmailRef.current = true;
|
|
1562
|
-
setTimeout(() => {
|
|
1563
|
-
formRef.current.setFieldError(b.data.value, 'Validating...');
|
|
1564
|
-
checkUsedEmailOrPhoneWithCache(campaignId, campaign_subot_id, {
|
|
1565
|
-
email: value,
|
|
1566
|
-
})
|
|
1567
|
-
.then((tKey) => {
|
|
1568
|
-
if (tKey) {
|
|
1569
|
-
formRef.current.setFieldError(b.data.value, t(tKey));
|
|
1570
|
-
}
|
|
1571
|
-
else {
|
|
1572
|
-
formRef.current.clearFieldError(b.data.value);
|
|
1573
|
-
}
|
|
1574
|
-
validatingEmailRef.current = false;
|
|
1575
|
-
})
|
|
1576
|
-
.catch((e) => {
|
|
1577
|
-
console.error(e);
|
|
1578
|
-
formRef.current.setFieldError(b.data.value, e.message || 'Something went wrong');
|
|
1579
|
-
validatingEmailRef.current = false;
|
|
1580
|
-
});
|
|
1581
|
-
}, 200);
|
|
1582
|
-
}, b) });
|
|
1583
|
-
}
|
|
1584
|
-
else if (b.name === 'PhoneBlock' ||
|
|
1585
|
-
b.name === 'PhoneOtpBlock' ||
|
|
1586
|
-
b.name === 'ZaloOtpBlock' ||
|
|
1587
|
-
b.name === 'WhatsappOtpBlock') {
|
|
1588
|
-
return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
|
|
1589
|
-
if (value &&
|
|
1590
|
-
window.intlTelInputUtils &&
|
|
1591
|
-
!window.intlTelInputUtils.isValidNumber(String(value), LEAD_LOCALE.countryCode)) {
|
|
1592
|
-
return t('validator.phone');
|
|
1593
|
-
}
|
|
1594
|
-
if (!value)
|
|
1595
|
-
return;
|
|
1596
|
-
validatingPhoneRef.current = true;
|
|
1597
|
-
setTimeout(() => {
|
|
1598
|
-
formRef.current.setFieldError(b.data.value, 'Validating...');
|
|
1599
|
-
if (b.data.singleSubmission) {
|
|
1600
|
-
checkUsedPhoneOnlyWithCache(campaignId, value)
|
|
1601
|
-
.then((tKey) => {
|
|
1602
|
-
if (tKey) {
|
|
1603
|
-
formRef.current.setFieldError(b.data.value, t(tKey));
|
|
1604
|
-
}
|
|
1605
|
-
else {
|
|
1606
|
-
formRef.current.clearFieldError(b.data.value);
|
|
1607
|
-
}
|
|
1608
|
-
validatingPhoneRef.current = false;
|
|
1609
|
-
})
|
|
1610
|
-
.catch((err) => {
|
|
1611
|
-
console.error(err);
|
|
1612
|
-
formRef.current.setFieldError(b.data.value, err.message || 'Something went wrong');
|
|
1613
|
-
validatingPhoneRef.current = false;
|
|
1614
|
-
});
|
|
1615
|
-
}
|
|
1616
|
-
else {
|
|
1617
|
-
checkUsedEmailOrPhoneWithCache(campaignId, campaign_subot_id, {
|
|
1618
|
-
phone: value,
|
|
1619
|
-
})
|
|
1620
|
-
.then((tKey) => {
|
|
1621
|
-
if (tKey) {
|
|
1622
|
-
formRef.current.setFieldError(b.data.value, t(tKey));
|
|
1623
|
-
}
|
|
1624
|
-
else {
|
|
1625
|
-
formRef.current.clearFieldError(b.data.value);
|
|
1626
|
-
}
|
|
1627
|
-
validatingPhoneRef.current = false;
|
|
1628
|
-
})
|
|
1629
|
-
.catch((e) => {
|
|
1630
|
-
console.error(e);
|
|
1631
|
-
formRef.current.setFieldError(b.data.value, e.message || 'Something went wrong');
|
|
1632
|
-
validatingPhoneRef.current = false;
|
|
1633
|
-
});
|
|
1634
|
-
}
|
|
1635
|
-
}, 200);
|
|
1636
|
-
}, b) });
|
|
1637
|
-
}
|
|
1638
|
-
else if (b.name === 'DateBlock') {
|
|
1639
|
-
return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
|
|
1640
|
-
if (value && isNaN(Date.parse(value))) {
|
|
1641
|
-
return t('validator.date');
|
|
1642
|
-
}
|
|
1643
|
-
}, b) });
|
|
1644
|
-
}
|
|
1645
|
-
else if (b.name === 'TncBlock') {
|
|
1646
|
-
return Object.assign(Object.assign({}, r), { [`TNC-` + b.id]: withSharedCheck('TNC-' + b.id, (value) => {
|
|
1647
|
-
if (isRequired && !value) {
|
|
1648
|
-
return t('validator.required');
|
|
1649
|
-
}
|
|
1650
|
-
}, b) });
|
|
1651
|
-
}
|
|
1652
|
-
else {
|
|
1653
|
-
return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, undefined, b) });
|
|
1654
|
-
}
|
|
1655
|
-
}, {});
|
|
1656
|
-
}, [listBlockAdded.map((b) => b.name).join(',')]);
|
|
1657
|
-
const form = useLeadForm({
|
|
1658
|
-
validateInputOnChange: true,
|
|
1659
|
-
clearInputErrorOnChange: true,
|
|
1660
|
-
validate: validateObj,
|
|
1661
|
-
initialValues,
|
|
1662
|
-
});
|
|
1663
|
-
const formRef = useRef(form);
|
|
1664
|
-
formRef.current = form;
|
|
1665
|
-
return { form, validateObj };
|
|
1666
|
-
};
|
|
1667
|
-
|
|
1668
|
-
const PhoneInput = forwardRef((props, ref) => {
|
|
1669
|
-
const { defaultCountry, id: idProps, name, placeholder, label, labelElement, labelProps, description, descriptionProps, withAsterisk, inputMode, inputContainer, inputWrapperOrder, error, className, classNames, style, styles } = props, restProps = __rest(props, ["defaultCountry", "id", "name", "placeholder", "label", "labelElement", "labelProps", "description", "descriptionProps", "withAsterisk", "inputMode", "inputContainer", "inputWrapperOrder", "error", "className", "classNames", "style", "styles"]);
|
|
1670
|
-
const id = idProps || v1() + name;
|
|
1671
|
-
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 },
|
|
1672
|
-
React__default.createElement("div", { className: "mantine-Input-wrapper" },
|
|
1673
|
-
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" })))));
|
|
1674
|
-
});
|
|
1675
|
-
|
|
1676
|
-
const StyledLeadGenFormInner = styled.div `
|
|
1677
|
-
display: flex;
|
|
1678
|
-
flex-wrap: wrap;
|
|
1679
|
-
gap: 8px;
|
|
1680
|
-
.leadgen-form_input {
|
|
1681
|
-
width: calc(50% - 4px);
|
|
1682
|
-
}
|
|
1683
|
-
|
|
1684
|
-
.leadgen-form_input_checkbox {
|
|
1685
|
-
width: 100%;
|
|
1686
|
-
}
|
|
1687
|
-
`;
|
|
1688
|
-
|
|
1689
|
-
const cssInputNotShrink$1 = css `
|
|
1690
|
-
height: 100% !important;
|
|
1691
|
-
min-height: calc(var(--container-height, 56px) * 22 / 56);
|
|
1692
|
-
color: ${theme.colors.gray800};
|
|
1693
|
-
font-size: var(--input, 16px);
|
|
1694
|
-
line-height: calc(var(--container-height, 56px) * 22 / 56);
|
|
1695
|
-
border: none !important;
|
|
1696
|
-
border-radius: 0 !important;
|
|
1697
|
-
outline: none !important;
|
|
1698
|
-
box-shadow: none !important;
|
|
1699
|
-
padding: 0;
|
|
1700
|
-
cursor: pointer;
|
|
1701
|
-
opacity: 0;
|
|
1702
|
-
|
|
1703
|
-
::placeholder {
|
|
1704
|
-
color: ${theme.colors.gray400};
|
|
1705
|
-
}
|
|
1706
|
-
`;
|
|
1707
|
-
const cssInputShrink$1 = css `
|
|
1708
|
-
height: auto !important;
|
|
1709
|
-
cursor: text;
|
|
1710
|
-
opacity: 1;
|
|
1711
|
-
transition: 0.1s ease-in-out all;
|
|
1712
|
-
`;
|
|
1713
|
-
const cssLabelNotShrink$1 = css `
|
|
1714
|
-
position: absolute;
|
|
1715
|
-
top: calc(var(--container-height) / 2);
|
|
1716
|
-
left: var(--space-x, 16px);
|
|
1717
|
-
color: ${theme.colors.gray400};
|
|
1718
|
-
font-size: var(--label-not-shrink, 16px);
|
|
1719
|
-
font-weight: 400;
|
|
1720
|
-
line-height: calc(var(--container-height, 56px) * 18 / 56);
|
|
1721
|
-
margin: 0;
|
|
1722
|
-
z-index: 1;
|
|
1723
|
-
cursor: pointer;
|
|
1724
|
-
transform: translateY(-50%);
|
|
1725
|
-
transition: 0.125s ease-in all;
|
|
1726
|
-
`;
|
|
1727
|
-
const cssLabelShrink$1 = css `
|
|
1728
|
-
color: ${theme.colors.gray600};
|
|
1729
|
-
font-weight: 600;
|
|
1730
|
-
font-size: var(--label-shrink, 12px);
|
|
1731
|
-
top: calc(var(--container-height) * 7 / 56);
|
|
1732
|
-
transform: none;
|
|
1733
|
-
transition: 0.125s ease-out all;
|
|
1734
|
-
`;
|
|
1735
|
-
const cssWrapperInputNotShrink$1 = css `
|
|
1736
|
-
min-height: var(--container-height, 56px);
|
|
1737
|
-
display: flex;
|
|
1738
|
-
align-items: flex-end;
|
|
1739
|
-
border: 1px solid ${theme.colors.gray200};
|
|
1740
|
-
border-radius: 8px;
|
|
1741
|
-
background-color: #fff;
|
|
1742
|
-
padding-inline: var(--space-x, 16px);
|
|
1743
|
-
padding-block: var(--space-y-not-shrink, 16px);
|
|
1744
|
-
cursor: pointer;
|
|
1745
|
-
pointer-events: none;
|
|
1746
|
-
|
|
1747
|
-
&:has(.mantine-Input-rightSection) {
|
|
1748
|
-
padding-right: var(--container-height, 56px);
|
|
1749
|
-
}
|
|
1750
|
-
|
|
1751
|
-
.mantine-Input-icon {
|
|
1752
|
-
display: none;
|
|
1753
|
-
}
|
|
1754
|
-
|
|
1755
|
-
.mantine-NumberInput-control {
|
|
1756
|
-
border-color: ${theme.colors.gray200};
|
|
1757
|
-
}
|
|
1758
|
-
`;
|
|
1759
|
-
const cssWrapperInputShrink$1 = css `
|
|
1760
|
-
height: auto;
|
|
1761
|
-
min-height: var(--container-height, 56px);
|
|
1762
|
-
padding-block: var(--space-y-shrink, 7px);
|
|
1763
|
-
cursor: text;
|
|
1764
|
-
pointer-events: auto;
|
|
1765
|
-
`;
|
|
1766
|
-
const cssInputWrapperError$1 = css `
|
|
1767
|
-
color: ${theme.colors.red800};
|
|
1768
|
-
font-size: 12px;
|
|
1769
|
-
line-height: 1.5;
|
|
1770
|
-
`;
|
|
1771
|
-
const StyledTextFieldContainer$1 = styled.div `
|
|
1772
|
-
--space-x: 16px;
|
|
1773
|
-
--space-y-not-shrink: 16px;
|
|
1774
|
-
--space-y-shrink: 7px;
|
|
1775
|
-
--container-height: 56px;
|
|
1776
|
-
--label-not-shrink: 16px;
|
|
1777
|
-
--label-shrink: 12px;
|
|
1778
|
-
--input: 16px;
|
|
1779
|
-
|
|
1780
|
-
position: relative;
|
|
1781
|
-
min-width: 100px;
|
|
1782
|
-
max-width: 100%;
|
|
1783
|
-
display: inline-block;
|
|
1784
|
-
|
|
1785
|
-
.textField_wrapper {
|
|
1786
|
-
display: inline-block;
|
|
1787
|
-
width: 100%;
|
|
1788
|
-
cursor: pointer;
|
|
1789
|
-
}
|
|
1790
|
-
|
|
1791
|
-
.mantine-InputWrapper-root {
|
|
1792
|
-
&[data-invalid='true'] {
|
|
1793
|
-
.mantine-Input-wrapper {
|
|
1794
|
-
border-color: ${theme.colors.red400};
|
|
1795
|
-
}
|
|
1796
|
-
}
|
|
1797
|
-
|
|
1798
|
-
.mantine-Input-wrapper {
|
|
1799
|
-
&:has([data-invalid]) {
|
|
1800
|
-
border-color: ${theme.colors.red400};
|
|
1801
|
-
}
|
|
1802
|
-
}
|
|
1803
|
-
}
|
|
1804
|
-
|
|
1805
|
-
.mantine-InputWrapper-label {
|
|
1806
|
-
${cssLabelNotShrink$1}
|
|
1807
|
-
}
|
|
1808
|
-
|
|
1809
|
-
.mantine-Input-wrapper {
|
|
1810
|
-
${cssWrapperInputNotShrink$1}
|
|
1811
|
-
|
|
1812
|
-
+ .mantine-Popover-dropdown[data-position="bottom-start"] {
|
|
1813
|
-
left: 0 !important;
|
|
1814
|
-
}
|
|
1815
|
-
+ .mantine-Popover-dropdown[data-position='top-start'] {
|
|
1816
|
-
top: unset !important;
|
|
1817
|
-
left: 0 !important;
|
|
1818
|
-
bottom: 100% !important;
|
|
1819
|
-
}
|
|
1820
|
-
}
|
|
1821
|
-
|
|
1822
|
-
.mantine-Input-input {
|
|
1823
|
-
${cssInputNotShrink$1}
|
|
1824
|
-
}
|
|
1825
|
-
|
|
1826
|
-
&.textField_shrink,
|
|
1827
|
-
&:focus-within {
|
|
1828
|
-
.mantine-InputWrapper-label {
|
|
1829
|
-
${cssLabelShrink$1}
|
|
1830
|
-
}
|
|
1831
|
-
|
|
1832
|
-
.mantine-Input-wrapper {
|
|
1833
|
-
${cssWrapperInputShrink$1}
|
|
1834
|
-
&.mantine-Select-wrapper {
|
|
1835
|
-
.mantine-Select-rightSection {
|
|
1836
|
-
pointer-events: auto !important;
|
|
1837
|
-
}
|
|
1838
|
-
}
|
|
1839
|
-
}
|
|
1840
|
-
|
|
1841
|
-
.mantine-Input-input {
|
|
1842
|
-
${cssInputShrink$1}
|
|
1843
|
-
}
|
|
1844
|
-
|
|
1845
|
-
&:has(.PhoneInput) {
|
|
1846
|
-
.mantine-InputWrapper-label {
|
|
1847
|
-
left: var(--space-x, 16px);
|
|
1848
|
-
}
|
|
1849
|
-
.PhoneInput {
|
|
1850
|
-
.PhoneInputInput {
|
|
1851
|
-
opacity: 1;
|
|
1852
|
-
}
|
|
1853
|
-
}
|
|
1854
|
-
}
|
|
1855
|
-
}
|
|
1856
|
-
|
|
1857
|
-
.PhoneInput {
|
|
1858
|
-
--phone-select: 75px;
|
|
1859
|
-
--phone-input-space-x: 8px;
|
|
1860
|
-
width: 100%;
|
|
1861
|
-
opacity: 1;
|
|
1862
|
-
border: none;
|
|
1863
|
-
.PhoneInputCountry {
|
|
1864
|
-
background-color: transparent;
|
|
1865
|
-
border: none;
|
|
1866
|
-
padding: 0;
|
|
1867
|
-
width: var(--phone-select, 75px);
|
|
1868
|
-
}
|
|
1869
|
-
.PhoneInputInput {
|
|
1870
|
-
flex: 1;
|
|
1871
|
-
min-width: 0;
|
|
1872
|
-
line-height: 1.5;
|
|
1873
|
-
outline: none !important;
|
|
1874
|
-
border: none;
|
|
1875
|
-
box-shadow: none;
|
|
1876
|
-
padding: 0 var(--phone-input-space-x, 8px);
|
|
1877
|
-
opacity: 0;
|
|
1878
|
-
color: ${theme.colors.gray800} !important;
|
|
1879
|
-
:focus {
|
|
1880
|
-
color: ${theme.colors.gray800} !important;
|
|
1881
|
-
}
|
|
1882
|
-
}
|
|
1883
|
-
}
|
|
1884
|
-
|
|
1885
|
-
&:has(.PhoneInput) {
|
|
1886
|
-
.mantine-InputWrapper-label {
|
|
1887
|
-
left: calc(
|
|
1888
|
-
var(--space-x, 16px) + var(--phone-select, 75px) +
|
|
1889
|
-
var(--phone-input-space-x, 8px)
|
|
1890
|
-
);
|
|
1891
|
-
}
|
|
1892
|
-
}
|
|
1893
|
-
`;
|
|
1894
|
-
const StyledChoiceFieldContainer$1 = styled.div `
|
|
1895
|
-
&.leadgen-form_checkbox,
|
|
1896
|
-
&.leadgen-form_radio {
|
|
1897
|
-
width: 100%;
|
|
1898
|
-
}
|
|
1899
|
-
|
|
1900
|
-
&.leadgen-form_dropdown {
|
|
1901
|
-
width: calc(50% - 12px);
|
|
1902
|
-
}
|
|
1903
|
-
|
|
1904
|
-
.mantine-InputWrapper-root {
|
|
1905
|
-
display: block;
|
|
1906
|
-
}
|
|
1907
|
-
|
|
1908
|
-
.mantine-InputWrapper-label {
|
|
1909
|
-
margin-bottom: 0.5rem;
|
|
1910
|
-
color: ${theme.colors.gray800};
|
|
1911
|
-
font-size: 16px;
|
|
1912
|
-
font-weight: 400;
|
|
1913
|
-
line-height: 1.5;
|
|
1914
|
-
}
|
|
1915
|
-
|
|
1916
|
-
.mantine-Radio-root,
|
|
1917
|
-
.mantine-Checkbox-root {
|
|
1918
|
-
gap: 8px;
|
|
1919
|
-
min-width: calc(50% - 4px);
|
|
1920
|
-
|
|
1921
|
-
input[type='radio'],
|
|
1922
|
-
input[type='checkbox'] {
|
|
1923
|
-
border-color: ${theme.colors.gray600};
|
|
1924
|
-
width: 18px;
|
|
1925
|
-
height: 18px;
|
|
1926
|
-
}
|
|
1927
|
-
input[type='checkbox'] {
|
|
1928
|
-
border-radius: 4px;
|
|
1929
|
-
}
|
|
1930
|
-
|
|
1931
|
-
&[data-checked='true'] {
|
|
1932
|
-
input[type='radio'],
|
|
1933
|
-
input[type='checkbox'] {
|
|
1934
|
-
border-color: ${theme.colors.primary600};
|
|
1935
|
-
+ svg {
|
|
1936
|
-
color: ${theme.colors.primary600};
|
|
1937
|
-
}
|
|
1938
|
-
}
|
|
1939
|
-
|
|
1940
|
-
input[type='radio'] {
|
|
1941
|
-
background-color: white;
|
|
1942
|
-
}
|
|
1943
|
-
}
|
|
1944
|
-
|
|
1945
|
-
.mantine-Checkbox-input {
|
|
1946
|
-
&:checked {
|
|
1947
|
-
border-color: ${theme.colors.primary600};
|
|
1948
|
-
}
|
|
1949
|
-
}
|
|
1950
|
-
}
|
|
1951
|
-
|
|
1952
|
-
.mantine-Radio-inner,
|
|
1953
|
-
.mantine-Checkbox-inner {
|
|
1954
|
-
width: 24px;
|
|
1955
|
-
height: 24px;
|
|
1956
|
-
display: flex;
|
|
1957
|
-
align-items: center;
|
|
1958
|
-
justify-content: center;
|
|
1959
|
-
}
|
|
1960
|
-
|
|
1961
|
-
.mantine-Radio-body,
|
|
1962
|
-
.mantine-Checkbox-body {
|
|
1963
|
-
display: flex;
|
|
1964
|
-
align-items: center;
|
|
1965
|
-
}
|
|
1966
|
-
|
|
1967
|
-
.mantine-Radio-label,
|
|
1968
|
-
.mantine-Checkbox-label {
|
|
1969
|
-
padding-left: 8px;
|
|
1970
|
-
color: ${theme.colors.gray800};
|
|
1971
|
-
font-size: 14px;
|
|
1972
|
-
line-height: 1.4;
|
|
1973
|
-
letter-spacing: -0.2px;
|
|
1974
|
-
}
|
|
1975
|
-
|
|
1976
|
-
.leadgen-choiceContainer {
|
|
1977
|
-
display: flex;
|
|
1978
|
-
flex-wrap: wrap;
|
|
1979
|
-
align-items: flex-start;
|
|
1980
|
-
gap: 8px;
|
|
1981
|
-
}
|
|
1982
|
-
|
|
1983
|
-
.mantine-InputWrapper-error {
|
|
1984
|
-
${cssInputWrapperError$1}
|
|
1985
|
-
}
|
|
1986
|
-
`;
|
|
1987
|
-
|
|
1988
|
-
const TextField$1 = (props) => {
|
|
1989
|
-
const { shrink: shrinkProps, onChangeShrink, className, children } = props, restProps = __rest(props, ["shrink", "onChangeShrink", "className", "children"]);
|
|
1990
|
-
const containerRef = useClickOutside(() => {
|
|
1991
|
-
if (shrinkProps) {
|
|
1992
|
-
return;
|
|
1993
|
-
}
|
|
1994
|
-
setShrink(false);
|
|
1995
|
-
onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(false);
|
|
1996
|
-
});
|
|
1997
|
-
const [shrink, setShrink] = useState(shrinkProps);
|
|
1998
|
-
const onClick = useCallback((e) => {
|
|
1999
|
-
setShrink(true);
|
|
2000
|
-
onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(true);
|
|
2001
|
-
if (shrink) {
|
|
2002
|
-
return;
|
|
2003
|
-
}
|
|
2004
|
-
const $textEl = e.currentTarget.querySelectorAll('input:not([disabled]):not([type="submit"]),select:not([disabled]),textarea:not([disabled])');
|
|
2005
|
-
const $focusEl = $textEl.item($textEl.length - 1);
|
|
2006
|
-
if ($focusEl) {
|
|
2007
|
-
$focusEl.focus();
|
|
2008
|
-
setTimeout(() => {
|
|
2009
|
-
$focusEl.scrollIntoView({
|
|
2010
|
-
behavior: 'auto',
|
|
2011
|
-
block: 'center',
|
|
2012
|
-
inline: 'start',
|
|
2013
|
-
});
|
|
2014
|
-
}, 100);
|
|
2015
|
-
}
|
|
2016
|
-
}, [shrink]);
|
|
2017
|
-
useEffect(() => {
|
|
2018
|
-
setShrink(shrinkProps);
|
|
2019
|
-
}, [shrinkProps]);
|
|
2020
|
-
return (React__default.createElement(StyledTextFieldContainer$1, Object.assign({ shrink: shrink, className: clsx(className, 'textField', { textField_shrink: !!shrink }) }, restProps),
|
|
2021
|
-
React__default.createElement("div", { ref: containerRef, onClick: onClick, className: "textField_wrapper" }, children)));
|
|
2022
|
-
};
|
|
2023
|
-
const ChoiceField$1 = (props) => {
|
|
2024
|
-
const { children, className } = props, restProps = __rest(props, ["children", "className"]);
|
|
2025
|
-
return (React__default.createElement(StyledChoiceFieldContainer$1, Object.assign({ className: clsx(className, 'choiceField') }, restProps), children));
|
|
2026
|
-
};
|
|
2027
|
-
|
|
2028
|
-
const libraries = ['places'];
|
|
2029
|
-
const GoogleLocationBlock = (props) => {
|
|
2030
|
-
var _a;
|
|
2031
|
-
const { inputWrapperOrder = ['label', 'input', 'description', 'error'], defaultValue, value: valueProps, onChange: onChangeProps, locale } = props, restProps = __rest(props, ["inputWrapperOrder", "defaultValue", "value", "onChange", "locale"]);
|
|
2032
|
-
const [LoadScript, setLoadScript] = useState(null);
|
|
2033
|
-
const [value, setValue] = useState(defaultValue || valueProps);
|
|
2034
|
-
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]);
|
|
2035
|
-
const onChangeAutocomplete = useCallback((s) => {
|
|
2036
|
-
setValue(s);
|
|
2037
|
-
onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(s);
|
|
2038
|
-
}, []);
|
|
2039
|
-
const onClickItem = useCallback((item) => {
|
|
2040
|
-
/** For sure get value */
|
|
2041
|
-
setValue(item.value);
|
|
2042
|
-
const predCur = predictions === null || predictions === void 0 ? void 0 : predictions.find(({ description }) => description === item.value);
|
|
2043
|
-
onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(item.value, predCur === null || predCur === void 0 ? void 0 : predCur.rawData);
|
|
2044
|
-
}, [onChangeProps, predictions]);
|
|
2045
|
-
useEffect(() => {
|
|
2046
|
-
setValue(valueProps);
|
|
2047
|
-
}, [valueProps]);
|
|
2048
|
-
useEffect(() => {
|
|
2049
|
-
var _a, _b, _c;
|
|
2050
|
-
// only load extra google script when not yet loaded
|
|
2051
|
-
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) {
|
|
2052
|
-
import('@react-google-maps/api').then((m) => {
|
|
2053
|
-
setLoadScript(() => m.LoadScript);
|
|
2054
|
-
});
|
|
2055
|
-
}
|
|
2056
|
-
}, []);
|
|
2057
|
-
return (React__default.createElement(Autocomplete, Object.assign({ defaultValue: defaultValue, value: value, onChange: onChangeAutocomplete, data: predictions.map((pred) => {
|
|
2058
|
-
return { value: pred.description, label: pred.description };
|
|
2059
|
-
}), filter: () => true, onItemSubmit: onClickItem, inputWrapperOrder: inputWrapperOrder, zIndex: ZINDEX_SSO - 9e6 + 2, withinPortal: true, styles: { dropdown: { pointerEvents: 'auto' } }, inputContainer: (children) => {
|
|
2060
|
-
return (React__default.createElement(React__default.Fragment, null,
|
|
2061
|
-
LoadScript && (React__default.createElement(LoadScript, { googleMapsApiKey: GOOGLE_API_KEY, libraries: libraries, loadingElement: React__default.createElement(React__default.Fragment, null), style: { width: '100%' } })),
|
|
2062
|
-
children));
|
|
2063
|
-
} }, restProps)));
|
|
2064
|
-
};
|
|
2065
|
-
|
|
2066
|
-
const LEADGEN_ORDER_INPUT_WRAPPER = [
|
|
2067
|
-
'label',
|
|
2068
|
-
'input',
|
|
2069
|
-
'description',
|
|
2070
|
-
'error',
|
|
2071
|
-
];
|
|
2072
|
-
const LeadGenForm = forwardRef((props, ref) => {
|
|
2073
|
-
const { locale, blocks, scrollToErrorField = true, form: formProps, rules: validate, initialValues, onFinish, onFinishFailed, className, style, } = props;
|
|
2074
|
-
const formRef = useRef(null);
|
|
2075
|
-
const form = formProps || useForm({ initialValues, validate });
|
|
2076
|
-
const middlewareFinish = (values, event) => {
|
|
2077
|
-
onFinish === null || onFinish === void 0 ? void 0 : onFinish(values, event);
|
|
2078
|
-
};
|
|
2079
|
-
const middlewareFinishFailed = (errors, values, events) => {
|
|
2080
|
-
if (scrollToErrorField && errors) {
|
|
2081
|
-
const firstErrorKey = Object.keys(errors)[0];
|
|
2082
|
-
const firstErrorElement = document.querySelector(`[name="${firstErrorKey}"]`);
|
|
2083
|
-
if (firstErrorElement && (firstErrorElement === null || firstErrorElement === void 0 ? void 0 : firstErrorElement.focus)) {
|
|
2084
|
-
setTimeout(() => {
|
|
2085
|
-
firstErrorElement === null || firstErrorElement === void 0 ? void 0 : firstErrorElement.focus();
|
|
2086
|
-
firstErrorElement.scrollIntoView({
|
|
2087
|
-
behavior: 'auto',
|
|
2088
|
-
block: 'center',
|
|
2089
|
-
inline: 'center',
|
|
2090
|
-
});
|
|
2091
|
-
}, 100);
|
|
2092
|
-
}
|
|
2093
|
-
}
|
|
2094
|
-
onFinishFailed === null || onFinishFailed === void 0 ? void 0 : onFinishFailed(errors, values, events);
|
|
2095
|
-
};
|
|
2096
|
-
useEffect(() => {
|
|
2097
|
-
(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
2098
|
-
if (!window.intlTelInputUtils) {
|
|
2099
|
-
yield require('intl-tel-input/build/js/utils');
|
|
2100
|
-
}
|
|
2101
|
-
}))();
|
|
2102
|
-
}, []);
|
|
2103
|
-
useImperativeHandle(ref, () => (Object.assign(Object.assign({}, form), { submit: () => formRef.current.requestSubmit() })), [form, formRef]);
|
|
2104
|
-
if (!blocks || !blocks.length) {
|
|
2105
|
-
return null;
|
|
2106
|
-
}
|
|
2107
|
-
return (React__default.createElement("form", { ref: formRef, onSubmit: form.onSubmit(middlewareFinish, middlewareFinishFailed), className: className, style: style },
|
|
2108
|
-
React__default.createElement(StyledLeadGenFormInner, { className: "leadgen-form_inputs" }, blocks.map((block, idx) => {
|
|
2109
|
-
const { id, name: blockName, data } = block;
|
|
2110
|
-
const { placeholder, value: name, required, listQuestion, valueHTML, isSendMailChimp = false, } = data;
|
|
2111
|
-
const formInputProps = form.getInputProps(name);
|
|
2112
|
-
const { value, error } = formInputProps;
|
|
2113
|
-
const reactKey = `${id}-${idx}`;
|
|
2114
|
-
switch (blockName) {
|
|
2115
|
-
case LEADGEN_BLOCK.TextBlock: {
|
|
2116
|
-
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2117
|
-
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))));
|
|
2118
|
-
}
|
|
2119
|
-
case LEADGEN_BLOCK.NumberBlock: {
|
|
2120
|
-
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2121
|
-
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))));
|
|
2122
|
-
}
|
|
2123
|
-
case LEADGEN_BLOCK.EmailBlock: {
|
|
2124
|
-
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2125
|
-
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))));
|
|
2126
|
-
}
|
|
2127
|
-
case LEADGEN_BLOCK.PhoneOtpBlock:
|
|
2128
|
-
case LEADGEN_BLOCK.WhatsappOtpBlock:
|
|
2129
|
-
case LEADGEN_BLOCK.ZaloOtpBlock:
|
|
2130
|
-
case LEADGEN_BLOCK.PhoneBlock: {
|
|
2131
|
-
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2132
|
-
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))));
|
|
2133
|
-
}
|
|
2134
|
-
case LEADGEN_BLOCK.LocationBlock: {
|
|
2135
|
-
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2136
|
-
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))));
|
|
2137
|
-
}
|
|
2138
|
-
case LEADGEN_BLOCK.DateBlock: {
|
|
2139
|
-
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2140
|
-
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))));
|
|
2141
|
-
}
|
|
2142
|
-
case LEADGEN_BLOCK.DropdownBlock:
|
|
2143
|
-
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2144
|
-
React__default.createElement("div", { style: { display: 'none' }, "data-extra": true, "data-name": value, "data-control": 'dropdown' }),
|
|
2145
|
-
React__default.createElement(Select$1, Object.assign({ name: name, withAsterisk: required, label: placeholder, placeholder: placeholder, data: listQuestion.map((l) => ({
|
|
2146
|
-
value: l.value,
|
|
2147
|
-
label: l.placeholder,
|
|
2148
|
-
})) }, formInputProps))));
|
|
2149
|
-
case LEADGEN_BLOCK.CheckboxBlock: {
|
|
2150
|
-
const formInputCheckboxProps = form.getInputProps(name, {
|
|
2151
|
-
type: 'checkbox',
|
|
2152
|
-
});
|
|
2153
|
-
return (React__default.createElement(ChoiceField$1, { className: "leadgen-form_input leadgen-form_input_checkbox", key: reactKey },
|
|
2154
|
-
isSendMailChimp && (React__default.createElement("div", { style: { display: 'none' }, "data-name": name + '-mailchimp' })),
|
|
2155
|
-
React__default.createElement(Checkbox$1.Group, Object.assign({ size: "md", withAsterisk: required, label: placeholder, value: value, sx: {
|
|
2156
|
-
display: 'flex',
|
|
2157
|
-
flexDirection: 'column',
|
|
2158
|
-
flexWrap: 'wrap',
|
|
2159
|
-
gap: 8,
|
|
2160
|
-
}, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, inputContainer: (children) => {
|
|
2161
|
-
return (React__default.createElement("div", { className: "leadgen-choiceContainer" }, children));
|
|
2162
|
-
} }, formInputCheckboxProps), listQuestion.map((l, _idx) => (React__default.createElement(Checkbox$1, { name: name, key: _idx, value: l.value, label: l.placeholder, "data-control": "checkbox" }))))));
|
|
2163
|
-
}
|
|
2164
|
-
case LEADGEN_BLOCK.RadioBlock: {
|
|
2165
|
-
return (React__default.createElement(ChoiceField$1, { className: "leadgen-form_input leadgen-form_input_checkbox", key: reactKey },
|
|
2166
|
-
isSendMailChimp && (React__default.createElement("div", { style: { display: 'none' }, "data-name": name + '-mailchimp' })),
|
|
2167
|
-
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) => {
|
|
2168
|
-
return (React__default.createElement("div", { className: "leadgen-choiceContainer" }, children));
|
|
2169
|
-
} }, formInputProps), listQuestion.map((l, _index) => (React__default.createElement(Radio$1, { name: name, key: _index, value: l.value, label: l.placeholder, "data-control": "radio" }))))));
|
|
2170
|
-
}
|
|
2171
|
-
case 'TncBlock':
|
|
2172
|
-
return (React__default.createElement(ChoiceField$1, { className: "leadgen-form_input leadgen-form_input_checkbox", key: reactKey },
|
|
2173
|
-
React__default.createElement(Input$1.Wrapper, { error: error },
|
|
2174
|
-
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)))));
|
|
2175
|
-
default: {
|
|
2176
|
-
return null;
|
|
2177
|
-
}
|
|
2178
|
-
}
|
|
2179
|
-
}))));
|
|
2180
|
-
});
|
|
2181
|
-
|
|
2182
|
-
const StyledLeadGenThankYou = styled.div `
|
|
2183
|
-
display: flex;
|
|
2184
|
-
gap: 8px;
|
|
2185
|
-
flex-direction: column;
|
|
2186
|
-
padding-block: 24px;
|
|
2187
|
-
|
|
2188
|
-
.leadgen-image {
|
|
2189
|
-
width: 120px;
|
|
2190
|
-
height: 120px;
|
|
2191
|
-
margin-inline: auto;
|
|
2192
|
-
object-fit: contain;
|
|
2193
|
-
object-position: center;
|
|
2194
|
-
text-align: center;
|
|
2195
|
-
}
|
|
2196
|
-
|
|
2197
|
-
.leadgen-title {
|
|
2198
|
-
margin-block: 0;
|
|
2199
|
-
color: ${theme.colors.gray900};
|
|
2200
|
-
font-weight: 700;
|
|
2201
|
-
font-size: 18px;
|
|
2202
|
-
line-height: 28px;
|
|
2203
|
-
letter-spacing: -0.2px;
|
|
2204
|
-
}
|
|
2205
|
-
|
|
2206
|
-
.leadgen-description {
|
|
2207
|
-
margin-block: 0;
|
|
2208
|
-
color: ${theme.colors.gray600};
|
|
2209
|
-
font-weight: 400;
|
|
2210
|
-
font-size: 14px;
|
|
2211
|
-
line-height: 22px;
|
|
2212
|
-
letter-spacing: -0.2px;
|
|
2213
|
-
text-align: center;
|
|
2214
|
-
}
|
|
2215
|
-
|
|
2216
|
-
> [data-align] {
|
|
2217
|
-
&[data-align='right'] {
|
|
2218
|
-
text-align: right;
|
|
2219
|
-
}
|
|
2220
|
-
&[data-align='center'] {
|
|
2221
|
-
text-align: center;
|
|
2222
|
-
}
|
|
2223
|
-
}
|
|
2224
|
-
`;
|
|
2225
|
-
const LeadGenThankYou = ({ image, title, description, showButton = false, button, className, style, }) => {
|
|
2226
|
-
const { src } = image;
|
|
2227
|
-
const { htmlText: titleText, align: titleAlign } = title;
|
|
2228
|
-
const { htmlText: descriptionText, align: descriptionAlign } = description;
|
|
2229
|
-
const { htmlText: buttonText, newtab, url, onClick } = button;
|
|
2230
|
-
return (React__default.createElement(StyledLeadGenThankYou, { className: className, style: style },
|
|
2231
|
-
React__default.createElement("img", { src: src, alt: "", className: "leadgen-thankyou_image leadgen-image" }),
|
|
2232
|
-
React__default.createElement("p", { className: "leadgen-thankyou_title leadgen-title", "data-align": titleAlign }, titleText),
|
|
2233
|
-
React__default.createElement("p", { className: "leadgen-thankyou_description leadgen-description", "data-align": descriptionAlign }, descriptionText),
|
|
2234
|
-
!!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))));
|
|
2235
|
-
};
|
|
2236
|
-
|
|
2237
|
-
const StyledLeadGenSubscriptionBoxBody = styled.div `
|
|
2238
|
-
margin-top: 16px;
|
|
2239
|
-
.leadgen-btn {
|
|
2240
|
-
margin-top: 16px;
|
|
2241
|
-
}
|
|
2242
|
-
`;
|
|
2243
|
-
const StyledLeadGenSubscriptionBoxHeaderImage = styled.div `
|
|
2244
|
-
margin-top: 3px;
|
|
2245
|
-
margin-right: 20px;
|
|
2246
|
-
width: 44px;
|
|
2247
|
-
height: 44px;
|
|
2248
|
-
|
|
2249
|
-
img {
|
|
2250
|
-
width: 100%;
|
|
2251
|
-
height: 100%;
|
|
2252
|
-
object-fix: contain;
|
|
2253
|
-
onject-position: center;
|
|
2254
|
-
}
|
|
2255
|
-
|
|
2256
|
-
:has(img[src='']) {
|
|
2257
|
-
display: none;
|
|
2258
|
-
}
|
|
2259
|
-
`;
|
|
2260
|
-
const StyledLeadGenSubscriptionBoxHeader = styled.div `
|
|
2261
|
-
display: flex;
|
|
2262
|
-
align-items: center;
|
|
2263
|
-
margin-bottom: 16px;
|
|
2264
|
-
.leadgen-title {
|
|
2265
|
-
margin-bottom: 0;
|
|
2266
|
-
flex: 1;
|
|
2267
|
-
min-width: 0;
|
|
2268
|
-
color: ${theme.colors.gray900};
|
|
2269
|
-
font-size: 18px;
|
|
2270
|
-
font-weight: 600;
|
|
2271
|
-
line-height: 1.4;
|
|
2272
|
-
letter-spacing: -0.8px;
|
|
2273
|
-
}
|
|
2274
|
-
`;
|
|
2275
|
-
const StyledLeadGenSubscriptionBox = styled.div `
|
|
2276
|
-
padding: 16px;
|
|
2277
|
-
border: 1px solid ${theme.colors.neutral100};
|
|
2278
|
-
border-radius: 12px;
|
|
2279
|
-
margin-inline: auto;
|
|
2280
|
-
.leadgen-form_inputs {
|
|
2281
|
-
.leadgen-form_input {
|
|
2282
|
-
width: 100%;
|
|
2283
|
-
}
|
|
2284
|
-
}
|
|
2285
|
-
|
|
2286
|
-
.leadgen-form_input {
|
|
2287
|
-
.mantine-Input-wrapper {
|
|
2288
|
-
max-height: 56px;
|
|
2289
|
-
}
|
|
2290
|
-
}
|
|
2291
|
-
|
|
2292
|
-
@media screen and (min-width: 768px) {
|
|
2293
|
-
.leadgen-subscription_box_body {
|
|
2294
|
-
display: flex;
|
|
2295
|
-
> form {
|
|
2296
|
-
flex: 1;
|
|
2297
|
-
min-width: 0;
|
|
2298
|
-
|
|
2299
|
-
.leadgen-form_inputs {
|
|
2300
|
-
.leadgen-form_input {
|
|
2301
|
-
width: calc(50% - 4px);
|
|
2302
|
-
}
|
|
2303
|
-
}
|
|
2304
|
-
}
|
|
2305
|
-
|
|
2306
|
-
.leadgen-btn {
|
|
2307
|
-
margin-top: 0;
|
|
2308
|
-
margin-left: 8px;
|
|
2309
|
-
width: auto;
|
|
2310
|
-
min-height: 56px;
|
|
2311
|
-
}
|
|
2312
|
-
}
|
|
2313
|
-
}
|
|
2314
|
-
`;
|
|
2315
|
-
const LeadGenSubscriptionBoxWithoutMemo = ({ locale, userInfo, siteId, siteDomain, forceCampaign, campaign_code, article_id, subscription_title: subscriptionTitleProps, }) => {
|
|
2316
|
-
var _a, _b, _c;
|
|
2317
|
-
const refContainer = useRef(null);
|
|
2318
|
-
const validatingEmailRef = useRef(false);
|
|
2319
|
-
const validatingPhoneRef = useRef(false);
|
|
2320
|
-
const { image, extra_fields, id: campaign_id, bot_id: campaign_subot_id = [], ThankYouBlock, } = forceCampaign || {};
|
|
2321
|
-
const { textBlocks, listBlockAdded, actionBlocks } = extra_fields || {};
|
|
2322
|
-
const { submitBlock } = actionBlocks || {};
|
|
2323
|
-
const [loading, setLoading] = useState(false);
|
|
2324
|
-
const [showThankyou, setShowThankyou] = useState(false);
|
|
2325
|
-
const formRef = useRef(null);
|
|
2326
|
-
const { form, validateObj } = useLeadFormConfig({
|
|
2327
|
-
listBlockAdded,
|
|
2328
|
-
campaignId: campaign_id,
|
|
2329
|
-
campaign_subot_id,
|
|
2330
|
-
validatingEmailRef,
|
|
2331
|
-
validatingPhoneRef,
|
|
2332
|
-
userInfo,
|
|
2333
|
-
});
|
|
2334
|
-
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]);
|
|
2335
|
-
const { image: thankyouImage, title: thankyouTitle, description: thankyouDescription, button: thankyouButton, } = ThankYouBlock || {};
|
|
2336
|
-
const { apiUrl } = useMemo(() => {
|
|
2337
|
-
let apiUrl = leadStore.apiLeadUrl;
|
|
2338
|
-
if (apiUrl.includes('localhost')) {
|
|
2339
|
-
apiUrl = 'https://dev.leadgen.hellobacsi.com/';
|
|
2340
|
-
}
|
|
2341
|
-
return {
|
|
2342
|
-
apiUrl,
|
|
2343
|
-
};
|
|
2344
|
-
}, [siteDomain, siteId]);
|
|
2345
|
-
const url = useMemo(() => location.href.toLowerCase() || '', []);
|
|
2346
|
-
const article_title = useMemo(() => document.title || '', []);
|
|
2347
|
-
const cookie_id = useMemo(() => getCookie('hhg-id') || null, []);
|
|
2348
|
-
const ga_client_id = useMemo(() => getCookie('_ga') || null, []);
|
|
2349
|
-
const leadgenImpression = useCallback(() => {
|
|
2350
|
-
Service.campaignPostImpression({
|
|
2351
|
-
url,
|
|
2352
|
-
action: LEADGEN_ACTIONS.SCROLL,
|
|
2353
|
-
code: campaign_code,
|
|
2354
|
-
title_article: article_title,
|
|
2355
|
-
cookie_id,
|
|
2356
|
-
ga_client_id,
|
|
2357
|
-
extra: { cookie_id, article_id, subscription_title },
|
|
2358
|
-
});
|
|
2359
|
-
}, [
|
|
2360
|
-
article_id,
|
|
2361
|
-
article_title,
|
|
2362
|
-
cookie_id,
|
|
2363
|
-
ga_client_id,
|
|
2364
|
-
campaign_code,
|
|
2365
|
-
subscription_title,
|
|
2366
|
-
]);
|
|
2367
|
-
const intersectionObserverCallback = useCallback((entries) => {
|
|
2368
|
-
entries.forEach((entry) => {
|
|
2369
|
-
const { isIntersecting, target } = entry;
|
|
2370
|
-
if (isIntersecting && target === refContainer.current) {
|
|
2371
|
-
leadgenImpression();
|
|
2372
|
-
}
|
|
2373
|
-
});
|
|
2374
|
-
}, [leadgenImpression]);
|
|
2375
|
-
const IObserver = new IntersectionObserver(intersectionObserverCallback);
|
|
2376
|
-
const middlewareOnSubmit = useCallback((value) => __awaiter(void 0, void 0, void 0, function* () {
|
|
2377
|
-
const newValue = {
|
|
2378
|
-
url,
|
|
2379
|
-
article_title,
|
|
2380
|
-
cookie_id,
|
|
2381
|
-
ga_client_id,
|
|
2382
|
-
article_id,
|
|
2383
|
-
campaign_id,
|
|
2384
|
-
campaign_code,
|
|
2385
|
-
subscription_title: subscription_title,
|
|
2386
|
-
};
|
|
2387
|
-
listBlockAdded.forEach(({ data: { value: k } }) => {
|
|
2388
|
-
newValue[k] = value[k];
|
|
2389
|
-
});
|
|
2390
|
-
setLoading(true);
|
|
2391
|
-
try {
|
|
2392
|
-
const { _data } = (yield Service.campaignPostLead({ data: newValue })) || {};
|
|
2393
|
-
const { model } = _data;
|
|
2394
|
-
if (model && model.id) {
|
|
2395
|
-
setShowThankyou(true);
|
|
2396
|
-
}
|
|
2397
|
-
}
|
|
2398
|
-
catch (error) {
|
|
2399
|
-
console.log('** Error : ', error);
|
|
2400
|
-
}
|
|
2401
|
-
setLoading(false);
|
|
2402
|
-
}), [
|
|
2403
|
-
url,
|
|
2404
|
-
article_id,
|
|
2405
|
-
article_title,
|
|
2406
|
-
cookie_id,
|
|
2407
|
-
ga_client_id,
|
|
2408
|
-
campaign_code,
|
|
2409
|
-
subscription_title,
|
|
2410
|
-
listBlockAdded,
|
|
2411
|
-
]);
|
|
2412
|
-
useEffect(() => {
|
|
2413
|
-
if (refContainer.current) {
|
|
2414
|
-
IObserver.observe(refContainer.current);
|
|
2415
|
-
}
|
|
2416
|
-
return () => {
|
|
2417
|
-
IObserver.disconnect();
|
|
2418
|
-
};
|
|
2419
|
-
}, [
|
|
2420
|
-
url,
|
|
2421
|
-
article_id,
|
|
2422
|
-
article_title,
|
|
2423
|
-
ga_client_id,
|
|
2424
|
-
campaign_id,
|
|
2425
|
-
campaign_code,
|
|
2426
|
-
subscription_title,
|
|
2427
|
-
]);
|
|
2428
|
-
return (React__default.createElement("div", { ref: refContainer },
|
|
2429
|
-
React__default.createElement(StyledLeadGenSubscriptionBox, null,
|
|
2430
|
-
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 })),
|
|
2431
|
-
!showThankyou && (React__default.createElement(React__default.Fragment, null,
|
|
2432
|
-
React__default.createElement(StyledLeadGenSubscriptionBoxHeader, null,
|
|
2433
|
-
!!image && (React__default.createElement(StyledLeadGenSubscriptionBoxHeaderImage, null,
|
|
2434
|
-
React__default.createElement("img", { src: image, alt: "" }))),
|
|
2435
|
-
React__default.createElement("p", { className: "leadgen-title" }, subscription_title)),
|
|
2436
|
-
React__default.createElement(StyledLeadGenSubscriptionBoxBody, { className: "leadgen-subscription_box_body" },
|
|
2437
|
-
React__default.createElement(LeadGenForm, { ref: formRef, form: form, rules: validateObj, blocks: listBlockAdded, locale: locale, onFinish: middlewareOnSubmit }),
|
|
2438
|
-
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)))))));
|
|
2439
|
-
};
|
|
2440
|
-
const LeadGenSubscriptionBoxWithMemo = memo(LeadGenSubscriptionBoxWithoutMemo);
|
|
2441
|
-
|
|
2442
|
-
const Container = () => {
|
|
2443
|
-
const context = useContext(LeadGenSubscriptionBoxContext);
|
|
2444
|
-
const {
|
|
2445
|
-
// apiUrl: apiUrlProps,
|
|
2446
|
-
// apiSubotUrl,
|
|
2447
|
-
campaign_code, article_id, subscription_title, locale, siteId, siteDomain, userInfo, forceCampaign, } = context;
|
|
2448
|
-
if (!forceCampaign || !(forceCampaign === null || forceCampaign === void 0 ? void 0 : forceCampaign.id)) {
|
|
2449
|
-
return null;
|
|
2450
|
-
}
|
|
2451
|
-
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 }));
|
|
2452
|
-
};
|
|
2453
|
-
Container.displayName = 'LeadGenSubscriptionBox';
|
|
2454
|
-
const LeadGenSubscriptionBoxContainer = (props) => {
|
|
2455
|
-
const { campaign_code } = props;
|
|
2456
|
-
if (!campaign_code) {
|
|
2457
|
-
return null;
|
|
2458
|
-
}
|
|
2459
|
-
return (React__default.createElement(LeadGenSubscriptionBoxProvider, Object.assign({}, props),
|
|
2460
|
-
React__default.createElement(Container, null)));
|
|
2461
|
-
};
|
|
2462
|
-
const LeadGenSubscriptionBox = LeadGenSubscriptionBoxContainer;
|
|
2463
|
-
|
|
2464
|
-
const useImageSize = (src) => {
|
|
2465
|
-
const [width, setWidth] = useState(16);
|
|
2466
|
-
const [height, setHeight] = useState(9);
|
|
2467
|
-
const [loaded, setLoaded] = useState(false);
|
|
2468
|
-
// load src image to get its width and height
|
|
2469
|
-
useEffect(() => {
|
|
2470
|
-
setLoaded(false);
|
|
2471
|
-
if (src) {
|
|
2472
|
-
const img = new Image();
|
|
2473
|
-
img.addEventListener('load', () => {
|
|
2474
|
-
setWidth(img.naturalWidth);
|
|
2475
|
-
setHeight(img.naturalHeight);
|
|
2476
|
-
setLoaded(true);
|
|
2477
|
-
});
|
|
2478
|
-
img.addEventListener('error', () => {
|
|
2479
|
-
setWidth(16);
|
|
2480
|
-
setHeight(9);
|
|
2481
|
-
setLoaded(true);
|
|
2482
|
-
});
|
|
2483
|
-
img.src = src;
|
|
2484
|
-
}
|
|
2485
|
-
else {
|
|
2486
|
-
setWidth(16);
|
|
2487
|
-
setHeight(9);
|
|
2488
|
-
setLoaded(true);
|
|
2489
|
-
}
|
|
2490
|
-
}, [src]);
|
|
2491
|
-
return {
|
|
2492
|
-
loaded,
|
|
2493
|
-
width,
|
|
2494
|
-
height,
|
|
2495
|
-
};
|
|
2496
|
-
};
|
|
2497
|
-
|
|
2498
|
-
const CloseButton = ({ onClose, containerClassName, svgClassName, }) => (React__default.createElement("button", { onClick: onClose, className: `le-newbuilder-close-button js-modal__close ${containerClassName || ''}` },
|
|
2499
|
-
React__default.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 20 20", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", className: svgClassName },
|
|
2500
|
-
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" }))));
|
|
2501
|
-
|
|
2502
|
-
// url: imageBlocks.imageMobile.data.url
|
|
2503
|
-
// newTab: imageBlocks.imageMobile.data.newtab
|
|
2504
|
-
// imageMobile: campaignShow.image
|
|
2505
|
-
// imageDestkop: campaignShow.image_desktop
|
|
2506
|
-
const CenterTabLayout = ({ popupId, url, newTab, imageDestkop, imageMobile, onClose, onOtherSubmit, }) => {
|
|
2507
|
-
const { width: imageMobileWidth, height: imageMobileHeight, loaded: imageMobileLoaded, } = useImageSize(imageMobile);
|
|
2508
|
-
const { width: imageDestkopWidth, height: imageDestkopHeight, loaded: imageDestkopLoaded, } = useImageSize(imageDestkop);
|
|
2509
|
-
if (!imageMobileLoaded || !imageDestkopLoaded)
|
|
2510
|
-
return null;
|
|
2511
|
-
return (React__default.createElement("div", { id: popupId, className: "lead-modal-wrapper", "data-popup-url": location.pathname, "data-popup-type": "center_tab" },
|
|
2512
|
-
React__default.createElement("div", { className: "le-center-tab-popup" },
|
|
2513
|
-
React__default.createElement("div", { style: { position: 'relative' } },
|
|
2514
|
-
React__default.createElement("a", { className: "js-popup-other-submit", href: url, target: newTab ? 'blank' : '_parent', onClick: onOtherSubmit },
|
|
2515
|
-
isVideo(imageMobile) ? (React__default.createElement("video", { loop: true, muted: true, autoPlay: true, className: "le-only-mobile" },
|
|
2516
|
-
React__default.createElement("source", { src: imageMobile }))) : (React__default.createElement("img", { className: "le-only-mobile", src: imageMobile, style: {
|
|
2517
|
-
aspectRatio: `${imageMobileWidth}/${imageMobileHeight}`,
|
|
2518
|
-
} })),
|
|
2519
|
-
isVideo(imageDestkop) ? (React__default.createElement("video", { loop: true, muted: true, autoPlay: true, className: "le-only-desktop" },
|
|
2520
|
-
React__default.createElement("source", { src: imageDestkop }))) : (React__default.createElement("img", { className: "le-only-desktop", src: imageDestkop, style: {
|
|
2521
|
-
aspectRatio: `${imageDestkopWidth}/${imageDestkopHeight}`,
|
|
2522
|
-
} }))),
|
|
2523
|
-
React__default.createElement(CloseButton, { onClose: onClose, containerClassName: "close-button-top-right" })))));
|
|
1385
|
+
return (React__default.createElement("div", { id: popupId, className: "lead-modal-wrapper", "data-popup-url": location.pathname, "data-popup-type": "center_tab" },
|
|
1386
|
+
React__default.createElement("div", { className: "le-center-tab-popup" },
|
|
1387
|
+
React__default.createElement("div", { style: { position: 'relative' } },
|
|
1388
|
+
React__default.createElement("a", { className: "js-popup-other-submit", href: url, target: newTab ? 'blank' : '_parent', onClick: onOtherSubmit },
|
|
1389
|
+
isVideo(imageMobile) ? (React__default.createElement("video", { loop: true, muted: true, autoPlay: true, className: "le-only-mobile" },
|
|
1390
|
+
React__default.createElement("source", { src: imageMobile }))) : (React__default.createElement("img", { className: "le-only-mobile", src: imageMobile, style: {
|
|
1391
|
+
aspectRatio: `${imageMobileWidth}/${imageMobileHeight}`,
|
|
1392
|
+
} })),
|
|
1393
|
+
isVideo(imageDestkop) ? (React__default.createElement("video", { loop: true, muted: true, autoPlay: true, className: "le-only-desktop" },
|
|
1394
|
+
React__default.createElement("source", { src: imageDestkop }))) : (React__default.createElement("img", { className: "le-only-desktop", src: imageDestkop, style: {
|
|
1395
|
+
aspectRatio: `${imageDestkopWidth}/${imageDestkopHeight}`,
|
|
1396
|
+
} }))),
|
|
1397
|
+
React__default.createElement(CloseButton, { onClose: onClose, containerClassName: "close-button-top-right" })))));
|
|
2524
1398
|
};
|
|
2525
1399
|
|
|
2526
1400
|
// title: titleText
|
|
@@ -2742,6 +1616,211 @@ const EmptyComponent = ({ onClose, onContinue, }) => {
|
|
|
2742
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')))));
|
|
2743
1617
|
};
|
|
2744
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
|
+
|
|
2745
1824
|
const SubtitleBlock = ({ children, align, }) => (React__default.createElement("p", { className: `lead-modal__description ${'le-text-align-' + (align || '')} ${LEAD_CLASS}` }, children));
|
|
2746
1825
|
|
|
2747
1826
|
const cssInputNotShrink = css `
|
|
@@ -3060,13 +2139,11 @@ const TextField = (props) => {
|
|
|
3060
2139
|
const $focusEl = $textEl.item($textEl.length - 1);
|
|
3061
2140
|
if ($focusEl) {
|
|
3062
2141
|
$focusEl.focus();
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
});
|
|
3069
|
-
}, 100);
|
|
2142
|
+
$focusEl.scrollIntoView({
|
|
2143
|
+
behavior: 'auto',
|
|
2144
|
+
block: 'center',
|
|
2145
|
+
inline: 'start',
|
|
2146
|
+
});
|
|
3070
2147
|
}
|
|
3071
2148
|
}, [shrink]);
|
|
3072
2149
|
useEffect(() => {
|
|
@@ -3466,7 +2543,7 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
3466
2543
|
const isDrawer = isLightBoxB && isMobile;
|
|
3467
2544
|
const limitFieldsLightBoxB = isLightBoxB && listBlockAdded.length <= LEADGEN_LIMIT_LIGHTBOXB;
|
|
3468
2545
|
const hasForm = isLightBoxA
|
|
3469
|
-
? listBlockAdded.some((item) =>
|
|
2546
|
+
? listBlockAdded.some((item) => LEADGEN_BLOCK_IN_FORM.some((k) => k === (item === null || item === void 0 ? void 0 : item.name)))
|
|
3470
2547
|
: true;
|
|
3471
2548
|
const headerInsideFormContainer = isSlider || isLightBoxA || isFullscreen;
|
|
3472
2549
|
const showHeader = !!imageMobile || !!imageDesktop;
|
|
@@ -4510,4 +3587,4 @@ LeadGen.Thankyou = Thankyou;
|
|
|
4510
3587
|
LeadGen.OtpForm = OtpBlock$1;
|
|
4511
3588
|
LeadGen.Close = Close;
|
|
4512
3589
|
|
|
4513
|
-
export { LeadGen
|
|
3590
|
+
export { LeadGen };
|