@hhgtech/hhg-components 1.29.478 → 1.29.480-beta-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/{InputDate-651b6c37.js → InputDate-d158bc4e.js} +5 -5
- package/build/{LastPeriod-e7ba704f.js → LastPeriod-43e2cc54.js} +1 -1
- package/build/{MobileBottomNavigationIcon-042dedcb.js → MobileBottomNavigationIcon-f10c7508.js} +3 -3
- package/build/{Spinner-e9e91af0.js → Spinner-15aff8d4.js} +1 -1
- package/build/{WhatsApp-a8c940e6.js → WhatsApp-0b4c61b8.js} +1 -1
- package/build/adapters.js +20 -20
- package/build/atoms.js +50 -50
- package/build/babyGrowth.js +86 -86
- package/build/cache.js +2 -2
- package/build/care.js +18 -18
- package/build/careBookingSearchBar.js +14 -14
- package/build/careBookingSearchBarV2.js +15 -15
- package/build/components/atoms/imageUpload/ImageUpload.types.d.ts +1 -1
- package/build/components/molecules/index.d.ts +1 -0
- package/build/components/molecules/toolBannerCard/index.d.ts +2 -1
- package/build/components/molecules/toolBannerCard/index.styles.d.ts +1 -0
- package/build/components.js +105 -104
- package/build/{constants-76ab6c07.js → constants-06373310.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-9e3f066f.js → core-2c3af43c.js} +1 -1
- package/build/{dataTransform-101fc33a.js → dataTransform-11f990c2.js} +1 -1
- package/build/ecom.js +5 -5
- package/build/{editor-a4ac412d.js → editor-7df07f31.js} +11 -11
- package/build/embeddedHeathToolCards_babyGrowth.js +25 -25
- package/build/embeddedHeathToolCards_babyPoop.js +23 -23
- package/build/embeddedHeathToolCards_babyVaccine.js +25 -25
- package/build/embeddedHeathToolCards_bmi_bmi.js +30 -30
- package/build/embeddedHeathToolCards_bmrBmr.js +28 -28
- package/build/embeddedHeathToolCards_dueDate_dueDate.js +25 -25
- package/build/embeddedHeathToolCards_ovulation_ovulation.js +25 -25
- package/build/embeddedHeathToolCards_pwg_pwg.js +29 -29
- package/build/embeddedHeathToolCards_targetHeartRate.js +30 -30
- package/build/esm/{InputDate-a6698652.js → InputDate-c7afe06e.js} +5 -5
- package/build/esm/{LastPeriod-4ae38f87.js → LastPeriod-fd4f910c.js} +1 -1
- package/build/esm/{MobileBottomNavigationIcon-cb26993a.js → MobileBottomNavigationIcon-b60beecb.js} +3 -3
- package/build/esm/{Spinner-3b537c7d.js → Spinner-49e6bba1.js} +1 -1
- package/build/esm/{WhatsApp-fa2ac155.js → WhatsApp-1737ea92.js} +1 -1
- package/build/esm/adapters.js +20 -20
- package/build/esm/atoms.js +50 -50
- package/build/esm/babyGrowth.js +86 -86
- package/build/esm/cache.js +2 -2
- package/build/esm/care.js +18 -18
- package/build/esm/careBookingSearchBar.js +14 -14
- package/build/esm/careBookingSearchBarV2.js +15 -15
- package/build/esm/components/atoms/imageUpload/ImageUpload.types.d.ts +1 -1
- package/build/esm/components/molecules/index.d.ts +1 -0
- package/build/esm/components/molecules/toolBannerCard/index.d.ts +2 -1
- package/build/esm/components/molecules/toolBannerCard/index.styles.d.ts +1 -0
- package/build/esm/components.js +104 -104
- package/build/esm/{constants-bb69507c.js → constants-9472a3e8.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-db04cbfb.js → core-5343cd24.js} +1 -1
- package/build/esm/{dataTransform-c86e003b.js → dataTransform-27a2998c.js} +1 -1
- package/build/esm/ecom.js +5 -5
- package/build/esm/{editor-5c4606de.js → editor-f7e2180e.js} +11 -11
- package/build/esm/embeddedHeathToolCards_babyGrowth.js +25 -25
- package/build/esm/embeddedHeathToolCards_babyPoop.js +23 -23
- package/build/esm/embeddedHeathToolCards_babyVaccine.js +25 -25
- package/build/esm/embeddedHeathToolCards_bmi_bmi.js +30 -30
- package/build/esm/embeddedHeathToolCards_bmrBmr.js +28 -28
- package/build/esm/embeddedHeathToolCards_dueDate_dueDate.js +25 -25
- package/build/esm/embeddedHeathToolCards_ovulation_ovulation.js +25 -25
- package/build/esm/embeddedHeathToolCards_pwg_pwg.js +29 -29
- package/build/esm/embeddedHeathToolCards_targetHeartRate.js +30 -30
- package/build/esm/footer.js +22 -22
- package/build/esm/gAssets.js +2 -2
- package/build/esm/{healthTools-b8b77c9a.js → healthTools-fcf3ed62.js} +1 -1
- package/build/esm/healthToolsCardWrapper.js +21 -21
- package/build/esm/healthToolsForm.js +35 -35
- package/build/esm/hooks.js +13 -13
- package/build/esm/i18n.js +2 -2
- package/build/esm/i18nV2.js +2 -2
- package/build/esm/{index-67cd6f36.js → index-08b748d9.js} +13 -13
- package/build/esm/{index-e20294b7.js → index-1afa495f.js} +5 -5
- package/build/esm/{index-e9802274.js → index-1f2b4eae.js} +16 -16
- package/build/esm/{index-960a1d62.js → index-213f4801.js} +1 -1
- package/build/esm/{index-93e9f469.js → index-22e5ac4e.js} +16 -16
- package/build/esm/{index-ee8c5351.js → index-280b0a3b.js} +5 -5
- package/build/esm/{index-b9bf8185.js → index-2c6e4730.js} +17 -17
- package/build/esm/{index-d86cf83b.js → index-2c8b91f3.js} +16 -16
- package/build/esm/{index-d755f3c5.js → index-2f94f586.js} +14 -14
- package/build/esm/{index-ab83b4b5.js → index-3f99777e.js} +3 -3
- package/build/esm/{index-4410cd36.js → index-42c8616e.js} +4 -4
- package/build/esm/{index-e995250d.js → index-43283d7d.js} +13 -13
- package/build/esm/{index-21f88271.js → index-46e01ad8.js} +2 -2
- package/build/esm/{index-a3deb75f.js → index-49010cee.js} +2 -2
- package/build/esm/{index-c21452e2.js → index-4917810c.js} +8 -8
- package/build/esm/{index-598d767e.js → index-53d23197.js} +21 -21
- package/build/esm/{index-841ff0ac.js → index-561d81a0.js} +15 -15
- package/build/esm/{index-30bd185b.js → index-56222c40.js} +6 -6
- package/build/esm/{index-16706645.js → index-584bb04d.js} +2 -2
- package/build/esm/{index-5a20db0a.js → index-5a3c605d.js} +2 -2
- package/build/esm/{index-813465a3.js → index-5b44cc22.js} +14 -14
- package/build/esm/{index-1ee595ce.js → index-5c562bc7.js} +3 -3
- package/build/esm/{index-d43c5e0a.js → index-5fdf0fc7.js} +3 -3
- package/build/esm/{index-bf71b87d.js → index-61dd2567.js} +6 -6
- package/build/esm/{index-c009198e.js → index-65c6cf70.js} +1 -1
- package/build/esm/{index-69d399c0.js → index-664006ba.js} +19 -19
- package/build/esm/{index-c17b88ce.js → index-6a57a6dd.js} +3 -3
- package/build/esm/{index-15a19fa5.js → index-6debe34a.js} +2 -2
- package/build/esm/{index-122cc18c.js → index-722556b5.js} +2 -2
- package/build/esm/{index-fcb4fe71.js → index-75f15a53.js} +10 -10
- package/build/esm/{index-9718f8c6.js → index-768151fa.js} +2 -2
- package/build/esm/{index-aaad1421.js → index-7f7053a8.js} +32 -32
- package/build/esm/{index-4e273edc.js → index-8119be96.js} +7 -7
- package/build/esm/{index-0c8c6183.js → index-86cc3cc7.js} +2 -2
- package/build/esm/{index-fd6d7d79.js → index-8b589c6c.js} +2 -2
- package/build/esm/{index-1c436001.js → index-8b90aade.js} +26 -26
- package/build/esm/{index-055b1f1b.js → index-8b9ac9c8.js} +3 -3
- package/build/esm/{index-435ca731.js → index-8f66eb8d.js} +2 -2
- package/build/esm/{index-c271638e.js → index-904ab29f.js} +25 -25
- package/build/esm/{index-90ee5241.js → index-9376ca20.js} +15 -15
- package/build/esm/{index-815ae747.js → index-972dc587.js} +1 -1
- package/build/esm/{index-2446c72e.js → index-9bacf266.js} +1 -1
- package/build/esm/{index-811a758e.js → index-9cad0276.js} +22 -22
- package/build/esm/{index-81a9e7c6.js → index-9d570802.js} +3 -3
- package/build/esm/{index-66cfcc0a.js → index-a3859f7d.js} +1 -1
- package/build/esm/{index-39d2c90e.js → index-a6f36fca.js} +4 -4
- package/build/esm/{index-2b310a4c.js → index-aa3c701a.js} +21 -21
- package/build/esm/{index-eb19226f.js → index-abcfe180.js} +18 -18
- package/build/esm/{index-acfd14ab.js → index-b216181e.js} +32 -32
- package/build/esm/{index-20ba006e.js → index-b3877ccd.js} +2 -2
- package/build/esm/{index-94784cf9.js → index-b45be35b.js} +9 -9
- package/build/esm/{index-ca10d095.js → index-bcb4f5ca.js} +18 -18
- package/build/esm/{index-affed33c.js → index-c4767e99.js} +30 -30
- package/build/esm/{index-f2d228af.js → index-c6e6304d.js} +3 -3
- package/build/esm/{index-7c5b9744.js → index-c7220d78.js} +14 -14
- package/build/esm/{index-2182748a.js → index-c91b3f0c.js} +24 -16
- package/build/esm/{index-560aca98.js → index-cb27e7bc.js} +2 -2
- package/build/esm/{index-f5c8b482.js → index-d5e5f756.js} +2 -2
- package/build/esm/{index-35f35129.js → index-d930067d.js} +8 -8
- package/build/esm/{index-741b3443.js → index-dc5cc783.js} +2 -2
- package/build/esm/{index-4f09fea4.js → index-dedc22cb.js} +3 -3
- package/build/esm/{index-f5db0285.js → index-e16300cd.js} +7 -7
- package/build/esm/{index-8a7dfc97.js → index-e4f827a1.js} +1 -1
- package/build/esm/{index-53b93638.js → index-e53e6952.js} +16 -16
- package/build/esm/{index-c0988930.js → index-ef0f0c3d.js} +2 -2
- package/build/esm/{index-c4f775a2.js → index-efc6e879.js} +2 -2
- package/build/esm/{index-6512d090.js → index-f4894e84.js} +2 -2
- package/build/esm/{index-7e5b4813.js → index-f52961c9.js} +6 -6
- package/build/esm/{index-b0784892.js → index-f827c03e.js} +6 -6
- package/build/esm/{index-fea47297.js → index-f9d633c2.js} +11 -11
- package/build/esm/{index-79368851.js → index-fc0aaebc.js} +1 -1
- package/build/esm/index.js +124 -124
- package/build/esm/{labelSorting-ea9cd8f0.js → labelSorting-b440189f.js} +4 -4
- package/build/esm/lead.js +35 -35
- package/build/esm/{logoIcon-bf0f49fc.js → logoIcon-02eba59c.js} +2 -2
- package/build/esm/mantine.js +38 -29
- package/build/esm/misc.js +19 -19
- 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 +78 -78
- package/build/esm/moleculesArticleCard.js +6 -6
- package/build/esm/moleculesArticleCardV2.js +17 -17
- package/build/esm/navigation.js +47 -47
- package/build/esm/navigationLogoutPopup.js +11 -11
- package/build/esm/navigationProfileButton.js +27 -27
- package/build/esm/onboardingV2.js +30 -30
- package/build/esm/organisms.js +57 -57
- package/build/esm/{post-7381fb14.js → post-3ab28edc.js} +2 -2
- package/build/esm/profileNavigation.js +20 -20
- package/build/esm/progressBar.js +1 -1
- package/build/esm/pwg.js +23 -23
- package/build/esm/ssoV2.js +40 -31
- package/build/esm/{store-bafd7dbc.js → store-4279a82a.js} +3 -3
- package/build/esm/subot/index.d.ts +0 -1
- package/build/esm/subot/subotInlineRevamp/context.d.ts +1 -1
- package/build/esm/subot/subotInlineRevamp/types.d.ts +0 -2
- package/build/esm/subot.js +112 -3266
- package/build/esm/surveyOrPremiumBanner.js +34 -34
- package/build/esm/surveyQuestionCard.js +11 -11
- package/build/esm/{surveyThankyouCard-aa2ed45e.js → surveyThankyouCard-cc6d97ad.js} +5 -5
- package/build/esm/together/togetherComponentGlobalContext.d.ts +0 -2
- package/build/esm/together.js +57 -57
- package/build/esm/togetherApiUtils.js +4 -4
- package/build/esm/togetherAtoms.js +31 -31
- package/build/esm/togetherComponentGlobalContext.js +4 -4
- package/build/esm/togetherMolecules.js +52 -52
- package/build/esm/togetherMoleculesCardAuthor.js +29 -29
- package/build/esm/togetherMoleculesPostImagePreview.js +11 -11
- package/build/esm/togetherMoleculesProfileDetail.js +40 -40
- package/build/esm/togetherOrganisms.js +51 -51
- package/build/esm/togetherRichTextEditor.js +18 -18
- package/build/esm/togetherShareBox.js +10 -10
- package/build/esm/{translationsProvider-b7235c4f.js → translationsProvider-b3906c55.js} +1 -1
- package/build/esm/{treePopoverMenu-486605b9.js → treePopoverMenu-64b815db.js} +19 -19
- package/build/esm/types.js +2 -2
- package/build/esm/{useHealthToolCache-1d000f47.js → useHealthToolCache-7a07e506.js} +1 -1
- package/build/esm/{usePhoneValidator-8c818e2f.js → usePhoneValidator-7965267d.js} +5 -5
- package/build/esm/{usePlacesAutocomplete-014d6756.js → usePlacesAutocomplete-dacf815b.js} +1 -1
- package/build/esm/useTogetherAuthRequiredAction.js +10 -10
- package/build/esm/{utils-522d8ecc.js → utils-40fae116.js} +2 -2
- package/build/esm/{utils-aa43a964.js → utils-9ccad345.js} +2 -2
- package/build/esm/{utils-aa3a7bb1.js → utils-a5a71a6a.js} +5 -5
- package/build/esm/{utils-c69afac5.js → utils-c3fa1c36.js} +3 -3
- package/build/esm/vaccination.js +22 -22
- package/build/footer.js +22 -22
- package/build/gAssets.js +2 -2
- package/build/{healthTools-1daeb881.js → healthTools-ccd56fee.js} +1 -1
- package/build/healthToolsCardWrapper.js +21 -21
- package/build/healthToolsForm.js +35 -35
- package/build/hooks.js +13 -13
- package/build/i18n.js +2 -2
- package/build/i18nV2.js +1 -1
- package/build/{index-bb094509.js → index-015d8df4.js} +26 -26
- package/build/{index-6f257203.js → index-097109e4.js} +18 -18
- package/build/{index-e53c8a75.js → index-0a600778.js} +2 -2
- package/build/{index-650d5cc1.js → index-0cbc8e14.js} +2 -2
- package/build/{index-a085cf91.js → index-0d8a1288.js} +10 -10
- package/build/{index-d958ea48.js → index-0e1c1ea3.js} +3 -3
- package/build/{index-eac7fdd5.js → index-13832879.js} +13 -13
- package/build/{index-2a30e09d.js → index-16a22b24.js} +24 -16
- package/build/{index-863a636b.js → index-16de00ea.js} +16 -16
- package/build/{index-2cd0f505.js → index-185a0844.js} +2 -2
- package/build/{index-a60fd247.js → index-1bb1c894.js} +16 -16
- package/build/{index-a9c3e0c1.js → index-20a92497.js} +4 -4
- package/build/{index-8cc05623.js → index-219c0ee4.js} +2 -2
- package/build/{index-33d54079.js → index-2618fd79.js} +1 -1
- package/build/{index-f6ea5b64.js → index-2ee7b9db.js} +32 -32
- package/build/{index-ea3e6b80.js → index-31cb68a3.js} +30 -30
- package/build/{index-97001865.js → index-33d2e571.js} +2 -2
- package/build/{index-623820bc.js → index-3500ac3f.js} +15 -15
- package/build/{index-5db61b31.js → index-35229a7e.js} +2 -2
- package/build/{index-3e2888e9.js → index-3a51ec3d.js} +11 -11
- package/build/{index-3c19d304.js → index-41571984.js} +2 -2
- package/build/{index-1c4e2e26.js → index-48cd6eef.js} +25 -25
- package/build/{index-cd258cda.js → index-4a89e0f6.js} +19 -19
- package/build/{index-6a610b45.js → index-4d463a04.js} +3 -3
- package/build/{index-93c8dfdb.js → index-4f0a5b11.js} +21 -21
- package/build/{index-50f9d364.js → index-53d5cb37.js} +14 -14
- package/build/{index-20b0a23e.js → index-55054438.js} +2 -2
- package/build/{index-6caa9f0a.js → index-566fbe6a.js} +3 -3
- package/build/{index-4222250b.js → index-57c25707.js} +32 -32
- package/build/{index-32bcb11f.js → index-5d787993.js} +22 -22
- package/build/{index-661b0c9b.js → index-61871988.js} +1 -1
- package/build/{index-13300ad6.js → index-6b3d5c92.js} +4 -4
- package/build/{index-e734fdb1.js → index-6bef99e9.js} +2 -2
- package/build/{index-3ac08ba3.js → index-6d732b5d.js} +16 -16
- package/build/{index-8c9a7b0a.js → index-72a68b8d.js} +2 -2
- package/build/{index-c8a8909c.js → index-7bf8ef88.js} +3 -3
- package/build/{index-7b11672e.js → index-7e06711d.js} +2 -2
- package/build/{index-0fddf5dc.js → index-8082f5c3.js} +14 -14
- package/build/{index-b9c4847c.js → index-88478773.js} +5 -5
- package/build/{index-f1d00ff8.js → index-88c922e9.js} +1 -1
- package/build/{index-aa8e7351.js → index-8c51bc2a.js} +3 -3
- package/build/{index-c0803a06.js → index-8c6f33a0.js} +15 -15
- package/build/{index-b5cec6ea.js → index-8e173c21.js} +8 -8
- package/build/{index-2dbdc7fd.js → index-91b90c2c.js} +7 -7
- package/build/{index-3308d9cd.js → index-92a6e9a3.js} +21 -21
- package/build/{index-df769040.js → index-988256f0.js} +3 -3
- package/build/{index-810c6a59.js → index-9d03e100.js} +8 -8
- package/build/{index-3cff71bd.js → index-a05cfb79.js} +2 -2
- package/build/{index-7ed2262c.js → index-a1690241.js} +1 -1
- package/build/{index-b5f5b88c.js → index-a1f27506.js} +14 -14
- package/build/{index-3cb91fa2.js → index-a5a251f2.js} +2 -2
- package/build/{index-29eccae0.js → index-acf7e6e6.js} +6 -6
- package/build/{index-171e2ca3.js → index-b01da559.js} +3 -3
- package/build/{index-b8184578.js → index-b0e8f8c0.js} +2 -2
- package/build/{index-3ed6190e.js → index-b30bf9af.js} +17 -17
- package/build/{index-89cbf9e9.js → index-be21f9fa.js} +3 -3
- package/build/{index-cd894e66.js → index-cb226aa5.js} +9 -9
- package/build/{index-eb4160ca.js → index-cb616ac8.js} +6 -6
- package/build/{index-c17da4ed.js → index-cba20e24.js} +13 -13
- package/build/{index-463935f9.js → index-cd639ef4.js} +1 -1
- package/build/{index-3d0eed5c.js → index-d9a0b352.js} +1 -1
- package/build/{index-54f1519d.js → index-e3df463b.js} +16 -16
- package/build/{index-2e19e853.js → index-e47587c7.js} +18 -18
- package/build/{index-1d5c4000.js → index-e65d687b.js} +1 -1
- package/build/{index-652890d3.js → index-ef2d8114.js} +6 -6
- package/build/{index-e53cecb0.js → index-efdb9925.js} +7 -7
- package/build/{index-1cc3c7df.js → index-f3467a43.js} +6 -6
- package/build/{index-add730c8.js → index-f4e669e3.js} +5 -5
- package/build/{index-49063467.js → index-f5a32102.js} +2 -2
- package/build/{index-7bfc19ea.js → index-fd97f12e.js} +2 -2
- package/build/{index-ee6f5d96.js → index-ff164c96.js} +2 -2
- package/build/index.js +125 -124
- package/build/{labelSorting-96ec0767.js → labelSorting-0a10639c.js} +4 -4
- package/build/lead.js +35 -35
- package/build/{logoIcon-ce5335ea.js → logoIcon-34ff722d.js} +2 -2
- package/build/mantine.js +48 -40
- package/build/misc.js +19 -19
- 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 +79 -78
- package/build/moleculesArticleCard.js +6 -6
- package/build/moleculesArticleCardV2.js +17 -17
- package/build/navigation.js +47 -47
- package/build/navigationLogoutPopup.js +11 -11
- package/build/navigationProfileButton.js +27 -27
- package/build/onboardingV2.js +29 -29
- package/build/organisms.js +57 -57
- package/build/{post-43837f56.js → post-bbe835b7.js} +2 -2
- package/build/profileNavigation.js +20 -20
- package/build/progressBar.js +1 -1
- package/build/pwg.js +23 -23
- package/build/ssoV2.js +38 -29
- package/build/{store-c32018b3.js → store-87a5078f.js} +3 -3
- package/build/subot/index.d.ts +0 -1
- package/build/subot/subotInlineRevamp/context.d.ts +1 -1
- package/build/subot/subotInlineRevamp/types.d.ts +0 -2
- package/build/subot.js +113 -3269
- package/build/surveyOrPremiumBanner.js +34 -34
- package/build/surveyQuestionCard.js +11 -11
- package/build/{surveyThankyouCard-187a0999.js → surveyThankyouCard-d5c3d763.js} +5 -5
- package/build/together/togetherComponentGlobalContext.d.ts +0 -2
- package/build/together.js +57 -57
- package/build/togetherApiUtils.js +4 -4
- package/build/togetherAtoms.js +31 -31
- package/build/togetherComponentGlobalContext.js +4 -4
- package/build/togetherMolecules.js +52 -52
- package/build/togetherMoleculesCardAuthor.js +29 -29
- package/build/togetherMoleculesPostImagePreview.js +11 -11
- package/build/togetherMoleculesProfileDetail.js +40 -40
- package/build/togetherOrganisms.js +51 -51
- package/build/togetherRichTextEditor.js +18 -18
- package/build/togetherShareBox.js +10 -10
- package/build/{translationsProvider-96b95965.js → translationsProvider-b852d070.js} +1 -1
- package/build/{treePopoverMenu-87026202.js → treePopoverMenu-38ec7824.js} +19 -19
- package/build/types.js +2 -2
- package/build/{useHealthToolCache-24e6ce18.js → useHealthToolCache-9abe8e95.js} +1 -1
- package/build/{usePhoneValidator-a8e45be6.js → usePhoneValidator-244464fd.js} +5 -5
- package/build/{usePlacesAutocomplete-213f71d9.js → usePlacesAutocomplete-fc2c2088.js} +1 -1
- package/build/useTogetherAuthRequiredAction.js +10 -10
- package/build/{utils-ee106628.js → utils-5e96bc42.js} +3 -3
- package/build/{utils-d2caaa9e.js → utils-9e5d8888.js} +2 -2
- package/build/{utils-be5a9671.js → utils-cbaa2696.js} +2 -2
- package/build/{utils-b663a317.js → utils-e4e8962e.js} +5 -5
- package/build/vaccination.js +22 -22
- package/package.json +2 -4
- package/build/esm/index-7f349b3a.js +0 -16
- package/build/esm/subot/hooks/useVerifyPhoneNumber.d.ts +0 -1
- package/build/esm/subot/subotInline/assets/arrow-down.d.ts +0 -3
- package/build/esm/subot/subotInline/assets/arrow-left.d.ts +0 -3
- package/build/esm/subot/subotInline/assets/arrow-right.d.ts +0 -3
- package/build/esm/subot/subotInline/assets/arrow-up.d.ts +0 -3
- package/build/esm/subot/subotInline/assets/check.d.ts +0 -3
- package/build/esm/subot/subotInline/assets/checkbox.d.ts +0 -3
- package/build/esm/subot/subotInline/assets/chevronRightActive.d.ts +0 -3
- package/build/esm/subot/subotInline/assets/dislike-article.d.ts +0 -3
- package/build/esm/subot/subotInline/assets/index.d.ts +0 -10
- package/build/esm/subot/subotInline/assets/like-article.d.ts +0 -3
- package/build/esm/subot/subotInline/assets/rotate-left.d.ts +0 -3
- package/build/esm/subot/subotInline/index.d.ts +0 -4
- package/build/esm/subot/subotInline/index.styled.d.ts +0 -67
- package/build/esm/subot/subotInline/subotInline.config.d.ts +0 -38
- package/build/esm/subot/subotInline/subotInlineAction/index.d.ts +0 -25
- package/build/esm/subot/subotInline/subotInlineAction/subotInlineAction.d.ts +0 -4
- package/build/esm/subot/subotInline/subotInlineAction/subotInlineAction.styled.d.ts +0 -54
- package/build/esm/subot/subotInline/subotInlineFooter.d.ts +0 -17
- package/build/esm/subot/subotInline/subotInlineHeader.d.ts +0 -3
- package/build/esm/subot/subotInline/subotInlineIntent/index.d.ts +0 -100
- package/build/esm/subot/subotInline/subotInlineIntent/subotInlineIntent.d.ts +0 -4
- package/build/esm/subot/subotInline/subotInlineIntent/subotInlineIntent.styled.d.ts +0 -159
- package/build/esm/subot/subotInline/subotInlineIntent/subotInlineIntentFinal.d.ts +0 -4
- package/build/esm/subot/subotInline/subotInlineNode/SubotInlineNodeResultPoll.d.ts +0 -4
- package/build/esm/subot/subotInline/subotInlineNode/index.d.ts +0 -15
- package/build/esm/subot/subotInline/subotInlineNode/subotInlineNode.d.ts +0 -5
- package/build/esm/subot/subotInline/subotInlineNode/subotInlineNode.styled.d.ts +0 -74
- package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeFinal.d.ts +0 -4
- package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeFinalThankYou.d.ts +0 -4
- package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeForm.d.ts +0 -4
- package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeImage.d.ts +0 -4
- package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeMultiple.d.ts +0 -4
- package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeOTP.d.ts +0 -4
- package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodePoll.d.ts +0 -4
- package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeRating.d.ts +0 -4
- package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeReaction.d.ts +0 -4
- package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeReview.d.ts +0 -4
- package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeSSO.d.ts +0 -4
- package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeStart.d.ts +0 -4
- package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeText.d.ts +0 -4
- package/build/index-59a5a3a6.js +0 -22
- package/build/subot/hooks/useVerifyPhoneNumber.d.ts +0 -1
- package/build/subot/subotInline/assets/arrow-down.d.ts +0 -3
- package/build/subot/subotInline/assets/arrow-left.d.ts +0 -3
- package/build/subot/subotInline/assets/arrow-right.d.ts +0 -3
- package/build/subot/subotInline/assets/arrow-up.d.ts +0 -3
- package/build/subot/subotInline/assets/check.d.ts +0 -3
- package/build/subot/subotInline/assets/checkbox.d.ts +0 -3
- package/build/subot/subotInline/assets/chevronRightActive.d.ts +0 -3
- package/build/subot/subotInline/assets/dislike-article.d.ts +0 -3
- package/build/subot/subotInline/assets/index.d.ts +0 -10
- package/build/subot/subotInline/assets/like-article.d.ts +0 -3
- package/build/subot/subotInline/assets/rotate-left.d.ts +0 -3
- package/build/subot/subotInline/index.d.ts +0 -4
- package/build/subot/subotInline/index.styled.d.ts +0 -67
- package/build/subot/subotInline/subotInline.config.d.ts +0 -38
- package/build/subot/subotInline/subotInlineAction/index.d.ts +0 -25
- package/build/subot/subotInline/subotInlineAction/subotInlineAction.d.ts +0 -4
- package/build/subot/subotInline/subotInlineAction/subotInlineAction.styled.d.ts +0 -54
- package/build/subot/subotInline/subotInlineFooter.d.ts +0 -17
- package/build/subot/subotInline/subotInlineHeader.d.ts +0 -3
- package/build/subot/subotInline/subotInlineIntent/index.d.ts +0 -100
- package/build/subot/subotInline/subotInlineIntent/subotInlineIntent.d.ts +0 -4
- package/build/subot/subotInline/subotInlineIntent/subotInlineIntent.styled.d.ts +0 -159
- package/build/subot/subotInline/subotInlineIntent/subotInlineIntentFinal.d.ts +0 -4
- package/build/subot/subotInline/subotInlineNode/SubotInlineNodeResultPoll.d.ts +0 -4
- package/build/subot/subotInline/subotInlineNode/index.d.ts +0 -15
- package/build/subot/subotInline/subotInlineNode/subotInlineNode.d.ts +0 -5
- package/build/subot/subotInline/subotInlineNode/subotInlineNode.styled.d.ts +0 -74
- package/build/subot/subotInline/subotInlineNode/subotInlineNodeFinal.d.ts +0 -4
- package/build/subot/subotInline/subotInlineNode/subotInlineNodeFinalThankYou.d.ts +0 -4
- package/build/subot/subotInline/subotInlineNode/subotInlineNodeForm.d.ts +0 -4
- package/build/subot/subotInline/subotInlineNode/subotInlineNodeImage.d.ts +0 -4
- package/build/subot/subotInline/subotInlineNode/subotInlineNodeMultiple.d.ts +0 -4
- package/build/subot/subotInline/subotInlineNode/subotInlineNodeOTP.d.ts +0 -4
- package/build/subot/subotInline/subotInlineNode/subotInlineNodePoll.d.ts +0 -4
- package/build/subot/subotInline/subotInlineNode/subotInlineNodeRating.d.ts +0 -4
- package/build/subot/subotInline/subotInlineNode/subotInlineNodeReaction.d.ts +0 -4
- package/build/subot/subotInline/subotInlineNode/subotInlineNodeReview.d.ts +0 -4
- package/build/subot/subotInline/subotInlineNode/subotInlineNodeSSO.d.ts +0 -4
- package/build/subot/subotInline/subotInlineNode/subotInlineNodeStart.d.ts +0 -4
- package/build/subot/subotInline/subotInlineNode/subotInlineNodeText.d.ts +0 -4
- /package/build/{BMI_BOYS.percentile.monthly-3aea792f.js → BMI_BOYS.percentile.monthly-6b31557e.js} +0 -0
- /package/build/{BMI_BOYS.percentile.weekly-07de87c6.js → BMI_BOYS.percentile.weekly-978f2d7d.js} +0 -0
- /package/build/{BMI_BOYS.percentile.yearly-cadf94f1.js → BMI_BOYS.percentile.yearly-e829f962.js} +0 -0
- /package/build/{BMI_BOYS.zscore.monthly-6ebe7c55.js → BMI_BOYS.zscore.monthly-213f96ad.js} +0 -0
- /package/build/{BMI_BOYS.zscore.weekly-ea52fe8f.js → BMI_BOYS.zscore.weekly-b6db0a53.js} +0 -0
- /package/build/{BMI_BOYS.zscore.yearly-f9dca42f.js → BMI_BOYS.zscore.yearly-ee505a09.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.monthly-086f2fe7.js → BMI_GIRLS.percentile.monthly-3e3b72fe.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.weekly-24bdea5a.js → BMI_GIRLS.percentile.weekly-c953d8d4.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.yearly-74b8cfc7.js → BMI_GIRLS.percentile.yearly-59725d0f.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.monthly-59915c26.js → BMI_GIRLS.zscore.monthly-b79d105e.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.weekly-3fef2afa.js → BMI_GIRLS.zscore.weekly-44b6c00a.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.yearly-92d2cd3f.js → BMI_GIRLS.zscore.yearly-39c7714b.js} +0 -0
- /package/build/{ChevronDown-5d1c11ae.js → ChevronDown-5b13538e.js} +0 -0
- /package/build/{Close-6994789b.js → Close-37600026.js} +0 -0
- /package/build/{Google-38f0239d.js → Google-1da35685.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-79f294e4.js → HEAD CIRCUM_BOYS.percentile.monthly-0efa0492.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-f9a7f78b.js → HEAD CIRCUM_BOYS.percentile.weekly-ee06afe8.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-012a5b1d.js → HEAD CIRCUM_BOYS.percentile.yearly-5e0c8746.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-8a61d67b.js → HEAD CIRCUM_BOYS.zscore.monthly-6dc514c0.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-bf6f079b.js → HEAD CIRCUM_BOYS.zscore.weekly-9b5a704e.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-9baba408.js → HEAD CIRCUM_BOYS.zscore.yearly-6cb50ffc.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-06364175.js → HEAD CIRCUM_GIRLS.percentile.monthly-cdb93c7e.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-38cc0e4a.js → HEAD CIRCUM_GIRLS.percentile.weekly-605c07aa.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-fac1be7c.js → HEAD CIRCUM_GIRLS.percentile.yearly-4f6df473.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-95006ebb.js → HEAD CIRCUM_GIRLS.zscore.monthly-14b5d499.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-78ff5545.js → HEAD CIRCUM_GIRLS.zscore.weekly-4a869ab8.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-9d5dd132.js → HEAD CIRCUM_GIRLS.zscore.yearly-b66cc8ae.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.monthly-043dc929.js → HEIGHT_BOYS.percentile.monthly-da57f20d.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.weekly-9efe9283.js → HEIGHT_BOYS.percentile.weekly-e02783b8.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.yearly-14cf0684.js → HEIGHT_BOYS.percentile.yearly-52b9f922.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.monthly-3369b328.js → HEIGHT_BOYS.zscore.monthly-e7f988b0.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.weekly-5f72b03c.js → HEIGHT_BOYS.zscore.weekly-d5cf3e0c.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.yearly-8fe5536c.js → HEIGHT_BOYS.zscore.yearly-e100ba9f.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.monthly-0c7c0f0c.js → HEIGHT_GIRLS.percentile.monthly-de5fe181.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.weekly-27b8b6a1.js → HEIGHT_GIRLS.percentile.weekly-8f812859.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.yearly-87e0e46a.js → HEIGHT_GIRLS.percentile.yearly-01cdc98e.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.monthly-d7b2d9e5.js → HEIGHT_GIRLS.zscore.monthly-645b4643.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.weekly-243c7708.js → HEIGHT_GIRLS.zscore.weekly-0a42e395.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.yearly-e847811a.js → HEIGHT_GIRLS.zscore.yearly-2c7a0e47.js} +0 -0
- /package/build/{Locale-0882f19d.js → Locale-ec6930da.js} +0 -0
- /package/build/{Visible-f94f3e2c.js → Visible-0f3e8cb0.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.monthly-4e4fc116.js → WEIGHT_BOYS.percentile.monthly-b1b634ac.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.weekly-e634939f.js → WEIGHT_BOYS.percentile.weekly-c62ecd15.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.yearly-5cf2e474.js → WEIGHT_BOYS.percentile.yearly-70a4135e.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.monthly-674bd7d1.js → WEIGHT_BOYS.zscore.monthly-c4974073.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.weekly-423ce298.js → WEIGHT_BOYS.zscore.weekly-602e2a98.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.yearly-879bd3ba.js → WEIGHT_BOYS.zscore.yearly-8217903b.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.monthly-4fba9a58.js → WEIGHT_GIRLS.percentile.monthly-87394741.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.weekly-37db9658.js → WEIGHT_GIRLS.percentile.weekly-a4a9669e.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.yearly-8fcbc503.js → WEIGHT_GIRLS.percentile.yearly-9880623f.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.monthly-94a767c7.js → WEIGHT_GIRLS.zscore.monthly-2bd8a394.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.weekly-b0575242.js → WEIGHT_GIRLS.zscore.weekly-7b4399bc.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.yearly-d8d722c0.js → WEIGHT_GIRLS.zscore.yearly-0e23783b.js} +0 -0
- /package/build/{ageGenerate-a6d7d682.js → ageGenerate-1169c87d.js} +0 -0
- /package/build/{animation-3fec227f.js → animation-c590f2df.js} +0 -0
- /package/build/{constants-1670ba2c.js → constants-5a9d0603.js} +0 -0
- /package/build/{constants-72e80fc9.js → constants-bdfa27f7.js} +0 -0
- /package/build/{constants-88164425.js → constants-f0d2b8d5.js} +0 -0
- /package/build/{context-6f7c5563.js → context-9a0d030c.js} +0 -0
- /package/build/{dataTransform-0c951e0f.js → dataTransform-0fa9b2ac.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.monthly-a8576350.js → BMI_BOYS.percentile.monthly-ef81b628.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.weekly-2371bfa0.js → BMI_BOYS.percentile.weekly-43e2b140.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.yearly-81c7213e.js → BMI_BOYS.percentile.yearly-4c0b7de4.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.monthly-b7e59773.js → BMI_BOYS.zscore.monthly-2b356da0.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.weekly-993a5430.js → BMI_BOYS.zscore.weekly-588f6a2a.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.yearly-fa0b1ded.js → BMI_BOYS.zscore.yearly-e55a2144.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.monthly-19908ce4.js → BMI_GIRLS.percentile.monthly-1866bec6.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.weekly-e5789f1b.js → BMI_GIRLS.percentile.weekly-3435bd85.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.yearly-784c5e4c.js → BMI_GIRLS.percentile.yearly-8c118b3f.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.monthly-fd330c5b.js → BMI_GIRLS.zscore.monthly-c515a3e4.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.weekly-125de84c.js → BMI_GIRLS.zscore.weekly-0876207d.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.yearly-60064e8b.js → BMI_GIRLS.zscore.yearly-8cac09b0.js} +0 -0
- /package/build/esm/{ChevronDown-dcc89979.js → ChevronDown-acca4caa.js} +0 -0
- /package/build/esm/{Close-89f9bf3a.js → Close-5a2afe8f.js} +0 -0
- /package/build/esm/{Google-937ab394.js → Google-400a74df.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-4406549e.js → HEAD CIRCUM_BOYS.percentile.monthly-906c9922.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-74cb0013.js → HEAD CIRCUM_BOYS.percentile.weekly-891072b3.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-1a028be6.js → HEAD CIRCUM_BOYS.percentile.yearly-cb1c4dc7.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-1dea9769.js → HEAD CIRCUM_BOYS.zscore.monthly-f497d9ed.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-81ba63c6.js → HEAD CIRCUM_BOYS.zscore.weekly-a946edc1.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-8d85396f.js → HEAD CIRCUM_BOYS.zscore.yearly-22d27c38.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-40bd219b.js → HEAD CIRCUM_GIRLS.percentile.monthly-6555943c.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-1b54536b.js → HEAD CIRCUM_GIRLS.percentile.weekly-822011e4.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-adedb209.js → HEAD CIRCUM_GIRLS.percentile.yearly-0c1358c2.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-f82402e6.js → HEAD CIRCUM_GIRLS.zscore.monthly-f144fde0.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-5afc7db0.js → HEAD CIRCUM_GIRLS.zscore.weekly-417585ad.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-4ae7f8ff.js → HEAD CIRCUM_GIRLS.zscore.yearly-35b6dd6c.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.monthly-fc524891.js → HEIGHT_BOYS.percentile.monthly-b5134d44.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.weekly-ea4374c7.js → HEIGHT_BOYS.percentile.weekly-c387850f.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.yearly-7f25d743.js → HEIGHT_BOYS.percentile.yearly-a6b85401.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.monthly-90208f76.js → HEIGHT_BOYS.zscore.monthly-a7c902a8.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.weekly-f025729e.js → HEIGHT_BOYS.zscore.weekly-2f856f37.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.yearly-0f818c09.js → HEIGHT_BOYS.zscore.yearly-f712a6f1.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-9e1755c3.js → HEIGHT_GIRLS.percentile.monthly-dcddaa1f.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-36abf9b0.js → HEIGHT_GIRLS.percentile.weekly-37305420.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-7505370d.js → HEIGHT_GIRLS.percentile.yearly-026df0c0.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-3ecc9f93.js → HEIGHT_GIRLS.zscore.monthly-8eaa85fc.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-653f1849.js → HEIGHT_GIRLS.zscore.weekly-b92eac6d.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-50a24e0f.js → HEIGHT_GIRLS.zscore.yearly-3c88d4de.js} +0 -0
- /package/build/esm/{Locale-9ebdf028.js → Locale-b3c0ef4e.js} +0 -0
- /package/build/esm/{Visible-9ab75514.js → Visible-c62ca4eb.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.monthly-0df071be.js → WEIGHT_BOYS.percentile.monthly-b6edc37d.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.weekly-bf6e1c86.js → WEIGHT_BOYS.percentile.weekly-b67ed8aa.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.yearly-1526a041.js → WEIGHT_BOYS.percentile.yearly-895fbc86.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.monthly-0d02edfe.js → WEIGHT_BOYS.zscore.monthly-1dfae056.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.weekly-3566d014.js → WEIGHT_BOYS.zscore.weekly-32a73bc2.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.yearly-24f1eeb0.js → WEIGHT_BOYS.zscore.yearly-2d226348.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-08980008.js → WEIGHT_GIRLS.percentile.monthly-c01a8296.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-b8888ea9.js → WEIGHT_GIRLS.percentile.weekly-a57c604e.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-0c93e712.js → WEIGHT_GIRLS.percentile.yearly-27ca8230.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-4aa1d9be.js → WEIGHT_GIRLS.zscore.monthly-e6c08d9a.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-96124453.js → WEIGHT_GIRLS.zscore.weekly-85c92281.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-5ba766e4.js → WEIGHT_GIRLS.zscore.yearly-41a30f2c.js} +0 -0
- /package/build/esm/{ageGenerate-a0ec6213.js → ageGenerate-ccd2e560.js} +0 -0
- /package/build/esm/{animation-a1b23560.js → animation-76720a50.js} +0 -0
- /package/build/esm/{constants-498a3f3f.js → constants-3a147059.js} +0 -0
- /package/build/esm/{constants-26749107.js → constants-7ef9402f.js} +0 -0
- /package/build/esm/{constants-b8eeb363.js → constants-da6dfd4d.js} +0 -0
- /package/build/esm/{context-eccbf4ab.js → context-2f409304.js} +0 -0
- /package/build/esm/{dataTransform-6f8f5d9a.js → dataTransform-a141a5b6.js} +0 -0
- /package/build/esm/{index-5b28ac5e.js → index-28c66fc1.js} +0 -0
- /package/build/esm/{index-344e0598.js → index-30693067.js} +0 -0
- /package/build/esm/{index-56dced9f.js → index-4ab96c95.js} +0 -0
- /package/build/esm/{index-7a2240d3.js → index-5a33a2af.js} +0 -0
- /package/build/esm/{index-1e93154d.js → index-7cd1ff1c.js} +0 -0
- /package/build/esm/{index-30927237.js → index-871a20be.js} +0 -0
- /package/build/esm/{index-2d81b7cd.js → index-b3494961.js} +0 -0
- /package/build/esm/{index-7dab16d5.js → index-b52757bc.js} +0 -0
- /package/build/esm/{index-2166eaab.js → index-c0f625f9.js} +0 -0
- /package/build/esm/{index.styles-5b99525e.js → index.styles-dd14e23b.js} +0 -0
- /package/build/esm/{localizeNumberFormat-c3237408.js → localizeNumberFormat-8cd4af1a.js} +0 -0
- /package/build/esm/{normalizeLink-d4ac54c6.js → normalizeLink-1c482bf9.js} +0 -0
- /package/build/esm/{number-5f066ade.js → number-25072852.js} +0 -0
- /package/build/esm/{paths-f1c3c8f9.js → paths-d7ff4026.js} +0 -0
- /package/build/esm/{shared-343e153b.js → shared-d5039f06.js} +0 -0
- /package/build/esm/{translationsContext-50bce11b.js → translationsContext-f1586547.js} +0 -0
- /package/build/esm/{tslib.es6-45ce6353.js → tslib.es6-71c95f0d.js} +0 -0
- /package/build/esm/{types-652f2940.js → types-bfc769b5.js} +0 -0
- /package/build/esm/{types-9fddcb07.js → types-f1fa72fe.js} +0 -0
- /package/build/esm/{useIsInit-0d1d4851.js → useIsInit-8f570916.js} +0 -0
- /package/build/esm/{useOutsideClick-0cfddff2.js → useOutsideClick-ca9ef36d.js} +0 -0
- /package/build/esm/{useScrollbarSize-688a8b8d.js → useScrollbarSize-d4943a3b.js} +0 -0
- /package/build/esm/{useUniqueId-fb473ef0.js → useUniqueId-82cda08a.js} +0 -0
- /package/build/esm/{utils-64169dd2.js → utils-468ff2e1.js} +0 -0
- /package/build/esm/{utils-f638a98c.js → utils-829640ef.js} +0 -0
- /package/build/{index-5ca6b33e.js → index-090b99aa.js} +0 -0
- /package/build/{index-b2544b48.js → index-24dc470e.js} +0 -0
- /package/build/{index-98210e7d.js → index-4717a069.js} +0 -0
- /package/build/{index-7e01e7b8.js → index-48b4adf3.js} +0 -0
- /package/build/{index-40cb5e7b.js → index-5bf9d4bf.js} +0 -0
- /package/build/{index-2bf53ad5.js → index-addaddb1.js} +0 -0
- /package/build/{index-b21d38ff.js → index-bf822d11.js} +0 -0
- /package/build/{index-3705e2c5.js → index-c5ec058c.js} +0 -0
- /package/build/{index-c1baa4c2.js → index-fc2db4ec.js} +0 -0
- /package/build/{index.styles-3c78387f.js → index.styles-1ee5d7a8.js} +0 -0
- /package/build/{localizeNumberFormat-f1df3ca4.js → localizeNumberFormat-d908f487.js} +0 -0
- /package/build/{normalizeLink-afda85d8.js → normalizeLink-f20c5fb5.js} +0 -0
- /package/build/{number-2c6a3797.js → number-aaf0af8f.js} +0 -0
- /package/build/{paths-917f8624.js → paths-33a43575.js} +0 -0
- /package/build/{shared-602b3523.js → shared-d6f36907.js} +0 -0
- /package/build/{translationsContext-7b09eca1.js → translationsContext-5c1324f6.js} +0 -0
- /package/build/{tslib.es6-ce87bd30.js → tslib.es6-d626472f.js} +0 -0
- /package/build/{types-5b574d7e.js → types-2ea35542.js} +0 -0
- /package/build/{types-25943815.js → types-3cd9ff53.js} +0 -0
- /package/build/{useIsInit-a688e4e8.js → useIsInit-89c96446.js} +0 -0
- /package/build/{useOutsideClick-882841f1.js → useOutsideClick-df34268e.js} +0 -0
- /package/build/{useScrollbarSize-c65ae16e.js → useScrollbarSize-26e14b83.js} +0 -0
- /package/build/{useUniqueId-49718d9e.js → useUniqueId-146e6830.js} +0 -0
- /package/build/{utils-5b232c7b.js → utils-08fcfbf3.js} +0 -0
- /package/build/{utils-18b65c6a.js → utils-ff87015d.js} +0 -0
package/build/subot.js
CHANGED
|
@@ -3,82 +3,77 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var index$2 = require('./index-
|
|
7
|
-
var tslib_es6 = require('./tslib.es6-
|
|
8
|
-
var index$3 = require('./index-
|
|
6
|
+
var index$2 = require('./index-d9a0b352.js');
|
|
7
|
+
var tslib_es6 = require('./tslib.es6-d626472f.js');
|
|
8
|
+
var index$3 = require('./index-f5a32102.js');
|
|
9
9
|
var Cookies = require('js-cookie');
|
|
10
10
|
var fd = require('fastdom');
|
|
11
11
|
var fastdomPromised = require('fastdom/extensions/fastdom-promised');
|
|
12
|
-
var togetherComponentGlobalContext = require('./utils-
|
|
12
|
+
var togetherComponentGlobalContext = require('./utils-5e96bc42.js');
|
|
13
13
|
var formatString = require('string-format');
|
|
14
|
-
var index$1 = require('./index-
|
|
14
|
+
var index$1 = require('./index-0e1c1ea3.js');
|
|
15
15
|
var dayjs = require('dayjs');
|
|
16
16
|
var constantsDomainLocales = require('./constantsDomainLocales.js');
|
|
17
17
|
var classNames = require('classnames');
|
|
18
|
-
var index$b = require('./index-
|
|
19
|
-
var index$a = require('./index-
|
|
18
|
+
var index$b = require('./index-c5ec058c.js');
|
|
19
|
+
var index$a = require('./index-219c0ee4.js');
|
|
20
20
|
var framerMotion = require('framer-motion');
|
|
21
21
|
var styled = require('@emotion/styled');
|
|
22
|
-
var utils = require('./utils-
|
|
23
|
-
var index$4 = require('./index-
|
|
22
|
+
var utils = require('./utils-ff87015d.js');
|
|
23
|
+
var index$4 = require('./index-8c51bc2a.js');
|
|
24
24
|
var remarkable = require('remarkable');
|
|
25
25
|
var other = require('@hhgtech/icons/other');
|
|
26
26
|
var reactIntersectionObserver = require('react-intersection-observer');
|
|
27
27
|
var core = require('@mantine/core');
|
|
28
|
-
var index$5 = require('./index-
|
|
28
|
+
var index$5 = require('./index-5bf9d4bf.js');
|
|
29
29
|
var isSameOrBefore = require('dayjs/plugin/isSameOrBefore');
|
|
30
|
-
var constants = require('./constants-
|
|
30
|
+
var constants = require('./constants-5a9d0603.js');
|
|
31
31
|
var uuid = require('uuid');
|
|
32
|
-
var index$6 = require('./index-
|
|
32
|
+
var index$6 = require('./index-6bef99e9.js');
|
|
33
33
|
var miscTheme = require('./miscTheme.js');
|
|
34
34
|
var constantsIsProduction = require('./constantsIsProduction.js');
|
|
35
|
-
var index$7 = require('./index-
|
|
35
|
+
var index$7 = require('./index-9d03e100.js');
|
|
36
36
|
require('@mantine/dates');
|
|
37
|
-
require('./index-
|
|
38
|
-
require('./index-
|
|
39
|
-
require('./index.styles-
|
|
40
|
-
require('./translationsContext-
|
|
37
|
+
require('./index-8e173c21.js');
|
|
38
|
+
require('./index-090b99aa.js');
|
|
39
|
+
require('./index.styles-1ee5d7a8.js');
|
|
40
|
+
require('./translationsContext-5c1324f6.js');
|
|
41
41
|
require('@mantine/hooks');
|
|
42
|
-
require('./index-
|
|
42
|
+
require('./index-566fbe6a.js');
|
|
43
43
|
var isEmpty = require('lodash/isEmpty');
|
|
44
44
|
var reactHookForm = require('react-hook-form');
|
|
45
45
|
var PhoneInputBase = require('react-phone-number-input');
|
|
46
46
|
var api = require('@react-google-maps/api');
|
|
47
|
-
var usePlacesAutocomplete = require('./usePlacesAutocomplete-
|
|
47
|
+
var usePlacesAutocomplete = require('./usePlacesAutocomplete-fc2c2088.js');
|
|
48
48
|
var miscDefaultClassWrapper = require('./miscDefaultClassWrapper.js');
|
|
49
|
-
var Locale = require('./Locale-
|
|
50
|
-
var InputDate = require('./InputDate-
|
|
51
|
-
var index$8 = require('./index-
|
|
52
|
-
var index$9 = require('./index-
|
|
53
|
-
var store = require('./store-
|
|
54
|
-
var utils$1 = require('./utils-
|
|
55
|
-
var index$c = require('./index-59a5a3a6.js');
|
|
56
|
-
var StarRatings = require('react-star-ratings');
|
|
57
|
-
var moleculesArticleCard = require('./moleculesArticleCard.js');
|
|
58
|
-
var index$d = require('./index-c17da4ed.js');
|
|
59
|
-
var index$e = require('./index-5db61b31.js');
|
|
49
|
+
var Locale = require('./Locale-ec6930da.js');
|
|
50
|
+
var InputDate = require('./InputDate-d158bc4e.js');
|
|
51
|
+
var index$8 = require('./index-0a600778.js');
|
|
52
|
+
var index$9 = require('./index-24dc470e.js');
|
|
53
|
+
var store = require('./store-87a5078f.js');
|
|
54
|
+
var utils$1 = require('./utils-e4e8962e.js');
|
|
60
55
|
require('date-fns/locale');
|
|
61
56
|
require('./constantsSite.js');
|
|
62
57
|
require('./constantsRiskScreener.js');
|
|
63
|
-
require('./index-
|
|
58
|
+
require('./index-4717a069.js');
|
|
64
59
|
require('./miscCookieHelper.js');
|
|
65
60
|
require('slugify');
|
|
66
61
|
require('./togetherApiPaths.js');
|
|
67
|
-
require('./index-
|
|
68
|
-
require('./WhatsApp-
|
|
69
|
-
require('./Spinner-
|
|
70
|
-
require('./index-
|
|
71
|
-
require('./shared-
|
|
72
|
-
require('./index-
|
|
62
|
+
require('./index-7bf8ef88.js');
|
|
63
|
+
require('./WhatsApp-0b4c61b8.js');
|
|
64
|
+
require('./Spinner-15aff8d4.js');
|
|
65
|
+
require('./index-e65d687b.js');
|
|
66
|
+
require('./shared-d6f36907.js');
|
|
67
|
+
require('./index-185a0844.js');
|
|
73
68
|
require('@mantine/carousel');
|
|
74
|
-
require('./useUniqueId-
|
|
69
|
+
require('./useUniqueId-146e6830.js');
|
|
75
70
|
require('@emotion/react');
|
|
76
71
|
require('@hhgtech/icons/core');
|
|
77
72
|
require('@mantine/notifications');
|
|
78
73
|
require('zustand');
|
|
79
|
-
require('./index-
|
|
80
|
-
require('./normalizeLink-
|
|
81
|
-
require('./healthTools-
|
|
74
|
+
require('./index-20a92497.js');
|
|
75
|
+
require('./normalizeLink-f20c5fb5.js');
|
|
76
|
+
require('./healthTools-ccd56fee.js');
|
|
82
77
|
|
|
83
78
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
84
79
|
|
|
@@ -93,7 +88,6 @@ var styled__default = /*#__PURE__*/_interopDefault(styled);
|
|
|
93
88
|
var isSameOrBefore__default = /*#__PURE__*/_interopDefault(isSameOrBefore);
|
|
94
89
|
var isEmpty__default = /*#__PURE__*/_interopDefault(isEmpty);
|
|
95
90
|
var PhoneInputBase__default = /*#__PURE__*/_interopDefault(PhoneInputBase);
|
|
96
|
-
var StarRatings__default = /*#__PURE__*/_interopDefault(StarRatings);
|
|
97
91
|
|
|
98
92
|
// extend fastdom
|
|
99
93
|
const fastdom = fd__default["default"].extend(fastdomPromised__default["default"]);
|
|
@@ -175,7 +169,7 @@ const getSubotApiPath = (path, params) => {
|
|
|
175
169
|
return apiUrl + formatString__default["default"](path, Object.assign({}, params));
|
|
176
170
|
};
|
|
177
171
|
/** inline message */
|
|
178
|
-
const subotInlineMessage
|
|
172
|
+
const subotInlineMessage = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
179
173
|
try {
|
|
180
174
|
return yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.GET_INLINE_MESSAGE), 'POST', {
|
|
181
175
|
data,
|
|
@@ -183,7 +177,7 @@ const subotInlineMessage$1 = (data) => tslib_es6.__awaiter(void 0, void 0, void
|
|
|
183
177
|
}
|
|
184
178
|
catch (error) { }
|
|
185
179
|
});
|
|
186
|
-
const computeExtraSettingsForBot
|
|
180
|
+
const computeExtraSettingsForBot = (data) => {
|
|
187
181
|
var _a;
|
|
188
182
|
if ((data === null || data === void 0 ? void 0 : data._status) === 1 && ((_a = data === null || data === void 0 ? void 0 : data._data) === null || _a === void 0 ? void 0 : _a.extra_settings)) {
|
|
189
183
|
try {
|
|
@@ -206,11 +200,11 @@ const computeExtraSettingsForBot$1 = (data) => {
|
|
|
206
200
|
return data;
|
|
207
201
|
};
|
|
208
202
|
/** inline first node */
|
|
209
|
-
const subotInlineFirstNode
|
|
203
|
+
const subotInlineFirstNode = (id) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
210
204
|
try {
|
|
211
205
|
const data = yield CachedSystem.withCached('SubotInlineFirstNode/' + id, () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
212
206
|
const response = yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.GET_INLINE_FIRST_NODE) + `/${id}`, 'GET');
|
|
213
|
-
computeExtraSettingsForBot
|
|
207
|
+
computeExtraSettingsForBot(response);
|
|
214
208
|
return response;
|
|
215
209
|
}));
|
|
216
210
|
return data;
|
|
@@ -220,7 +214,7 @@ const subotInlineFirstNode$1 = (id) => tslib_es6.__awaiter(void 0, void 0, void
|
|
|
220
214
|
}
|
|
221
215
|
});
|
|
222
216
|
/** inline click */
|
|
223
|
-
const subotInlineClick
|
|
217
|
+
const subotInlineClick = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
224
218
|
try {
|
|
225
219
|
return yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.GET_INLINE_CLICK), 'POST', {
|
|
226
220
|
data,
|
|
@@ -229,7 +223,7 @@ const subotInlineClick$1 = (data) => tslib_es6.__awaiter(void 0, void 0, void 0,
|
|
|
229
223
|
catch (error) { }
|
|
230
224
|
});
|
|
231
225
|
/** inline impression */
|
|
232
|
-
const subotInlineImpression
|
|
226
|
+
const subotInlineImpression = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
233
227
|
try {
|
|
234
228
|
return yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.GET_INLINE_IMPRESSION), 'POST', {
|
|
235
229
|
data,
|
|
@@ -828,7 +822,7 @@ const detectToSkipNodeStart = (botItem, currentActiveId, currentListNodes) => {
|
|
|
828
822
|
return [currentActiveId, currentListNodes];
|
|
829
823
|
};
|
|
830
824
|
|
|
831
|
-
const SubotInlineContext
|
|
825
|
+
const SubotInlineContext = React.createContext({
|
|
832
826
|
activeId: '',
|
|
833
827
|
params: {},
|
|
834
828
|
listNodes: [],
|
|
@@ -844,7 +838,7 @@ const SubotInlineContext$1 = React.createContext({
|
|
|
844
838
|
setLoading: () => null,
|
|
845
839
|
userInfo: null,
|
|
846
840
|
});
|
|
847
|
-
const SubotInlineProvider = ({ children, articleLink, subotId, isFullContainer, bgColor: _bgColor, primaryColor: _primaryColor, textColor, textButtonColor, bgContentColor, bgImgFullContainer, isDisabledAnimationOnMobile, onCloseMobile, userInfo, typeFormProps,
|
|
841
|
+
const SubotInlineProvider = ({ children, articleLink, subotId, isFullContainer, bgColor: _bgColor, primaryColor: _primaryColor, textColor, textButtonColor, bgContentColor, bgImgFullContainer, isDisabledAnimationOnMobile, onCloseMobile, userInfo, typeFormProps, isMobile, locale, }) => {
|
|
848
842
|
const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
849
843
|
const ref = React.useRef(null);
|
|
850
844
|
// const { formatMessage: f } = useIntl()
|
|
@@ -891,7 +885,8 @@ const SubotInlineProvider = ({ children, articleLink, subotId, isFullContainer,
|
|
|
891
885
|
/** Get Params */
|
|
892
886
|
const getParams = React.useCallback(() => {
|
|
893
887
|
const gaData = window.gaData;
|
|
894
|
-
const url =
|
|
888
|
+
const url = window.location.origin +
|
|
889
|
+
index$3.basePath +
|
|
895
890
|
((togetherComponentGlobalContext.GlobalData === null || togetherComponentGlobalContext.GlobalData === void 0 ? void 0 : togetherComponentGlobalContext.GlobalData.locale) === 'tl-PH'
|
|
896
891
|
? articleLink.replace('fil/', '')
|
|
897
892
|
: articleLink);
|
|
@@ -940,7 +935,7 @@ const SubotInlineProvider = ({ children, articleLink, subotId, isFullContainer,
|
|
|
940
935
|
let newActiveId = '';
|
|
941
936
|
let nodes = [];
|
|
942
937
|
setLoading(true);
|
|
943
|
-
const resFirst = yield subotInlineFirstNode
|
|
938
|
+
const resFirst = yield subotInlineFirstNode(params.bot_id);
|
|
944
939
|
if ((resFirst === null || resFirst === void 0 ? void 0 : resFirst._status) === 1) {
|
|
945
940
|
newActiveId = resFirst === null || resFirst === void 0 ? void 0 : resFirst._data.id.toString();
|
|
946
941
|
nodes.push(resFirst === null || resFirst === void 0 ? void 0 : resFirst._data, resFirst === null || resFirst === void 0 ? void 0 : resFirst._data.first_node);
|
|
@@ -958,7 +953,7 @@ const SubotInlineProvider = ({ children, articleLink, subotId, isFullContainer,
|
|
|
958
953
|
if (previousState &&
|
|
959
954
|
previousState.params.action_id &&
|
|
960
955
|
previousState.params.action_value) {
|
|
961
|
-
const resResultInline = yield subotInlineMessage
|
|
956
|
+
const resResultInline = yield subotInlineMessage(previousState.params);
|
|
962
957
|
if ((resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._status) === 1 && (resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._data.node)) {
|
|
963
958
|
newActiveId = resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._data.node.id;
|
|
964
959
|
nodes = previousState.listNodes;
|
|
@@ -1027,7 +1022,7 @@ const SubotInlineProvider = ({ children, articleLink, subotId, isFullContainer,
|
|
|
1027
1022
|
const onNext = React.useCallback((messageParams) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
1028
1023
|
if (messageParams === null || messageParams === void 0 ? void 0 : messageParams.node_id) {
|
|
1029
1024
|
const newMessage = Object.assign(Object.assign({}, messageParams), getCurrentTotalDynamicScore(listNodes, activeId, messageParams.action_id));
|
|
1030
|
-
const res = yield subotInlineMessage
|
|
1025
|
+
const res = yield subotInlineMessage(newMessage);
|
|
1031
1026
|
setLoading(false);
|
|
1032
1027
|
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
1033
1028
|
const _b = res === null || res === void 0 ? void 0 : res._data, { node } = _b, restData = tslib_es6.__rest(_b, ["node"]);
|
|
@@ -1175,7 +1170,7 @@ const SubotInlineProvider = ({ children, articleLink, subotId, isFullContainer,
|
|
|
1175
1170
|
if (!listNodes.length) {
|
|
1176
1171
|
return null;
|
|
1177
1172
|
}
|
|
1178
|
-
return (React__default["default"].createElement(SubotInlineContext
|
|
1173
|
+
return (React__default["default"].createElement(SubotInlineContext.Provider, { value: value },
|
|
1179
1174
|
React__default["default"].createElement("div", { ref: ref }, children)));
|
|
1180
1175
|
};
|
|
1181
1176
|
|
|
@@ -1679,7 +1674,7 @@ const Container$u = () => {
|
|
|
1679
1674
|
var _a, _b, _c;
|
|
1680
1675
|
const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
1681
1676
|
const currentUrl = useCurrentUrl();
|
|
1682
|
-
const { listNodes, activeId, isShowFooter, onNext, onPrev, params, onStartOver, loading, } = React.useContext(SubotInlineContext
|
|
1677
|
+
const { listNodes, activeId, isShowFooter, onNext, onPrev, params, onStartOver, loading, } = React.useContext(SubotInlineContext);
|
|
1683
1678
|
const { value } = React.useContext(NodeContext);
|
|
1684
1679
|
const validation = useValidationMultiOption();
|
|
1685
1680
|
const botItem = listNodes[0];
|
|
@@ -2071,7 +2066,7 @@ const Container$s = ({ node, onClickStart }) => {
|
|
|
2071
2066
|
const refImpression = React.useRef(false);
|
|
2072
2067
|
const { ref, inView } = reactIntersectionObserver.useInView();
|
|
2073
2068
|
const currentUrl = useCurrentUrl();
|
|
2074
|
-
const { params, getParams, onNext, setIsShowFooter, listNodes } = React.useContext(SubotInlineContext
|
|
2069
|
+
const { params, getParams, onNext, setIsShowFooter, listNodes } = React.useContext(SubotInlineContext);
|
|
2075
2070
|
const botItem = listNodes[0];
|
|
2076
2071
|
const botType = (_a = botItem === null || botItem === void 0 ? void 0 : botItem.extra_settings) === null || _a === void 0 ? void 0 : _a.subot_type;
|
|
2077
2072
|
React.useMemo(() => {
|
|
@@ -2081,14 +2076,14 @@ const Container$s = ({ node, onClickStart }) => {
|
|
|
2081
2076
|
if (!inView || refImpression.current) {
|
|
2082
2077
|
return;
|
|
2083
2078
|
}
|
|
2084
|
-
subotInlineImpression
|
|
2079
|
+
subotInlineImpression(getParams());
|
|
2085
2080
|
refImpression.current = true;
|
|
2086
2081
|
}, [inView]);
|
|
2087
2082
|
const handleClickStart = () => {
|
|
2088
2083
|
// 1. Tracking Event Click
|
|
2089
2084
|
const params = getParams();
|
|
2090
2085
|
params.device_id = index$1.checkMobile(window.navigator.userAgent) ? 2 : 1;
|
|
2091
|
-
subotInlineClick
|
|
2086
|
+
subotInlineClick(params);
|
|
2092
2087
|
// 2. Call API to fetch next node
|
|
2093
2088
|
onNext();
|
|
2094
2089
|
onClickStart === null || onClickStart === void 0 ? void 0 : onClickStart();
|
|
@@ -2367,7 +2362,7 @@ const handleFrisoRedirecition = (listNode) => {
|
|
|
2367
2362
|
|
|
2368
2363
|
const Container$r = ({ intent }) => {
|
|
2369
2364
|
var _a;
|
|
2370
|
-
const { listNodes } = React.useContext(SubotInlineContext
|
|
2365
|
+
const { listNodes } = React.useContext(SubotInlineContext);
|
|
2371
2366
|
const handleOnClick = () => {
|
|
2372
2367
|
var _a;
|
|
2373
2368
|
if ((_a = intent.url) === null || _a === void 0 ? void 0 : _a.includes('{{.frisoRedirectUrl}}')) {
|
|
@@ -2423,7 +2418,7 @@ const Container$q = ({ intent }) => {
|
|
|
2423
2418
|
Container$q.displayName = 'SubotInlineIntentBotImage';
|
|
2424
2419
|
|
|
2425
2420
|
const Container$p = ({ intent, indexNumber }) => {
|
|
2426
|
-
const { listNodes } = React.useContext(SubotInlineContext
|
|
2421
|
+
const { listNodes } = React.useContext(SubotInlineContext);
|
|
2427
2422
|
const isShowLabel = ![index$2.NodeIntentType.SSO_INTENT].includes(intent === null || intent === void 0 ? void 0 : intent.type);
|
|
2428
2423
|
const isText = [
|
|
2429
2424
|
index$2.NodeIntentType.BOT_TEXT,
|
|
@@ -2457,7 +2452,7 @@ Container$p.displayName = 'SubotInlineIntentBotTitle';
|
|
|
2457
2452
|
|
|
2458
2453
|
const Container$o = ({ intent }) => {
|
|
2459
2454
|
const currentUrl = useCurrentUrl();
|
|
2460
|
-
const { listNodes, activeId, params } = React.useContext(SubotInlineContext
|
|
2455
|
+
const { listNodes, activeId, params } = React.useContext(SubotInlineContext);
|
|
2461
2456
|
const foundNode = listNodes.find((n) => n.id == activeId);
|
|
2462
2457
|
if (!intent.label || !foundNode) {
|
|
2463
2458
|
return null;
|
|
@@ -2798,7 +2793,7 @@ const StyledWrap$e = styled__default["default"].div `
|
|
|
2798
2793
|
`;
|
|
2799
2794
|
|
|
2800
2795
|
const Container$k = ({ intent }) => {
|
|
2801
|
-
const { listNodes } = React.useContext(SubotInlineContext
|
|
2796
|
+
const { listNodes } = React.useContext(SubotInlineContext);
|
|
2802
2797
|
if (!(intent === null || intent === void 0 ? void 0 : intent.label)) {
|
|
2803
2798
|
return null;
|
|
2804
2799
|
}
|
|
@@ -2859,15 +2854,15 @@ const Container$j = ({ intent }) => {
|
|
|
2859
2854
|
};
|
|
2860
2855
|
Container$j.displayName = 'SubotInlineIntentSSO';
|
|
2861
2856
|
|
|
2862
|
-
var _a$
|
|
2863
|
-
const SubotInlineIntentCol
|
|
2857
|
+
var _a$1;
|
|
2858
|
+
const SubotInlineIntentCol = styled__default["default"].div `
|
|
2864
2859
|
width: ${({ width }) => width || '100%'};
|
|
2865
2860
|
padding: 4px;
|
|
2866
2861
|
${utils.MediaQueries.mbDown} {
|
|
2867
2862
|
width: 100%;
|
|
2868
2863
|
}
|
|
2869
2864
|
`;
|
|
2870
|
-
const SubotInlineIntentUrlContainer
|
|
2865
|
+
const SubotInlineIntentUrlContainer = styled__default["default"].div `
|
|
2871
2866
|
display: flex;
|
|
2872
2867
|
.feature {
|
|
2873
2868
|
width: 30%;
|
|
@@ -2895,7 +2890,7 @@ const SubotInlineIntentUrlContainer$1 = styled__default["default"].div `
|
|
|
2895
2890
|
margin-left: 10px;
|
|
2896
2891
|
line-height: 1.5;
|
|
2897
2892
|
a {
|
|
2898
|
-
color: ${((_a$
|
|
2893
|
+
color: ${((_a$1 = miscTheme.theme === null || miscTheme.theme === void 0 ? void 0 : miscTheme.theme.colors) === null || _a$1 === void 0 ? void 0 : _a$1.gray800) || '#262626'};
|
|
2899
2894
|
text-decoration: none;
|
|
2900
2895
|
}
|
|
2901
2896
|
}
|
|
@@ -2905,8 +2900,8 @@ const Container$i = ({ intent, }) => {
|
|
|
2905
2900
|
const article = React.useMemo(() => intent.label.includes('{')
|
|
2906
2901
|
? JSON.parse(intent.label)
|
|
2907
2902
|
: {}, [intent.label]);
|
|
2908
|
-
return (React__default["default"].createElement(React__default["default"].Fragment, null, !!Object.keys(article).length && (React__default["default"].createElement(SubotInlineIntentCol
|
|
2909
|
-
React__default["default"].createElement(SubotInlineIntentUrlContainer
|
|
2903
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null, !!Object.keys(article).length && (React__default["default"].createElement(SubotInlineIntentCol, null,
|
|
2904
|
+
React__default["default"].createElement(SubotInlineIntentUrlContainer, null,
|
|
2910
2905
|
React__default["default"].createElement("div", { className: "feature" },
|
|
2911
2906
|
React__default["default"].createElement("a", { href: article === null || article === void 0 ? void 0 : article.url, className: "feature-wrapper" },
|
|
2912
2907
|
React__default["default"].createElement("img", { loading: "lazy", src: article === null || article === void 0 ? void 0 : article.thumbnail, alt: article === null || article === void 0 ? void 0 : article.title, className: "feature-img" }))),
|
|
@@ -2943,7 +2938,7 @@ const SubotInlineIntentBaseTarget = {
|
|
|
2943
2938
|
/** intents fake for sso block */
|
|
2944
2939
|
[index$2.NodeIntentType.SSO_INTENT]: Container$j,
|
|
2945
2940
|
};
|
|
2946
|
-
const SubotInlineIntentBase
|
|
2941
|
+
const SubotInlineIntentBase = new Proxy(SubotInlineIntentBaseTarget, {
|
|
2947
2942
|
get(_, prop) {
|
|
2948
2943
|
const UnknowComponent = () => {
|
|
2949
2944
|
if (constantsIsProduction.isProduction)
|
|
@@ -2970,7 +2965,7 @@ const Container$h = ({ intents: intentsProp, indexNumber, }) => {
|
|
|
2970
2965
|
const intentType = (intent === null || intent === void 0 ? void 0 : intent.type) || '';
|
|
2971
2966
|
if (excludeIntents.includes(intentType))
|
|
2972
2967
|
return null;
|
|
2973
|
-
const NodeIntent = SubotInlineIntentBase
|
|
2968
|
+
const NodeIntent = SubotInlineIntentBase[intentType];
|
|
2974
2969
|
return NodeIntent && React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent });
|
|
2975
2970
|
})))));
|
|
2976
2971
|
};
|
|
@@ -2978,7 +2973,7 @@ Container$h.displayName = 'SubotInlineIntent';
|
|
|
2978
2973
|
|
|
2979
2974
|
const Container$g = ({ node }) => {
|
|
2980
2975
|
var _a, _b;
|
|
2981
|
-
const { setIsShowFooter, listNodes } = React.useContext(SubotInlineContext
|
|
2976
|
+
const { setIsShowFooter, listNodes } = React.useContext(SubotInlineContext);
|
|
2982
2977
|
const botItem = listNodes[0];
|
|
2983
2978
|
React.useMemo(() => {
|
|
2984
2979
|
setIsShowFooter(true);
|
|
@@ -3169,7 +3164,7 @@ const SubInlineIntent = ({ subIntents }) => {
|
|
|
3169
3164
|
React__default["default"].createElement(ChevronDown, { className: "si-chevron-down" })),
|
|
3170
3165
|
React__default["default"].createElement(framerMotion.motion.div, { className: "si-sub-intent-expand", animate: isShow ? { height: 'auto' } : { height: 0 }, transition: { duration: 0.3 }, "data-show": isShow }, restSubIntents.map((intent) => {
|
|
3171
3166
|
const intentType = (intent === null || intent === void 0 ? void 0 : intent.type) || '';
|
|
3172
|
-
const NodeIntent = SubotInlineIntentBase
|
|
3167
|
+
const NodeIntent = SubotInlineIntentBase[intentType];
|
|
3173
3168
|
return NodeIntent && React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent });
|
|
3174
3169
|
}))));
|
|
3175
3170
|
};
|
|
@@ -3180,7 +3175,7 @@ const Container$f = ({ node }) => {
|
|
|
3180
3175
|
// const isMobile = useGetIsMobile(true)
|
|
3181
3176
|
const refMainIntents = React.useRef(null);
|
|
3182
3177
|
const { formatMessage: f } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
3183
|
-
const { setIsShowFooter, listNodes } = React.useContext(SubotInlineContext
|
|
3178
|
+
const { setIsShowFooter, listNodes } = React.useContext(SubotInlineContext);
|
|
3184
3179
|
const [isShowMore, setIsShowMore] = React.useState(false);
|
|
3185
3180
|
React.useEffect(() => {
|
|
3186
3181
|
var _a;
|
|
@@ -3285,11 +3280,11 @@ const Container$f = ({ node }) => {
|
|
|
3285
3280
|
defaultMessage: 'See more',
|
|
3286
3281
|
}))),
|
|
3287
3282
|
React__default["default"].createElement("div", { className: "wrap-main-button-intent" }, (_a = [...mainButtonIntents, ...bookingButtonIntents]) === null || _a === void 0 ? void 0 : _a.map((intent) => {
|
|
3288
|
-
const NodeIntent = SubotInlineIntentBase
|
|
3283
|
+
const NodeIntent = SubotInlineIntentBase[intent.type || ''];
|
|
3289
3284
|
return NodeIntent && React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent });
|
|
3290
3285
|
})),
|
|
3291
3286
|
(suggestedServiceIntents === null || suggestedServiceIntents === void 0 ? void 0 : suggestedServiceIntents.length) > 0 && (React__default["default"].createElement("div", null, suggestedServiceIntents.map((intent) => {
|
|
3292
|
-
const NodeIntent = SubotInlineIntentBase
|
|
3287
|
+
const NodeIntent = SubotInlineIntentBase[intent.type || ''];
|
|
3293
3288
|
return NodeIntent && React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent });
|
|
3294
3289
|
}))),
|
|
3295
3290
|
(relatedArticleIntents === null || relatedArticleIntents === void 0 ? void 0 : relatedArticleIntents.length) > 0 && (React__default["default"].createElement("div", { style: { marginTop: 24 } },
|
|
@@ -3298,7 +3293,7 @@ const Container$f = ({ node }) => {
|
|
|
3298
3293
|
defaultMessage: 'Related Articles',
|
|
3299
3294
|
})),
|
|
3300
3295
|
React__default["default"].createElement("div", { style: { padding: '8px 0' } }, relatedArticleIntents.map((intent) => {
|
|
3301
|
-
const NodeIntent = SubotInlineIntentBase
|
|
3296
|
+
const NodeIntent = SubotInlineIntentBase[intent.type || ''];
|
|
3302
3297
|
return (NodeIntent && React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent }));
|
|
3303
3298
|
})))),
|
|
3304
3299
|
React__default["default"].createElement(SubInlineIntent, { subIntents: subIntents })));
|
|
@@ -3312,7 +3307,7 @@ const StyledWrap$b = styled__default["default"].div `
|
|
|
3312
3307
|
`;
|
|
3313
3308
|
|
|
3314
3309
|
const Container$e = ({ node }) => {
|
|
3315
|
-
const { params, onNext, setIsShowFooter } = React.useContext(SubotInlineContext
|
|
3310
|
+
const { params, onNext, setIsShowFooter } = React.useContext(SubotInlineContext);
|
|
3316
3311
|
React.useMemo(() => {
|
|
3317
3312
|
setIsShowFooter(true);
|
|
3318
3313
|
}, []);
|
|
@@ -3724,7 +3719,7 @@ const CountDown = ({ onFinish, onClick, isFinished, resendLabel, className }, re
|
|
|
3724
3719
|
};
|
|
3725
3720
|
var CountDown$1 = React.forwardRef(CountDown);
|
|
3726
3721
|
|
|
3727
|
-
|
|
3722
|
+
styled__default["default"].div `
|
|
3728
3723
|
margin: 0 auto;
|
|
3729
3724
|
background: #f7f9fc;
|
|
3730
3725
|
border-radius: ${miscTheme.theme.borderRadius};
|
|
@@ -4656,7 +4651,7 @@ const OTP_VERIFIED_MSG_CODE = {
|
|
|
4656
4651
|
},
|
|
4657
4652
|
};
|
|
4658
4653
|
|
|
4659
|
-
var _a
|
|
4654
|
+
var _a, _b, _c, _d, _e;
|
|
4660
4655
|
const StyledPhoneCode = styled__default["default"].div `
|
|
4661
4656
|
display: flex;
|
|
4662
4657
|
align-items: center;
|
|
@@ -4668,21 +4663,21 @@ const StyledPhoneCode = styled__default["default"].div `
|
|
|
4668
4663
|
border-radius: 2px;
|
|
4669
4664
|
}
|
|
4670
4665
|
> div {
|
|
4671
|
-
color: ${((_a
|
|
4666
|
+
color: ${((_a = miscTheme.theme.colors) === null || _a === void 0 ? void 0 : _a.gray800) || ''};
|
|
4672
4667
|
white-space: nowrap;
|
|
4673
4668
|
}
|
|
4674
4669
|
`;
|
|
4675
4670
|
styled__default["default"](PhoneInputBase__default["default"]) `
|
|
4676
4671
|
display: flex;
|
|
4677
|
-
border: 1px solid ${((_b
|
|
4672
|
+
border: 1px solid ${((_b = miscTheme.theme.colors) === null || _b === void 0 ? void 0 : _b.gray200) || ''};
|
|
4678
4673
|
border-radius: ${miscTheme.theme === null || miscTheme.theme === void 0 ? void 0 : miscTheme.theme.borderRadius};
|
|
4679
4674
|
.PhoneInputCountry {
|
|
4680
4675
|
position: relative;
|
|
4681
4676
|
padding: 12px 8px 12px 16px;
|
|
4682
|
-
border-right: 1px solid ${((_c
|
|
4683
|
-
background-color: ${((_d
|
|
4677
|
+
border-right: 1px solid ${((_c = miscTheme.theme.colors) === null || _c === void 0 ? void 0 : _c.gray200) || ''};
|
|
4678
|
+
background-color: ${((_d = miscTheme.theme.colors) === null || _d === void 0 ? void 0 : _d.gray100) || ''};
|
|
4684
4679
|
border-radius: 6px 0 0 6px;
|
|
4685
|
-
color: ${((_e
|
|
4680
|
+
color: ${((_e = miscTheme.theme.colors) === null || _e === void 0 ? void 0 : _e.gray800) || ''};
|
|
4686
4681
|
.PhoneInputCountrySelect {
|
|
4687
4682
|
position: absolute;
|
|
4688
4683
|
top: 0;
|
|
@@ -5519,14 +5514,14 @@ const StyledWrap$a = styled__default["default"].div `
|
|
|
5519
5514
|
const Container$d = ({ node, indexNumber }) => {
|
|
5520
5515
|
var _a;
|
|
5521
5516
|
const locale = togetherComponentGlobalContext.GlobalData === null || togetherComponentGlobalContext.GlobalData === void 0 ? void 0 : togetherComponentGlobalContext.GlobalData.locale;
|
|
5522
|
-
const { params, listNodes, activeId, onSubmit, setIsShowFooter } = React.useContext(SubotInlineContext
|
|
5517
|
+
const { params, listNodes, activeId, onSubmit, setIsShowFooter } = React.useContext(SubotInlineContext);
|
|
5523
5518
|
React.useMemo(() => {
|
|
5524
5519
|
setIsShowFooter(true);
|
|
5525
5520
|
}, []);
|
|
5526
5521
|
const handleSubmit = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
5527
5522
|
checkSyncDataOnFrisoCampaign(listNodes[0], data.form_submit_meta);
|
|
5528
5523
|
const _message = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, params), node._message), data), getCurrentTotalDynamicScore(listNodes, activeId, data.action_id, data.form_submit_meta)), { node_id: node.id });
|
|
5529
|
-
const res = yield subotInlineMessage
|
|
5524
|
+
const res = yield subotInlineMessage(_message);
|
|
5530
5525
|
// asking
|
|
5531
5526
|
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
5532
5527
|
const _b = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _b, restData = tslib_es6.__rest(_b, ["node"]);
|
|
@@ -5691,7 +5686,7 @@ const StyledWrap$7 = styled__default["default"].div `
|
|
|
5691
5686
|
`;
|
|
5692
5687
|
const Container$c = ({ action, active, onChange, htmlType, }) => {
|
|
5693
5688
|
const currentUrl = useCurrentUrl();
|
|
5694
|
-
const { params } = React.useContext(SubotInlineContext
|
|
5689
|
+
const { params } = React.useContext(SubotInlineContext);
|
|
5695
5690
|
return (React__default["default"].createElement(StyledWrap$7, { className: "si-action-img-choice", onClick: () => onChange && onChange(action), active: !!active, "data-event-category": "Service Connection", "data-event-action": "Risk Screening Answer Click", "data-event-label": currentUrl, "data-bot-id": params.bot_id },
|
|
5696
5691
|
React__default["default"].createElement("div", { className: "si-action-image-wrap" },
|
|
5697
5692
|
React__default["default"].createElement("img", { loading: "lazy", src: action === null || action === void 0 ? void 0 : action.url, alt: action === null || action === void 0 ? void 0 : action.label })),
|
|
@@ -5707,7 +5702,7 @@ const StyledWrap$6 = styled__default["default"].div `
|
|
|
5707
5702
|
`;
|
|
5708
5703
|
const Container$b = ({ action, onChange }) => {
|
|
5709
5704
|
const currentUrl = useCurrentUrl();
|
|
5710
|
-
const { params, activeId } = React.useContext(SubotInlineContext
|
|
5705
|
+
const { params, activeId } = React.useContext(SubotInlineContext);
|
|
5711
5706
|
return (React__default["default"].createElement(StyledWrap$6, null,
|
|
5712
5707
|
React__default["default"].createElement(index$4.Button, { onClick: () => onChange && onChange(action), size: "lg", "data-event-category": "Service Connection", "data-event-action": "Risk Screening Sign Up for Result", "data-event-label": currentUrl, "data-bot-id": params.bot_id, "data-event-question-id": activeId, styles: {
|
|
5713
5708
|
root: {
|
|
@@ -5769,7 +5764,7 @@ const Container$a = ({ action, onChange, active, htmlType, formSubmitMeta, }) =>
|
|
|
5769
5764
|
const currentUrl = useCurrentUrl();
|
|
5770
5765
|
const inputRef = React.useRef(null);
|
|
5771
5766
|
const [otherText, setOtherText] = React.useState('');
|
|
5772
|
-
const { params } = React.useContext(SubotInlineContext
|
|
5767
|
+
const { params } = React.useContext(SubotInlineContext);
|
|
5773
5768
|
const isActionPollWithOther = (action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.POLL_CHOICE_TEXT_BY_INPUT;
|
|
5774
5769
|
const isActionSelectWithOther = (action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.USER_CHOICE_TEXT_BY_INPUT ||
|
|
5775
5770
|
isActionPollWithOther;
|
|
@@ -5853,7 +5848,7 @@ const SubotInlineActionBaseTarget = {
|
|
|
5853
5848
|
// [NodeActionType.RESULT_BUTTON]: SubotInlineActionTextChoice,
|
|
5854
5849
|
// [NodeActionType.POLL_RESULT]: SubotInlinePollResult,
|
|
5855
5850
|
};
|
|
5856
|
-
const SubotInlineActionBase
|
|
5851
|
+
const SubotInlineActionBase = new Proxy(SubotInlineActionBaseTarget, {
|
|
5857
5852
|
get(_, prop) {
|
|
5858
5853
|
const UnknowComponent = () => {
|
|
5859
5854
|
if (constantsIsProduction.isProduction)
|
|
@@ -5884,14 +5879,14 @@ const Container$7 = ({ actions, value, onChange, htmlType, node_type, formSubmit
|
|
|
5884
5879
|
const actionType = action.type;
|
|
5885
5880
|
if (excludeActions.includes(actionType))
|
|
5886
5881
|
return null;
|
|
5887
|
-
const NodeAction = SubotInlineActionBase
|
|
5882
|
+
const NodeAction = SubotInlineActionBase[action.type];
|
|
5888
5883
|
return (NodeAction && (React__default["default"].createElement(NodeAction, { key: action.id, action: action, onChange: onChange, active: value === null || value === void 0 ? void 0 : value.includes(action.id), htmlType: htmlType, formSubmitMeta: formSubmitMeta })));
|
|
5889
5884
|
})));
|
|
5890
5885
|
};
|
|
5891
5886
|
Container$7.displayName = 'SubotInlineAction';
|
|
5892
5887
|
|
|
5893
5888
|
const Container$6 = ({ node, indexNumber }) => {
|
|
5894
|
-
const { params, listNodes, activeId, onSubmit, setIsShowFooter, setLoading } = React.useContext(SubotInlineContext
|
|
5889
|
+
const { params, listNodes, activeId, onSubmit, setIsShowFooter, setLoading } = React.useContext(SubotInlineContext);
|
|
5895
5890
|
const { value, setValue } = React.useContext(NodeContext);
|
|
5896
5891
|
React.useMemo(() => {
|
|
5897
5892
|
setIsShowFooter(true);
|
|
@@ -5906,7 +5901,7 @@ const Container$6 = ({ node, indexNumber }) => {
|
|
|
5906
5901
|
setValue(Object.assign(Object.assign({}, value), { action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key }));
|
|
5907
5902
|
const newParams = Object.assign(Object.assign(Object.assign(Object.assign({}, params), value), { node_id: node.id, action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key }), getCurrentTotalDynamicScore(listNodes, activeId, action.id));
|
|
5908
5903
|
setLoading(true);
|
|
5909
|
-
const res = yield subotInlineMessage
|
|
5904
|
+
const res = yield subotInlineMessage(newParams);
|
|
5910
5905
|
setLoading(false);
|
|
5911
5906
|
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
5912
5907
|
const _a = res === null || res === void 0 ? void 0 : res._data, { node } = _a, restData = tslib_es6.__rest(_a, ["node"]);
|
|
@@ -5931,7 +5926,7 @@ const StyledWrap$3 = styled__default["default"].div `
|
|
|
5931
5926
|
|
|
5932
5927
|
const Container$5 = ({ node, indexNumber }) => {
|
|
5933
5928
|
var _a;
|
|
5934
|
-
const { setIsShowFooter, onChange } = React.useContext(SubotInlineContext
|
|
5929
|
+
const { setIsShowFooter, onChange } = React.useContext(SubotInlineContext);
|
|
5935
5930
|
const { value, setValue } = React.useContext(NodeContext);
|
|
5936
5931
|
React.useMemo(() => {
|
|
5937
5932
|
setIsShowFooter(true);
|
|
@@ -6043,7 +6038,7 @@ const StyledWrap$2 = styled__default["default"].div `
|
|
|
6043
6038
|
`;
|
|
6044
6039
|
|
|
6045
6040
|
const Container$4 = ({ node, indexNumber }) => {
|
|
6046
|
-
const { onChange, setIsShowFooter } = React.useContext(SubotInlineContext
|
|
6041
|
+
const { onChange, setIsShowFooter } = React.useContext(SubotInlineContext);
|
|
6047
6042
|
const { value, setValue } = React.useContext(NodeContext);
|
|
6048
6043
|
const descriptionNode = useDescriptionPollNode({ node });
|
|
6049
6044
|
React.useMemo(() => {
|
|
@@ -6118,7 +6113,7 @@ const StyledWrap$1 = styled__default["default"].div ``;
|
|
|
6118
6113
|
const Container$3 = ({ node }) => {
|
|
6119
6114
|
const refIsTrigger = React.useRef(false);
|
|
6120
6115
|
const { formatMessage: f, data: { userInfo }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
6121
|
-
const { params, setIsShowFooter, listNodes, activeId } = React.useContext(SubotInlineContext
|
|
6116
|
+
const { params, setIsShowFooter, listNodes, activeId } = React.useContext(SubotInlineContext);
|
|
6122
6117
|
React.useMemo(() => {
|
|
6123
6118
|
setIsShowFooter(true);
|
|
6124
6119
|
}, []);
|
|
@@ -6180,7 +6175,7 @@ const StyledWrap = styled__default["default"].div `
|
|
|
6180
6175
|
`;
|
|
6181
6176
|
|
|
6182
6177
|
const Container$2 = ({ node, indexNumber }) => {
|
|
6183
|
-
const { params, onSubmit, setIsShowFooter, listNodes, activeId, setLoading, onChange, } = React.useContext(SubotInlineContext
|
|
6178
|
+
const { params, onSubmit, setIsShowFooter, listNodes, activeId, setLoading, onChange, } = React.useContext(SubotInlineContext);
|
|
6184
6179
|
const { value, setValue } = React.useContext(NodeContext);
|
|
6185
6180
|
React.useMemo(() => {
|
|
6186
6181
|
setIsShowFooter(true);
|
|
@@ -6196,7 +6191,7 @@ const Container$2 = ({ node, indexNumber }) => {
|
|
|
6196
6191
|
const handleOnChangeNormal = (action) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
6197
6192
|
const newParams = Object.assign(Object.assign(Object.assign(Object.assign({}, params), value), { node_id: node.id, action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key, form_submit_meta: undefined }), getCurrentTotalDynamicScore(listNodes, activeId, action.id));
|
|
6198
6193
|
setLoading(true);
|
|
6199
|
-
const res = yield subotInlineMessage
|
|
6194
|
+
const res = yield subotInlineMessage(newParams);
|
|
6200
6195
|
setLoading(false);
|
|
6201
6196
|
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
6202
6197
|
const _a = res === null || res === void 0 ? void 0 : res._data, { node } = _a, restData = tslib_es6.__rest(_a, ["node"]);
|
|
@@ -6244,7 +6239,7 @@ const SubotInlineNodeBaseTarget = {
|
|
|
6244
6239
|
// RESULT_RATING = 12,
|
|
6245
6240
|
// RESULT_REACTION = 13,
|
|
6246
6241
|
};
|
|
6247
|
-
const SubotInlineNodeBase
|
|
6242
|
+
const SubotInlineNodeBase = new Proxy(SubotInlineNodeBaseTarget, {
|
|
6248
6243
|
get(_, prop) {
|
|
6249
6244
|
const UnknowComponent = () => {
|
|
6250
6245
|
if (constantsIsProduction.isProduction)
|
|
@@ -6259,7 +6254,7 @@ const SubotInlineNodeBase$1 = new Proxy(SubotInlineNodeBaseTarget, {
|
|
|
6259
6254
|
|
|
6260
6255
|
const Container$1 = ({ onClickStart }) => {
|
|
6261
6256
|
var _a;
|
|
6262
|
-
const { listNodes, activeId, isDisabledAnimationOnMobile } = React.useContext(SubotInlineContext
|
|
6257
|
+
const { listNodes, activeId, isDisabledAnimationOnMobile } = React.useContext(SubotInlineContext);
|
|
6263
6258
|
const foundIdx = React.useMemo(() => {
|
|
6264
6259
|
return listNodes.findIndex((n) => n.id == activeId);
|
|
6265
6260
|
}, [listNodes, activeId]);
|
|
@@ -6280,10 +6275,10 @@ const Container$1 = ({ onClickStart }) => {
|
|
|
6280
6275
|
const nodeType = index$2.NodeType[node.type].valueOf();
|
|
6281
6276
|
const nodeTypeSSO = (_a = index$2.NodePosition[node.position]) === null || _a === void 0 ? void 0 : _a.valueOf();
|
|
6282
6277
|
let NodeComponent = node.position === index$2.NodePosition.SSO
|
|
6283
|
-
? SubotInlineNodeBase
|
|
6284
|
-
: SubotInlineNodeBase
|
|
6278
|
+
? SubotInlineNodeBase[nodeTypeSSO]
|
|
6279
|
+
: SubotInlineNodeBase[nodeType];
|
|
6285
6280
|
if (node.is_multi_select && node.type !== index$2.NodeType.POLL) {
|
|
6286
|
-
NodeComponent = SubotInlineNodeBase
|
|
6281
|
+
NodeComponent = SubotInlineNodeBase['MULTIPLE'];
|
|
6287
6282
|
}
|
|
6288
6283
|
return (React__default["default"].createElement(framerMotion.motion.div, { key: node.id, initial: { opacity: 1, y: -300 }, animate: { opacity: 1, y: 0 }, transition: {
|
|
6289
6284
|
y: { type: 'spring', stiffness: 300, damping: 30 },
|
|
@@ -6321,7 +6316,7 @@ const View = ({ loading, backgroundImage, isShowFooter, isFullContainer, isDisab
|
|
|
6321
6316
|
backgroundRepeat: 'no-repeat',
|
|
6322
6317
|
backgroundPosition: 'center',
|
|
6323
6318
|
}), [backgroundImage]);
|
|
6324
|
-
const { isMobile, locale } = React.useContext(SubotInlineContext
|
|
6319
|
+
const { isMobile, locale } = React.useContext(SubotInlineContext);
|
|
6325
6320
|
const [isDisplayFullMobile, setIsDisplayFullMobile] = React.useState(false);
|
|
6326
6321
|
React.useEffect(() => {
|
|
6327
6322
|
if (isDisplayFullMobile) {
|
|
@@ -6384,7 +6379,7 @@ const ViewWithMemo = React.memo(View);
|
|
|
6384
6379
|
ViewWithMemo.displayName = 'SubotInlineRevampView';
|
|
6385
6380
|
|
|
6386
6381
|
const Container = () => {
|
|
6387
|
-
const { loading, listNodes, isShowFooter, activeId, isFullContainer, isDisabledAnimationOnMobile, onCloseMobile, userInfo, bgImgFullContainer, typeFormProps, } = React.useContext(SubotInlineContext
|
|
6382
|
+
const { loading, listNodes, isShowFooter, activeId, isFullContainer, isDisabledAnimationOnMobile, onCloseMobile, userInfo, bgImgFullContainer, typeFormProps, } = React.useContext(SubotInlineContext);
|
|
6388
6383
|
const backgroundImage = React.useMemo(() => {
|
|
6389
6384
|
var _a, _b;
|
|
6390
6385
|
const foundNode = listNodes.find((n) => n.id == activeId);
|
|
@@ -6441,3155 +6436,6 @@ const SubotInlineRevampWithTheme = (props) => {
|
|
|
6441
6436
|
return (React__default["default"].createElement(ContainerWithProvider, Object.assign({}, props, { primaryColor: (_b = (_a = botData.extra_settings) === null || _a === void 0 ? void 0 : _a.inline_styles) === null || _b === void 0 ? void 0 : _b.primary_color, textColor: (_d = (_c = botData.extra_settings) === null || _c === void 0 ? void 0 : _c.inline_styles) === null || _d === void 0 ? void 0 : _d.text_color, textButtonColor: (_f = (_e = botData.extra_settings) === null || _e === void 0 ? void 0 : _e.inline_styles) === null || _f === void 0 ? void 0 : _f.text_button_color, bgColor: (_h = (_g = botData.extra_settings) === null || _g === void 0 ? void 0 : _g.inline_styles) === null || _h === void 0 ? void 0 : _h.container_bg_color, bgContentColor: (_k = (_j = botData.extra_settings) === null || _j === void 0 ? void 0 : _j.inline_styles) === null || _k === void 0 ? void 0 : _k.content_bg_color, bgImgFullContainer: (_m = (_l = botData.extra_settings) === null || _l === void 0 ? void 0 : _l.inline_styles) === null || _m === void 0 ? void 0 : _m.container_bg_image })));
|
|
6442
6437
|
};
|
|
6443
6438
|
|
|
6444
|
-
const SubotInlineContext = React.createContext({
|
|
6445
|
-
activeId: '',
|
|
6446
|
-
params: {},
|
|
6447
|
-
nodes: [],
|
|
6448
|
-
getParams: () => ({}),
|
|
6449
|
-
trackingCommonInline: {},
|
|
6450
|
-
});
|
|
6451
|
-
/** inline click */
|
|
6452
|
-
const subotInlineClick = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
6453
|
-
try {
|
|
6454
|
-
return yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.GET_INLINE_CLICK), 'POST', {
|
|
6455
|
-
data,
|
|
6456
|
-
});
|
|
6457
|
-
}
|
|
6458
|
-
catch (error) { }
|
|
6459
|
-
});
|
|
6460
|
-
/** inline impression */
|
|
6461
|
-
const subotInlineImpression = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
6462
|
-
try {
|
|
6463
|
-
return yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.GET_INLINE_IMPRESSION), 'POST', {
|
|
6464
|
-
data,
|
|
6465
|
-
});
|
|
6466
|
-
}
|
|
6467
|
-
catch (error) { }
|
|
6468
|
-
});
|
|
6469
|
-
/** inline message */
|
|
6470
|
-
const subotInlineMessage = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
6471
|
-
try {
|
|
6472
|
-
return yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.GET_INLINE_MESSAGE), 'POST', {
|
|
6473
|
-
data,
|
|
6474
|
-
});
|
|
6475
|
-
}
|
|
6476
|
-
catch (error) { }
|
|
6477
|
-
});
|
|
6478
|
-
const computeExtraSettingsForBot = (data) => {
|
|
6479
|
-
var _a;
|
|
6480
|
-
if ((data === null || data === void 0 ? void 0 : data._status) === 1 && ((_a = data === null || data === void 0 ? void 0 : data._data) === null || _a === void 0 ? void 0 : _a.extra_settings)) {
|
|
6481
|
-
try {
|
|
6482
|
-
const extraSettingsObj = JSON.parse(data._data.extra_settings);
|
|
6483
|
-
if (typeof extraSettingsObj === 'object') {
|
|
6484
|
-
data._data.extra_settings = extraSettingsObj;
|
|
6485
|
-
}
|
|
6486
|
-
else {
|
|
6487
|
-
data._data.extra_settings = {
|
|
6488
|
-
sync_data_friso_campaign: false,
|
|
6489
|
-
};
|
|
6490
|
-
}
|
|
6491
|
-
}
|
|
6492
|
-
catch (err) {
|
|
6493
|
-
data._data.extra_settings = {
|
|
6494
|
-
sync_data_friso_campaign: false,
|
|
6495
|
-
};
|
|
6496
|
-
}
|
|
6497
|
-
}
|
|
6498
|
-
return data;
|
|
6499
|
-
};
|
|
6500
|
-
/** inline first node */
|
|
6501
|
-
const subotInlineFirstNode = (id) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
6502
|
-
try {
|
|
6503
|
-
const data = yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.GET_INLINE_FIRST_NODE) + `/${id}`, 'GET');
|
|
6504
|
-
computeExtraSettingsForBot(data);
|
|
6505
|
-
return data;
|
|
6506
|
-
}
|
|
6507
|
-
catch (error) { }
|
|
6508
|
-
});
|
|
6509
|
-
|
|
6510
|
-
const SubotInlineFormContainer = styled__default["default"].div `
|
|
6511
|
-
margin-top: 2rem;
|
|
6512
|
-
.form {
|
|
6513
|
-
background-color: ${miscTheme.theme.colors.white || '#fff'};
|
|
6514
|
-
}
|
|
6515
|
-
`;
|
|
6516
|
-
const SubotInlineIntentContainer = styled__default["default"].div ``;
|
|
6517
|
-
const SubotInlineActionContainer = styled__default["default"].div `
|
|
6518
|
-
margin-top: 1.25rem;
|
|
6519
|
-
`;
|
|
6520
|
-
const SubotInlineReviewContainer = styled__default["default"].div `
|
|
6521
|
-
margin-bottom: 1rem;
|
|
6522
|
-
`;
|
|
6523
|
-
const SubotInlineDescription$1 = styled__default["default"].div `
|
|
6524
|
-
font-weight: 400;
|
|
6525
|
-
font-size: 16px;
|
|
6526
|
-
line-height: 24px;
|
|
6527
|
-
color: #595959;
|
|
6528
|
-
font-style: italic;
|
|
6529
|
-
`;
|
|
6530
|
-
const SubotInlineFinalButton = styled__default["default"](index$8.Button) `
|
|
6531
|
-
position: relative;
|
|
6532
|
-
min-width: 180px;
|
|
6533
|
-
svg {
|
|
6534
|
-
path {
|
|
6535
|
-
stroke: currentColor;
|
|
6536
|
-
}
|
|
6537
|
-
}
|
|
6538
|
-
&:hover {
|
|
6539
|
-
svg {
|
|
6540
|
-
path {
|
|
6541
|
-
stroke: currentColor;
|
|
6542
|
-
}
|
|
6543
|
-
}
|
|
6544
|
-
}
|
|
6545
|
-
`;
|
|
6546
|
-
const SubotInlineFinalMoreContainer = styled__default["default"].div `
|
|
6547
|
-
display: flex;
|
|
6548
|
-
align-items: center;
|
|
6549
|
-
justify-content: center;
|
|
6550
|
-
`;
|
|
6551
|
-
const SubotInlineFinalWrapper = styled__default["default"].div `
|
|
6552
|
-
position: relative;
|
|
6553
|
-
overflow: ${({ isMore }) => (isMore ? 'unset' : 'hidden')};
|
|
6554
|
-
max-height: ${({ maxHeight }) => (maxHeight ? maxHeight + 'px' : 'auto')};
|
|
6555
|
-
margin-bottom: 8px;
|
|
6556
|
-
transition: 0.25s all linear;
|
|
6557
|
-
&:before {
|
|
6558
|
-
position: absolute;
|
|
6559
|
-
z-index: 1;
|
|
6560
|
-
top: 50%;
|
|
6561
|
-
right: 0;
|
|
6562
|
-
bottom: 0;
|
|
6563
|
-
left: 0;
|
|
6564
|
-
background-image: linear-gradient(
|
|
6565
|
-
to top,
|
|
6566
|
-
${miscTheme.theme.colors.neutral50 || '#F7F9FC'} 0%,
|
|
6567
|
-
transparent 100%
|
|
6568
|
-
);
|
|
6569
|
-
content: '';
|
|
6570
|
-
pointer-events: none;
|
|
6571
|
-
${({ isMore }) => isMore && `opacity: 0;`}
|
|
6572
|
-
}
|
|
6573
|
-
`;
|
|
6574
|
-
const SubotInlineFinalContainer = styled__default["default"].div `
|
|
6575
|
-
position: relative;
|
|
6576
|
-
padding: 32px 32px 16px;
|
|
6577
|
-
background-color: ${miscTheme.theme.colors.neutral50 || '#F7F9FC'};
|
|
6578
|
-
border-radius: ${miscTheme.theme.borderRadius};
|
|
6579
|
-
${utils.MediaQueries.tdDown} {
|
|
6580
|
-
padding: 24px 24px 16px;
|
|
6581
|
-
}
|
|
6582
|
-
${utils.MediaQueries.mbDown} {
|
|
6583
|
-
padding: 16px;
|
|
6584
|
-
border-radius: 0px;
|
|
6585
|
-
}
|
|
6586
|
-
`;
|
|
6587
|
-
const SubotInlineWrapper$1 = styled__default["default"].div `
|
|
6588
|
-
padding: 12px 32px 32px;
|
|
6589
|
-
${utils.MediaQueries.tdDown} {
|
|
6590
|
-
padding: 12px 24px 24px;
|
|
6591
|
-
}
|
|
6592
|
-
${utils.MediaQueries.mbDown} {
|
|
6593
|
-
padding: 12px 16px 16px;
|
|
6594
|
-
}
|
|
6595
|
-
`;
|
|
6596
|
-
const SubotInlineContainer$1 = styled__default["default"].div `
|
|
6597
|
-
border: 1px solid ${miscTheme.theme.colors.neutral100 || '#E4E8EC'};
|
|
6598
|
-
background-color: ${miscTheme.theme.colors.neutral50 || '#F7F9FC'};
|
|
6599
|
-
border-radius: ${miscTheme.theme.borderRadius};
|
|
6600
|
-
${utils.MediaQueries.mbDown} {
|
|
6601
|
-
border: none;
|
|
6602
|
-
}
|
|
6603
|
-
`;
|
|
6604
|
-
|
|
6605
|
-
const CheckboxIcon = (props) => (React__default["default"].createElement("svg", Object.assign({ width: "22", height: "22", viewBox: "0 0 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
6606
|
-
React__default["default"].createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11 21C16.5228 21 21 16.5228 21 11C21 5.47715 16.5228 1 11 1C5.47715 1 1 5.47715 1 11C1 16.5228 5.47715 21 11 21Z", fill: "#2D87F3", stroke: "#2D87F3", strokeWidth: "2" }),
|
|
6607
|
-
React__default["default"].createElement("path", { d: "M15.5714 8L9.67857 14L7 11.2727", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })));
|
|
6608
|
-
|
|
6609
|
-
const CheckIcon = (props) => (React__default["default"].createElement("svg", Object.assign({ width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
6610
|
-
React__default["default"].createElement("path", { d: "M13.3346 4L6.0013 11.3333L2.66797 8", stroke: "#737373", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })));
|
|
6611
|
-
|
|
6612
|
-
const LikeIcon = (props) => (React__default["default"].createElement("svg", Object.assign({ width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
6613
|
-
React__default["default"].createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.0521 5.70293L11.8834 2L12.6635 2.03149C12.6635 2.03149 13.5407 2.05593 14.4487 2.51311C15.3568 2.9703 16.375 4.04935 16.375 5.69552C16.375 6.76085 16.1102 7.83874 15.8458 8.67047H20.125C21.1497 8.67047 22 9.53063 22 10.5673V12.8847C22 13.1046 21.9497 13.3294 21.8462 13.533L18.6437 19.9571C18.3261 20.5939 17.6767 21 16.9701 21H8.875C7.85025 21 7 20.1398 7 19.1031V10.0579C7 9.50164 7.24299 8.97147 7.66284 8.61119L11.0521 5.70293ZM13.4432 4.15712C13.4125 4.15279 13.3784 4.14799 13.3263 4.1321L12.7422 6.73842L8.875 10.0579V19.1031H16.9701L20.125 12.7717V10.5673H13.0864L13.6357 9.25027C13.6357 9.25027 14.5 7.01241 14.5 5.69552C14.5 4.74112 14.1119 4.46257 13.6138 4.21176C13.5294 4.16929 13.4902 4.16376 13.4432 4.15712Z", fill: "#595959" }),
|
|
6614
|
-
React__default["default"].createElement("path", { d: "M2 10.5C2 9.672 2.672 9 3.5 9C4.328 9 5 9.672 5 10.5V19.5C5 20.328 4.328 21 3.5 21C2.672 21 2 20.328 2 19.5V10.5Z", fill: "#595959" })));
|
|
6615
|
-
|
|
6616
|
-
const DislikeIcon = (props) => (React__default["default"].createElement("svg", Object.assign({ width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
6617
|
-
React__default["default"].createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.0521 17.2971L11.8834 21L12.6635 20.9685C12.6635 20.9685 13.5407 20.9441 14.4487 20.4869C15.3568 20.0297 16.375 18.9507 16.375 17.3045C16.375 16.2391 16.1102 15.1613 15.8458 14.3295H20.125C21.1497 14.3295 22 13.4694 22 12.4327V10.1153C22 9.89545 21.9497 9.6706 21.8462 9.467L18.6437 3.0429C18.3261 2.40607 17.6767 2 16.9701 2H8.875C7.85025 2 7 2.86016 7 3.89685V12.9421C7 13.4984 7.24299 14.0285 7.66284 14.3888L11.0521 17.2971ZM13.4432 18.8429C13.4125 18.8472 13.3784 18.852 13.3263 18.8679L12.7422 16.2616L8.875 12.9421V3.89685H16.9701L20.125 10.2283V12.4327H13.0864L13.6357 13.7497C13.6357 13.7497 14.5 15.9876 14.5 17.3045C14.5 18.2589 14.1119 18.5374 13.6138 18.7882C13.5294 18.8307 13.4902 18.8362 13.4432 18.8429Z", fill: "#595959" }),
|
|
6618
|
-
React__default["default"].createElement("path", { d: "M2 12.5C2 13.328 2.672 14 3.5 14C4.328 14 5 13.328 5 12.5V3.5C5 2.672 4.328 2 3.5 2C2.672 2 2 2.672 2 3.5V12.5Z", fill: "#595959" })));
|
|
6619
|
-
|
|
6620
|
-
const ArrowDown = (props) => (React__default["default"].createElement("svg", Object.assign({ width: "10", height: "6", viewBox: "0 0 10 6", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
6621
|
-
React__default["default"].createElement("path", { d: "M1 1L5 5L9 1", stroke: "#595959", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" })));
|
|
6622
|
-
|
|
6623
|
-
const ArrowLeft = (props) => (React__default["default"].createElement("svg", Object.assign({ width: "7", height: "10", viewBox: "0 0 7 10", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
6624
|
-
React__default["default"].createElement("path", { d: "M5.5 9L1.5 5L5.5 1", stroke: "#2D87F3", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" })));
|
|
6625
|
-
|
|
6626
|
-
const ArrowRight = (props) => (React__default["default"].createElement("svg", Object.assign({ width: "7", height: "10", viewBox: "0 0 7 10", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
6627
|
-
React__default["default"].createElement("path", { d: "M1.5 9L5.5 5L1.5 1", stroke: "#2D87F3", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" })));
|
|
6628
|
-
|
|
6629
|
-
const ArrowUp = (props) => (React__default["default"].createElement("svg", Object.assign({ width: "10", height: "6", viewBox: "0 0 10 6", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
6630
|
-
React__default["default"].createElement("path", { d: "M1 5L5 1L9 5", stroke: "#FC5D9A", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" })));
|
|
6631
|
-
|
|
6632
|
-
const ChevronRightActive = (props) => (React__default["default"].createElement("svg", Object.assign({ width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
6633
|
-
React__default["default"].createElement("path", { d: "M6 12L10 8L6 4", stroke: "#2D87F3", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })));
|
|
6634
|
-
|
|
6635
|
-
const RotateLeft = (props) => (React__default["default"].createElement("svg", Object.assign({ width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
6636
|
-
React__default["default"].createElement("g", { clipPath: "url(#clip0)" },
|
|
6637
|
-
React__default["default"].createElement("path", { d: "M0.666626 2.6665V6.6665H4.66663", stroke: "#737373", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
6638
|
-
React__default["default"].createElement("path", { d: "M2.33996 10.0001C2.77222 11.227 3.59152 12.2802 4.6744 13.001C5.75728 13.7218 7.04508 14.0712 8.34377 13.9964C9.64246 13.9217 10.8817 13.4269 11.8747 12.5866C12.8677 11.7464 13.5608 10.6061 13.8494 9.3377C14.1381 8.06929 14.0067 6.74143 13.475 5.55419C12.9434 4.36696 12.0403 3.38466 10.9018 2.7553C9.76339 2.12595 8.45123 1.88364 7.16308 2.06487C5.87493 2.24611 4.68057 2.84108 3.75996 3.76013L0.666626 6.6668", stroke: "#737373", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" })),
|
|
6639
|
-
React__default["default"].createElement("defs", null,
|
|
6640
|
-
React__default["default"].createElement("clipPath", { id: "clip0" },
|
|
6641
|
-
React__default["default"].createElement("rect", { width: "16", height: "16", fill: "white" })))));
|
|
6642
|
-
|
|
6643
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
6644
|
-
const SubotInlineButtonReaction = styled__default["default"].div `
|
|
6645
|
-
display: flex;
|
|
6646
|
-
align-items: center;
|
|
6647
|
-
justify-content: center;
|
|
6648
|
-
padding: 12px 24px;
|
|
6649
|
-
border: 1px solid ${miscTheme.theme.colors.neutral100 || '#E4E8EC'};
|
|
6650
|
-
background-color: ${miscTheme.theme.colors.white || 'white'};
|
|
6651
|
-
border-radius: 32px;
|
|
6652
|
-
cursor: pointer;
|
|
6653
|
-
transition: 0.25s all linear;
|
|
6654
|
-
svg {
|
|
6655
|
-
height: 16px;
|
|
6656
|
-
margin-right: 3px;
|
|
6657
|
-
}
|
|
6658
|
-
&:hover {
|
|
6659
|
-
background-color: ${miscTheme.theme.colors.neutral100};
|
|
6660
|
-
}
|
|
6661
|
-
&.active {
|
|
6662
|
-
background-color: ${miscTheme.theme.colors.primaryActive};
|
|
6663
|
-
color: ${miscTheme.theme.colors.white || '#fff'};
|
|
6664
|
-
svg {
|
|
6665
|
-
stroke: ${miscTheme.theme.colors.white || '#fff'};
|
|
6666
|
-
}
|
|
6667
|
-
}
|
|
6668
|
-
`;
|
|
6669
|
-
const SubotInlineButtonReview = styled__default["default"].div `
|
|
6670
|
-
padding: 12px 24px;
|
|
6671
|
-
border: 1px solid ${miscTheme.theme.colors.neutral100 || '#E4E8EC'};
|
|
6672
|
-
background-color: ${miscTheme.theme.colors.white || 'white'};
|
|
6673
|
-
border-radius: 32px;
|
|
6674
|
-
cursor: pointer;
|
|
6675
|
-
transition: 0.25s all linear;
|
|
6676
|
-
&.active {
|
|
6677
|
-
background-color: ${(_a = miscTheme.theme.colors) === null || _a === void 0 ? void 0 : _a.primaryActive};
|
|
6678
|
-
color: ${miscTheme.theme.colors.white || '#fff'};
|
|
6679
|
-
svg {
|
|
6680
|
-
stroke: ${miscTheme.theme.colors.white || '#fff'};
|
|
6681
|
-
}
|
|
6682
|
-
}
|
|
6683
|
-
`;
|
|
6684
|
-
const SubotInlineActionText = styled__default["default"].div `
|
|
6685
|
-
display: flex;
|
|
6686
|
-
align-items: center;
|
|
6687
|
-
padding: 16px 24px;
|
|
6688
|
-
border: 1px solid
|
|
6689
|
-
${({ active }) => active
|
|
6690
|
-
? miscTheme.theme.colors.primaryBase || '#2685F1'
|
|
6691
|
-
: miscTheme.theme.colors.white || '#fff'};
|
|
6692
|
-
background-color: ${miscTheme.theme.colors.white || '#fff'};
|
|
6693
|
-
border-radius: ${miscTheme.theme.borderRadius};
|
|
6694
|
-
cursor: pointer;
|
|
6695
|
-
transition: 0.25s all linear;
|
|
6696
|
-
.label {
|
|
6697
|
-
flex: 1;
|
|
6698
|
-
}
|
|
6699
|
-
.icon {
|
|
6700
|
-
position: relative;
|
|
6701
|
-
z-index: 0;
|
|
6702
|
-
display: flex;
|
|
6703
|
-
width: 24px;
|
|
6704
|
-
height: 24px;
|
|
6705
|
-
align-items: center;
|
|
6706
|
-
justify-content: center;
|
|
6707
|
-
padding: 1px;
|
|
6708
|
-
transition: 0.2s linear all;
|
|
6709
|
-
.icon-checkbox {
|
|
6710
|
-
width: 100%;
|
|
6711
|
-
height: 100%;
|
|
6712
|
-
opacity: 0;
|
|
6713
|
-
${({ active }) => active && `opacity: 1`};
|
|
6714
|
-
transition: 0.25s all linear;
|
|
6715
|
-
}
|
|
6716
|
-
&:before {
|
|
6717
|
-
position: absolute;
|
|
6718
|
-
top: 50%;
|
|
6719
|
-
left: 50%;
|
|
6720
|
-
width: 22px;
|
|
6721
|
-
height: 22px;
|
|
6722
|
-
border: 2px solid
|
|
6723
|
-
${({ active }) => active
|
|
6724
|
-
? miscTheme.theme.colors.primaryBase || '#2685F1'
|
|
6725
|
-
: miscTheme.theme.colors.gray600 || '#595959'};
|
|
6726
|
-
border-radius: 50%;
|
|
6727
|
-
content: '';
|
|
6728
|
-
transform: translate(-50%, -50%);
|
|
6729
|
-
transition: 0.25s all linear;
|
|
6730
|
-
}
|
|
6731
|
-
&:after {
|
|
6732
|
-
position: absolute;
|
|
6733
|
-
z-index: -1;
|
|
6734
|
-
top: 50%;
|
|
6735
|
-
left: 50%;
|
|
6736
|
-
width: 10px;
|
|
6737
|
-
height: 10px;
|
|
6738
|
-
background-color: ${miscTheme.theme.colors.primaryBase || '#2685F1'};
|
|
6739
|
-
border-radius: 50%;
|
|
6740
|
-
content: '';
|
|
6741
|
-
opacity: 0;
|
|
6742
|
-
${({ active }) => active && `opacity: 1`};
|
|
6743
|
-
transform: translate(-50%, -50%);
|
|
6744
|
-
transition: 0.25s all linear;
|
|
6745
|
-
}
|
|
6746
|
-
}
|
|
6747
|
-
&:hover {
|
|
6748
|
-
border-color: ${((_b = miscTheme.theme.colors) === null || _b === void 0 ? void 0 : _b.primaryBase) || '#2685F1'};
|
|
6749
|
-
.icon {
|
|
6750
|
-
&:before {
|
|
6751
|
-
border-color: ${((_c = miscTheme.theme.colors) === null || _c === void 0 ? void 0 : _c.primaryBase) || '#2685F1'};
|
|
6752
|
-
transition: 0.2s linear all;
|
|
6753
|
-
}
|
|
6754
|
-
}
|
|
6755
|
-
}
|
|
6756
|
-
${utils.MediaQueries.tdDown} {
|
|
6757
|
-
padding: 16px 20px;
|
|
6758
|
-
}
|
|
6759
|
-
`;
|
|
6760
|
-
const SubotInlineActionImage = styled__default["default"](SubotInlineActionText) `
|
|
6761
|
-
position: relative;
|
|
6762
|
-
flex-wrap: wrap;
|
|
6763
|
-
padding: 16px;
|
|
6764
|
-
background-color: ${((_d = miscTheme.theme.colors) === null || _d === void 0 ? void 0 : _d.white) || '#fff'};
|
|
6765
|
-
.image-container {
|
|
6766
|
-
position: relative;
|
|
6767
|
-
overflow: hidden;
|
|
6768
|
-
width: 100%;
|
|
6769
|
-
padding-top: 67%;
|
|
6770
|
-
border-radius: 10px;
|
|
6771
|
-
.image {
|
|
6772
|
-
position: absolute;
|
|
6773
|
-
top: 50%;
|
|
6774
|
-
left: 50%;
|
|
6775
|
-
width: 100%;
|
|
6776
|
-
min-width: 100%;
|
|
6777
|
-
height: auto;
|
|
6778
|
-
min-height: 100%;
|
|
6779
|
-
transform: translate(-50%, -50%);
|
|
6780
|
-
}
|
|
6781
|
-
}
|
|
6782
|
-
.label {
|
|
6783
|
-
margin-top: 16px;
|
|
6784
|
-
}
|
|
6785
|
-
.icon {
|
|
6786
|
-
position: absolute;
|
|
6787
|
-
top: 1.75rem;
|
|
6788
|
-
right: 1.75rem;
|
|
6789
|
-
&:before {
|
|
6790
|
-
z-index: -1;
|
|
6791
|
-
background-color: #fff;
|
|
6792
|
-
}
|
|
6793
|
-
}
|
|
6794
|
-
${utils.MediaQueries.tdDown} {
|
|
6795
|
-
padding: 12px;
|
|
6796
|
-
.label {
|
|
6797
|
-
margin-top: 12px;
|
|
6798
|
-
}
|
|
6799
|
-
.icon {
|
|
6800
|
-
top: 1.3rem;
|
|
6801
|
-
right: 1.3rem;
|
|
6802
|
-
}
|
|
6803
|
-
}
|
|
6804
|
-
${utils.MediaQueries.tdDown} {
|
|
6805
|
-
padding: 8px;
|
|
6806
|
-
.label {
|
|
6807
|
-
margin-top: 8px;
|
|
6808
|
-
}
|
|
6809
|
-
.icon {
|
|
6810
|
-
top: 0.9rem;
|
|
6811
|
-
right: 0.9rem;
|
|
6812
|
-
}
|
|
6813
|
-
}
|
|
6814
|
-
`;
|
|
6815
|
-
const SubotInlineActionRatingStartContainer = styled__default["default"].div `
|
|
6816
|
-
display: flex;
|
|
6817
|
-
align-items: center;
|
|
6818
|
-
justify-content: flex-start;
|
|
6819
|
-
${utils.MediaQueries.tdDown} {
|
|
6820
|
-
justify-content: center;
|
|
6821
|
-
}
|
|
6822
|
-
`;
|
|
6823
|
-
const SubotInlineActionRatingDescriptionContainer = styled__default["default"].div `
|
|
6824
|
-
textarea {
|
|
6825
|
-
background-color: ${((_e = miscTheme.theme.colors) === null || _e === void 0 ? void 0 : _e.white) || '#fff'};
|
|
6826
|
-
}
|
|
6827
|
-
`;
|
|
6828
|
-
const SubotInlineActionPollResult = styled__default["default"].div `
|
|
6829
|
-
margin-top: 20px;
|
|
6830
|
-
color: ${((_f = miscTheme.theme.colors) === null || _f === void 0 ? void 0 : _f.gray500) || '#737373'};
|
|
6831
|
-
font-weight: 600;
|
|
6832
|
-
`;
|
|
6833
|
-
const SubotInlineActionPollChoiceResult = styled__default["default"].div `
|
|
6834
|
-
position: relative;
|
|
6835
|
-
z-index: 0;
|
|
6836
|
-
display: flex;
|
|
6837
|
-
overflow: hidden;
|
|
6838
|
-
align-items: center;
|
|
6839
|
-
padding: 16px 20px;
|
|
6840
|
-
border-radius: ${miscTheme.theme.borderRadius};
|
|
6841
|
-
.number {
|
|
6842
|
-
width: 32px;
|
|
6843
|
-
margin-right: 14px;
|
|
6844
|
-
font-weight: 600;
|
|
6845
|
-
}
|
|
6846
|
-
.content {
|
|
6847
|
-
flex: 1;
|
|
6848
|
-
}
|
|
6849
|
-
.icon {
|
|
6850
|
-
width: 16px;
|
|
6851
|
-
margin-left: 8px;
|
|
6852
|
-
}
|
|
6853
|
-
&:before {
|
|
6854
|
-
position: absolute;
|
|
6855
|
-
z-index: -1;
|
|
6856
|
-
top: 0;
|
|
6857
|
-
right: ${({ percent }) => (percent ? `${100 - percent}%` : '100%')};
|
|
6858
|
-
bottom: 0;
|
|
6859
|
-
left: 0;
|
|
6860
|
-
background-color: ${({ is_chosen }) => is_chosen
|
|
6861
|
-
? miscTheme.theme.colors.primary50 || '#E3F2FF'
|
|
6862
|
-
: miscTheme.theme.colors.neutral100 || '#E4E8EC'};
|
|
6863
|
-
content: '';
|
|
6864
|
-
transition: 0.3s all linear;
|
|
6865
|
-
}
|
|
6866
|
-
&:after {
|
|
6867
|
-
position: absolute;
|
|
6868
|
-
z-index: -2;
|
|
6869
|
-
top: 0;
|
|
6870
|
-
right: 0;
|
|
6871
|
-
bottom: 0;
|
|
6872
|
-
left: 0;
|
|
6873
|
-
background-color: ${((_g = miscTheme.theme.colors) === null || _g === void 0 ? void 0 : _g.white) || '#fff'};
|
|
6874
|
-
content: '';
|
|
6875
|
-
}
|
|
6876
|
-
${utils.MediaQueries.mbDown} {
|
|
6877
|
-
padding: 6px 16px;
|
|
6878
|
-
}
|
|
6879
|
-
`;
|
|
6880
|
-
const SubotInlineActionItemContainer = styled__default["default"].div `
|
|
6881
|
-
width: ${({ width }) => width || '100%'};
|
|
6882
|
-
padding: 4px;
|
|
6883
|
-
&.item-image-container {
|
|
6884
|
-
padding: 16px;
|
|
6885
|
-
${utils.MediaQueries.tdDown} {
|
|
6886
|
-
padding: 7.5px;
|
|
6887
|
-
}
|
|
6888
|
-
${utils.MediaQueries.mbDown} {
|
|
6889
|
-
width: 50%;
|
|
6890
|
-
}
|
|
6891
|
-
}
|
|
6892
|
-
`;
|
|
6893
|
-
const SubotInlineActionListContainer = styled__default["default"].div `
|
|
6894
|
-
display: flex;
|
|
6895
|
-
flex-wrap: wrap;
|
|
6896
|
-
align-items: flex-start;
|
|
6897
|
-
justify-content: center;
|
|
6898
|
-
margin: -4px;
|
|
6899
|
-
|
|
6900
|
-
&.list-container {
|
|
6901
|
-
margin: -16px;
|
|
6902
|
-
${utils.MediaQueries.tdDown} {
|
|
6903
|
-
margin: -7.5px;
|
|
6904
|
-
}
|
|
6905
|
-
}
|
|
6906
|
-
|
|
6907
|
-
&.review-container {
|
|
6908
|
-
margin: -8px;
|
|
6909
|
-
> div {
|
|
6910
|
-
padding: 8px;
|
|
6911
|
-
}
|
|
6912
|
-
}
|
|
6913
|
-
`;
|
|
6914
|
-
|
|
6915
|
-
const SubotInlineAction = ({ actions, value, onChange, htmlType, node_type, formSubmitMeta, }) => {
|
|
6916
|
-
const className = React.useMemo(() => {
|
|
6917
|
-
switch (node_type) {
|
|
6918
|
-
case index$2.NodeType.IMAGE:
|
|
6919
|
-
case index$2.NodeType.REACTION:
|
|
6920
|
-
return 'list-container';
|
|
6921
|
-
default:
|
|
6922
|
-
return '';
|
|
6923
|
-
}
|
|
6924
|
-
}, [node_type]);
|
|
6925
|
-
return (React__default["default"].createElement(React__default["default"].Fragment, null, actions && !!(actions === null || actions === void 0 ? void 0 : actions.length) && (React__default["default"].createElement(SubotInlineActionListContainer, { className: className }, actions === null || actions === void 0 ? void 0 : actions.map((action) => {
|
|
6926
|
-
const NodeAction = SubotInlineActionBase[action === null || action === void 0 ? void 0 : action.type];
|
|
6927
|
-
return (NodeAction && (React__default["default"].createElement(NodeAction, { key: action.id, action: action, onChange: onChange, active: value === null || value === void 0 ? void 0 : value.includes(action.id), htmlType: htmlType, formSubmitMeta: formSubmitMeta })));
|
|
6928
|
-
})))));
|
|
6929
|
-
};
|
|
6930
|
-
|
|
6931
|
-
const ButtonStyled = styled__default["default"](index$8.Button) `
|
|
6932
|
-
&:disabled {
|
|
6933
|
-
background-color: rgb(242, 242, 242);
|
|
6934
|
-
color: rgb(140, 140, 140);
|
|
6935
|
-
|
|
6936
|
-
&:hover {
|
|
6937
|
-
border: 0;
|
|
6938
|
-
}
|
|
6939
|
-
}
|
|
6940
|
-
svg {
|
|
6941
|
-
path {
|
|
6942
|
-
stroke: currentColor;
|
|
6943
|
-
}
|
|
6944
|
-
}
|
|
6945
|
-
`;
|
|
6946
|
-
const ButtonBackStyled = styled__default["default"](ButtonStyled) `
|
|
6947
|
-
&:disabled {
|
|
6948
|
-
background-color: rgb(242, 242, 242);
|
|
6949
|
-
color: rgb(140, 140, 140);
|
|
6950
|
-
&:hover {
|
|
6951
|
-
border: 0;
|
|
6952
|
-
}
|
|
6953
|
-
}
|
|
6954
|
-
svg {
|
|
6955
|
-
path {
|
|
6956
|
-
stroke: currentColor;
|
|
6957
|
-
}
|
|
6958
|
-
}
|
|
6959
|
-
`;
|
|
6960
|
-
const SubotInlineFooterStyled = styled__default["default"].div `
|
|
6961
|
-
display: flex;
|
|
6962
|
-
align-items: center;
|
|
6963
|
-
justify-content: flex-end;
|
|
6964
|
-
padding: 16px 32px;
|
|
6965
|
-
border-top: 4px solid ${miscTheme.theme.colors.neutral100 || '#E4E8EC'};
|
|
6966
|
-
.mantine-Button-root {
|
|
6967
|
-
+ .mantine-Button-root {
|
|
6968
|
-
margin-left: 8px;
|
|
6969
|
-
}
|
|
6970
|
-
}
|
|
6971
|
-
${utils.MediaQueries.tdDown} {
|
|
6972
|
-
padding: 12px 24px;
|
|
6973
|
-
}
|
|
6974
|
-
${utils.MediaQueries.mbDown} {
|
|
6975
|
-
padding: 12px 16px;
|
|
6976
|
-
}
|
|
6977
|
-
`;
|
|
6978
|
-
|
|
6979
|
-
const SubotInlineActionTextChoice = ({ action, onChange, active, htmlType, formSubmitMeta, }) => {
|
|
6980
|
-
const { trackingCommonInline } = React.useContext(SubotInlineContext);
|
|
6981
|
-
const inputRef = React.useRef(null);
|
|
6982
|
-
const [otherText, setOtherText] = React.useState('');
|
|
6983
|
-
const isActionPollWithOther = (action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.POLL_CHOICE_TEXT_BY_INPUT;
|
|
6984
|
-
const isActionSelectWithOther = (action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.USER_CHOICE_TEXT_BY_INPUT ||
|
|
6985
|
-
isActionPollWithOther;
|
|
6986
|
-
const onChangeTextArea = (evt) => {
|
|
6987
|
-
setOtherText(evt.target.value);
|
|
6988
|
-
if (isActionSelectWithOther) {
|
|
6989
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(action, [
|
|
6990
|
-
{
|
|
6991
|
-
key: KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD,
|
|
6992
|
-
control: index$2.ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type] || 'text',
|
|
6993
|
-
value: evt.target.value,
|
|
6994
|
-
action_id: action.id,
|
|
6995
|
-
},
|
|
6996
|
-
]);
|
|
6997
|
-
}
|
|
6998
|
-
};
|
|
6999
|
-
React.useEffect(() => {
|
|
7000
|
-
var _a, _b;
|
|
7001
|
-
if (active) {
|
|
7002
|
-
setOtherText(((_a = formSubmitMeta === null || formSubmitMeta === void 0 ? void 0 : formSubmitMeta.find((f) => f.key === KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD)) === null || _a === void 0 ? void 0 : _a.value) || '');
|
|
7003
|
-
(_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.focus();
|
|
7004
|
-
}
|
|
7005
|
-
}, [active, formSubmitMeta]);
|
|
7006
|
-
return (React__default["default"].createElement(SubotInlineActionItemContainer, null,
|
|
7007
|
-
React__default["default"].createElement(SubotInlineActionText, Object.assign({ active: !!active, onClick: () => onChange === null || onChange === void 0 ? void 0 : onChange(action), className: "pointer-event-child-none" }, trackingCommonInline, { "data-response-id": action === null || action === void 0 ? void 0 : action.id, "data-event-action": "Answer Click" }),
|
|
7008
|
-
React__default["default"].createElement("div", { className: "label" },
|
|
7009
|
-
React__default["default"].createElement(Markdown, null, action === null || action === void 0 ? void 0 : action.label)),
|
|
7010
|
-
React__default["default"].createElement("div", { className: "icon" }, htmlType === 'checkbox' && (React__default["default"].createElement(CheckboxIcon, { className: "icon-checkbox", viewBox: "0 0 22 22" })))),
|
|
7011
|
-
isActionSelectWithOther && active && (React__default["default"].createElement(core.Box, { mt: "6px", style: { textAlign: 'right' } },
|
|
7012
|
-
React__default["default"].createElement(core.Textarea, { ref: inputRef, placeholder: action === null || action === void 0 ? void 0 : action.label, styles: {
|
|
7013
|
-
input: {
|
|
7014
|
-
paddingLeft: '24px',
|
|
7015
|
-
paddingRight: '24px',
|
|
7016
|
-
boxShadow: 'none',
|
|
7017
|
-
':focus': { boxShadow: 'none' },
|
|
7018
|
-
},
|
|
7019
|
-
}, value: otherText, onChange: onChangeTextArea, maxLength: 360 })))));
|
|
7020
|
-
};
|
|
7021
|
-
const SubotInlineActionImageChoice = ({ action, onChange, active, htmlType, }) => {
|
|
7022
|
-
const { trackingCommonInline } = React.useContext(SubotInlineContext);
|
|
7023
|
-
return (React__default["default"].createElement(SubotInlineActionItemContainer, { width: "45%", className: 'item-image-container' },
|
|
7024
|
-
React__default["default"].createElement(SubotInlineActionImage, Object.assign({ onClick: () => onChange && onChange(action), active: !!active }, trackingCommonInline, { "data-response-id": action === null || action === void 0 ? void 0 : action.id, "data-event-action": "Answer Click" }),
|
|
7025
|
-
React__default["default"].createElement("div", { className: "image-container" },
|
|
7026
|
-
React__default["default"].createElement("img", { loading: "lazy", src: action === null || action === void 0 ? void 0 : action.url, alt: action === null || action === void 0 ? void 0 : action.label, className: "image" })),
|
|
7027
|
-
(action === null || action === void 0 ? void 0 : action.label) && (React__default["default"].createElement("div", { className: "label" },
|
|
7028
|
-
React__default["default"].createElement(Markdown, null, action === null || action === void 0 ? void 0 : action.label))),
|
|
7029
|
-
React__default["default"].createElement("div", { className: "icon" }, htmlType === 'checkbox' && (React__default["default"].createElement(CheckboxIcon, { className: "icon-checkbox", viewBox: "0 0 22 22" }))))));
|
|
7030
|
-
};
|
|
7031
|
-
const SubotInlineActionSSO = ({ action, onChange, }) => {
|
|
7032
|
-
const { trackingCommonInline } = React.useContext(SubotInlineContext);
|
|
7033
|
-
return (React__default["default"].createElement(SubotInlineActionItemContainer, { width: "50%", style: { alignSelf: 'center' } },
|
|
7034
|
-
React__default["default"].createElement(ButtonStyled, Object.assign({ onClick: () => onChange && onChange(action), size: "lg", isBlock: true }, trackingCommonInline, { className: "pointer-event-child-none", "data-event-action": "Login Click", "data-response-id": action === null || action === void 0 ? void 0 : action.id }),
|
|
7035
|
-
React__default["default"].createElement(Markdown, null, action === null || action === void 0 ? void 0 : action.label))));
|
|
7036
|
-
};
|
|
7037
|
-
const SubotInlinePollChoice = ({ active, action, onChange, htmlType, node_type, }) => {
|
|
7038
|
-
const handleOnChange = (action) => {
|
|
7039
|
-
if (action)
|
|
7040
|
-
onChange &&
|
|
7041
|
-
onChange({
|
|
7042
|
-
key: (action === null || action === void 0 ? void 0 : action.key) || '',
|
|
7043
|
-
control: index$2.ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type],
|
|
7044
|
-
value: '',
|
|
7045
|
-
action_id: action === null || action === void 0 ? void 0 : action.id,
|
|
7046
|
-
});
|
|
7047
|
-
};
|
|
7048
|
-
if (node_type === index$2.NodeType.RESULT_POLL)
|
|
7049
|
-
return (React__default["default"].createElement(SubotInlineActionItemContainer, null,
|
|
7050
|
-
React__default["default"].createElement(SubotInlineActionPollChoiceResult, { percent: (action === null || action === void 0 ? void 0 : action.percent) || 0, is_chosen: action === null || action === void 0 ? void 0 : action.is_chosen },
|
|
7051
|
-
React__default["default"].createElement("div", { className: "number" }, action === null || action === void 0 ? void 0 :
|
|
7052
|
-
action.percent,
|
|
7053
|
-
"%"),
|
|
7054
|
-
React__default["default"].createElement("div", { className: "content" }, action === null || action === void 0 ? void 0 : action.label),
|
|
7055
|
-
React__default["default"].createElement("div", { className: "icon" }, (action === null || action === void 0 ? void 0 : action.is_chosen) && React__default["default"].createElement(CheckIcon, { viewBox: "0 0 16 16" })))));
|
|
7056
|
-
return (React__default["default"].createElement(SubotInlineActionTextChoice, { active: !!active, action: action, onChange: handleOnChange, htmlType: htmlType }));
|
|
7057
|
-
};
|
|
7058
|
-
const SubotInlinePollChoiceImage = ({ active, action, onChange, htmlType, node_type, }) => {
|
|
7059
|
-
const handleOnChange = (action) => {
|
|
7060
|
-
if (action)
|
|
7061
|
-
onChange &&
|
|
7062
|
-
onChange({
|
|
7063
|
-
key: action === null || action === void 0 ? void 0 : action.key,
|
|
7064
|
-
control: index$2.ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type],
|
|
7065
|
-
value: '',
|
|
7066
|
-
action_id: action === null || action === void 0 ? void 0 : action.id,
|
|
7067
|
-
});
|
|
7068
|
-
};
|
|
7069
|
-
if (node_type === index$2.NodeType.RESULT_POLL)
|
|
7070
|
-
// TODO: Update layout result poll image
|
|
7071
|
-
return (React__default["default"].createElement(SubotInlineActionItemContainer, null,
|
|
7072
|
-
React__default["default"].createElement(SubotInlineActionPollChoiceResult, { percent: (action === null || action === void 0 ? void 0 : action.percent) || 0, is_chosen: action === null || action === void 0 ? void 0 : action.is_chosen },
|
|
7073
|
-
React__default["default"].createElement("div", { className: "number" }, action === null || action === void 0 ? void 0 :
|
|
7074
|
-
action.percent,
|
|
7075
|
-
"%"),
|
|
7076
|
-
React__default["default"].createElement("div", { className: "content" }, action === null || action === void 0 ? void 0 : action.label),
|
|
7077
|
-
React__default["default"].createElement("div", { className: "icon" }, (action === null || action === void 0 ? void 0 : action.is_chosen) && React__default["default"].createElement(CheckIcon, { viewBox: "0 0 16 16" })))));
|
|
7078
|
-
return (React__default["default"].createElement(SubotInlineActionImageChoice, { active: !!active, action: action, onChange: handleOnChange, htmlType: htmlType }));
|
|
7079
|
-
};
|
|
7080
|
-
const SubotInlineRatingStar = ({ action, value, onChange, }) => {
|
|
7081
|
-
var _a, _b;
|
|
7082
|
-
return (React__default["default"].createElement(SubotInlineActionItemContainer, null,
|
|
7083
|
-
React__default["default"].createElement(SubotInlineActionRatingStartContainer, null,
|
|
7084
|
-
React__default["default"].createElement(StarRatings__default["default"], { rating: value && typeof value !== 'string' && (value === null || value === void 0 ? void 0 : value.value)
|
|
7085
|
-
? parseInt(value === null || value === void 0 ? void 0 : value.value)
|
|
7086
|
-
: 0, changeRating: (star) => {
|
|
7087
|
-
const _value = {
|
|
7088
|
-
key: action === null || action === void 0 ? void 0 : action.key,
|
|
7089
|
-
control: index$2.ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type],
|
|
7090
|
-
value: star.toString(),
|
|
7091
|
-
action_id: action === null || action === void 0 ? void 0 : action.id,
|
|
7092
|
-
};
|
|
7093
|
-
onChange && onChange(_value);
|
|
7094
|
-
}, starHoverColor: (_a = miscTheme.theme === null || miscTheme.theme === void 0 ? void 0 : miscTheme.theme.colors) === null || _a === void 0 ? void 0 : _a.yellow600, starRatedColor: (_b = miscTheme.theme === null || miscTheme.theme === void 0 ? void 0 : miscTheme.theme.colors) === null || _b === void 0 ? void 0 : _b.yellow600, starDimension: "48" }))));
|
|
7095
|
-
};
|
|
7096
|
-
const SubotInlineTextArea = ({ action, value, onChange, }) => {
|
|
7097
|
-
return (React__default["default"].createElement(SubotInlineActionItemContainer, null,
|
|
7098
|
-
React__default["default"].createElement(SubotInlineActionRatingDescriptionContainer, null,
|
|
7099
|
-
React__default["default"].createElement(index$c.TextArea, { placeholder: action === null || action === void 0 ? void 0 : action.label, value: value && typeof value !== 'string' && (value === null || value === void 0 ? void 0 : value.value)
|
|
7100
|
-
? value === null || value === void 0 ? void 0 : value.value
|
|
7101
|
-
: '', onChange: (evt) => {
|
|
7102
|
-
const _value = {
|
|
7103
|
-
key: action === null || action === void 0 ? void 0 : action.key,
|
|
7104
|
-
control: index$2.ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type],
|
|
7105
|
-
value: evt.target.value,
|
|
7106
|
-
action_id: action === null || action === void 0 ? void 0 : action.id,
|
|
7107
|
-
};
|
|
7108
|
-
onChange && onChange(_value);
|
|
7109
|
-
} }))));
|
|
7110
|
-
};
|
|
7111
|
-
const SubotInlineLikeChoice = ({ action, active, onChange, }) => {
|
|
7112
|
-
return (React__default["default"].createElement(SubotInlineActionItemContainer, { width: "40%", className: 'item-image-container' },
|
|
7113
|
-
React__default["default"].createElement(SubotInlineButtonReaction, { className: classNames__default["default"](!!active && 'active'), onClick: () => onChange && onChange(action) },
|
|
7114
|
-
React__default["default"].createElement(LikeIcon, { viewBox: "0 0 24 24" }),
|
|
7115
|
-
React__default["default"].createElement(Markdown, null, action === null || action === void 0 ? void 0 : action.label))));
|
|
7116
|
-
};
|
|
7117
|
-
const SubotInlineDislikeChoice = ({ action, active, onChange, }) => {
|
|
7118
|
-
return (React__default["default"].createElement(SubotInlineActionItemContainer, { width: "40%", className: 'item-image-container' },
|
|
7119
|
-
React__default["default"].createElement(SubotInlineButtonReaction, { className: classNames__default["default"](!!active && 'active'), onClick: () => onChange && onChange(action) },
|
|
7120
|
-
React__default["default"].createElement(DislikeIcon, { viewBox: "0 0 24 24" }),
|
|
7121
|
-
React__default["default"].createElement(Markdown, null, action === null || action === void 0 ? void 0 : action.label))));
|
|
7122
|
-
};
|
|
7123
|
-
const SubotInlineReviewChoice = ({ active, action, onChange, }) => (React__default["default"].createElement(SubotInlineActionItemContainer, { width: "auto", className: "review-choice" },
|
|
7124
|
-
React__default["default"].createElement(SubotInlineButtonReview, { className: classNames__default["default"](!!active && 'active'), onClick: () => onChange &&
|
|
7125
|
-
onChange({
|
|
7126
|
-
key: action === null || action === void 0 ? void 0 : action.key,
|
|
7127
|
-
control: index$2.ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type],
|
|
7128
|
-
value: '',
|
|
7129
|
-
action_id: action === null || action === void 0 ? void 0 : action.id,
|
|
7130
|
-
}) },
|
|
7131
|
-
React__default["default"].createElement(Markdown, null, action === null || action === void 0 ? void 0 : action.label))));
|
|
7132
|
-
const SubotInlinePollResult = ({ action, }) => (React__default["default"].createElement(SubotInlineActionItemContainer, null,
|
|
7133
|
-
React__default["default"].createElement(SubotInlineActionPollResult, null, action === null || action === void 0 ? void 0 : action.label)));
|
|
7134
|
-
const SubotInlineActionBase = {
|
|
7135
|
-
'user-image': SubotInlineActionImageChoice,
|
|
7136
|
-
[index$2.NodeActionType.USER_CHOICE_TEXT]: SubotInlineActionTextChoice,
|
|
7137
|
-
[index$2.NodeActionType.USER_CHOICE_TEXT_BY_INPUT]: SubotInlineActionTextChoice,
|
|
7138
|
-
[index$2.NodeActionType.USER_CHOICE_IMAGE]: SubotInlineActionImageChoice,
|
|
7139
|
-
[index$2.NodeActionType.ACTION_SSO_REDIRECT]: SubotInlineActionSSO,
|
|
7140
|
-
[index$2.NodeActionType.POLL_CHOICE]: SubotInlinePollChoice,
|
|
7141
|
-
[index$2.NodeActionType.POLL_CHOICE_TEXT_BY_INPUT]: SubotInlineActionTextChoice,
|
|
7142
|
-
[index$2.NodeActionType.POLL_CHOICE_IMAGE]: SubotInlinePollChoiceImage,
|
|
7143
|
-
[index$2.NodeActionType.RATING_STAR]: SubotInlineRatingStar,
|
|
7144
|
-
[index$2.NodeActionType.RATING_DESCRIPTION]: SubotInlineTextArea,
|
|
7145
|
-
[index$2.NodeActionType.LIKE_CHOICE]: SubotInlineLikeChoice,
|
|
7146
|
-
[index$2.NodeActionType.DISLIKE_CHOICE]: SubotInlineDislikeChoice,
|
|
7147
|
-
[index$2.NodeActionType.REVIEW_CHOICE]: SubotInlineReviewChoice,
|
|
7148
|
-
[index$2.NodeActionType.REVIEW_DESCRIPTION]: SubotInlineTextArea,
|
|
7149
|
-
[index$2.NodeActionType.RESULT_BUTTON]: SubotInlineActionTextChoice,
|
|
7150
|
-
[index$2.NodeActionType.POLL_RESULT]: SubotInlinePollResult,
|
|
7151
|
-
};
|
|
7152
|
-
|
|
7153
|
-
const SubotInlineFooter = ({ onBack, onNext: onSubmit, hideBack, hideNext, nextText, backProps, nextProps, }) => {
|
|
7154
|
-
var _a, _b, _c;
|
|
7155
|
-
const { formatMessage: f } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
7156
|
-
const { nodes: listNodes, activeId, params, onNext, trackingCommonInline, } = React.useContext(SubotInlineContext);
|
|
7157
|
-
const nodeMessage = listNodes.find((nodeItem) => nodeItem.id == activeId);
|
|
7158
|
-
const actionNextChoice = (_a = nodeMessage === null || nodeMessage === void 0 ? void 0 : nodeMessage.actions) === null || _a === void 0 ? void 0 : _a.find((act) => act.type === index$2.NodeActionType.USER_CHOICE_NEXT);
|
|
7159
|
-
const handleNextChoice = () => {
|
|
7160
|
-
if (nodeMessage && actionNextChoice) {
|
|
7161
|
-
const nextValue = {
|
|
7162
|
-
node_id: nodeMessage.id,
|
|
7163
|
-
action_id: actionNextChoice === null || actionNextChoice === void 0 ? void 0 : actionNextChoice.id,
|
|
7164
|
-
action_value: actionNextChoice === null || actionNextChoice === void 0 ? void 0 : actionNextChoice.key,
|
|
7165
|
-
};
|
|
7166
|
-
onNext === null || onNext === void 0 ? void 0 : onNext(Object.assign(Object.assign(Object.assign({}, params), nextValue), nodeMessage._message));
|
|
7167
|
-
}
|
|
7168
|
-
};
|
|
7169
|
-
const actionSubmitMultiple = (_b = nodeMessage === null || nodeMessage === void 0 ? void 0 : nodeMessage.actions) === null || _b === void 0 ? void 0 : _b.find((act) => act.type === index$2.NodeActionType.ACTION_MULTIPLE_BUTTON);
|
|
7170
|
-
return (React__default["default"].createElement(SubotInlineFooterStyled, null,
|
|
7171
|
-
!hideBack && (React__default["default"].createElement(ButtonBackStyled, Object.assign({ size: "md", color: "secondary", onClick: onBack }, backProps, { className: classNames__default["default"]('pointer-event-child-none', backProps === null || backProps === void 0 ? void 0 : backProps.className) }, trackingCommonInline, { "data-event-action": "Back Click" }),
|
|
7172
|
-
React__default["default"].createElement(ArrowLeft, { style: { marginRight: 10 } }),
|
|
7173
|
-
f({
|
|
7174
|
-
id: 'riskScreener.back',
|
|
7175
|
-
defaultMessage: 'Back',
|
|
7176
|
-
}))),
|
|
7177
|
-
!hideNext && (React__default["default"].createElement(ButtonStyled, Object.assign({ size: "md", color: "primary", onClick: actionNextChoice ? handleNextChoice : onSubmit }, nextProps, { className: classNames__default["default"]('pointer-event-child-none', nextProps === null || nextProps === void 0 ? void 0 : nextProps.className) }, trackingCommonInline, { "data-event-action": "Answer Click", "data-response-id": (actionSubmitMultiple === null || actionSubmitMultiple === void 0 ? void 0 : actionSubmitMultiple.id) ||
|
|
7178
|
-
(actionNextChoice === null || actionNextChoice === void 0 ? void 0 : actionNextChoice.id) ||
|
|
7179
|
-
((_c = nodeMessage === null || nodeMessage === void 0 ? void 0 : nodeMessage._message) === null || _c === void 0 ? void 0 : _c.action_id) }),
|
|
7180
|
-
!nextText
|
|
7181
|
-
? f({
|
|
7182
|
-
id: 'riskScreener.next',
|
|
7183
|
-
defaultMessage: 'Next',
|
|
7184
|
-
})
|
|
7185
|
-
: nextText,
|
|
7186
|
-
React__default["default"].createElement(ArrowRight, { style: { marginLeft: 10 } })))));
|
|
7187
|
-
};
|
|
7188
|
-
var SubotInlineFooter$1 = React.memo(SubotInlineFooter);
|
|
7189
|
-
|
|
7190
|
-
const SubotInlineHeadline = styled__default["default"].h4 `
|
|
7191
|
-
padding: 32px 0px 12px;
|
|
7192
|
-
border-bottom: 1px solid ${miscTheme.theme.colors.neutral100 || '#E4E8EC'};
|
|
7193
|
-
margin: 0px 32px;
|
|
7194
|
-
color: ${miscTheme.theme.colors.gray500 || '#737373'};
|
|
7195
|
-
font-size: 14px;
|
|
7196
|
-
font-weight: 700;
|
|
7197
|
-
line-height: 1.5;
|
|
7198
|
-
${utils.MediaQueries.tdDown} {
|
|
7199
|
-
padding: 24px 0px 12px;
|
|
7200
|
-
margin: 0px 24px;
|
|
7201
|
-
}
|
|
7202
|
-
${utils.MediaQueries.mbDown} {
|
|
7203
|
-
padding: 16px 0px 12px;
|
|
7204
|
-
margin: 0px 16px;
|
|
7205
|
-
}
|
|
7206
|
-
`;
|
|
7207
|
-
const SubotInlineHeader = () => {
|
|
7208
|
-
const { formatMessage: f } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
7209
|
-
const { nodes } = React.useContext(SubotInlineContext);
|
|
7210
|
-
const headline = React.useMemo(() => { var _a; return (_a = nodes[0]) === null || _a === void 0 ? void 0 : _a.inline_headline; }, [nodes]);
|
|
7211
|
-
return (React__default["default"].createElement(SubotInlineHeadline, null, headline ||
|
|
7212
|
-
f({
|
|
7213
|
-
id: 'subotInline.quote',
|
|
7214
|
-
defaultMessage: 'HAVE TIME FOR A QUICK QUESTION?',
|
|
7215
|
-
})));
|
|
7216
|
-
};
|
|
7217
|
-
var SubotInlineHeader$1 = React.memo(SubotInlineHeader);
|
|
7218
|
-
|
|
7219
|
-
const SubotInlineIntentTitle = styled__default["default"].h3 `
|
|
7220
|
-
margin-bottom: 0px;
|
|
7221
|
-
font-size: 22px;
|
|
7222
|
-
font-weight: bold;
|
|
7223
|
-
line-height: 1.45;
|
|
7224
|
-
${utils.MediaQueries.tdDown} {
|
|
7225
|
-
font-size: 20px;
|
|
7226
|
-
}
|
|
7227
|
-
`;
|
|
7228
|
-
const SubotInlineRecalculateButton = styled__default["default"](index$8.Button) `
|
|
7229
|
-
&.bot-recalculate {
|
|
7230
|
-
svg {
|
|
7231
|
-
path {
|
|
7232
|
-
stroke: ${miscTheme.theme.colors.primaryBase || '#2685F1'} !important;
|
|
7233
|
-
}
|
|
7234
|
-
}
|
|
7235
|
-
&:hover {
|
|
7236
|
-
svg {
|
|
7237
|
-
path {
|
|
7238
|
-
stroke: #fff !important;
|
|
7239
|
-
}
|
|
7240
|
-
}
|
|
7241
|
-
}
|
|
7242
|
-
}
|
|
7243
|
-
`;
|
|
7244
|
-
const SubotInlineIntentButton = styled__default["default"](index$8.Button) `
|
|
7245
|
-
border: 2px solid transparent;
|
|
7246
|
-
`;
|
|
7247
|
-
const SubotInlineItemIcon = styled__default["default"].div `
|
|
7248
|
-
display: flex;
|
|
7249
|
-
padding-top: 10px;
|
|
7250
|
-
padding-bottom: 10px;
|
|
7251
|
-
.icon {
|
|
7252
|
-
width: 64px;
|
|
7253
|
-
height: 64px;
|
|
7254
|
-
margin-right: 16px;
|
|
7255
|
-
object-fit: contain;
|
|
7256
|
-
object-position: center;
|
|
7257
|
-
}
|
|
7258
|
-
.content {
|
|
7259
|
-
flex: 1;
|
|
7260
|
-
.title {
|
|
7261
|
-
margin-top: 0;
|
|
7262
|
-
margin-bottom: 0;
|
|
7263
|
-
font-size: inherit;
|
|
7264
|
-
font-weight: 700;
|
|
7265
|
-
line-height: 1.4;
|
|
7266
|
-
}
|
|
7267
|
-
.description {
|
|
7268
|
-
color: ${miscTheme.theme.colors.gray700 || '#404040'};
|
|
7269
|
-
line-height: 1.4;
|
|
7270
|
-
}
|
|
7271
|
-
}
|
|
7272
|
-
${utils.MediaQueries.mbDown} {
|
|
7273
|
-
.icon {
|
|
7274
|
-
width: 47px;
|
|
7275
|
-
height: 47px;
|
|
7276
|
-
margin-right: 16px;
|
|
7277
|
-
}
|
|
7278
|
-
.content {
|
|
7279
|
-
.title {
|
|
7280
|
-
font-size: 14px;
|
|
7281
|
-
}
|
|
7282
|
-
.description {
|
|
7283
|
-
font-size: 14px;
|
|
7284
|
-
}
|
|
7285
|
-
}
|
|
7286
|
-
}
|
|
7287
|
-
`;
|
|
7288
|
-
styled__default["default"](index$8.Button) ``;
|
|
7289
|
-
const SubotInlineIntentFirstTextWrapper = styled__default["default"].div `
|
|
7290
|
-
display: flex;
|
|
7291
|
-
align-items: flex-start;
|
|
7292
|
-
color: ${miscTheme.theme.colors.gray800 || '#262626'};
|
|
7293
|
-
font-size: 22px;
|
|
7294
|
-
font-weight: 700;
|
|
7295
|
-
letter-space: -0.6px;
|
|
7296
|
-
line-height: 1.45;
|
|
7297
|
-
.number {
|
|
7298
|
-
margin-right: 3px;
|
|
7299
|
-
}
|
|
7300
|
-
.title {
|
|
7301
|
-
flex: 1;
|
|
7302
|
-
}
|
|
7303
|
-
${utils.MediaQueries.tdDown} {
|
|
7304
|
-
font-size: 20px;
|
|
7305
|
-
}
|
|
7306
|
-
${utils.MediaQueries.mbDown} {
|
|
7307
|
-
font-size: 18px;
|
|
7308
|
-
}
|
|
7309
|
-
`;
|
|
7310
|
-
const SubotInlineIntentFirstImageWrapper = styled__default["default"].div `
|
|
7311
|
-
display: flex;
|
|
7312
|
-
justify-content: center;
|
|
7313
|
-
`;
|
|
7314
|
-
const SubotInlineIntentFirstTextContainer = styled__default["default"].div ``;
|
|
7315
|
-
const SubotInlineIntentTextContainer = styled__default["default"].div `
|
|
7316
|
-
padding: 12px 16px;
|
|
7317
|
-
border: 1px solid ${miscTheme.theme.colors.gray200 || '#D9D9D9'};
|
|
7318
|
-
background-color: ${miscTheme.theme.colors.white || '#fff'};
|
|
7319
|
-
border-radius: ${miscTheme.theme.borderRadius};
|
|
7320
|
-
line-height: 1.5;
|
|
7321
|
-
`;
|
|
7322
|
-
const SubotInlineIntentImageContainer = styled__default["default"].div `
|
|
7323
|
-
border: ${miscTheme.theme.colors.gray200 || '#D9D9D9'};
|
|
7324
|
-
background-color: ${miscTheme.theme.colors.white || '#FFF'};
|
|
7325
|
-
border-radius: ${miscTheme.theme.borderRadius};
|
|
7326
|
-
.intent-img {
|
|
7327
|
-
border-radius: ${miscTheme.theme.borderRadius};
|
|
7328
|
-
&.has-label {
|
|
7329
|
-
border-bottom-left-radius: 0px;
|
|
7330
|
-
border-bottom-right-radius: 0px;
|
|
7331
|
-
}
|
|
7332
|
-
}
|
|
7333
|
-
.intent-img-label {
|
|
7334
|
-
padding: 5px 10px;
|
|
7335
|
-
font-size: 0.8em;
|
|
7336
|
-
font-style: italic;
|
|
7337
|
-
font-weight: 400;
|
|
7338
|
-
}
|
|
7339
|
-
`;
|
|
7340
|
-
const SubotInlineIntentUrlContainer = styled__default["default"].div `
|
|
7341
|
-
display: flex;
|
|
7342
|
-
.feature {
|
|
7343
|
-
width: 30%;
|
|
7344
|
-
.feature-wrapper {
|
|
7345
|
-
position: relative;
|
|
7346
|
-
display: block;
|
|
7347
|
-
overflow: hidden;
|
|
7348
|
-
width: 100%;
|
|
7349
|
-
padding-top: 66%;
|
|
7350
|
-
border-radius: ${miscTheme.theme.borderRadius};
|
|
7351
|
-
.feature-img {
|
|
7352
|
-
position: absolute;
|
|
7353
|
-
top: 50%;
|
|
7354
|
-
left: 50%;
|
|
7355
|
-
width: 100%;
|
|
7356
|
-
min-width: 100%;
|
|
7357
|
-
height: auto;
|
|
7358
|
-
min-height: 100%;
|
|
7359
|
-
transform: translate(-50%, -50%);
|
|
7360
|
-
}
|
|
7361
|
-
}
|
|
7362
|
-
}
|
|
7363
|
-
.body {
|
|
7364
|
-
flex: 1;
|
|
7365
|
-
margin-left: 10px;
|
|
7366
|
-
line-height: 1.5;
|
|
7367
|
-
a {
|
|
7368
|
-
color: ${miscTheme.theme.colors.gray800 || '#262626'};
|
|
7369
|
-
text-decoration: none;
|
|
7370
|
-
}
|
|
7371
|
-
}
|
|
7372
|
-
`;
|
|
7373
|
-
const SubotInlineIntentRiskScreenerContainer = styled__default["default"].div `
|
|
7374
|
-
display: flex;
|
|
7375
|
-
align-items: center;
|
|
7376
|
-
justify-content: space-between;
|
|
7377
|
-
padding: 20px 40px 20px 16px;
|
|
7378
|
-
background-color: #fff;
|
|
7379
|
-
border-radius: ${miscTheme.theme.borderRadius};
|
|
7380
|
-
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.04), 0px 0px 2px rgba(0, 0, 0, 0.06),
|
|
7381
|
-
0px 0px 1px rgba(0, 0, 0, 0.04);
|
|
7382
|
-
.feature {
|
|
7383
|
-
display: block;
|
|
7384
|
-
overflow: hidden;
|
|
7385
|
-
width: 72px;
|
|
7386
|
-
height: 72px;
|
|
7387
|
-
margin-right: 16px;
|
|
7388
|
-
border-radius: ${miscTheme.theme.borderRadius};
|
|
7389
|
-
img {
|
|
7390
|
-
width: 100%;
|
|
7391
|
-
height: 100%;
|
|
7392
|
-
object-fit: cover;
|
|
7393
|
-
object-position: center;
|
|
7394
|
-
}
|
|
7395
|
-
}
|
|
7396
|
-
.title-container {
|
|
7397
|
-
display: flex;
|
|
7398
|
-
flex: 1;
|
|
7399
|
-
align-items: center;
|
|
7400
|
-
justify-content: space-between;
|
|
7401
|
-
a {
|
|
7402
|
-
font-size: 16px;
|
|
7403
|
-
line-height: 1.5em;
|
|
7404
|
-
text-decoration: none;
|
|
7405
|
-
.title {
|
|
7406
|
-
padding: 0;
|
|
7407
|
-
color: #262626;
|
|
7408
|
-
font-size: inherit;
|
|
7409
|
-
line-height: inherit;
|
|
7410
|
-
}
|
|
7411
|
-
&.link {
|
|
7412
|
-
display: flex;
|
|
7413
|
-
align-items: center;
|
|
7414
|
-
justify-content: center;
|
|
7415
|
-
margin-left: 20px;
|
|
7416
|
-
color: #2d87f3;
|
|
7417
|
-
font-weight: 700;
|
|
7418
|
-
}
|
|
7419
|
-
}
|
|
7420
|
-
}
|
|
7421
|
-
@media screen and (max-width: 769px) {
|
|
7422
|
-
padding: 16px 12px;
|
|
7423
|
-
.feature {
|
|
7424
|
-
width: 50px;
|
|
7425
|
-
height: 50px;
|
|
7426
|
-
}
|
|
7427
|
-
.title-container {
|
|
7428
|
-
a {
|
|
7429
|
-
font-size: 13px;
|
|
7430
|
-
line-height: 20px;
|
|
7431
|
-
&.link {
|
|
7432
|
-
margin-left: 10px;
|
|
7433
|
-
}
|
|
7434
|
-
}
|
|
7435
|
-
}
|
|
7436
|
-
}
|
|
7437
|
-
`;
|
|
7438
|
-
const SubotInlineIntentFinalButtonContainer = styled__default["default"].div `
|
|
7439
|
-
display: flex;
|
|
7440
|
-
align-items: center;
|
|
7441
|
-
justify-content: center;
|
|
7442
|
-
`;
|
|
7443
|
-
styled__default["default"].div `
|
|
7444
|
-
padding: 16px;
|
|
7445
|
-
margin-top: 32px;
|
|
7446
|
-
margin-bottom: 32px;
|
|
7447
|
-
background-color: ${miscTheme.theme.colors.primary50 || ''};
|
|
7448
|
-
border-radius: ${miscTheme.theme.borderRadius};
|
|
7449
|
-
.item-grid {
|
|
7450
|
-
> div {
|
|
7451
|
-
box-shadow: none;
|
|
7452
|
-
}
|
|
7453
|
-
}
|
|
7454
|
-
.lp--affiliate-product {
|
|
7455
|
-
.arrow-left {
|
|
7456
|
-
left: -20px;
|
|
7457
|
-
}
|
|
7458
|
-
.arrow-right {
|
|
7459
|
-
right: -16px;
|
|
7460
|
-
}
|
|
7461
|
-
}
|
|
7462
|
-
.bullet-nav {
|
|
7463
|
-
bottom: -10px;
|
|
7464
|
-
}
|
|
7465
|
-
`;
|
|
7466
|
-
const SubotInlineIntentFinalCol = styled__default["default"].div `
|
|
7467
|
-
width: ${({ width }) => width || '100%'};
|
|
7468
|
-
padding: 8px;
|
|
7469
|
-
${utils.MediaQueries.mbDown} {
|
|
7470
|
-
width: 100%;
|
|
7471
|
-
}
|
|
7472
|
-
`;
|
|
7473
|
-
const SubotInlineIntentFinalRow = styled__default["default"].div `
|
|
7474
|
-
display: flex;
|
|
7475
|
-
flex-wrap: wrap;
|
|
7476
|
-
align-items: flex-start;
|
|
7477
|
-
justify-content: center;
|
|
7478
|
-
margin: 0 -8px;
|
|
7479
|
-
`;
|
|
7480
|
-
const SubotInlineIntentCol = styled__default["default"].div `
|
|
7481
|
-
width: ${({ width }) => width || '100%'};
|
|
7482
|
-
padding: 4px;
|
|
7483
|
-
${utils.MediaQueries.mbDown} {
|
|
7484
|
-
width: 100%;
|
|
7485
|
-
}
|
|
7486
|
-
`;
|
|
7487
|
-
const SubotInlineIntentRow = styled__default["default"].div `
|
|
7488
|
-
display: flex;
|
|
7489
|
-
flex-wrap: wrap;
|
|
7490
|
-
align-items: flex-start;
|
|
7491
|
-
justify-content: center;
|
|
7492
|
-
margin: 0 -4px;
|
|
7493
|
-
`;
|
|
7494
|
-
const SubotInlineIntentList = styled__default["default"].div `
|
|
7495
|
-
margin-top: 20px;
|
|
7496
|
-
`;
|
|
7497
|
-
|
|
7498
|
-
const SubotInlineIntent = ({ intents, indexNumber, }) => {
|
|
7499
|
-
var _a, _b;
|
|
7500
|
-
const title = React.useMemo(() => {
|
|
7501
|
-
const _title = intents && intents[0];
|
|
7502
|
-
if (_title)
|
|
7503
|
-
return _title;
|
|
7504
|
-
return null;
|
|
7505
|
-
}, []);
|
|
7506
|
-
if (!intents.length)
|
|
7507
|
-
return React__default["default"].createElement(SubotInlineIntentBotTitle, { indexNumber: indexNumber });
|
|
7508
|
-
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
7509
|
-
title && (React__default["default"].createElement(SubotInlineIntentBotTitle, { intent: title, indexNumber: indexNumber })),
|
|
7510
|
-
!!((_a = intents.slice(1)) === null || _a === void 0 ? void 0 : _a.length) && (React__default["default"].createElement(SubotInlineIntentList, null,
|
|
7511
|
-
React__default["default"].createElement(SubotInlineIntentRow, null, (_b = intents.slice(1)) === null || _b === void 0 ? void 0 : _b.map((intent) => {
|
|
7512
|
-
const NodeIntent = SubotInlineIntentBase[intent === null || intent === void 0 ? void 0 : intent.type];
|
|
7513
|
-
return (NodeIntent && React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent }));
|
|
7514
|
-
}))))));
|
|
7515
|
-
};
|
|
7516
|
-
|
|
7517
|
-
const SubotInlineIntentFinal = ({ intents: intentsProps, }) => {
|
|
7518
|
-
const intents = React.useMemo(() => {
|
|
7519
|
-
const mainIntents = [];
|
|
7520
|
-
const subIntents = [];
|
|
7521
|
-
const rest = [];
|
|
7522
|
-
intentsProps === null || intentsProps === void 0 ? void 0 : intentsProps.map((intent) => {
|
|
7523
|
-
switch (intent === null || intent === void 0 ? void 0 : intent.type) {
|
|
7524
|
-
case index$2.NodeIntentType.BOT_MAIN_IMAGE:
|
|
7525
|
-
mainIntents.push(intent);
|
|
7526
|
-
break;
|
|
7527
|
-
case index$2.NodeIntentType.BOT_MAIN_TITLE:
|
|
7528
|
-
mainIntents.push(intent);
|
|
7529
|
-
break;
|
|
7530
|
-
case index$2.NodeIntentType.BOT_MAIN_BODY:
|
|
7531
|
-
mainIntents.push(intent);
|
|
7532
|
-
break;
|
|
7533
|
-
case index$2.NodeIntentType.BOT_MAIN_BUTTON:
|
|
7534
|
-
mainIntents.push(intent);
|
|
7535
|
-
break;
|
|
7536
|
-
case index$2.NodeIntentType.BOT_RECALCULATE:
|
|
7537
|
-
mainIntents.push(intent);
|
|
7538
|
-
break;
|
|
7539
|
-
case index$2.NodeIntentType.BOT_SUB_TITLE:
|
|
7540
|
-
subIntents.push(intent);
|
|
7541
|
-
break;
|
|
7542
|
-
case index$2.NodeIntentType.BOT_SUB_BODY:
|
|
7543
|
-
subIntents.push(intent);
|
|
7544
|
-
break;
|
|
7545
|
-
default:
|
|
7546
|
-
rest.push(intent);
|
|
7547
|
-
break;
|
|
7548
|
-
}
|
|
7549
|
-
});
|
|
7550
|
-
return {
|
|
7551
|
-
mainIntents,
|
|
7552
|
-
subIntents,
|
|
7553
|
-
intents: rest,
|
|
7554
|
-
};
|
|
7555
|
-
}, []);
|
|
7556
|
-
if (!(intentsProps === null || intentsProps === void 0 ? void 0 : intentsProps.length)) {
|
|
7557
|
-
return null;
|
|
7558
|
-
}
|
|
7559
|
-
function renderIntent(intent) {
|
|
7560
|
-
const NodeIntent = SubotInlineIntentBase[intent === null || intent === void 0 ? void 0 : intent.type];
|
|
7561
|
-
if (!NodeIntent) {
|
|
7562
|
-
return null;
|
|
7563
|
-
}
|
|
7564
|
-
return React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent });
|
|
7565
|
-
}
|
|
7566
|
-
return (React__default["default"].createElement(SubotInlineIntentRow, null,
|
|
7567
|
-
React__default["default"].createElement(SubotInlineIntentCol, null,
|
|
7568
|
-
React__default["default"].createElement(SubotInlineIntentFinalRow, null,
|
|
7569
|
-
intents.mainIntents.map(renderIntent),
|
|
7570
|
-
intents.subIntents.map(renderIntent),
|
|
7571
|
-
intents.intents.map(renderIntent)))));
|
|
7572
|
-
};
|
|
7573
|
-
|
|
7574
|
-
/*******************************************************************************/
|
|
7575
|
-
/*************************** NodeIntentType: 'bot-text' ************************/
|
|
7576
|
-
//#region
|
|
7577
|
-
const SubotInlineIntentBotText = ({ intent, }) => {
|
|
7578
|
-
if (!(intent === null || intent === void 0 ? void 0 : intent.label))
|
|
7579
|
-
return React__default["default"].createElement(React__default["default"].Fragment, null);
|
|
7580
|
-
return (React__default["default"].createElement(SubotInlineIntentCol, null,
|
|
7581
|
-
React__default["default"].createElement(SubotInlineIntentTextContainer, null,
|
|
7582
|
-
React__default["default"].createElement(Markdown, null, intent === null || intent === void 0 ? void 0 : intent.label))));
|
|
7583
|
-
};
|
|
7584
|
-
//#endregion
|
|
7585
|
-
/*************************** END - NodeIntentType: 'bot-text' ******************/
|
|
7586
|
-
/*******************************************************************************/
|
|
7587
|
-
/*******************************************************************************/
|
|
7588
|
-
/*************************** NodeIntentType: 'bot-image' ***********************/
|
|
7589
|
-
//#region
|
|
7590
|
-
const SubotInlineIntentBotImage = ({ intent, }) => {
|
|
7591
|
-
if (!intent.url)
|
|
7592
|
-
return React__default["default"].createElement(React__default["default"].Fragment, null);
|
|
7593
|
-
const isObject = (() => {
|
|
7594
|
-
try {
|
|
7595
|
-
return Boolean(JSON.parse((intent === null || intent === void 0 ? void 0 : intent.label) || ''));
|
|
7596
|
-
}
|
|
7597
|
-
catch (err) {
|
|
7598
|
-
return false;
|
|
7599
|
-
}
|
|
7600
|
-
})();
|
|
7601
|
-
return (React__default["default"].createElement(SubotInlineIntentCol, { width: "50%" },
|
|
7602
|
-
React__default["default"].createElement(SubotInlineIntentImageContainer, null,
|
|
7603
|
-
React__default["default"].createElement("img", { loading: "lazy", src: intent.url, alt: intent.label, className: `intent-img ${intent.label && 'has-label'}` }),
|
|
7604
|
-
isObject && (React__default["default"].createElement("h4", { className: "intent-img-label" },
|
|
7605
|
-
React__default["default"].createElement(Markdown, null, intent.label))))));
|
|
7606
|
-
};
|
|
7607
|
-
//#endregion
|
|
7608
|
-
/*************************** END - NodeIntentType: 'bot-image' *****************/
|
|
7609
|
-
/*******************************************************************************/
|
|
7610
|
-
/*******************************************************************************/
|
|
7611
|
-
/*************************** NodeIntentType: 'bot-button' **********************/
|
|
7612
|
-
//#region
|
|
7613
|
-
const SubotInlineIntentBotButton = ({ intent, }) => {
|
|
7614
|
-
const { trackingCommonInline } = React.useContext(SubotInlineContext);
|
|
7615
|
-
const handleOnClick = () => {
|
|
7616
|
-
window.location.href = intent.url;
|
|
7617
|
-
};
|
|
7618
|
-
if (!(intent === null || intent === void 0 ? void 0 : intent.label))
|
|
7619
|
-
return React__default["default"].createElement(React__default["default"].Fragment, null);
|
|
7620
|
-
return (React__default["default"].createElement(SubotInlineIntentCol, { width: "60%" },
|
|
7621
|
-
React__default["default"].createElement(SubotInlineIntentButton, Object.assign({ size: "lg", color: "primary", onClick: handleOnClick, isBlock: true }, trackingCommonInline, { "data-event-action": "Click CTA", "data-response-id": intent.id }),
|
|
7622
|
-
React__default["default"].createElement(Markdown, null, intent === null || intent === void 0 ? void 0 : intent.label))));
|
|
7623
|
-
};
|
|
7624
|
-
//#endregion
|
|
7625
|
-
/*************************** END - NodeIntentType: 'bot-button' ****************/
|
|
7626
|
-
/*******************************************************************************/
|
|
7627
|
-
/*******************************************************************************/
|
|
7628
|
-
/*************************** NodeIntentType: 'bot-url' *************************/
|
|
7629
|
-
//#region
|
|
7630
|
-
const SubotInlineIntentUrl = ({ intent, }) => {
|
|
7631
|
-
const article = React.useMemo(() => intent.label.includes('{')
|
|
7632
|
-
? JSON.parse(intent.label)
|
|
7633
|
-
: {}, [intent.label]);
|
|
7634
|
-
return (React__default["default"].createElement(React__default["default"].Fragment, null, !!Object.keys(article).length && (React__default["default"].createElement(SubotInlineIntentCol, null,
|
|
7635
|
-
React__default["default"].createElement(SubotInlineIntentUrlContainer, null,
|
|
7636
|
-
React__default["default"].createElement("div", { className: "feature" },
|
|
7637
|
-
React__default["default"].createElement("a", { href: article === null || article === void 0 ? void 0 : article.url, className: "feature-wrapper" },
|
|
7638
|
-
React__default["default"].createElement("img", { loading: "lazy", src: article === null || article === void 0 ? void 0 : article.thumbnail, alt: article === null || article === void 0 ? void 0 : article.title, className: "feature-img" }))),
|
|
7639
|
-
React__default["default"].createElement("div", { className: "body" },
|
|
7640
|
-
React__default["default"].createElement("a", { href: article === null || article === void 0 ? void 0 : article.url },
|
|
7641
|
-
React__default["default"].createElement("h5", { className: "title" },
|
|
7642
|
-
React__default["default"].createElement(Markdown, null, article === null || article === void 0 ? void 0 : article.title)))))))));
|
|
7643
|
-
};
|
|
7644
|
-
//#endregion
|
|
7645
|
-
/*************************** END - NodeIntentType: 'bot-url' *******************/
|
|
7646
|
-
/*******************************************************************************/
|
|
7647
|
-
/*******************************************************************************/
|
|
7648
|
-
/*************************** NodeIntentType: 'sso-intent' *************************/
|
|
7649
|
-
//#region
|
|
7650
|
-
const SubotInlineIntentSSO = ({ intent, }) => {
|
|
7651
|
-
const info = (() => {
|
|
7652
|
-
try {
|
|
7653
|
-
return (intent === null || intent === void 0 ? void 0 : intent.label) ? JSON.parse(intent === null || intent === void 0 ? void 0 : intent.label) : {};
|
|
7654
|
-
}
|
|
7655
|
-
catch (err) {
|
|
7656
|
-
return {};
|
|
7657
|
-
}
|
|
7658
|
-
})();
|
|
7659
|
-
if (!info || !info.title)
|
|
7660
|
-
return React__default["default"].createElement(React__default["default"].Fragment, null);
|
|
7661
|
-
return (React__default["default"].createElement(SubotInlineIntentCol, null,
|
|
7662
|
-
React__default["default"].createElement(SubotInlineItemIcon, null,
|
|
7663
|
-
React__default["default"].createElement("img", { loading: "lazy", src: intent === null || intent === void 0 ? void 0 : intent.url, className: "icon", alt: "" }),
|
|
7664
|
-
React__default["default"].createElement("div", { className: "content" },
|
|
7665
|
-
React__default["default"].createElement("h3", { className: "title" }, info.title),
|
|
7666
|
-
React__default["default"].createElement("div", { className: "description" }, info === null || info === void 0 ? void 0 : info.description)))));
|
|
7667
|
-
};
|
|
7668
|
-
//#endregion
|
|
7669
|
-
/*************************** END - NodeIntentType: 'sso-intent' *******************/
|
|
7670
|
-
/*******************************************************************************/
|
|
7671
|
-
/*******************************************************************************/
|
|
7672
|
-
/*************************** NodeIntentType: 'bot-title' ***********************/
|
|
7673
|
-
//#region
|
|
7674
|
-
const SubotInlineIntentBotTitle = ({ intent, indexNumber, }) => {
|
|
7675
|
-
const isShowLabel = ![index$2.NodeIntentType.SSO_INTENT].includes(intent === null || intent === void 0 ? void 0 : intent.type);
|
|
7676
|
-
return (React__default["default"].createElement(SubotInlineIntentFirstTextContainer, null,
|
|
7677
|
-
React__default["default"].createElement(SubotInlineIntentFirstTextWrapper, null,
|
|
7678
|
-
indexNumber && (React__default["default"].createElement("div", { className: "number" },
|
|
7679
|
-
indexNumber < 10 ? `0${indexNumber}` : indexNumber,
|
|
7680
|
-
".")),
|
|
7681
|
-
isShowLabel &&
|
|
7682
|
-
intent &&
|
|
7683
|
-
[index$2.NodeIntentType.BOT_TEXT, index$2.NodeIntentType.BOT_BUTTON].includes(intent === null || intent === void 0 ? void 0 : intent.type) && React__default["default"].createElement(Markdown, { className: "title" }, intent.label)),
|
|
7684
|
-
intent &&
|
|
7685
|
-
[index$2.NodeIntentType.BOT_IMAGE].includes(intent === null || intent === void 0 ? void 0 : intent.type) && (React__default["default"].createElement(SubotInlineIntentFirstImageWrapper, null,
|
|
7686
|
-
React__default["default"].createElement(SubotInlineIntentBotImage, { intent: intent })))));
|
|
7687
|
-
};
|
|
7688
|
-
//#endregion
|
|
7689
|
-
/*************************** END - NodeIntentType: 'bot-title' *****************/
|
|
7690
|
-
/*******************************************************************************/
|
|
7691
|
-
/*******************************************************************************/
|
|
7692
|
-
/*************************** NodeIntentType: 'bot-main-title' ******************/
|
|
7693
|
-
//#region
|
|
7694
|
-
const SubotInlineIntentBotMainTitle = ({ intent, }) => {
|
|
7695
|
-
if (!intent.label ||
|
|
7696
|
-
intent.label === 'Sub title' ||
|
|
7697
|
-
intent.label === 'Main title') {
|
|
7698
|
-
return null;
|
|
7699
|
-
}
|
|
7700
|
-
return (React__default["default"].createElement(SubotInlineIntentFinalCol, null,
|
|
7701
|
-
React__default["default"].createElement(SubotInlineIntentTitle, null,
|
|
7702
|
-
React__default["default"].createElement(Markdown, null, intent.label))));
|
|
7703
|
-
};
|
|
7704
|
-
//#endregion
|
|
7705
|
-
/*************************** END - NodeIntentType: 'bot-main-title' ************/
|
|
7706
|
-
/*******************************************************************************/
|
|
7707
|
-
/*******************************************************************************/
|
|
7708
|
-
/*************************** NodeIntentType: 'bot-main-image' ******************/
|
|
7709
|
-
//#region
|
|
7710
|
-
const SubotInlineIntentBotMainImage = ({ intent, }) => {
|
|
7711
|
-
if (!intent.url)
|
|
7712
|
-
return React__default["default"].createElement(React__default["default"].Fragment, null);
|
|
7713
|
-
return (React__default["default"].createElement(SubotInlineIntentFinalCol, null,
|
|
7714
|
-
React__default["default"].createElement(SubotInlineIntentImageContainer, null,
|
|
7715
|
-
React__default["default"].createElement("img", { loading: "lazy", src: intent.url, alt: intent.label, className: `intent-img ${intent.label && 'has-label'}` }),
|
|
7716
|
-
intent.label && (React__default["default"].createElement("h4", { className: "intent-img-label" },
|
|
7717
|
-
React__default["default"].createElement(Markdown, null, intent.label))))));
|
|
7718
|
-
};
|
|
7719
|
-
//#endregion
|
|
7720
|
-
/*************************** END - NodeIntentType: 'bot-main-image' ************/
|
|
7721
|
-
/*******************************************************************************/
|
|
7722
|
-
/*******************************************************************************/
|
|
7723
|
-
/*************************** NodeIntentType: 'bot-main-body' ******************/
|
|
7724
|
-
//#region
|
|
7725
|
-
const SubotInlineIntentBotMainBody = ({ intent, }) => {
|
|
7726
|
-
if (!intent.label ||
|
|
7727
|
-
intent.label === 'Main body' ||
|
|
7728
|
-
intent.label === 'Sub body') {
|
|
7729
|
-
return null;
|
|
7730
|
-
}
|
|
7731
|
-
return (React__default["default"].createElement(SubotInlineIntentFinalCol, null,
|
|
7732
|
-
React__default["default"].createElement("div", { className: "intents__item markdown" },
|
|
7733
|
-
React__default["default"].createElement(Markdown, null, intent.label))));
|
|
7734
|
-
};
|
|
7735
|
-
//#endregion
|
|
7736
|
-
/*************************** END - NodeIntentType: 'bot-main-body' ************/
|
|
7737
|
-
/*******************************************************************************/
|
|
7738
|
-
/*******************************************************************************/
|
|
7739
|
-
/*************************** NodeIntentType: 'bot-main-button' *****************/
|
|
7740
|
-
//#region
|
|
7741
|
-
const SubotInlineIntentBotMainButton = ({ intent, }) => {
|
|
7742
|
-
const { trackingCommonInline } = React.useContext(SubotInlineContext);
|
|
7743
|
-
const handleOnClick = () => {
|
|
7744
|
-
window.location.href = intent.url;
|
|
7745
|
-
};
|
|
7746
|
-
if (!intent.label)
|
|
7747
|
-
return React__default["default"].createElement(React__default["default"].Fragment, null);
|
|
7748
|
-
return (React__default["default"].createElement(SubotInlineIntentCol, { width: "auto" },
|
|
7749
|
-
React__default["default"].createElement(SubotInlineIntentFinalButtonContainer, null,
|
|
7750
|
-
React__default["default"].createElement(SubotInlineIntentButton, Object.assign({ size: "lg", color: "primary", onClick: handleOnClick, className: "pointer-event-child-none" }, trackingCommonInline, { "data-event-action": "Click CTA", "data-response-id": intent.id }),
|
|
7751
|
-
React__default["default"].createElement(Markdown, null, intent === null || intent === void 0 ? void 0 : intent.label)))));
|
|
7752
|
-
};
|
|
7753
|
-
//#endregion
|
|
7754
|
-
/*************************** END - NodeIntentType: 'bot-main-button' ***********/
|
|
7755
|
-
/*******************************************************************************/
|
|
7756
|
-
/*******************************************************************************/
|
|
7757
|
-
/*************************** NodeIntentType: 'bot-recalculate' *****************/
|
|
7758
|
-
//#region
|
|
7759
|
-
const SubotInlineIntentBotRecalculate = ({ intent }) => {
|
|
7760
|
-
const { onReset } = React.useContext(SubotInlineContext);
|
|
7761
|
-
const handleOnClick = () => {
|
|
7762
|
-
onReset && onReset();
|
|
7763
|
-
};
|
|
7764
|
-
if (!(intent === null || intent === void 0 ? void 0 : intent.label))
|
|
7765
|
-
return React__default["default"].createElement(React__default["default"].Fragment, null);
|
|
7766
|
-
return (React__default["default"].createElement(SubotInlineIntentCol, { width: "auto", style: { justifyContent: 'center', display: 'flex' } },
|
|
7767
|
-
React__default["default"].createElement(SubotInlineRecalculateButton, { size: "lg", color: "secondary", onClick: handleOnClick, icon: React__default["default"].createElement(RotateLeft, null), className: "bot-recalculate" },
|
|
7768
|
-
React__default["default"].createElement(Markdown, null, intent === null || intent === void 0 ? void 0 : intent.label))));
|
|
7769
|
-
};
|
|
7770
|
-
//#endregion
|
|
7771
|
-
/*************************** END - NodeIntentType: 'bot-recalculate' ***********/
|
|
7772
|
-
/*******************************************************************************/
|
|
7773
|
-
/*******************************************************************************/
|
|
7774
|
-
/*************************** NodeIntentType: 'bot-risk-screener' ***************/
|
|
7775
|
-
//#region
|
|
7776
|
-
const SubotInlineIntentBotRiskScreener = ({ intent }) => {
|
|
7777
|
-
const { formatMessage: f } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
7778
|
-
const article = React.useMemo(() => {
|
|
7779
|
-
if (intent.label && intent.label.includes('{')) {
|
|
7780
|
-
return JSON.parse(intent.label);
|
|
7781
|
-
}
|
|
7782
|
-
return {};
|
|
7783
|
-
}, [intent, intent === null || intent === void 0 ? void 0 : intent.label]);
|
|
7784
|
-
return (React__default["default"].createElement(React__default["default"].Fragment, null, !!(article === null || article === void 0 ? void 0 : article.title) && !!(article === null || article === void 0 ? void 0 : article.thumbnail) && !!(article === null || article === void 0 ? void 0 : article.url) && (React__default["default"].createElement(SubotInlineIntentFinalCol, null,
|
|
7785
|
-
React__default["default"].createElement(SubotInlineIntentRiskScreenerContainer, null,
|
|
7786
|
-
React__default["default"].createElement("a", { href: article === null || article === void 0 ? void 0 : article.url, className: "feature" },
|
|
7787
|
-
React__default["default"].createElement("img", { loading: "lazy", src: article === null || article === void 0 ? void 0 : article.thumbnail, alt: article === null || article === void 0 ? void 0 : article.title })),
|
|
7788
|
-
React__default["default"].createElement("div", { className: "title-container" },
|
|
7789
|
-
React__default["default"].createElement("a", { href: article === null || article === void 0 ? void 0 : article.url },
|
|
7790
|
-
React__default["default"].createElement("h5", { className: "title" }, article === null || article === void 0 ? void 0 : article.title)),
|
|
7791
|
-
React__default["default"].createElement("a", { href: article === null || article === void 0 ? void 0 : article.url, className: "link" },
|
|
7792
|
-
f({
|
|
7793
|
-
id: 'riskScreener.start',
|
|
7794
|
-
defaultMessage: 'Start',
|
|
7795
|
-
}),
|
|
7796
|
-
React__default["default"].createElement(ChevronRightActive, { style: { marginLeft: 10 } }))))))));
|
|
7797
|
-
};
|
|
7798
|
-
//#endregion
|
|
7799
|
-
/*************************** END - NodeIntentType: 'bot-risk-screener' *********/
|
|
7800
|
-
/*******************************************************************************/
|
|
7801
|
-
/*******************************************************************************/
|
|
7802
|
-
/*************************** NodeIntentType: 'bot-related-article' *************/
|
|
7803
|
-
//#region
|
|
7804
|
-
const SubotInlineIntentBotRelatedArticle = ({ intent }) => {
|
|
7805
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
7806
|
-
const article = React.useMemo(() => {
|
|
7807
|
-
if (intent.label && intent.label.includes('{')) {
|
|
7808
|
-
const _article = JSON.parse(intent.label);
|
|
7809
|
-
if (_article.meta) {
|
|
7810
|
-
const tmp = {};
|
|
7811
|
-
_article.meta.map(({ key, value }) => {
|
|
7812
|
-
if (key && value)
|
|
7813
|
-
tmp[key] = value;
|
|
7814
|
-
});
|
|
7815
|
-
_article.meta = Object.assign({}, tmp);
|
|
7816
|
-
}
|
|
7817
|
-
return Object.assign({}, _article);
|
|
7818
|
-
}
|
|
7819
|
-
return {};
|
|
7820
|
-
}, [intent, intent === null || intent === void 0 ? void 0 : intent.label]);
|
|
7821
|
-
return (React__default["default"].createElement(React__default["default"].Fragment, null, !!(article === null || article === void 0 ? void 0 : article.title) &&
|
|
7822
|
-
!!(article === null || article === void 0 ? void 0 : article.thumbnail) &&
|
|
7823
|
-
!!(article === null || article === void 0 ? void 0 : article.url) &&
|
|
7824
|
-
!!(article === null || article === void 0 ? void 0 : article.meta) &&
|
|
7825
|
-
!!((_a = article === null || article === void 0 ? void 0 : article.meta) === null || _a === void 0 ? void 0 : _a.post_modified) &&
|
|
7826
|
-
!!((_b = article === null || article === void 0 ? void 0 : article.meta) === null || _b === void 0 ? void 0 : _b.reviewed_display_name) &&
|
|
7827
|
-
!!((_c = article === null || article === void 0 ? void 0 : article.meta) === null || _c === void 0 ? void 0 : _c.reviewed_url) &&
|
|
7828
|
-
!!((_d = article === null || article === void 0 ? void 0 : article.meta) === null || _d === void 0 ? void 0 : _d.reviewed_avatar_thumbnail) &&
|
|
7829
|
-
!!((_e = article === null || article === void 0 ? void 0 : article.meta) === null || _e === void 0 ? void 0 : _e.category_url) &&
|
|
7830
|
-
!!((_f = article === null || article === void 0 ? void 0 : article.meta) === null || _f === void 0 ? void 0 : _f.category_name) && (React__default["default"].createElement(SubotInlineIntentFinalCol, { width: "40%" },
|
|
7831
|
-
React__default["default"].createElement(moleculesArticleCard.ArticleCard, { title: article === null || article === void 0 ? void 0 : article.title, uploadTime: dayjs__default["default"]((_g = article === null || article === void 0 ? void 0 : article.meta) === null || _g === void 0 ? void 0 : _g.post_modified).format('DD/MM/YYYY'), authorName: (_h = article === null || article === void 0 ? void 0 : article.meta) === null || _h === void 0 ? void 0 : _h.reviewed_display_name, authorLink: (_j = article === null || article === void 0 ? void 0 : article.meta) === null || _j === void 0 ? void 0 : _j.reviewed_url, avatarImg: React__default["default"].createElement("img", { loading: "lazy", src: (_k = article === null || article === void 0 ? void 0 : article.meta) === null || _k === void 0 ? void 0 : _k.reviewed_avatar_thumbnail, alt: (_l = article === null || article === void 0 ? void 0 : article.meta) === null || _l === void 0 ? void 0 : _l.reviewed_display_name }), categoryLink: (_m = article === null || article === void 0 ? void 0 : article.meta) === null || _m === void 0 ? void 0 : _m.category_url, categoryName: (_o = article === null || article === void 0 ? void 0 : article.meta) === null || _o === void 0 ? void 0 : _o.category_name, banner: React__default["default"].createElement("img", { loading: "lazy", src: article === null || article === void 0 ? void 0 : article.thumbnail, alt: article === null || article === void 0 ? void 0 : article.title }), text: "", size: "sm", direction: "vertical" })))));
|
|
7832
|
-
};
|
|
7833
|
-
//#endregion
|
|
7834
|
-
/*************************** END - NodeIntentType: 'bot-related-article' *******/
|
|
7835
|
-
/*******************************************************************************/
|
|
7836
|
-
/*******************************************************************************/
|
|
7837
|
-
/*************************** NodeIntentType: 'thank-you-image' *****************/
|
|
7838
|
-
//#region
|
|
7839
|
-
const SubotInlineIntentThankYouImage = ({ intent, }) => {
|
|
7840
|
-
if (!intent.url)
|
|
7841
|
-
return React__default["default"].createElement(React__default["default"].Fragment, null);
|
|
7842
|
-
return (React__default["default"].createElement(SubotInlineIntentFinalCol, null,
|
|
7843
|
-
React__default["default"].createElement(SubotInlineIntentImageContainer, null,
|
|
7844
|
-
React__default["default"].createElement("img", { loading: "lazy", src: intent.url, alt: intent.label, className: `intent-img ${intent.label && 'has-label'}` }),
|
|
7845
|
-
intent.label && (React__default["default"].createElement("h4", { className: "intent-img-label" },
|
|
7846
|
-
React__default["default"].createElement(Markdown, null, intent.label))))));
|
|
7847
|
-
};
|
|
7848
|
-
//#endregion
|
|
7849
|
-
/*************************** END - NodeIntentType: 'thank-you-image' ***********/
|
|
7850
|
-
/*******************************************************************************/
|
|
7851
|
-
/*******************************************************************************/
|
|
7852
|
-
/*************************** NodeIntentType: 'thank-you-title' *****************/
|
|
7853
|
-
//#region
|
|
7854
|
-
const SubotInlineIntentThankYouTitle = ({ intent, }) => {
|
|
7855
|
-
if (!intent.label)
|
|
7856
|
-
return React__default["default"].createElement(React__default["default"].Fragment, null);
|
|
7857
|
-
return (React__default["default"].createElement(SubotInlineIntentFinalCol, null,
|
|
7858
|
-
React__default["default"].createElement(SubotInlineIntentTitle, null,
|
|
7859
|
-
React__default["default"].createElement(Markdown, null, intent.label))));
|
|
7860
|
-
};
|
|
7861
|
-
//#endregion
|
|
7862
|
-
/*************************** END - NodeIntentType: 'thank-you-title' ***********/
|
|
7863
|
-
/*******************************************************************************/
|
|
7864
|
-
/*******************************************************************************/
|
|
7865
|
-
/*************************** NodeIntentType: 'thank-you-body' ******************/
|
|
7866
|
-
//#region
|
|
7867
|
-
const SubotInlineIntentThankYouBody = ({ intent, }) => {
|
|
7868
|
-
if (!intent.label)
|
|
7869
|
-
return React__default["default"].createElement(React__default["default"].Fragment, null);
|
|
7870
|
-
return (React__default["default"].createElement(SubotInlineIntentFinalCol, null,
|
|
7871
|
-
React__default["default"].createElement("div", { className: "intents__item markdown" },
|
|
7872
|
-
React__default["default"].createElement(Markdown, null, intent.label))));
|
|
7873
|
-
};
|
|
7874
|
-
//#endregion
|
|
7875
|
-
/*************************** END - NodeIntentType: 'thank-you-body' ************/
|
|
7876
|
-
/*******************************************************************************/
|
|
7877
|
-
const SubotInlineIntentBase = {
|
|
7878
|
-
[index$2.NodeIntentType.BOT_TEXT]: SubotInlineIntentBotText,
|
|
7879
|
-
[index$2.NodeIntentType.BOT_IMAGE]: SubotInlineIntentBotImage,
|
|
7880
|
-
[index$2.NodeIntentType.BOT_BUTTON]: SubotInlineIntentBotButton,
|
|
7881
|
-
[index$2.NodeIntentType.BOT_URL]: SubotInlineIntentUrl,
|
|
7882
|
-
[index$2.NodeIntentType.BOT_RECALCULATE]: SubotInlineIntentBotRecalculate,
|
|
7883
|
-
[index$2.NodeIntentType.BOT_MAIN_TITLE]: SubotInlineIntentBotMainTitle,
|
|
7884
|
-
[index$2.NodeIntentType.BOT_MAIN_IMAGE]: SubotInlineIntentBotMainImage,
|
|
7885
|
-
[index$2.NodeIntentType.BOT_MAIN_BODY]: SubotInlineIntentBotMainBody,
|
|
7886
|
-
[index$2.NodeIntentType.BOT_MAIN_BUTTON]: SubotInlineIntentBotMainButton,
|
|
7887
|
-
[index$2.NodeIntentType.BOT_SUB_TITLE]: SubotInlineIntentBotMainTitle,
|
|
7888
|
-
[index$2.NodeIntentType.BOT_SUB_BODY]: SubotInlineIntentBotMainBody,
|
|
7889
|
-
[index$2.NodeIntentType.BOT_LANDING_PAGE_URL]: SubotInlineIntentBotText,
|
|
7890
|
-
[index$2.NodeIntentType.BOT_LANDING_PAGE_BUTTON]: SubotInlineIntentBotText,
|
|
7891
|
-
[index$2.NodeIntentType.BOT_RISK_SCREEN]: SubotInlineIntentBotRiskScreener,
|
|
7892
|
-
[index$2.NodeIntentType.BOT_RELATED_ARTICLE]: SubotInlineIntentBotRelatedArticle,
|
|
7893
|
-
[index$2.NodeIntentType.THANK_YOU_IMAGE]: SubotInlineIntentThankYouImage,
|
|
7894
|
-
[index$2.NodeIntentType.THANK_YOU_TITLE]: SubotInlineIntentThankYouTitle,
|
|
7895
|
-
[index$2.NodeIntentType.THANK_YOU_BODY]: SubotInlineIntentThankYouBody,
|
|
7896
|
-
/** intents fake for sso block */
|
|
7897
|
-
[index$2.NodeIntentType.SSO_INTENT]: SubotInlineIntentSSO,
|
|
7898
|
-
};
|
|
7899
|
-
|
|
7900
|
-
/***************** type: TEXT, IMAGE ***************/
|
|
7901
|
-
const SubotInlineNode = ({ node, indexNumber, }) => {
|
|
7902
|
-
const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
7903
|
-
const { params, onChange, onSubmit, onPrev, onNext, nodes, activeId } = React.useContext(SubotInlineContext);
|
|
7904
|
-
const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
|
|
7905
|
-
const handleOnChangeNormal = (action) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
7906
|
-
const _message = Object.assign(Object.assign(Object.assign(Object.assign({}, params), value), { action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key }), getCurrentTotalDynamicScore(nodes, activeId, action.id));
|
|
7907
|
-
delete _message.form_submit_meta;
|
|
7908
|
-
const res = yield subotInlineMessage(_message);
|
|
7909
|
-
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
7910
|
-
const _a = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _a, restData = tslib_es6.__rest(_a, ["node"]);
|
|
7911
|
-
const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
|
|
7912
|
-
delete _nextNode._message.form_submit_meta;
|
|
7913
|
-
onSubmit && onSubmit(_nextNode, _message);
|
|
7914
|
-
}
|
|
7915
|
-
});
|
|
7916
|
-
const handleOnChange = (action, formSubmitMeta) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
7917
|
-
if (!action)
|
|
7918
|
-
return;
|
|
7919
|
-
const actionWithOther = (action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.USER_CHOICE_TEXT_BY_INPUT ||
|
|
7920
|
-
(action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.POLL_CHOICE_TEXT_BY_INPUT;
|
|
7921
|
-
const newValue = Object.assign(Object.assign({}, value), { action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key, form_submit_meta: formSubmitMeta });
|
|
7922
|
-
if (actionWithOther) {
|
|
7923
|
-
setValue(newValue);
|
|
7924
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
7925
|
-
return;
|
|
7926
|
-
}
|
|
7927
|
-
delete newValue.form_submit_meta;
|
|
7928
|
-
setValue(newValue);
|
|
7929
|
-
handleOnChangeNormal(action);
|
|
7930
|
-
});
|
|
7931
|
-
const handleOnNext = () => {
|
|
7932
|
-
const newMessage = JSON.parse(JSON.stringify(Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), value)));
|
|
7933
|
-
if ((value === null || value === void 0 ? void 0 : value.action_id) &&
|
|
7934
|
-
(value === null || value === void 0 ? void 0 : value.action_value) === KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD) {
|
|
7935
|
-
onNext === null || onNext === void 0 ? void 0 : onNext(newMessage);
|
|
7936
|
-
return;
|
|
7937
|
-
}
|
|
7938
|
-
if (!(value === null || value === void 0 ? void 0 : value.action_id) || !(value === null || value === void 0 ? void 0 : value.action_value)) {
|
|
7939
|
-
pushNotifications({
|
|
7940
|
-
title: '',
|
|
7941
|
-
message: f({
|
|
7942
|
-
id: 'multiSelectError.required',
|
|
7943
|
-
defaultMessage: `There is no answer!`,
|
|
7944
|
-
}),
|
|
7945
|
-
type: 'warning', // "success" | "danger" | "info" | "warning"
|
|
7946
|
-
});
|
|
7947
|
-
}
|
|
7948
|
-
else {
|
|
7949
|
-
delete newMessage.form_submit_meta;
|
|
7950
|
-
onNext === null || onNext === void 0 ? void 0 : onNext(newMessage);
|
|
7951
|
-
}
|
|
7952
|
-
};
|
|
7953
|
-
return (React__default["default"].createElement(SubotInlineContainer$1, null,
|
|
7954
|
-
React__default["default"].createElement(SubotInlineHeader$1, null),
|
|
7955
|
-
React__default["default"].createElement(SubotInlineWrapper$1, null,
|
|
7956
|
-
React__default["default"].createElement(SubotInlineIntentContainer, null,
|
|
7957
|
-
React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
|
|
7958
|
-
React__default["default"].createElement(SubotInlineActionContainer, null,
|
|
7959
|
-
React__default["default"].createElement(SubotInlineAction, { value: (value === null || value === void 0 ? void 0 : value.action_id) ? [value === null || value === void 0 ? void 0 : value.action_id] : [], actions: node === null || node === void 0 ? void 0 : node.actions, onChange: handleOnChange, formSubmitMeta: value === null || value === void 0 ? void 0 : value.form_submit_meta }))),
|
|
7960
|
-
React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, onNext: handleOnNext })));
|
|
7961
|
-
};
|
|
7962
|
-
|
|
7963
|
-
const SubotInlineNodeFinal = ({ node, }) => {
|
|
7964
|
-
var _a, _b;
|
|
7965
|
-
const fixHeight = 350;
|
|
7966
|
-
const { nodes } = React.useContext(SubotInlineContext);
|
|
7967
|
-
const { formatMessage: f } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
7968
|
-
const flag = React.useRef(null);
|
|
7969
|
-
const wrapper = React.useRef(null);
|
|
7970
|
-
const [height, setHeight] = React.useState(fixHeight);
|
|
7971
|
-
const [showMore, setShowMore] = React.useState(true);
|
|
7972
|
-
const [isMore, setIsMore] = React.useState(false);
|
|
7973
|
-
const handleOnClick = React.useCallback(() => {
|
|
7974
|
-
fastdom.measure(() => {
|
|
7975
|
-
var _a;
|
|
7976
|
-
if (wrapper.current) {
|
|
7977
|
-
const wrapperHeight = (_a = wrapper.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().height;
|
|
7978
|
-
if (height && height < wrapperHeight) {
|
|
7979
|
-
setHeight(wrapperHeight);
|
|
7980
|
-
setIsMore(true);
|
|
7981
|
-
}
|
|
7982
|
-
else {
|
|
7983
|
-
setHeight(fixHeight);
|
|
7984
|
-
setIsMore(false);
|
|
7985
|
-
}
|
|
7986
|
-
flag.current &&
|
|
7987
|
-
flag.current.scrollIntoView({
|
|
7988
|
-
behavior: 'smooth',
|
|
7989
|
-
block: 'start',
|
|
7990
|
-
inline: 'start',
|
|
7991
|
-
});
|
|
7992
|
-
}
|
|
7993
|
-
});
|
|
7994
|
-
}, [height]);
|
|
7995
|
-
React.useLayoutEffect(() => {
|
|
7996
|
-
fastdom.measure(() => {
|
|
7997
|
-
if (wrapper.current) {
|
|
7998
|
-
setTimeout(() => {
|
|
7999
|
-
var _a;
|
|
8000
|
-
const wrapperHeight = (_a = wrapper.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().height;
|
|
8001
|
-
if (wrapperHeight && height > wrapperHeight) {
|
|
8002
|
-
setShowMore(false);
|
|
8003
|
-
setIsMore(false);
|
|
8004
|
-
}
|
|
8005
|
-
}, 400);
|
|
8006
|
-
}
|
|
8007
|
-
});
|
|
8008
|
-
}, []);
|
|
8009
|
-
const botItem = nodes[0];
|
|
8010
|
-
const botType = (_a = botItem === null || botItem === void 0 ? void 0 : botItem.extra_settings) === null || _a === void 0 ? void 0 : _a.subot_type;
|
|
8011
|
-
const suggestedServiceIntents = React.useMemo(() => {
|
|
8012
|
-
var _a;
|
|
8013
|
-
return (((_a = node === null || node === void 0 ? void 0 : node.intents) === null || _a === void 0 ? void 0 : _a.filter((i) => i.type === index$2.NodeIntentType.BOT_SUGGESTED_SERVICE)) || []);
|
|
8014
|
-
}, []);
|
|
8015
|
-
return (React__default["default"].createElement(SubotInlineFinalContainer, null,
|
|
8016
|
-
React__default["default"].createElement("div", { ref: flag, className: "hhg-flag", style: {
|
|
8017
|
-
position: 'absolute',
|
|
8018
|
-
top: -100,
|
|
8019
|
-
left: 0,
|
|
8020
|
-
pointerEvents: 'none',
|
|
8021
|
-
} }),
|
|
8022
|
-
React__default["default"].createElement(SubotInlineFinalWrapper, { maxHeight: height, isMore: isMore },
|
|
8023
|
-
React__default["default"].createElement("div", { ref: wrapper },
|
|
8024
|
-
React__default["default"].createElement(SubotInlineIntentFinal, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [] }),
|
|
8025
|
-
suggestedServiceIntents.length > 0 && (React__default["default"].createElement("div", null, suggestedServiceIntents.map((intent) => {
|
|
8026
|
-
const NodeIntent = SubotInlineIntentBase$1[intent.type || ''];
|
|
8027
|
-
return (NodeIntent && React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent }));
|
|
8028
|
-
}))))),
|
|
8029
|
-
showMore && (React__default["default"].createElement(SubotInlineFinalMoreContainer, null,
|
|
8030
|
-
React__default["default"].createElement(SubotInlineFinalButton, { size: "md", color: "secondary", onClick: handleOnClick }, !isMore ? (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
8031
|
-
f({ id: 'subotInline.showMore', defaultMessage: 'Show more' }),
|
|
8032
|
-
React__default["default"].createElement(ArrowDown, { style: { marginLeft: 10 } }))) : (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
8033
|
-
f({ id: 'subotInline.showLess', defaultMessage: 'Show less' }),
|
|
8034
|
-
React__default["default"].createElement(ArrowUp, { style: { marginLeft: 10 } })))))),
|
|
8035
|
-
botType === index$2.SubotType.voucherAcuvue && (React__default["default"].createElement(SubotInlineVoucherLeftUI, { clientId: (_b = botItem.extra_settings) === null || _b === void 0 ? void 0 : _b.client_id, voucherAnswers: extractVoucherAnswers(nodes, botItem) }))));
|
|
8036
|
-
};
|
|
8037
|
-
|
|
8038
|
-
const SubotInlineResultButton = styled__default["default"].span `
|
|
8039
|
-
display: inline-block;
|
|
8040
|
-
margin-top: 20px;
|
|
8041
|
-
color: ${miscTheme.theme.colors.primaryBase || '#2D87F3'};
|
|
8042
|
-
cursor: pointer;
|
|
8043
|
-
transition: 0.3 all ease;
|
|
8044
|
-
&:hover {
|
|
8045
|
-
color: ${miscTheme.theme.colors.primaryHover || '#2D87F3'};
|
|
8046
|
-
}
|
|
8047
|
-
${utils.MediaQueries.tdDown} {
|
|
8048
|
-
margin-top: 16px;
|
|
8049
|
-
}
|
|
8050
|
-
${utils.MediaQueries.mbDown} {
|
|
8051
|
-
margin-top: 12px;
|
|
8052
|
-
}
|
|
8053
|
-
`;
|
|
8054
|
-
const SubotInlineWrapper = styled__default["default"].div `
|
|
8055
|
-
max-width: 430px;
|
|
8056
|
-
margin-right: auto;
|
|
8057
|
-
margin-left: auto;
|
|
8058
|
-
`;
|
|
8059
|
-
const SubotInlineContainer = styled__default["default"].div `
|
|
8060
|
-
padding: 44px 16px 32px;
|
|
8061
|
-
background-color: ${miscTheme.theme.colors.neutral50 || '#F7F9FC'};
|
|
8062
|
-
border-radius: ${miscTheme.theme.borderRadius};
|
|
8063
|
-
position: relative;
|
|
8064
|
-
text-align: center;
|
|
8065
|
-
${utils.MediaQueries.tdDown} {
|
|
8066
|
-
padding: 36px 16px 24px;
|
|
8067
|
-
}
|
|
8068
|
-
${utils.MediaQueries.mbDown} {
|
|
8069
|
-
padding: 16px;
|
|
8070
|
-
border-radius: 0px;
|
|
8071
|
-
}
|
|
8072
|
-
`;
|
|
8073
|
-
const SubotInlineNodeFinalThankYou = ({ node, }) => {
|
|
8074
|
-
var _a;
|
|
8075
|
-
const { params, onNext } = React.useContext(SubotInlineContext);
|
|
8076
|
-
const resultButton = React.useMemo(() => {
|
|
8077
|
-
var _a;
|
|
8078
|
-
const _resultButton = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type === index$2.NodeActionType.RESULT_BUTTON);
|
|
8079
|
-
if (_resultButton)
|
|
8080
|
-
return _resultButton;
|
|
8081
|
-
return null;
|
|
8082
|
-
}, [node === null || node === void 0 ? void 0 : node.actions]);
|
|
8083
|
-
const handleOnNext = React.useCallback(() => {
|
|
8084
|
-
onNext &&
|
|
8085
|
-
onNext(Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), { action_id: resultButton === null || resultButton === void 0 ? void 0 : resultButton.id, action_value: resultButton === null || resultButton === void 0 ? void 0 : resultButton.key }));
|
|
8086
|
-
}, [resultButton]);
|
|
8087
|
-
return (React__default["default"].createElement(SubotInlineContainer, null,
|
|
8088
|
-
React__default["default"].createElement(SubotInlineWrapper, null, (_a = node === null || node === void 0 ? void 0 : node.intents) === null || _a === void 0 ? void 0 :
|
|
8089
|
-
_a.map((intent) => {
|
|
8090
|
-
const NodeIntent = SubotInlineIntentBase[intent === null || intent === void 0 ? void 0 : intent.type];
|
|
8091
|
-
return NodeIntent && React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent });
|
|
8092
|
-
}),
|
|
8093
|
-
resultButton && (React__default["default"].createElement(SubotInlineResultButton, { onClick: handleOnNext }, resultButton === null || resultButton === void 0 ? void 0 : resultButton.label)))));
|
|
8094
|
-
};
|
|
8095
|
-
|
|
8096
|
-
const SubotInlineNodeForm = ({ node, indexNumber, }) => {
|
|
8097
|
-
var _a;
|
|
8098
|
-
const { data: { locale }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
8099
|
-
const { params, onPrev, onSubmit, trackingCommonInline, nodes, activeId } = React.useContext(SubotInlineContext);
|
|
8100
|
-
const handleSubmit = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
8101
|
-
const res = yield subotInlineMessage(Object.assign(Object.assign(Object.assign(Object.assign({}, params), node._message), data), getCurrentTotalDynamicScore(nodes, activeId, data.action_id, data.form_submit_meta)));
|
|
8102
|
-
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
8103
|
-
const _b = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _b, restData = tslib_es6.__rest(_b, ["node"]);
|
|
8104
|
-
const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
|
|
8105
|
-
onSubmit && onSubmit(_nextNode, Object.assign(Object.assign({}, node._message), data));
|
|
8106
|
-
}
|
|
8107
|
-
});
|
|
8108
|
-
return (React__default["default"].createElement(SubotInlineContainer$1, null,
|
|
8109
|
-
React__default["default"].createElement(SubotInlineHeader$1, null),
|
|
8110
|
-
React__default["default"].createElement(SubotInlineWrapper$1, null,
|
|
8111
|
-
React__default["default"].createElement(SubotInlineIntentContainer, null,
|
|
8112
|
-
React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
|
|
8113
|
-
React__default["default"].createElement(SubotInlineFormContainer, null,
|
|
8114
|
-
React__default["default"].createElement(UserInfoForm, { botId: params.bot_id, nodeId: String(node === null || node === void 0 ? void 0 : node.id), className: "form", actions: (node === null || node === void 0 ? void 0 : node.actions) || [], formSubmitMeta: ((_a = node === null || node === void 0 ? void 0 : node._message) === null || _a === void 0 ? void 0 : _a.form_submit_meta) || null, callBack: handleSubmit, countryCode: (locale === null || locale === void 0 ? void 0 : locale.split('-')[1]) || 'PH', trackingSubmitBtn: Object.assign(Object.assign({}, trackingCommonInline), { 'data-event-action': 'Submit' }) }))),
|
|
8115
|
-
React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, hideNext: true })));
|
|
8116
|
-
};
|
|
8117
|
-
|
|
8118
|
-
const SubotInlineNodeImage = ({ node, indexNumber, }) => {
|
|
8119
|
-
const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
8120
|
-
const { params, onSubmit, onPrev, onNext } = React.useContext(SubotInlineContext);
|
|
8121
|
-
const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
|
|
8122
|
-
const handleOnChange = (action) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
8123
|
-
if (action) {
|
|
8124
|
-
setValue(Object.assign(Object.assign({}, value), { action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key }));
|
|
8125
|
-
const _message = Object.assign(Object.assign(Object.assign({}, params), value), { node_id: node.id, action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key });
|
|
8126
|
-
const res = yield subotInlineMessage(_message);
|
|
8127
|
-
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
8128
|
-
const _a = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _a, restData = tslib_es6.__rest(_a, ["node"]);
|
|
8129
|
-
const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
|
|
8130
|
-
onSubmit && onSubmit(_nextNode, _message);
|
|
8131
|
-
}
|
|
8132
|
-
}
|
|
8133
|
-
});
|
|
8134
|
-
const handleOnNext = () => {
|
|
8135
|
-
var _a;
|
|
8136
|
-
if (!(node === null || node === void 0 ? void 0 : node._message) || !((_a = node._message) === null || _a === void 0 ? void 0 : _a.action_id)) {
|
|
8137
|
-
pushNotifications({
|
|
8138
|
-
title: '',
|
|
8139
|
-
message: f({
|
|
8140
|
-
id: 'multiSelectError.required',
|
|
8141
|
-
defaultMessage: `There is no answer!`,
|
|
8142
|
-
}),
|
|
8143
|
-
type: 'warning', // "success" | "danger" | "info" | "warning"
|
|
8144
|
-
});
|
|
8145
|
-
}
|
|
8146
|
-
else {
|
|
8147
|
-
onNext && onNext(Object.assign(Object.assign(Object.assign({}, params), value), node === null || node === void 0 ? void 0 : node._message));
|
|
8148
|
-
}
|
|
8149
|
-
};
|
|
8150
|
-
return (React__default["default"].createElement(SubotInlineContainer$1, null,
|
|
8151
|
-
React__default["default"].createElement(SubotInlineHeader$1, null),
|
|
8152
|
-
React__default["default"].createElement(SubotInlineWrapper$1, null,
|
|
8153
|
-
React__default["default"].createElement(SubotInlineIntentContainer, null,
|
|
8154
|
-
React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
|
|
8155
|
-
React__default["default"].createElement(SubotInlineActionContainer, null,
|
|
8156
|
-
React__default["default"].createElement(SubotInlineAction, { node_type: node === null || node === void 0 ? void 0 : node.type, value: (value === null || value === void 0 ? void 0 : value.action_id) ? [value === null || value === void 0 ? void 0 : value.action_id] : [], actions: node === null || node === void 0 ? void 0 : node.actions, onChange: handleOnChange }))),
|
|
8157
|
-
React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, onNext: handleOnNext })));
|
|
8158
|
-
};
|
|
8159
|
-
|
|
8160
|
-
const SubotInlineNodeMultiple = ({ node, indexNumber, }) => {
|
|
8161
|
-
const { params, onChange, onPrev, onNext } = React.useContext(SubotInlineContext);
|
|
8162
|
-
const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
8163
|
-
const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
|
|
8164
|
-
const submitButton = React.useMemo(() => {
|
|
8165
|
-
var _a;
|
|
8166
|
-
const _submitButton = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type == index$2.NodeActionType.ACTION_MULTIPLE_BUTTON);
|
|
8167
|
-
if (_submitButton)
|
|
8168
|
-
return _submitButton;
|
|
8169
|
-
return null;
|
|
8170
|
-
}, [node === null || node === void 0 ? void 0 : node.actions]);
|
|
8171
|
-
const activeActions = React.useMemo(() => {
|
|
8172
|
-
if (value === null || value === void 0 ? void 0 : value.selected_actions) {
|
|
8173
|
-
return Object.keys(value === null || value === void 0 ? void 0 : value.selected_actions);
|
|
8174
|
-
}
|
|
8175
|
-
return [];
|
|
8176
|
-
}, [value, value === null || value === void 0 ? void 0 : value.selected_actions]);
|
|
8177
|
-
const validateSelectActions = (selected_actions, callBack) => {
|
|
8178
|
-
const activeActions = Object.keys(selected_actions);
|
|
8179
|
-
if (!activeActions.length) {
|
|
8180
|
-
pushNotifications({
|
|
8181
|
-
title: '',
|
|
8182
|
-
message: f({
|
|
8183
|
-
id: 'multiSelectError.required',
|
|
8184
|
-
defaultMessage: `There is no answer!`,
|
|
8185
|
-
}),
|
|
8186
|
-
type: 'warning', // "success" | "danger" | "info" | "warning"
|
|
8187
|
-
});
|
|
8188
|
-
return;
|
|
8189
|
-
}
|
|
8190
|
-
else if ((node === null || node === void 0 ? void 0 : node.multi_select_option) === index$2.NodeMultipleOptions.RANGE &&
|
|
8191
|
-
activeActions.length < (node === null || node === void 0 ? void 0 : node.from)) {
|
|
8192
|
-
pushNotifications({
|
|
8193
|
-
title: '',
|
|
8194
|
-
message: f({
|
|
8195
|
-
id: 'multiSelectError.range',
|
|
8196
|
-
defaultMessage: 'You must choose from {from} to {to} answers (Ex: You must choose from 3 to 5 answers)',
|
|
8197
|
-
}, {
|
|
8198
|
-
from: node.from,
|
|
8199
|
-
to: node.to,
|
|
8200
|
-
}),
|
|
8201
|
-
type: 'warning', // "success" | "danger" | "info" | "warning"
|
|
8202
|
-
});
|
|
8203
|
-
return;
|
|
8204
|
-
}
|
|
8205
|
-
else if ((node === null || node === void 0 ? void 0 : node.multi_select_option) === index$2.NodeMultipleOptions.EXACT_NUMBER &&
|
|
8206
|
-
activeActions.length !== (node === null || node === void 0 ? void 0 : node.from)) {
|
|
8207
|
-
pushNotifications({
|
|
8208
|
-
message: f({
|
|
8209
|
-
id: 'multiSelectError.exactNumber',
|
|
8210
|
-
defaultMessage: 'You must choose {from} answers.',
|
|
8211
|
-
}, {
|
|
8212
|
-
from: node.from,
|
|
8213
|
-
}),
|
|
8214
|
-
type: 'warning', // "success" | "danger" | "info" | "warning"
|
|
8215
|
-
});
|
|
8216
|
-
return;
|
|
8217
|
-
}
|
|
8218
|
-
else {
|
|
8219
|
-
callBack();
|
|
8220
|
-
}
|
|
8221
|
-
};
|
|
8222
|
-
const handleOnClick = (action, formSubmitMeta) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
8223
|
-
var _a, _b;
|
|
8224
|
-
if (action) {
|
|
8225
|
-
const _value = JSON.parse(JSON.stringify(Object.assign(Object.assign({}, value), { action_id: submitButton === null || submitButton === void 0 ? void 0 : submitButton.id, action_value: submitButton === null || submitButton === void 0 ? void 0 : submitButton.key, selected_actions: Object.assign({}, value === null || value === void 0 ? void 0 : value.selected_actions) })));
|
|
8226
|
-
if ((action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.POLL_CHOICE_TEXT_BY_INPUT ||
|
|
8227
|
-
(action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.USER_CHOICE_TEXT_BY_INPUT) {
|
|
8228
|
-
const isExistedPoll = (_value === null || _value === void 0 ? void 0 : _value.selected_actions) && action.id in _value.selected_actions;
|
|
8229
|
-
if (isExistedPoll) {
|
|
8230
|
-
if (formSubmitMeta) {
|
|
8231
|
-
_value.form_submit_meta = formSubmitMeta;
|
|
8232
|
-
}
|
|
8233
|
-
else {
|
|
8234
|
-
delete _value.form_submit_meta;
|
|
8235
|
-
(_a = _value.selected_actions) === null || _a === void 0 ? true : delete _a[action.id];
|
|
8236
|
-
}
|
|
8237
|
-
}
|
|
8238
|
-
else {
|
|
8239
|
-
if (action === null || action === void 0 ? void 0 : action.id) {
|
|
8240
|
-
_value.selected_actions = Object.assign(Object.assign({}, _value.selected_actions), { [action.id]: action.key || '' });
|
|
8241
|
-
}
|
|
8242
|
-
}
|
|
8243
|
-
setValue(_value);
|
|
8244
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(_value);
|
|
8245
|
-
return;
|
|
8246
|
-
}
|
|
8247
|
-
if (!((_b = _value.selected_actions) === null || _b === void 0 ? void 0 : _b[action.id])) {
|
|
8248
|
-
_value.selected_actions = Object.assign(Object.assign({}, _value.selected_actions), { [action.id]: action.key || '' });
|
|
8249
|
-
onChange && onChange(_value);
|
|
8250
|
-
setValue(_value);
|
|
8251
|
-
return;
|
|
8252
|
-
}
|
|
8253
|
-
if (_value.selected_actions[action.id]) {
|
|
8254
|
-
delete _value.selected_actions[action.id];
|
|
8255
|
-
onChange && onChange(_value);
|
|
8256
|
-
setValue(_value);
|
|
8257
|
-
return;
|
|
8258
|
-
}
|
|
8259
|
-
}
|
|
8260
|
-
});
|
|
8261
|
-
const handleOnNext = React.useCallback(() => {
|
|
8262
|
-
validateSelectActions((value === null || value === void 0 ? void 0 : value.selected_actions) || {}, () => {
|
|
8263
|
-
onNext &&
|
|
8264
|
-
onNext(Object.assign(Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), value), { node_id: node.id }));
|
|
8265
|
-
});
|
|
8266
|
-
}, [value, value === null || value === void 0 ? void 0 : value.selected_actions, onNext]);
|
|
8267
|
-
return (React__default["default"].createElement(SubotInlineContainer$1, null,
|
|
8268
|
-
React__default["default"].createElement(SubotInlineHeader$1, null),
|
|
8269
|
-
React__default["default"].createElement(SubotInlineWrapper$1, null,
|
|
8270
|
-
React__default["default"].createElement(SubotInlineIntentContainer, null,
|
|
8271
|
-
React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
|
|
8272
|
-
React__default["default"].createElement(SubotInlineActionContainer, null,
|
|
8273
|
-
React__default["default"].createElement(SubotInlineAction, { value: activeActions, actions: node === null || node === void 0 ? void 0 : node.actions, onChange: handleOnClick, htmlType: "checkbox", formSubmitMeta: value === null || value === void 0 ? void 0 : value.form_submit_meta }))),
|
|
8274
|
-
React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, nextText: submitButton ? submitButton === null || submitButton === void 0 ? void 0 : submitButton.label : '', onNext: handleOnNext })));
|
|
8275
|
-
};
|
|
8276
|
-
|
|
8277
|
-
const OTPInfoForm = ({ className, style, actions, countryCode, phoneNumber, areaCode,
|
|
8278
|
-
// verified,
|
|
8279
|
-
callBack, }) => {
|
|
8280
|
-
const countRef = React.useRef();
|
|
8281
|
-
const [isFinishedCountDown, setIsFinishedCountDown] = React.useState(false);
|
|
8282
|
-
const [isLoading, setIsLoading] = React.useState(false);
|
|
8283
|
-
const [isLoadingVerify, setIsLoadingVerify] = React.useState(false);
|
|
8284
|
-
const [sentOTP, setSentOTP] = React.useState(false);
|
|
8285
|
-
const { register, formState: { errors }, control, trigger, getValues, setValue, } = reactHookForm.useForm();
|
|
8286
|
-
const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
8287
|
-
// useEffect(() => {
|
|
8288
|
-
// const actionPhone = actions.find(
|
|
8289
|
-
// (action) => action.type === NodeActionType.USER_SUBMIT_PHONE,
|
|
8290
|
-
// )
|
|
8291
|
-
// actionPhone?.key && setValue(actionPhone.key, '+84343261825')
|
|
8292
|
-
// setSentOTP(true)
|
|
8293
|
-
// }, [])
|
|
8294
|
-
// const placeholderPhone = useMemo(() => {
|
|
8295
|
-
// return actions.find(({ type }) => type === NodeActionType.USER_SUBMIT_PHONE)
|
|
8296
|
-
// ?.label
|
|
8297
|
-
// }, [actions])
|
|
8298
|
-
// const placeholderOtp = useMemo(() => {
|
|
8299
|
-
// return actions.find(
|
|
8300
|
-
// ({ type }) => type === NodeActionType.USER_SUBMIT_NUMBER,
|
|
8301
|
-
// )?.label
|
|
8302
|
-
// }, [actions])
|
|
8303
|
-
// const labelBtnSendOtp = 'Gửi mã OTP'
|
|
8304
|
-
// const labelBtnVerifyOtp = useMemo(() => {
|
|
8305
|
-
// return (
|
|
8306
|
-
// actions.find(({ type }) => type === NodeActionType.USER_SUBMIT_SEND)
|
|
8307
|
-
// ?.label || 'Xác minh mã OTP'
|
|
8308
|
-
// )
|
|
8309
|
-
// }, [actions])
|
|
8310
|
-
// const labelBtnResendOtp = useMemo(() => {
|
|
8311
|
-
// return (
|
|
8312
|
-
// actions.find(({ type }) => type === NodeActionType.USER_SUBMIT_RESEND)
|
|
8313
|
-
// ?.label || 'Gửi lại mã OTP'
|
|
8314
|
-
// )
|
|
8315
|
-
// }, [actions])
|
|
8316
|
-
const handleSendOTP = (event) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
8317
|
-
var _a;
|
|
8318
|
-
event.preventDefault();
|
|
8319
|
-
const data = getValues();
|
|
8320
|
-
const parsedPhone = PhoneInputBase.parsePhoneNumber(data.phone || '');
|
|
8321
|
-
if (!(parsedPhone === null || parsedPhone === void 0 ? void 0 : parsedPhone.nationalNumber) || !(parsedPhone === null || parsedPhone === void 0 ? void 0 : parsedPhone.countryCallingCode)) {
|
|
8322
|
-
return;
|
|
8323
|
-
}
|
|
8324
|
-
setIsLoading(true);
|
|
8325
|
-
try {
|
|
8326
|
-
const result = yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.POST_SEND_OTP), 'POST', {
|
|
8327
|
-
data: {
|
|
8328
|
-
phone_number: parsedPhone.nationalNumber,
|
|
8329
|
-
area_code: `+${parsedPhone.countryCallingCode}`,
|
|
8330
|
-
},
|
|
8331
|
-
});
|
|
8332
|
-
setIsLoading(false);
|
|
8333
|
-
if ((result === null || result === void 0 ? void 0 : result._status) === 1) {
|
|
8334
|
-
if (sentOTP) {
|
|
8335
|
-
setIsFinishedCountDown(false);
|
|
8336
|
-
countRef.current.reset();
|
|
8337
|
-
}
|
|
8338
|
-
setSentOTP(true);
|
|
8339
|
-
setTimeout(() => {
|
|
8340
|
-
const input = document.querySelector('.input-otp-code');
|
|
8341
|
-
if (input) {
|
|
8342
|
-
input.focus();
|
|
8343
|
-
input.scrollIntoView({ block: 'center' });
|
|
8344
|
-
}
|
|
8345
|
-
}, 100);
|
|
8346
|
-
return;
|
|
8347
|
-
}
|
|
8348
|
-
if ((result === null || result === void 0 ? void 0 : result._status) === 0 &&
|
|
8349
|
-
((_a = result === null || result === void 0 ? void 0 : result._messages) === null || _a === void 0 ? void 0 : _a[0]) === 'This phone number was verified') {
|
|
8350
|
-
// const { _messages } = result
|
|
8351
|
-
if (countRef.current) {
|
|
8352
|
-
countRef.current.cancel();
|
|
8353
|
-
}
|
|
8354
|
-
pushNotifications({
|
|
8355
|
-
title: '',
|
|
8356
|
-
message: 'Số điện thoại này đã được xác minh.',
|
|
8357
|
-
type: 'success',
|
|
8358
|
-
});
|
|
8359
|
-
const action = actions.find((action) => action.type === index$2.NodeActionType.USER_SUBMIT_SEND);
|
|
8360
|
-
action && callBack(action, data.phone);
|
|
8361
|
-
return;
|
|
8362
|
-
}
|
|
8363
|
-
throw new Error();
|
|
8364
|
-
}
|
|
8365
|
-
catch (error) {
|
|
8366
|
-
setIsLoading(false);
|
|
8367
|
-
if (countRef.current) {
|
|
8368
|
-
countRef.current.cancel();
|
|
8369
|
-
}
|
|
8370
|
-
showMessageSomethingWrong();
|
|
8371
|
-
}
|
|
8372
|
-
});
|
|
8373
|
-
const handleOnVerify = (event, action) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
8374
|
-
event.preventDefault();
|
|
8375
|
-
setIsLoadingVerify(true);
|
|
8376
|
-
yield trigger();
|
|
8377
|
-
if (isEmpty__default["default"](errors)) {
|
|
8378
|
-
const data = getValues();
|
|
8379
|
-
const { number } = data;
|
|
8380
|
-
const parsedPhone = PhoneInputBase.parsePhoneNumber(data.phone || '');
|
|
8381
|
-
if (!(parsedPhone === null || parsedPhone === void 0 ? void 0 : parsedPhone.nationalNumber) || !(parsedPhone === null || parsedPhone === void 0 ? void 0 : parsedPhone.countryCallingCode)) {
|
|
8382
|
-
return;
|
|
8383
|
-
}
|
|
8384
|
-
try {
|
|
8385
|
-
const result = yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.POST_VERIFY_OTP), 'POST', {
|
|
8386
|
-
data: {
|
|
8387
|
-
phone_number: parsedPhone.nationalNumber,
|
|
8388
|
-
area_code: `+${parsedPhone.countryCallingCode}`,
|
|
8389
|
-
code: number,
|
|
8390
|
-
},
|
|
8391
|
-
});
|
|
8392
|
-
setIsLoadingVerify(false);
|
|
8393
|
-
if ((result === null || result === void 0 ? void 0 : result._status) === 1) {
|
|
8394
|
-
pushNotifications({
|
|
8395
|
-
title: '',
|
|
8396
|
-
message: f({ id: 'subot.verifyOTP.success.message' }),
|
|
8397
|
-
type: 'success',
|
|
8398
|
-
});
|
|
8399
|
-
callBack(action, data.phone);
|
|
8400
|
-
return;
|
|
8401
|
-
}
|
|
8402
|
-
throw new Error();
|
|
8403
|
-
}
|
|
8404
|
-
catch (error) {
|
|
8405
|
-
pushNotifications({
|
|
8406
|
-
title: '',
|
|
8407
|
-
message: f({ id: 'validation.error.validOTP' }),
|
|
8408
|
-
type: 'danger',
|
|
8409
|
-
});
|
|
8410
|
-
setIsLoadingVerify(false);
|
|
8411
|
-
}
|
|
8412
|
-
}
|
|
8413
|
-
else {
|
|
8414
|
-
setIsLoadingVerify(false);
|
|
8415
|
-
}
|
|
8416
|
-
});
|
|
8417
|
-
const showMessageSomethingWrong = () => {
|
|
8418
|
-
pushNotifications({
|
|
8419
|
-
title: '',
|
|
8420
|
-
message: f({ id: 'notification.comment.somethingWrong' }),
|
|
8421
|
-
type: 'danger',
|
|
8422
|
-
});
|
|
8423
|
-
};
|
|
8424
|
-
const renderFormInput = (action) => {
|
|
8425
|
-
if (!action.key) {
|
|
8426
|
-
return null;
|
|
8427
|
-
}
|
|
8428
|
-
switch (action.type) {
|
|
8429
|
-
case index$2.NodeActionType.USER_SUBMIT_PHONE:
|
|
8430
|
-
return (React__default["default"].createElement("div", { className: "input-row", key: action.id },
|
|
8431
|
-
React__default["default"].createElement("label", { htmlFor: action.key }, action.label),
|
|
8432
|
-
React__default["default"].createElement(reactHookForm.Controller, { name: action.key, control: control, rules: {
|
|
8433
|
-
required: true,
|
|
8434
|
-
validate: (value) => PhoneInputBase.isPossiblePhoneNumber(value),
|
|
8435
|
-
}, render: ({ field: { onChange, value } }) => {
|
|
8436
|
-
const disabledPhone = (!isFinishedCountDown && sentOTP) || isLoading;
|
|
8437
|
-
return (React__default["default"].createElement(StyleWrapperPhoneInput, null,
|
|
8438
|
-
React__default["default"].createElement(PhoneInputWithCode, { value: value, defaultValue: phoneNumber, onChange: onChange, defaultCountry: countryCode, id: action.id, className: `input-row ${action.id}`, name: action.key, disabled: disabledPhone, flagComponent: FlagComponent, placeholder: action.label }),
|
|
8439
|
-
disabledPhone && (React__default["default"].createElement(IconEdit, { viewBox: "0 0 24 24", className: "icon-edit-phone", onClick: () => {
|
|
8440
|
-
var _a;
|
|
8441
|
-
onChange('');
|
|
8442
|
-
setSentOTP(false);
|
|
8443
|
-
setIsLoadingVerify(false);
|
|
8444
|
-
(_a = countRef.current) === null || _a === void 0 ? void 0 : _a.cancel();
|
|
8445
|
-
} })),
|
|
8446
|
-
action.key && errors[action.key] && (React__default["default"].createElement("p", { className: "error-message" }, f({
|
|
8447
|
-
id: 'validation.error.validNumber',
|
|
8448
|
-
defaultMessage: 'Please enter a valid number.',
|
|
8449
|
-
}))),
|
|
8450
|
-
React__default["default"].createElement("div", { className: "submit-btn-row", key: action.id },
|
|
8451
|
-
React__default["default"].createElement(index$8.Button, { className: "submit-btn", size: "lg", onClick: handleSendOTP, isDisabled: (!isFinishedCountDown && sentOTP) || isLoading, isLoading: isLoading }, sentOTP ? (React__default["default"].createElement(CountDown$1, { ref: countRef, isFinished: isFinishedCountDown, onFinish: setIsFinishedCountDown })) : (React__default["default"].createElement("span", null, f({
|
|
8452
|
-
id: 'subot.sendOTP.button',
|
|
8453
|
-
defaultMessage: 'Send OTP',
|
|
8454
|
-
})))))));
|
|
8455
|
-
} })));
|
|
8456
|
-
case index$2.NodeActionType.USER_SUBMIT_NUMBER:
|
|
8457
|
-
if (!sentOTP) {
|
|
8458
|
-
return '';
|
|
8459
|
-
}
|
|
8460
|
-
return (React__default["default"].createElement("div", { className: "input-row", key: action.id },
|
|
8461
|
-
React__default["default"].createElement("label", { htmlFor: action.key }, action.label),
|
|
8462
|
-
React__default["default"].createElement("input", Object.assign({ type: "tel", id: action.id, placeholder: action.label }, register(action.key, {
|
|
8463
|
-
required: true,
|
|
8464
|
-
pattern: /^[0-9]{0,6}$/,
|
|
8465
|
-
}), { className: "input-otp-code" })),
|
|
8466
|
-
errors[action.key] && (React__default["default"].createElement("p", { className: "error-message" }, f({
|
|
8467
|
-
id: 'validation.error.validOTP',
|
|
8468
|
-
defaultMessage: 'Invalid OTP provided',
|
|
8469
|
-
})))));
|
|
8470
|
-
default:
|
|
8471
|
-
return '';
|
|
8472
|
-
}
|
|
8473
|
-
};
|
|
8474
|
-
const renderFormSubmitAndTerms = (action) => {
|
|
8475
|
-
switch (action.type) {
|
|
8476
|
-
case index$2.NodeActionType.USER_SUBMIT_SEND:
|
|
8477
|
-
if (!sentOTP)
|
|
8478
|
-
return '';
|
|
8479
|
-
return (React__default["default"].createElement("div", { className: "submit-btn-row", key: action.id },
|
|
8480
|
-
React__default["default"].createElement(index$8.Button, { className: "submit-btn", size: "lg", isDisabled: isLoadingVerify, isLoading: isLoadingVerify, onClick: (event) => handleOnVerify(event, action) }, action.label)));
|
|
8481
|
-
default:
|
|
8482
|
-
return '';
|
|
8483
|
-
}
|
|
8484
|
-
};
|
|
8485
|
-
React.useEffect(() => {
|
|
8486
|
-
if (phoneNumber) {
|
|
8487
|
-
const action = actions.find((action) => action.type === index$2.NodeActionType.USER_SUBMIT_PHONE);
|
|
8488
|
-
if (action && action.key) {
|
|
8489
|
-
setValue(action.key, `+${areaCode}${phoneNumber}`);
|
|
8490
|
-
}
|
|
8491
|
-
}
|
|
8492
|
-
}, [phoneNumber, areaCode]);
|
|
8493
|
-
return (React__default["default"].createElement(StyledUserInfoFormContainer$1, { className: className, style: style },
|
|
8494
|
-
React__default["default"].createElement("form", { className: "user-info-form" },
|
|
8495
|
-
actions.map((action) => renderFormInput(action)),
|
|
8496
|
-
actions.map((action) => renderFormSubmitAndTerms(action)))));
|
|
8497
|
-
};
|
|
8498
|
-
|
|
8499
|
-
const useVerifyPhoneNumber = () => {
|
|
8500
|
-
const userInfo = togetherComponentGlobalContext.GlobalData === null || togetherComponentGlobalContext.GlobalData === void 0 ? void 0 : togetherComponentGlobalContext.GlobalData.userInfo;
|
|
8501
|
-
const [verifiedPhone, setVerifiedPhone] = React.useState(false);
|
|
8502
|
-
React.useEffect(() => {
|
|
8503
|
-
if (userInfo === null || userInfo === void 0 ? void 0 : userInfo.phone) {
|
|
8504
|
-
if (userInfo.phone_verified_at && userInfo.verify_phone_code) {
|
|
8505
|
-
setVerifiedPhone(true);
|
|
8506
|
-
}
|
|
8507
|
-
}
|
|
8508
|
-
}, [userInfo]);
|
|
8509
|
-
return verifiedPhone;
|
|
8510
|
-
};
|
|
8511
|
-
|
|
8512
|
-
const SubotInlineNodeOTP = ({ node, indexNumber, }) => {
|
|
8513
|
-
const { params, onPrev, onNext } = React.useContext(SubotInlineContext);
|
|
8514
|
-
const userInfo = togetherComponentGlobalContext.GlobalData === null || togetherComponentGlobalContext.GlobalData === void 0 ? void 0 : togetherComponentGlobalContext.GlobalData.userInfo;
|
|
8515
|
-
const locale = togetherComponentGlobalContext.GlobalData === null || togetherComponentGlobalContext.GlobalData === void 0 ? void 0 : togetherComponentGlobalContext.GlobalData.locale;
|
|
8516
|
-
const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
|
|
8517
|
-
const verifiedPhone = useVerifyPhoneNumber();
|
|
8518
|
-
const handleOnVerify = (action, phoneNumber) => {
|
|
8519
|
-
var _a;
|
|
8520
|
-
const actionPhone = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type === index$2.NodeActionType.USER_SUBMIT_PHONE);
|
|
8521
|
-
if (!action || !actionPhone) {
|
|
8522
|
-
return;
|
|
8523
|
-
}
|
|
8524
|
-
const form_submit_meta = [
|
|
8525
|
-
{
|
|
8526
|
-
key: String(actionPhone.key),
|
|
8527
|
-
control: index$2.ELEMENT_CONTROL_INPUT_TYPE[index$2.NodeActionType.USER_SUBMIT_PHONE],
|
|
8528
|
-
value: phoneNumber,
|
|
8529
|
-
},
|
|
8530
|
-
];
|
|
8531
|
-
const newValue = Object.assign(Object.assign({}, value), { form_submit_meta, action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key });
|
|
8532
|
-
setValue(newValue);
|
|
8533
|
-
onNext && onNext(Object.assign(Object.assign(Object.assign({}, params), newValue), node === null || node === void 0 ? void 0 : node._message));
|
|
8534
|
-
};
|
|
8535
|
-
return (React__default["default"].createElement(SubotInlineContainer$1, null,
|
|
8536
|
-
React__default["default"].createElement(SubotInlineHeader$1, null),
|
|
8537
|
-
React__default["default"].createElement(SubotInlineWrapper$1, null,
|
|
8538
|
-
React__default["default"].createElement(SubotInlineIntentContainer, null,
|
|
8539
|
-
React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
|
|
8540
|
-
React__default["default"].createElement(SubotInlineActionContainer, null,
|
|
8541
|
-
React__default["default"].createElement(OTPInfoForm, { phoneNumber: userInfo === null || userInfo === void 0 ? void 0 : userInfo.phone, verified: verifiedPhone, areaCode: userInfo === null || userInfo === void 0 ? void 0 : userInfo.area_code, callBack: handleOnVerify, actions: (node === null || node === void 0 ? void 0 : node.actions) || [], countryCode: (locale === null || locale === void 0 ? void 0 : locale.split('-')[1]) || 'PH' }))),
|
|
8542
|
-
React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, hideNext: true })));
|
|
8543
|
-
};
|
|
8544
|
-
|
|
8545
|
-
// Poll Message
|
|
8546
|
-
// {
|
|
8547
|
-
// form_meta: [
|
|
8548
|
-
// { key: "poll4", control: "formmeta", value: "", action_id: "action.id" },
|
|
8549
|
-
// { key: "poll2", control: "formmeta", value: "", action_id: "action.id" },
|
|
8550
|
-
// { key: "poll3", control: "formmeta", value: "", action_id: "action.id" },
|
|
8551
|
-
// { key: 'attribite-description', control:"formmeta-description", value: '', action_id: "action.id"}
|
|
8552
|
-
// ],
|
|
8553
|
-
// action_id: "button_id",
|
|
8554
|
-
// action_value: "button_attribute"
|
|
8555
|
-
// }
|
|
8556
|
-
const SubotInlineNodePoll = ({ node, indexNumber, }) => {
|
|
8557
|
-
var _a, _b;
|
|
8558
|
-
const { params, onChange, onPrev, onNext } = React.useContext(SubotInlineContext);
|
|
8559
|
-
const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
|
|
8560
|
-
const validation = useValidationMultiOption();
|
|
8561
|
-
const descriptionNode = useDescriptionPollNode({ node });
|
|
8562
|
-
const submitButton = React.useMemo(() => {
|
|
8563
|
-
var _a;
|
|
8564
|
-
const _submitButton = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type == index$2.NodeActionType.POLL_BUTTON);
|
|
8565
|
-
if (_submitButton)
|
|
8566
|
-
return _submitButton;
|
|
8567
|
-
return null;
|
|
8568
|
-
}, [node === null || node === void 0 ? void 0 : node.actions]);
|
|
8569
|
-
const handleOnChange = (action, formSubmitMeta) => {
|
|
8570
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
8571
|
-
const newValue = JSON.parse(JSON.stringify(Object.assign(Object.assign({}, value), { node_id: node.id, action_id: submitButton === null || submitButton === void 0 ? void 0 : submitButton.id, action_value: submitButton === null || submitButton === void 0 ? void 0 : submitButton.key, form_submit_meta: [...((value === null || value === void 0 ? void 0 : value.form_submit_meta) || [])] })));
|
|
8572
|
-
if ((action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.POLL_CHOICE_TEXT_BY_INPUT ||
|
|
8573
|
-
(action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.USER_CHOICE_TEXT_BY_INPUT) {
|
|
8574
|
-
const isExistedPoll = (_a = newValue.form_submit_meta) === null || _a === void 0 ? void 0 : _a.some(({ action_id }) => action_id === action.id);
|
|
8575
|
-
if (isExistedPoll) {
|
|
8576
|
-
newValue.form_submit_meta =
|
|
8577
|
-
typeof formSubmitMeta === 'undefined'
|
|
8578
|
-
? (_b = newValue.form_submit_meta) === null || _b === void 0 ? void 0 : _b.filter(({ action_id }) => action_id !== action.id)
|
|
8579
|
-
: (_c = newValue.form_submit_meta) === null || _c === void 0 ? void 0 : _c.filter(({ action_id }) => action_id !== action.id).concat(formSubmitMeta);
|
|
8580
|
-
}
|
|
8581
|
-
else {
|
|
8582
|
-
newValue.form_submit_meta = (_d = newValue.form_submit_meta) === null || _d === void 0 ? void 0 : _d.concat([
|
|
8583
|
-
{
|
|
8584
|
-
key: action === null || action === void 0 ? void 0 : action.key,
|
|
8585
|
-
control: index$2.ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type] || 'text',
|
|
8586
|
-
value: '',
|
|
8587
|
-
action_id: action === null || action === void 0 ? void 0 : action.id,
|
|
8588
|
-
},
|
|
8589
|
-
]);
|
|
8590
|
-
}
|
|
8591
|
-
setValue(newValue);
|
|
8592
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
8593
|
-
return;
|
|
8594
|
-
}
|
|
8595
|
-
const isPoll = (_e = newValue.form_submit_meta) === null || _e === void 0 ? void 0 : _e.some(({ action_id }) => action_id === (action === null || action === void 0 ? void 0 : action.action_id));
|
|
8596
|
-
if (isPoll) {
|
|
8597
|
-
newValue.form_submit_meta = (_f = newValue.form_submit_meta) === null || _f === void 0 ? void 0 : _f.filter(({ action_id }) => action_id !== (action === null || action === void 0 ? void 0 : action.action_id));
|
|
8598
|
-
}
|
|
8599
|
-
else {
|
|
8600
|
-
newValue.form_submit_meta = (_g = newValue.form_submit_meta) === null || _g === void 0 ? void 0 : _g.concat([action]);
|
|
8601
|
-
}
|
|
8602
|
-
setValue(newValue);
|
|
8603
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
8604
|
-
};
|
|
8605
|
-
const activeActions = React.useMemo(() => {
|
|
8606
|
-
if (value === null || value === void 0 ? void 0 : value.form_submit_meta) {
|
|
8607
|
-
return value === null || value === void 0 ? void 0 : value.form_submit_meta.map(({ action_id }) => action_id);
|
|
8608
|
-
}
|
|
8609
|
-
return [];
|
|
8610
|
-
}, [value, value === null || value === void 0 ? void 0 : value.form_submit_meta]);
|
|
8611
|
-
const handleOnNext = () => {
|
|
8612
|
-
const tmp = {};
|
|
8613
|
-
if (value.form_submit_meta && value.form_submit_meta.length) {
|
|
8614
|
-
tmp[node.id] = value.form_submit_meta.map((_v) => _v.action_id);
|
|
8615
|
-
}
|
|
8616
|
-
const newValue = Object.assign(Object.assign({}, value), { current_polls: tmp });
|
|
8617
|
-
validation.validateSelectActions(activeActions, node, () => {
|
|
8618
|
-
onNext && onNext(Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), newValue));
|
|
8619
|
-
});
|
|
8620
|
-
};
|
|
8621
|
-
return (React__default["default"].createElement(SubotInlineContainer$1, null,
|
|
8622
|
-
React__default["default"].createElement(SubotInlineHeader$1, null),
|
|
8623
|
-
React__default["default"].createElement(SubotInlineWrapper$1, null,
|
|
8624
|
-
React__default["default"].createElement(SubotInlineIntentContainer, null,
|
|
8625
|
-
React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
|
|
8626
|
-
React__default["default"].createElement(SubotInlineDescription$1, null, descriptionNode),
|
|
8627
|
-
React__default["default"].createElement(SubotInlineActionContainer, null, (node === null || node === void 0 ? void 0 : node.actions) && !!((_a = node.actions) === null || _a === void 0 ? void 0 : _a.length) && (React__default["default"].createElement(SubotInlineActionListContainer, null, (_b = node === null || node === void 0 ? void 0 : node.actions.filter(({ type }) => type !== index$2.NodeActionType.POLL_BUTTON)) === null || _b === void 0 ? void 0 : _b.map((action) => {
|
|
8628
|
-
const NodeAction = SubotInlineActionBase[action === null || action === void 0 ? void 0 : action.type];
|
|
8629
|
-
return (NodeAction && (React__default["default"].createElement(NodeAction, { key: action.id, active: activeActions.includes(action.id), action: action, onChange: handleOnChange, htmlType: "checkbox", formSubmitMeta: value === null || value === void 0 ? void 0 : value.form_submit_meta })));
|
|
8630
|
-
}))))),
|
|
8631
|
-
React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, nextText: submitButton ? submitButton === null || submitButton === void 0 ? void 0 : submitButton.label : '', onNext: handleOnNext })));
|
|
8632
|
-
};
|
|
8633
|
-
|
|
8634
|
-
// Rating Message
|
|
8635
|
-
// {
|
|
8636
|
-
// form_meta: [
|
|
8637
|
-
// { key: "action.key", control: "star", value: "", action_id: 'action.id' },
|
|
8638
|
-
// { key: 'action.key', control: "text", value: '', action_id: 'action.id' }
|
|
8639
|
-
// ],
|
|
8640
|
-
// action_id: "button_id",
|
|
8641
|
-
// action_value: "button_attribute"
|
|
8642
|
-
// }
|
|
8643
|
-
const SubotInlineNodeRating = ({ node, indexNumber, }) => {
|
|
8644
|
-
var _a, _b;
|
|
8645
|
-
const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
8646
|
-
const { params, onChange, onSubmit, onPrev, onNext } = React.useContext(SubotInlineContext);
|
|
8647
|
-
const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
|
|
8648
|
-
const [isSubmit, setIsSubmit] = React.useState(false);
|
|
8649
|
-
const ratingStarValue = React.useMemo(() => {
|
|
8650
|
-
var _a;
|
|
8651
|
-
const _ratingStar = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type === index$2.NodeActionType.RATING_STAR);
|
|
8652
|
-
if (value.form_submit_meta && _ratingStar) {
|
|
8653
|
-
const formIndex = value === null || value === void 0 ? void 0 : value.form_submit_meta.findIndex(({ action_id }) => action_id === (_ratingStar === null || _ratingStar === void 0 ? void 0 : _ratingStar.id));
|
|
8654
|
-
if (formIndex !== -1)
|
|
8655
|
-
return parseInt(value === null || value === void 0 ? void 0 : value.form_submit_meta[formIndex].value);
|
|
8656
|
-
}
|
|
8657
|
-
return 0;
|
|
8658
|
-
}, [value === null || value === void 0 ? void 0 : value.form_submit_meta]);
|
|
8659
|
-
const submitButton = React.useMemo(() => {
|
|
8660
|
-
var _a;
|
|
8661
|
-
const _submitButton = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type == index$2.NodeActionType.RATING_BUTTON);
|
|
8662
|
-
if (_submitButton)
|
|
8663
|
-
return _submitButton;
|
|
8664
|
-
return null;
|
|
8665
|
-
}, []);
|
|
8666
|
-
const handleOnChange = (formValue) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
8667
|
-
if (formValue) {
|
|
8668
|
-
const _message = Object.assign(Object.assign(Object.assign({}, params), value), { node_id: node.id, action_id: submitButton === null || submitButton === void 0 ? void 0 : submitButton.id, action_value: submitButton === null || submitButton === void 0 ? void 0 : submitButton.key, form_submit_meta: (value === null || value === void 0 ? void 0 : value.form_submit_meta)
|
|
8669
|
-
? [...value === null || value === void 0 ? void 0 : value.form_submit_meta]
|
|
8670
|
-
: [] });
|
|
8671
|
-
const tmpFormSubmitMeta = [
|
|
8672
|
-
..._message === null || _message === void 0 ? void 0 : _message.form_submit_meta,
|
|
8673
|
-
];
|
|
8674
|
-
const formUpdateIndex = tmpFormSubmitMeta.findIndex(({ action_id }) => action_id === formValue.action_id);
|
|
8675
|
-
if (formUpdateIndex !== -1)
|
|
8676
|
-
tmpFormSubmitMeta[formUpdateIndex] = Object.assign({}, formValue);
|
|
8677
|
-
else
|
|
8678
|
-
tmpFormSubmitMeta.push(formValue);
|
|
8679
|
-
_message.form_submit_meta = [...tmpFormSubmitMeta];
|
|
8680
|
-
setValue(_message);
|
|
8681
|
-
onChange && onChange(_message);
|
|
8682
|
-
}
|
|
8683
|
-
});
|
|
8684
|
-
const handleOnNext = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
8685
|
-
if (!value.form_submit_meta || ratingStarValue === 0) {
|
|
8686
|
-
pushNotifications({
|
|
8687
|
-
title: '',
|
|
8688
|
-
message: f({
|
|
8689
|
-
id: 'multiSelectError.required',
|
|
8690
|
-
defaultMessage: `There is no answer!`,
|
|
8691
|
-
}),
|
|
8692
|
-
type: 'warning', // "success" | "danger" | "info" | "warning"
|
|
8693
|
-
});
|
|
8694
|
-
return;
|
|
8695
|
-
}
|
|
8696
|
-
if (!isSubmit) {
|
|
8697
|
-
const _message = Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), value);
|
|
8698
|
-
const res = yield subotInlineMessage(_message);
|
|
8699
|
-
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
8700
|
-
const _c = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _c, restData = tslib_es6.__rest(_c, ["node"]);
|
|
8701
|
-
const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
|
|
8702
|
-
onSubmit && onSubmit(_nextNode, _message);
|
|
8703
|
-
setIsSubmit(true);
|
|
8704
|
-
}
|
|
8705
|
-
}
|
|
8706
|
-
else {
|
|
8707
|
-
onNext && onNext(Object.assign(Object.assign(Object.assign({}, params), value), node === null || node === void 0 ? void 0 : node._message));
|
|
8708
|
-
}
|
|
8709
|
-
});
|
|
8710
|
-
return (React__default["default"].createElement(SubotInlineContainer$1, null,
|
|
8711
|
-
React__default["default"].createElement(SubotInlineHeader$1, null),
|
|
8712
|
-
React__default["default"].createElement(SubotInlineWrapper$1, null,
|
|
8713
|
-
React__default["default"].createElement(SubotInlineIntentContainer, null,
|
|
8714
|
-
React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
|
|
8715
|
-
React__default["default"].createElement(SubotInlineActionContainer, null, (node === null || node === void 0 ? void 0 : node.actions) && !!((_a = node.actions) === null || _a === void 0 ? void 0 : _a.length) && (React__default["default"].createElement(SubotInlineActionListContainer, null, (_b = node === null || node === void 0 ? void 0 : node.actions.filter(({ type }) => type !== index$2.NodeActionType.RATING_BUTTON)) === null || _b === void 0 ? void 0 : _b.map((action) => {
|
|
8716
|
-
var _a;
|
|
8717
|
-
const NodeAction = SubotInlineActionBase[action === null || action === void 0 ? void 0 : action.type];
|
|
8718
|
-
return (NodeAction && (React__default["default"].createElement(NodeAction, { key: action.id, action: action, onChange: handleOnChange, value: (value &&
|
|
8719
|
-
(value === null || value === void 0 ? void 0 : value.form_submit_meta) &&
|
|
8720
|
-
((_a = value.form_submit_meta) === null || _a === void 0 ? void 0 : _a.find(({ action_id }) => action_id === action.id))) })));
|
|
8721
|
-
}))))),
|
|
8722
|
-
React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, nextText: submitButton ? submitButton === null || submitButton === void 0 ? void 0 : submitButton.label : '', onNext: handleOnNext })));
|
|
8723
|
-
};
|
|
8724
|
-
|
|
8725
|
-
const SubotInlineNodeReaction = ({ node, indexNumber, }) => {
|
|
8726
|
-
const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
8727
|
-
const { params, onSubmit, onPrev, onNext } = React.useContext(SubotInlineContext);
|
|
8728
|
-
const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
|
|
8729
|
-
const handleOnChange = (action) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
8730
|
-
if (action) {
|
|
8731
|
-
setValue(Object.assign(Object.assign({}, value), { action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key }));
|
|
8732
|
-
const _message = Object.assign(Object.assign(Object.assign({}, params), value), { node_id: node.id, action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key });
|
|
8733
|
-
const res = yield subotInlineMessage(_message);
|
|
8734
|
-
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
8735
|
-
const _a = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _a, restData = tslib_es6.__rest(_a, ["node"]);
|
|
8736
|
-
const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
|
|
8737
|
-
onSubmit && onSubmit(_nextNode, _message);
|
|
8738
|
-
}
|
|
8739
|
-
}
|
|
8740
|
-
});
|
|
8741
|
-
const handleOnNext = () => {
|
|
8742
|
-
var _a;
|
|
8743
|
-
if (!(node === null || node === void 0 ? void 0 : node._message) || !((_a = node._message) === null || _a === void 0 ? void 0 : _a.action_id)) {
|
|
8744
|
-
pushNotifications({
|
|
8745
|
-
title: '',
|
|
8746
|
-
message: f({
|
|
8747
|
-
id: 'multiSelectError.required',
|
|
8748
|
-
defaultMessage: `There is no answer!`,
|
|
8749
|
-
}),
|
|
8750
|
-
type: 'warning', // "success" | "danger" | "info" | "warning"
|
|
8751
|
-
});
|
|
8752
|
-
}
|
|
8753
|
-
else {
|
|
8754
|
-
onNext && onNext(Object.assign(Object.assign(Object.assign({}, params), value), node === null || node === void 0 ? void 0 : node._message));
|
|
8755
|
-
}
|
|
8756
|
-
};
|
|
8757
|
-
return (React__default["default"].createElement(SubotInlineContainer$1, null,
|
|
8758
|
-
React__default["default"].createElement(SubotInlineHeader$1, null),
|
|
8759
|
-
React__default["default"].createElement(SubotInlineWrapper$1, null,
|
|
8760
|
-
React__default["default"].createElement(SubotInlineIntentContainer, null,
|
|
8761
|
-
React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
|
|
8762
|
-
React__default["default"].createElement(SubotInlineActionContainer, null,
|
|
8763
|
-
React__default["default"].createElement(SubotInlineAction, { value: (value === null || value === void 0 ? void 0 : value.action_id) ? [value === null || value === void 0 ? void 0 : value.action_id] : [], actions: (node === null || node === void 0 ? void 0 : node.actions) || [], onChange: handleOnChange }))),
|
|
8764
|
-
React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, onNext: handleOnNext })));
|
|
8765
|
-
};
|
|
8766
|
-
|
|
8767
|
-
const SubotInlineNodeResultPoll = ({ node, }) => {
|
|
8768
|
-
var _a, _b;
|
|
8769
|
-
return (React__default["default"].createElement(SubotInlineContainer$1, null,
|
|
8770
|
-
React__default["default"].createElement(SubotInlineHeader$1, null),
|
|
8771
|
-
React__default["default"].createElement(SubotInlineWrapper$1, null,
|
|
8772
|
-
React__default["default"].createElement(SubotInlineIntentContainer, null,
|
|
8773
|
-
React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [] })),
|
|
8774
|
-
React__default["default"].createElement(SubotInlineActionContainer, null, (node === null || node === void 0 ? void 0 : node.actions) && !!((_a = node.actions) === null || _a === void 0 ? void 0 : _a.length) && (React__default["default"].createElement(SubotInlineActionListContainer, null, (_b = node === null || node === void 0 ? void 0 : node.actions.filter(({ type }) => type !== index$2.NodeActionType.POLL_BUTTON)) === null || _b === void 0 ? void 0 : _b.map((action) => {
|
|
8775
|
-
const NodeAction = SubotInlineActionBase[action === null || action === void 0 ? void 0 : action.type];
|
|
8776
|
-
return (NodeAction && (React__default["default"].createElement(NodeAction, { key: action.id, action: action, htmlType: "checkbox", node_type: node === null || node === void 0 ? void 0 : node.type })));
|
|
8777
|
-
})))))));
|
|
8778
|
-
};
|
|
8779
|
-
|
|
8780
|
-
// Review Message
|
|
8781
|
-
// {
|
|
8782
|
-
// form_meta: [
|
|
8783
|
-
// { key: "review1", control: "formmeta", value: '', action_id: "action.id" },
|
|
8784
|
-
// { key: "review2", control: "formmeta", value: '', action_id: "action.id" },
|
|
8785
|
-
// { key: "review3", control: "formmeta", value: "" },
|
|
8786
|
-
// { key: "review4", control: "formmeta", value: "" },
|
|
8787
|
-
// { key: "review5", control: "formmeta", value: "" },
|
|
8788
|
-
// {key: 'attribite-description', control:"formmeta-description", value: ''}
|
|
8789
|
-
// ],
|
|
8790
|
-
// action_id: "button_id",
|
|
8791
|
-
// action_value: "button_attribute"
|
|
8792
|
-
// }
|
|
8793
|
-
const SubotInlineNodeReview = ({ node, indexNumber, }) => {
|
|
8794
|
-
const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
8795
|
-
const { params, onChange, onSubmit, onPrev, onNext } = React.useContext(SubotInlineContext);
|
|
8796
|
-
const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
|
|
8797
|
-
const [isSubmit, setIsSubmit] = React.useState(false);
|
|
8798
|
-
const reviewChoices = React.useMemo(() => {
|
|
8799
|
-
var _a;
|
|
8800
|
-
return ((_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.filter(({ type }) => type === index$2.NodeActionType.REVIEW_CHOICE)) || [];
|
|
8801
|
-
}, [node === null || node === void 0 ? void 0 : node.actions]);
|
|
8802
|
-
const reviewDescriptions = React.useMemo(() => {
|
|
8803
|
-
var _a;
|
|
8804
|
-
return ((_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.filter(({ type }) => type === index$2.NodeActionType.REVIEW_DESCRIPTION)) || [];
|
|
8805
|
-
}, [node === null || node === void 0 ? void 0 : node.actions]);
|
|
8806
|
-
const submitButton = React.useMemo(() => {
|
|
8807
|
-
var _a;
|
|
8808
|
-
const _submitButton = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type == index$2.NodeActionType.REVIEW_BUTTON);
|
|
8809
|
-
if (_submitButton)
|
|
8810
|
-
return _submitButton;
|
|
8811
|
-
return null;
|
|
8812
|
-
}, [node === null || node === void 0 ? void 0 : node.actions]);
|
|
8813
|
-
const activeActions = React.useMemo(() => {
|
|
8814
|
-
if (value === null || value === void 0 ? void 0 : value.form_submit_meta) {
|
|
8815
|
-
return value === null || value === void 0 ? void 0 : value.form_submit_meta.map(({ action_id }) => action_id).filter((action_id) => !!(reviewChoices === null || reviewChoices === void 0 ? void 0 : reviewChoices.map(({ id }) => id).includes(action_id)));
|
|
8816
|
-
}
|
|
8817
|
-
return [];
|
|
8818
|
-
}, [value, value === null || value === void 0 ? void 0 : value.form_submit_meta]);
|
|
8819
|
-
const handleOnClick = (formValue) => {
|
|
8820
|
-
if (formValue) {
|
|
8821
|
-
const _message = Object.assign(Object.assign(Object.assign({}, params), value), { node_id: node.id, action_id: submitButton === null || submitButton === void 0 ? void 0 : submitButton.id, action_value: submitButton === null || submitButton === void 0 ? void 0 : submitButton.key, form_submit_meta: (value === null || value === void 0 ? void 0 : value.form_submit_meta)
|
|
8822
|
-
? [...value === null || value === void 0 ? void 0 : value.form_submit_meta]
|
|
8823
|
-
: [] });
|
|
8824
|
-
let tmpFormSubmitMeta = [
|
|
8825
|
-
..._message === null || _message === void 0 ? void 0 : _message.form_submit_meta,
|
|
8826
|
-
];
|
|
8827
|
-
const formUpdateIndex = tmpFormSubmitMeta.findIndex(({ action_id }) => action_id === formValue.action_id);
|
|
8828
|
-
if (formUpdateIndex !== -1)
|
|
8829
|
-
tmpFormSubmitMeta = [
|
|
8830
|
-
...tmpFormSubmitMeta.slice(0, formUpdateIndex),
|
|
8831
|
-
...tmpFormSubmitMeta.slice(formUpdateIndex + 1),
|
|
8832
|
-
];
|
|
8833
|
-
else
|
|
8834
|
-
tmpFormSubmitMeta.push(formValue);
|
|
8835
|
-
_message.form_submit_meta = [...tmpFormSubmitMeta];
|
|
8836
|
-
setValue(_message);
|
|
8837
|
-
setIsSubmit(false);
|
|
8838
|
-
onChange && onChange(_message);
|
|
8839
|
-
}
|
|
8840
|
-
};
|
|
8841
|
-
const handleOnChange = (formValue) => {
|
|
8842
|
-
if (formValue) {
|
|
8843
|
-
const _message = Object.assign(Object.assign(Object.assign({}, params), value), { node_id: node.id, action_id: submitButton === null || submitButton === void 0 ? void 0 : submitButton.id, action_value: submitButton === null || submitButton === void 0 ? void 0 : submitButton.key, form_submit_meta: (value === null || value === void 0 ? void 0 : value.form_submit_meta)
|
|
8844
|
-
? [...value === null || value === void 0 ? void 0 : value.form_submit_meta]
|
|
8845
|
-
: [] });
|
|
8846
|
-
const tmpFormSubmitMeta = [
|
|
8847
|
-
..._message === null || _message === void 0 ? void 0 : _message.form_submit_meta,
|
|
8848
|
-
];
|
|
8849
|
-
const formUpdateIndex = tmpFormSubmitMeta.findIndex(({ action_id }) => action_id === formValue.action_id);
|
|
8850
|
-
if (formUpdateIndex !== -1)
|
|
8851
|
-
tmpFormSubmitMeta[formUpdateIndex] = Object.assign({}, formValue);
|
|
8852
|
-
else
|
|
8853
|
-
tmpFormSubmitMeta.push(formValue);
|
|
8854
|
-
_message.form_submit_meta = [...tmpFormSubmitMeta];
|
|
8855
|
-
setValue(_message);
|
|
8856
|
-
setIsSubmit(false);
|
|
8857
|
-
onChange && onChange(_message);
|
|
8858
|
-
}
|
|
8859
|
-
};
|
|
8860
|
-
const handleOnNext = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
8861
|
-
var _a;
|
|
8862
|
-
if (!((_a = node === null || node === void 0 ? void 0 : node._message) === null || _a === void 0 ? void 0 : _a.form_submit_meta) || !activeActions.length) {
|
|
8863
|
-
pushNotifications({
|
|
8864
|
-
title: '',
|
|
8865
|
-
message: f({
|
|
8866
|
-
id: 'multiSelectError.required',
|
|
8867
|
-
defaultMessage: `There is no answer!`,
|
|
8868
|
-
}),
|
|
8869
|
-
type: 'warning', // "success" | "danger" | "info" | "warning"
|
|
8870
|
-
});
|
|
8871
|
-
return;
|
|
8872
|
-
}
|
|
8873
|
-
if (!isSubmit) {
|
|
8874
|
-
const _message = Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), value);
|
|
8875
|
-
const res = yield subotInlineMessage(_message);
|
|
8876
|
-
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
8877
|
-
const _b = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _b, restData = tslib_es6.__rest(_b, ["node"]);
|
|
8878
|
-
const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
|
|
8879
|
-
onSubmit && onSubmit(_nextNode, _message);
|
|
8880
|
-
setIsSubmit(true);
|
|
8881
|
-
}
|
|
8882
|
-
}
|
|
8883
|
-
else {
|
|
8884
|
-
onNext && onNext(Object.assign(Object.assign(Object.assign({}, params), value), node === null || node === void 0 ? void 0 : node._message));
|
|
8885
|
-
}
|
|
8886
|
-
});
|
|
8887
|
-
return (React__default["default"].createElement(SubotInlineContainer$1, null,
|
|
8888
|
-
React__default["default"].createElement(SubotInlineHeader$1, null),
|
|
8889
|
-
React__default["default"].createElement(SubotInlineWrapper$1, null,
|
|
8890
|
-
React__default["default"].createElement(SubotInlineIntentContainer, null,
|
|
8891
|
-
React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
|
|
8892
|
-
React__default["default"].createElement(SubotInlineActionContainer, null,
|
|
8893
|
-
!!reviewChoices.length && (React__default["default"].createElement(SubotInlineReviewContainer, null,
|
|
8894
|
-
React__default["default"].createElement(SubotInlineActionListContainer, { className: "review-container" }, reviewChoices.map((action) => {
|
|
8895
|
-
var _a;
|
|
8896
|
-
const NodeAction = SubotInlineActionBase[action === null || action === void 0 ? void 0 : action.type];
|
|
8897
|
-
return (NodeAction && (React__default["default"].createElement(NodeAction, { key: action.id, action: action, onChange: handleOnClick, active: (value &&
|
|
8898
|
-
!!((_a = value === null || value === void 0 ? void 0 : value.form_submit_meta) === null || _a === void 0 ? void 0 : _a.find(({ action_id }) => action_id === action.id))) ||
|
|
8899
|
-
false })));
|
|
8900
|
-
})))),
|
|
8901
|
-
!!(reviewDescriptions === null || reviewDescriptions === void 0 ? void 0 : reviewDescriptions.length) && (React__default["default"].createElement(SubotInlineActionListContainer, null, reviewDescriptions.map((action) => {
|
|
8902
|
-
var _a;
|
|
8903
|
-
const NodeAction = SubotInlineActionBase[action === null || action === void 0 ? void 0 : action.type];
|
|
8904
|
-
return (NodeAction && (React__default["default"].createElement(NodeAction, { key: action.id, action: action, onChange: handleOnChange, value: (value &&
|
|
8905
|
-
(value === null || value === void 0 ? void 0 : value.form_submit_meta) &&
|
|
8906
|
-
((_a = value.form_submit_meta) === null || _a === void 0 ? void 0 : _a.find(({ action_id }) => action_id === action.id))) })));
|
|
8907
|
-
}))))),
|
|
8908
|
-
React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, nextText: submitButton ? submitButton === null || submitButton === void 0 ? void 0 : submitButton.label : '', onNext: handleOnNext })));
|
|
8909
|
-
};
|
|
8910
|
-
|
|
8911
|
-
const SubotInlineNodeSSO = ({ node, indexNumber, }) => {
|
|
8912
|
-
const refIsTrigger = React.useRef(false);
|
|
8913
|
-
const { params, onPrev, nodes, activeId, userInfo } = React.useContext(SubotInlineContext);
|
|
8914
|
-
React.useEffect(() => {
|
|
8915
|
-
var _a;
|
|
8916
|
-
const actionSSO = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find((act) => act.type === index$2.NodeActionType.ACTION_SSO_REDIRECT);
|
|
8917
|
-
if ((userInfo === null || userInfo === void 0 ? void 0 : userInfo.id) && actionSSO && !refIsTrigger.current) {
|
|
8918
|
-
refIsTrigger.current = true;
|
|
8919
|
-
handleOnChange(actionSSO);
|
|
8920
|
-
}
|
|
8921
|
-
}, [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
|
|
8922
|
-
const { formatMessage: f } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
8923
|
-
const handleOnChange = (action) => {
|
|
8924
|
-
if (action && action.type === index$2.NodeActionType.ACTION_SSO_REDIRECT) {
|
|
8925
|
-
const currentState = {
|
|
8926
|
-
params: Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), { action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key, mode: 'inline' }),
|
|
8927
|
-
listNodes: nodes,
|
|
8928
|
-
activeId,
|
|
8929
|
-
createdAt: new Date().getTime(),
|
|
8930
|
-
botId: params.bot_id,
|
|
8931
|
-
};
|
|
8932
|
-
localStorage.setItem(STATE_SUBOT_INLINE_KEY, JSON.stringify(currentState));
|
|
8933
|
-
const urlObj = utils$1.getURLwithSSOTracking(window.location.href, {
|
|
8934
|
-
botItem: nodes[0],
|
|
8935
|
-
});
|
|
8936
|
-
urlObj.searchParams.set('bot_id', String(params.bot_id));
|
|
8937
|
-
urlObj.searchParams.set('mode', 'inline');
|
|
8938
|
-
urlObj.searchParams.set('source', 'subot-inline');
|
|
8939
|
-
const returnUrl = urlObj.href;
|
|
8940
|
-
if (store.IS_SSOV2_ENABLED()) {
|
|
8941
|
-
store.useSSOV2Store.getState().triggerLogin({
|
|
8942
|
-
returnUrl,
|
|
8943
|
-
source: `subot-inline`,
|
|
8944
|
-
});
|
|
8945
|
-
}
|
|
8946
|
-
else {
|
|
8947
|
-
window.location.href = `${index$3.SSO_URL}?returnUrl=${encodeURIComponent(returnUrl)}`;
|
|
8948
|
-
}
|
|
8949
|
-
}
|
|
8950
|
-
};
|
|
8951
|
-
return (React__default["default"].createElement(SubotInlineContainer$1, null,
|
|
8952
|
-
React__default["default"].createElement(SubotInlineHeader$1, null),
|
|
8953
|
-
React__default["default"].createElement(SubotInlineWrapper$1, null,
|
|
8954
|
-
React__default["default"].createElement(SubotInlineIntentContainer, null,
|
|
8955
|
-
React__default["default"].createElement(SubotInlineIntent, { intents: [
|
|
8956
|
-
...((node === null || node === void 0 ? void 0 : node.intents) || []),
|
|
8957
|
-
...index$1.ssoIntents(f),
|
|
8958
|
-
], indexNumber: indexNumber })),
|
|
8959
|
-
React__default["default"].createElement(SubotInlineActionContainer, null,
|
|
8960
|
-
React__default["default"].createElement(SubotInlineAction, { actions: node === null || node === void 0 ? void 0 : node.actions, onChange: handleOnChange }))),
|
|
8961
|
-
React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, hideNext: true })));
|
|
8962
|
-
};
|
|
8963
|
-
|
|
8964
|
-
const SubotInlineNodeText = ({ node, indexNumber, }) => {
|
|
8965
|
-
const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
8966
|
-
const { nodes, activeId, params, onSubmit, onPrev, onNext, onChange } = React.useContext(SubotInlineContext);
|
|
8967
|
-
const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
|
|
8968
|
-
const handleOnChangeNormal = (action) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
8969
|
-
const _message = Object.assign(Object.assign(Object.assign(Object.assign({}, params), value), { node_id: node.id, action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key }), getCurrentTotalDynamicScore(nodes, activeId, action.id));
|
|
8970
|
-
delete _message.form_submit_meta;
|
|
8971
|
-
const res = yield subotInlineMessage(_message);
|
|
8972
|
-
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
8973
|
-
const _a = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _a, restData = tslib_es6.__rest(_a, ["node"]);
|
|
8974
|
-
const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
|
|
8975
|
-
onSubmit && onSubmit(_nextNode, _message);
|
|
8976
|
-
}
|
|
8977
|
-
});
|
|
8978
|
-
const handleOnChange = (action, formSubmitMeta) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
8979
|
-
if (!action)
|
|
8980
|
-
return;
|
|
8981
|
-
const actionWithOther = (action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.USER_CHOICE_TEXT_BY_INPUT ||
|
|
8982
|
-
(action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.POLL_CHOICE_TEXT_BY_INPUT;
|
|
8983
|
-
const newValue = Object.assign(Object.assign({}, value), { action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key, form_submit_meta: formSubmitMeta });
|
|
8984
|
-
if (actionWithOther) {
|
|
8985
|
-
setValue(newValue);
|
|
8986
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
8987
|
-
return;
|
|
8988
|
-
}
|
|
8989
|
-
delete newValue.form_submit_meta;
|
|
8990
|
-
setValue(newValue);
|
|
8991
|
-
handleOnChangeNormal(action);
|
|
8992
|
-
});
|
|
8993
|
-
const handleOnNext = () => {
|
|
8994
|
-
const newMessage = JSON.parse(JSON.stringify(Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), value)));
|
|
8995
|
-
if ((value === null || value === void 0 ? void 0 : value.action_id) &&
|
|
8996
|
-
(value === null || value === void 0 ? void 0 : value.action_value) === KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD) {
|
|
8997
|
-
onNext === null || onNext === void 0 ? void 0 : onNext(newMessage);
|
|
8998
|
-
return;
|
|
8999
|
-
}
|
|
9000
|
-
if (!(value === null || value === void 0 ? void 0 : value.action_id) || !(value === null || value === void 0 ? void 0 : value.action_value)) {
|
|
9001
|
-
pushNotifications({
|
|
9002
|
-
title: '',
|
|
9003
|
-
message: f({
|
|
9004
|
-
id: 'multiSelectError.required',
|
|
9005
|
-
defaultMessage: `There is no answer!`,
|
|
9006
|
-
}),
|
|
9007
|
-
type: 'warning', // "success" | "danger" | "info" | "warning"
|
|
9008
|
-
});
|
|
9009
|
-
}
|
|
9010
|
-
else {
|
|
9011
|
-
delete newMessage.form_submit_meta;
|
|
9012
|
-
onNext === null || onNext === void 0 ? void 0 : onNext(newMessage);
|
|
9013
|
-
}
|
|
9014
|
-
};
|
|
9015
|
-
return (React__default["default"].createElement(SubotInlineContainer$1, null,
|
|
9016
|
-
React__default["default"].createElement(SubotInlineHeader$1, null),
|
|
9017
|
-
React__default["default"].createElement(SubotInlineWrapper$1, null,
|
|
9018
|
-
React__default["default"].createElement(SubotInlineIntentContainer, null,
|
|
9019
|
-
React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
|
|
9020
|
-
React__default["default"].createElement(SubotInlineActionContainer, null,
|
|
9021
|
-
React__default["default"].createElement(SubotInlineAction, { value: (value === null || value === void 0 ? void 0 : value.action_id) ? [value === null || value === void 0 ? void 0 : value.action_id] : [], actions: node === null || node === void 0 ? void 0 : node.actions, onChange: handleOnChange, formSubmitMeta: value === null || value === void 0 ? void 0 : value.form_submit_meta }))),
|
|
9022
|
-
React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, onNext: handleOnNext })));
|
|
9023
|
-
};
|
|
9024
|
-
|
|
9025
|
-
const SubotInlineNodeBase = {
|
|
9026
|
-
TEXT: SubotInlineNodeText,
|
|
9027
|
-
IMAGE: SubotInlineNodeImage,
|
|
9028
|
-
FORM: SubotInlineNodeForm,
|
|
9029
|
-
CONDITION: SubotInlineNode,
|
|
9030
|
-
FINAL_STANDARD: SubotInlineNodeFinal,
|
|
9031
|
-
FINAL: SubotInlineNodeFinal,
|
|
9032
|
-
FINAL_THANK_YOU: SubotInlineNodeFinalThankYou,
|
|
9033
|
-
SSO: SubotInlineNodeSSO,
|
|
9034
|
-
MULTIPLE: SubotInlineNodeMultiple,
|
|
9035
|
-
POLL: SubotInlineNodePoll,
|
|
9036
|
-
RATING: SubotInlineNodeRating,
|
|
9037
|
-
REACTION: SubotInlineNodeReaction,
|
|
9038
|
-
REVIEW: SubotInlineNodeReview,
|
|
9039
|
-
RESULT_POLL: SubotInlineNodeResultPoll,
|
|
9040
|
-
OTP: SubotInlineNodeOTP,
|
|
9041
|
-
// RESULT_RATING = 12,
|
|
9042
|
-
// RESULT_REACTION = 13,
|
|
9043
|
-
};
|
|
9044
|
-
|
|
9045
|
-
const SubotInlineButton = styled__default["default"](index$8.Button) `
|
|
9046
|
-
margin-top: 24px;
|
|
9047
|
-
${utils.MediaQueries.mbUp} {
|
|
9048
|
-
margin-top: 16px;
|
|
9049
|
-
}
|
|
9050
|
-
`;
|
|
9051
|
-
const SubotInlineDescription = styled__default["default"].div `
|
|
9052
|
-
margin-top: 24px;
|
|
9053
|
-
`;
|
|
9054
|
-
const SubotInlineReview = styled__default["default"](index$d.Text) `
|
|
9055
|
-
text-align: center;
|
|
9056
|
-
${utils.MediaQueries.mbUp} {
|
|
9057
|
-
text-align: left;
|
|
9058
|
-
}
|
|
9059
|
-
`;
|
|
9060
|
-
const SubotInlineTitle = styled__default["default"](index$e.Heading) `
|
|
9061
|
-
text-align: center;
|
|
9062
|
-
margin-bottom: 8px;
|
|
9063
|
-
|
|
9064
|
-
${utils.MediaQueries.mbUp} {
|
|
9065
|
-
margin-bottom: 0;
|
|
9066
|
-
text-align: left;
|
|
9067
|
-
}
|
|
9068
|
-
`;
|
|
9069
|
-
const SubotInlineImage = styled__default["default"].div `
|
|
9070
|
-
background-color: #ffffff;
|
|
9071
|
-
border-radius: 50%;
|
|
9072
|
-
width: 120px;
|
|
9073
|
-
height: 120px;
|
|
9074
|
-
object-fit: contain;
|
|
9075
|
-
overflow: hidden;
|
|
9076
|
-
flex-shrink: 0;
|
|
9077
|
-
|
|
9078
|
-
img {
|
|
9079
|
-
width: 100%;
|
|
9080
|
-
height: 100%;
|
|
9081
|
-
object-fit: cover;
|
|
9082
|
-
}
|
|
9083
|
-
`;
|
|
9084
|
-
const SubotInlineContent = styled__default["default"].div `
|
|
9085
|
-
flex-grow: 1;
|
|
9086
|
-
${utils.MediaQueries.tdDown} {
|
|
9087
|
-
width: 100%;
|
|
9088
|
-
margin-left: 0;
|
|
9089
|
-
}
|
|
9090
|
-
`;
|
|
9091
|
-
const SubotInlineStartWrapper = styled__default["default"].div `
|
|
9092
|
-
position: relative;
|
|
9093
|
-
display: flex;
|
|
9094
|
-
gap: 24px;
|
|
9095
|
-
${utils.MediaQueries.mbDown} {
|
|
9096
|
-
flex-wrap: wrap;
|
|
9097
|
-
justify-content: center;
|
|
9098
|
-
}
|
|
9099
|
-
`;
|
|
9100
|
-
const SubotInlineStartContainer = styled__default["default"].div `
|
|
9101
|
-
position: relative;
|
|
9102
|
-
overflow: hidden;
|
|
9103
|
-
background-color: ${miscTheme.theme.colors.primary50};
|
|
9104
|
-
padding: 32px;
|
|
9105
|
-
border-radius: ${miscTheme.theme.borderRadius};
|
|
9106
|
-
background-image: url('/images/subot-bg-transparent.png');
|
|
9107
|
-
background-size: contain;
|
|
9108
|
-
background-repeat: repeat-y;
|
|
9109
|
-
${utils.MediaQueries.mbDown} {
|
|
9110
|
-
padding: 24px;
|
|
9111
|
-
}
|
|
9112
|
-
`;
|
|
9113
|
-
const SubotInlineNodeStart = ({ node, setLoading, }) => {
|
|
9114
|
-
const startRef = React.useRef({
|
|
9115
|
-
impress: false,
|
|
9116
|
-
});
|
|
9117
|
-
const userInfo = togetherComponentGlobalContext.GlobalData === null || togetherComponentGlobalContext.GlobalData === void 0 ? void 0 : togetherComponentGlobalContext.GlobalData.userInfo;
|
|
9118
|
-
const { params, onNext, trackingCommonInline, isMobile } = React.useContext(SubotInlineContext);
|
|
9119
|
-
const handleOnClick = (isCountClick = true) => () => {
|
|
9120
|
-
if (isCountClick) {
|
|
9121
|
-
const queryParams = {
|
|
9122
|
-
cookie_id: params.cookie_id,
|
|
9123
|
-
window_id: params.window_id,
|
|
9124
|
-
bot_id: params.bot_id,
|
|
9125
|
-
title_url: params.title_url,
|
|
9126
|
-
url: params.url,
|
|
9127
|
-
gtm_id: params.gtm_id,
|
|
9128
|
-
ga_client_id: params.ga_client_id,
|
|
9129
|
-
device_id: index$1.checkMobile(window.navigator.userAgent) ? 2 : 1,
|
|
9130
|
-
account_id: params.account_id || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.id) || null,
|
|
9131
|
-
};
|
|
9132
|
-
subotInlineClick(queryParams);
|
|
9133
|
-
}
|
|
9134
|
-
onNext && onNext();
|
|
9135
|
-
};
|
|
9136
|
-
React.useEffect(() => {
|
|
9137
|
-
const inViewport = (element, callback, options = {}) => {
|
|
9138
|
-
if (!!window.IntersectionObserver && !startRef.current.impress) {
|
|
9139
|
-
const observer = new IntersectionObserver((entries, observer) => {
|
|
9140
|
-
entries.forEach((entry) => callback(entry, observer));
|
|
9141
|
-
}, options);
|
|
9142
|
-
observer.observe(element);
|
|
9143
|
-
}
|
|
9144
|
-
};
|
|
9145
|
-
const eventScrollImpress = () => {
|
|
9146
|
-
if (startRef.current.element) {
|
|
9147
|
-
inViewport(startRef.current.element, (element, observer) => {
|
|
9148
|
-
/** Not in viewport */
|
|
9149
|
-
if (!element.isIntersecting) {
|
|
9150
|
-
if (startRef.current.impress) {
|
|
9151
|
-
startRef.current.impress = false;
|
|
9152
|
-
}
|
|
9153
|
-
return;
|
|
9154
|
-
}
|
|
9155
|
-
if (!startRef.current.impress) {
|
|
9156
|
-
startRef.current.impress = true;
|
|
9157
|
-
if (startRef.current.debounce) {
|
|
9158
|
-
clearTimeout(startRef.current.debounce);
|
|
9159
|
-
}
|
|
9160
|
-
if (!(node === null || node === void 0 ? void 0 : node.inline_start_button)) {
|
|
9161
|
-
setLoading(true);
|
|
9162
|
-
}
|
|
9163
|
-
startRef.current.debounce = setTimeout(() => {
|
|
9164
|
-
const queryParams = {
|
|
9165
|
-
cookie_id: params.cookie_id,
|
|
9166
|
-
window_id: params.window_id,
|
|
9167
|
-
bot_id: params.bot_id,
|
|
9168
|
-
title_url: params.title_url,
|
|
9169
|
-
url: params.url,
|
|
9170
|
-
gtm_id: params.gtm_id,
|
|
9171
|
-
ga_client_id: params.ga_client_id,
|
|
9172
|
-
device_id: index$1.checkMobile(window.navigator.userAgent) ? 2 : 1,
|
|
9173
|
-
account_id: params.account_id || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.id) || null,
|
|
9174
|
-
};
|
|
9175
|
-
queryParams && subotInlineImpression(queryParams);
|
|
9176
|
-
/** Auto skip the starting node in the case
|
|
9177
|
-
* CTA Start value is not contributed on Subot Admin */
|
|
9178
|
-
if (!(node === null || node === void 0 ? void 0 : node.inline_start_button)) {
|
|
9179
|
-
handleOnClick(false)();
|
|
9180
|
-
}
|
|
9181
|
-
}, 400);
|
|
9182
|
-
startRef.current.element &&
|
|
9183
|
-
(observer === null || observer === void 0 ? void 0 : observer.unobserve(startRef.current.element));
|
|
9184
|
-
}
|
|
9185
|
-
}, {
|
|
9186
|
-
rootMargin: '1000px',
|
|
9187
|
-
});
|
|
9188
|
-
}
|
|
9189
|
-
};
|
|
9190
|
-
eventScrollImpress();
|
|
9191
|
-
window.addEventListener('scroll', eventScrollImpress, { passive: true });
|
|
9192
|
-
return () => window.removeEventListener('scroll', eventScrollImpress);
|
|
9193
|
-
}, [onNext]);
|
|
9194
|
-
if (!node)
|
|
9195
|
-
return null;
|
|
9196
|
-
return (React__default["default"].createElement(SubotInlineStartContainer, null,
|
|
9197
|
-
React__default["default"].createElement(SubotInlineStartWrapper, { ref: (ref) => (startRef.current.element = ref) },
|
|
9198
|
-
node.inline_image && (React__default["default"].createElement(SubotInlineImage, null,
|
|
9199
|
-
React__default["default"].createElement("img", { loading: "lazy", src: node.inline_image, alt: "" }))),
|
|
9200
|
-
React__default["default"].createElement(SubotInlineContent, null,
|
|
9201
|
-
node.inline_title || node.inline_headline ? (React__default["default"].createElement(SubotInlineTitle, { tag: "h3", fontWeight: "bold", color: miscTheme.theme.colors.secondaryBase },
|
|
9202
|
-
React__default["default"].createElement(Markdown, null, node.inline_title || node.inline_headline))) : null,
|
|
9203
|
-
node.inline_review && (React__default["default"].createElement(SubotInlineReview, { size: "s4", color: miscTheme.theme.colors.gray600,
|
|
9204
|
-
// fix error html, div is not allowed as child of p
|
|
9205
|
-
as: 'div' },
|
|
9206
|
-
React__default["default"].createElement(Markdown, null, node.inline_review))),
|
|
9207
|
-
node.inline_start_button && (React__default["default"].createElement(SubotInlineButton, Object.assign({ size: "md", isBlock: isMobile, onClick: handleOnClick(true), className: "pointer-event-child-none" }, trackingCommonInline, { "data-event-action": "Start" }), node.inline_start_button)))),
|
|
9208
|
-
React__default["default"].createElement(SubotInlineDescription, null,
|
|
9209
|
-
React__default["default"].createElement(Markdown, null, node.inline_description))));
|
|
9210
|
-
};
|
|
9211
|
-
|
|
9212
|
-
const SubotInlineLoading = styled__default["default"].div `
|
|
9213
|
-
position: absolute;
|
|
9214
|
-
z-index: 2;
|
|
9215
|
-
top: 0;
|
|
9216
|
-
right: 0;
|
|
9217
|
-
bottom: 0;
|
|
9218
|
-
left: 0;
|
|
9219
|
-
display: flex;
|
|
9220
|
-
flex-direction: column;
|
|
9221
|
-
align-items: center;
|
|
9222
|
-
justify-content: center;
|
|
9223
|
-
color: ${miscTheme.theme.colors.gray800};
|
|
9224
|
-
opacity: 0;
|
|
9225
|
-
pointer-events: none;
|
|
9226
|
-
&:before {
|
|
9227
|
-
position: absolute;
|
|
9228
|
-
z-index: -1;
|
|
9229
|
-
top: 0;
|
|
9230
|
-
right: 0;
|
|
9231
|
-
bottom: 0;
|
|
9232
|
-
left: 0;
|
|
9233
|
-
background-color: ${miscTheme.theme.colors.neutral50 || '#F7F9FC'};
|
|
9234
|
-
content: '';
|
|
9235
|
-
opacity: 1;
|
|
9236
|
-
}
|
|
9237
|
-
${({ isLoading }) => isLoading && ` opacity: 1; pointer-events: auto; `};
|
|
9238
|
-
`;
|
|
9239
|
-
const SubotInlineLoadingContainer = styled__default["default"].div `
|
|
9240
|
-
position: relative;
|
|
9241
|
-
z-index: 1;
|
|
9242
|
-
line-height: 1.5;
|
|
9243
|
-
transition: 0.25s all linear;
|
|
9244
|
-
margin-block: 16px;
|
|
9245
|
-
content-visibility: auto;
|
|
9246
|
-
contain-intrinsic-size: 500px;
|
|
9247
|
-
&.hhg-subot-style {
|
|
9248
|
-
min-height: 100px;
|
|
9249
|
-
}
|
|
9250
|
-
${utils.MediaQueries.mbDown} {
|
|
9251
|
-
margin-right: -1rem;
|
|
9252
|
-
margin-left: -1rem;
|
|
9253
|
-
}
|
|
9254
|
-
`;
|
|
9255
|
-
const SubotInline = ({ id, isMobile, articleLink, customUrl, }) => {
|
|
9256
|
-
const currentUrl = useCurrentUrl();
|
|
9257
|
-
const refAccountIdFromLogs = React.useRef(null);
|
|
9258
|
-
const flag = React.useRef(null);
|
|
9259
|
-
const [loading, setLoading] = React.useState(true);
|
|
9260
|
-
const [state, setState] = React.useState({
|
|
9261
|
-
activeId: '',
|
|
9262
|
-
params: {},
|
|
9263
|
-
nodes: [],
|
|
9264
|
-
getParams: () => ({}),
|
|
9265
|
-
});
|
|
9266
|
-
const userInfo = togetherComponentGlobalContext.GlobalData === null || togetherComponentGlobalContext.GlobalData === void 0 ? void 0 : togetherComponentGlobalContext.GlobalData.userInfo;
|
|
9267
|
-
const currentNode = React.useMemo(() => {
|
|
9268
|
-
return state.nodes.find((n) => n.id == state.activeId);
|
|
9269
|
-
}, [state.nodes, state.activeId]);
|
|
9270
|
-
const trackingCommonInline = React.useMemo(() => ({
|
|
9271
|
-
'data-event-category': 'Subot',
|
|
9272
|
-
'data-event-label': currentUrl,
|
|
9273
|
-
'data-bot-id': state.params.bot_id,
|
|
9274
|
-
'data-bot-type': 'Inline',
|
|
9275
|
-
'data-question-id': typeof (currentNode === null || currentNode === void 0 ? void 0 : currentNode.id) === 'string' ? currentNode === null || currentNode === void 0 ? void 0 : currentNode.id : null,
|
|
9276
|
-
}), [currentNode, currentUrl, state.params.bot_id]);
|
|
9277
|
-
/** Get Params */
|
|
9278
|
-
const getParams = React.useCallback(() => {
|
|
9279
|
-
var _a, _b, _c, _d;
|
|
9280
|
-
const gaData = window.gaData;
|
|
9281
|
-
const _url = (customUrl || window.location.origin + index$3.basePath) +
|
|
9282
|
-
(togetherComponentGlobalContext.GlobalData.locale === 'tl-PH'
|
|
9283
|
-
? articleLink.replace('fil/', '')
|
|
9284
|
-
: articleLink);
|
|
9285
|
-
const params = {
|
|
9286
|
-
bot_id: id,
|
|
9287
|
-
account_id: ((_a = index$1.getUserInfoFromCookie()) === null || _a === void 0 ? void 0 : _a.id) || null,
|
|
9288
|
-
action_id: '',
|
|
9289
|
-
action_value: '',
|
|
9290
|
-
cookie_id: index$1.getSubotCookieId((_c = (_b = togetherComponentGlobalContext.GlobalData === null || togetherComponentGlobalContext.GlobalData === void 0 ? void 0 : togetherComponentGlobalContext.GlobalData.router) === null || _b === void 0 ? void 0 : _b.query) === null || _c === void 0 ? void 0 : _c.cookie_id),
|
|
9291
|
-
current_score: 0,
|
|
9292
|
-
current_keys: [],
|
|
9293
|
-
current_selected: [],
|
|
9294
|
-
form_submit_meta: [],
|
|
9295
|
-
gtm_id: gaData ? Object.keys(gaData)[0] : '',
|
|
9296
|
-
ga_client_id: Cookies__default["default"].get('_ga') || '',
|
|
9297
|
-
is_new: false,
|
|
9298
|
-
mode: 'inline',
|
|
9299
|
-
node_id: '',
|
|
9300
|
-
selected_actions: {},
|
|
9301
|
-
title_url: document.title || '',
|
|
9302
|
-
// url: _url,
|
|
9303
|
-
// Keep this commnent line to test on local
|
|
9304
|
-
url: _url
|
|
9305
|
-
.replace('http://localhost', 'https://discover.hellobacsi.com')
|
|
9306
|
-
.replace('dev.', 'discover.'),
|
|
9307
|
-
window_id: index$1.getWindowId(),
|
|
9308
|
-
};
|
|
9309
|
-
return index$1.overrideParamsByQuery(params, (_d = togetherComponentGlobalContext.GlobalData === null || togetherComponentGlobalContext.GlobalData === void 0 ? void 0 : togetherComponentGlobalContext.GlobalData.router) === null || _d === void 0 ? void 0 : _d.query);
|
|
9310
|
-
}, []);
|
|
9311
|
-
const elementScrollIntoView = () => {
|
|
9312
|
-
flag.current &&
|
|
9313
|
-
flag.current.scrollIntoView({
|
|
9314
|
-
behavior: 'smooth',
|
|
9315
|
-
block: 'start',
|
|
9316
|
-
inline: 'start',
|
|
9317
|
-
});
|
|
9318
|
-
};
|
|
9319
|
-
const onChange = (message) => {
|
|
9320
|
-
setState((state) => {
|
|
9321
|
-
var _a;
|
|
9322
|
-
if (message && (message === null || message === void 0 ? void 0 : message.node_id) && (message === null || message === void 0 ? void 0 : message.node_id) == (state === null || state === void 0 ? void 0 : state.activeId)) {
|
|
9323
|
-
const nodeActiveIndex = state.nodes.findIndex(({ id }) => id == (state === null || state === void 0 ? void 0 : state.activeId));
|
|
9324
|
-
if (nodeActiveIndex !== -1) {
|
|
9325
|
-
const tmpNode = Object.assign(Object.assign({}, state.nodes[nodeActiveIndex]), { _message: Object.assign(Object.assign({}, (_a = state.nodes[nodeActiveIndex]) === null || _a === void 0 ? void 0 : _a._message), message) });
|
|
9326
|
-
state.nodes[nodeActiveIndex] = tmpNode;
|
|
9327
|
-
}
|
|
9328
|
-
}
|
|
9329
|
-
return Object.assign({}, state);
|
|
9330
|
-
});
|
|
9331
|
-
};
|
|
9332
|
-
const onSubmit = (nextNode, message) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
9333
|
-
/**
|
|
9334
|
-
* Skip the OTP Node if user's phone number is verified.
|
|
9335
|
-
*/
|
|
9336
|
-
// if (nextNode) {
|
|
9337
|
-
// const isNextNodeOTP = nextNode.type === NodeType.OTP
|
|
9338
|
-
// if (isNextNodeOTP && verifiedPhone) {
|
|
9339
|
-
// const actionOTPSubmit = nextNode.actions?.find(
|
|
9340
|
-
// (action) => action.type === NodeActionType.USER_SUBMIT_SEND,
|
|
9341
|
-
// )
|
|
9342
|
-
// const blockOTPMessage: SubotMessage = {
|
|
9343
|
-
// ...state.params,
|
|
9344
|
-
// node_id: nextNode.id,
|
|
9345
|
-
// action_id: actionOTPSubmit?.id,
|
|
9346
|
-
// action_value: actionOTPSubmit?.key,
|
|
9347
|
-
// }
|
|
9348
|
-
// const res = await subotInlineMessage(blockOTPMessage)
|
|
9349
|
-
// if (res?._status === 1) {
|
|
9350
|
-
// const { node: _node, ...restData } = res?._data
|
|
9351
|
-
// const nextNodeAfterOTP = {
|
|
9352
|
-
// ..._node,
|
|
9353
|
-
// _message: { ...restData, node_id: _node.id },
|
|
9354
|
-
// }
|
|
9355
|
-
// onSubmit && onSubmit(nextNodeAfterOTP, message)
|
|
9356
|
-
// return
|
|
9357
|
-
// }
|
|
9358
|
-
// pushNotifications({
|
|
9359
|
-
// title: '',
|
|
9360
|
-
// message: f({ id: 'notification.comment.somethingWrong' }),
|
|
9361
|
-
// type: 'danger',
|
|
9362
|
-
// })
|
|
9363
|
-
// return
|
|
9364
|
-
// }
|
|
9365
|
-
// }
|
|
9366
|
-
const _state = Object.assign(Object.assign({}, state), { nodes: [...state.nodes] });
|
|
9367
|
-
if (message && (message === null || message === void 0 ? void 0 : message.node_id)) {
|
|
9368
|
-
const updateNodeIndex = _state.nodes.findIndex(({ id }) => id == message.node_id);
|
|
9369
|
-
if (updateNodeIndex !== -1) {
|
|
9370
|
-
_state.nodes[updateNodeIndex]._message = Object.assign(Object.assign({}, _state.nodes[updateNodeIndex]._message), message);
|
|
9371
|
-
_state.nodes = [..._state.nodes.slice(0, updateNodeIndex + 1)];
|
|
9372
|
-
}
|
|
9373
|
-
}
|
|
9374
|
-
setLoading(true);
|
|
9375
|
-
if (nextNode) {
|
|
9376
|
-
const nextNodeFindIndex = _state.nodes.findIndex(({ id }) => id == (nextNode === null || nextNode === void 0 ? void 0 : nextNode.id));
|
|
9377
|
-
if (nextNodeFindIndex === -1) {
|
|
9378
|
-
_state.nodes = [..._state.nodes, Object.assign({}, nextNode)];
|
|
9379
|
-
}
|
|
9380
|
-
else {
|
|
9381
|
-
const tmpNode = Object.assign(Object.assign(Object.assign({}, _state.nodes[nextNodeFindIndex]), nextNode), { _message: Object.assign(Object.assign({}, _state.nodes[nextNodeFindIndex]._message), nextNode === null || nextNode === void 0 ? void 0 : nextNode._message) });
|
|
9382
|
-
_state.nodes = [
|
|
9383
|
-
..._state.nodes.slice(0, nextNodeFindIndex),
|
|
9384
|
-
Object.assign({}, tmpNode),
|
|
9385
|
-
..._state.nodes.slice(nextNodeFindIndex + 1),
|
|
9386
|
-
];
|
|
9387
|
-
}
|
|
9388
|
-
_state.activeId = nextNode.id;
|
|
9389
|
-
}
|
|
9390
|
-
setTimeout(() => {
|
|
9391
|
-
setState(_state);
|
|
9392
|
-
setLoading(false);
|
|
9393
|
-
_state.activeId &&
|
|
9394
|
-
saveSubotInlineLogs({
|
|
9395
|
-
nodes: _state.nodes,
|
|
9396
|
-
activeId: _state.activeId,
|
|
9397
|
-
params: _state.params,
|
|
9398
|
-
accountIdFromLogs: refAccountIdFromLogs.current,
|
|
9399
|
-
});
|
|
9400
|
-
}, 250);
|
|
9401
|
-
elementScrollIntoView();
|
|
9402
|
-
});
|
|
9403
|
-
const onPrev = () => {
|
|
9404
|
-
var _a;
|
|
9405
|
-
const _state = Object.assign({}, state);
|
|
9406
|
-
const nodeActiveIndex = (_a = _state === null || _state === void 0 ? void 0 : _state.nodes) === null || _a === void 0 ? void 0 : _a.findIndex(({ id }) => id == (_state === null || _state === void 0 ? void 0 : _state.activeId));
|
|
9407
|
-
if (nodeActiveIndex && nodeActiveIndex !== -1 && nodeActiveIndex > 1) {
|
|
9408
|
-
const prevNode = _state.nodes[nodeActiveIndex - 1];
|
|
9409
|
-
if (prevNode)
|
|
9410
|
-
_state.activeId = prevNode.id;
|
|
9411
|
-
}
|
|
9412
|
-
elementScrollIntoView();
|
|
9413
|
-
setState(Object.assign({}, _state));
|
|
9414
|
-
_state.activeId &&
|
|
9415
|
-
saveSubotInlineLogs({
|
|
9416
|
-
nodes: _state.nodes,
|
|
9417
|
-
activeId: _state.activeId,
|
|
9418
|
-
params: _state.params,
|
|
9419
|
-
accountIdFromLogs: refAccountIdFromLogs.current,
|
|
9420
|
-
});
|
|
9421
|
-
};
|
|
9422
|
-
const onNext = (message) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
9423
|
-
if (message && (message === null || message === void 0 ? void 0 : message.node_id)) {
|
|
9424
|
-
const newMessage = Object.assign(Object.assign({}, message), getCurrentTotalDynamicScore(state.nodes, state.activeId, message.action_id));
|
|
9425
|
-
const res = yield subotInlineMessage(newMessage);
|
|
9426
|
-
setLoading(false);
|
|
9427
|
-
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
9428
|
-
const _a = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _a, restData = tslib_es6.__rest(_a, ["node"]);
|
|
9429
|
-
const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
|
|
9430
|
-
const nextNodeFindIndex = state.nodes.findIndex(({ id }) => id === _nextNode.id);
|
|
9431
|
-
if (nextNodeFindIndex !== -1) {
|
|
9432
|
-
onSubmit(_nextNode);
|
|
9433
|
-
}
|
|
9434
|
-
else {
|
|
9435
|
-
onSubmit(_nextNode, message);
|
|
9436
|
-
}
|
|
9437
|
-
return;
|
|
9438
|
-
}
|
|
9439
|
-
}
|
|
9440
|
-
const nodeActive = state.nodes.find(({ id }) => id == (state === null || state === void 0 ? void 0 : state.activeId));
|
|
9441
|
-
if (nodeActive && !nodeActive.hasOwnProperty('type')) {
|
|
9442
|
-
setLoading(true);
|
|
9443
|
-
if (state.nodes[0].id == (state === null || state === void 0 ? void 0 : state.activeId)) {
|
|
9444
|
-
// elementScrollIntoView()
|
|
9445
|
-
setTimeout(() => {
|
|
9446
|
-
setState(Object.assign(Object.assign({}, state), { activeId: state.nodes[1].id.toString() }));
|
|
9447
|
-
setLoading(false);
|
|
9448
|
-
saveSubotInlineLogs({
|
|
9449
|
-
nodes: state.nodes,
|
|
9450
|
-
activeId: state.nodes[1].id.toString(),
|
|
9451
|
-
params: getParams(),
|
|
9452
|
-
accountIdFromLogs: refAccountIdFromLogs.current,
|
|
9453
|
-
});
|
|
9454
|
-
}, 250);
|
|
9455
|
-
}
|
|
9456
|
-
}
|
|
9457
|
-
});
|
|
9458
|
-
const onReset = () => {
|
|
9459
|
-
setLoading(true);
|
|
9460
|
-
setState((state) => {
|
|
9461
|
-
state.nodes = state.nodes.slice(0, 2);
|
|
9462
|
-
state.nodes[1] = Object.assign(Object.assign({}, state.nodes[1]), { _message: undefined });
|
|
9463
|
-
state.activeId = state.nodes[0].id.toString();
|
|
9464
|
-
return Object.assign({}, state);
|
|
9465
|
-
});
|
|
9466
|
-
setTimeout(() => {
|
|
9467
|
-
setLoading(false);
|
|
9468
|
-
}, 250);
|
|
9469
|
-
elementScrollIntoView();
|
|
9470
|
-
};
|
|
9471
|
-
const getFirstAPI = (params) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
9472
|
-
var _b;
|
|
9473
|
-
if ((params === null || params === void 0 ? void 0 : params.url) && (params === null || params === void 0 ? void 0 : params.bot_id)) {
|
|
9474
|
-
let activeId = '';
|
|
9475
|
-
let nodes = [];
|
|
9476
|
-
setLoading(true);
|
|
9477
|
-
const resFirst = yield subotInlineFirstNode(params.bot_id);
|
|
9478
|
-
if ((resFirst === null || resFirst === void 0 ? void 0 : resFirst._status) === 1) {
|
|
9479
|
-
activeId = resFirst === null || resFirst === void 0 ? void 0 : resFirst._data.id.toString();
|
|
9480
|
-
nodes.push(resFirst === null || resFirst === void 0 ? void 0 : resFirst._data, resFirst === null || resFirst === void 0 ? void 0 : resFirst._data.first_node);
|
|
9481
|
-
}
|
|
9482
|
-
const subotLogs = yield getSubotInlineLogs(nodes[0]);
|
|
9483
|
-
if (subotLogs) {
|
|
9484
|
-
const lastNode = subotLogs.nodes[subotLogs.nodes.length - 1];
|
|
9485
|
-
const isComplete = [
|
|
9486
|
-
index$2.NodeType.FINAL,
|
|
9487
|
-
index$2.NodeType.FINAL_THANK_YOU,
|
|
9488
|
-
index$2.NodeType.FINAL_STANDARD,
|
|
9489
|
-
].includes(lastNode.type);
|
|
9490
|
-
if (!isComplete) {
|
|
9491
|
-
nodes = subotLogs.nodes;
|
|
9492
|
-
activeId = subotLogs.activeId;
|
|
9493
|
-
refAccountIdFromLogs.current = ((_b = subotLogs.params) === null || _b === void 0 ? void 0 : _b.account_id) || 0;
|
|
9494
|
-
}
|
|
9495
|
-
}
|
|
9496
|
-
/** [Subot Inline] Show result page after redirect from SSO */
|
|
9497
|
-
const previousState = getPreviousStateFromStorage(params.bot_id, {
|
|
9498
|
-
getParams,
|
|
9499
|
-
});
|
|
9500
|
-
if (previousState &&
|
|
9501
|
-
previousState.params.action_id &&
|
|
9502
|
-
previousState.params.action_value) {
|
|
9503
|
-
const resResultInline = yield subotInlineMessage(previousState.params);
|
|
9504
|
-
if ((resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._status) === 1 && (resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._data.node)) {
|
|
9505
|
-
activeId = resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._data.node.id;
|
|
9506
|
-
nodes = previousState.listNodes;
|
|
9507
|
-
nodes[nodes.length - 1] = resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._data.node;
|
|
9508
|
-
saveSubotInlineLogs({
|
|
9509
|
-
nodes,
|
|
9510
|
-
activeId: activeId,
|
|
9511
|
-
params: previousState.params,
|
|
9512
|
-
accountIdFromLogs: refAccountIdFromLogs.current,
|
|
9513
|
-
});
|
|
9514
|
-
setTimeout(() => {
|
|
9515
|
-
elementScrollIntoView();
|
|
9516
|
-
}, 100);
|
|
9517
|
-
}
|
|
9518
|
-
}
|
|
9519
|
-
const newParams = (previousState === null || previousState === void 0 ? void 0 : previousState.params) || (subotLogs === null || subotLogs === void 0 ? void 0 : subotLogs.params) || params;
|
|
9520
|
-
const _state = Object.assign(Object.assign({}, state), { params: newParams, activeId, nodes: nodes });
|
|
9521
|
-
setLoading(false);
|
|
9522
|
-
setState(_state);
|
|
9523
|
-
}
|
|
9524
|
-
});
|
|
9525
|
-
React.useEffect(() => {
|
|
9526
|
-
var _a;
|
|
9527
|
-
if (!!((_a = state === null || state === void 0 ? void 0 : state.nodes) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
9528
|
-
console.log('Subot Already Loaded');
|
|
9529
|
-
return () => undefined;
|
|
9530
|
-
}
|
|
9531
|
-
if (!Cookies__default["default"].get(index$3.GA_TOKEN_COOKIE)) {
|
|
9532
|
-
index$1.checkUntilFinished({
|
|
9533
|
-
condition: () => Boolean(Cookies__default["default"].get(index$3.GA_TOKEN_COOKIE)),
|
|
9534
|
-
finished: () => {
|
|
9535
|
-
const params = getParams();
|
|
9536
|
-
getFirstAPI(params);
|
|
9537
|
-
},
|
|
9538
|
-
});
|
|
9539
|
-
}
|
|
9540
|
-
else {
|
|
9541
|
-
const params = getParams();
|
|
9542
|
-
getFirstAPI(params);
|
|
9543
|
-
}
|
|
9544
|
-
}, []);
|
|
9545
|
-
if (state.nodes.length && !state.nodes[0].inline_active) {
|
|
9546
|
-
return null;
|
|
9547
|
-
}
|
|
9548
|
-
return (React__default["default"].createElement(SubotInlineContext.Provider, { value: Object.assign(Object.assign({}, state), { isMobile,
|
|
9549
|
-
getParams,
|
|
9550
|
-
onChange,
|
|
9551
|
-
onSubmit,
|
|
9552
|
-
onPrev,
|
|
9553
|
-
onNext,
|
|
9554
|
-
onReset,
|
|
9555
|
-
trackingCommonInline,
|
|
9556
|
-
userInfo }) },
|
|
9557
|
-
React__default["default"].createElement(SubotInlineLoadingContainer, { className: classNames__default["default"]('hhg-subot', `hhg-subot-${id}`, !!state.nodes.length && 'hhg-subot-style') }, !!state.nodes.length && (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
9558
|
-
React__default["default"].createElement("div", { ref: flag, className: "hhg-flag", style: {
|
|
9559
|
-
position: 'absolute',
|
|
9560
|
-
top: -150,
|
|
9561
|
-
left: 0,
|
|
9562
|
-
pointerEvents: 'none',
|
|
9563
|
-
} }),
|
|
9564
|
-
React__default["default"].createElement(SubotInlineLoading, { isLoading: !!loading },
|
|
9565
|
-
React__default["default"].createElement(index$a.Loading, null),
|
|
9566
|
-
"Verifying..."),
|
|
9567
|
-
state.nodes.map((node, index) => {
|
|
9568
|
-
if (node.id.toString() === (state === null || state === void 0 ? void 0 : state.activeId)) {
|
|
9569
|
-
if (node.hasOwnProperty('type')) {
|
|
9570
|
-
let NodeComponent;
|
|
9571
|
-
switch (node === null || node === void 0 ? void 0 : node.position) {
|
|
9572
|
-
case index$2.NodePosition.SSO:
|
|
9573
|
-
NodeComponent =
|
|
9574
|
-
SubotInlineNodeBase[index$2.NodePosition[node === null || node === void 0 ? void 0 : node.position].valueOf()];
|
|
9575
|
-
break;
|
|
9576
|
-
default:
|
|
9577
|
-
NodeComponent =
|
|
9578
|
-
SubotInlineNodeBase[index$2.NodeType[node === null || node === void 0 ? void 0 : node.type].valueOf()];
|
|
9579
|
-
}
|
|
9580
|
-
if (node.is_multi_select &&
|
|
9581
|
-
node.type !== index$2.NodeType.POLL)
|
|
9582
|
-
NodeComponent = SubotInlineNodeBase['MULTIPLE'];
|
|
9583
|
-
return (NodeComponent && (React__default["default"].createElement(NodeComponent, { key: index.toString(), indexNumber: index, node: node })));
|
|
9584
|
-
}
|
|
9585
|
-
else {
|
|
9586
|
-
return (React__default["default"].createElement(SubotInlineNodeStart, { key: index.toString(), node: node, setLoading: setLoading }));
|
|
9587
|
-
}
|
|
9588
|
-
}
|
|
9589
|
-
return null;
|
|
9590
|
-
}))))));
|
|
9591
|
-
};
|
|
9592
|
-
|
|
9593
6439
|
// subot.sendOTP.button
|
|
9594
6440
|
// subot.resendOTP.button
|
|
9595
6441
|
// subot.verifyOTP.button
|
|
@@ -9629,7 +6475,6 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
9629
6475
|
Markdown: Markdown,
|
|
9630
6476
|
hexRgb: hexRgb,
|
|
9631
6477
|
SubotInlineVoucherLeftUI: SubotInlineVoucherLeftUI,
|
|
9632
|
-
SubotInline: SubotInline,
|
|
9633
6478
|
overrideParamsByQuery: index$1.overrideParamsByQuery,
|
|
9634
6479
|
ssoIntents: index$1.ssoIntents,
|
|
9635
6480
|
checkUntilFinished: index$1.checkUntilFinished,
|
|
@@ -9645,11 +6490,11 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
9645
6490
|
isFakeEmail: index$1.isFakeEmail,
|
|
9646
6491
|
formatUrlWithEncrypedGa: index$1.formatUrlWithEncrypedGa,
|
|
9647
6492
|
getSubotApiPath: getSubotApiPath,
|
|
9648
|
-
subotInlineMessage: subotInlineMessage
|
|
9649
|
-
computeExtraSettingsForBot: computeExtraSettingsForBot
|
|
9650
|
-
subotInlineFirstNode: subotInlineFirstNode
|
|
9651
|
-
subotInlineClick: subotInlineClick
|
|
9652
|
-
subotInlineImpression: subotInlineImpression
|
|
6493
|
+
subotInlineMessage: subotInlineMessage,
|
|
6494
|
+
computeExtraSettingsForBot: computeExtraSettingsForBot,
|
|
6495
|
+
subotInlineFirstNode: subotInlineFirstNode,
|
|
6496
|
+
subotInlineClick: subotInlineClick,
|
|
6497
|
+
subotInlineImpression: subotInlineImpression,
|
|
9653
6498
|
PATHS: PATHS$1,
|
|
9654
6499
|
getPreviousStateFromStorage: getPreviousStateFromStorage,
|
|
9655
6500
|
getSubotInlineLogs: getSubotInlineLogs,
|
|
@@ -9660,7 +6505,7 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
9660
6505
|
detectToSkipNodeStart: detectToSkipNodeStart,
|
|
9661
6506
|
KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD: KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD,
|
|
9662
6507
|
SubotInlineIntentBaseTarget: SubotInlineIntentBaseTarget,
|
|
9663
|
-
SubotInlineIntentBase: SubotInlineIntentBase
|
|
6508
|
+
SubotInlineIntentBase: SubotInlineIntentBase,
|
|
9664
6509
|
checkSyncDataOnFrisoCampaign: checkSyncDataOnFrisoCampaign,
|
|
9665
6510
|
handleFrisoRedirecition: handleFrisoRedirecition,
|
|
9666
6511
|
getDynamicScore: getDynamicScore,
|
|
@@ -9685,14 +6530,13 @@ exports.ssoIntents = index$1.ssoIntents;
|
|
|
9685
6530
|
exports.KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD = KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD;
|
|
9686
6531
|
exports.Markdown = Markdown;
|
|
9687
6532
|
exports.PATHS = PATHS$1;
|
|
9688
|
-
exports.
|
|
9689
|
-
exports.SubotInlineIntentBase = SubotInlineIntentBase$1;
|
|
6533
|
+
exports.SubotInlineIntentBase = SubotInlineIntentBase;
|
|
9690
6534
|
exports.SubotInlineIntentBaseTarget = SubotInlineIntentBaseTarget;
|
|
9691
6535
|
exports.SubotInlineRevampWithTheme = SubotInlineRevampWithTheme;
|
|
9692
6536
|
exports.SubotInlineVoucherLeftUI = SubotInlineVoucherLeftUI;
|
|
9693
6537
|
exports.UserInfoForm = UserInfoForm;
|
|
9694
6538
|
exports.checkSyncDataOnFrisoCampaign = checkSyncDataOnFrisoCampaign;
|
|
9695
|
-
exports.computeExtraSettingsForBot = computeExtraSettingsForBot
|
|
6539
|
+
exports.computeExtraSettingsForBot = computeExtraSettingsForBot;
|
|
9696
6540
|
exports["default"] = ContainerWithProvider;
|
|
9697
6541
|
exports.detectToSkipNodeStart = detectToSkipNodeStart;
|
|
9698
6542
|
exports.extractUnifiedAnswers = extractUnifiedAnswers;
|
|
@@ -9707,7 +6551,7 @@ exports.handleFrisoRedirecition = handleFrisoRedirecition;
|
|
|
9707
6551
|
exports.hexRgb = hexRgb;
|
|
9708
6552
|
exports.replaceTextWithVariables = replaceTextWithVariables;
|
|
9709
6553
|
exports.saveSubotInlineLogs = saveSubotInlineLogs;
|
|
9710
|
-
exports.subotInlineClick = subotInlineClick
|
|
9711
|
-
exports.subotInlineFirstNode = subotInlineFirstNode
|
|
9712
|
-
exports.subotInlineImpression = subotInlineImpression
|
|
9713
|
-
exports.subotInlineMessage = subotInlineMessage
|
|
6554
|
+
exports.subotInlineClick = subotInlineClick;
|
|
6555
|
+
exports.subotInlineFirstNode = subotInlineFirstNode;
|
|
6556
|
+
exports.subotInlineImpression = subotInlineImpression;
|
|
6557
|
+
exports.subotInlineMessage = subotInlineMessage;
|