@hhgtech/hhg-components 1.29.311 → 1.29.313
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/README.md +2 -0
- package/build/{LastPeriod-2107ce0b.js → LastPeriod-45f1e2f6.js} +1 -1
- package/build/{MobileBottomNavigationIcon-2fa0dfec.js → MobileBottomNavigationIcon-433e3a07.js} +3 -3
- package/build/{Spinner-5eeed23a.js → Spinner-face3518.js} +1 -1
- package/build/{WhatsApp-93a9b026.js → WhatsApp-d3841ed4.js} +1 -1
- package/build/adapters.js +19 -19
- package/build/atoms.js +46 -46
- 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/mantine/modal/index.d.ts +2 -2
- package/build/components/mantine/phone/countrySelect.d.ts +1 -1
- package/build/components/mantine/phone/phoneWithCustomCountrySelect.d.ts +1 -0
- package/build/components.js +90 -90
- package/build/{constants-a3c59889.js → constants-68c8613f.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-ecc818f0.js → core-fa60462e.js} +1 -1
- package/build/{dataTransform-df350bff.js → dataTransform-c0cf9a74.js} +1 -1
- package/build/ecom.js +4 -4
- package/build/{editor-40df96a9.js → editor-07359690.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-e3951455.js → LastPeriod-d37434a6.js} +1 -1
- package/build/esm/{MobileBottomNavigationIcon-9216cca7.js → MobileBottomNavigationIcon-68fe5671.js} +3 -3
- package/build/esm/{Spinner-903430aa.js → Spinner-bf1d8508.js} +1 -1
- package/build/esm/{WhatsApp-a64943bc.js → WhatsApp-c31f438a.js} +1 -1
- package/build/esm/adapters.js +19 -19
- package/build/esm/atoms.js +46 -46
- 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/mantine/modal/index.d.ts +2 -2
- package/build/esm/components/mantine/phone/countrySelect.d.ts +1 -1
- package/build/esm/components/mantine/phone/phoneWithCustomCountrySelect.d.ts +1 -0
- package/build/esm/components.js +90 -90
- package/build/esm/{constants-79f4e640.js → constants-1022462e.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-1a9ff9e4.js → core-107521b8.js} +1 -1
- package/build/esm/{dataTransform-c881832b.js → dataTransform-b11af8f7.js} +1 -1
- package/build/esm/ecom.js +4 -4
- package/build/esm/{editor-cf4bd5c2.js → editor-4d82ac35.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/{fixedBottomAdBlock-46427068.js → fixedBottomAdBlock-52178158.js} +24 -24
- package/build/esm/footer.js +21 -21
- package/build/esm/gAssets.js +2 -2
- package/build/esm/healthToolsCardWrapper.js +18 -18
- package/build/esm/healthToolsForm.js +33 -33
- package/build/esm/hooks.js +13 -13
- package/build/esm/i18n/translationKeys.d.ts +1 -1
- package/build/esm/i18n-values/en-PH.js +1 -0
- package/build/esm/i18n-values/hi-IN.js +1 -0
- package/build/esm/i18n-values/id-ID.js +1 -0
- package/build/esm/i18n-values/km-KH.js +2 -1
- package/build/esm/i18n-values/ms-MY.js +1 -0
- package/build/esm/i18n-values/my-MM.js +1 -0
- package/build/esm/i18n-values/th-TH.js +1 -0
- package/build/esm/i18n-values/tl-PH.js +1 -0
- package/build/esm/i18n-values/vi-VN.js +1 -0
- package/build/esm/i18n-values/vi-VN_MB.js +1 -0
- package/build/esm/i18n-values/zh-TW.js +1 -0
- package/build/esm/i18n.js +2 -2
- package/build/esm/i18nV2.js +2 -2
- package/build/esm/{index-75b8afb7.js → index-04e696f6.js} +1 -1
- package/build/esm/{index-2bf08a6b.js → index-0abb5e05.js} +2 -2
- package/build/esm/{index-4cc596e0.js → index-0cadb1ce.js} +7 -7
- package/build/esm/{index-10898fb6.js → index-0e9c4d34.js} +15 -15
- package/build/esm/{index-c85f723d.js → index-1110c164.js} +15 -15
- package/build/esm/{index-53014194.js → index-121f5432.js} +13 -13
- package/build/esm/{index-be992c75.js → index-1a6f786a.js} +3 -3
- package/build/esm/{index-d291e7d4.js → index-22a9f087.js} +3 -3
- package/build/esm/{index-41fff10e.js → index-25d5d608.js} +3 -3
- package/build/esm/{index-347f6319.js → index-2d56fa2c.js} +2 -2
- package/build/esm/{index-cf31f84c.js → index-30929126.js} +2 -2
- package/build/esm/{index-148c8577.js → index-3812913e.js} +5 -5
- package/build/esm/{index-434b8921.js → index-3958eacb.js} +21 -21
- package/build/esm/{index-13f9bf44.js → index-43fc0ae2.js} +30 -30
- package/build/esm/{index-308d4854.js → index-463ee5e4.js} +3 -3
- package/build/esm/{index-1d64e6cf.js → index-4ab87728.js} +26 -26
- package/build/esm/{index-116f69cf.js → index-4c5b80f4.js} +1 -1
- package/build/esm/{index-b4ead995.js → index-4e41dcc1.js} +2 -2
- package/build/esm/{index-2f27692b.js → index-5245edcb.js} +13 -13
- package/build/esm/{index-c5c4cd20.js → index-5f94e471.js} +6 -6
- package/build/esm/{index-14bfa2c9.js → index-686c3d4f.js} +2 -2
- package/build/esm/{index-88358d84.js → index-732791ce.js} +13 -13
- package/build/esm/{index-6354b22f.js → index-74e2a36f.js} +3 -3
- package/build/esm/{index-340d1a01.js → index-77247a43.js} +24 -24
- package/build/esm/{index-4c62f4db.js → index-7da27d56.js} +6 -6
- package/build/esm/{index-b6442a0d.js → index-7e60d7f3.js} +20 -20
- package/build/esm/{index-8d5b7ebd.js → index-85c83243.js} +16 -16
- package/build/esm/{index-e6e1a986.js → index-9210ad5b.js} +16 -16
- package/build/esm/{index-cde9ca6c.js → index-94d61e88.js} +19 -19
- package/build/esm/{index-3afff570.js → index-963a3873.js} +18 -18
- package/build/esm/{index-ca0e9bf8.js → index-96e6c866.js} +16 -16
- package/build/esm/{index-c5c3e71e.js → index-98590ec5.js} +2 -2
- package/build/esm/{index-9e9fd42c.js → index-9f219ef3.js} +1 -1
- package/build/esm/{index-d5dc6344.js → index-9fc9f759.js} +2 -2
- package/build/esm/{index-78e5203a.js → index-a8e2c3fe.js} +13 -13
- package/build/esm/{index-e33334d0.js → index-aa11ca3f.js} +2 -2
- package/build/esm/{index-6bb36621.js → index-aa3a7889.js} +1 -1
- package/build/esm/{index-a7f516ad.js → index-ac43c1ba.js} +2 -2
- package/build/esm/{index-81f30b2c.js → index-af19f67a.js} +6 -6
- package/build/esm/{index-060736dd.js → index-afb64d8d.js} +7 -7
- package/build/esm/{index-16e03c09.js → index-b39750e3.js} +2 -2
- package/build/esm/{index-cdb8c87e.js → index-bafde7a5.js} +1 -1
- package/build/esm/{index-0099b8f2.js → index-bee910f9.js} +1 -1
- package/build/esm/{index-ae56762e.js → index-c0ebffba.js} +17 -17
- package/build/esm/{index-e66f15e0.js → index-c80fcefd.js} +10 -10
- package/build/esm/{index-189a9824.js → index-c8b62137.js} +3 -3
- package/build/esm/{index-85f514dd.js → index-c920dc22.js} +17 -17
- package/build/esm/{index-630296c3.js → index-cc6913eb.js} +1 -1
- package/build/esm/{index-6c43703a.js → index-ce334d62.js} +6 -6
- package/build/esm/{index-3d3d0613.js → index-d02f8023.js} +2 -2
- package/build/esm/{index-4a13f41d.js → index-d9218757.js} +1 -1
- package/build/esm/{index-7da61d52.js → index-dca9ca35.js} +2 -2
- package/build/esm/{index-0202ef16.js → index-dff7d2bd.js} +3 -3
- package/build/esm/{index-d92ce05b.js → index-e77e2b31.js} +17 -17
- package/build/esm/{index-809fc2cb.js → index-eadeaa14.js} +32 -32
- package/build/esm/{index-b5a40899.js → index-eefc9f56.js} +11 -11
- package/build/esm/{index-dd2caaea.js → index-f015fbce.js} +4 -4
- package/build/esm/{index-66c9c3c6.js → index-f3a1a4d5.js} +16 -16
- package/build/esm/{index-fa13fe6b.js → index-f61f3197.js} +1 -1
- package/build/esm/{index-0fa8c9a5.js → index-fc4075dc.js} +5 -5
- package/build/esm/index.js +112 -112
- package/build/esm/interfaces/types/index.d.ts +1 -0
- package/build/esm/{labelSorting-76cf0104.js → labelSorting-45993b6f.js} +4 -4
- package/build/esm/lead.js +24 -24
- package/build/esm/{logoIcon-90c6ed4d.js → logoIcon-9e589a09.js} +2 -2
- package/build/esm/mantine.js +25 -25
- package/build/esm/misc.js +16 -16
- 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 +69 -69
- package/build/esm/moleculesArticleCard.js +6 -6
- package/build/esm/moleculesArticleCardV2.js +16 -16
- package/build/esm/navigation.js +40 -40
- 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 +44 -44
- package/build/esm/{post-0c8fcb47.js → post-e5e04a87.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/index.d.ts +1 -1
- package/build/esm/ssoV2/api/paths.d.ts +1 -0
- package/build/esm/ssoV2/index.d.ts +8 -0
- package/build/esm/ssoV2/screens/components/progressBar.d.ts +15 -0
- package/build/esm/ssoV2/screens/components/progressBar.utils.d.ts +9 -0
- package/build/esm/ssoV2/screens/components/setupLater.d.ts +6 -0
- package/build/esm/ssoV2/screens/components/zalo.d.ts +6 -0
- package/build/esm/ssoV2/screens/setup/otherSetup.d.ts +1 -1
- package/build/esm/ssoV2/ssoStateManager/store.d.ts +14 -0
- package/build/esm/ssoV2.js +594 -304
- package/build/esm/{store-2a1b6eeb.js → store-88f81657.js} +42 -19
- package/build/esm/subot.js +33 -33
- package/build/esm/surveyOrPremiumBanner.js +31 -31
- package/build/esm/surveyQuestionCard.js +10 -10
- package/build/esm/{surveyThankyouCard-876d3fa8.js → surveyThankyouCard-5eb36772.js} +5 -5
- package/build/esm/together.js +53 -53
- 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 +48 -48
- package/build/esm/togetherMoleculesCardAuthor.js +27 -27
- package/build/esm/togetherMoleculesPostImagePreview.js +11 -11
- package/build/esm/togetherMoleculesProfileDetail.js +37 -37
- package/build/esm/togetherOrganisms.js +47 -47
- package/build/esm/togetherRichTextEditor.js +17 -17
- package/build/esm/togetherShareBox.js +10 -10
- package/build/esm/{treePopoverMenu-b567b402.js → treePopoverMenu-a5c26692.js} +19 -19
- package/build/esm/{types-98286e03.js → types-2dedcc1a.js} +2 -2
- package/build/esm/types.js +2 -2
- package/build/esm/{useCategory-e9703fcc.js → useCategory-00d78d6d.js} +5 -5
- package/build/esm/{useHealthToolCache-497b3113.js → useHealthToolCache-b0f03357.js} +1 -1
- package/build/esm/{useMantineLocale-bd1e758a.js → useMantineLocale-ad1b21b5.js} +6 -6
- package/build/esm/{usePlacesAutocomplete-d6c6019b.js → usePlacesAutocomplete-c4349765.js} +1 -1
- package/build/esm/{useScreenSize-40c82c05.js → useScreenSize-2af6a44f.js} +2 -2
- package/build/esm/useTogetherAuthRequiredAction.js +9 -9
- package/build/esm/{utils-e5d33fe3.js → utils-1b24ff61.js} +2 -2
- package/build/esm/{utils-5f291626.js → utils-2645506d.js} +2 -2
- package/build/esm/{utils-10430638.js → utils-a27259d3.js} +3 -3
- package/build/esm/vaccination.js +21 -21
- package/build/{fixedBottomAdBlock-fb98a4e6.js → fixedBottomAdBlock-11489b86.js} +24 -24
- package/build/footer.js +21 -21
- package/build/gAssets.js +2 -2
- package/build/healthToolsCardWrapper.js +18 -18
- package/build/healthToolsForm.js +33 -33
- package/build/hooks.js +13 -13
- package/build/i18n/translationKeys.d.ts +1 -1
- package/build/i18n-values/en-PH.js +1 -0
- package/build/i18n-values/hi-IN.js +1 -0
- package/build/i18n-values/id-ID.js +1 -0
- package/build/i18n-values/km-KH.js +2 -1
- package/build/i18n-values/ms-MY.js +1 -0
- package/build/i18n-values/my-MM.js +1 -0
- package/build/i18n-values/th-TH.js +1 -0
- package/build/i18n-values/tl-PH.js +1 -0
- package/build/i18n-values/vi-VN.js +1 -0
- package/build/i18n-values/vi-VN_MB.js +1 -0
- package/build/i18n-values/zh-TW.js +1 -0
- package/build/i18n.js +1 -1
- package/build/i18nV2.js +1 -1
- package/build/{index-286cce3b.js → index-1090cd65.js} +17 -17
- package/build/{index-5874bcf9.js → index-140b3af8.js} +6 -6
- package/build/{index-46b2200b.js → index-176597cf.js} +16 -16
- package/build/{index-e1e08c25.js → index-181b726f.js} +2 -2
- package/build/{index-6ee7fe98.js → index-20d3b16b.js} +30 -30
- package/build/{index-56fff3f2.js → index-26737617.js} +1 -1
- package/build/{index-606a09c0.js → index-28f45b70.js} +1 -1
- package/build/{index-90ab1ea7.js → index-2b117aad.js} +3 -3
- package/build/{index-b6d27f9a.js → index-357c45bd.js} +21 -21
- package/build/{index-32f52199.js → index-3605a366.js} +4 -4
- package/build/{index-e8747d65.js → index-39bea41b.js} +13 -13
- package/build/{index-a834d49b.js → index-44128cb9.js} +3 -3
- package/build/{index-c3785047.js → index-454d7e3a.js} +2 -2
- package/build/{index-9a625f5e.js → index-4a32923e.js} +13 -13
- package/build/{index-95ccdb7f.js → index-58014552.js} +3 -3
- package/build/{index-c08747a6.js → index-5c5a04cf.js} +26 -26
- package/build/{index-4ee89043.js → index-5ce3738a.js} +3 -3
- package/build/{index-e67c5ae1.js → index-61d295e2.js} +1 -1
- package/build/{index-1e0434fd.js → index-6904ad61.js} +5 -5
- package/build/{index-3c10fbfa.js → index-6d865c87.js} +2 -2
- package/build/{index-99410d26.js → index-6de1a1e3.js} +2 -2
- package/build/{index-685db51a.js → index-72e01968.js} +24 -24
- package/build/{index-34fe205a.js → index-73604406.js} +10 -10
- package/build/{index-ee69c925.js → index-83a310bf.js} +2 -2
- package/build/{index-e811fb10.js → index-87d9b10d.js} +13 -13
- package/build/{index-ea370ff2.js → index-899c67d1.js} +17 -17
- package/build/{index-1d6281f6.js → index-8b862358.js} +1 -1
- package/build/{index-89b71178.js → index-8cf727aa.js} +3 -3
- package/build/{index-8aad4619.js → index-908ae11a.js} +18 -18
- package/build/{index-2baef874.js → index-a346a9f3.js} +1 -1
- package/build/{index-3aec5aee.js → index-ad9aaf70.js} +2 -2
- package/build/{index-d3872755.js → index-adbe391d.js} +2 -2
- package/build/{index-6089f95a.js → index-ae5b3f80.js} +16 -16
- package/build/{index-53aa2337.js → index-af5ea866.js} +15 -15
- package/build/{index-bfad3960.js → index-b1b249a8.js} +2 -2
- package/build/{index-fd92c8a1.js → index-b5efe3af.js} +6 -6
- package/build/{index-1f9ad2eb.js → index-b629c74a.js} +1 -1
- package/build/{index-96be67bf.js → index-b67f35d4.js} +2 -2
- package/build/{index-e649c3f8.js → index-b6aab3bd.js} +6 -6
- package/build/{index-9125292c.js → index-b916cb1a.js} +3 -3
- package/build/{index-e208b34a.js → index-b9f25270.js} +13 -13
- package/build/{index-2551c303.js → index-c03997f9.js} +1 -1
- package/build/{index-23805e05.js → index-c1e235c1.js} +6 -6
- package/build/{index-9de29abf.js → index-c6911315.js} +16 -16
- package/build/{index-969cd112.js → index-d0b2373f.js} +11 -11
- package/build/{index-76efb5fb.js → index-d198e797.js} +1 -1
- package/build/{index-4b623617.js → index-d2783263.js} +2 -2
- package/build/{index-4f1ed7eb.js → index-d877397a.js} +2 -2
- package/build/{index-40771dad.js → index-dc7fe767.js} +3 -3
- package/build/{index-4a04c1d8.js → index-dddb8f90.js} +7 -7
- package/build/{index-0c5b5a40.js → index-df3bb9c0.js} +20 -20
- package/build/{index-2e0023c8.js → index-df801365.js} +15 -15
- package/build/{index-4df71ee6.js → index-e11447bc.js} +17 -17
- package/build/{index-aef6ff34.js → index-e1ea002d.js} +32 -32
- package/build/{index-9e2d7c97.js → index-e51a7795.js} +5 -5
- package/build/{index-ad33b8f9.js → index-ea813cc2.js} +16 -16
- package/build/{index-188f5a1c.js → index-f2050806.js} +2 -2
- package/build/{index-95320aa8.js → index-f35ba3c5.js} +1 -1
- package/build/{index-8fc3d400.js → index-f7ed5a94.js} +7 -7
- package/build/{index-55e75fea.js → index-fefd209b.js} +19 -19
- package/build/index.js +112 -112
- package/build/interfaces/types/index.d.ts +1 -0
- package/build/{labelSorting-95a1a528.js → labelSorting-4d80b18c.js} +4 -4
- package/build/lead.js +24 -24
- package/build/{logoIcon-e5bd7343.js → logoIcon-cfabb762.js} +2 -2
- package/build/mantine.js +22 -22
- package/build/misc.js +16 -16
- 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 +69 -69
- package/build/moleculesArticleCard.js +6 -6
- package/build/moleculesArticleCardV2.js +16 -16
- package/build/navigation.js +40 -40
- package/build/navigationLogoutPopup.js +9 -9
- package/build/navigationProfileButton.js +23 -23
- package/build/onboardingV2.js +28 -28
- package/build/organisms.js +44 -44
- package/build/{post-88476eaa.js → post-f87fa496.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/index.d.ts +1 -1
- package/build/ssoV2/api/paths.d.ts +1 -0
- package/build/ssoV2/index.d.ts +8 -0
- package/build/ssoV2/screens/components/progressBar.d.ts +15 -0
- package/build/ssoV2/screens/components/progressBar.utils.d.ts +9 -0
- package/build/ssoV2/screens/components/setupLater.d.ts +6 -0
- package/build/ssoV2/screens/components/zalo.d.ts +6 -0
- package/build/ssoV2/screens/setup/otherSetup.d.ts +1 -1
- package/build/ssoV2/ssoStateManager/store.d.ts +14 -0
- package/build/ssoV2.js +590 -300
- package/build/{store-69bb3be7.js → store-8b9b4ed6.js} +44 -18
- package/build/subot.js +32 -32
- package/build/surveyOrPremiumBanner.js +31 -31
- package/build/surveyQuestionCard.js +10 -10
- package/build/{surveyThankyouCard-56f0ae37.js → surveyThankyouCard-b585deb6.js} +5 -5
- package/build/together.js +53 -53
- package/build/togetherApiUtils.js +4 -4
- package/build/togetherAtoms.js +30 -30
- package/build/togetherComponentGlobalContext.js +4 -4
- package/build/togetherMolecules.js +48 -48
- package/build/togetherMoleculesCardAuthor.js +27 -27
- package/build/togetherMoleculesPostImagePreview.js +11 -11
- package/build/togetherMoleculesProfileDetail.js +37 -37
- package/build/togetherOrganisms.js +47 -47
- package/build/togetherRichTextEditor.js +17 -17
- package/build/togetherShareBox.js +10 -10
- package/build/{treePopoverMenu-87ca9b4c.js → treePopoverMenu-0054901a.js} +19 -19
- package/build/{types-267e6ecb.js → types-7ce1a273.js} +2 -2
- package/build/types.js +2 -2
- package/build/{useCategory-601dc682.js → useCategory-b2bd46f7.js} +5 -5
- package/build/{useHealthToolCache-fb8ea8e7.js → useHealthToolCache-ab7bcb42.js} +1 -1
- package/build/{useMantineLocale-48052e4d.js → useMantineLocale-ceb915ca.js} +6 -6
- package/build/{usePlacesAutocomplete-32fb6ea6.js → usePlacesAutocomplete-38d7718f.js} +1 -1
- package/build/{useScreenSize-e56ada5a.js → useScreenSize-cfd48573.js} +2 -2
- package/build/useTogetherAuthRequiredAction.js +9 -9
- package/build/{utils-51039a43.js → utils-3becf24a.js} +2 -2
- package/build/{utils-bc112548.js → utils-573956e1.js} +2 -2
- package/build/{utils-741b2173.js → utils-a6e2076e.js} +3 -3
- package/build/vaccination.js +21 -21
- package/package.json +1 -1
- /package/build/{BMI_BOYS.percentile.monthly-93d6990e.js → BMI_BOYS.percentile.monthly-5423246f.js} +0 -0
- /package/build/{BMI_BOYS.percentile.weekly-9de93fe7.js → BMI_BOYS.percentile.weekly-e9b9a026.js} +0 -0
- /package/build/{BMI_BOYS.percentile.yearly-a40e7b56.js → BMI_BOYS.percentile.yearly-97aa1047.js} +0 -0
- /package/build/{BMI_BOYS.zscore.monthly-ba9026f5.js → BMI_BOYS.zscore.monthly-9c3ce283.js} +0 -0
- /package/build/{BMI_BOYS.zscore.weekly-a7de23e7.js → BMI_BOYS.zscore.weekly-f0b1b256.js} +0 -0
- /package/build/{BMI_BOYS.zscore.yearly-1416c78c.js → BMI_BOYS.zscore.yearly-368ae6e2.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.monthly-4790fce8.js → BMI_GIRLS.percentile.monthly-7897f7ee.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.weekly-f929726a.js → BMI_GIRLS.percentile.weekly-ab4f45fd.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.yearly-4387c6c5.js → BMI_GIRLS.percentile.yearly-349adc05.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.monthly-4c264643.js → BMI_GIRLS.zscore.monthly-fa9f004b.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.weekly-a133bb6e.js → BMI_GIRLS.zscore.weekly-dc949397.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.yearly-a0404db2.js → BMI_GIRLS.zscore.yearly-612414a3.js} +0 -0
- /package/build/{ChevronDown-aaa35ea2.js → ChevronDown-3ef25cb3.js} +0 -0
- /package/build/{Close-6c6e9720.js → Close-7bb11b9b.js} +0 -0
- /package/build/{Google-10b046ef.js → Google-f56afbdc.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-f63b1535.js → HEAD CIRCUM_BOYS.percentile.monthly-d042efb1.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-5a387c89.js → HEAD CIRCUM_BOYS.percentile.weekly-80b93b27.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-e257b63e.js → HEAD CIRCUM_BOYS.percentile.yearly-ad2d1728.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-2676a44b.js → HEAD CIRCUM_BOYS.zscore.monthly-59b77efa.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-4fee3b5b.js → HEAD CIRCUM_BOYS.zscore.weekly-be030123.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-545e264d.js → HEAD CIRCUM_BOYS.zscore.yearly-07deeb89.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-ae0d3971.js → HEAD CIRCUM_GIRLS.percentile.monthly-471ee5dd.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-b472028c.js → HEAD CIRCUM_GIRLS.percentile.weekly-38530577.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-7a362bfe.js → HEAD CIRCUM_GIRLS.percentile.yearly-7f0d074b.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-e48d6185.js → HEAD CIRCUM_GIRLS.zscore.monthly-57b04e2f.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-8a9676c2.js → HEAD CIRCUM_GIRLS.zscore.weekly-818a9725.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-d213569e.js → HEAD CIRCUM_GIRLS.zscore.yearly-60dc992f.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.monthly-57cf9281.js → HEIGHT_BOYS.percentile.monthly-aa7d9315.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.weekly-155a877f.js → HEIGHT_BOYS.percentile.weekly-1a15561b.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.yearly-94b0bdeb.js → HEIGHT_BOYS.percentile.yearly-4d3f9ced.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.monthly-4d7065ee.js → HEIGHT_BOYS.zscore.monthly-365a1af2.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.weekly-cc0f3ef4.js → HEIGHT_BOYS.zscore.weekly-79c5c893.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.yearly-1d12eeaa.js → HEIGHT_BOYS.zscore.yearly-4c142484.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.monthly-5af692bf.js → HEIGHT_GIRLS.percentile.monthly-fc8fa3fd.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.weekly-82607a5b.js → HEIGHT_GIRLS.percentile.weekly-68610d4b.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.yearly-1f188b70.js → HEIGHT_GIRLS.percentile.yearly-a4353e59.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.monthly-20f568c9.js → HEIGHT_GIRLS.zscore.monthly-eedd812a.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.weekly-351d9c9c.js → HEIGHT_GIRLS.zscore.weekly-3a709a61.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.yearly-66277de4.js → HEIGHT_GIRLS.zscore.yearly-9db6333c.js} +0 -0
- /package/build/{Locale-4c8042b0.js → Locale-a525e258.js} +0 -0
- /package/build/{Visible-fd04e5be.js → Visible-080f5064.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.monthly-98d965cb.js → WEIGHT_BOYS.percentile.monthly-0ae289e3.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.weekly-8f8e8921.js → WEIGHT_BOYS.percentile.weekly-855b02b7.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.yearly-154795f6.js → WEIGHT_BOYS.percentile.yearly-bc4a4c53.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.monthly-d0519c13.js → WEIGHT_BOYS.zscore.monthly-b476b7cd.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.weekly-e1ead695.js → WEIGHT_BOYS.zscore.weekly-32a6879c.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.yearly-2fe02df0.js → WEIGHT_BOYS.zscore.yearly-dd6397e3.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.monthly-3efc2d52.js → WEIGHT_GIRLS.percentile.monthly-41dd84e6.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.weekly-dc56f5bc.js → WEIGHT_GIRLS.percentile.weekly-ea76ef57.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.yearly-7e0956b7.js → WEIGHT_GIRLS.percentile.yearly-7db78265.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.monthly-cafaa82f.js → WEIGHT_GIRLS.zscore.monthly-bbbc3292.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.weekly-68994c02.js → WEIGHT_GIRLS.zscore.weekly-57d20fd6.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.yearly-2981a41f.js → WEIGHT_GIRLS.zscore.yearly-68373b89.js} +0 -0
- /package/build/{animation-b507cd11.js → animation-add20b06.js} +0 -0
- /package/build/{constants-992b0578.js → constants-4df1d8d1.js} +0 -0
- /package/build/{constants-10359dd4.js → constants-51023928.js} +0 -0
- /package/build/{constants-2b28086d.js → constants-6dbac600.js} +0 -0
- /package/build/{dataTransform-6e222d1a.js → dataTransform-709035b0.js} +0 -0
- /package/build/{doctor-b2ec210f.js → doctor-e4be9559.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.monthly-a07f0f54.js → BMI_BOYS.percentile.monthly-2ae0022e.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.weekly-85dbca5e.js → BMI_BOYS.percentile.weekly-6bd84b90.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.yearly-f41886bc.js → BMI_BOYS.percentile.yearly-035b3091.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.monthly-ea595935.js → BMI_BOYS.zscore.monthly-19b9b64e.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.weekly-7d9c599e.js → BMI_BOYS.zscore.weekly-71640fd1.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.yearly-805285c0.js → BMI_BOYS.zscore.yearly-db0a9fd5.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.monthly-540f6f76.js → BMI_GIRLS.percentile.monthly-78083438.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.weekly-57919e11.js → BMI_GIRLS.percentile.weekly-c99db040.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.yearly-93301c51.js → BMI_GIRLS.percentile.yearly-e82b53a3.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.monthly-da84c887.js → BMI_GIRLS.zscore.monthly-774a6aaa.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.weekly-0955bde2.js → BMI_GIRLS.zscore.weekly-48ed4fa5.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.yearly-971fce28.js → BMI_GIRLS.zscore.yearly-a9273c78.js} +0 -0
- /package/build/esm/{ChevronDown-1e78a8e7.js → ChevronDown-3b35f312.js} +0 -0
- /package/build/esm/{Close-d0842035.js → Close-b45f5c32.js} +0 -0
- /package/build/esm/{Google-64dc9f05.js → Google-4ff57dce.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-c15a00f2.js → HEAD CIRCUM_BOYS.percentile.monthly-c1f42bbe.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-954bfb7e.js → HEAD CIRCUM_BOYS.percentile.weekly-70f7f26f.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-821fc4f5.js → HEAD CIRCUM_BOYS.percentile.yearly-11cbfcf1.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-db8b365a.js → HEAD CIRCUM_BOYS.zscore.monthly-003ee1e4.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-eb78ff15.js → HEAD CIRCUM_BOYS.zscore.weekly-8ab37831.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-ec7bc0b9.js → HEAD CIRCUM_BOYS.zscore.yearly-20666ab8.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-4cda8496.js → HEAD CIRCUM_GIRLS.percentile.monthly-21b0b8ae.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-fede4105.js → HEAD CIRCUM_GIRLS.percentile.weekly-d0df7650.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-dccd0acf.js → HEAD CIRCUM_GIRLS.percentile.yearly-afffad27.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-14e6354f.js → HEAD CIRCUM_GIRLS.zscore.monthly-7cf18616.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-b2f1adef.js → HEAD CIRCUM_GIRLS.zscore.weekly-44c69b89.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-d01b98b8.js → HEAD CIRCUM_GIRLS.zscore.yearly-c6c425a4.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.monthly-82e1ff12.js → HEIGHT_BOYS.percentile.monthly-4c3e9ea9.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.weekly-2ad2d4ca.js → HEIGHT_BOYS.percentile.weekly-2279353f.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.yearly-7086aebe.js → HEIGHT_BOYS.percentile.yearly-b4fb69e1.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.monthly-838e2b31.js → HEIGHT_BOYS.zscore.monthly-3752b948.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.weekly-e4449bdc.js → HEIGHT_BOYS.zscore.weekly-ba3aead0.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.yearly-23327e54.js → HEIGHT_BOYS.zscore.yearly-ed677a00.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-4d4e9eb8.js → HEIGHT_GIRLS.percentile.monthly-6beed83e.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-56a63779.js → HEIGHT_GIRLS.percentile.weekly-f92c1f02.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-4489fbb4.js → HEIGHT_GIRLS.percentile.yearly-a723c9f9.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-32157cb0.js → HEIGHT_GIRLS.zscore.monthly-a2524782.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-082dac9e.js → HEIGHT_GIRLS.zscore.weekly-56160879.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-5deb5013.js → HEIGHT_GIRLS.zscore.yearly-77d20c43.js} +0 -0
- /package/build/esm/{Locale-05f46f2a.js → Locale-5dcef50c.js} +0 -0
- /package/build/esm/{Visible-fd6bc425.js → Visible-d8c95d5c.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.monthly-1c1fad72.js → WEIGHT_BOYS.percentile.monthly-a68e0c51.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.weekly-6d494fdd.js → WEIGHT_BOYS.percentile.weekly-861a8532.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.yearly-9be5f2bb.js → WEIGHT_BOYS.percentile.yearly-5e9d7594.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.monthly-fc1521fe.js → WEIGHT_BOYS.zscore.monthly-75bc3c2c.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.weekly-8485d2f3.js → WEIGHT_BOYS.zscore.weekly-060cfc76.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.yearly-e232227b.js → WEIGHT_BOYS.zscore.yearly-ee7b1c48.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-4736c7aa.js → WEIGHT_GIRLS.percentile.monthly-283f722f.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-00d5d075.js → WEIGHT_GIRLS.percentile.weekly-86274d80.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-17fafef1.js → WEIGHT_GIRLS.percentile.yearly-129a595a.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-0f34e73c.js → WEIGHT_GIRLS.zscore.monthly-1799c49c.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-7df80bb8.js → WEIGHT_GIRLS.zscore.weekly-6701ef1e.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-9b920f57.js → WEIGHT_GIRLS.zscore.yearly-7e405467.js} +0 -0
- /package/build/esm/{animation-8e63068e.js → animation-d3819eb0.js} +0 -0
- /package/build/esm/{constants-fff0e873.js → constants-2061e79c.js} +0 -0
- /package/build/esm/{constants-1ed528a3.js → constants-c2fdc111.js} +0 -0
- /package/build/esm/{constants-25cc884e.js → constants-c5ba41f1.js} +0 -0
- /package/build/esm/{dataTransform-7f13a99d.js → dataTransform-6ba59604.js} +0 -0
- /package/build/esm/{doctor-e1757149.js → doctor-8d3f3b99.js} +0 -0
- /package/build/esm/{index-3f41e1e2.js → index-02cb023b.js} +0 -0
- /package/build/esm/{index-f4597cea.js → index-073ed73b.js} +0 -0
- /package/build/esm/{index-84bd0271.js → index-2a90ffae.js} +0 -0
- /package/build/esm/{index-cef61a9e.js → index-2b4f6772.js} +0 -0
- /package/build/esm/{index-c02e04f4.js → index-5f1ea0d8.js} +0 -0
- /package/build/esm/{index-0552435e.js → index-779ae7c8.js} +0 -0
- /package/build/esm/{index-d50c1b6d.js → index-7d0bb985.js} +0 -0
- /package/build/esm/{index-d3f5d34b.js → index-c24cd541.js} +0 -0
- /package/build/esm/{index-618f0b0c.js → index-d2eff99e.js} +0 -0
- /package/build/esm/{index.styles-dfe31537.js → index.styles-17355847.js} +0 -0
- /package/build/esm/{localizeNumberFormat-c14eab14.js → localizeNumberFormat-f244f091.js} +0 -0
- /package/build/esm/{normalizeLink-2bf24c8c.js → normalizeLink-7101e4ce.js} +0 -0
- /package/build/esm/{other-8e7af889.js → other-84c23b58.js} +0 -0
- /package/build/esm/{paths-a859c358.js → paths-3e9a8d29.js} +0 -0
- /package/build/esm/{translationsContext-b6c33e91.js → translationsContext-d0ce480d.js} +0 -0
- /package/build/esm/{tslib.es6-709d7787.js → tslib.es6-ffc85631.js} +0 -0
- /package/build/esm/{types-0904d32f.js → types-dea4e4e6.js} +0 -0
- /package/build/esm/{useIsInit-3383f41b.js → useIsInit-378bd9a2.js} +0 -0
- /package/build/esm/{useOutsideClick-11006abd.js → useOutsideClick-658ad2b9.js} +0 -0
- /package/build/esm/{useScrollbarSize-c15fd39e.js → useScrollbarSize-bb369b38.js} +0 -0
- /package/build/esm/{useUniqueId-cf5d6065.js → useUniqueId-16d3ffba.js} +0 -0
- /package/build/esm/{utils-e21b8836.js → utils-bd8c6df6.js} +0 -0
- /package/build/{index-8fc12b04.js → index-0c86b7e9.js} +0 -0
- /package/build/{index-6cb41f70.js → index-18a6798f.js} +0 -0
- /package/build/{index-44dd2ed3.js → index-1e024425.js} +0 -0
- /package/build/{index-0d669510.js → index-6cceb0dc.js} +0 -0
- /package/build/{index-39237568.js → index-a9d1a37f.js} +0 -0
- /package/build/{index-c7782352.js → index-d8b92954.js} +0 -0
- /package/build/{index-950cbd1e.js → index-d96cd3fd.js} +0 -0
- /package/build/{index-c2436bb5.js → index-de260e9d.js} +0 -0
- /package/build/{index-ba7abd78.js → index-f32c239b.js} +0 -0
- /package/build/{index.styles-483ecf51.js → index.styles-865486b8.js} +0 -0
- /package/build/{localizeNumberFormat-c35b4fab.js → localizeNumberFormat-57d69c13.js} +0 -0
- /package/build/{normalizeLink-d98c5115.js → normalizeLink-08ac7d73.js} +0 -0
- /package/build/{other-a39e1798.js → other-a63ad0f6.js} +0 -0
- /package/build/{paths-cc67867e.js → paths-1811c84d.js} +0 -0
- /package/build/{translationsContext-9fb25554.js → translationsContext-9a1276c2.js} +0 -0
- /package/build/{tslib.es6-54d5a3b5.js → tslib.es6-7ff6ae00.js} +0 -0
- /package/build/{types-5e6fd5c4.js → types-07939e9e.js} +0 -0
- /package/build/{useIsInit-044fcacb.js → useIsInit-441c7c54.js} +0 -0
- /package/build/{useOutsideClick-e29d71c0.js → useOutsideClick-1e974632.js} +0 -0
- /package/build/{useScrollbarSize-46c0ff33.js → useScrollbarSize-d0a286b9.js} +0 -0
- /package/build/{useUniqueId-45824993.js → useUniqueId-45a5d443.js} +0 -0
- /package/build/{utils-ca404e47.js → utils-7835b6a6.js} +0 -0
package/build/esm/ssoV2.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { a as __awaiter, _ as __rest } from './tslib.es6-
|
|
2
|
-
import React__default, { createContext, useEffect, useState,
|
|
3
|
-
import { I as Input, s as styles, O as OTP, f as PasswordInput,
|
|
4
|
-
import { a as useSSOSteps,
|
|
5
|
-
export { u as useSSOV2Store } from './store-
|
|
1
|
+
import { a as __awaiter, _ as __rest } from './tslib.es6-ffc85631.js';
|
|
2
|
+
import React__default, { createContext, useMemo, useEffect, useState, useCallback, forwardRef } from 'react';
|
|
3
|
+
import { I as Input, s as styles, O as OTP, f as PasswordInput, E as ErrorBoundary } from './index-eefc9f56.js';
|
|
4
|
+
import { S as SSOStepTypeType, a as useSSOSteps, u as useSSOV2Store, i as isUserFinishedSetup, f as fetchSSOV2Api, w as websiteId, b as SSO_V2_PATHS, c as checkUserExist, F as FacebookAppId, G as GoogleAuthClientId, h as handleAuthSuccess, g as getUserInfo, d as updateUserInfo, e as isPhoneNotVerifedYet, j as isLoginWithPhoneNotVerifedYet, k as isFlowFinishedSetup, r as resetPassword, l as redirect } from './store-88f81657.js';
|
|
5
|
+
export { u as useSSOV2Store } from './store-88f81657.js';
|
|
6
6
|
import { ChevronLeft } from '@hhgtech/icons/arrow';
|
|
7
|
-
import { Close, Search } from '@hhgtech/icons/core';
|
|
8
|
-
import { Z as ZINDEX_SSO, L as LOCALE_SPECS, S as STATIC_PAGES } from './index-
|
|
9
|
-
import { L as LogoIcon } from './logoIcon-
|
|
10
|
-
import { B as Button } from './index-
|
|
11
|
-
import { M as Modal } from './index-
|
|
12
|
-
import { Stack,
|
|
7
|
+
import { Close, Search, ReplySquare } from '@hhgtech/icons/core';
|
|
8
|
+
import { Z as ZINDEX_SSO, L as LOCALE_SPECS, S as STATIC_PAGES } from './index-4e41dcc1.js';
|
|
9
|
+
import { L as LogoIcon } from './logoIcon-9e589a09.js';
|
|
10
|
+
import { B as Button } from './index-bee910f9.js';
|
|
11
|
+
import { M as Modal } from './index-0abb5e05.js';
|
|
12
|
+
import { Stack, Flex, Box, Group, Divider } from '@mantine/core';
|
|
13
13
|
import '@mantine/dates';
|
|
14
|
-
import './index-
|
|
15
|
-
import './index-
|
|
16
|
-
import { s as showNotification } from './useMantineLocale-
|
|
17
|
-
import { T as Text } from './index-
|
|
18
|
-
import { u as useTranslations } from './index-
|
|
14
|
+
import './index-d9218757.js';
|
|
15
|
+
import './index-7d0bb985.js';
|
|
16
|
+
import { s as showNotification } from './useMantineLocale-ad1b21b5.js';
|
|
17
|
+
import { T as Text } from './index-686c3d4f.js';
|
|
18
|
+
import { u as useTranslations } from './index-aa3a7889.js';
|
|
19
19
|
import '@mantine/hooks';
|
|
20
|
-
import './utils-
|
|
21
|
-
import './other-
|
|
22
|
-
import './index-
|
|
23
|
-
import { L as LOCALE } from './Locale-
|
|
24
|
-
import { G as Google, F as Facebook } from './Google-
|
|
20
|
+
import './utils-bd8c6df6.js';
|
|
21
|
+
import './other-84c23b58.js';
|
|
22
|
+
import './index-74e2a36f.js';
|
|
23
|
+
import { L as LOCALE } from './Locale-5dcef50c.js';
|
|
24
|
+
import { G as Google, F as Facebook } from './Google-4ff57dce.js';
|
|
25
25
|
import { parsePhoneNumber, getCountryCallingCode } from 'react-phone-number-input';
|
|
26
26
|
import styled from '@emotion/styled';
|
|
27
27
|
import cn from 'classnames';
|
|
@@ -29,28 +29,28 @@ import { CaretDown } from '@hhgtech/icons/other';
|
|
|
29
29
|
import debounce from 'lodash/debounce';
|
|
30
30
|
import throttle from 'lodash/throttle';
|
|
31
31
|
import Flags from 'react-phone-number-input/flags';
|
|
32
|
-
import { u as useScreenSize } from './useScreenSize-
|
|
32
|
+
import { u as useScreenSize } from './useScreenSize-2af6a44f.js';
|
|
33
33
|
import { Drawer } from 'vaul';
|
|
34
|
-
import { M as MAPPED_LOCALE } from './utils-
|
|
35
|
-
import { S as Spoiler } from './index-
|
|
34
|
+
import { M as MAPPED_LOCALE } from './utils-2645506d.js';
|
|
35
|
+
import { S as Spoiler } from './index-1a6f786a.js';
|
|
36
36
|
import { domainLocales } from './constantsDomainLocales.js';
|
|
37
37
|
import { useForm, yupResolver } from '@mantine/form';
|
|
38
38
|
import * as yup from 'yup';
|
|
39
39
|
import dayjs from 'dayjs';
|
|
40
|
-
import { D as DatePicker } from './index-
|
|
40
|
+
import { D as DatePicker } from './index-ce334d62.js';
|
|
41
41
|
import '@mantine/carousel';
|
|
42
42
|
import './miscTheme.js';
|
|
43
|
-
import './useUniqueId-
|
|
43
|
+
import './useUniqueId-16d3ffba.js';
|
|
44
44
|
import './constantsSite.js';
|
|
45
45
|
import 'zustand';
|
|
46
46
|
import './constantsIsProduction.js';
|
|
47
|
-
import './normalizeLink-
|
|
47
|
+
import './normalizeLink-7101e4ce.js';
|
|
48
48
|
import './miscCookieHelper.js';
|
|
49
49
|
import 'date-fns/locale';
|
|
50
50
|
import './constantsRiskScreener.js';
|
|
51
|
-
import './index.styles-
|
|
51
|
+
import './index.styles-17355847.js';
|
|
52
52
|
import '@mantine/notifications';
|
|
53
|
-
import './translationsContext-
|
|
53
|
+
import './translationsContext-d0ce480d.js';
|
|
54
54
|
|
|
55
55
|
const SSOStateContext = createContext({
|
|
56
56
|
locale: LOCALE.Vietnam,
|
|
@@ -158,13 +158,227 @@ const BackgroundHeader = () => (React__default.createElement("svg", { width: "29
|
|
|
158
158
|
React__default.createElement("stop", { stopColor: "#fff", stopOpacity: "0" }),
|
|
159
159
|
React__default.createElement("stop", { offset: "1", stopColor: "#fff" })))));
|
|
160
160
|
|
|
161
|
+
const isPhoneVerifedAlready = (userInfo, flowData) => {
|
|
162
|
+
var _a;
|
|
163
|
+
if (flowData === null || flowData === void 0 ? void 0 : flowData.metaData) {
|
|
164
|
+
return (_a = flowData === null || flowData === void 0 ? void 0 : flowData.metaData) === null || _a === void 0 ? void 0 : _a.is_phone_verified;
|
|
165
|
+
}
|
|
166
|
+
return (userInfo === null || userInfo === void 0 ? void 0 : userInfo.phone_verified_at) && (userInfo === null || userInfo === void 0 ? void 0 : userInfo.phone);
|
|
167
|
+
};
|
|
168
|
+
const isSetupFullInfoAlready = (userInfo, flowData) => {
|
|
169
|
+
var _a, _b, _c;
|
|
170
|
+
if (flowData === null || flowData === void 0 ? void 0 : flowData.metaData) {
|
|
171
|
+
return (((_a = flowData === null || flowData === void 0 ? void 0 : flowData.metaData) === null || _a === void 0 ? void 0 : _a.is_name) &&
|
|
172
|
+
((_b = flowData === null || flowData === void 0 ? void 0 : flowData.metaData) === null || _b === void 0 ? void 0 : _b.is_gender) &&
|
|
173
|
+
((_c = flowData === null || flowData === void 0 ? void 0 : flowData.metaData) === null || _c === void 0 ? void 0 : _c.is_birthday));
|
|
174
|
+
}
|
|
175
|
+
const hasName = !!(userInfo === null || userInfo === void 0 ? void 0 : userInfo.name);
|
|
176
|
+
const hasGender = typeof (userInfo === null || userInfo === void 0 ? void 0 : userInfo.gender) === 'number';
|
|
177
|
+
const hasBirthday = !!(userInfo === null || userInfo === void 0 ? void 0 : userInfo.birthday);
|
|
178
|
+
return hasName && hasGender && hasBirthday;
|
|
179
|
+
};
|
|
180
|
+
const isExistUpdateEmailStep = (steps) => {
|
|
181
|
+
return steps.find((s) => s.type === SSOStepTypeType.UPDATE_EMAIL);
|
|
182
|
+
};
|
|
183
|
+
const isVerifyPhoneInTheSignUp = (steps, flowData) => {
|
|
184
|
+
var _a;
|
|
185
|
+
return ((_a = steps[0]) === null || _a === void 0 ? void 0 : _a.type) === SSOStepTypeType.FIRST && (flowData === null || flowData === void 0 ? void 0 : flowData.flow) === 'signup';
|
|
186
|
+
};
|
|
187
|
+
const parseEmailFromToken = (token) => {
|
|
188
|
+
try {
|
|
189
|
+
const base64Url = token.split('.')[1];
|
|
190
|
+
const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');
|
|
191
|
+
const jsonPayload = decodeURIComponent(atob(base64)
|
|
192
|
+
.split('')
|
|
193
|
+
.map(function (c) {
|
|
194
|
+
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
|
|
195
|
+
})
|
|
196
|
+
.join(''));
|
|
197
|
+
const payload = JSON.parse(jsonPayload);
|
|
198
|
+
return payload.email;
|
|
199
|
+
}
|
|
200
|
+
catch (err) {
|
|
201
|
+
return '';
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
const isSocialFlowFn = (flowData) => {
|
|
206
|
+
return (flowData === null || flowData === void 0 ? void 0 : flowData.method) === 'google' || (flowData === null || flowData === void 0 ? void 0 : flowData.method) === 'facebook';
|
|
207
|
+
};
|
|
208
|
+
const isPhoneFlowFn = (flowData) => {
|
|
209
|
+
return ((flowData === null || flowData === void 0 ? void 0 : flowData.method) === 'sms' ||
|
|
210
|
+
(flowData === null || flowData === void 0 ? void 0 : flowData.method) === 'zalo' ||
|
|
211
|
+
(flowData === null || flowData === void 0 ? void 0 : flowData.method) === 'phone');
|
|
212
|
+
};
|
|
213
|
+
const isEmailFlowFn = (flowData) => {
|
|
214
|
+
return (flowData === null || flowData === void 0 ? void 0 : flowData.method) === 'email';
|
|
215
|
+
};
|
|
216
|
+
const isResetPasswordFlowFn = (steps) => {
|
|
217
|
+
// First -> Passsword -> Password Forgot Setup
|
|
218
|
+
const passwordStep = steps.findIndex((s) => s.type === SSOStepTypeType.PASSWORD);
|
|
219
|
+
const passwordForgotStep = steps.findIndex((s) => s.type === SSOStepTypeType.FORGOT_PASSWORD_SETUP);
|
|
220
|
+
return (passwordStep > 0 &&
|
|
221
|
+
passwordForgotStep > 0 &&
|
|
222
|
+
passwordForgotStep > passwordStep);
|
|
223
|
+
};
|
|
224
|
+
const isDisplayProgressBarFn = (flowData, step) => {
|
|
225
|
+
const showProgressBar = (step === null || step === void 0 ? void 0 : step.type) === SSOStepTypeType.OTP ||
|
|
226
|
+
(step === null || step === void 0 ? void 0 : step.type) === SSOStepTypeType.SETUP_FULL ||
|
|
227
|
+
(step === null || step === void 0 ? void 0 : step.type) === SSOStepTypeType.VERIFY_PHONE ||
|
|
228
|
+
(step === null || step === void 0 ? void 0 : step.type) === SSOStepTypeType.PASSWORD ||
|
|
229
|
+
(step === null || step === void 0 ? void 0 : step.type) === SSOStepTypeType.FORGOT_PASSWORD_PHONE ||
|
|
230
|
+
(step === null || step === void 0 ? void 0 : step.type) === SSOStepTypeType.FORGOT_PASSWORD_SETUP ||
|
|
231
|
+
(step === null || step === void 0 ? void 0 : step.type) === SSOStepTypeType.EMAIL ||
|
|
232
|
+
(step === null || step === void 0 ? void 0 : step.type) === SSOStepTypeType.UPDATE_EMAIL;
|
|
233
|
+
const isWhiteListFlow = isSocialFlowFn(flowData) ||
|
|
234
|
+
isPhoneFlowFn(flowData) ||
|
|
235
|
+
isEmailFlowFn(flowData);
|
|
236
|
+
return showProgressBar && isWhiteListFlow;
|
|
237
|
+
};
|
|
238
|
+
const getCurrentStepNumber = (flowData, { steps, currentStepIndex, }, userInfo) => {
|
|
239
|
+
var _a, _b;
|
|
240
|
+
const step = steps[currentStepIndex];
|
|
241
|
+
const isSocialFlow = isSocialFlowFn(flowData);
|
|
242
|
+
const isPhoneFlow = isPhoneFlowFn(flowData);
|
|
243
|
+
const isEmailFlow = isEmailFlowFn(flowData);
|
|
244
|
+
/** Social (Google, Facebook): FIRST => VERIFY_PHONE | OTP => STEP_FULL */
|
|
245
|
+
if (isSocialFlow) {
|
|
246
|
+
const arrSteps = [
|
|
247
|
+
!isPhoneVerifedAlready(userInfo, flowData)
|
|
248
|
+
? [SSOStepTypeType.VERIFY_PHONE, SSOStepTypeType.OTP]
|
|
249
|
+
: undefined,
|
|
250
|
+
isExistUpdateEmailStep(steps)
|
|
251
|
+
? (step === null || step === void 0 ? void 0 : step.type) === SSOStepTypeType.OTP
|
|
252
|
+
? SSOStepTypeType.OTP
|
|
253
|
+
: SSOStepTypeType.UPDATE_EMAIL
|
|
254
|
+
: undefined,
|
|
255
|
+
!userInfo || !isUserFinishedSetup(userInfo)
|
|
256
|
+
? SSOStepTypeType.SETUP_FULL
|
|
257
|
+
: undefined,
|
|
258
|
+
]
|
|
259
|
+
.flat()
|
|
260
|
+
.filter(Boolean);
|
|
261
|
+
const previousStep = steps[currentStepIndex - 1];
|
|
262
|
+
return [
|
|
263
|
+
arrSteps.length,
|
|
264
|
+
(previousStep === null || previousStep === void 0 ? void 0 : previousStep.type) === SSOStepTypeType.UPDATE_EMAIL
|
|
265
|
+
? arrSteps.findLastIndex((type) => type === (step === null || step === void 0 ? void 0 : step.type)) + 1
|
|
266
|
+
: arrSteps.findIndex((type) => type === (step === null || step === void 0 ? void 0 : step.type)) + 1,
|
|
267
|
+
];
|
|
268
|
+
}
|
|
269
|
+
if (isPhoneFlow && (flowData === null || flowData === void 0 ? void 0 : flowData.flow) === 'signup') {
|
|
270
|
+
const arrSteps = [
|
|
271
|
+
!isPhoneVerifedAlready(userInfo, flowData)
|
|
272
|
+
? SSOStepTypeType.OTP
|
|
273
|
+
: undefined,
|
|
274
|
+
!((_a = flowData === null || flowData === void 0 ? void 0 : flowData.metaData) === null || _a === void 0 ? void 0 : _a.is_pass)
|
|
275
|
+
? SSOStepTypeType.FORGOT_PASSWORD_SETUP
|
|
276
|
+
: undefined,
|
|
277
|
+
!isSetupFullInfoAlready(userInfo, flowData)
|
|
278
|
+
? SSOStepTypeType.SETUP_FULL
|
|
279
|
+
: undefined,
|
|
280
|
+
]
|
|
281
|
+
.flat()
|
|
282
|
+
.filter(Boolean);
|
|
283
|
+
return [
|
|
284
|
+
arrSteps.length,
|
|
285
|
+
arrSteps.findIndex((type) => type === (step === null || step === void 0 ? void 0 : step.type)) + 1,
|
|
286
|
+
];
|
|
287
|
+
}
|
|
288
|
+
if (isPhoneFlow && (flowData === null || flowData === void 0 ? void 0 : flowData.flow) === 'login') {
|
|
289
|
+
const isForgotPasswordPhone = steps.find((s) => s.type === SSOStepTypeType.FORGOT_PASSWORD_PHONE);
|
|
290
|
+
const arrSteps = [
|
|
291
|
+
SSOStepTypeType.PASSWORD,
|
|
292
|
+
!isPhoneVerifedAlready(userInfo, flowData) || isForgotPasswordPhone
|
|
293
|
+
? [SSOStepTypeType.FORGOT_PASSWORD_PHONE, SSOStepTypeType.OTP]
|
|
294
|
+
: undefined,
|
|
295
|
+
isForgotPasswordPhone ? SSOStepTypeType.FORGOT_PASSWORD_SETUP : undefined,
|
|
296
|
+
isExistUpdateEmailStep(steps)
|
|
297
|
+
? (step === null || step === void 0 ? void 0 : step.type) === SSOStepTypeType.OTP
|
|
298
|
+
? SSOStepTypeType.OTP
|
|
299
|
+
: SSOStepTypeType.UPDATE_EMAIL
|
|
300
|
+
: undefined,
|
|
301
|
+
!isSetupFullInfoAlready(userInfo, flowData)
|
|
302
|
+
? SSOStepTypeType.SETUP_FULL
|
|
303
|
+
: undefined,
|
|
304
|
+
]
|
|
305
|
+
.flat()
|
|
306
|
+
.filter(Boolean);
|
|
307
|
+
const previousStep = steps[currentStepIndex - 1];
|
|
308
|
+
return [
|
|
309
|
+
arrSteps.length,
|
|
310
|
+
(previousStep === null || previousStep === void 0 ? void 0 : previousStep.type) === SSOStepTypeType.UPDATE_EMAIL
|
|
311
|
+
? arrSteps.findLastIndex((type) => type === (step === null || step === void 0 ? void 0 : step.type)) + 1
|
|
312
|
+
: arrSteps.findIndex((type) => type === (step === null || step === void 0 ? void 0 : step.type)) + 1,
|
|
313
|
+
];
|
|
314
|
+
}
|
|
315
|
+
if (isEmailFlow) {
|
|
316
|
+
const hasPasswordStep = !((_b = flowData === null || flowData === void 0 ? void 0 : flowData.metaData) === null || _b === void 0 ? void 0 : _b.is_pass);
|
|
317
|
+
const hasPhoneStep = !isPhoneVerifedAlready(userInfo, flowData);
|
|
318
|
+
const hasSetupFullStep = !isSetupFullInfoAlready(userInfo, flowData);
|
|
319
|
+
const isForgotPasswordSetup = steps.find((s) => s.type === SSOStepTypeType.FORGOT_PASSWORD_SETUP);
|
|
320
|
+
if (!hasPasswordStep && !hasPhoneStep && !hasSetupFullStep)
|
|
321
|
+
return [];
|
|
322
|
+
const arrSteps = [
|
|
323
|
+
(step === null || step === void 0 ? void 0 : step.type) === SSOStepTypeType.OTP
|
|
324
|
+
? SSOStepTypeType.OTP
|
|
325
|
+
: SSOStepTypeType.EMAIL,
|
|
326
|
+
hasPasswordStep || isForgotPasswordSetup
|
|
327
|
+
? SSOStepTypeType.FORGOT_PASSWORD_SETUP
|
|
328
|
+
: SSOStepTypeType.PASSWORD,
|
|
329
|
+
hasPhoneStep
|
|
330
|
+
? (step === null || step === void 0 ? void 0 : step.type) === SSOStepTypeType.OTP
|
|
331
|
+
? SSOStepTypeType.OTP
|
|
332
|
+
: SSOStepTypeType.VERIFY_PHONE
|
|
333
|
+
: undefined,
|
|
334
|
+
hasSetupFullStep ? SSOStepTypeType.SETUP_FULL : undefined,
|
|
335
|
+
]
|
|
336
|
+
.flat()
|
|
337
|
+
.filter(Boolean);
|
|
338
|
+
const previousStep = steps[currentStepIndex - 1];
|
|
339
|
+
return [
|
|
340
|
+
arrSteps.length,
|
|
341
|
+
(previousStep === null || previousStep === void 0 ? void 0 : previousStep.type) === SSOStepTypeType.VERIFY_PHONE
|
|
342
|
+
? arrSteps.findLastIndex((type) => type === (step === null || step === void 0 ? void 0 : step.type)) + 1
|
|
343
|
+
: arrSteps.findIndex((type) => type === (step === null || step === void 0 ? void 0 : step.type)) + 1,
|
|
344
|
+
];
|
|
345
|
+
}
|
|
346
|
+
return [];
|
|
347
|
+
};
|
|
348
|
+
const ProgressBar = () => {
|
|
349
|
+
// const initUserInfo = useRef<UserInfo | undefined | null>()
|
|
350
|
+
const { steps, currentStepIndex } = useSSOSteps();
|
|
351
|
+
const { flowData, userInfo } = useSSOV2Store();
|
|
352
|
+
/** No need update state IF userInfo is changed */
|
|
353
|
+
const initUserInfo = useMemo(() => userInfo, [userInfo]);
|
|
354
|
+
const [totalStepNumber, activeStepNumber] = getCurrentStepNumber(flowData, { steps, currentStepIndex }, initUserInfo);
|
|
355
|
+
if (!activeStepNumber || totalStepNumber === 1)
|
|
356
|
+
return null;
|
|
357
|
+
return (React__default.createElement(Flex, { gap: 2 }, Array.from({ length: totalStepNumber }).map((_, idx) => {
|
|
358
|
+
const currentStepNumber = idx + 1;
|
|
359
|
+
return (React__default.createElement(Box, { key: currentStepNumber, style: {
|
|
360
|
+
width: 'auto',
|
|
361
|
+
height: 2,
|
|
362
|
+
flex: 1,
|
|
363
|
+
borderRadius: 4,
|
|
364
|
+
backgroundColor: currentStepNumber <= activeStepNumber ? '#00B16A' : '#D2D6DC',
|
|
365
|
+
} }));
|
|
366
|
+
})));
|
|
367
|
+
};
|
|
368
|
+
|
|
161
369
|
const SSOPopupWrapper = ({ children, opened, onClose, }) => {
|
|
162
370
|
var _a;
|
|
163
|
-
const { steps, goBack } = useSSOSteps();
|
|
371
|
+
const { steps, goBack, currentStepIndex } = useSSOSteps();
|
|
372
|
+
const { flowData } = useSSOV2Store();
|
|
164
373
|
const { locale, tracking } = useSSOState();
|
|
165
|
-
const
|
|
166
|
-
const
|
|
167
|
-
const
|
|
374
|
+
const currentStep = steps[currentStepIndex];
|
|
375
|
+
const showProgressBar = isDisplayProgressBarFn(flowData, currentStep);
|
|
376
|
+
const showBack = (steps.length > 1 && !showProgressBar) ||
|
|
377
|
+
(currentStep === null || currentStep === void 0 ? void 0 : currentStep.type) === SSOStepTypeType.OTP ||
|
|
378
|
+
(currentStep === null || currentStep === void 0 ? void 0 : currentStep.type) === SSOStepTypeType.PASSWORD ||
|
|
379
|
+
(currentStep === null || currentStep === void 0 ? void 0 : currentStep.type) === SSOStepTypeType.EMAIL;
|
|
380
|
+
const showClose = (currentStep === null || currentStep === void 0 ? void 0 : currentStep.type) === SSOStepTypeType.FIRST;
|
|
381
|
+
const showLogo = (steps.length === 1 || showProgressBar) && !showBack;
|
|
168
382
|
const logoType = (_a = LOCALE_SPECS[locale]) === null || _a === void 0 ? void 0 : _a.LOGO_TYPE;
|
|
169
383
|
const [closeConfirmOpen, setCloseConfirmOpen] = React__default.useState(false);
|
|
170
384
|
const onCloseClick = () => {
|
|
@@ -207,7 +421,11 @@ const SSOPopupWrapper = ({ children, opened, onClose, }) => {
|
|
|
207
421
|
display: 'block',
|
|
208
422
|
},
|
|
209
423
|
},
|
|
210
|
-
}), withCloseButton: false, zIndex: ZINDEX_SSO
|
|
424
|
+
}), withCloseButton: false, zIndex: ZINDEX_SSO, overlayProps: {
|
|
425
|
+
'data-event-label': 'Focus out',
|
|
426
|
+
'data-event-category': tracking === null || tracking === void 0 ? void 0 : tracking.category,
|
|
427
|
+
'data-event-action': tracking === null || tracking === void 0 ? void 0 : tracking.action,
|
|
428
|
+
} },
|
|
211
429
|
React__default.createElement("div", { style: {
|
|
212
430
|
height: 40,
|
|
213
431
|
display: 'flex',
|
|
@@ -220,7 +438,7 @@ const SSOPopupWrapper = ({ children, opened, onClose, }) => {
|
|
|
220
438
|
padding: 8,
|
|
221
439
|
background: 'white',
|
|
222
440
|
borderRadius: '100%',
|
|
223
|
-
}, onClick: goBack, "data-event-category": tracking === null || tracking === void 0 ? void 0 : tracking.category, "data-event-action": tracking === null || tracking === void 0 ? void 0 : tracking.action, "data-event-label": "
|
|
441
|
+
}, onClick: goBack, "data-event-category": tracking === null || tracking === void 0 ? void 0 : tracking.category, "data-event-action": tracking === null || tracking === void 0 ? void 0 : tracking.action, "data-event-label": "Back" },
|
|
224
442
|
React__default.createElement(ChevronLeft, null))),
|
|
225
443
|
showLogo && (React__default.createElement(LogoIcon, { type: logoType, height: 32, width: 'unset' })),
|
|
226
444
|
showClose && (React__default.createElement(Button, { variant: "white", style: {
|
|
@@ -231,6 +449,7 @@ const SSOPopupWrapper = ({ children, opened, onClose, }) => {
|
|
|
231
449
|
borderRadius: '100%',
|
|
232
450
|
}, onClick: onCloseClick, "data-event-category": tracking === null || tracking === void 0 ? void 0 : tracking.category, "data-event-action": tracking === null || tracking === void 0 ? void 0 : tracking.action, "data-event-label": "Exit" },
|
|
233
451
|
React__default.createElement(Close, null)))),
|
|
452
|
+
showProgressBar && React__default.createElement(ProgressBar, null),
|
|
234
453
|
React__default.createElement("div", { style: {
|
|
235
454
|
flex: 1,
|
|
236
455
|
} }, children)),
|
|
@@ -374,7 +593,10 @@ const SSOEmailScreen = ({ hidden, }) => {
|
|
|
374
593
|
const { t } = useTranslations();
|
|
375
594
|
const [loading, setLoading] = React__default.useState(false);
|
|
376
595
|
const [errMsg, setErrMsg] = React__default.useState('');
|
|
377
|
-
const
|
|
596
|
+
const { flowData } = useSSOV2Store();
|
|
597
|
+
const trackingCategory = flowData.flow === 'signup'
|
|
598
|
+
? `SSO - Sign Up via Email`
|
|
599
|
+
: 'SSO - Sign In via Email';
|
|
378
600
|
const trackingAction = 'Continue With Email';
|
|
379
601
|
const { setTracking } = useSSOState();
|
|
380
602
|
useEffect(() => {
|
|
@@ -402,6 +624,7 @@ const SSOEmailScreen = ({ hidden, }) => {
|
|
|
402
624
|
flowData: {
|
|
403
625
|
method: 'email',
|
|
404
626
|
flow: 'login',
|
|
627
|
+
metaData: existRes._data,
|
|
405
628
|
},
|
|
406
629
|
});
|
|
407
630
|
// go to password screen
|
|
@@ -419,6 +642,7 @@ const SSOEmailScreen = ({ hidden, }) => {
|
|
|
419
642
|
flowData: {
|
|
420
643
|
method: 'email',
|
|
421
644
|
flow: 'signup',
|
|
645
|
+
metaData: existRes._data,
|
|
422
646
|
},
|
|
423
647
|
});
|
|
424
648
|
if (!((_b = existRes._data) === null || _b === void 0 ? void 0 : _b.provider)) {
|
|
@@ -437,7 +661,7 @@ const SSOEmailScreen = ({ hidden, }) => {
|
|
|
437
661
|
config: {
|
|
438
662
|
email,
|
|
439
663
|
otpType: 'email',
|
|
440
|
-
afterAction: '
|
|
664
|
+
afterAction: 'forgot',
|
|
441
665
|
},
|
|
442
666
|
});
|
|
443
667
|
goNext();
|
|
@@ -616,12 +840,7 @@ const verifyUpdatePhoneZaloOTP = (phone, areaCode, otpCode) => __awaiter(void 0,
|
|
|
616
840
|
});
|
|
617
841
|
|
|
618
842
|
const MailIcon = (props) => (React__default.createElement("svg", Object.assign({ width: "21", height: "20", viewBox: "0 0 21 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
619
|
-
React__default.createElement("
|
|
620
|
-
React__default.createElement("rect", { x: "0.666992", width: "20", height: "20", rx: "10", fill: "#00B16A" }),
|
|
621
|
-
React__default.createElement("path", { d: "M13.792 4.6875H7.54199C5.66699 4.6875 4.41699 5.625 4.41699 7.8125V12.1875C4.41699 14.375 5.66699 15.3125 7.54199 15.3125H13.792C15.667 15.3125 16.917 14.375 16.917 12.1875V7.8125C16.917 5.625 15.667 4.6875 13.792 4.6875ZM14.0857 8.49375L12.1295 10.0563C11.717 10.3875 11.192 10.55 10.667 10.55C10.142 10.55 9.61074 10.3875 9.20449 10.0563L7.24824 8.49375C7.04824 8.33125 7.01699 8.03125 7.17324 7.83125C7.33574 7.63125 7.62949 7.59375 7.82949 7.75625L9.78574 9.31875C10.2607 9.7 11.067 9.7 11.542 9.31875L13.4982 7.75625C13.6982 7.59375 13.9982 7.625 14.1545 7.83125C14.317 8.03125 14.2857 8.33125 14.0857 8.49375Z", fill: "white" })),
|
|
622
|
-
React__default.createElement("defs", null,
|
|
623
|
-
React__default.createElement("clipPath", { id: "clip0_1284_30810" },
|
|
624
|
-
React__default.createElement("rect", { width: "20", height: "20", fill: "white", transform: "translate(0.666992)" })))));
|
|
843
|
+
React__default.createElement("path", { d: "M15.043 2.56348H6.29297C3.66797 2.56348 1.91797 3.87598 1.91797 6.93848V13.0635C1.91797 16.126 3.66797 17.4385 6.29297 17.4385H15.043C17.668 17.4385 19.418 16.126 19.418 13.0635V6.93848C19.418 3.87598 17.668 2.56348 15.043 2.56348ZM15.4542 7.89223L12.7155 10.0797C12.138 10.5435 11.403 10.771 10.668 10.771C9.93297 10.771 9.18922 10.5435 8.62047 10.0797L5.88172 7.89223C5.60172 7.66473 5.55797 7.24473 5.77672 6.96473C6.00422 6.68473 6.41547 6.63223 6.69547 6.85973L9.43422 9.04723C10.0992 9.58098 11.228 9.58098 11.893 9.04723L14.6317 6.85973C14.9117 6.63223 15.3317 6.67598 15.5505 6.96473C15.778 7.24473 15.7342 7.66473 15.4542 7.89223Z", fill: "#00B16A" })));
|
|
625
844
|
|
|
626
845
|
function createCommonjsModule(fn) {
|
|
627
846
|
var module = { exports: {} };
|
|
@@ -1778,7 +1997,7 @@ function CountrySelectWithIcon(_a) {
|
|
|
1778
1997
|
var { value, options, className,
|
|
1779
1998
|
// iconComponent: Icon,
|
|
1780
1999
|
// getIconAspectRatio,
|
|
1781
|
-
arrowComponent: Arrow = DefaultArrowComponent, onChange, disabled, readOnly } = _a, rest = __rest(_a, ["value", "options", "className", "arrowComponent", "onChange", "disabled", "readOnly"]);
|
|
2000
|
+
arrowComponent: Arrow = DefaultArrowComponent, onChange, disabled, readOnly, trackingFn } = _a, rest = __rest(_a, ["value", "options", "className", "arrowComponent", "onChange", "disabled", "readOnly", "trackingFn"]);
|
|
1782
2001
|
const { t } = useTranslations();
|
|
1783
2002
|
const [open, setOpen] = useState(false);
|
|
1784
2003
|
const [modalStyle, setModalStyle] = useState({});
|
|
@@ -1862,13 +2081,13 @@ function CountrySelectWithIcon(_a) {
|
|
|
1862
2081
|
React__default.createElement(SelectCountryItem, { option: selectedOption, onSelect: (option) => {
|
|
1863
2082
|
onChange_(option.value);
|
|
1864
2083
|
setOpen(false);
|
|
1865
|
-
} }))),
|
|
2084
|
+
}, trackingFn: trackingFn }))),
|
|
1866
2085
|
React__default.createElement(Stack, { spacing: 0 },
|
|
1867
2086
|
React__default.createElement(Text, { size: "s4" }, t('ssov2.first.search.country.all')),
|
|
1868
2087
|
filteredOptions.map((option) => (React__default.createElement(SelectCountryItem, { option: option, key: option.value, onSelect: (option) => {
|
|
1869
2088
|
onChange_(option.value);
|
|
1870
2089
|
setOpen(false);
|
|
1871
|
-
}, selected: selectedOption.value === option.value }))))));
|
|
2090
|
+
}, selected: selectedOption.value === option.value, trackingFn: trackingFn }))))));
|
|
1872
2091
|
const FlagSelected = Flags[selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value];
|
|
1873
2092
|
return (React__default.createElement(React__default.Fragment, null,
|
|
1874
2093
|
React__default.createElement("div", { className: "PhoneInputCountry", ref: countryDivRef },
|
|
@@ -1932,7 +2151,7 @@ function CountrySelectWithIcon(_a) {
|
|
|
1932
2151
|
}, onClick: () => setOpen(false) }),
|
|
1933
2152
|
React__default.createElement("div", { style: Object.assign({ position: 'fixed', height: 540, top: '100%', left: 0, width: '100%', backgroundColor: 'white', padding: '8px 24px', zIndex: ZINDEX_SSO + 9, borderRadius: 12, boxShadow: '0px 0px 1px 0px #0000000A, 0px 4px 8px 0px #0000000A, 0px 16px 24px 0px #0000000A, 0px 24px 32px 0px #0000000A', overflow: 'auto' }, modalStyle) }, SelectCountryContent))))));
|
|
1934
2153
|
}
|
|
1935
|
-
const SelectCountryItem = ({ option, onSelect, selected, }) => {
|
|
2154
|
+
const SelectCountryItem = ({ option, onSelect, selected, trackingFn, }) => {
|
|
1936
2155
|
const selectedCallingCode = useMemo(() => {
|
|
1937
2156
|
if (!option.value)
|
|
1938
2157
|
return '';
|
|
@@ -1943,14 +2162,15 @@ const SelectCountryItem = ({ option, onSelect, selected, }) => {
|
|
|
1943
2162
|
return '';
|
|
1944
2163
|
}, [option.value]);
|
|
1945
2164
|
const Flag = Flags[option.value];
|
|
1946
|
-
|
|
2165
|
+
const tracking = (trackingFn === null || trackingFn === void 0 ? void 0 : trackingFn(option)) || {};
|
|
2166
|
+
return (React__default.createElement(Stack, Object.assign({ sx: {
|
|
1947
2167
|
padding: '0 24px',
|
|
1948
2168
|
backgroundColor: selected ? '#e3f2ff' : 'transparent',
|
|
1949
2169
|
':hover': { backgroundColor: '#F7F9FA' },
|
|
1950
2170
|
cursor: 'pointer',
|
|
1951
2171
|
marginLeft: -24,
|
|
1952
2172
|
marginRight: -24,
|
|
1953
|
-
}, justify: "center", onClick: () => onSelect(option) },
|
|
2173
|
+
}, justify: "center", onClick: () => onSelect(option) }, tracking),
|
|
1954
2174
|
React__default.createElement(Group, { position: "apart", sx: {
|
|
1955
2175
|
height: 50,
|
|
1956
2176
|
borderBottom: '1px solid #E4E8EC',
|
|
@@ -2002,7 +2222,7 @@ function isSameOptionValue(value1, value2) {
|
|
|
2002
2222
|
const PhoneForwardRef = (props, ref) => {
|
|
2003
2223
|
const { isError, defaultCountry,
|
|
2004
2224
|
// countries = countriesDefault,
|
|
2005
|
-
countryCallingCodeEditable = false, defaultValue, value: valueProps, onChange: onChangeProps, className } = props, inputProps = __rest(props, ["isError", "defaultCountry", "countryCallingCodeEditable", "defaultValue", "value", "onChange", "className"]);
|
|
2225
|
+
countryCallingCodeEditable = false, defaultValue, value: valueProps, onChange: onChangeProps, className, trackingFn } = props, inputProps = __rest(props, ["isError", "defaultCountry", "countryCallingCodeEditable", "defaultValue", "value", "onChange", "className", "trackingFn"]);
|
|
2006
2226
|
const [value, setValue] = useState(defaultValue || valueProps);
|
|
2007
2227
|
const [PhoneInputUtils, setPhoneInputUtils] = useState(null);
|
|
2008
2228
|
const onChange = (val) => {
|
|
@@ -2026,7 +2246,7 @@ const PhoneForwardRef = (props, ref) => {
|
|
|
2026
2246
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2027
2247
|
ref: ref, value: value, onChange: onChange,
|
|
2028
2248
|
// countries={countries}
|
|
2029
|
-
defaultCountry: defaultCountry, countryCallingCodeEditable: countryCallingCodeEditable, className: cn(styles.phoneInput, { isError, [styles.error]: isError }, className), countrySelectComponent: CountrySelectWithIcon }, inputProps)));
|
|
2249
|
+
defaultCountry: defaultCountry, countryCallingCodeEditable: countryCallingCodeEditable, className: cn(styles.phoneInput, { isError, [styles.error]: isError }, className), countrySelectComponent: CountrySelectWithIcon, countrySelectProps: { trackingFn } }, inputProps)));
|
|
2030
2250
|
};
|
|
2031
2251
|
const PhoneWithCustomCountrySelect = forwardRef(PhoneForwardRef);
|
|
2032
2252
|
|
|
@@ -2056,17 +2276,32 @@ const StyledPhone = styled(PhoneWithCustomCountrySelect) `
|
|
|
2056
2276
|
}
|
|
2057
2277
|
`;
|
|
2058
2278
|
|
|
2279
|
+
const Zalo = ({ size = 20, useCurrentColor = false }) => {
|
|
2280
|
+
const color = useCurrentColor ? 'currentColor' : '#0068FF';
|
|
2281
|
+
return (React__default.createElement("svg", { width: (size * 21) / 20, height: size, viewBox: "0 0 21 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
2282
|
+
React__default.createElement("path", { d: "M13.7007 6.55306C13.9781 6.55306 14.2555 6.55306 14.5336 6.55306C14.529 8.17796 14.529 9.8035 14.5336 11.4284C14.262 11.3903 13.81 11.5642 13.7079 11.2027C13.691 9.65349 13.7066 8.10296 13.7007 6.55306Z", fill: color }),
|
|
2283
|
+
React__default.createElement("path", { d: "M5.21482 6.61061C6.50542 6.60932 7.79474 6.60091 9.0847 6.60996C9.07564 6.86278 9.06142 7.13823 8.89201 7.34256C8.01005 8.44048 7.14685 9.55262 6.26554 10.6505C7.20245 10.6564 8.13937 10.6525 9.07629 10.6525C9.05883 10.8717 9.13578 11.1271 8.99353 11.3172C8.9043 11.44 8.74265 11.429 8.6088 11.4303C7.43652 11.4239 6.26424 11.4362 5.09261 11.4239C5.09584 11.1762 5.09843 10.9021 5.27172 10.7049C6.14333 9.61146 7.02529 8.52583 7.89302 7.42985C7.00136 7.43114 6.10906 7.42403 5.2174 7.43373C5.21159 7.15957 5.21352 6.88477 5.21482 6.61061Z", fill: color }),
|
|
2284
|
+
React__default.createElement("path", { d: "M16.5981 7.68655C17.5267 7.47899 18.5341 8.08873 18.7882 9.00302C19.1069 9.95416 18.525 11.0851 17.5635 11.3747C16.7469 11.6625 15.7692 11.2868 15.3457 10.5342C15.0133 9.97809 14.9933 9.25002 15.2953 8.67778C15.5513 8.17279 16.046 7.80358 16.5981 7.68655ZM16.5826 8.51031C16.0162 8.71011 15.711 9.39938 15.9322 9.9561C16.1151 10.4824 16.7313 10.8044 17.2667 10.6428C17.8778 10.4967 18.247 9.78087 18.0304 9.19441C17.8493 8.61377 17.1478 8.27883 16.5826 8.51031Z", fill: color }),
|
|
2285
|
+
React__default.createElement("path", { d: "M9.71965 8.36353C10.1665 7.81005 10.9488 7.53718 11.6381 7.73439C11.8657 7.79194 12.072 7.90574 12.2711 8.02666C12.2692 7.96588 12.2647 7.84496 12.2627 7.78418C12.5233 7.78289 12.7832 7.78354 13.0438 7.78224C13.0425 8.99784 13.0412 10.2134 13.0445 11.4297C12.8531 11.4245 12.6584 11.4472 12.4703 11.4084C12.3384 11.3547 12.2976 11.2105 12.2453 11.0928C11.5262 11.6515 10.3966 11.5247 9.79919 10.8445C9.16229 10.1856 9.12931 9.06315 9.71965 8.36353ZM10.7723 8.52648C10.1736 8.73727 9.88324 9.50865 10.1865 10.0647C10.4451 10.6066 11.1732 10.8342 11.6937 10.5355C12.1767 10.282 12.3998 9.65285 12.1922 9.14979C11.9911 8.60277 11.3129 8.29629 10.7723 8.52648Z", fill: color }),
|
|
2286
|
+
React__default.createElement("path", { d: "M4.20742 0.101327C4.89217 -0.00665471 5.58855 -0.00730131 6.28041 0.008217L6.22092 0.0631777C5.31569 0.656106 4.56499 1.47017 4.02249 2.4045C2.93492 4.27511 2.53856 6.48711 2.62843 8.63123C2.71766 10.377 3.13666 12.1325 4.02508 13.6501C4.1738 13.9217 4.42144 14.1616 4.42532 14.4913C4.45313 15.1987 4.10332 15.8653 3.63001 16.371C3.66105 16.4033 3.69144 16.4356 3.72247 16.468C4.16539 16.9516 4.63805 17.4062 5.08809 17.8834C5.72757 18.6063 6.45628 19.2464 7.08283 19.9822C6.04052 19.9977 4.98592 20.0462 3.9559 19.8516C2.65947 19.6001 1.50853 18.7013 0.958922 17.4999C0.625925 16.8055 0.526349 16.0289 0.500485 15.2679C0.499838 11.7543 0.499838 8.24133 0.500485 4.72837C0.51471 3.55415 0.825723 2.32562 1.65207 1.45465C2.30643 0.716886 3.233 0.237112 4.20742 0.101327Z", fill: color }),
|
|
2287
|
+
React__default.createElement("path", { d: "M6.22092 0.0631777C6.36576 0.0217955 6.51706 0.0088636 6.66707 0.00433743C9.25281 0.0140364 11.8386 0.00304423 14.4243 0.00757041C15.1155 0.0159762 15.8106 -0.0305788 16.4966 0.0748164C17.4465 0.147235 18.3608 0.549418 19.0675 1.18502C19.9546 2.03271 20.4279 3.25348 20.4428 4.47102C20.4435 7.89863 20.4415 11.3288 20.4447 14.7551C20.4357 14.7752 20.4182 14.8166 20.4092 14.8373C19.4878 15.8679 18.2489 16.5656 16.9538 17.0169C15.2086 17.6118 13.3393 17.8032 11.5049 17.6635C9.67051 17.5058 7.8219 17.0266 6.26618 16.0128C5.47087 16.3665 4.59344 16.5397 3.72247 16.468C3.69144 16.4356 3.66105 16.4033 3.63001 16.371C4.10332 15.8653 4.45313 15.1987 4.42532 14.4913C4.42144 14.1616 4.1738 13.9217 4.02508 13.6501C3.13666 12.1325 2.71766 10.377 2.62843 8.63123C2.53856 6.48711 2.93492 4.27511 4.02249 2.4045C4.56499 1.47017 5.31569 0.656106 6.22092 0.0631777ZM13.7007 6.55306C13.7066 8.10296 13.691 9.65349 13.7079 11.2027C13.81 11.5642 14.262 11.3903 14.5336 11.4284C14.529 9.8035 14.529 8.17796 14.5336 6.55306C14.2555 6.55306 13.9781 6.55306 13.7007 6.55306ZM5.21482 6.61061C5.21352 6.88477 5.21159 7.15957 5.2174 7.43373C6.10906 7.42403 7.00136 7.43114 7.89302 7.42985C7.02529 8.52583 6.14333 9.61146 5.27172 10.7049C5.09843 10.9021 5.09584 11.1762 5.09261 11.4239C6.26424 11.4362 7.43652 11.4239 8.6088 11.4303C8.74265 11.429 8.9043 11.44 8.99353 11.3172C9.13578 11.1271 9.05883 10.8717 9.07629 10.6525C8.13937 10.6525 7.20245 10.6564 6.26554 10.6505C7.14685 9.55262 8.01005 8.44048 8.89201 7.34256C9.06142 7.13823 9.07564 6.86278 9.0847 6.60996C7.79474 6.60091 6.50542 6.60932 5.21482 6.61061ZM16.5981 7.68655C16.046 7.80358 15.5513 8.17279 15.2953 8.67778C14.9933 9.25002 15.0133 9.97809 15.3457 10.5342C15.7692 11.2868 16.7469 11.6625 17.5635 11.3747C18.525 11.0851 19.1069 9.95416 18.7882 9.00302C18.5341 8.08873 17.5267 7.47899 16.5981 7.68655ZM9.71965 8.36353C9.12931 9.06315 9.16229 10.1856 9.79919 10.8445C10.3966 11.5247 11.5262 11.6515 12.2453 11.0928C12.2976 11.2105 12.3384 11.3547 12.4703 11.4084C12.6584 11.4472 12.8531 11.4245 13.0445 11.4297C13.0412 10.2134 13.0425 8.99784 13.0438 7.78224C12.7832 7.78354 12.5233 7.78289 12.2627 7.78418C12.2647 7.84496 12.2692 7.96588 12.2711 8.02666C12.072 7.90574 11.8657 7.79194 11.6381 7.73439C10.9488 7.53718 10.1665 7.81005 9.71965 8.36353Z", fill: "white" }),
|
|
2288
|
+
React__default.createElement("path", { d: "M10.7737 8.52648C11.3142 8.29629 11.9925 8.60278 12.1936 9.1498C12.4012 9.65285 12.1781 10.282 11.6951 10.5355C11.1746 10.8342 10.4465 10.6066 10.1879 10.0647C9.8846 9.50866 10.1749 8.73727 10.7737 8.52648Z", fill: "white" }),
|
|
2289
|
+
React__default.createElement("path", { d: "M16.5822 8.51048C17.1473 8.279 17.8489 8.61394 18.0299 9.19458C18.2465 9.78104 17.8773 10.4968 17.2663 10.643C16.7309 10.8046 16.1147 10.4826 15.9317 9.95627C15.7106 9.39955 16.0158 8.71028 16.5822 8.51048Z", fill: "white" }),
|
|
2290
|
+
React__default.createElement("path", { d: "M20.4094 14.8378L20.4604 14.7822C20.487 15.7929 20.3777 16.8475 19.8817 17.7469C19.305 18.8021 18.2588 19.5858 17.082 19.8367C16.4218 19.9731 15.7448 20.0035 15.0724 19.9951C13.0039 19.9957 10.9354 19.9951 8.86698 19.9957C8.27211 19.986 7.67595 20.0138 7.08302 19.9828C6.45646 19.247 5.72775 18.6068 5.08827 17.8839C4.63824 17.4068 4.16557 16.9522 3.72266 16.4685C4.59362 16.5403 5.47105 16.367 6.26637 16.0133C7.82208 17.0272 9.67069 17.5063 11.5051 17.6641C13.3395 17.8038 15.2088 17.6124 16.954 17.0175C18.2491 16.5662 19.488 15.8685 20.4094 14.8378Z", fill: color })));
|
|
2291
|
+
};
|
|
2292
|
+
|
|
2059
2293
|
const SSOFirstScreen = ({ hidden, config, }) => {
|
|
2060
2294
|
var _a, _b;
|
|
2061
2295
|
const [phone, setPhone] = React__default.useState('');
|
|
2062
2296
|
const [errMsg, setErrMsg] = React__default.useState('');
|
|
2063
2297
|
const { locale, onClose, setTracking } = useSSOState();
|
|
2064
2298
|
const { addStep, goNext } = useSSOSteps();
|
|
2299
|
+
const { setUserInfo } = useSSOV2Store();
|
|
2065
2300
|
const [activeTab, setActiveTab] = React__default.useState('login');
|
|
2066
2301
|
const { legalTextType } = config || {};
|
|
2067
2302
|
const { t } = useTranslations();
|
|
2068
|
-
const
|
|
2069
|
-
const
|
|
2303
|
+
const trackingAction = 'Sign In or Sign Up';
|
|
2304
|
+
const trackingCategory = `SSO - ${activeTab === 'login' ? 'Sign In' : 'Sign Up'}`;
|
|
2070
2305
|
useEffect(() => {
|
|
2071
2306
|
if (!hidden) {
|
|
2072
2307
|
setErrMsg('');
|
|
@@ -2077,24 +2312,42 @@ const SSOFirstScreen = ({ hidden, config, }) => {
|
|
|
2077
2312
|
}
|
|
2078
2313
|
}, [hidden]);
|
|
2079
2314
|
const [loading, setLoading] = React__default.useState(false);
|
|
2315
|
+
// onTrigger -> handleLoginBySocial -> loginBySocial
|
|
2080
2316
|
const handleLoginBySocial = (credential, provider) => __awaiter(void 0, void 0, void 0, function* () {
|
|
2081
|
-
var _c, _d;
|
|
2082
2317
|
const res = yield loginBySocial(credential, provider);
|
|
2083
2318
|
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
2084
2319
|
handleAuthSuccess(res === null || res === void 0 ? void 0 : res._data);
|
|
2085
2320
|
const userInfo = yield getUserInfo();
|
|
2321
|
+
setUserInfo(userInfo === null || userInfo === void 0 ? void 0 : userInfo._data);
|
|
2086
2322
|
if ((userInfo === null || userInfo === void 0 ? void 0 : userInfo._status) === 1 && userInfo._data) {
|
|
2087
2323
|
useSSOV2Store.setState({
|
|
2088
2324
|
flowData: {
|
|
2089
2325
|
method: provider,
|
|
2090
2326
|
},
|
|
2091
2327
|
});
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2328
|
+
const isNotHavePhone = !userInfo._data.phone || !userInfo._data.phone_verified_at;
|
|
2329
|
+
if (isNotHavePhone) {
|
|
2330
|
+
useSSOV2Store.setState((f) => {
|
|
2331
|
+
var _a;
|
|
2332
|
+
return ({
|
|
2333
|
+
flowData: Object.assign(Object.assign({}, f.flowData), { flow: ((_a = userInfo === null || userInfo === void 0 ? void 0 : userInfo._data) === null || _a === void 0 ? void 0 : _a.first_time_login) ? 'signup' : 'login', isVerifyPhone: true }),
|
|
2334
|
+
});
|
|
2335
|
+
});
|
|
2336
|
+
addStep({
|
|
2337
|
+
type: SSOStepTypeType.VERIFY_PHONE,
|
|
2338
|
+
config: {
|
|
2339
|
+
provider: provider,
|
|
2340
|
+
},
|
|
2341
|
+
});
|
|
2342
|
+
goNext();
|
|
2343
|
+
}
|
|
2344
|
+
else if (!isUserFinishedSetup(userInfo._data)) {
|
|
2345
|
+
useSSOV2Store.setState((f) => {
|
|
2346
|
+
var _a;
|
|
2347
|
+
return ({
|
|
2348
|
+
flowData: Object.assign(Object.assign({}, f.flowData), { flow: ((_a = userInfo === null || userInfo === void 0 ? void 0 : userInfo._data) === null || _a === void 0 ? void 0 : _a.first_time_login) ? 'signup' : 'login' }),
|
|
2349
|
+
});
|
|
2350
|
+
});
|
|
2098
2351
|
if (provider === 'facebook') {
|
|
2099
2352
|
window.FB.api('/me', { fields: 'name, email, gender, birthday' }, function (response) {
|
|
2100
2353
|
addStep({
|
|
@@ -2122,19 +2375,6 @@ const SSOFirstScreen = ({ hidden, config, }) => {
|
|
|
2122
2375
|
goNext();
|
|
2123
2376
|
}
|
|
2124
2377
|
}
|
|
2125
|
-
else if (!((_c = userInfo._data) === null || _c === void 0 ? void 0 : _c.phone_verified_at) ||
|
|
2126
|
-
!((_d = userInfo._data) === null || _d === void 0 ? void 0 : _d.phone)) {
|
|
2127
|
-
useSSOV2Store.setState((f) => ({
|
|
2128
|
-
flowData: Object.assign(Object.assign({}, f.flowData), { flow: 'login', isVerifyPhone: true }),
|
|
2129
|
-
}));
|
|
2130
|
-
addStep({
|
|
2131
|
-
type: SSOStepTypeType.VERIFY_PHONE,
|
|
2132
|
-
config: {
|
|
2133
|
-
provider: provider,
|
|
2134
|
-
},
|
|
2135
|
-
});
|
|
2136
|
-
goNext();
|
|
2137
|
-
}
|
|
2138
2378
|
else {
|
|
2139
2379
|
onClose === null || onClose === void 0 ? void 0 : onClose(true);
|
|
2140
2380
|
}
|
|
@@ -2174,7 +2414,7 @@ const SSOFirstScreen = ({ hidden, config, }) => {
|
|
|
2174
2414
|
};
|
|
2175
2415
|
}, []);
|
|
2176
2416
|
const onClickContinueZalo = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
2177
|
-
var
|
|
2417
|
+
var _c, _d;
|
|
2178
2418
|
setLoading(true);
|
|
2179
2419
|
const { areaCode, phoneNumber } = splitPhone(phone);
|
|
2180
2420
|
if (!areaCode || !phoneNumber || !phone) {
|
|
@@ -2183,12 +2423,13 @@ const SSOFirstScreen = ({ hidden, config, }) => {
|
|
|
2183
2423
|
}
|
|
2184
2424
|
const userExist = yield checkUserExist({ phone: phoneNumber });
|
|
2185
2425
|
if ((userExist === null || userExist === void 0 ? void 0 : userExist._status) === 1) {
|
|
2186
|
-
const provider = (
|
|
2187
|
-
if ((
|
|
2426
|
+
const provider = (_c = userExist._data) === null || _c === void 0 ? void 0 : _c.provider;
|
|
2427
|
+
if ((_d = userExist._data) === null || _d === void 0 ? void 0 : _d.is_pass) {
|
|
2188
2428
|
useSSOV2Store.setState({
|
|
2189
2429
|
flowData: {
|
|
2190
2430
|
method: 'zalo',
|
|
2191
2431
|
flow: 'login',
|
|
2432
|
+
metaData: userExist._data,
|
|
2192
2433
|
},
|
|
2193
2434
|
});
|
|
2194
2435
|
addStep({
|
|
@@ -2216,6 +2457,7 @@ const SSOFirstScreen = ({ hidden, config, }) => {
|
|
|
2216
2457
|
flowData: {
|
|
2217
2458
|
method: 'zalo',
|
|
2218
2459
|
flow: 'signup',
|
|
2460
|
+
metaData: userExist._data,
|
|
2219
2461
|
},
|
|
2220
2462
|
});
|
|
2221
2463
|
addStep({
|
|
@@ -2223,7 +2465,7 @@ const SSOFirstScreen = ({ hidden, config, }) => {
|
|
|
2223
2465
|
config: {
|
|
2224
2466
|
phone,
|
|
2225
2467
|
otpType: 'phone-zalo',
|
|
2226
|
-
afterAction: '
|
|
2468
|
+
afterAction: 'forgot',
|
|
2227
2469
|
},
|
|
2228
2470
|
});
|
|
2229
2471
|
goNext();
|
|
@@ -2235,7 +2477,7 @@ const SSOFirstScreen = ({ hidden, config, }) => {
|
|
|
2235
2477
|
setLoading(false);
|
|
2236
2478
|
});
|
|
2237
2479
|
const onClickContinuePhone = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
2238
|
-
var
|
|
2480
|
+
var _e, _f;
|
|
2239
2481
|
setLoading(true);
|
|
2240
2482
|
const { areaCode, phoneNumber } = splitPhone(phone);
|
|
2241
2483
|
if (!areaCode || !phoneNumber || !phone) {
|
|
@@ -2244,12 +2486,13 @@ const SSOFirstScreen = ({ hidden, config, }) => {
|
|
|
2244
2486
|
}
|
|
2245
2487
|
const userExist = yield checkUserExist({ phone: phoneNumber });
|
|
2246
2488
|
if ((userExist === null || userExist === void 0 ? void 0 : userExist._status) === 1) {
|
|
2247
|
-
const provider = (
|
|
2248
|
-
if ((
|
|
2489
|
+
const provider = (_e = userExist._data) === null || _e === void 0 ? void 0 : _e.provider;
|
|
2490
|
+
if ((_f = userExist._data) === null || _f === void 0 ? void 0 : _f.is_pass) {
|
|
2249
2491
|
useSSOV2Store.setState({
|
|
2250
2492
|
flowData: {
|
|
2251
2493
|
method: 'sms',
|
|
2252
2494
|
flow: 'login',
|
|
2495
|
+
metaData: userExist._data,
|
|
2253
2496
|
},
|
|
2254
2497
|
});
|
|
2255
2498
|
addStep({
|
|
@@ -2277,6 +2520,7 @@ const SSOFirstScreen = ({ hidden, config, }) => {
|
|
|
2277
2520
|
flowData: {
|
|
2278
2521
|
method: 'sms',
|
|
2279
2522
|
flow: 'signup',
|
|
2523
|
+
metaData: userExist._data,
|
|
2280
2524
|
},
|
|
2281
2525
|
});
|
|
2282
2526
|
addStep({
|
|
@@ -2284,7 +2528,7 @@ const SSOFirstScreen = ({ hidden, config, }) => {
|
|
|
2284
2528
|
config: {
|
|
2285
2529
|
phone,
|
|
2286
2530
|
otpType: 'phone-sms',
|
|
2287
|
-
afterAction: '
|
|
2531
|
+
afterAction: 'forgot',
|
|
2288
2532
|
},
|
|
2289
2533
|
});
|
|
2290
2534
|
goNext();
|
|
@@ -2296,7 +2540,7 @@ const SSOFirstScreen = ({ hidden, config, }) => {
|
|
|
2296
2540
|
setLoading(false);
|
|
2297
2541
|
});
|
|
2298
2542
|
const onClickLoginWithPhone = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
2299
|
-
var
|
|
2543
|
+
var _g, _h;
|
|
2300
2544
|
setLoading(true);
|
|
2301
2545
|
const { areaCode, phoneNumber } = splitPhone(phone);
|
|
2302
2546
|
if (!areaCode || !phoneNumber || !phone) {
|
|
@@ -2305,7 +2549,7 @@ const SSOFirstScreen = ({ hidden, config, }) => {
|
|
|
2305
2549
|
}
|
|
2306
2550
|
const userExist = yield checkUserExist({ phone: phoneNumber });
|
|
2307
2551
|
if ((userExist === null || userExist === void 0 ? void 0 : userExist._status) === 1) {
|
|
2308
|
-
if (!userExist._data || !((
|
|
2552
|
+
if (!userExist._data || !((_g = userExist._data) === null || _g === void 0 ? void 0 : _g.is_pass)) {
|
|
2309
2553
|
showNotification({
|
|
2310
2554
|
message: t('ssov2.first.noAccountOrPass'),
|
|
2311
2555
|
type: 'danger',
|
|
@@ -2313,11 +2557,12 @@ const SSOFirstScreen = ({ hidden, config, }) => {
|
|
|
2313
2557
|
setActiveTab('signup');
|
|
2314
2558
|
return setLoading(false);
|
|
2315
2559
|
}
|
|
2316
|
-
if ((
|
|
2560
|
+
if ((_h = userExist._data) === null || _h === void 0 ? void 0 : _h.is_pass) {
|
|
2317
2561
|
useSSOV2Store.setState({
|
|
2318
2562
|
flowData: {
|
|
2319
2563
|
method: 'phone',
|
|
2320
2564
|
flow: 'login',
|
|
2565
|
+
metaData: userExist._data,
|
|
2321
2566
|
},
|
|
2322
2567
|
});
|
|
2323
2568
|
addStep({
|
|
@@ -2339,7 +2584,7 @@ const SSOFirstScreen = ({ hidden, config, }) => {
|
|
|
2339
2584
|
useSSOV2Store.setState({
|
|
2340
2585
|
flowData: {
|
|
2341
2586
|
method: 'email',
|
|
2342
|
-
flow: 'login',
|
|
2587
|
+
flow: activeTab === 'login' ? 'login' : 'signup',
|
|
2343
2588
|
},
|
|
2344
2589
|
});
|
|
2345
2590
|
addStep({
|
|
@@ -2396,10 +2641,21 @@ const SSOFirstScreen = ({ hidden, config, }) => {
|
|
|
2396
2641
|
onClickContinueZalo();
|
|
2397
2642
|
} },
|
|
2398
2643
|
React__default.createElement(Input.Wrapper, { error: errMsg },
|
|
2399
|
-
React__default.createElement(StyledPhone, { defaultCountry: (locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN'), value: phone, onChange: (value) => setPhone(value), isError: !!errMsg, required: true, name: "phone", disabled: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Enter Phone"
|
|
2644
|
+
React__default.createElement(StyledPhone, { defaultCountry: (locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN'), value: phone, onChange: (value) => setPhone(value), isError: !!errMsg, required: true, name: "phone", disabled: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Enter Phone", trackingFn: useCallback((option) => {
|
|
2645
|
+
if (!(option === null || option === void 0 ? void 0 : option.label))
|
|
2646
|
+
return;
|
|
2647
|
+
return {
|
|
2648
|
+
'data-event-action': 'Country Selection',
|
|
2649
|
+
'data-event-label': option.label,
|
|
2650
|
+
'data-event-category': activeTab === 'signup'
|
|
2651
|
+
? 'SSO - Sign Up'
|
|
2652
|
+
: 'SSO - Sign In',
|
|
2653
|
+
};
|
|
2654
|
+
}, [activeTab]) }))),
|
|
2400
2655
|
React__default.createElement(Button, { size: "lg", variant: "primary", onClick: onClickLoginWithPhone, loading: loading, disabled: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Continue Login", display: activeTab === 'login' ? 'block' : 'none' }, t('ssov2.button.continue')),
|
|
2401
|
-
React__default.createElement(Button, { size: "lg", variant: "primary", onClick: onClickContinueZalo, loading: loading, disabled: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Continue with Zalo", display: activeTab === 'signup' ? 'block' : 'none' }, t('ssov2.button.otp.zalo')),
|
|
2402
|
-
React__default.createElement(Button, { size: "
|
|
2656
|
+
React__default.createElement(Button, { size: "lg", variant: "primary", onClick: onClickContinueZalo, loading: loading, disabled: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Continue with Zalo", display: activeTab === 'signup' ? 'block' : 'none', leftIcon: React__default.createElement(Zalo, null) }, t('ssov2.button.otp.zalo')),
|
|
2657
|
+
React__default.createElement(Button, { size: "sm", variant: "white", onClick: onClickContinuePhone, loading: loading, disabled: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Continue with SMS", display: activeTab === 'signup' ? 'block' : 'none', style: { fontWeight: 400 }, color: "#595959", leftIcon: React__default.createElement(ReplySquare, { size: 18 }) }, t('ssov2.button.otp.sms'))),
|
|
2658
|
+
React__default.createElement(Divider, { color: "#E4E8EC", display: activeTab === 'signup' ? 'block' : 'none' }),
|
|
2403
2659
|
React__default.createElement(Stack, { spacing: 16, align: "center" },
|
|
2404
2660
|
React__default.createElement(Text, { size: "p4", color: "gray.4" }, t('ssov2.orContinueWith')),
|
|
2405
2661
|
React__default.createElement(Group, { spacing: 8, style: {
|
|
@@ -2478,10 +2734,8 @@ const initSendUpdateEmailOtp = (email) => __awaiter(void 0, void 0, void 0, func
|
|
|
2478
2734
|
});
|
|
2479
2735
|
});
|
|
2480
2736
|
const resendUpdateEmailOTP = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
2481
|
-
const formData = new FormData();
|
|
2482
2737
|
return fetchSSOV2Api(SSO_V2_PATHS.ECOM_CARE.RESEND_OTP, {
|
|
2483
|
-
method: '
|
|
2484
|
-
body: formData,
|
|
2738
|
+
method: 'GET',
|
|
2485
2739
|
});
|
|
2486
2740
|
});
|
|
2487
2741
|
const verifyUpdateEmailOTP = (otpCode) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -2496,8 +2750,8 @@ const verifyUpdateEmailOTP = (otpCode) => __awaiter(void 0, void 0, void 0, func
|
|
|
2496
2750
|
const SSOOTPScreen = ({ hidden, index, config, }) => {
|
|
2497
2751
|
const { t } = useTranslations();
|
|
2498
2752
|
const { onClose, setTracking } = useSSOState();
|
|
2499
|
-
const { setSteps } = useSSOSteps();
|
|
2500
|
-
const { flowData } = useSSOV2Store();
|
|
2753
|
+
const { setSteps, steps } = useSSOSteps();
|
|
2754
|
+
const { flowData, userInfo } = useSSOV2Store();
|
|
2501
2755
|
const [loading, setLoading] = React__default.useState(false);
|
|
2502
2756
|
const [otp, setOtp] = React__default.useState('');
|
|
2503
2757
|
const [error, setError] = React__default.useState('');
|
|
@@ -2509,14 +2763,14 @@ const SSOOTPScreen = ({ hidden, index, config, }) => {
|
|
|
2509
2763
|
const isEmail = otpType === 'email' || otpType === 'update-email';
|
|
2510
2764
|
const isZalo = otpType === 'phone-zalo';
|
|
2511
2765
|
const isSMS = otpType === 'phone-sms';
|
|
2512
|
-
const trackingMethod = flowData.method;
|
|
2513
|
-
const trackingCategory =
|
|
2514
|
-
?
|
|
2515
|
-
: flowData
|
|
2516
|
-
?
|
|
2517
|
-
:
|
|
2766
|
+
const trackingMethod = flowData === null || flowData === void 0 ? void 0 : flowData.method;
|
|
2767
|
+
const trackingCategory = userInfo && !userInfo.first_time_login
|
|
2768
|
+
? `SSO - Existing User via ${trackingMethod}`
|
|
2769
|
+
: isVerifyPhoneInTheSignUp(steps, flowData)
|
|
2770
|
+
? `SSO - Sign Up via ${trackingMethod}`
|
|
2771
|
+
: `SSO - Sign In via ${trackingMethod}`;
|
|
2518
2772
|
const trackingAction = isEmail
|
|
2519
|
-
? 'Verify Email'
|
|
2773
|
+
? 'Verify Your Email'
|
|
2520
2774
|
: `Verify Phone Number via ${isZalo ? 'Zalo' : isSMS ? 'SMS' : ''}`;
|
|
2521
2775
|
useEffect(() => {
|
|
2522
2776
|
if (!hidden) {
|
|
@@ -2529,15 +2783,7 @@ const SSOOTPScreen = ({ hidden, index, config, }) => {
|
|
|
2529
2783
|
}, [hidden]);
|
|
2530
2784
|
const addStepAndGoNext = (step) => {
|
|
2531
2785
|
useSSOSteps.setState((old) => {
|
|
2532
|
-
var _a, _b;
|
|
2533
2786
|
const oldSteps = old.steps;
|
|
2534
|
-
if (((_a = oldSteps[index - 1]) === null || _a === void 0 ? void 0 : _a.type) === SSOStepTypeType.VERIFY_PHONE ||
|
|
2535
|
-
((_b = oldSteps[index - 1]) === null || _b === void 0 ? void 0 : _b.type) === SSOStepTypeType.UPDATE_EMAIL) {
|
|
2536
|
-
return {
|
|
2537
|
-
steps: oldSteps.slice(0, index - 1).concat(step),
|
|
2538
|
-
currentStepIndex: index - 1,
|
|
2539
|
-
};
|
|
2540
|
-
}
|
|
2541
2787
|
return {
|
|
2542
2788
|
steps: oldSteps.slice(0, index).concat(step),
|
|
2543
2789
|
currentStepIndex: index,
|
|
@@ -2868,7 +3114,7 @@ const SSOOTPScreen = ({ hidden, index, config, }) => {
|
|
|
2868
3114
|
'data-event-category': trackingCategory,
|
|
2869
3115
|
'data-event-action': trackingAction,
|
|
2870
3116
|
'data-event-label': 'Enter Code',
|
|
2871
|
-
} })),
|
|
3117
|
+
}, placeholder: "*" })),
|
|
2872
3118
|
React__default.createElement(Group, { spacing: 8, align: "center", style: {
|
|
2873
3119
|
height: 40,
|
|
2874
3120
|
} },
|
|
@@ -2880,7 +3126,7 @@ const SSOOTPScreen = ({ hidden, index, config, }) => {
|
|
|
2880
3126
|
count: resendTime,
|
|
2881
3127
|
})))),
|
|
2882
3128
|
React__default.createElement(Button, { type: "submit", size: "lg", variant: "primary", mt: 12, fullWidth: true, disabled: loading, loading: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Continue", ref: submitButtonRef }, t('ssov2.button.continue')),
|
|
2883
|
-
!isEmail && (React__default.createElement(Button, { size: "
|
|
3129
|
+
!isEmail && (React__default.createElement(Button, { size: "sm", variant: "white", mt: 12, onClick: swapZaloSms, fullWidth: true, disabled: loading, loading: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": `Send OTP Code via ${otpType === 'phone-sms' ? 'Zalo' : 'SMS'}`, leftIcon: otpType === 'phone-sms' ? (React__default.createElement(Zalo, { size: 18, useCurrentColor: true })) : (React__default.createElement(ReplySquare, { size: 18 })), style: { fontWeight: 400 }, color: "#595959" }, t('ssov2.otp.sendVia', {
|
|
2884
3130
|
method: otpType === 'phone-sms' ? 'Zalo' : 'SMS',
|
|
2885
3131
|
})))));
|
|
2886
3132
|
};
|
|
@@ -2888,6 +3134,7 @@ const SSOOTPScreen = ({ hidden, index, config, }) => {
|
|
|
2888
3134
|
const SSOPasswordScreen = ({ hidden, config, }) => {
|
|
2889
3135
|
const { t } = useTranslations();
|
|
2890
3136
|
const { onClose, setTracking } = useSSOState();
|
|
3137
|
+
const { setUserInfo, flowData } = useSSOV2Store();
|
|
2891
3138
|
const [errMsg, setErrMsg] = React__default.useState('');
|
|
2892
3139
|
const phone = config === null || config === void 0 ? void 0 : config.phone;
|
|
2893
3140
|
const method = config === null || config === void 0 ? void 0 : config.method;
|
|
@@ -2923,9 +3170,15 @@ const SSOPasswordScreen = ({ hidden, config, }) => {
|
|
|
2923
3170
|
let res;
|
|
2924
3171
|
if (!((_a = existRes._data) === null || _a === void 0 ? void 0 : _a.provider)) {
|
|
2925
3172
|
res = yield registerBySendEmailOTP(email);
|
|
3173
|
+
useSSOV2Store.setState((f) => ({
|
|
3174
|
+
flowData: Object.assign(Object.assign({}, f.flowData), { flow: 'signup' }),
|
|
3175
|
+
}));
|
|
2926
3176
|
}
|
|
2927
3177
|
else {
|
|
2928
3178
|
res = yield resendEmailOTP(email);
|
|
3179
|
+
useSSOV2Store.setState((f) => ({
|
|
3180
|
+
flowData: Object.assign(Object.assign({}, f.flowData), { flow: 'login' }),
|
|
3181
|
+
}));
|
|
2929
3182
|
}
|
|
2930
3183
|
if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
|
|
2931
3184
|
setErrMsg(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
|
|
@@ -2951,11 +3204,13 @@ const SSOPasswordScreen = ({ hidden, config, }) => {
|
|
|
2951
3204
|
setLoading(false);
|
|
2952
3205
|
});
|
|
2953
3206
|
const onAuthSuccess = (data) => __awaiter(void 0, void 0, void 0, function* () {
|
|
2954
|
-
var _c, _d;
|
|
2955
3207
|
handleAuthSuccess(data);
|
|
3208
|
+
const userInfo = yield getUserInfo();
|
|
3209
|
+
const isPhoneFlow = isPhoneFlowFn(flowData);
|
|
3210
|
+
const isEmailFlow = isEmailFlowFn(flowData);
|
|
3211
|
+
setUserInfo(userInfo === null || userInfo === void 0 ? void 0 : userInfo._data);
|
|
2956
3212
|
if (!phone && !!email) {
|
|
2957
|
-
|
|
2958
|
-
if (!((_c = userInfo._data) === null || _c === void 0 ? void 0 : _c.phone_verified_at) || !((_d = userInfo._data) === null || _d === void 0 ? void 0 : _d.phone)) {
|
|
3213
|
+
if (isPhoneNotVerifedYet(userInfo === null || userInfo === void 0 ? void 0 : userInfo._data)) {
|
|
2959
3214
|
useSSOV2Store.setState((s) => ({
|
|
2960
3215
|
flowData: Object.assign(Object.assign({}, s.flowData), { isVerifyPhone: true }),
|
|
2961
3216
|
}));
|
|
@@ -2969,6 +3224,27 @@ const SSOPasswordScreen = ({ hidden, config, }) => {
|
|
|
2969
3224
|
return;
|
|
2970
3225
|
}
|
|
2971
3226
|
}
|
|
3227
|
+
if (isLoginWithPhoneNotVerifedYet(flowData, userInfo._data)) {
|
|
3228
|
+
addStep({
|
|
3229
|
+
type: SSOStepTypeType.FORGOT_PASSWORD_PHONE,
|
|
3230
|
+
config: {
|
|
3231
|
+
phone: `${userInfo._data.area_code}${userInfo._data.phone}`,
|
|
3232
|
+
afterAction: 'setup',
|
|
3233
|
+
},
|
|
3234
|
+
});
|
|
3235
|
+
goNext();
|
|
3236
|
+
return;
|
|
3237
|
+
}
|
|
3238
|
+
if ((isPhoneFlow || isEmailFlow) && !isUserFinishedSetup(userInfo === null || userInfo === void 0 ? void 0 : userInfo._data)) {
|
|
3239
|
+
addStep({
|
|
3240
|
+
type: SSOStepTypeType.SETUP_FULL,
|
|
3241
|
+
config: {
|
|
3242
|
+
userInfo: userInfo === null || userInfo === void 0 ? void 0 : userInfo._data,
|
|
3243
|
+
},
|
|
3244
|
+
});
|
|
3245
|
+
goNext();
|
|
3246
|
+
return;
|
|
3247
|
+
}
|
|
2972
3248
|
onClose === null || onClose === void 0 ? void 0 : onClose(true);
|
|
2973
3249
|
});
|
|
2974
3250
|
return (React__default.createElement("form", { style: {
|
|
@@ -3017,6 +3293,48 @@ const SSOPasswordScreen = ({ hidden, config, }) => {
|
|
|
3017
3293
|
React__default.createElement(Button, { type: "submit", size: "lg", variant: "primary", mt: 12, fullWidth: true, disabled: loading, loading: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Sign In" }, t('ssov2.password.signIn'))));
|
|
3018
3294
|
};
|
|
3019
3295
|
|
|
3296
|
+
const SetupLater = ({ style = {} }) => {
|
|
3297
|
+
const { t } = useTranslations();
|
|
3298
|
+
const { onClose, tracking } = useSSOState();
|
|
3299
|
+
const [loading, setLoading] = useState(false);
|
|
3300
|
+
const { userInfo, flowData } = useSSOV2Store();
|
|
3301
|
+
const { currentStepIndex, steps, addStep, goNext } = useSSOSteps();
|
|
3302
|
+
const currentStep = steps[currentStepIndex];
|
|
3303
|
+
const onClickSetupLater = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
3304
|
+
if (loading)
|
|
3305
|
+
return;
|
|
3306
|
+
setLoading(true);
|
|
3307
|
+
if (userInfo &&
|
|
3308
|
+
!isUserFinishedSetup(userInfo) &&
|
|
3309
|
+
((currentStep === null || currentStep === void 0 ? void 0 : currentStep.type) === SSOStepTypeType.VERIFY_PHONE ||
|
|
3310
|
+
(currentStep === null || currentStep === void 0 ? void 0 : currentStep.type) === SSOStepTypeType.FORGOT_PASSWORD_PHONE)) {
|
|
3311
|
+
addStep({
|
|
3312
|
+
type: SSOStepTypeType.SETUP_FULL,
|
|
3313
|
+
config: {
|
|
3314
|
+
userInfo,
|
|
3315
|
+
},
|
|
3316
|
+
});
|
|
3317
|
+
goNext();
|
|
3318
|
+
}
|
|
3319
|
+
else if (!userInfo &&
|
|
3320
|
+
!isFlowFinishedSetup(flowData) &&
|
|
3321
|
+
(currentStep === null || currentStep === void 0 ? void 0 : currentStep.type) === SSOStepTypeType.VERIFY_PHONE) {
|
|
3322
|
+
addStep({
|
|
3323
|
+
type: SSOStepTypeType.SETUP_FULL,
|
|
3324
|
+
config: {
|
|
3325
|
+
userInfo,
|
|
3326
|
+
},
|
|
3327
|
+
});
|
|
3328
|
+
goNext();
|
|
3329
|
+
}
|
|
3330
|
+
else {
|
|
3331
|
+
onClose === null || onClose === void 0 ? void 0 : onClose(true);
|
|
3332
|
+
}
|
|
3333
|
+
setLoading(false);
|
|
3334
|
+
});
|
|
3335
|
+
return (React__default.createElement(Button, { size: "sm", variant: "white", color: "#737373", style: Object.assign({ fontWeight: 400 }, style), onClick: onClickSetupLater, disabled: loading, dataEventCategory: tracking === null || tracking === void 0 ? void 0 : tracking.category, dataEventAction: tracking === null || tracking === void 0 ? void 0 : tracking.action, dataEventLabel: "Setup Later" }, t('ssov2.button.setupLater')));
|
|
3336
|
+
};
|
|
3337
|
+
|
|
3020
3338
|
const SSOPasswordForgotPhone = ({ hidden, config, }) => {
|
|
3021
3339
|
const phone = config === null || config === void 0 ? void 0 : config.phone;
|
|
3022
3340
|
const { t } = useTranslations();
|
|
@@ -3064,7 +3382,7 @@ const SSOPasswordForgotPhone = ({ hidden, config, }) => {
|
|
|
3064
3382
|
config: {
|
|
3065
3383
|
phone,
|
|
3066
3384
|
otpType: 'phone-zalo',
|
|
3067
|
-
afterAction: 'forgot',
|
|
3385
|
+
afterAction: config.afterAction || 'forgot',
|
|
3068
3386
|
provider: (_b = userExist._data) === null || _b === void 0 ? void 0 : _b.provider,
|
|
3069
3387
|
},
|
|
3070
3388
|
});
|
|
@@ -3107,7 +3425,7 @@ const SSOPasswordForgotPhone = ({ hidden, config, }) => {
|
|
|
3107
3425
|
config: {
|
|
3108
3426
|
phone,
|
|
3109
3427
|
otpType: 'phone-sms',
|
|
3110
|
-
afterAction: 'forgot',
|
|
3428
|
+
afterAction: config.afterAction || 'forgot',
|
|
3111
3429
|
provider: (_d = userExist._data) === null || _d === void 0 ? void 0 : _d.provider,
|
|
3112
3430
|
},
|
|
3113
3431
|
});
|
|
@@ -3132,10 +3450,19 @@ const SSOPasswordForgotPhone = ({ hidden, config, }) => {
|
|
|
3132
3450
|
React__default.createElement(Stack, { mt: 24, spacing: 16 },
|
|
3133
3451
|
React__default.createElement(StyledPhone, { defaultCountry: (locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN'), value: phone,
|
|
3134
3452
|
// onChange={(value) => setPhone(value)}
|
|
3135
|
-
isError: !!errMsg, required: true, disabled: true, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Enter Phone"
|
|
3453
|
+
isError: !!errMsg, required: true, disabled: true, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Enter Phone", trackingFn: useCallback((option) => {
|
|
3454
|
+
if (!(option === null || option === void 0 ? void 0 : option.label))
|
|
3455
|
+
return;
|
|
3456
|
+
return {
|
|
3457
|
+
'data-event-action': 'Country Selection',
|
|
3458
|
+
'data-event-label': option.label,
|
|
3459
|
+
'data-event-category': trackingCategory,
|
|
3460
|
+
};
|
|
3461
|
+
}, []) }),
|
|
3136
3462
|
errMsg && (React__default.createElement(Text, { size: "label2", color: "red.6", mt: -12 }, errMsg)),
|
|
3137
|
-
React__default.createElement(Button, { size: "lg", variant: "primary", onClick: onClickContinueZalo, disabled: loading, loading: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Continue with Zalo" }, t('ssov2.button.continueZalo')),
|
|
3138
|
-
React__default.createElement(Button, { size: "
|
|
3463
|
+
React__default.createElement(Button, { size: "lg", variant: "primary", onClick: onClickContinueZalo, disabled: loading, loading: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Continue with Zalo", leftIcon: React__default.createElement(Zalo, null) }, t('ssov2.button.continueZalo')),
|
|
3464
|
+
React__default.createElement(Button, { size: "sm", variant: "white", onClick: onClickContinuePhone, disabled: loading, loading: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Continue with SMS", style: { fontWeight: 400 }, color: "#595959", leftIcon: React__default.createElement(ReplySquare, { size: 18 }) }, t('ssov2.button.continueSMS')),
|
|
3465
|
+
React__default.createElement(SetupLater, null))));
|
|
3139
3466
|
};
|
|
3140
3467
|
|
|
3141
3468
|
const CheckGrayIcon = () => (React__default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
@@ -3176,11 +3503,14 @@ const SSOPasswordForgotSetup = ({ hidden, }) => {
|
|
|
3176
3503
|
const { t } = useTranslations();
|
|
3177
3504
|
const [loading, setLoading] = React__default.useState(false);
|
|
3178
3505
|
const [errMsg, setErrMsg] = React__default.useState('');
|
|
3179
|
-
const { setTracking } = useSSOState();
|
|
3180
|
-
const {
|
|
3506
|
+
const { setTracking, onClose } = useSSOState();
|
|
3507
|
+
const { addStep, goNext } = useSSOSteps();
|
|
3508
|
+
const { flowData, setUserInfo } = useSSOV2Store();
|
|
3181
3509
|
const trackingMethod = flowData.method;
|
|
3182
|
-
const trackingCategory =
|
|
3183
|
-
|
|
3510
|
+
const trackingCategory = flowData.flow === 'login'
|
|
3511
|
+
? `SSO - Sign In via ${trackingMethod}`
|
|
3512
|
+
: `SSO - Sign Up via ${trackingMethod}`;
|
|
3513
|
+
const trackingAction = `Setup Password`;
|
|
3184
3514
|
useEffect(() => {
|
|
3185
3515
|
if (!hidden) {
|
|
3186
3516
|
setErrMsg('');
|
|
@@ -3208,6 +3538,7 @@ const SSOPasswordForgotSetup = ({ hidden, }) => {
|
|
|
3208
3538
|
})),
|
|
3209
3539
|
});
|
|
3210
3540
|
const onSubmit = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
3541
|
+
var _a;
|
|
3211
3542
|
setLoading(true);
|
|
3212
3543
|
try {
|
|
3213
3544
|
const { password, confirmPassword } = values;
|
|
@@ -3215,22 +3546,72 @@ const SSOPasswordForgotSetup = ({ hidden, }) => {
|
|
|
3215
3546
|
password.length <= 50 &&
|
|
3216
3547
|
password.match(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)/) &&
|
|
3217
3548
|
password === confirmPassword) {
|
|
3218
|
-
const
|
|
3549
|
+
const isPhoneOrEmailFlow = isPhoneFlowFn(flowData) || isEmailFlowFn(flowData);
|
|
3550
|
+
const res = isPhoneOrEmailFlow
|
|
3551
|
+
? yield updateUserInfo({
|
|
3552
|
+
password,
|
|
3553
|
+
confirm_password: confirmPassword,
|
|
3554
|
+
validate: '',
|
|
3555
|
+
})
|
|
3556
|
+
: yield resetPassword(password, confirmPassword);
|
|
3219
3557
|
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3558
|
+
if (isPhoneOrEmailFlow) {
|
|
3559
|
+
// Login again to fetch token
|
|
3560
|
+
const email = parseEmailFromToken((_a = res === null || res === void 0 ? void 0 : res._data) === null || _a === void 0 ? void 0 : _a.token);
|
|
3561
|
+
// Only Email flow have the verify phone before. Need new profile to tracking correctly
|
|
3562
|
+
const newTokenRes = isEmailFlowFn(flowData) && isResetPasswordFlowFn(steps)
|
|
3563
|
+
? yield loginByEmailPassword(email, password)
|
|
3564
|
+
: null;
|
|
3565
|
+
handleAuthSuccess((newTokenRes === null || newTokenRes === void 0 ? void 0 : newTokenRes._data) || (res === null || res === void 0 ? void 0 : res._data));
|
|
3566
|
+
const userInfo = yield getUserInfo();
|
|
3567
|
+
// Phone
|
|
3568
|
+
if (isPhoneFlowFn(flowData)) {
|
|
3569
|
+
if (userInfo && !isUserFinishedSetup(userInfo === null || userInfo === void 0 ? void 0 : userInfo._data)) {
|
|
3570
|
+
addStep({
|
|
3571
|
+
type: SSOStepTypeType.SETUP_FULL,
|
|
3572
|
+
config: {
|
|
3573
|
+
userInfo: userInfo === null || userInfo === void 0 ? void 0 : userInfo._data,
|
|
3574
|
+
},
|
|
3575
|
+
});
|
|
3576
|
+
goNext();
|
|
3577
|
+
}
|
|
3578
|
+
else {
|
|
3579
|
+
onClose === null || onClose === void 0 ? void 0 : onClose(true);
|
|
3580
|
+
}
|
|
3581
|
+
}
|
|
3582
|
+
// Email
|
|
3583
|
+
if (isEmailFlowFn(flowData)) {
|
|
3584
|
+
setUserInfo(userInfo === null || userInfo === void 0 ? void 0 : userInfo._data);
|
|
3585
|
+
if (isPhoneNotVerifedYet(userInfo === null || userInfo === void 0 ? void 0 : userInfo._data)) {
|
|
3586
|
+
addStep({
|
|
3587
|
+
type: SSOStepTypeType.VERIFY_PHONE,
|
|
3588
|
+
config: {
|
|
3589
|
+
provider: 'email',
|
|
3590
|
+
},
|
|
3591
|
+
});
|
|
3592
|
+
goNext();
|
|
3593
|
+
}
|
|
3594
|
+
else {
|
|
3595
|
+
onClose === null || onClose === void 0 ? void 0 : onClose(true);
|
|
3596
|
+
}
|
|
3597
|
+
}
|
|
3230
3598
|
}
|
|
3231
3599
|
else {
|
|
3232
|
-
|
|
3233
|
-
|
|
3600
|
+
showNotification({
|
|
3601
|
+
type: 'success',
|
|
3602
|
+
message: 'Password has been reset successfully',
|
|
3603
|
+
});
|
|
3604
|
+
// back to login step
|
|
3605
|
+
const foundPasswordIndex = steps.findIndex((step) => step.type === SSOStepTypeType.PASSWORD);
|
|
3606
|
+
if (foundPasswordIndex === -1) {
|
|
3607
|
+
// reset to first step
|
|
3608
|
+
setSteps((s) => [s[0]]);
|
|
3609
|
+
useSSOSteps.setState({ currentStepIndex: 0 });
|
|
3610
|
+
}
|
|
3611
|
+
else {
|
|
3612
|
+
setSteps((s) => s.slice(0, foundPasswordIndex + 1));
|
|
3613
|
+
useSSOSteps.setState({ currentStepIndex: foundPasswordIndex });
|
|
3614
|
+
}
|
|
3234
3615
|
}
|
|
3235
3616
|
// onClose?.()
|
|
3236
3617
|
}
|
|
@@ -3258,7 +3639,9 @@ const SSOPasswordForgotSetup = ({ hidden, }) => {
|
|
|
3258
3639
|
action: trackingAction,
|
|
3259
3640
|
} }),
|
|
3260
3641
|
errMsg && (React__default.createElement(Text, { size: "label2", color: "red.6", mt: -12 }, errMsg)),
|
|
3261
|
-
React__default.createElement(Button, { type: "submit", size: "lg", variant: "primary", fullWidth: true, disabled: loading, loading: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label":
|
|
3642
|
+
React__default.createElement(Button, { type: "submit", size: "lg", variant: "primary", fullWidth: true, disabled: loading, loading: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": (flowData === null || flowData === void 0 ? void 0 : flowData.flow) === 'signup' ? 'Create New Account' : 'Save' }, (flowData === null || flowData === void 0 ? void 0 : flowData.flow) === 'signup'
|
|
3643
|
+
? t('ssov2.setup.button.createAccount')
|
|
3644
|
+
: t('ssov2.button.save')))));
|
|
3262
3645
|
};
|
|
3263
3646
|
|
|
3264
3647
|
const SSOPhoneVerify = ({ hidden, config, }) => {
|
|
@@ -3267,8 +3650,15 @@ const SSOPhoneVerify = ({ hidden, config, }) => {
|
|
|
3267
3650
|
const [loading, setLoading] = React__default.useState(false);
|
|
3268
3651
|
const [errMsg, setErrMsg] = React__default.useState('');
|
|
3269
3652
|
const { locale, setTracking } = useSSOState();
|
|
3653
|
+
const { flowData, userInfo } = useSSOV2Store();
|
|
3654
|
+
const { steps } = useSSOSteps();
|
|
3270
3655
|
const { afterAction, provider } = config || {};
|
|
3271
|
-
const
|
|
3656
|
+
const trackingMethod = flowData === null || flowData === void 0 ? void 0 : flowData.method;
|
|
3657
|
+
const trackingCategory = userInfo && !userInfo.first_time_login
|
|
3658
|
+
? `SSO - Existing User via ${trackingMethod}`
|
|
3659
|
+
: isVerifyPhoneInTheSignUp(steps, flowData)
|
|
3660
|
+
? `SSO - Sign Up via ${trackingMethod}`
|
|
3661
|
+
: `SSO - Sign In via ${trackingMethod}`;
|
|
3272
3662
|
const trackingAction = 'Verify Phone Number';
|
|
3273
3663
|
useEffect(() => {
|
|
3274
3664
|
if (!hidden) {
|
|
@@ -3279,6 +3669,7 @@ const SSOPhoneVerify = ({ hidden, config, }) => {
|
|
|
3279
3669
|
});
|
|
3280
3670
|
}
|
|
3281
3671
|
}, [hidden]);
|
|
3672
|
+
const { source } = useSSOV2Store();
|
|
3282
3673
|
const { addStep, goNext } = useSSOSteps();
|
|
3283
3674
|
const onClickContinueZalo = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
3284
3675
|
setLoading(true);
|
|
@@ -3376,9 +3767,18 @@ const SSOPhoneVerify = ({ hidden, config, }) => {
|
|
|
3376
3767
|
React__default.createElement(StyledPhone, { defaultCountry: (locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN'), value: phone, onChange: (value) => {
|
|
3377
3768
|
setPhone(value);
|
|
3378
3769
|
setErrMsg('');
|
|
3379
|
-
}, isError: !!errMsg, required: true, name: "phone", disabled: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Enter Phone"
|
|
3380
|
-
|
|
3381
|
-
|
|
3770
|
+
}, isError: !!errMsg, required: true, name: "phone", disabled: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Enter Phone", trackingFn: useCallback((option) => {
|
|
3771
|
+
if (!(option === null || option === void 0 ? void 0 : option.label))
|
|
3772
|
+
return;
|
|
3773
|
+
return {
|
|
3774
|
+
'data-event-action': 'Country Selection',
|
|
3775
|
+
'data-event-label': option.label,
|
|
3776
|
+
'data-event-category': trackingCategory,
|
|
3777
|
+
};
|
|
3778
|
+
}, []) })),
|
|
3779
|
+
React__default.createElement(Button, { size: "lg", variant: "primary", onClick: onClickContinueZalo, disabled: loading, loading: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Continue with Zalo", leftIcon: React__default.createElement(Zalo, null) }, t('ssov2.button.continueZalo')),
|
|
3780
|
+
React__default.createElement(Button, { size: "sm", variant: "white", onClick: onClickContinuePhone, disabled: loading, loading: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Continue with SMS", style: { fontWeight: 400 }, color: "#595959", leftIcon: React__default.createElement(ReplySquare, { size: 18 }) }, t('ssov2.button.continueSMS')),
|
|
3781
|
+
source !== 'care_onboarding' && source !== 'ecom' && React__default.createElement(SetupLater, null)))));
|
|
3382
3782
|
};
|
|
3383
3783
|
|
|
3384
3784
|
const FemaleIcon = () => (React__default.createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
@@ -3410,39 +3810,19 @@ const MaleIcon = () => (React__default.createElement("svg", { width: "20", heigh
|
|
|
3410
3810
|
React__default.createElement("path", { d: "M11.122 6.393a.157.157 0 0 1-.051-.304c.687-.234 1.688-.344 2.26-.03a.156.156 0 0 1-.15.274c-.463-.254-1.38-.163-2.009.052a.2.2 0 0 1-.05.008m-2.19.572a.16.16 0 0 1-.144-.097c-.013-.027-.123-.097-.363-.129-.325-.043-.672.016-.772.131a.156.156 0 1 1-.236-.205c.214-.245.721-.29 1.103-.228.209.034.475.116.556.311a.156.156 0 0 1-.144.217m.222-.571a.2.2 0 0 1-.05-.009c-.629-.215-1.546-.306-2.009-.051a.156.156 0 1 1-.15-.274c.572-.315 1.572-.206 2.26.03a.156.156 0 0 1-.05.304", fill: "#404040" }),
|
|
3411
3811
|
React__default.createElement("path", { d: "m11.12 9.547-.019.001a8 8 0 0 1-1.928 0 .156.156 0 1 0-.037.31c.665.08 1.337.08 2.003 0a.156.156 0 0 0-.019-.31", fill: "#D84023" })));
|
|
3412
3812
|
|
|
3813
|
+
// import { StyledPhone } from '../components/phone'
|
|
3413
3814
|
// always has name, gender dob
|
|
3414
|
-
const OtherSetup = ({ form,
|
|
3815
|
+
const OtherSetup = ({ form,
|
|
3816
|
+
// needPhone,
|
|
3817
|
+
// skipPhone,
|
|
3818
|
+
needEmail, isEmailDisable,
|
|
3819
|
+
// isPhoneDisabled,
|
|
3820
|
+
loading, tracking, }) => {
|
|
3415
3821
|
const { t } = useTranslations();
|
|
3416
|
-
const { locale = 'vi-VN' } = useSSOState()
|
|
3822
|
+
// const { locale = 'vi-VN' } = useSSOState()
|
|
3417
3823
|
const { setupSource } = useSSOV2Store();
|
|
3418
3824
|
const [dobChanged, setDobChanged] = React__default.useState(false);
|
|
3419
3825
|
return (React__default.createElement(Stack, { spacing: 12 },
|
|
3420
|
-
needPhone && (React__default.createElement(React__default.Fragment, null,
|
|
3421
|
-
React__default.createElement(Input.Wrapper, Object.assign({ label: t('ssov2.setup.field.phone.label'), withAsterisk: true }, form.getInputProps('phone')),
|
|
3422
|
-
React__default.createElement(StyledPhone, { defaultCountry: (locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN'), value: form.getInputProps('phone').value, onChange: (value) => {
|
|
3423
|
-
form.setFieldValue('phone', value);
|
|
3424
|
-
}, isError: !!form.getInputProps('phone').error, required: true, name: "phone", disabled: loading || isPhoneDisabled, "data-event-category": tracking === null || tracking === void 0 ? void 0 : tracking.category, "data-event-action": tracking === null || tracking === void 0 ? void 0 : tracking.action, "data-event-label": "Enter Phone" })),
|
|
3425
|
-
!skipPhone && (React__default.createElement(Group, { spacing: 24 },
|
|
3426
|
-
React__default.createElement(Text, { size: "p4" }, t('ssov2.setup.field.otp.label')),
|
|
3427
|
-
React__default.createElement(Radio.Group, Object.assign({ name: "otpMethod", styles: {
|
|
3428
|
-
root: {
|
|
3429
|
-
display: 'flex',
|
|
3430
|
-
flexDirection: 'row',
|
|
3431
|
-
flexWrap: 'wrap',
|
|
3432
|
-
gap: 24,
|
|
3433
|
-
},
|
|
3434
|
-
} }, form.getInputProps('otpMethod')),
|
|
3435
|
-
React__default.createElement(Radio, { value: "zalo", label: "Zalo", styles: {
|
|
3436
|
-
label: {
|
|
3437
|
-
paddingLeft: 8,
|
|
3438
|
-
},
|
|
3439
|
-
}, disabled: loading, "data-event-category": tracking === null || tracking === void 0 ? void 0 : tracking.category, "data-event-action": tracking === null || tracking === void 0 ? void 0 : tracking.action, "data-event-label": "Send OTP Code via Zalo" }),
|
|
3440
|
-
React__default.createElement(Radio, { value: "sms", label: "SMS", styles: {
|
|
3441
|
-
label: {
|
|
3442
|
-
paddingLeft: 8,
|
|
3443
|
-
},
|
|
3444
|
-
}, disabled: loading, "data-event-category": tracking === null || tracking === void 0 ? void 0 : tracking.category, "data-event-action": tracking === null || tracking === void 0 ? void 0 : tracking.action, "data-event-label": "Send OTP Code via SMS" })))))),
|
|
3445
|
-
needEmail && (React__default.createElement(Input, Object.assign({ name: "email", type: "email", label: t('ssov2.setup.field.email.label'), disabled: isEmailDisable || loading, required: setupSource === 'care' ? true : false, withAsterisk: setupSource === 'care' ? true : false, "data-event-category": tracking === null || tracking === void 0 ? void 0 : tracking.category, "data-event-action": tracking === null || tracking === void 0 ? void 0 : tracking.action, "data-event-label": "Enter Email" }, form.getInputProps('email')))),
|
|
3446
3826
|
React__default.createElement(Input, Object.assign({ name: "name", label: t('ssov2.setup.field.name.label'), withAsterisk: true, required: true, placeholder: t('ssov2.setup.field.name.placeholder'), disabled: loading, "data-event-category": tracking === null || tracking === void 0 ? void 0 : tracking.category, "data-event-action": tracking === null || tracking === void 0 ? void 0 : tracking.action, "data-event-label": "Enter Name" }, form.getInputProps('name'))),
|
|
3447
3827
|
React__default.createElement(Input.Wrapper, Object.assign({ label: t('ssov2.setup.field.gender.label'), withAsterisk: true }, form.getInputProps('gender')),
|
|
3448
3828
|
React__default.createElement(Group, null,
|
|
@@ -3457,7 +3837,7 @@ const OtherSetup = ({ form, needPhone, skipPhone, needEmail, isEmailDisable, isP
|
|
|
3457
3837
|
? 'secondary'
|
|
3458
3838
|
: 'tertiary', onClick: () => {
|
|
3459
3839
|
form.setFieldValue('gender', 'female');
|
|
3460
|
-
}, leftIcon: React__default.createElement(FemaleIcon, null), disabled: loading, "data-event-category": tracking === null || tracking === void 0 ? void 0 : tracking.category, "data-event-action": tracking === null || tracking === void 0 ? void 0 : tracking.action, "data-event-label": "Enter Gender
|
|
3840
|
+
}, leftIcon: React__default.createElement(FemaleIcon, null), disabled: loading, "data-event-category": tracking === null || tracking === void 0 ? void 0 : tracking.category, "data-event-action": tracking === null || tracking === void 0 ? void 0 : tracking.action, "data-event-label": "Enter Gender" }, t('ssov2.setup.field.gender.female')),
|
|
3461
3841
|
React__default.createElement(Button, { type: "button", styles: {
|
|
3462
3842
|
root: {
|
|
3463
3843
|
flex: 1,
|
|
@@ -3469,7 +3849,7 @@ const OtherSetup = ({ form, needPhone, skipPhone, needEmail, isEmailDisable, isP
|
|
|
3469
3849
|
? 'secondary'
|
|
3470
3850
|
: 'tertiary', onClick: () => {
|
|
3471
3851
|
form.setFieldValue('gender', 'male');
|
|
3472
|
-
}, leftIcon: React__default.createElement(MaleIcon, null), disabled: loading, "data-event-category": tracking === null || tracking === void 0 ? void 0 : tracking.category, "data-event-action": tracking === null || tracking === void 0 ? void 0 : tracking.action, "data-event-label": "Enter Gender
|
|
3852
|
+
}, leftIcon: React__default.createElement(MaleIcon, null), disabled: loading, "data-event-category": tracking === null || tracking === void 0 ? void 0 : tracking.category, "data-event-action": tracking === null || tracking === void 0 ? void 0 : tracking.action, "data-event-label": "Enter Gender" }, t('ssov2.setup.field.gender.male')))),
|
|
3473
3853
|
React__default.createElement(DatePicker, Object.assign({ name: "dob", label: t('ssov2.setup.field.dob.label'), withAsterisk: true, required: true, placeholder: t('ssov2.setup.field.dob.placeholder'), maxDate: new Date(new Date().getFullYear() - 18, new Date().getMonth(), new Date().getDate()), disabled: loading, "data-event-category": tracking === null || tracking === void 0 ? void 0 : tracking.category, "data-event-action": tracking === null || tracking === void 0 ? void 0 : tracking.action, "data-event-label": "Enter Birthday" }, form.getInputProps('dob'), { onChange: (e) => {
|
|
3474
3854
|
form.getInputProps('dob').onChange(e);
|
|
3475
3855
|
setDobChanged(true);
|
|
@@ -3477,9 +3857,13 @@ const OtherSetup = ({ form, needPhone, skipPhone, needEmail, isEmailDisable, isP
|
|
|
3477
3857
|
if (!form.getInputProps('dob').value && !dobChanged)
|
|
3478
3858
|
return;
|
|
3479
3859
|
form.getInputProps('dob').onBlur(e);
|
|
3480
|
-
} }))
|
|
3860
|
+
} })),
|
|
3861
|
+
needEmail && (React__default.createElement(Input, Object.assign({ name: "email", type: "email", label: t('ssov2.setup.field.email.label'), disabled: isEmailDisable || loading, required: setupSource === 'care' || setupSource === 'ecom' ? true : false, withAsterisk: setupSource === 'care' || setupSource === 'ecom' ? true : false, "data-event-category": tracking === null || tracking === void 0 ? void 0 : tracking.category, "data-event-action": tracking === null || tracking === void 0 ? void 0 : tracking.action, "data-event-label": "Enter Email", style: {
|
|
3862
|
+
display: isEmailDisable ? 'none' : 'block',
|
|
3863
|
+
} }, form.getInputProps('email'))))));
|
|
3481
3864
|
};
|
|
3482
3865
|
|
|
3866
|
+
// import { SSOPasswordWithConfirm } from '../passwordForgotSetup/passwordWithConfirm'
|
|
3483
3867
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3484
3868
|
const getDefaultData = (data) => {
|
|
3485
3869
|
try {
|
|
@@ -3505,7 +3889,6 @@ const SSOSetupScreen = ({ hidden, config, }) => {
|
|
|
3505
3889
|
var _a, _b, _c;
|
|
3506
3890
|
const { onClose, setTracking } = useSSOState();
|
|
3507
3891
|
const { t } = useTranslations();
|
|
3508
|
-
const { goNext, addStep } = useSSOSteps();
|
|
3509
3892
|
const { setupSource, flowData } = useSSOV2Store();
|
|
3510
3893
|
const [errMsg, setErrMsg] = React__default.useState('');
|
|
3511
3894
|
const userInfo = config === null || config === void 0 ? void 0 : config.userInfo;
|
|
@@ -3515,13 +3898,6 @@ const SSOSetupScreen = ({ hidden, config, }) => {
|
|
|
3515
3898
|
const provider = (_a = config === null || config === void 0 ? void 0 : config.userInfo) === null || _a === void 0 ? void 0 : _a.provider;
|
|
3516
3899
|
const authFlow = flowData === null || flowData === void 0 ? void 0 : flowData.flow;
|
|
3517
3900
|
const defaultData = getDefaultData(config === null || config === void 0 ? void 0 : config.setupDefaultData);
|
|
3518
|
-
const needPass = (authMethod === 'phone' ||
|
|
3519
|
-
authMethod === 'zalo' ||
|
|
3520
|
-
authMethod === 'sms' ||
|
|
3521
|
-
authMethod === 'email' ||
|
|
3522
|
-
provider === 'email' ||
|
|
3523
|
-
provider === 'phone') &&
|
|
3524
|
-
!(userInfo === null || userInfo === void 0 ? void 0 : userInfo.is_pass);
|
|
3525
3901
|
const skipPhone = (userInfo === null || userInfo === void 0 ? void 0 : userInfo.phone) && !!(userInfo === null || userInfo === void 0 ? void 0 : userInfo.phone_verified_at);
|
|
3526
3902
|
const isPhoneDisabled = !!(configPhone || (defaultData === null || defaultData === void 0 ? void 0 : defaultData.phone) || skipPhone);
|
|
3527
3903
|
const needPhone = authFlow === 'signup' &&
|
|
@@ -3538,11 +3914,10 @@ const SSOSetupScreen = ({ hidden, config, }) => {
|
|
|
3538
3914
|
: undefined) ||
|
|
3539
3915
|
undefined;
|
|
3540
3916
|
const needEmail = setupSource === 'care' ||
|
|
3917
|
+
setupSource === 'ecom' ||
|
|
3541
3918
|
!(flowData === null || flowData === void 0 ? void 0 : flowData.isVerifyPhone) ||
|
|
3542
3919
|
authMethod === 'facebook' ||
|
|
3543
3920
|
provider === 'facebook';
|
|
3544
|
-
// const needPhone = !userInfo?.phone_verified_at
|
|
3545
|
-
// const needEmail = authFlow !== 'verify-phone'
|
|
3546
3921
|
const isEmailDisable = (defaultEmail &&
|
|
3547
3922
|
(authMethod === 'google' ||
|
|
3548
3923
|
authMethod === 'email' ||
|
|
@@ -3550,7 +3925,7 @@ const SSOSetupScreen = ({ hidden, config, }) => {
|
|
|
3550
3925
|
provider === 'email')) ||
|
|
3551
3926
|
(!!(userInfo === null || userInfo === void 0 ? void 0 : userInfo.email) && !!(userInfo === null || userInfo === void 0 ? void 0 : userInfo.email_verified_at));
|
|
3552
3927
|
const trackingCategory = `SSO - ${authFlow === 'signup' ? 'Sign Up' : 'Existing Users'} via ${authMethod || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.provider)}`;
|
|
3553
|
-
const trackingAction = '
|
|
3928
|
+
const trackingAction = 'Add Information';
|
|
3554
3929
|
useEffect(() => {
|
|
3555
3930
|
if (!hidden) {
|
|
3556
3931
|
setErrMsg('');
|
|
@@ -3579,32 +3954,9 @@ const SSOSetupScreen = ({ hidden, config, }) => {
|
|
|
3579
3954
|
? dayjs(defaultData.birthday, 'MM/DD/YYYY').toDate()
|
|
3580
3955
|
: undefined }),
|
|
3581
3956
|
validateInputOnBlur: true,
|
|
3582
|
-
validate: yupResolver(yup.object().shape(Object.assign(Object.assign(
|
|
3583
|
-
? {
|
|
3584
|
-
password: yup
|
|
3585
|
-
.string()
|
|
3586
|
-
.required(t('ssov2.validate.password.required'))
|
|
3587
|
-
.min(8, ' ')
|
|
3588
|
-
.max(50, ' ')
|
|
3589
|
-
.matches(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)/, ' '),
|
|
3590
|
-
confirmPassword: yup
|
|
3591
|
-
.string()
|
|
3592
|
-
.required(t('ssov2.validate.confirmPassword.required'))
|
|
3593
|
-
.test('passwords-match', t('ssov2.validate.confirmPassword.match'), function (value) {
|
|
3594
|
-
return this.parent.password === value;
|
|
3595
|
-
}),
|
|
3596
|
-
}
|
|
3597
|
-
: {})), (needPhone
|
|
3598
|
-
? Object.assign({ phone: yup.string().required(t('ssov2.validate.phone.required')) }, (!skipPhone
|
|
3599
|
-
? {
|
|
3600
|
-
otpMethod: yup
|
|
3601
|
-
.string()
|
|
3602
|
-
.required(t('ssov2.validate.otp.required'))
|
|
3603
|
-
.oneOf(['zalo', 'sms']),
|
|
3604
|
-
}
|
|
3605
|
-
: {})) : {})), (needEmail
|
|
3957
|
+
validate: yupResolver(yup.object().shape(Object.assign(Object.assign({}, (needEmail
|
|
3606
3958
|
? {
|
|
3607
|
-
email: setupSource === 'care'
|
|
3959
|
+
email: setupSource === 'care' || setupSource === 'ecom'
|
|
3608
3960
|
? yup
|
|
3609
3961
|
.string()
|
|
3610
3962
|
.email(t('ssov2.validate.email.invalid'))
|
|
@@ -3619,15 +3971,13 @@ const SSOSetupScreen = ({ hidden, config, }) => {
|
|
|
3619
3971
|
const onSubmit = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
3620
3972
|
setLoading(true);
|
|
3621
3973
|
try {
|
|
3622
|
-
const {
|
|
3974
|
+
const { phone, gender, name, dob } = values;
|
|
3623
3975
|
const { phoneNumber, areaCode } = splitPhone(phone || configPhone || '');
|
|
3624
3976
|
// validate only, delay set data to after otp
|
|
3625
3977
|
const res = yield updateUserInfo({
|
|
3626
3978
|
name,
|
|
3627
3979
|
birthday: dayjs(dob).format('YYYY-MM-DD'),
|
|
3628
3980
|
email: values.email || undefined,
|
|
3629
|
-
password,
|
|
3630
|
-
confirm_password: confirmPassword,
|
|
3631
3981
|
phone_number: phoneNumber || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.phone),
|
|
3632
3982
|
area_code: areaCode || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.area_code) || '84',
|
|
3633
3983
|
gender: gender === 'male' ? 1 : 0,
|
|
@@ -3635,80 +3985,23 @@ const SSOSetupScreen = ({ hidden, config, }) => {
|
|
|
3635
3985
|
validate: 'true',
|
|
3636
3986
|
});
|
|
3637
3987
|
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
if (otpMethod === 'zalo') {
|
|
3652
|
-
const res = yield resendUpdatePhoneZaloOTP(phoneNumber, areaCode);
|
|
3653
|
-
if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
|
|
3654
|
-
setErrMsg(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
|
|
3655
|
-
return setLoading(false);
|
|
3656
|
-
}
|
|
3657
|
-
addStep({
|
|
3658
|
-
type: SSOStepTypeType.OTP,
|
|
3659
|
-
config: {
|
|
3660
|
-
phone,
|
|
3661
|
-
otpType: 'phone-zalo',
|
|
3662
|
-
isUpdatePhone: true,
|
|
3663
|
-
afterAction: 'submitSetup',
|
|
3664
|
-
setupData,
|
|
3665
|
-
provider,
|
|
3666
|
-
},
|
|
3667
|
-
});
|
|
3668
|
-
goNext();
|
|
3669
|
-
}
|
|
3670
|
-
else {
|
|
3671
|
-
const res = yield resendUpdatePhoneOTP(phoneNumber, areaCode);
|
|
3672
|
-
if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
|
|
3673
|
-
setErrMsg(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
|
|
3674
|
-
return setLoading(false);
|
|
3675
|
-
}
|
|
3676
|
-
addStep({
|
|
3677
|
-
type: SSOStepTypeType.OTP,
|
|
3678
|
-
config: {
|
|
3679
|
-
phone,
|
|
3680
|
-
otpType: 'phone-sms',
|
|
3681
|
-
isUpdatePhone: true,
|
|
3682
|
-
afterAction: 'submitSetup',
|
|
3683
|
-
setupData,
|
|
3684
|
-
provider,
|
|
3685
|
-
},
|
|
3686
|
-
});
|
|
3687
|
-
goNext();
|
|
3688
|
-
}
|
|
3988
|
+
const res = yield updateUserInfo({
|
|
3989
|
+
name,
|
|
3990
|
+
birthday: dayjs(dob).format('YYYY-MM-DD'),
|
|
3991
|
+
email: values.email || undefined,
|
|
3992
|
+
phone_number: phoneNumber || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.phone),
|
|
3993
|
+
area_code: areaCode || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.area_code),
|
|
3994
|
+
gender: gender === 'male' ? 1 : 0,
|
|
3995
|
+
source: setupSource,
|
|
3996
|
+
validate: '',
|
|
3997
|
+
});
|
|
3998
|
+
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
3999
|
+
handleAuthSuccess(res === null || res === void 0 ? void 0 : res._data);
|
|
4000
|
+
onClose === null || onClose === void 0 ? void 0 : onClose(true);
|
|
3689
4001
|
}
|
|
3690
4002
|
else {
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
name,
|
|
3694
|
-
birthday: dayjs(dob).format('YYYY-MM-DD'),
|
|
3695
|
-
email: values.email || undefined,
|
|
3696
|
-
password,
|
|
3697
|
-
confirm_password: confirmPassword,
|
|
3698
|
-
phone_number: phoneNumber || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.phone),
|
|
3699
|
-
area_code: areaCode || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.area_code),
|
|
3700
|
-
gender: gender === 'male' ? 1 : 0,
|
|
3701
|
-
source: setupSource,
|
|
3702
|
-
validate: '',
|
|
3703
|
-
});
|
|
3704
|
-
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
3705
|
-
handleAuthSuccess(res === null || res === void 0 ? void 0 : res._data);
|
|
3706
|
-
onClose === null || onClose === void 0 ? void 0 : onClose(true);
|
|
3707
|
-
}
|
|
3708
|
-
else {
|
|
3709
|
-
setErrMsg(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
|
|
3710
|
-
return setLoading(false);
|
|
3711
|
-
}
|
|
4003
|
+
setErrMsg(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
|
|
4004
|
+
return setLoading(false);
|
|
3712
4005
|
}
|
|
3713
4006
|
}
|
|
3714
4007
|
else {
|
|
@@ -3729,36 +4022,22 @@ const SSOSetupScreen = ({ hidden, config, }) => {
|
|
|
3729
4022
|
React__default.createElement(Stack, { spacing: 8 },
|
|
3730
4023
|
React__default.createElement(Text, { size: "s1", weight: "semiBold" }, t('ssov2.setup.title')),
|
|
3731
4024
|
React__default.createElement(Text, { size: "p4" }, t('ssov2.setup.description'))),
|
|
3732
|
-
needPass && (React__default.createElement(SSOPasswordWithConfirm, { form: form, loading: loading, tracking: {
|
|
3733
|
-
category: trackingCategory,
|
|
3734
|
-
action: trackingAction,
|
|
3735
|
-
} })),
|
|
3736
4025
|
React__default.createElement(OtherSetup, { needPhone: needPhone, skipPhone: skipPhone, needEmail: needEmail, isEmailDisable: isEmailDisable, isPhoneDisabled: isPhoneDisabled, form: form, loading: loading, tracking: {
|
|
3737
4026
|
category: trackingCategory,
|
|
3738
4027
|
action: trackingAction,
|
|
3739
4028
|
} }),
|
|
3740
4029
|
errMsg && (React__default.createElement(Text, { color: "red.6", size: "p4" }, errMsg)),
|
|
3741
|
-
React__default.createElement(Button, { type: "submit", variant: "primary", fullWidth: true, loading: loading, disabled: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label":
|
|
3742
|
-
|
|
3743
|
-
: authFlow === 'signup'
|
|
3744
|
-
? 'Create New Account'
|
|
3745
|
-
: 'Save' }, needPhone && !skipPhone
|
|
3746
|
-
? t('ssov2.setup.button.veriyPhone')
|
|
3747
|
-
: authFlow === 'signup'
|
|
3748
|
-
? t('ssov2.setup.button.createAccount')
|
|
3749
|
-
: t('ssov2.button.save')))));
|
|
4030
|
+
React__default.createElement(Button, { type: "submit", variant: "primary", fullWidth: true, loading: loading, disabled: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Save" }, t('ssov2.button.save')),
|
|
4031
|
+
React__default.createElement(SetupLater, { style: { marginTop: -8 } }))));
|
|
3750
4032
|
};
|
|
3751
4033
|
|
|
3752
|
-
// import {
|
|
3753
|
-
// getSSOFlowFromUserProfile,
|
|
3754
|
-
// useSSOV2Store,
|
|
3755
|
-
// } from '../ssoStateManager/store'
|
|
3756
4034
|
const SSOUpdateEmailScreen = ({ hidden, }) => {
|
|
3757
4035
|
const { t } = useTranslations();
|
|
3758
4036
|
const [errMsg, setErrMsg] = React__default.useState('');
|
|
3759
4037
|
const { setTracking } = useSSOState();
|
|
3760
|
-
const
|
|
3761
|
-
const
|
|
4038
|
+
const { flowData } = useSSOV2Store();
|
|
4039
|
+
const trackingCategory = `SSO - Existing User via ${flowData === null || flowData === void 0 ? void 0 : flowData.method}`;
|
|
4040
|
+
const trackingAction = 'Continue With Email';
|
|
3762
4041
|
useEffect(() => {
|
|
3763
4042
|
if (!hidden) {
|
|
3764
4043
|
setErrMsg('');
|
|
@@ -3784,9 +4063,6 @@ const SSOUpdateEmailScreen = ({ hidden, }) => {
|
|
|
3784
4063
|
if ((existRes === null || existRes === void 0 ? void 0 : existRes._status) === 1) {
|
|
3785
4064
|
const userInfo = yield getUserInfo();
|
|
3786
4065
|
if (!existRes._data || email === ((_a = userInfo === null || userInfo === void 0 ? void 0 : userInfo._data) === null || _a === void 0 ? void 0 : _a.email)) {
|
|
3787
|
-
// useSSOV2Store.setState({
|
|
3788
|
-
// flowData: getSSOFlowFromUserProfile(userInfo?._data),
|
|
3789
|
-
// })
|
|
3790
4066
|
const res = yield initSendUpdateEmailOtp(email);
|
|
3791
4067
|
if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
|
|
3792
4068
|
setErrMsg(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
|
|
@@ -3855,6 +4131,20 @@ const SSOScreenRenderer = () => {
|
|
|
3855
4131
|
})));
|
|
3856
4132
|
};
|
|
3857
4133
|
|
|
4134
|
+
if (!Array.prototype.findLastIndex) {
|
|
4135
|
+
Array.prototype.findLastIndex = function (callback, thisArg) {
|
|
4136
|
+
for (let i = this.length - 1; i >= 0; i--) {
|
|
4137
|
+
if (callback.call(thisArg, this[i], i, this))
|
|
4138
|
+
return i;
|
|
4139
|
+
}
|
|
4140
|
+
return -1;
|
|
4141
|
+
};
|
|
4142
|
+
}
|
|
4143
|
+
if (!String.prototype.capitalize) {
|
|
4144
|
+
String.prototype.capitalize = function () {
|
|
4145
|
+
return this.charAt(0).toUpperCase() + this.slice(1);
|
|
4146
|
+
};
|
|
4147
|
+
}
|
|
3858
4148
|
const SSOV2 = ({ onClose: onCloseProps, locale }) => {
|
|
3859
4149
|
const { isOpen, setOpen, returnUrl, setMounted, source, overrideClose, setOnCloseProp, forceReloadOnClose, } = useSSOV2Store();
|
|
3860
4150
|
useEffect(() => {
|