@hhgtech/hhg-components 1.27.112 → 1.27.113
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/babyGrowth.js +2 -2
- package/build/cache.js +1 -1
- package/build/care.js +1 -1
- package/build/components/molecules/index.d.ts +3 -3
- package/build/components/molecules/{premiumNewsletterBanner → surveyOrPremiumBanner}/bannerWithOption/index.d.ts +2 -0
- package/build/{esm/components/molecules/premiumNewsletterBanner → components/molecules/surveyOrPremiumBanner}/bannerWithOption/index.styles.d.ts +1 -0
- package/build/components/molecules/{premiumNewsletterBanner → surveyOrPremiumBanner}/constants.d.ts +41 -7
- package/build/components/molecules/{premiumNewsletterBanner → surveyOrPremiumBanner}/context.d.ts +7 -4
- package/build/components/molecules/surveyOrPremiumBanner/index.d.ts +15 -0
- package/build/components/molecules/surveyOrPremiumBanner/surveyBanner.d.ts +3 -0
- package/build/components/molecules/{premiumNewsletterBanner → surveyOrPremiumBanner}/toolBanner.d.ts +1 -0
- package/build/components/molecules/{premiumNewsletterBanner → surveyOrPremiumBanner}/types.d.ts +5 -0
- package/build/components.js +1 -1
- package/build/constants.js +1 -1
- package/build/{core-223cfdf2.js → core-5c4c9018.js} +1 -1
- package/build/ecom.js +1 -1
- package/build/esm/babyGrowth.js +4 -4
- package/build/esm/cache.js +1 -1
- package/build/esm/care.js +1 -1
- package/build/esm/components/molecules/index.d.ts +3 -3
- package/build/esm/components/molecules/{premiumNewsletterBanner → surveyOrPremiumBanner}/bannerWithOption/index.d.ts +2 -0
- package/build/{components/molecules/premiumNewsletterBanner → esm/components/molecules/surveyOrPremiumBanner}/bannerWithOption/index.styles.d.ts +1 -0
- package/build/esm/components/molecules/{premiumNewsletterBanner → surveyOrPremiumBanner}/constants.d.ts +41 -7
- package/build/esm/components/molecules/{premiumNewsletterBanner → surveyOrPremiumBanner}/context.d.ts +7 -4
- package/build/esm/components/molecules/surveyOrPremiumBanner/index.d.ts +15 -0
- package/build/esm/components/molecules/surveyOrPremiumBanner/surveyBanner.d.ts +3 -0
- package/build/esm/components/molecules/{premiumNewsletterBanner → surveyOrPremiumBanner}/toolBanner.d.ts +1 -0
- package/build/esm/components/molecules/{premiumNewsletterBanner → surveyOrPremiumBanner}/types.d.ts +5 -0
- package/build/esm/components.js +1 -1
- package/build/esm/constants.js +1 -1
- package/build/esm/{core-29500107.js → core-256cda08.js} +1 -1
- package/build/esm/ecom.js +1 -1
- package/build/esm/{fixedBottomAdBlock-4a036f62.js → fixedBottomAdBlock-42a0fc3b.js} +1 -1
- package/build/esm/footer.js +1 -1
- package/build/esm/gAssets.js +1 -1
- package/build/esm/{getDynamicHealthTool-69405709.js → getDynamicHealthTool-0e9dffaf.js} +1 -1
- package/build/esm/{getSocialList-92cf722f.js → getSocialList-04ad7465.js} +1 -1
- package/build/esm/hooks.js +1 -1
- package/build/esm/i18n-values/vi-VN.js +1 -1
- package/build/esm/i18n-values/vi-VN_MB.js +1 -1
- package/build/esm/i18n.js +1 -1
- package/build/esm/i18nV2.js +1 -1
- package/build/esm/{index-402570ee.js → index-1f31ee2c.js} +1 -1
- package/build/esm/{index-47fa4d84.js → index-2472bb2e.js} +1 -1
- package/build/esm/{index-0816b158.js → index-37ac3e0a.js} +1 -1
- package/build/esm/{index-d597705a.js → index-40352094.js} +23 -23
- package/build/esm/index-404d6f42.js +1 -0
- package/build/esm/{index-4b3f4c97.js → index-4b0913ef.js} +1 -1
- package/build/esm/index-4ef01662.js +1 -0
- package/build/esm/{index-f43dae18.js → index-5b15422c.js} +1 -1
- package/build/esm/{index-9c19eedb.js → index-671bebd2.js} +1 -1
- package/build/esm/{index-fbca16bf.js → index-6bfebf91.js} +1 -1
- package/build/esm/{index-fe688742.js → index-79cd66c0.js} +1 -1
- package/build/esm/{index-1c39b096.js → index-7ea25330.js} +1 -1
- package/build/esm/index-9a6cbd76.js +1 -0
- package/build/esm/{index-f9c9808c.js → index-9dc3058e.js} +1 -1
- package/build/esm/{index-dbfe0a73.js → index-aab6e937.js} +4 -4
- package/build/esm/{index-6f00ca93.js → index-c04a8332.js} +1 -1
- package/build/esm/{index-caf3b0b5.js → index-c20147f5.js} +1 -1
- package/build/esm/{index-a0fdff7f.js → index-c52c6d1d.js} +1 -1
- package/build/esm/{index-ab6ab4f8.js → index-c9c1af14.js} +1 -1
- package/build/esm/{index-e4a9ae2b.js → index-d533e676.js} +1 -1
- package/build/esm/{index-7a0cf70a.js → index-f9338e27.js} +2 -2
- package/build/esm/index.js +1 -1
- package/build/esm/{index.styled-c0a2cbc4.js → index.styled-8ad8796f.js} +2 -2
- package/build/esm/{index.styled-7621a537.js → index.styled-c742d0a3.js} +5 -5
- package/build/esm/{index.styled-897d1d7d.js → index.styled-ce98cbc1.js} +1 -1
- package/build/esm/{index.styles-2670b640.js → index.styles-952b0f4b.js} +1 -1
- package/build/esm/lead.js +1 -1
- package/build/esm/mantine.js +1 -1
- package/build/esm/misc.js +1 -1
- package/build/esm/navigation.js +1 -1
- package/build/esm/{normalizeLink-21860b29.js → normalizeLink-58957b47.js} +1 -1
- package/build/esm/onboarding.js +1 -1
- package/build/esm/onboardingV2.js +18 -18
- package/build/esm/pwg.js +3 -3
- package/build/esm/together.js +1 -1
- package/build/esm/{types-c35e8660.js → types-0cbaa281.js} +1 -1
- package/build/esm/{types-c0872c63.js → types-27c16503.js} +1 -1
- package/build/esm/types.js +1 -1
- package/build/esm/{useCategory-70a19940.js → useCategory-bfba2de5.js} +1 -1
- package/build/esm/useHealthToolCache-b9973713.js +1 -0
- package/build/esm/{useRafState-66373b2d.js → useRafState-66b5f663.js} +1 -1
- package/build/esm/useTranslations-b2f04ab6.js +1 -0
- package/build/esm/{utils-cd9f3234.js → utils-33c4c832.js} +1 -1
- package/build/esm/vaccination.js +5 -5
- package/build/{fixedBottomAdBlock-90957ff3.js → fixedBottomAdBlock-664a6e50.js} +1 -1
- package/build/footer.js +1 -1
- package/build/gAssets.js +1 -1
- package/build/{getDynamicHealthTool-9858cbf6.js → getDynamicHealthTool-571597e0.js} +1 -1
- package/build/{getSocialList-e92f5b03.js → getSocialList-2d43911c.js} +1 -1
- package/build/hooks.js +1 -1
- package/build/i18n-values/vi-VN.js +1 -1
- package/build/i18n-values/vi-VN_MB.js +1 -1
- package/build/i18n.js +1 -1
- package/build/i18nV2.js +1 -1
- package/build/{index-9139a1b0.js → index-22a4d8ec.js} +1 -1
- package/build/{index-b3e74643.js → index-2584fe83.js} +2 -2
- package/build/{index-2e49ed8f.js → index-2db33f49.js} +1 -1
- package/build/{index-2b1500c8.js → index-32d3a385.js} +1 -1
- package/build/index-4efa8e7e.js +1 -0
- package/build/{index-314491e7.js → index-537bccbe.js} +1 -1
- package/build/{index-611f5daf.js → index-55a6f97a.js} +1 -1
- package/build/index-58609826.js +1 -0
- package/build/{index-4d941e91.js → index-5b7dfda4.js} +1 -1
- package/build/{index-e71d86ca.js → index-63632fd5.js} +1 -1
- package/build/{index-2163c775.js → index-8383af12.js} +1 -1
- package/build/{index-3fa544d3.js → index-9669998e.js} +1 -1
- package/build/{index-753c5340.js → index-9f6e2696.js} +29 -29
- package/build/{index-56ad1186.js → index-a89b23de.js} +1 -1
- package/build/{index-f4e53bf8.js → index-b99409f1.js} +1 -1
- package/build/{index-2075491a.js → index-bc8fcf35.js} +1 -1
- package/build/{index-44ba7b08.js → index-c57b487f.js} +1 -1
- package/build/{index-9f431a0f.js → index-dad94e78.js} +1 -1
- package/build/{index-d220afbf.js → index-e022af07.js} +1 -1
- package/build/{index-633a5bf3.js → index-e7f2e80f.js} +3 -3
- package/build/{index-e29e4c94.js → index-f36821a3.js} +1 -1
- package/build/index.js +1 -1
- package/build/{index.styled-3d7dd6e8.js → index.styled-0d4d68f3.js} +1 -1
- package/build/{index.styled-9824e086.js → index.styled-90c35fc5.js} +3 -3
- package/build/{index.styled-790b9cd1.js → index.styled-b9465af1.js} +5 -5
- package/build/{index.styles-dcdcb15d.js → index.styles-9285e23d.js} +1 -1
- package/build/lead.js +1 -1
- package/build/mantine.js +1 -1
- package/build/misc.js +1 -1
- package/build/navigation.js +1 -1
- package/build/{normalizeLink-72938aa8.js → normalizeLink-28258895.js} +1 -1
- package/build/onboarding.js +1 -1
- package/build/onboardingV2.js +5 -5
- package/build/pwg.js +2 -2
- package/build/together.js +1 -1
- package/build/{types-c6a1a14f.js → types-90d8b488.js} +1 -1
- package/build/{types-7ecc106d.js → types-ffea7b45.js} +1 -1
- package/build/types.js +1 -1
- package/build/{useCategory-4968c4d0.js → useCategory-971481b4.js} +1 -1
- package/build/{useHealthToolCache-7b38b8b0.js → useHealthToolCache-10f561aa.js} +1 -1
- package/build/{useRafState-228e7e99.js → useRafState-5cd3ac64.js} +1 -1
- package/build/{useTranslations-e52e6fd2.js → useTranslations-2e7d64aa.js} +1 -1
- package/build/utils-2fb6eb7d.js +1 -0
- package/build/vaccination.js +1 -1
- package/package.json +1 -1
- package/build/components/molecules/premiumNewsletterBanner/index.d.ts +0 -15
- package/build/components/molecules/premiumNewsletterBanner/testingBanner.d.ts +0 -3
- package/build/esm/components/molecules/premiumNewsletterBanner/index.d.ts +0 -15
- package/build/esm/components/molecules/premiumNewsletterBanner/testingBanner.d.ts +0 -3
- package/build/esm/index-b528163b.js +0 -1
- package/build/esm/index-b8e67607.js +0 -1
- package/build/esm/index-bcd1808f.js +0 -1
- package/build/esm/useHealthToolCache-59a568dd.js +0 -1
- package/build/esm/useTranslations-5eeefd8c.js +0 -1
- package/build/index-7109c879.js +0 -1
- package/build/index-7af60d34.js +0 -1
- package/build/utils-b44511dc.js +0 -1
- /package/build/{BMI_BOYS.percentile.monthly-03b0a17d.js → BMI_BOYS.percentile.monthly-5b917714.js} +0 -0
- /package/build/{BMI_BOYS.percentile.weekly-a33d058d.js → BMI_BOYS.percentile.weekly-9566eb37.js} +0 -0
- /package/build/{BMI_BOYS.percentile.yearly-6ff97ed9.js → BMI_BOYS.percentile.yearly-db737739.js} +0 -0
- /package/build/{BMI_BOYS.zscore.monthly-d76b4424.js → BMI_BOYS.zscore.monthly-86f68a0b.js} +0 -0
- /package/build/{BMI_BOYS.zscore.weekly-25865f62.js → BMI_BOYS.zscore.weekly-92d923b0.js} +0 -0
- /package/build/{BMI_BOYS.zscore.yearly-0a163e24.js → BMI_BOYS.zscore.yearly-4d92f086.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.monthly-526177f1.js → BMI_GIRLS.percentile.monthly-6a6d1837.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.weekly-f5e5b1bf.js → BMI_GIRLS.percentile.weekly-5589d39f.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.yearly-f8d1dfcd.js → BMI_GIRLS.percentile.yearly-15c4d279.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.monthly-dadee917.js → BMI_GIRLS.zscore.monthly-667e63fd.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.weekly-443024a5.js → BMI_GIRLS.zscore.weekly-3fdeccfe.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.yearly-3bf0e411.js → BMI_GIRLS.zscore.yearly-ea25f63d.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-0d86a102.js → HEAD CIRCUM_BOYS.percentile.monthly-6db968ca.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-9b9ac144.js → HEAD CIRCUM_BOYS.percentile.weekly-2a4e9201.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-ea0ee6dc.js → HEAD CIRCUM_BOYS.percentile.yearly-c566092e.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-b0f6f3ce.js → HEAD CIRCUM_BOYS.zscore.monthly-03fc7b94.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-3a24b5da.js → HEAD CIRCUM_BOYS.zscore.weekly-faa83c6d.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-c0d3acd7.js → HEAD CIRCUM_BOYS.zscore.yearly-629071b8.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-3121a310.js → HEAD CIRCUM_GIRLS.percentile.monthly-fd8e09c4.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-76c88a25.js → HEAD CIRCUM_GIRLS.percentile.weekly-d7bc181c.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-d7662134.js → HEAD CIRCUM_GIRLS.percentile.yearly-2c18bf98.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-2fd1d14e.js → HEAD CIRCUM_GIRLS.zscore.monthly-8d909763.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-32ca855c.js → HEAD CIRCUM_GIRLS.zscore.weekly-018ebd5c.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-45412ada.js → HEAD CIRCUM_GIRLS.zscore.yearly-f4da36f0.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.monthly-52900d4f.js → HEIGHT_BOYS.percentile.monthly-4bcc65ef.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.weekly-61b1d40a.js → HEIGHT_BOYS.percentile.weekly-7c769b89.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.yearly-507a34d2.js → HEIGHT_BOYS.percentile.yearly-3f50eba5.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.monthly-dc6aa694.js → HEIGHT_BOYS.zscore.monthly-a78a7a26.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.weekly-c50427f9.js → HEIGHT_BOYS.zscore.weekly-caab37b3.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.yearly-89381ecc.js → HEIGHT_BOYS.zscore.yearly-c2d46f1f.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.monthly-a5e48323.js → HEIGHT_GIRLS.percentile.monthly-b3265a7d.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.weekly-01b9b367.js → HEIGHT_GIRLS.percentile.weekly-69403da3.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.yearly-40365af8.js → HEIGHT_GIRLS.percentile.yearly-5f19a816.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.monthly-be2a1555.js → HEIGHT_GIRLS.zscore.monthly-e56cd9ff.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.weekly-7dd8e2be.js → HEIGHT_GIRLS.zscore.weekly-cfbee1ac.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.yearly-4cc3169b.js → HEIGHT_GIRLS.zscore.yearly-603fd96e.js} +0 -0
- /package/build/{Onboarding-eda97622.js → Onboarding-2b01db17.js} +0 -0
- /package/build/{Visible-8f91e576.js → Visible-7e3703b1.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.monthly-5f71f8e6.js → WEIGHT_BOYS.percentile.monthly-df2b38ad.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.weekly-ad9e0982.js → WEIGHT_BOYS.percentile.weekly-017d4587.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.yearly-ed1e14bb.js → WEIGHT_BOYS.percentile.yearly-d98f06d0.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.monthly-02ce2d47.js → WEIGHT_BOYS.zscore.monthly-3efc2926.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.weekly-5e25b5a4.js → WEIGHT_BOYS.zscore.weekly-1478e955.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.yearly-3d2ec650.js → WEIGHT_BOYS.zscore.yearly-96592d44.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.monthly-831fbf48.js → WEIGHT_GIRLS.percentile.monthly-7990f762.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.weekly-62e5c21b.js → WEIGHT_GIRLS.percentile.weekly-4b98de90.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.yearly-634b6b1c.js → WEIGHT_GIRLS.percentile.yearly-5686e441.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.monthly-0bb0f9dc.js → WEIGHT_GIRLS.zscore.monthly-76c7187f.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.weekly-324b7a89.js → WEIGHT_GIRLS.zscore.weekly-bc5910e8.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.yearly-63965708.js → WEIGHT_GIRLS.zscore.yearly-07b83056.js} +0 -0
- /package/build/components/molecules/{premiumNewsletterBanner → surveyOrPremiumBanner}/bannerLayout.d.ts +0 -0
- /package/build/components/molecules/{premiumNewsletterBanner → surveyOrPremiumBanner}/handlerBanner.d.ts +0 -0
- /package/build/{constants-e7d71ae0.js → constants-fd82a887.js} +0 -0
- /package/build/{cookieHelper-67cb3d98.js → cookieHelper-47e34efa.js} +0 -0
- /package/build/{dataTransform-ec79da65.js → dataTransform-fe677610.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.monthly-c0ed6b25.js → BMI_BOYS.percentile.monthly-9e7fdff9.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.weekly-41326a44.js → BMI_BOYS.percentile.weekly-109aa882.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.yearly-aaeb4489.js → BMI_BOYS.percentile.yearly-2f4904a4.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.monthly-fd822aa5.js → BMI_BOYS.zscore.monthly-b7818505.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.weekly-eb21980f.js → BMI_BOYS.zscore.weekly-8a8c6e60.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.yearly-c0c5f77a.js → BMI_BOYS.zscore.yearly-259d827f.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.monthly-891f0c3a.js → BMI_GIRLS.percentile.monthly-4c85f2e2.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.weekly-058942a5.js → BMI_GIRLS.percentile.weekly-52780dde.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.yearly-18e64396.js → BMI_GIRLS.percentile.yearly-d552f7ff.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.monthly-fb4764bd.js → BMI_GIRLS.zscore.monthly-70736759.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.weekly-6e3cdd9d.js → BMI_GIRLS.zscore.weekly-09d9a498.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.yearly-964afbaa.js → BMI_GIRLS.zscore.yearly-787a71f2.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-05d677e9.js → HEAD CIRCUM_BOYS.percentile.monthly-3dc23858.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-ce43ef6e.js → HEAD CIRCUM_BOYS.percentile.weekly-fc90a435.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-2b6e2ead.js → HEAD CIRCUM_BOYS.percentile.yearly-d311328c.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-e790d5b8.js → HEAD CIRCUM_BOYS.zscore.monthly-a4105e49.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-24f67c66.js → HEAD CIRCUM_BOYS.zscore.weekly-1602faff.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-808cabb3.js → HEAD CIRCUM_BOYS.zscore.yearly-314d87f2.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-2494b2f5.js → HEAD CIRCUM_GIRLS.percentile.monthly-1755894d.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-c619fe7e.js → HEAD CIRCUM_GIRLS.percentile.weekly-eff64869.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-95322471.js → HEAD CIRCUM_GIRLS.percentile.yearly-ec836bd1.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-6cef3e38.js → HEAD CIRCUM_GIRLS.zscore.monthly-45824afc.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-63d2be33.js → HEAD CIRCUM_GIRLS.zscore.weekly-3dda450c.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-0111d1d5.js → HEAD CIRCUM_GIRLS.zscore.yearly-47d31d6a.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.monthly-d681290f.js → HEIGHT_BOYS.percentile.monthly-8e3e5eea.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.weekly-5873089d.js → HEIGHT_BOYS.percentile.weekly-4fd1e4f0.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.yearly-37378046.js → HEIGHT_BOYS.percentile.yearly-a72efc6f.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.monthly-1b2697a7.js → HEIGHT_BOYS.zscore.monthly-bbc5d61a.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.weekly-84b0707d.js → HEIGHT_BOYS.zscore.weekly-be4b43d4.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.yearly-3eb4d639.js → HEIGHT_BOYS.zscore.yearly-41fab017.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-028e111f.js → HEIGHT_GIRLS.percentile.monthly-5960d7bc.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-13c93618.js → HEIGHT_GIRLS.percentile.weekly-842b0b35.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-cf733987.js → HEIGHT_GIRLS.percentile.yearly-5e771144.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-aece5b1c.js → HEIGHT_GIRLS.zscore.monthly-a87662f6.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-9d1ee9e2.js → HEIGHT_GIRLS.zscore.weekly-9974df51.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-7b7ec405.js → HEIGHT_GIRLS.zscore.yearly-036899ae.js} +0 -0
- /package/build/esm/{Onboarding-8386c62c.js → Onboarding-3631c6d1.js} +0 -0
- /package/build/esm/{Visible-53ac248e.js → Visible-2bac67a9.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.monthly-1dff682d.js → WEIGHT_BOYS.percentile.monthly-fb78f02c.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.weekly-c2ff9b23.js → WEIGHT_BOYS.percentile.weekly-a91de386.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.yearly-982ac1ae.js → WEIGHT_BOYS.percentile.yearly-ad66fdd2.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.monthly-b95b5729.js → WEIGHT_BOYS.zscore.monthly-2f39cc76.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.weekly-6d599f9e.js → WEIGHT_BOYS.zscore.weekly-14cc15d4.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.yearly-bab0c651.js → WEIGHT_BOYS.zscore.yearly-2041fbea.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-0f54b996.js → WEIGHT_GIRLS.percentile.monthly-3a60ac45.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-fe08daa7.js → WEIGHT_GIRLS.percentile.weekly-d0fbecca.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-5c8d7800.js → WEIGHT_GIRLS.percentile.yearly-3ae3438e.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-d9f39b55.js → WEIGHT_GIRLS.zscore.monthly-ed2bf2a6.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-c79991bd.js → WEIGHT_GIRLS.zscore.weekly-3328de54.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-d1d50e1a.js → WEIGHT_GIRLS.zscore.yearly-e78ef269.js} +0 -0
- /package/build/esm/components/molecules/{premiumNewsletterBanner → surveyOrPremiumBanner}/bannerLayout.d.ts +0 -0
- /package/build/esm/components/molecules/{premiumNewsletterBanner → surveyOrPremiumBanner}/handlerBanner.d.ts +0 -0
- /package/build/esm/{constants-7adbe3c0.js → constants-66251709.js} +0 -0
- /package/build/esm/{cookieHelper-52685cc6.js → cookieHelper-2fe90225.js} +0 -0
- /package/build/esm/{dataTransform-55ae967b.js → dataTransform-532e7457.js} +0 -0
- /package/build/esm/{index-f8eec5e7.js → index-7df304c0.js} +0 -0
- /package/build/esm/{isProduction-ed4525be.js → isProduction-85c6cb19.js} +0 -0
- /package/build/esm/{localizeNumberFormat-705ca7e6.js → localizeNumberFormat-17475a32.js} +0 -0
- /package/build/esm/{number-05af8f98.js → number-251f8529.js} +0 -0
- /package/build/esm/{paths-e75f2e2f.js → paths-46458204.js} +0 -0
- /package/build/esm/{screenSizeContext-10db56d9.js → screenSizeContext-4ff53e25.js} +0 -0
- /package/build/esm/{theme-a4e9bb74.js → theme-b5489d82.js} +0 -0
- /package/build/esm/{translationsContext-3b169438.js → translationsContext-be2e1844.js} +0 -0
- /package/build/esm/{tslib.es6-6c588ee6.js → tslib.es6-0405df6a.js} +0 -0
- /package/build/esm/{types-b707f6a4.js → types-48c94135.js} +0 -0
- /package/build/esm/{useIsInit-5d90c0d1.js → useIsInit-942b94fa.js} +0 -0
- /package/build/esm/{useOutsideClick-fbe19017.js → useOutsideClick-3450a7a8.js} +0 -0
- /package/build/esm/{useScrollbarSize-71b41011.js → useScrollbarSize-11faa525.js} +0 -0
- /package/build/esm/{useUniqueId-d097338a.js → useUniqueId-d35bf586.js} +0 -0
- /package/build/{index-e8e5f987.js → index-4046269f.js} +0 -0
- /package/build/{isProduction-6603c122.js → isProduction-e1b7813f.js} +0 -0
- /package/build/{localizeNumberFormat-d70884f2.js → localizeNumberFormat-7424a97a.js} +0 -0
- /package/build/{number-7a59b05e.js → number-b3767f34.js} +0 -0
- /package/build/{paths-52bfb691.js → paths-2ac2ae14.js} +0 -0
- /package/build/{screenSizeContext-d3822141.js → screenSizeContext-4d5786c6.js} +0 -0
- /package/build/{theme-95cd4c16.js → theme-1a7c14fb.js} +0 -0
- /package/build/{translationsContext-0aeba983.js → translationsContext-f962ff63.js} +0 -0
- /package/build/{tslib.es6-23138875.js → tslib.es6-0d31715f.js} +0 -0
- /package/build/{types-c4a0b167.js → types-ef750ab6.js} +0 -0
- /package/build/{useIsInit-5fb3bcb1.js → useIsInit-790b9962.js} +0 -0
- /package/build/{useOutsideClick-51c6acd1.js → useOutsideClick-81c62034.js} +0 -0
- /package/build/{useScrollbarSize-9b6430c7.js → useScrollbarSize-29ac8766.js} +0 -0
- /package/build/{useUniqueId-10edc9fa.js → useUniqueId-86a9e1d4.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./tslib.es6-23138875.js"),t=require("react"),a=require("@mantine/core"),l=require("./index-753c5340.js"),o=require("./useTranslations-e52e6fd2.js"),n=require("innertext"),i=require("./theme-95cd4c16.js"),r=require("./index-4d941e91.js"),s=require("./index.styles-dcdcb15d.js");require("@mantine/dates");var d=require("./index-56ad1186.js");require("./Onboarding-eda97622.js");var c=require("./gAssets.js");require("dayjs");var u=require("./screenSizeContext-d3822141.js");require("styled-components"),require("./isProduction-6603c122.js");var m=require("./index-9f431a0f.js");require("@mantine/hooks");var p=require("./index-3fa544d3.js"),v=require("./index.styled-3d7dd6e8.js"),g=require("./index-d220afbf.js"),f=require("./index-314491e7.js"),h=require("lodash/debounce"),y=require("react-contenteditable");require("./useCategory-4968c4d0.js");var C=require("./index-f4e53bf8.js"),E=require("react-dom");function w(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function k(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(a){if("default"!==a){var l=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,l.get?l:{enumerable:!0,get:function(){return e[a]}})}})),t.default=e,Object.freeze(t)}require("date-fns"),require("react-day-picker/DayPickerInput"),require("./index-633a5bf3.js"),require("lodash/throttle"),require("./types-c4a0b167.js"),require("react-hook-form"),require("date-fns/locale/en-US"),require("date-fns/locale/id"),require("date-fns/locale/vi"),require("date-fns/locale/zh-TW"),require("./index.styled-790b9cd1.js"),require("uuid"),require("./utils-b44511dc.js"),require("string-format");var b=w(t),P=w(n),T=w(h),S=w(y),x=k(E);const N=({title:o,url:n,image:i,logo:r,className:d,style:c,noRefetch:u})=>{const{data:{locale:m,env:{isMarryBaby:p}}}=t.useContext(s.TogetherComponentGlobalContext),[v,f]=t.useState(!1),h=a.useMantineTheme(),y=t.useRef(u);y.current=u;const[C,E]=t.useState(null);t.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){if(!y.current){if(!n)return E(null);E((e=>Object.assign(Object.assign({},e),{isFetching:!0}))),s.callApi(s.getApiPath(s.PATHS.FETCH_PREVIEW,{_locale:m}),"POST",{data:{link:n},headers:{"Content-Type":"application/json"}}).then((e=>{var t,a,l;f(!1),E({title:null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.title,url:n,image:(null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.image)||(null===(l=null==e?void 0:e.data)||void 0===l?void 0:l.logo)})})).catch((()=>{E(null)}))}}))}),[n]);const w=(null==C?void 0:C.image)||i,k=(null==C?void 0:C.title)||o,P=(null==C?void 0:C.logo)||r,T=(null==C?void 0:C.url)||n,S=T.replace("http://","").replace("https://","").split(/[/?#]/)[0],x=t.useRef(!1);return b.default.createElement(l.StyledCardLink,{"data-is-marrybaby":p,className:`${d} no-replace-click`,style:c,color:h.colors[h.primaryColor][0]},b.default.createElement("a",{href:T,target:"_blank",rel:"noreferrer"},w&&b.default.createElement("div",{className:"link-image-wrapper"},!p&&b.default.createElement("img",{className:"link-image-blur",src:w,onError:e=>{x.current||(x.current=!0,e.currentTarget.src=s.DEFAULT_IMG)},loading:"lazy"}),b.default.createElement("img",{className:"link-image",src:w,onError:e=>{x.current||(x.current=!0,e.currentTarget.src=s.DEFAULT_IMG)},loading:"lazy"})),b.default.createElement("div",{className:"link-info-container"},b.default.createElement(g.Text,{size:"n1"},p&&P&&!v&&b.default.createElement("img",{className:"link-logo",src:P,onError:()=>f(!0),loading:"lazy"}),S),b.default.createElement(s.Heading,{tag:"h6"},k))))};const A=({onClick:e,color:a,className:n,style:i})=>{const{data:{env:{isMarryBaby:r}}}=t.useContext(s.TogetherComponentGlobalContext),{t:d}=o.useTranslations();return b.default.createElement(l.LabelSortPin,{label:b.default.createElement(b.default.Fragment,null,r&&b.default.createElement("img",{className:"label-sort-pin-icon",src:"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M3.5 19.9999L7.87 15.6299' stroke='%23FB8C00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath fill-rule='evenodd' clip-rule='evenodd' d='M4.95634 11.294C4.56534 11.685 4.56534 12.318 4.95634 12.708L7.87434 15.626L10.7923 18.544C11.1833 18.935 11.8163 18.935 12.2063 18.544L13.3813 17.369C13.5693 17.181 13.6743 16.927 13.6743 16.662V12.726L16.5743 9.82597L18.8833 9.94897C19.1663 9.96397 19.4433 9.85797 19.6433 9.65797L20.2173 9.08397C20.6083 8.69297 20.6083 8.05997 20.2173 7.66997L15.8313 3.28397C15.4403 2.89297 14.8073 2.89297 14.4173 3.28397L13.8433 3.85797C13.6423 4.05897 13.5363 4.33497 13.5523 4.61797L13.6753 6.92697L10.7753 9.82697H6.83834C6.57334 9.82697 6.31834 9.93197 6.13134 10.12L4.95634 11.294V11.294Z' stroke='%23FB8C00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath d='M16.5699 9.83018L13.6699 6.93018' stroke='%23FB8C00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3c/svg%3e",loading:"lazy"})," ",d("label.pinnedPost")),rightLabel:!r&&b.default.createElement("img",{className:"label-sort-pin-icon",src:"data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cline x1='7.18605' y1='7.68219' x2='3.68219' y2='13.8139' stroke='%23FEA21E' stroke-linecap='round'/%3e%3cpath d='M3.24591 7.78426C3.21275 7.84168 3.20376 7.90993 3.22092 7.97398C3.23808 8.03803 3.27998 8.09264 3.3374 8.12579L8.78429 11.2706C8.90385 11.3396 9.05674 11.2986 9.12578 11.1791C9.71191 10.1641 9.71348 8.97262 9.23682 7.99339L10.8583 5.18521C11.5115 5.00603 12.0982 4.57973 12.4638 3.94629C12.5328 3.82672 12.4919 3.67383 12.3723 3.6048L8.18237 1.18584C8.12494 1.15268 8.0567 1.1437 7.99265 1.16086C7.92861 1.17803 7.874 1.21993 7.84086 1.27736C7.47521 1.91077 7.39934 2.63194 7.57065 3.28723L5.94919 6.09545C4.86323 6.1723 3.83201 6.76934 3.24591 7.78426Z' fill='%23FEA21E' stroke='%23FEA21E' stroke-width='0.5' stroke-linejoin='round'/%3e%3c/svg%3e",loading:"lazy"}),onClick:e,color:"white",className:`label-pinned ${n}`,style:i})},I=e=>({message:e("notification.failure"),type:"danger"});var _="data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 14.5C11.3137 14.5 14 11.8137 14 8.5C14 5.18629 11.3137 2.5 8 2.5C4.68629 2.5 2 5.18629 2 8.5C2 11.8137 4.68629 14.5 8 14.5Z' fill='%23FE921D'/%3e%3cpath d='M8 5.5V8.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 11.5H8.00708' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const M=(e,a)=>{const[l,o]=t.useState(e||[]);return{onSelectImages:t=>{const n=t.target.files;if(n)if(a&&e){a((e||l).concat(Array.from(n)))}else o((t=>{const l=e||t;return a&&a(l.concat(Array.from(n))),l.concat(Array.from(n))}))},onRemoveImage:t=>{if(a&&e){const l=e;l.splice(t,1),a(l.slice())}else o((l=>{const o=e||l;return o.splice(t,1),a&&a(o.slice()),o.slice()}))},onRemoveAllImages:()=>{a?a([]):o([])},imageSrcs:t.useMemo((()=>(e||l).map((e=>"string"==typeof e?e:URL.createObjectURL(e)))),[e,l]),imageFiles:e||l}};var L="data:image/svg+xml,%3csvg width='24' height='25' viewBox='0 0 24 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 22.9844C17.5228 22.9844 22 18.5072 22 12.9844C22 7.46153 17.5228 2.98438 12 2.98438C6.47715 2.98438 2 7.46153 2 12.9844C2 18.5072 6.47715 22.9844 12 22.9844Z' fill='%23262626'/%3e%3cpath d='M14.8281 10.1562L9.17127 15.8131' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M9.17188 10.1562L14.8287 15.8131' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const j=({className:e,style:a,bannedWords:n=[],value:r,onChange:d,onPreviewUrlChange:c,onInvalidUrlsChange:u,onImageFilesChange:m,imageFiles:p,isReplying:v})=>{const{t:f}=o.useTranslations(),[h,y]=t.useState(null),C=t.useRef(null),{onSelectImages:E,onRemoveImage:w,imageSrcs:k}=M(p,m);return t.useEffect((()=>{c&&((null==h?void 0:h.url)?c({title:h.title||"",url:h.url||"",image:h.image||"",description:h.description||""}):c(null))}),[h]),b.default.createElement(l.StyledCreatePostDescription,{className:e,style:a},b.default.createElement(g.Text,{size:"p4",className:"description-label"},f("createPost.popup.description")),b.default.createElement("div",{className:"textarea-control"},b.default.createElement("div",{className:"textarea-wrapper"},b.default.createElement(l.RichTextEditor,{html:r||"",onChange:d,bannedWords:n,onImagePickerClick:()=>{var e;return null===(e=C.current)||void 0===e?void 0:e.click()},onPreviewUrlChange:y,onInvalidUrlsChange:u,isReplying:v}))),b.default.createElement(g.Text,{size:"p4",className:"count-string"},f("character"),": ",P.default(r||"").length),(!k||0===k.length)&&h&&b.default.createElement("div",{className:"link-preview-wrapper"},h.isFetching?b.default.createElement(l.Loading,null):b.default.createElement(b.default.Fragment,null,b.default.createElement(N,{title:h.title,url:h.url||"#",image:h.image,noRefetch:!0}),b.default.createElement("img",{src:L,className:"icon-close",onClick:()=>y(null),loading:"lazy"}))),b.default.createElement("input",{ref:C,type:"file",accept:"image/png, image/gif, image/jpeg",multiple:!0,style:{display:"none"},onChange:E}),k.length>s.MAX_IMAGE_UPLOADS?b.default.createElement("div",{className:"input-notification"},b.default.createElement("img",{src:_,loading:"lazy"}),b.default.createElement(g.Text,{size:"p4",color:i.theme.colors.alertWarning},f("createPost.popup.warningImage"))):null,k.length>0&&b.default.createElement("div",{className:"image-gallery"},k.map(((e,t)=>b.default.createElement("div",{key:t,className:"image-item"},b.default.createElement("img",{src:e,loading:"lazy"}),b.default.createElement("img",{className:"close-btn",src:L,onClick:()=>w(t),loading:"lazy"}))))))},R=(e,t)=>{if(!t)return e;const{limit:a,bannedWords:o=[]}=t,n="number"==typeof a&&a>=0?e.substring(0,a):e;return l.highlightBadWords(n,o)},B=({className:e,style:a,bannedWords:n=[],value:i,onChange:r})=>{var s;const{t:d}=o.useTranslations(),[c,u]=t.useState(""),m=t.useRef(null);t.useEffect((()=>{if(m.current){const e=e=>{var t;e.preventDefault();const a=null===(t=e.clipboardData)||void 0===t?void 0:t.getData("text/plain");document.execCommand("insertHTML",!1,a)},t=m.current;return t.addEventListener("paste",e,{passive:!0}),()=>t.removeEventListener("paste",e)}}),[m]);const p=(null==n?void 0:n.join(","))||"";t.useEffect((()=>{var e;if(p){const t=null===(e=m.current)||void 0===e?void 0:e.innerText;if(t){const e=l.highlightBadWords(t,n);e!==t&&(r&&r(e),u(e))}}}),[p]);const v=t.useCallback(T.default((()=>{if(m.current){const e=R(m.current.innerText,{limit:120,bannedWords:n});r&&r(e),u(e)}}),300),[]);return t.useEffect((()=>{setTimeout((()=>{var e;null===(e=m.current)||void 0===e||e.focus()}),500)}),[]),b.default.createElement(l.StyledCreatePostTitle,{className:e,style:a},b.default.createElement(f.Input,{name:"title",value:i||c,size:"md",label:d("createPost.title"),CustomInput:b.default.createElement(S.default,{innerRef:m,html:i||c,onChange:()=>{if(m.current&&m.current.innerText!==(i||c)){const e=R(m.current.innerText,{bannedWords:n});r&&r(e),u(e),v()}},className:"title-input"})}),b.default.createElement(g.Text,{size:"p4",className:"count-string"},d("createPost.popup.wordCount",{count:(null===(s=m.current)||void 0===s?void 0:s.innerText.length)||0,max:120})))},O=({className:a,style:o,topics:n,communityId:i,onChange:r,isLoading:d,disabled:c,forceTopics:u,selectedTopics:m,noFetch:p,dataEventCategory:g,dataEventAction:f,dataEventLabel:h})=>{const{data:{locale:y,env:{isMarryBaby:C}}}=t.useContext(s.TogetherComponentGlobalContext),[E,w]=t.useState(n?[...n]:[]),[k,P]=t.useState(m?[...m]:[]),[T,S]=t.useState(!1),x=t.useRef(n);x.current=n,t.useEffect((()=>{var t;!i||p||(null===(t=x.current)||void 0===t?void 0:t.length)||(w([]),S(!0),e.__awaiter(void 0,void 0,void 0,(function*(){var e;try{const t=yield s.callApi(s.getApiPath(s.PATHS.TOPIC.LIST,{communityId:i,_locale:y}),"GET"),a=null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.topics;Array.isArray(a)&&w((()=>(null==a?void 0:a.map(v.formatTopic).sort(((e,t)=>(e.order||0)-(t.order||0))))||[]))}catch(e){console.log(e),S(!1)}S(!1)})))}),[i,p]);const N=null==n?void 0:n.map((e=>e.id)).join("-"),A=null==E?void 0:E.map((e=>e.id)).join("-"),I=null==u?void 0:u.map((e=>e.id)).join("-");t.useEffect((()=>{n&&void 0!==N&&N!==A&&w(n)}),[n,N,A]);const _=t.useMemo((()=>E.filter((e=>!(null==u?void 0:u.some((t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId)))))),[A,I]);return b.default.createElement(l.StyledTopicSelectList,{"data-is-marrybaby":C,className:a,style:o},u.map((e=>b.default.createElement(z,{key:`${e.id}-${e.mappedCategoryId}`,topic:e,disabled:!0,selected:!0,dataEventAction:f,dataEventCategory:g,dataEventLabel:h}))),_.map((e=>b.default.createElement(z,{key:`${e.id}-${e.mappedCategoryId}`,topic:e,disabled:c,selected:(m||k).some((t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId)),onClick:()=>{const t=m||k,a=t.findIndex((t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId));-1!==a?t.splice(a,1):t.push(e),r&&m?r(t.slice()):(r&&r(t.slice()),P(t.slice()))},dataEventAction:f,dataEventCategory:g,dataEventLabel:h}))),(d||T)&&b.default.createElement(l.Loading,{className:"topic-spinner"}))},z=t=>{var{topic:a,disabled:l,selected:o,onClick:n}=t,i=e.__rest(t,["topic","disabled","selected","onClick"]);return b.default.createElement("div",Object.assign({className:"tag-item"+(o?" --active":""),"data-disabled":l,onClick:l?void 0:n},i),a.name)},D=({className:e,isMarryBaby:a,style:o,title:n,description:i,acceptText:r,cancelText:d,onAccept:c,onCancel:m,thumbnail:p,isThumbnailIcon:v,onClose:f,acceptBtnTracking:h,acceptBtnProps:y,cancelBtnProps:E})=>{const{data:{env:{isMarryBaby:w}}}=t.useContext(s.TogetherComponentGlobalContext),k="boolean"==typeof a?a:w,[P,T]=t.useState(!1);return t.useEffect((()=>(u.toggleNoScroll(!0),setTimeout((()=>T(!0)),0),()=>u.toggleNoScroll(!1))),[]),"undefined"==typeof window?null:x.createPortal(b.default.createElement(l.StyledPopupDanger,{"data-is-marrybaby":k,className:e,style:o,"data-open":P},b.default.createElement(l.PopupFrame,{className:"popup-frame",isOpen:P,onClose:f},b.default.createElement("div",{className:"confirm-dialog",onClick:e=>e.stopPropagation()},b.default.createElement("div",{className:"confirm-content"},p&&b.default.createElement("div",{className:"thumbnail-container "+(v?"is-icon":"")},b.default.createElement("img",{className:"thumbnail",src:p,loading:"lazy"})),b.default.createElement(s.Heading,{className:"title",tag:"h2"},n),b.default.createElement(g.Text,{className:"desc",size:"lg"},i),b.default.createElement("div",{className:"btn-group"},b.default.createElement(C.Button,Object.assign({theme:k?"marryBaby":"helloSites",size:"md",color:"tertiary",onClick:()=>{null==c||c(),null==f||f()}},y,h),r),b.default.createElement(C.Button,Object.assign({theme:k?"marryBaby":"helloSites",size:"md",onClick:()=>{null==m||m(),null==f||f()}},E),d)))),k&&p&&b.default.createElement("div",{className:"thumbnail-container is-mobile "+(v?"is-icon":"")},b.default.createElement("img",{className:"thumbnail",src:p,loading:"lazy"})))),u.getPopupWrapperDom())};const F=({isReply:a,className:n,onClose:i,replyToName:r,style:d,replyingId:c,replyingUser:u,onPostSuccess:m,post:p,isMarryBaby:h})=>{const{action:{pushNotifications:y,sanitizeFunction:E},data:{userInfo:w,locale:k,env:{isMarryBaby:P}}}=t.useContext(s.TogetherComponentGlobalContext),T="boolean"==typeof h?h:P,{t:S}=o.useTranslations(),{onSelectImages:x,onRemoveImage:A,imageSrcs:I,onRemoveAllImages:_,imageFiles:j}=M(),[R,B]=t.useState(""),{trigger:O}=t.useContext(l.MainInputTriggerContext),[z,D]=t.useState(!1),F=t.useRef(null),U=t.useRef(null),H=t.useRef(null),[q,W]=t.useState([]),[V,$]=t.useState([]),[G,Z]=t.useState(null);return t.useEffect((()=>{var e;null===(e=H.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"start"}),setTimeout((()=>{var e;null===(e=U.current)||void 0===e||e.focus()}),400)}),[O]),b.default.createElement(l.StyledInputCommentBar,{"data-is-reply":a,className:n,style:d},a&&b.default.createElement("div",{className:"reply-to-container"},b.default.createElement(g.Text,{size:"p4"},b.default.createElement("span",{dangerouslySetInnerHTML:{__html:S("inputComment.replyTo",{name:`<span style="color: #2D87F3; cursor: pointer">@${r||""}</span>`})}})),b.default.createElement("img",{src:"data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8.00016' cy='8.50004' r='6.66667' fill='white' stroke='%23404040'/%3e%3cpath d='M10 6.5L6 10.5' stroke='%23404040' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M6 6.5L10 10.5' stroke='%23404040' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",className:"icon-close-comment",onClick:()=>i&&i(),loading:"lazy"})),b.default.createElement("div",{className:"input-container",ref:H},b.default.createElement(v.UserAvatar,{className:"avatar-wrapper "+(a?"avatar-wrapper-reply":""),avatar:(null==w?void 0:w.id)?w.avatar:s.DEFAULT_AVATAR_IMG,username:(null==w?void 0:w.name)||(null==w?void 0:w.username)}),b.default.createElement("input",{ref:F,onChange:x,type:"file",multiple:!0,accept:"image/png,image/jpeg",name:"images",style:{display:"none"}}),b.default.createElement(f.Input,{value:R,name:"input",size:"md",className:"input-wrapper",displayIcon:b.default.createElement("img",{src:"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M10.7543 4.85352H4.49227C4.01776 4.85352 3.56268 5.04201 3.22715 5.37754C2.89162 5.71307 2.70313 6.16815 2.70312 6.64266V19.1667C2.70313 19.6412 2.89162 20.0963 3.22715 20.4318C3.56268 20.7673 4.01776 20.9558 4.49227 20.9558H17.0163C17.4908 20.9558 17.9459 20.7673 18.2814 20.4318C18.6169 20.0963 18.8054 19.6412 18.8054 19.1667V12.9047' stroke='%232D87F3' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M17.4633 3.51187C17.8192 3.15599 18.3019 2.95605 18.8052 2.95605C19.3085 2.95605 19.7912 3.15599 20.147 3.51187C20.5029 3.86775 20.7029 4.35044 20.7029 4.85373C20.7029 5.35702 20.5029 5.83971 20.147 6.19559L11.6486 14.694L8.07031 15.5886L8.96489 12.0103L17.4633 3.51187Z' stroke='%232D87F3' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",loading:"lazy"}),CustomInput:b.default.createElement("div",{className:"as-input"},b.default.createElement(l.RichTextEditor,{className:"textarea",html:R,onChange:B,onImagePickerClick:()=>{var e;return null===(e=F.current)||void 0===e?void 0:e.click()},bannedWords:V,onPreviewUrlChange:Z,onInvalidUrlsChange:W,setEditorRef:e=>U.current=e,isReplying:a}))}),b.default.createElement(C.Button,{theme:T?"marryBaby":"helloSites",className:"send-button",size:"sm",onClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){var t,o,n,r,d,g,f,h,C;if((null==p?void 0:p.id)&&!z){D(!0);try{const w=e=>{B(""),_(),i&&i();const t=v.formatComment(e.data);"string"==typeof t.images&&(t.images=JSON.parse(t.images)),m&&m(t)},b=yield(({postId:t,message:a,photos:o,link:n,locale:i,sanitizeFunction:r,replyingUserId:d,replyingUserName:c,replyingId:u})=>e.__awaiter(void 0,void 0,void 0,(function*(){const e=new FormData;let m=l.encodePostContent(a.replace(/(\ )+/g," "),r);const p=l.getMentionIdsFromString(m);return o&&o.length>0&&(yield Promise.all(null==o?void 0:o.map((e=>l.uploadAndGetSrc(e,i))))).filter(Boolean).slice(0,s.MAX_IMAGE_UPLOADS).forEach((t=>{e.append("images[]",t)})),n&&e.append("link",n),null==p||p.forEach((t=>{e.append("mention_ids[]",t)})),e.append("post_id",t),u&&e.append("parent_id",u),d&&(p.unshift(d),m=`[mention+id="${d}"+name="${(c||"").replace('"',"'")}"]${m}`,e.append("parent_user_id",String(d))),e.append("content",m),e.append("content",m),e})))(Object.assign({message:R,photos:j,postId:String(p.id),link:null==G?void 0:G.url,sanitizeFunction:E,locale:k},a&&c?{replyingUserId:String((null==u?void 0:u.id)||(null===(t=null==p?void 0:p.author)||void 0===t?void 0:t.id)||""),replyingId:c,replyingUserName:(null==u?void 0:u.name)||(null==u?void 0:u.username)||""}:{})),P=yield a&&c?((t,a)=>e.__awaiter(void 0,void 0,void 0,(function*(){return s.callApiWithAuth(s.getApiPath(s.PATHS.COMMENT.REPLY,{_locale:a}),"POST",{data:t})})))(b,k):((t,a)=>e.__awaiter(void 0,void 0,void 0,(function*(){return s.callApiWithAuth(s.getApiPath(s.PATHS.COMMENT.CREATE,{_locale:a}),"POST",{data:t})})))(b,k),T=null==P?void 0:P.data;(null==T?void 0:T.id)&&!(null===(n=null===(o=null==P?void 0:P.messages)||void 0===o?void 0:o.moderation)||void 0===n?void 0:n.type)?w(P):"banned"===(null===(d=null===(r=null==P?void 0:P.messages)||void 0===r?void 0:r.moderation)||void 0===d?void 0:d.type)?(y({title:S("notification.comment.blocked.title"),message:S("notification.comment.blocked.message"),type:"danger"}),P.messages.moderation.words&&$(P.messages.moderation.words)):"suspect"===(null===(f=null===(g=null==P?void 0:P.messages)||void 0===g?void 0:g.moderation)||void 0===f?void 0:f.type)?(y({title:S("notification.comment.suspect.title"),message:S("notification.comment.suspect.message"),type:"warning"}),B(""),_(),i&&i()):(null===(h=null==P?void 0:P.messages)||void 0===h?void 0:h.find((e=>{var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(y({message:S("notification.suspend.message"),type:"warning"}),B(""),_(),i&&i()):y({title:"",message:(null===(C=null==P?void 0:P.messages)||void 0===C?void 0:C[0])||S("notification.comment.somethingWrong"),type:"danger"})}catch(e){y({title:"",message:S("notification.comment.somethingWrong"),type:"danger"})}D(!1)}})),isLoading:z,isDisabled:!!(null==q?void 0:q.length)||z||!R||(null==R?void 0:R.length)<2||!R.trim()},b.default.createElement("img",{src:"data:image/svg+xml,%3csvg width='20' height='21' viewBox='0 0 20 21' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M7.5 9.73438L3.75 13.4844L7.5 17.2344' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M16.25 4.73438L16.25 10.3026C16.25 11.1464 15.9208 11.9557 15.3347 12.5524C14.7487 13.1491 13.9538 13.4844 13.125 13.4844L3.75 13.4844' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",className:"icon-enter",loading:"lazy"}))),(null==q?void 0:q.length)?b.default.createElement("div",{className:"error-text"},S("notification.limitUrlDomain")):null,(!I||0===I.length)&&G&&b.default.createElement("div",{className:"link-preview-wrapper"},G.isFetching?b.default.createElement(l.Loading,null):b.default.createElement(b.default.Fragment,null,b.default.createElement(N,{title:G.title,url:G.url||"#",image:G.image,noRefetch:!0}),b.default.createElement("img",{src:L,className:"icon-close",onClick:()=>Z(null),loading:"lazy"}))),I&&I.length>0&&b.default.createElement("div",{className:"preview-images-container"},I.map(((e,t)=>b.default.createElement("div",{key:t,className:"image-src-wrapper"},b.default.createElement("img",{className:"preview-image",src:e,loading:"lazy"}),b.default.createElement("img",{src:L,className:"icon-close-circle",onClick:()=>A(t),loading:"lazy"}))))))};var U="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14Z' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 5V8' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 11H8.00708' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const H=({className:a,style:n,reason:r,reasonText:d,onClose:c,postId:u})=>{const{data:{locale:m,env:{isMarryBaby:p}},action:{pushNotifications:v}}=t.useContext(s.TogetherComponentGlobalContext),{t:f}=o.useTranslations(),[h,y]=t.useState(!1);return b.default.createElement(l.StyledSubmitReportForm,{"data-is-marrybaby":p,className:a,style:n},b.default.createElement("ul",{className:"report-list"},b.default.createElement("li",{className:"report-item"},b.default.createElement("img",{src:U,loading:"lazy"}),b.default.createElement(g.Text,{className:"__label",color:i.theme.colors.gray800,size:"p4"},d))),b.default.createElement(C.Button,{theme:p?"marryBaby":"helloSites",className:"report-submit",size:"lg",color:"primary",isLoading:h,onClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(u&&!h){y(!0);try{const e=yield(({id:e,reason:t,locale:a})=>{const l=new FormData;return l.append("reason",t),s.callApiWithAuth(s.getApiPath(s.PATHS.POST.REPORT,{_locale:a,id:e}),"POST",{data:l})})({id:u,reason:r,locale:m});1===(null==e?void 0:e.status)&&(v({message:"Post reported",type:"success"}),c&&c())}catch(e){}y(!1)}}))},f("submit")))};const q=({className:e,style:n,authorName:i,images:r,onClose:s,onOpenSingleView:d,alt:c})=>{const{t:u}=o.useTranslations(),[m,p]=t.useState(!1);return t.useEffect((()=>{setTimeout((()=>{p(!0)}),0)}),[]),b.default.createElement(a.Portal,null,b.default.createElement(l.StyledImagePreviewPopup,{className:e,style:n,"data-open":m},b.default.createElement("div",{className:"top-bar"},b.default.createElement("img",{className:"icon-arrow-left",src:"data:image/svg+xml,%3csvg width='24' height='25' viewBox='0 0 24 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M10.0508 18.0607L4.00078 12.0367L10.0508 6.01172' stroke='%23262626' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M4.00195 12.0352L19.002 12.0352' stroke='%23262626' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",onClick:s,alt:"go back",loading:"lazy"}),b.default.createElement(g.Text,{size:"p2",type:"bold",style:{textAlign:"center"}},u("previewPhotos.title",{name:i}))),b.default.createElement("div",{className:"container"},r.map(((e,t)=>b.default.createElement("img",{className:"img-preview",key:t,src:e,onClick:()=>null==d?void 0:d(t),alt:c,loading:"lazy"}))))),",")};var W="data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M6 12.8125L10 8.8125L6 4.8125' stroke='white' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const V=({initialViewIndex:e,images:o,onClose:n,alt:i})=>{const[r,s]=t.useState(e),[d,c]=t.useState(!1);t.useEffect((()=>{setTimeout((()=>{c(!0)}),0)}),[]);const u=null==o?void 0:o[r],m=0===r,p=!(null==o?void 0:o.length)||r===(null==o?void 0:o.length)-1;return b.default.createElement(a.Portal,null,b.default.createElement(l.StyledImagePreviewContainer,{"data-open":d&&!!u},b.default.createElement(l.StyledImagePreviewTopbar,null,b.default.createElement("img",{src:l.img,className:"icon-close",onClick:n,alt:"close",loading:"lazy"})),u&&r>=0&&b.default.createElement(b.default.Fragment,null,b.default.createElement(l.StyledImagePreviewWrapper,null,b.default.createElement("img",{className:"img-preview",src:u,alt:i,loading:"lazy"}),b.default.createElement(l.StyledArrowWrapper,{"data-disabled":m,onClick:()=>!m&&s(r-1)},b.default.createElement(l.StyledCircleArrow,null,b.default.createElement("img",{src:W,style:{transform:"rotate(180deg)"},alt:"left arrow","data-disabled":m,loading:"lazy"}))),b.default.createElement(l.StyledArrowWrapper,{"data-right":!0,"data-disabled":p,onClick:()=>!p&&s(r+1)},b.default.createElement(l.StyledCircleArrow,null,b.default.createElement("img",{src:W,alt:"right arrow","data-disabled":p,loading:"lazy"})))))))},$=({image:e,showIcon:a=!0})=>{const[o,n]=t.useState(!0);return b.default.createElement(l.StyledWrapper$1,{"data-is-blurred":o,onClick:e=>o&&e.stopPropagation()},b.default.createElement("img",{loading:"lazy",className:"img-preview",src:e}),b.default.createElement(l.StyledInner,{onClick:e=>{e.stopPropagation(),n(!o)}},a&&b.default.createElement(l.StyledIcon,null,o?b.default.createElement("svg",{width:"22",height:"20",viewBox:"0 0 22 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.71 2.5399C1.32 2.1499 1.32 1.5199 1.71 1.1299C2.1 0.739902 2.74 0.739902 3.13 1.1299L19.44 17.4599C19.83 17.8499 19.83 18.4799 19.44 18.8699C19.05 19.2599 18.42 19.2599 18.03 18.8699L15.31 16.1499C13.97 16.6699 12.52 16.9699 11 16.9699C6 16.9699 1.73 13.8599 0 9.4699C0.77 7.4999 2.06 5.7999 3.68 4.5099L1.71 2.5399ZM16 9.4699C16 6.7099 13.76 4.4699 11 4.4699C10.49 4.4699 10 4.5699 9.53 4.7099L7.36 2.5399C8.51 2.1699 9.73 1.9699 11 1.9699C16 1.9699 20.27 5.0799 22 9.4599C21.31 11.2199 20.21 12.7599 18.82 13.9899L15.76 10.9299C15.9 10.4699 16 9.9799 16 9.4699ZM11 14.4699C8.24 14.4699 6 12.2299 6 9.4699C6 8.6999 6.18 7.9699 6.49 7.3299L8.06 8.8999C8.03 9.0799 8 9.2699 8 9.4699C8 11.1299 9.34 12.4699 11 12.4699C11.2 12.4699 11.38 12.4399 11.57 12.3999L13.14 13.9699C12.49 14.2899 11.77 14.4699 11 14.4699ZM13.97 9.1399C13.82 7.7399 12.72 6.6499 11.33 6.4999L13.97 9.1399Z",fill:"white"})):b.default.createElement("svg",{width:"23",height:"16",viewBox:"0 0 23 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b.default.createElement("path",{d:"M11.9999 0C5.14188 0 1.88558 5.87864 1.09558 7.55664C0.963582 7.83664 0.963582 8.16141 1.09558 8.44141C1.88558 10.1204 5.14188 16 11.9999 16C18.8339 16 22.0924 10.1629 22.8964 8.46094C23.0344 8.16794 23.0344 7.83206 22.8964 7.53906C22.0924 5.83706 18.8339 0 11.9999 0ZM11.9999 3C14.7609 3 16.9999 5.239 16.9999 8C16.9999 10.761 14.7609 13 11.9999 13C9.23888 13 6.99988 10.761 6.99988 8C6.99988 5.239 9.23888 3 11.9999 3ZM11.9999 5C11.2042 5 10.4412 5.31607 9.87856 5.87868C9.31595 6.44129 8.99988 7.20435 8.99988 8C8.99988 8.79565 9.31595 9.55871 9.87856 10.1213C10.4412 10.6839 11.2042 11 11.9999 11C12.7955 11 13.5586 10.6839 14.1212 10.1213C14.6838 9.55871 14.9999 8.79565 14.9999 8C14.9999 7.20435 14.6838 6.44129 14.1212 5.87868C13.5586 5.31607 12.7955 5 11.9999 5Z",fill:"#2D87F3"})))))},G=({className:e,images:a=[],style:n,authorName:i,isSensitive:r=!1,alt:d})=>{const{data:{env:{isMarryBaby:c}}}=t.useContext(s.TogetherComponentGlobalContext),{t:m}=o.useTranslations(),p="+ "+((a.length||0)-4),[v,g]=t.useState(!1),[f,h]=t.useState(-1),y=a.length>5,C=t.useRef(!1);return t.useEffect((()=>()=>{C.current&&u.toggleNoScroll(!1)}),[]),t.useEffect((()=>{v||f>=0?(u.toggleNoScroll(!0),C.current=!0):(u.toggleNoScroll(!1),C.current=!1)}),[v,f]),b.default.createElement(b.default.Fragment,null,r&&b.default.createElement(l.StyledNotificationBar,{message:m("sensitiveMask.contentWarningDescription"),icon:b.default.createElement("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.00002 0.666748C4.40002 0.666748 0.666687 4.40008 0.666687 9.00008C0.666687 13.6001 4.40002 17.3334 9.00002 17.3334C13.6 17.3334 17.3334 13.6001 17.3334 9.00008C17.3334 4.40008 13.6 0.666748 9.00002 0.666748ZM9.00002 9.83341C8.54169 9.83341 8.16669 9.45841 8.16669 9.00008V5.66675C8.16669 5.20842 8.54169 4.83342 9.00002 4.83342C9.45835 4.83342 9.83335 5.20842 9.83335 5.66675V9.00008C9.83335 9.45841 9.45835 9.83341 9.00002 9.83341ZM8.16669 11.5001V13.1667H9.83335V11.5001H8.16669Z",fill:"#FE921D"}))}),b.default.createElement(l.StyledPostImagePreview,{className:e,style:n,"data-image-count":y?5:a.length||0,"data-is-marrybaby":c,"data-cursor-pointer":!r},null==a?void 0:a.slice(0,5).map(((e,t)=>{const a=4===t&&y;return b.default.createElement("div",{className:"img-wrapper",key:t,onClick:()=>{t>=4&&y?g(!0):h(t)}},r&&b.default.createElement($,{image:e,showIcon:!a}),!c&&b.default.createElement("img",{loading:"lazy",className:"img-preview-blur",src:e,alt:d}),b.default.createElement("img",{loading:"lazy",className:"img-preview",src:e,alt:d}),a&&b.default.createElement("div",{className:"img-more-overlay"},b.default.createElement(s.Heading,{tag:"h1",as:"h2",color:"white"},p)))}))),v&&b.default.createElement(q,{authorName:i||"",images:a,onClose:()=>g(!1),onOpenSingleView:h,alt:d}),f>=0&&b.default.createElement(V,{images:a,initialViewIndex:f,onClose:()=>h(-1),alt:d}))},Z=({url:o,image:n,className:i,style:r,autoPlay:d=!0})=>{const{data:{locale:c}}=t.useContext(s.TogetherComponentGlobalContext),[u,p]=t.useState(null);t.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){if(!n){if(!o)return p(null);p((e=>Object.assign(Object.assign({},e),{isFetching:!0}))),s.callApi(s.getApiPath(s.PATHS.FETCH_PREVIEW,{_locale:c}),"POST",{data:{link:o},headers:{"Content-Type":"application/json"}}).then((e=>{var t,a;p({url:o,image:(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.image)||(null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.logo)})})).catch((()=>{p(null)}))}}))}),[o,n]);const v=n||(null==u?void 0:u.image),g=(null==u?void 0:u.url)||o,f=t.useMemo((()=>l.youtubeVidIdGetter(g)),[g]),h=t.useMemo((()=>g.includes("facebook.com")||g.includes("fb.watch")),[g]),y=t.useRef(0),C=t.useRef(0),[E,w]=t.useState(!1);t.useEffect((()=>{const e=()=>{var e;const t=null===(e=k.current)||void 0===e?void 0:e.getBoundingClientRect();let a=!1;t&&(!y.current||Math.abs((y.current-t.width)/(null==t?void 0:t.width))>.2)&&(y.current=Math.floor(t.width),a=!0),t&&(!C.current||Math.abs((C.current-t.height)/(null==t?void 0:t.height))>.2)&&(C.current=Math.floor(t.height),a=!0),a&&w((e=>!e))};return e(),window.addEventListener("resize",e,{passive:!0}),()=>{window.removeEventListener("resize",e)}}),[]);const k=t.useRef(null),P=a.useMantineTheme();return b.default.createElement(l.StyledSocialLinkPreview,{className:`${i} no-replace-click`,style:r,ref:k,color:P.colors[P.primaryColor][0]},n||!f&&!h?b.default.createElement("a",{href:g,target:"_blank",rel:"noreferrer"},b.default.createElement("div",{className:"link-image-wrapper "+((null==u?void 0:u.isFetching)?"fetching":"")},(null==u?void 0:u.isFetching)?b.default.createElement(l.Loading,{className:"loading-spinner"}):b.default.createElement(m.ImageWrap,{className:"link-image",src:v||s.DEFAULT_IMG,backupSrc:s.DEFAULT_IMG,alt:g}))):b.default.createElement("div",{className:"link-image-wrapper"},f?b.default.createElement("iframe",{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${f}?&autoplay=${d?1:0}&mute=1&enablejsapi=1`,frameBorder:"0",allowFullScreen:!0,style:{position:"absolute",top:0,left:0,border:"none",overflow:"hidden"},loading:"lazy"}):h?b.default.createElement("iframe",{key:String(E),src:`https://www.facebook.com/plugins/video.php?href=${encodeURIComponent(g)}&autoplay=${d?1:0}&show_text=false&t=0&width=${y.current}&height=${C.current}`,style:{position:"absolute",top:"50%",left:"50%",border:"none",overflow:"hidden",height:C.current,width:y.current,transform:"translate(-50%, -50%)"},scrolling:"no",frameBorder:"0",allowFullScreen:!0,allow:"autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share",loading:"lazy"}):null))};var Q="KsWg8i6",K="_9tS0EUN",X="kyyRKlb",J="-Uqqka-";var Y="data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M5 10C3.9 10 3 10.9 3 12C3 13.1 3.9 14 5 14C6.1 14 7 13.1 7 12C7 10.9 6.1 10 5 10Z' fill='%233E3F58'/%3e %3cpath d='M19 10C17.9 10 17 10.9 17 12C17 13.1 17.9 14 19 14C20.1 14 21 13.1 21 12C21 10.9 20.1 10 19 10Z' fill='%233E3F58'/%3e %3cpath d='M12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10Z' fill='%233E3F58'/%3e %3c/svg%3e",ee="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='%23595959' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 13.3334L8 10.3704L4 13.3334V3.85187C4 3.53754 4.12041 3.23608 4.33474 3.01382C4.54906 2.79155 4.83975 2.66669 5.14286 2.66669H10.8571C11.1602 2.66669 11.4509 2.79155 11.6653 3.01382C11.8796 3.23608 12 3.53754 12 3.85187V13.3334Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",te="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 13.3334L8 10.3704L4 13.3334V3.85187C4 3.53754 4.12041 3.23608 4.33474 3.01382C4.54906 2.79155 4.83975 2.66669 5.14286 2.66669H10.8571C11.1602 2.66669 11.4509 2.79155 11.6653 3.01382C11.8796 3.23608 12 3.53754 12 3.85187V13.3334Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",ae="data:image/svg+xml,%3csvg width='3' height='13' viewBox='0 0 3 13' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='1.58326' cy='6.41663' r='1.25' transform='rotate(89.9997 1.58326 6.41663)' fill='%23595959'/%3e%3cellipse cx='1.58326' cy='1.41663' rx='1.25' ry='1.25' transform='rotate(89.9997 1.58326 1.41663)' fill='%23595959'/%3e%3cellipse cx='1.58326' cy='11.4166' rx='1.25' ry='1.25' transform='rotate(89.9997 1.58326 11.4166)' fill='%23595959'/%3e%3c/svg%3e",le="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 5.33337C13.1046 5.33337 14 4.43794 14 3.33337C14 2.2288 13.1046 1.33337 12 1.33337C10.8954 1.33337 10 2.2288 10 3.33337C10 4.43794 10.8954 5.33337 12 5.33337Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M4 10C5.10457 10 6 9.10457 6 8C6 6.89543 5.10457 6 4 6C2.89543 6 2 6.89543 2 8C2 9.10457 2.89543 10 4 10Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M12 14.6666C13.1046 14.6666 14 13.7712 14 12.6666C14 11.5621 13.1046 10.6666 12 10.6666C10.8954 10.6666 10 11.5621 10 12.6666C10 13.7712 10.8954 14.6666 12 14.6666Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M5.72668 9.00665L10.28 11.66' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M10.2734 4.33997L5.72668 6.9933' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",oe="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M2 4H3.33333H14' stroke='%23737373' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M5.33334 3.99992V2.66659C5.33334 2.31296 5.47382 1.97382 5.72387 1.72378C5.97392 1.47373 6.31305 1.33325 6.66668 1.33325H9.33334C9.68697 1.33325 10.0261 1.47373 10.2762 1.72378C10.5262 1.97382 10.6667 2.31296 10.6667 2.66659V3.99992M12.6667 3.99992V13.3333C12.6667 13.6869 12.5262 14.026 12.2762 14.2761C12.0261 14.5261 11.687 14.6666 11.3333 14.6666H4.66668C4.31305 14.6666 3.97392 14.5261 3.72387 14.2761C3.47382 14.026 3.33334 13.6869 3.33334 13.3333V3.99992H12.6667Z' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M6.66666 7.33325V11.3333' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M9.33334 7.33325V11.3333' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const ne=({authorEmail:a,onDeletePost:n,shareUrl:i,post:r,className:d="",popoverClassName:u="",onBookmark:m,onRemoveBookmark:p,onEditPost:v})=>{const{data:{locale:g,userInfo:f,togetherUserId:h,env:{isMarryBaby:y}},action:{pushNotifications:C}}=t.useContext(s.TogetherComponentGlobalContext),{t:E}=o.useTranslations(),[w,k]=t.useState(!1),[P,T]=t.useState(!1),[S,x]=t.useState(!1),{authActionWrapper:N}=l.useTogetherAuthRequiredAction(),A=a&&(null==f?void 0:f.email)&&a===String(null==f?void 0:f.email);return b.default.createElement("div",{className:d,onClick:e=>{e.preventDefault(),e.stopPropagation()}},S&&b.default.createElement(l.SharePopup,{url:i,text:null==r?void 0:r.title,onClose:()=>x(!1)}),P&&b.default.createElement(D,{thumbnail:c.CommonGAssets.getAssetPath("trash-bin.svg"),isThumbnailIcon:!0,title:E("popup.deletePost.title"),description:E("popup.deletePost.description"),acceptText:E("popup.deletePost.accept"),cancelText:E("popup.deletePost.cancel"),onAccept:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if((null==r?void 0:r.id)&&!w){k(!0);try{const t=yield(({id:t,locale:a})=>e.__awaiter(void 0,void 0,void 0,(function*(){if(t)return yield s.callApiWithAuth(s.getApiPath(s.PATHS.POST.DELETE,{id:t,_locale:a}),"DELETE")})))({id:r.id,locale:g});1===(null==t?void 0:t.status)&&(null==n||n())}catch(e){}k(!1)}})),onClose:()=>T(!1)}),b.default.createElement(l.TreePopoverMenu,{className:u,toggleButtonContent:b.default.createElement("img",{src:y?Y:ae,loading:"lazy"}),position:"bottom",align:"end",buttonProps:{isLoading:w},data:A?{isShowheader:!1,type:"list",list:[{icon:le,label:E("morePopover.share"),onClick:()=>x(!0)},{icon:"data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M7.16952 3.2356H2.99484C2.6785 3.2356 2.37512 3.36126 2.15143 3.58495C1.92774 3.80863 1.80208 4.11202 1.80208 4.42836V12.7777C1.80208 13.094 1.92774 13.3974 2.15143 13.6211C2.37512 13.8448 2.6785 13.9705 2.99484 13.9705H11.3442C11.6605 13.9705 11.9639 13.8448 12.1876 13.6211C12.4113 13.3974 12.537 13.094 12.537 12.7777V8.60303' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M11.6425 2.341C11.8798 2.10375 12.2016 1.97046 12.5371 1.97046C12.8726 1.97046 13.1944 2.10375 13.4317 2.341C13.6689 2.57826 13.8022 2.90005 13.8022 3.23558C13.8022 3.57111 13.6689 3.89289 13.4317 4.13015L7.76607 9.79578L5.38054 10.3922L5.97692 8.00663L11.6425 2.341Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",label:E("actionPopover.edit"),onClick:v},{icon:oe,label:E("actionPopover.delete"),onClick:()=>{N((()=>T(!0)))}}]}:{isShowheader:!1,type:"list",list:[{icon:le,label:E("morePopover.share"),onClick:()=>x(!0)},{icon:(null==r?void 0:r.bookmarked)?ee:te,label:(null==r?void 0:r.bookmarked)?E("morePopover.unsavePost"):E("morePopover.savePost"),onClick:()=>{N((()=>e.__awaiter(void 0,void 0,void 0,(function*(){if((null==f?void 0:f.id)&&(null==r?void 0:r.id))if(null==r?void 0:r.bookmarked){const e=yield s.callApiWithAuth(s.getApiPath(s.PATHS.BOOKMARK.DELETE,{_locale:g}),"DELETE",{data:{post_id:String(r.id)}});1===(null==e?void 0:e.status)?(C({title:"",message:"Removed saved post",type:"success",displayIcon:te}),p&&p()):C({title:"",message:"Remove failed",type:"danger",displayIcon:te})}else{const e=yield s.callApiWithAuth(s.getApiPath(s.PATHS.BOOKMARK.CREATE,{_locale:g}),"POST",{data:{user_id:h||f.id,post_id:r.id}});1===(null==e?void 0:e.status)?(C({title:"",message:"Post saved",type:"success",displayIcon:ee}),m&&m()):C({title:"",message:"Post saved failed",type:"danger",displayIcon:te})}}))))}},{icon:U,label:E("morePopover.report"),subTree:{title:E("morePopover.report.title"),description:E("morePopover.report.description"),isShowheader:!0,type:"list",list:Object.keys(s.REPORT_REASON_MAP).map((e=>({label:s.REPORT_REASON_MAP[e].label,reason:s.REPORT_REASON_MAP[e].reportReasonText,reasonValue:e}))).map((e=>({label:E(e.label),subTree:{title:E("morePopover.reportSubmit.title"),description:E("morePopover.reportSubmit.description"),isShowheader:!0,type:"jsx",jsxRenderer:t=>b.default.createElement(H,{reason:e.reasonValue,reasonText:E(e.reason),postId:null==r?void 0:r.id,onClose:()=>t&&t(!1)})}})))}}]}}))};const ie=({onDeleteComment:a,commentId:n,className:i="",popoverClassName:r=""})=>{const{data:{env:{isMarryBaby:d},locale:c},action:{pushNotifications:u}}=t.useContext(s.TogetherComponentGlobalContext),{t:m}=o.useTranslations(),[p,v]=t.useState(!1),{authActionWrapper:g}=l.useTogetherAuthRequiredAction();return b.default.createElement("div",{className:i,onClick:e=>{e.preventDefault(),e.stopPropagation()}},p&&b.default.createElement(D,{thumbnail:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17' fill='none'%3e%3cg stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' clip-path='url(%23clip0)'%3e%3cpath d='M2 4.008h12M5.333 4.008V2.675a1.333 1.333 0 0 1 1.334-1.333h2.666a1.333 1.333 0 0 1 1.334 1.333v1.333m2 0v9.334a1.333 1.333 0 0 1-1.334 1.333H4.667a1.333 1.333 0 0 1-1.334-1.333V4.008h9.334ZM6.667 7.342v4M9.333 7.342v4'/%3e%3c/g%3e%3cdefs%3e%3cclipPath id='clip0'%3e%3cpath fill='white' d='M0 .008h16v16H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",isThumbnailIcon:!0,title:m("popup.deleteComment.title"),description:m("popup.deleteComment.description"),acceptText:m("popup.deletePost.accept"),cancelText:m("popup.deletePost.cancel"),onAccept:()=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;if(!n)return;const t=yield(({id:e,locale:t})=>s.callApiWithAuth(s.getApiPath(s.PATHS.COMMENT.DELETE,{_locale:t,id:e}),"DELETE"))({id:n,locale:c});1===(null==t?void 0:t.status)?(a&&a(),u({title:"",message:m("notification.success"),type:"success"})):u({title:"",message:(null===(e=null==t?void 0:t.messages)||void 0===e?void 0:e[0])||m("notification.failure"),type:"danger"})})),onClose:()=>v(!1)}),b.default.createElement(l.TreePopoverMenu,{position:"bottom",align:"end",data:{isShowheader:!1,type:"list",list:[{icon:oe,label:m("actionPopover.delete"),onClick:()=>{g((()=>{v(!0)}))}}]},className:r,toggleButtonContent:b.default.createElement("img",{src:d?Y:ae,loading:"lazy"}),buttonProps:{}}))};var re="-dzIuHr";const se=({userId:e,avatar:a,name:n,role:s,title:d,className:c})=>{const{t:u}=o.useTranslations(),[m,p]=t.useState(!1);return b.default.createElement(b.default.Fragment,null,b.default.createElement(C.Button,{className:`${re} ${c}`,color:"success",size:"xs",onClick:()=>p(!0),style:{padding:"5px 8px",marginBottom:"12px",borderRadius:"4px"}},b.default.createElement("span",{className:"text"},b.default.createElement(r.Icon.Endorse,{isSolid:!0,size:18,color:i.theme.colors.green800,className:"icon"}),u("cardReply.verifyBy",{name:`${n||""}`}))),b.default.createElement(l.ProfileDetailModal,{open:m,onClose:()=>p(!1),profileModalProps:{zIndex:1e3}},b.default.createElement(l.ProfileDetail,{authorProps:{userId:e,avatar:a,name:n,role:s,title:d},hideQuestionTab:!0})))};const de=({className:a,style:n,comment:i,type:r="comment",level:c=0,replyingId:u,onPostCommentSuccess:m,post:v,onDeleteComment:g,refetchComment:f,hasQuickBookingEnable:h,handleMakeAppointment:y,cardAuthorProps:E,maxChars:w=600,disableShortenContent:k})=>{var P,T,S,x,A,I,_,M,L,j,R,B,O;const{data:{locale:z,userInfo:D,env:{isMarryBaby:U}}}=t.useContext(s.TogetherComponentGlobalContext),{t:H}=o.useTranslations(),[q,W]=t.useState(i||null),{id:V,countLikes:$,content:Z,replies:Q=[],images:K=[],author:X,liked:J,link:Y,mentionedUser:ee,mentions:te}=q,{text:ae,replyingTo:le}=(e=>{try{const t=e.match(/\[@([^\]]+)\]/),a=t?t[0].replace("[@","").replace("]",""):"";return{text:e.replace(/\[@([^\]]+)\]/,"").trim(),replyingTo:a}}catch(e){}return{text:""}})(Z),{authActionWrapper:oe}=l.useTogetherAuthRequiredAction({_joinCommunityIds:[null===(P=null==v?void 0:v.community)||void 0===P?void 0:P.id],_joinTopicIds:null===(T=null==v?void 0:v.topics)||void 0===T?void 0:T.map((e=>e.id))}),[ne,re]=t.useState(4),ce=!!(null==D?void 0:D.id)&&(null==Q?void 0:Q.some((e=>e.author.id===D.id))),ue=e=>{W((t=>{if(!t.replies.find((t=>t.id===e.id))){t.replies.unshift(e);const a=Object.assign(Object.assign({},t),{replies:t.replies.slice(),countReplies:t.countReplies+1});return f&&f(a),a}return t}))},[me,pe]=t.useState(!1),ve=t.useMemo((()=>"comment"===r&&Q&&0!=Q.length?Q.sort(((e,t)=>{const a=new Date(e.createdAt).getTime(),l=new Date(t.createdAt).getTime();return a>l?-1:a<l?1:0})):Q),[r,Q]),ge=(null==Q?void 0:Q.length)||0,fe=String(null==X?void 0:X.email)&&(null==D?void 0:D.email)&&String(null==X?void 0:X.email)===String(null==D?void 0:D.email),he=(null==X?void 0:X.name)||(null==X?void 0:X.username)||"",ye=(null==X?void 0:X.username)||(null==X?void 0:X.name)||"",Ce=null==X?void 0:X.avatar,Ee=(null==v?void 0:v.isAnonymous)||null==X?void 0:X.role,we=[...(null==v?void 0:v.isAnonymous)?[{id:(null===(S=null==v?void 0:v.author)||void 0===S?void 0:S.id)||0,name:H("cardPost.anonymous")}]:[],...te||[]],[ke,be]=t.useState(null),[Pe,Te]=t.useState(null);t.useEffect((()=>{if(null==X?void 0:X.hospitalId){const t=t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield s.callApi(s.getCarePath(s.CARE_PATHS.GET_HOSPITAL_INFO,{hospital_branch_id:t,website_url:d.domainLocales[z]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.branch)&&be(null==a?void 0:a._data.branch)}));t(X.hospitalId)}if(null==X?void 0:X.doctorId){const t=t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield s.callApi(s.getCarePath(s.CARE_PATHS.GET_DOCTOR_INFO,{doctorId:t,website_url:d.domainLocales[z]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&Te(null==a?void 0:a._data.doctor)}));t(X.doctorId)}}),[X.hospitalId,X.doctorId]);const Se=(null==Pe?void 0:Pe.valid_outpatient)||(null==Pe?void 0:Pe.valid_telemedicine),xe=((null==ke?void 0:ke.total_available_service)||(null==ke?void 0:ke.total_available_doctor))>0,Ne=h&&(Se||xe),Ae="chatbot"===(null===(x=null==q?void 0:q.author)||void 0===x?void 0:x.type);return b.default.createElement(l.TogetherAuthConfigContextProvider,{defaultParams:{_joinCommunityIds:[null===(A=null==v?void 0:v.community)||void 0===A?void 0:A.id],_joinTopicIds:null===(I=null==v?void 0:v.topics)||void 0===I?void 0:I.map((e=>e.id))}},b.default.createElement(l.StyledCardPost,{className:a,style:n,"data-is-reply":!!c,"data-is-marrybaby":U,"data-has-booking":Ne},"reply"===r&&b.default.createElement(p.Divider,{className:"top-divider",type:"solid"}),b.default.createElement("div",{style:{padding:"16px 16px 0"}},b.default.createElement(l.CardAuthor,Object.assign({avatar:Ce,name:he,username:ye,timeText:null==v?void 0:v.createdTime,community:null==v?void 0:v.community,className:"post-author "+(fe?"with-popover":""),type:r,userId:null==X?void 0:X.id,role:Ee,expertId:null==X?void 0:X.partnerId,title:null==X?void 0:X.title,doctorId:null==X?void 0:X.doctorId,hospitalId:null==X?void 0:X.hospitalId,hasQuickBooking:Ne,handleMakeAppointment:y,isAnonymous:(null==q?void 0:q.isAnonymous)||Boolean(null==v?void 0:v.isAnonymous)&&(null===(_=null==v?void 0:v.author)||void 0===_?void 0:_.username)===(null==X?void 0:X.username),hideBackground:Ae,userType:null==X?void 0:X.type},E)),Boolean(null==q?void 0:q.isVerify)&&!Boolean(null==q?void 0:q.isOppose)&&b.default.createElement(se,{title:null===(M=null==q?void 0:q.userVerify)||void 0===M?void 0:M.title,name:null===(L=null==q?void 0:q.userVerify)||void 0===L?void 0:L.name,userId:null===(j=null==q?void 0:q.userVerify)||void 0===j?void 0:j.id,role:null===(R=null==q?void 0:q.userVerify)||void 0===R?void 0:R.role,avatar:null===(B=null==q?void 0:q.userVerify)||void 0===B?void 0:B.avatar,className:"verify-tag"})),b.default.createElement(l.PostContent,{className:"post-content-wrapper",replyingTo:le,mentionedUser:ee,description:ae,mentions:we,maxChars:w,disableShortenContent:k}),b.default.createElement("span",null),b.default.createElement("span",null),K&&K.length>0?b.default.createElement("div",{key:"image-preview",className:"image-preview-wrapper","data-is-reply":!0},b.default.createElement(G,{images:K,authorName:null==X?void 0:X.username})):null,K&&0!==K.length||!Y?null:b.default.createElement("div",{key:"link-preview",className:"link-preview-wrapper","data-is-reply":!0},b.default.createElement(N,{url:Y})),"most-engaging"!==r?b.default.createElement(b.default.Fragment,null,Ae&&b.default.createElement(l.StyledSourceList,{listUrl:null==q?void 0:q.source,categorySlug:null==q?void 0:q.categorySlug}),b.default.createElement(l.CardReactions,{type:l.CardReactionType.reply,loveCount:$,replyCount:ge,className:"post-reaction",liked:J,isReplied:ce,hideCommentIcon:"reply"===r||Ae,hasShare:!1,onCommentClick:()=>oe((()=>pe((e=>!e)))),onCommentCountClick:()=>oe((()=>{pe(!0)})),onLikeClick:()=>oe((()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(V){const t=yield(({commentId:t,setLike:a=!1,locale:l})=>e.__awaiter(void 0,void 0,void 0,(function*(){return s.callApiWithAuth(s.getApiPath(a?s.PATHS.COMMENT.LIKE:s.PATHS.COMMENT.UNLIKE,{_locale:l,id:t}),"GET")})))({commentId:V,setLike:!J,locale:z});1===t.status&&W((e=>Object.assign(Object.assign({},e),{liked:!J,countLikes:e.countLikes+(J?-1:1)})))}}))))}),me&&b.default.createElement(F,{replyingId:u||q.id,replyToName:he,isReply:!0,onClose:()=>pe(!1),onPostSuccess:e=>{"reply"===r?m&&m(e):ue(e)},post:v,replyingUser:X}),"comment"===r&&Q&&Q.length>0?b.default.createElement("div",{className:"comment-reply-wrapper"},null===(O=null==ve?void 0:ve.slice(0,ne))||void 0===O?void 0:O.map((e=>b.default.createElement(de,{key:e.id,comment:e,type:"reply",className:"comment-reply-item",level:c+1,replyingId:V,onPostCommentSuccess:ue,post:v,onDeleteComment:()=>{W((t=>Object.assign(Object.assign({},t),{replies:t.replies.filter((t=>t.id!==e.id)),countReplies:t.countReplies-1})))},handleMakeAppointment:y,hasQuickBookingEnable:h}))),ge>ne&&b.default.createElement(b.default.Fragment,null,b.default.createElement(p.Divider,{className:"top-divider",type:"solid"}),b.default.createElement(C.Button,{className:"more-cmt",size:"lg",color:"ghost",onClick:()=>re((e=>e+4))},H("comment.seeMoreReplies",{count:ge-ne}),b.default.createElement("img",{className:"chevron-right",src:"data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M6 12L10 8L6 4' stroke='%232D87F3' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",loading:"lazy"})))):null):null,fe&&b.default.createElement(ie,{onDeleteComment:g,className:"popover",commentId:q.id})))},ce=(t,a)=>e.__awaiter(void 0,void 0,void 0,(function*(){var e,l,o;const n=yield s.callApiWithOptionalAuth(s.getApiPath(s.PATHS.COMMENT.LIST,{postId:t,_locale:a,sort:"popularity",perPage:1,withoutReply:1}),"GET");return null===(o=null===(l=null===(e=null==n?void 0:n.data)||void 0===e?void 0:e.comments)||void 0===l?void 0:l.map(v.formatComment))||void 0===o?void 0:o[0]}));var ue=Object.freeze({__proto__:null});exports.CardLink=N,exports.CardPost=({className:a,style:n,hideViewMoreComment:i,showMostEngaging:r,onCommentClick:d,onCommentCountClick:c,onMostEngagingCommentClick:u,onPostCommentSuccess:m,disableCardLink:p,disableShortenContent:v,onDeletePost:g,onEditPost:f,post:h,mostEngagingComment:y,onDeleteComment:E,showInputComment:w,InlineCommentsComponent:k,hasQuickBookingEnable:T,handleMakeAppointment:S,cardAuthorProps:x})=>{const[_,M]=t.useState(h),[L,j]=t.useState(!1),[R,B]=t.useState(y),{community:O,topics:z,author:D,slug:U,isPin:H,liked:q,photos:W,mentions:V,title:$,description:Q,previewUrl:K,likesCount:X,commentsCount:J,id:Y,commented:ee}=_,{data:{locale:te,env:{isMarryBaby:ae,togetherBasePath:le}},action:{pushNotifications:oe}}=t.useContext(s.TogetherComponentGlobalContext),{t:ie}=o.useTranslations(),[re,se]=t.useState(w),ue=`${le}/${(null==O?void 0:O.slug)||"_"}/${U||""}`,me=`${s.getCurrentBaseUrl(te)}${ue}`,{authActionWrapper:pe}=l.useTogetherAuthRequiredAction((null==O?void 0:O.slug)?{_joinCommunityIds:[O.id],_joinTopicIds:null==z?void 0:z.map((e=>e.id))}:void 0),[ve,ge]=t.useState(!1);t.useEffect((()=>{se(w)}),[w]);const fe=(null==D?void 0:D.name)||(null==D?void 0:D.username)||"",he=(null==D?void 0:D.username)||(null==D?void 0:D.name)||"",ye=null==D?void 0:D.avatar,Ce=(null==_?void 0:_.isAnonymous)||null==D?void 0:D.role,[Ee,we]=t.useState(null),[ke,be]=t.useState(null);t.useEffect((()=>{if(null==D?void 0:D.hospitalId){(t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield s.callApi(s.getCarePath(s.CARE_PATHS.GET_HOSPITAL_INFO,{hospital_branch_id:t,website_url:s.domainLocales[te]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.branch)&&we(null==a?void 0:a._data.branch)})))(D.hospitalId)}if(null==D?void 0:D.doctorId){(t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield s.callApi(s.getCarePath(s.CARE_PATHS.GET_DOCTOR_INFO,{doctorId:t,website_url:s.domainLocales[te]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&be(null==a?void 0:a._data.doctor)})))(D.doctorId)}}),[D.hospitalId,D.doctorId]);const Pe=(null==ke?void 0:ke.valid_outpatient)||(null==ke?void 0:ke.valid_telemedicine),Te=((null==Ee?void 0:Ee.total_available_service)||(null==Ee?void 0:Ee.total_available_doctor))>0,Se=T&&(Pe||Te);t.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){if(Y&&J&&r&&!(null==y?void 0:y.id)){const e=yield ce(Y,te);B(e)}}))}),[Y,te,J,r,null==y?void 0:y.id]),t.useEffect((()=>{B(y)}),[null==y?void 0:y.id]);const xe=t=>e.__awaiter(void 0,void 0,void 0,(function*(){if(J>1&&(null==R?void 0:R.id)&&(null==R?void 0:R.id)===(null==t?void 0:t.id)){const e=yield ce(Y,te);B(e)}M((e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount-1}))),E&&E(t)}));return b.default.createElement(l.TogetherAuthConfigContextProvider,{defaultParams:(null==O?void 0:O.slug)?{_joinCommunityIds:[O.id],_joinTopicIds:null==z?void 0:z.map((e=>e.id))}:void 0},L&&b.default.createElement(l.SharePopup,{url:me,avatar:s.DEFAULT_IMG,text:$,onClose:()=>j(!1)}),b.default.createElement(l.StyledCardPost$1,{className:a,style:n,"data-is-marrybaby":ae},H?b.default.createElement(A,{className:"post-pin"}):null,b.default.createElement("div",{style:{position:"relative",padding:"1rem 1rem 0"}},b.default.createElement(l.CardAuthor,Object.assign({avatar:ye,name:fe,username:he,url:p?void 0:ue,community:O,timeText:null==_?void 0:_.createdTime,className:"post-author",role:Ce,userId:null==D?void 0:D.id,expertId:null==D?void 0:D.partnerId,doctorId:null==D?void 0:D.doctorId,hospitalId:null==D?void 0:D.hospitalId,title:null==D?void 0:D.title,hasQuickBooking:Se,handleMakeAppointment:S,"data-testid":"name",isAnonymous:!!(null==_?void 0:_.isAnonymous),extendEle:b.default.createElement(ne,{authorEmail:String(null==D?void 0:D.email),onDeletePost:g,shareUrl:me,post:_,className:"popover",onEditPost:f})},x))),b.default.createElement("a",{href:p?void 0:ue,className:"post-content-link-wrapper"},$&&b.default.createElement(s.Heading,{className:"post-content-title",as:"h2",tag:"h5",fontWeight:"bold","data-testid":"Title of the Post"},P.default($)),b.default.createElement(l.PostContent,{className:"post-content-wrapper",description:Q,disableShortenContent:v,mentions:V,"data-testid":"Content of the Post"})),b.default.createElement("span",null),b.default.createElement("span",null),b.default.createElement("div",{key:"tag-topic"},z&&z.length>0?b.default.createElement(l.TagTopic,{topics:z,className:"post-topics"}):null),b.default.createElement("div",{key:"social-preview"},(null==_?void 0:_.introUrl)?b.default.createElement("div",{className:"social-preview-wrapper "+((null==W?void 0:W.length)?"has-image":"")},b.default.createElement(Z,{url:_.introUrl,image:_.bannerImage})):null),b.default.createElement("div",{key:"image-preview"},(null==W?void 0:W.length)?b.default.createElement("div",{className:"image-preview-wrapper"},b.default.createElement(G,{images:W,authorName:null==D?void 0:D.name})):null),b.default.createElement("div",{key:"link-preview"},(null==_?void 0:_.introUrl)||(null==W?void 0:W.length)||!(null==K?void 0:K.url)?null:b.default.createElement("div",{className:"link-preview-wrapper"},b.default.createElement(N,{title:K.title,url:K.url,image:K.image}))),b.default.createElement(l.CardReactions,{isMarryBaby:ae,type:l.CardReactionType.post,loveCount:X,replyCount:J,className:"post-reaction "+((null==W?void 0:W.length)||(null==K?void 0:K.url)?"hide-top-border":""),liked:ve?!q:q,isReplied:ee,onCommentClick:()=>pe((()=>{d?d():se((e=>!e))})),onCommentCountClick:()=>{pe((()=>{ae?se(!0):c?c():!p&&(window.location.href=ue)}))},onShareClick:()=>{j(!0)},onLikeClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(Y&&!ve){ge(!0);try{const t=yield(({id:t,locale:a})=>e.__awaiter(void 0,void 0,void 0,(function*(){if(t)return yield s.callApiWithAuth(s.getApiPath(s.PATHS.POST.LIKE,{id:t,_locale:a}),"GET")})))({id:Y,locale:te});1!==(null==t?void 0:t.status)?oe(I(ie)):M((e=>Object.assign(Object.assign({},e),{likesCount:(e.likesCount||0)+(e.liked?-1:1),liked:!e.liked})))}catch(e){oe(I(ie))}ge(!1)}})),showingMostEngaging:!(!r||!(null==R?void 0:R.id))}),re&&b.default.createElement(F,{isMainCmt:!w,onClose:()=>se(!1),onPostSuccess:e=>{0!==J||(null==R?void 0:R.id)||B(e),M((e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount+1,commented:!0}))),m&&m(e)},post:_}),r&&(null==R?void 0:R.id)?b.default.createElement("div",{className:"most-engaging-wrapper",onClick:e=>{u?(e.stopPropagation(),u()):window.location.href=ue}},b.default.createElement(de,{hasQuickBookingEnable:T,handleMakeAppointment:S,comment:R,post:_,onDeleteComment:()=>{xe&&xe(R)},className:"most-engaging-comment",type:"most-engaging",key:R.id,cardAuthorProps:x}),J>1&&!i&&b.default.createElement(C.Button,{className:"see-more-comments",color:"ghost",size:"md"},ie("comment.seeMoreComments",{count:J-1}))):null,k))},exports.CardPostPopoverMore=ne,exports.CardReply=de,exports.CardReplyPopover=ie,exports.CreateNewPostContent=({className:n,style:d,onPostCreatedEdited:m,onClose:g,communities:f=[],forceSelectCommunity:h,forceSelectTopics:y,articleId:C,optionalTopic:E,editPostData:w,defaultCommunity:k,defaultTopics:T,noFetchTopic:S,hideTopicList:x,selectAskDoctor:N,showAskDoctorOptions:A,currentPageUrl:M})=>{const L=!!(null==w?void 0:w.id),{data:{locale:R,env:{isMarryBaby:z}},action:{pushNotifications:D,sanitizeFunction:F}}=t.useContext(s.TogetherComponentGlobalContext),{t:U}=o.useTranslations(),[H,q]=t.useState(!1),[W,V]=t.useState(N),[$,G]=t.useState(!1),[Z,Q]=t.useState(!1),[K,X]=t.useState(!1),[J,Y]=t.useState(""),[ee,te]=t.useState(""),[ae,le]=t.useState(h?{label:h.name,value:`${h.id||""}-${h.mappedCategoryId||""}`}:{label:U("community.choose"),value:""}),[oe,ne]=t.useState([...y]||[]),[ie,re]=t.useState([]),[se,de]=t.useState([]),ce=h||f.find((e=>`${e.id||""}-${e.mappedCategoryId||""}`===ae.value)),ue=h?[h]:f.filter((e=>e.isActive)).sort(((e,t)=>e.name>t.name?1:e.name<t.name?-1:0)),[me,pe]=t.useState(null),[ve,ge]=t.useState([]),fe=J&&!Z&&P.default(ee)&&(E||!E&&oe.length>0)&&ce&&(!ie||ie.length<=s.MAX_IMAGE_UPLOADS)&&!(null==ve?void 0:ve.length)&&!K;t.useEffect((()=>{if(w){const e=w;Y(e.title||""),te(l.decodeMention(l.decodePostUrl(e.description||"","edit"),e.mentions)),le({label:e.community.name,value:`${e.community.id||""}-${e.community.mappedCategoryId||""}`}),ne(e.topics||[]),re(e.photos||[]),q(!!e.isAnonymous||!1),V(!!e.isAskDoctor||!1)}else k&&le({label:k.name,value:`${k.id||""}-${k.mappedCategoryId||""}`}),T&&ne(T)}),[]),t.useEffect((()=>{Q(""!==J&&!/[a-zA-Z]/.test(J))}),[J]);const he=()=>e.__awaiter(void 0,void 0,void 0,(function*(){var t,a,o,n,i,r,d,c,p;if(A&&void 0===W)return G(!0),!1;const f=yield(({title:t,description:a,communityId:o,imageFiles:n,previewUrl:i,topicIds:r,locale:d,sanitizeFunction:c,categoryCommunityId:m,categoryTopicIds:p,introUrl:v,bannerUrl:g,scheduleTime:f,isAnonymous:h,isAskDoctor:y})=>e.__awaiter(void 0,void 0,void 0,(function*(){const e=new FormData,C=l.removeBannedWordWrapper(a),E=l.removeBannedWordWrapper(t),w=l.getMentionIdsFromString(C);if(e.append("title",E),e.append("description",l.encodePostContent(C,c)),m?e.append("category_community",String(m)):o&&e.append("community_id",String(o)),e.append("is_anonymous",h?"1":"0"),e.append("is_question",y?"1":"0"),(null==i?void 0:i.title)&&e.append("preview_title",i.title),(null==i?void 0:i.description)&&e.append("preview_description",i.description),(null==i?void 0:i.url)&&e.append("preview_link",u.safeEncodeURI(i.url)),(null==i?void 0:i.image)&&e.append("preview_image",u.safeEncodeURI(i.image)),null==r||r.forEach((t=>{e.append("topics[]",String(t||""))})),null==p||p.forEach((t=>{e.append("category_topics[]",String(t||""))})),null==n?void 0:n.length){const t=yield Promise.all(n.map(((e,t)=>new Promise((a=>{setTimeout((()=>{a(l.uploadAndGetSrc(e,d))}),2e3*t)})))));null==t||t.filter(Boolean).slice(0,s.MAX_IMAGE_UPLOADS).forEach(((t,a)=>{e.append(`images[${a}]`,t)}))}else e.append("images","");return null==w||w.forEach((t=>{e.append("mention_ids[]",t)})),e.append("intro_url",v||""),e.append("banner",g||""),f&&(e.append("post_type","scheduled"),e.append("schedule_datetime",f)),e})))({title:J,description:ee,communityId:String((null==ce?void 0:ce.id)||""),imageFiles:ie,previewUrl:me,topicIds:null==oe?void 0:oe.map((e=>String(e.id||""))).filter(Boolean),locale:R,sanitizeFunction:F,categoryCommunityId:String((null==ce?void 0:ce.mappedCategoryId)||""),categoryTopicIds:null==oe?void 0:oe.map((e=>String(e.mappedCategoryId||""))).filter(Boolean),isAnonymous:H?1:0,isAskDoctor:W?1:0});let h;C&&f.append("article_id",C),L?(null==w?void 0:w.id)&&(h=yield(({id:t,locale:a,formData:l})=>e.__awaiter(void 0,void 0,void 0,(function*(){return yield s.callApiWithAuth(s.getApiPath(s.PATHS.POST.UPDATE,{id:t,_locale:a}),"POST",{data:l})})))({id:w.id,formData:f,locale:R})):h=yield(({locale:t,formData:a,isArticleComment:l})=>e.__awaiter(void 0,void 0,void 0,(function*(){return yield s.callApiWithAuth(s.getApiPath(l?s.PATHS.POST.CREATE_ARTICLE_COMMENT:s.PATHS.POST.CREATE,{_locale:t}),"POST",{data:a})})))({formData:f,locale:R,isArticleComment:!(null==ce?void 0:ce.id)&&!!(null==ce?void 0:ce.mappedCategoryId)});const y=null==h?void 0:h.data;(null==y?void 0:y.id)&&!(null===(a=null===(t=null==h?void 0:h.messages)||void 0===t?void 0:t.moderation)||void 0===a?void 0:a.type)?(D({message:U("createPost.popup.success"),type:"success"}),(e=>{m&&m(v.formatPost(e),L),g&&g()})(y)):"banned"===(null===(n=null===(o=null==h?void 0:h.messages)||void 0===o?void 0:o.moderation)||void 0===n?void 0:n.type)?(D({title:U("notification.post.blocked.title"),message:U("notification.post.blocked.message"),type:"danger"}),h.messages.moderation.words&&de(h.messages.moderation.words)):"suspect"===(null===(r=null===(i=null==h?void 0:h.messages)||void 0===i?void 0:i.moderation)||void 0===r?void 0:r.type)?(D({title:U("notification.post.suspect.title"),message:U("notification.post.suspect.message"),type:"warning"}),g&&g()):(null===(c=null===(d=null==h?void 0:h.messages)||void 0===d?void 0:d.find)||void 0===c?void 0:c.call(d,(e=>{var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(D({message:U("notification.suspend.message"),type:"danger"}),g&&g()):D({message:(null===(p=null==h?void 0:h.messages)||void 0===p?void 0:p[0])||U("notification.failure"),type:"danger"})}));return b.default.createElement(l.StyledCreateNewPost,{className:n,style:d},b.default.createElement("div",{className:"input-group-container"},b.default.createElement(B,{className:"input-group",bannedWords:se,value:J,onChange:Y}),Z&&b.default.createElement(l.StyledError,null,b.default.createElement(r.Info,{isSolid:!0,color:i.theme.colors.red700,size:14}),b.default.createElement(s.Text,{size:"p3",as:"span",color:i.theme.colors.red700},U("createPost.popup.specialCharErr"))),b.default.createElement(j,{className:"input-group",bannedWords:se,value:ee,onChange:te,onPreviewUrlChange:pe,onInvalidUrlsChange:ge,onImageFilesChange:re,imageFiles:ie}),A&&b.default.createElement(l.StyledIsQuestion,{"data-is-marry-baby":z},b.default.createElement("div",{className:"switch-label"},b.default.createElement(r.Ask,{isMarryBaby:z,size:z?32:24,color:i.theme.colors.primaryBase,className:"label-icon"}),b.default.createElement("span",{className:"label-txt"},U("createPost.askDoctor"))),b.default.createElement(p.BtnChoice,{value:W,choices:[{label:U("createPost.askDoctorChoice.yes"),value:!0,dataEventCategory:"Together",dataEventAction:"Write Post Click - Ask Doctor",dataEventLabel:M},{label:U("createPost.askDoctorChoice.no"),value:!1}],onChange:e=>{"boolean"==typeof e&&(G(!1),V(e))}})),$&&b.default.createElement(l.StyledError,null,b.default.createElement(r.Info,{isSolid:!0,color:i.theme.colors.red700,size:14}),b.default.createElement(s.Text,{size:"p3",as:"span",color:i.theme.colors.red700},U("createPost.message.askDoctorRequire"))),b.default.createElement("div",{className:"input-group"},b.default.createElement(s.Text,{size:"p4",className:"input-group-label"},U("admin.community")),b.default.createElement(l.Dropdown,{options:(null==ue?void 0:ue.map((e=>({label:e.name,value:`${e.id||""}-${e.mappedCategoryId||""}`}))))||[],id:"community-picker",placeholder:U("community.choose"),value:ae,dropdownLabelTrackingAttributes:{"data-event-category":"Together","data-event-action":"Write Post Click - Choose Community/Topic","data-event-label":M},onChange:e=>{le({label:e.label,value:String(e.value)}),ne([])},disabled:!!h}),b.default.createElement(s.Text,{size:"sm",className:"warning",color:i.theme.colors.gray400},"* ",U("commentPopup.warning.newPost"))),!x&&b.default.createElement("div",{className:"input-group"},b.default.createElement(s.Text,{size:"p4",className:"input-group-label"},U("tab.topic")),b.default.createElement("div",{className:"input-notification"},b.default.createElement("img",{src:ce?"data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 14.5C11.3137 14.5 14 11.8137 14 8.5C14 5.18629 11.3137 2.5 8 2.5C4.68629 2.5 2 5.18629 2 8.5C2 11.8137 4.68629 14.5 8 14.5Z' fill='%232D87F3'/%3e%3cpath d='M8 5.5V8.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 11.5H8.00708' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e":_,loading:"lazy"}),b.default.createElement(s.Text,{size:"base",color:i.theme.colors.gray500},U(ce?"createPost.popup.primary":"createPost.popup.warning"))),ce&&b.default.createElement(O,{className:"tag-list",communityId:ce.id,forceTopics:y,onChange:ne,selectedTopics:oe,noFetch:S,dataEventCategory:"Together",dataEventAction:"Write Post Click - Choose Community/Topic",dataEventLabel:M}))),b.default.createElement("div",{className:"form-action"},b.default.createElement("div",{className:"input-group"},b.default.createElement(a.Checkbox,{className:"swich-input-group",labelPosition:"left",name:"PostAnonymous",checked:H,color:z?"pink":void 0,"data-event-category":"Together","data-event-action":"Write Post Click - Incognito","data-event-label":M,label:b.default.createElement("div",{className:"switch-label"},b.default.createElement("img",{className:"label-icon",src:c.CommonGAssets.getAssetPath("anomyous-avatar.svg"),alt:"anomyous avatar",style:{marginRight:"10px",width:"24px"},loading:"lazy"}),b.default.createElement("span",{className:"label-txt"},U("createPost.postAnonymous"))),value:"Post Anonymous",onChange:e=>q(e.currentTarget.checked),styles:{body:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},label:{display:"flex",alignItems:"center"}}})),b.default.createElement("div",{className:"input-group"},b.default.createElement(s.Button,{className:"submit-btn pointer-event-child-none",size:"lg","data-event-category":"Ask Doctor","data-event-action":"Submit Question","data-event-label":window.location.href,onClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(fe&&!K){X(!0);try{yield he()}catch(e){console.error(e),D(I(U))}X(!1)}})),disabled:!fe,loading:K},U("createPost.popup.submit")))))},exports.CreatePostDescription=j,exports.CreatePostTitle=B,exports.ImagePreviewPopup=q,exports.InputCommentBar=F,exports.LabelPin=A,exports.PopupDanger=D,exports.PostImagePreview=G,exports.PostSingleImageViewPopup=V,exports.SkipQuestionOfExpertBtn=l=>{var{post:n,onSkip:i,btnText:d,currentPageUrl:c}=l,u=e.__rest(l,["post","onSkip","btnText","currentPageUrl"]);const{t:m}=o.useTranslations(),{data:{locale:p},action:{pushNotifications:v}}=t.useContext(s.TogetherComponentGlobalContext),[g,f]=t.useState(!1),[h,y]=t.useState(!1),C=a.useMantineTheme(),E=t.useCallback((()=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;y(!0);const t=yield s.callApiWithAuth(s.getApiPath(s.PATHS.USER.SKIP_QUESTION,{_locale:p,id:null==n?void 0:n.id}),"PUT");1===(null==t?void 0:t.status)?(null==i||i({id:(null==n?void 0:n.id)||"",communityId:(null===(e=null==n?void 0:n.community)||void 0===e?void 0:e.id)||""}),f(!1),v({title:"",message:"Skip success",type:"success"})):v({title:"",message:null==t?void 0:t.messages,type:"danger"}),y(!1)}))),[]);return b.default.createElement(a.Popover,{width:327,withArrow:!0,shadow:"md",opened:g},b.default.createElement(a.Popover.Target,null,b.default.createElement("div",Object.assign({className:`${Q} ${(null==u?void 0:u.className)||""}`,onClick:()=>f(!0)},u),d||m("profilePanel.questionNotClear"))),b.default.createElement(a.Popover.Dropdown,null,b.default.createElement("div",null,b.default.createElement("div",{className:K},m("profilePanel.skipQuestion.heading")),b.default.createElement("div",{className:X},m("profilePanel.skipQuestion.content")),b.default.createElement("div",{className:J},b.default.createElement(s.Button,{size:"md",variant:"secondary",leftIcon:b.default.createElement(r.Close,{color:C.fn.primaryColor(),size:24}),onClick:()=>f(!1),styles:()=>({leftIcon:{marginRight:0}})}),b.default.createElement(s.Button,{variant:"primary",size:"md",leftIcon:b.default.createElement(r.Check,{color:"white",size:24}),onClick:E,loading:h,"data-event-category":"Together","data-event-action":"Unclear Question Click","data-event-label":c,styles:()=>({leftIcon:{marginRight:0}})})))))},exports.SocialLinkPreview=Z,exports.SubmitReportForm=H,exports.TopicSelectList=O,exports.VerifiedTag=se,exports.types=ue;
|
|
1
|
+
"use strict";var e=require("./tslib.es6-0d31715f.js"),t=require("react"),a=require("@mantine/core"),l=require("./index-9f6e2696.js"),o=require("./useTranslations-2e7d64aa.js"),n=require("innertext"),i=require("./theme-1a7c14fb.js"),r=require("./index-5b7dfda4.js"),s=require("./index.styles-9285e23d.js");require("@mantine/dates");var d=require("./index-a89b23de.js");require("./Onboarding-2b01db17.js");var c=require("./gAssets.js");require("dayjs");var u=require("./screenSizeContext-4d5786c6.js");require("styled-components"),require("./isProduction-e1b7813f.js");var m=require("./index-dad94e78.js");require("@mantine/hooks");var p=require("./index-9669998e.js"),v=require("./index.styled-0d4d68f3.js"),g=require("./index-e022af07.js"),f=require("./index-537bccbe.js"),h=require("lodash/debounce"),y=require("react-contenteditable");require("./useCategory-971481b4.js");var C=require("./index-b99409f1.js"),E=require("react-dom");function w(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function k(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(a){if("default"!==a){var l=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,l.get?l:{enumerable:!0,get:function(){return e[a]}})}})),t.default=e,Object.freeze(t)}require("date-fns"),require("react-day-picker/DayPickerInput"),require("./index-e7f2e80f.js"),require("lodash/throttle"),require("./types-ef750ab6.js"),require("react-hook-form"),require("date-fns/locale/en-US"),require("date-fns/locale/id"),require("date-fns/locale/vi"),require("date-fns/locale/zh-TW"),require("./index.styled-b9465af1.js"),require("uuid"),require("./utils-2fb6eb7d.js"),require("string-format");var b=w(t),P=w(n),T=w(h),S=w(y),x=k(E);const N=({title:o,url:n,image:i,logo:r,className:d,style:c,noRefetch:u})=>{const{data:{locale:m,env:{isMarryBaby:p}}}=t.useContext(s.TogetherComponentGlobalContext),[v,f]=t.useState(!1),h=a.useMantineTheme(),y=t.useRef(u);y.current=u;const[C,E]=t.useState(null);t.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){if(!y.current){if(!n)return E(null);E((e=>Object.assign(Object.assign({},e),{isFetching:!0}))),s.callApi(s.getApiPath(s.PATHS.FETCH_PREVIEW,{_locale:m}),"POST",{data:{link:n},headers:{"Content-Type":"application/json"}}).then((e=>{var t,a,l;f(!1),E({title:null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.title,url:n,image:(null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.image)||(null===(l=null==e?void 0:e.data)||void 0===l?void 0:l.logo)})})).catch((()=>{E(null)}))}}))}),[n]);const w=(null==C?void 0:C.image)||i,k=(null==C?void 0:C.title)||o,P=(null==C?void 0:C.logo)||r,T=(null==C?void 0:C.url)||n,S=T.replace("http://","").replace("https://","").split(/[/?#]/)[0],x=t.useRef(!1);return b.default.createElement(l.StyledCardLink,{"data-is-marrybaby":p,className:`${d} no-replace-click`,style:c,color:h.colors[h.primaryColor][0]},b.default.createElement("a",{href:T,target:"_blank",rel:"noreferrer"},w&&b.default.createElement("div",{className:"link-image-wrapper"},!p&&b.default.createElement("img",{className:"link-image-blur",src:w,onError:e=>{x.current||(x.current=!0,e.currentTarget.src=s.DEFAULT_IMG)},loading:"lazy"}),b.default.createElement("img",{className:"link-image",src:w,onError:e=>{x.current||(x.current=!0,e.currentTarget.src=s.DEFAULT_IMG)},loading:"lazy"})),b.default.createElement("div",{className:"link-info-container"},b.default.createElement(g.Text,{size:"n1"},p&&P&&!v&&b.default.createElement("img",{className:"link-logo",src:P,onError:()=>f(!0),loading:"lazy"}),S),b.default.createElement(s.Heading,{tag:"h6"},k))))};const A=({onClick:e,color:a,className:n,style:i})=>{const{data:{env:{isMarryBaby:r}}}=t.useContext(s.TogetherComponentGlobalContext),{t:d}=o.useTranslations();return b.default.createElement(l.LabelSortPin,{label:b.default.createElement(b.default.Fragment,null,r&&b.default.createElement("img",{className:"label-sort-pin-icon",src:"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M3.5 19.9999L7.87 15.6299' stroke='%23FB8C00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath fill-rule='evenodd' clip-rule='evenodd' d='M4.95634 11.294C4.56534 11.685 4.56534 12.318 4.95634 12.708L7.87434 15.626L10.7923 18.544C11.1833 18.935 11.8163 18.935 12.2063 18.544L13.3813 17.369C13.5693 17.181 13.6743 16.927 13.6743 16.662V12.726L16.5743 9.82597L18.8833 9.94897C19.1663 9.96397 19.4433 9.85797 19.6433 9.65797L20.2173 9.08397C20.6083 8.69297 20.6083 8.05997 20.2173 7.66997L15.8313 3.28397C15.4403 2.89297 14.8073 2.89297 14.4173 3.28397L13.8433 3.85797C13.6423 4.05897 13.5363 4.33497 13.5523 4.61797L13.6753 6.92697L10.7753 9.82697H6.83834C6.57334 9.82697 6.31834 9.93197 6.13134 10.12L4.95634 11.294V11.294Z' stroke='%23FB8C00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath d='M16.5699 9.83018L13.6699 6.93018' stroke='%23FB8C00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3c/svg%3e",loading:"lazy"})," ",d("label.pinnedPost")),rightLabel:!r&&b.default.createElement("img",{className:"label-sort-pin-icon",src:"data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cline x1='7.18605' y1='7.68219' x2='3.68219' y2='13.8139' stroke='%23FEA21E' stroke-linecap='round'/%3e%3cpath d='M3.24591 7.78426C3.21275 7.84168 3.20376 7.90993 3.22092 7.97398C3.23808 8.03803 3.27998 8.09264 3.3374 8.12579L8.78429 11.2706C8.90385 11.3396 9.05674 11.2986 9.12578 11.1791C9.71191 10.1641 9.71348 8.97262 9.23682 7.99339L10.8583 5.18521C11.5115 5.00603 12.0982 4.57973 12.4638 3.94629C12.5328 3.82672 12.4919 3.67383 12.3723 3.6048L8.18237 1.18584C8.12494 1.15268 8.0567 1.1437 7.99265 1.16086C7.92861 1.17803 7.874 1.21993 7.84086 1.27736C7.47521 1.91077 7.39934 2.63194 7.57065 3.28723L5.94919 6.09545C4.86323 6.1723 3.83201 6.76934 3.24591 7.78426Z' fill='%23FEA21E' stroke='%23FEA21E' stroke-width='0.5' stroke-linejoin='round'/%3e%3c/svg%3e",loading:"lazy"}),onClick:e,color:"white",className:`label-pinned ${n}`,style:i})},I=e=>({message:e("notification.failure"),type:"danger"});var _="data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 14.5C11.3137 14.5 14 11.8137 14 8.5C14 5.18629 11.3137 2.5 8 2.5C4.68629 2.5 2 5.18629 2 8.5C2 11.8137 4.68629 14.5 8 14.5Z' fill='%23FE921D'/%3e%3cpath d='M8 5.5V8.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 11.5H8.00708' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const M=(e,a)=>{const[l,o]=t.useState(e||[]);return{onSelectImages:t=>{const n=t.target.files;if(n)if(a&&e){a((e||l).concat(Array.from(n)))}else o((t=>{const l=e||t;return a&&a(l.concat(Array.from(n))),l.concat(Array.from(n))}))},onRemoveImage:t=>{if(a&&e){const l=e;l.splice(t,1),a(l.slice())}else o((l=>{const o=e||l;return o.splice(t,1),a&&a(o.slice()),o.slice()}))},onRemoveAllImages:()=>{a?a([]):o([])},imageSrcs:t.useMemo((()=>(e||l).map((e=>"string"==typeof e?e:URL.createObjectURL(e)))),[e,l]),imageFiles:e||l}};var L="data:image/svg+xml,%3csvg width='24' height='25' viewBox='0 0 24 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 22.9844C17.5228 22.9844 22 18.5072 22 12.9844C22 7.46153 17.5228 2.98438 12 2.98438C6.47715 2.98438 2 7.46153 2 12.9844C2 18.5072 6.47715 22.9844 12 22.9844Z' fill='%23262626'/%3e%3cpath d='M14.8281 10.1562L9.17127 15.8131' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M9.17188 10.1562L14.8287 15.8131' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const j=({className:e,style:a,bannedWords:n=[],value:r,onChange:d,onPreviewUrlChange:c,onInvalidUrlsChange:u,onImageFilesChange:m,imageFiles:p,isReplying:v})=>{const{t:f}=o.useTranslations(),[h,y]=t.useState(null),C=t.useRef(null),{onSelectImages:E,onRemoveImage:w,imageSrcs:k}=M(p,m);return t.useEffect((()=>{c&&((null==h?void 0:h.url)?c({title:h.title||"",url:h.url||"",image:h.image||"",description:h.description||""}):c(null))}),[h]),b.default.createElement(l.StyledCreatePostDescription,{className:e,style:a},b.default.createElement(g.Text,{size:"p4",className:"description-label"},f("createPost.popup.description")),b.default.createElement("div",{className:"textarea-control"},b.default.createElement("div",{className:"textarea-wrapper"},b.default.createElement(l.RichTextEditor,{html:r||"",onChange:d,bannedWords:n,onImagePickerClick:()=>{var e;return null===(e=C.current)||void 0===e?void 0:e.click()},onPreviewUrlChange:y,onInvalidUrlsChange:u,isReplying:v}))),b.default.createElement(g.Text,{size:"p4",className:"count-string"},f("character"),": ",P.default(r||"").length),(!k||0===k.length)&&h&&b.default.createElement("div",{className:"link-preview-wrapper"},h.isFetching?b.default.createElement(l.Loading,null):b.default.createElement(b.default.Fragment,null,b.default.createElement(N,{title:h.title,url:h.url||"#",image:h.image,noRefetch:!0}),b.default.createElement("img",{src:L,className:"icon-close",onClick:()=>y(null),loading:"lazy"}))),b.default.createElement("input",{ref:C,type:"file",accept:"image/png, image/gif, image/jpeg",multiple:!0,style:{display:"none"},onChange:E}),k.length>s.MAX_IMAGE_UPLOADS?b.default.createElement("div",{className:"input-notification"},b.default.createElement("img",{src:_,loading:"lazy"}),b.default.createElement(g.Text,{size:"p4",color:i.theme.colors.alertWarning},f("createPost.popup.warningImage"))):null,k.length>0&&b.default.createElement("div",{className:"image-gallery"},k.map(((e,t)=>b.default.createElement("div",{key:t,className:"image-item"},b.default.createElement("img",{src:e,loading:"lazy"}),b.default.createElement("img",{className:"close-btn",src:L,onClick:()=>w(t),loading:"lazy"}))))))},R=(e,t)=>{if(!t)return e;const{limit:a,bannedWords:o=[]}=t,n="number"==typeof a&&a>=0?e.substring(0,a):e;return l.highlightBadWords(n,o)},B=({className:e,style:a,bannedWords:n=[],value:i,onChange:r})=>{var s;const{t:d}=o.useTranslations(),[c,u]=t.useState(""),m=t.useRef(null);t.useEffect((()=>{if(m.current){const e=e=>{var t;e.preventDefault();const a=null===(t=e.clipboardData)||void 0===t?void 0:t.getData("text/plain");document.execCommand("insertHTML",!1,a)},t=m.current;return t.addEventListener("paste",e,{passive:!0}),()=>t.removeEventListener("paste",e)}}),[m]);const p=(null==n?void 0:n.join(","))||"";t.useEffect((()=>{var e;if(p){const t=null===(e=m.current)||void 0===e?void 0:e.innerText;if(t){const e=l.highlightBadWords(t,n);e!==t&&(r&&r(e),u(e))}}}),[p]);const v=t.useCallback(T.default((()=>{if(m.current){const e=R(m.current.innerText,{limit:120,bannedWords:n});r&&r(e),u(e)}}),300),[]);return t.useEffect((()=>{setTimeout((()=>{var e;null===(e=m.current)||void 0===e||e.focus()}),500)}),[]),b.default.createElement(l.StyledCreatePostTitle,{className:e,style:a},b.default.createElement(f.Input,{name:"title",value:i||c,size:"md",label:d("createPost.title"),CustomInput:b.default.createElement(S.default,{innerRef:m,html:i||c,onChange:()=>{if(m.current&&m.current.innerText!==(i||c)){const e=R(m.current.innerText,{bannedWords:n});r&&r(e),u(e),v()}},className:"title-input"})}),b.default.createElement(g.Text,{size:"p4",className:"count-string"},d("createPost.popup.wordCount",{count:(null===(s=m.current)||void 0===s?void 0:s.innerText.length)||0,max:120})))},O=({className:a,style:o,topics:n,communityId:i,onChange:r,isLoading:d,disabled:c,forceTopics:u,selectedTopics:m,noFetch:p,dataEventCategory:g,dataEventAction:f,dataEventLabel:h})=>{const{data:{locale:y,env:{isMarryBaby:C}}}=t.useContext(s.TogetherComponentGlobalContext),[E,w]=t.useState(n?[...n]:[]),[k,P]=t.useState(m?[...m]:[]),[T,S]=t.useState(!1),x=t.useRef(n);x.current=n,t.useEffect((()=>{var t;!i||p||(null===(t=x.current)||void 0===t?void 0:t.length)||(w([]),S(!0),e.__awaiter(void 0,void 0,void 0,(function*(){var e;try{const t=yield s.callApi(s.getApiPath(s.PATHS.TOPIC.LIST,{communityId:i,_locale:y}),"GET"),a=null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.topics;Array.isArray(a)&&w((()=>(null==a?void 0:a.map(v.formatTopic).sort(((e,t)=>(e.order||0)-(t.order||0))))||[]))}catch(e){console.log(e),S(!1)}S(!1)})))}),[i,p]);const N=null==n?void 0:n.map((e=>e.id)).join("-"),A=null==E?void 0:E.map((e=>e.id)).join("-"),I=null==u?void 0:u.map((e=>e.id)).join("-");t.useEffect((()=>{n&&void 0!==N&&N!==A&&w(n)}),[n,N,A]);const _=t.useMemo((()=>E.filter((e=>!(null==u?void 0:u.some((t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId)))))),[A,I]);return b.default.createElement(l.StyledTopicSelectList,{"data-is-marrybaby":C,className:a,style:o},u.map((e=>b.default.createElement(z,{key:`${e.id}-${e.mappedCategoryId}`,topic:e,disabled:!0,selected:!0,dataEventAction:f,dataEventCategory:g,dataEventLabel:h}))),_.map((e=>b.default.createElement(z,{key:`${e.id}-${e.mappedCategoryId}`,topic:e,disabled:c,selected:(m||k).some((t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId)),onClick:()=>{const t=m||k,a=t.findIndex((t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId));-1!==a?t.splice(a,1):t.push(e),r&&m?r(t.slice()):(r&&r(t.slice()),P(t.slice()))},dataEventAction:f,dataEventCategory:g,dataEventLabel:h}))),(d||T)&&b.default.createElement(l.Loading,{className:"topic-spinner"}))},z=t=>{var{topic:a,disabled:l,selected:o,onClick:n}=t,i=e.__rest(t,["topic","disabled","selected","onClick"]);return b.default.createElement("div",Object.assign({className:"tag-item"+(o?" --active":""),"data-disabled":l,onClick:l?void 0:n},i),a.name)},D=({className:e,isMarryBaby:a,style:o,title:n,description:i,acceptText:r,cancelText:d,onAccept:c,onCancel:m,thumbnail:p,isThumbnailIcon:v,onClose:f,acceptBtnTracking:h,acceptBtnProps:y,cancelBtnProps:E})=>{const{data:{env:{isMarryBaby:w}}}=t.useContext(s.TogetherComponentGlobalContext),k="boolean"==typeof a?a:w,[P,T]=t.useState(!1);return t.useEffect((()=>(u.toggleNoScroll(!0),setTimeout((()=>T(!0)),0),()=>u.toggleNoScroll(!1))),[]),"undefined"==typeof window?null:x.createPortal(b.default.createElement(l.StyledPopupDanger,{"data-is-marrybaby":k,className:e,style:o,"data-open":P},b.default.createElement(l.PopupFrame,{className:"popup-frame",isOpen:P,onClose:f},b.default.createElement("div",{className:"confirm-dialog",onClick:e=>e.stopPropagation()},b.default.createElement("div",{className:"confirm-content"},p&&b.default.createElement("div",{className:"thumbnail-container "+(v?"is-icon":"")},b.default.createElement("img",{className:"thumbnail",src:p,loading:"lazy"})),b.default.createElement(s.Heading,{className:"title",tag:"h2"},n),b.default.createElement(g.Text,{className:"desc",size:"lg"},i),b.default.createElement("div",{className:"btn-group"},b.default.createElement(C.Button,Object.assign({theme:k?"marryBaby":"helloSites",size:"md",color:"tertiary",onClick:()=>{null==c||c(),null==f||f()}},y,h),r),b.default.createElement(C.Button,Object.assign({theme:k?"marryBaby":"helloSites",size:"md",onClick:()=>{null==m||m(),null==f||f()}},E),d)))),k&&p&&b.default.createElement("div",{className:"thumbnail-container is-mobile "+(v?"is-icon":"")},b.default.createElement("img",{className:"thumbnail",src:p,loading:"lazy"})))),u.getPopupWrapperDom())};const F=({isReply:a,className:n,onClose:i,replyToName:r,style:d,replyingId:c,replyingUser:u,onPostSuccess:m,post:p,isMarryBaby:h})=>{const{action:{pushNotifications:y,sanitizeFunction:E},data:{userInfo:w,locale:k,env:{isMarryBaby:P}}}=t.useContext(s.TogetherComponentGlobalContext),T="boolean"==typeof h?h:P,{t:S}=o.useTranslations(),{onSelectImages:x,onRemoveImage:A,imageSrcs:I,onRemoveAllImages:_,imageFiles:j}=M(),[R,B]=t.useState(""),{trigger:O}=t.useContext(l.MainInputTriggerContext),[z,D]=t.useState(!1),F=t.useRef(null),U=t.useRef(null),H=t.useRef(null),[q,W]=t.useState([]),[V,$]=t.useState([]),[G,Z]=t.useState(null);return t.useEffect((()=>{var e;null===(e=H.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"start"}),setTimeout((()=>{var e;null===(e=U.current)||void 0===e||e.focus()}),400)}),[O]),b.default.createElement(l.StyledInputCommentBar,{"data-is-reply":a,className:n,style:d},a&&b.default.createElement("div",{className:"reply-to-container"},b.default.createElement(g.Text,{size:"p4"},b.default.createElement("span",{dangerouslySetInnerHTML:{__html:S("inputComment.replyTo",{name:`<span style="color: #2D87F3; cursor: pointer">@${r||""}</span>`})}})),b.default.createElement("img",{src:"data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8.00016' cy='8.50004' r='6.66667' fill='white' stroke='%23404040'/%3e%3cpath d='M10 6.5L6 10.5' stroke='%23404040' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M6 6.5L10 10.5' stroke='%23404040' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",className:"icon-close-comment",onClick:()=>i&&i(),loading:"lazy"})),b.default.createElement("div",{className:"input-container",ref:H},b.default.createElement(v.UserAvatar,{className:"avatar-wrapper "+(a?"avatar-wrapper-reply":""),avatar:(null==w?void 0:w.id)?w.avatar:s.DEFAULT_AVATAR_IMG,username:(null==w?void 0:w.name)||(null==w?void 0:w.username)}),b.default.createElement("input",{ref:F,onChange:x,type:"file",multiple:!0,accept:"image/png,image/jpeg",name:"images",style:{display:"none"}}),b.default.createElement(f.Input,{value:R,name:"input",size:"md",className:"input-wrapper",displayIcon:b.default.createElement("img",{src:"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M10.7543 4.85352H4.49227C4.01776 4.85352 3.56268 5.04201 3.22715 5.37754C2.89162 5.71307 2.70313 6.16815 2.70312 6.64266V19.1667C2.70313 19.6412 2.89162 20.0963 3.22715 20.4318C3.56268 20.7673 4.01776 20.9558 4.49227 20.9558H17.0163C17.4908 20.9558 17.9459 20.7673 18.2814 20.4318C18.6169 20.0963 18.8054 19.6412 18.8054 19.1667V12.9047' stroke='%232D87F3' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M17.4633 3.51187C17.8192 3.15599 18.3019 2.95605 18.8052 2.95605C19.3085 2.95605 19.7912 3.15599 20.147 3.51187C20.5029 3.86775 20.7029 4.35044 20.7029 4.85373C20.7029 5.35702 20.5029 5.83971 20.147 6.19559L11.6486 14.694L8.07031 15.5886L8.96489 12.0103L17.4633 3.51187Z' stroke='%232D87F3' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",loading:"lazy"}),CustomInput:b.default.createElement("div",{className:"as-input"},b.default.createElement(l.RichTextEditor,{className:"textarea",html:R,onChange:B,onImagePickerClick:()=>{var e;return null===(e=F.current)||void 0===e?void 0:e.click()},bannedWords:V,onPreviewUrlChange:Z,onInvalidUrlsChange:W,setEditorRef:e=>U.current=e,isReplying:a}))}),b.default.createElement(C.Button,{theme:T?"marryBaby":"helloSites",className:"send-button",size:"sm",onClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){var t,o,n,r,d,g,f,h,C;if((null==p?void 0:p.id)&&!z){D(!0);try{const w=e=>{B(""),_(),i&&i();const t=v.formatComment(e.data);"string"==typeof t.images&&(t.images=JSON.parse(t.images)),m&&m(t)},b=yield(({postId:t,message:a,photos:o,link:n,locale:i,sanitizeFunction:r,replyingUserId:d,replyingUserName:c,replyingId:u})=>e.__awaiter(void 0,void 0,void 0,(function*(){const e=new FormData;let m=l.encodePostContent(a.replace(/(\ )+/g," "),r);const p=l.getMentionIdsFromString(m);return o&&o.length>0&&(yield Promise.all(null==o?void 0:o.map((e=>l.uploadAndGetSrc(e,i))))).filter(Boolean).slice(0,s.MAX_IMAGE_UPLOADS).forEach((t=>{e.append("images[]",t)})),n&&e.append("link",n),null==p||p.forEach((t=>{e.append("mention_ids[]",t)})),e.append("post_id",t),u&&e.append("parent_id",u),d&&(p.unshift(d),m=`[mention+id="${d}"+name="${(c||"").replace('"',"'")}"]${m}`,e.append("parent_user_id",String(d))),e.append("content",m),e.append("content",m),e})))(Object.assign({message:R,photos:j,postId:String(p.id),link:null==G?void 0:G.url,sanitizeFunction:E,locale:k},a&&c?{replyingUserId:String((null==u?void 0:u.id)||(null===(t=null==p?void 0:p.author)||void 0===t?void 0:t.id)||""),replyingId:c,replyingUserName:(null==u?void 0:u.name)||(null==u?void 0:u.username)||""}:{})),P=yield a&&c?((t,a)=>e.__awaiter(void 0,void 0,void 0,(function*(){return s.callApiWithAuth(s.getApiPath(s.PATHS.COMMENT.REPLY,{_locale:a}),"POST",{data:t})})))(b,k):((t,a)=>e.__awaiter(void 0,void 0,void 0,(function*(){return s.callApiWithAuth(s.getApiPath(s.PATHS.COMMENT.CREATE,{_locale:a}),"POST",{data:t})})))(b,k),T=null==P?void 0:P.data;(null==T?void 0:T.id)&&!(null===(n=null===(o=null==P?void 0:P.messages)||void 0===o?void 0:o.moderation)||void 0===n?void 0:n.type)?w(P):"banned"===(null===(d=null===(r=null==P?void 0:P.messages)||void 0===r?void 0:r.moderation)||void 0===d?void 0:d.type)?(y({title:S("notification.comment.blocked.title"),message:S("notification.comment.blocked.message"),type:"danger"}),P.messages.moderation.words&&$(P.messages.moderation.words)):"suspect"===(null===(f=null===(g=null==P?void 0:P.messages)||void 0===g?void 0:g.moderation)||void 0===f?void 0:f.type)?(y({title:S("notification.comment.suspect.title"),message:S("notification.comment.suspect.message"),type:"warning"}),B(""),_(),i&&i()):(null===(h=null==P?void 0:P.messages)||void 0===h?void 0:h.find((e=>{var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(y({message:S("notification.suspend.message"),type:"warning"}),B(""),_(),i&&i()):y({title:"",message:(null===(C=null==P?void 0:P.messages)||void 0===C?void 0:C[0])||S("notification.comment.somethingWrong"),type:"danger"})}catch(e){y({title:"",message:S("notification.comment.somethingWrong"),type:"danger"})}D(!1)}})),isLoading:z,isDisabled:!!(null==q?void 0:q.length)||z||!R||(null==R?void 0:R.length)<2||!R.trim()},b.default.createElement("img",{src:"data:image/svg+xml,%3csvg width='20' height='21' viewBox='0 0 20 21' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M7.5 9.73438L3.75 13.4844L7.5 17.2344' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M16.25 4.73438L16.25 10.3026C16.25 11.1464 15.9208 11.9557 15.3347 12.5524C14.7487 13.1491 13.9538 13.4844 13.125 13.4844L3.75 13.4844' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",className:"icon-enter",loading:"lazy"}))),(null==q?void 0:q.length)?b.default.createElement("div",{className:"error-text"},S("notification.limitUrlDomain")):null,(!I||0===I.length)&&G&&b.default.createElement("div",{className:"link-preview-wrapper"},G.isFetching?b.default.createElement(l.Loading,null):b.default.createElement(b.default.Fragment,null,b.default.createElement(N,{title:G.title,url:G.url||"#",image:G.image,noRefetch:!0}),b.default.createElement("img",{src:L,className:"icon-close",onClick:()=>Z(null),loading:"lazy"}))),I&&I.length>0&&b.default.createElement("div",{className:"preview-images-container"},I.map(((e,t)=>b.default.createElement("div",{key:t,className:"image-src-wrapper"},b.default.createElement("img",{className:"preview-image",src:e,loading:"lazy"}),b.default.createElement("img",{src:L,className:"icon-close-circle",onClick:()=>A(t),loading:"lazy"}))))))};var U="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14Z' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 5V8' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 11H8.00708' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const H=({className:a,style:n,reason:r,reasonText:d,onClose:c,postId:u})=>{const{data:{locale:m,env:{isMarryBaby:p}},action:{pushNotifications:v}}=t.useContext(s.TogetherComponentGlobalContext),{t:f}=o.useTranslations(),[h,y]=t.useState(!1);return b.default.createElement(l.StyledSubmitReportForm,{"data-is-marrybaby":p,className:a,style:n},b.default.createElement("ul",{className:"report-list"},b.default.createElement("li",{className:"report-item"},b.default.createElement("img",{src:U,loading:"lazy"}),b.default.createElement(g.Text,{className:"__label",color:i.theme.colors.gray800,size:"p4"},d))),b.default.createElement(C.Button,{theme:p?"marryBaby":"helloSites",className:"report-submit",size:"lg",color:"primary",isLoading:h,onClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(u&&!h){y(!0);try{const e=yield(({id:e,reason:t,locale:a})=>{const l=new FormData;return l.append("reason",t),s.callApiWithAuth(s.getApiPath(s.PATHS.POST.REPORT,{_locale:a,id:e}),"POST",{data:l})})({id:u,reason:r,locale:m});1===(null==e?void 0:e.status)&&(v({message:"Post reported",type:"success"}),c&&c())}catch(e){}y(!1)}}))},f("submit")))};const q=({className:e,style:n,authorName:i,images:r,onClose:s,onOpenSingleView:d,alt:c})=>{const{t:u}=o.useTranslations(),[m,p]=t.useState(!1);return t.useEffect((()=>{setTimeout((()=>{p(!0)}),0)}),[]),b.default.createElement(a.Portal,null,b.default.createElement(l.StyledImagePreviewPopup,{className:e,style:n,"data-open":m},b.default.createElement("div",{className:"top-bar"},b.default.createElement("img",{className:"icon-arrow-left",src:"data:image/svg+xml,%3csvg width='24' height='25' viewBox='0 0 24 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M10.0508 18.0607L4.00078 12.0367L10.0508 6.01172' stroke='%23262626' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M4.00195 12.0352L19.002 12.0352' stroke='%23262626' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",onClick:s,alt:"go back",loading:"lazy"}),b.default.createElement(g.Text,{size:"p2",type:"bold",style:{textAlign:"center"}},u("previewPhotos.title",{name:i}))),b.default.createElement("div",{className:"container"},r.map(((e,t)=>b.default.createElement("img",{className:"img-preview",key:t,src:e,onClick:()=>null==d?void 0:d(t),alt:c,loading:"lazy"}))))),",")};var W="data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M6 12.8125L10 8.8125L6 4.8125' stroke='white' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const V=({initialViewIndex:e,images:o,onClose:n,alt:i})=>{const[r,s]=t.useState(e),[d,c]=t.useState(!1);t.useEffect((()=>{setTimeout((()=>{c(!0)}),0)}),[]);const u=null==o?void 0:o[r],m=0===r,p=!(null==o?void 0:o.length)||r===(null==o?void 0:o.length)-1;return b.default.createElement(a.Portal,null,b.default.createElement(l.StyledImagePreviewContainer,{"data-open":d&&!!u},b.default.createElement(l.StyledImagePreviewTopbar,null,b.default.createElement("img",{src:l.img,className:"icon-close",onClick:n,alt:"close",loading:"lazy"})),u&&r>=0&&b.default.createElement(b.default.Fragment,null,b.default.createElement(l.StyledImagePreviewWrapper,null,b.default.createElement("img",{className:"img-preview",src:u,alt:i,loading:"lazy"}),b.default.createElement(l.StyledArrowWrapper,{"data-disabled":m,onClick:()=>!m&&s(r-1)},b.default.createElement(l.StyledCircleArrow,null,b.default.createElement("img",{src:W,style:{transform:"rotate(180deg)"},alt:"left arrow","data-disabled":m,loading:"lazy"}))),b.default.createElement(l.StyledArrowWrapper,{"data-right":!0,"data-disabled":p,onClick:()=>!p&&s(r+1)},b.default.createElement(l.StyledCircleArrow,null,b.default.createElement("img",{src:W,alt:"right arrow","data-disabled":p,loading:"lazy"})))))))},$=({image:e,showIcon:a=!0})=>{const[o,n]=t.useState(!0);return b.default.createElement(l.StyledWrapper$1,{"data-is-blurred":o,onClick:e=>o&&e.stopPropagation()},b.default.createElement("img",{loading:"lazy",className:"img-preview",src:e}),b.default.createElement(l.StyledInner,{onClick:e=>{e.stopPropagation(),n(!o)}},a&&b.default.createElement(l.StyledIcon,null,o?b.default.createElement("svg",{width:"22",height:"20",viewBox:"0 0 22 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.71 2.5399C1.32 2.1499 1.32 1.5199 1.71 1.1299C2.1 0.739902 2.74 0.739902 3.13 1.1299L19.44 17.4599C19.83 17.8499 19.83 18.4799 19.44 18.8699C19.05 19.2599 18.42 19.2599 18.03 18.8699L15.31 16.1499C13.97 16.6699 12.52 16.9699 11 16.9699C6 16.9699 1.73 13.8599 0 9.4699C0.77 7.4999 2.06 5.7999 3.68 4.5099L1.71 2.5399ZM16 9.4699C16 6.7099 13.76 4.4699 11 4.4699C10.49 4.4699 10 4.5699 9.53 4.7099L7.36 2.5399C8.51 2.1699 9.73 1.9699 11 1.9699C16 1.9699 20.27 5.0799 22 9.4599C21.31 11.2199 20.21 12.7599 18.82 13.9899L15.76 10.9299C15.9 10.4699 16 9.9799 16 9.4699ZM11 14.4699C8.24 14.4699 6 12.2299 6 9.4699C6 8.6999 6.18 7.9699 6.49 7.3299L8.06 8.8999C8.03 9.0799 8 9.2699 8 9.4699C8 11.1299 9.34 12.4699 11 12.4699C11.2 12.4699 11.38 12.4399 11.57 12.3999L13.14 13.9699C12.49 14.2899 11.77 14.4699 11 14.4699ZM13.97 9.1399C13.82 7.7399 12.72 6.6499 11.33 6.4999L13.97 9.1399Z",fill:"white"})):b.default.createElement("svg",{width:"23",height:"16",viewBox:"0 0 23 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b.default.createElement("path",{d:"M11.9999 0C5.14188 0 1.88558 5.87864 1.09558 7.55664C0.963582 7.83664 0.963582 8.16141 1.09558 8.44141C1.88558 10.1204 5.14188 16 11.9999 16C18.8339 16 22.0924 10.1629 22.8964 8.46094C23.0344 8.16794 23.0344 7.83206 22.8964 7.53906C22.0924 5.83706 18.8339 0 11.9999 0ZM11.9999 3C14.7609 3 16.9999 5.239 16.9999 8C16.9999 10.761 14.7609 13 11.9999 13C9.23888 13 6.99988 10.761 6.99988 8C6.99988 5.239 9.23888 3 11.9999 3ZM11.9999 5C11.2042 5 10.4412 5.31607 9.87856 5.87868C9.31595 6.44129 8.99988 7.20435 8.99988 8C8.99988 8.79565 9.31595 9.55871 9.87856 10.1213C10.4412 10.6839 11.2042 11 11.9999 11C12.7955 11 13.5586 10.6839 14.1212 10.1213C14.6838 9.55871 14.9999 8.79565 14.9999 8C14.9999 7.20435 14.6838 6.44129 14.1212 5.87868C13.5586 5.31607 12.7955 5 11.9999 5Z",fill:"#2D87F3"})))))},G=({className:e,images:a=[],style:n,authorName:i,isSensitive:r=!1,alt:d})=>{const{data:{env:{isMarryBaby:c}}}=t.useContext(s.TogetherComponentGlobalContext),{t:m}=o.useTranslations(),p="+ "+((a.length||0)-4),[v,g]=t.useState(!1),[f,h]=t.useState(-1),y=a.length>5,C=t.useRef(!1);return t.useEffect((()=>()=>{C.current&&u.toggleNoScroll(!1)}),[]),t.useEffect((()=>{v||f>=0?(u.toggleNoScroll(!0),C.current=!0):(u.toggleNoScroll(!1),C.current=!1)}),[v,f]),b.default.createElement(b.default.Fragment,null,r&&b.default.createElement(l.StyledNotificationBar,{message:m("sensitiveMask.contentWarningDescription"),icon:b.default.createElement("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.00002 0.666748C4.40002 0.666748 0.666687 4.40008 0.666687 9.00008C0.666687 13.6001 4.40002 17.3334 9.00002 17.3334C13.6 17.3334 17.3334 13.6001 17.3334 9.00008C17.3334 4.40008 13.6 0.666748 9.00002 0.666748ZM9.00002 9.83341C8.54169 9.83341 8.16669 9.45841 8.16669 9.00008V5.66675C8.16669 5.20842 8.54169 4.83342 9.00002 4.83342C9.45835 4.83342 9.83335 5.20842 9.83335 5.66675V9.00008C9.83335 9.45841 9.45835 9.83341 9.00002 9.83341ZM8.16669 11.5001V13.1667H9.83335V11.5001H8.16669Z",fill:"#FE921D"}))}),b.default.createElement(l.StyledPostImagePreview,{className:e,style:n,"data-image-count":y?5:a.length||0,"data-is-marrybaby":c,"data-cursor-pointer":!r},null==a?void 0:a.slice(0,5).map(((e,t)=>{const a=4===t&&y;return b.default.createElement("div",{className:"img-wrapper",key:t,onClick:()=>{t>=4&&y?g(!0):h(t)}},r&&b.default.createElement($,{image:e,showIcon:!a}),!c&&b.default.createElement("img",{loading:"lazy",className:"img-preview-blur",src:e,alt:d}),b.default.createElement("img",{loading:"lazy",className:"img-preview",src:e,alt:d}),a&&b.default.createElement("div",{className:"img-more-overlay"},b.default.createElement(s.Heading,{tag:"h1",as:"h2",color:"white"},p)))}))),v&&b.default.createElement(q,{authorName:i||"",images:a,onClose:()=>g(!1),onOpenSingleView:h,alt:d}),f>=0&&b.default.createElement(V,{images:a,initialViewIndex:f,onClose:()=>h(-1),alt:d}))},Z=({url:o,image:n,className:i,style:r,autoPlay:d=!0})=>{const{data:{locale:c}}=t.useContext(s.TogetherComponentGlobalContext),[u,p]=t.useState(null);t.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){if(!n){if(!o)return p(null);p((e=>Object.assign(Object.assign({},e),{isFetching:!0}))),s.callApi(s.getApiPath(s.PATHS.FETCH_PREVIEW,{_locale:c}),"POST",{data:{link:o},headers:{"Content-Type":"application/json"}}).then((e=>{var t,a;p({url:o,image:(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.image)||(null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.logo)})})).catch((()=>{p(null)}))}}))}),[o,n]);const v=n||(null==u?void 0:u.image),g=(null==u?void 0:u.url)||o,f=t.useMemo((()=>l.youtubeVidIdGetter(g)),[g]),h=t.useMemo((()=>g.includes("facebook.com")||g.includes("fb.watch")),[g]),y=t.useRef(0),C=t.useRef(0),[E,w]=t.useState(!1);t.useEffect((()=>{const e=()=>{var e;const t=null===(e=k.current)||void 0===e?void 0:e.getBoundingClientRect();let a=!1;t&&(!y.current||Math.abs((y.current-t.width)/(null==t?void 0:t.width))>.2)&&(y.current=Math.floor(t.width),a=!0),t&&(!C.current||Math.abs((C.current-t.height)/(null==t?void 0:t.height))>.2)&&(C.current=Math.floor(t.height),a=!0),a&&w((e=>!e))};return e(),window.addEventListener("resize",e,{passive:!0}),()=>{window.removeEventListener("resize",e)}}),[]);const k=t.useRef(null),P=a.useMantineTheme();return b.default.createElement(l.StyledSocialLinkPreview,{className:`${i} no-replace-click`,style:r,ref:k,color:P.colors[P.primaryColor][0]},n||!f&&!h?b.default.createElement("a",{href:g,target:"_blank",rel:"noreferrer"},b.default.createElement("div",{className:"link-image-wrapper "+((null==u?void 0:u.isFetching)?"fetching":"")},(null==u?void 0:u.isFetching)?b.default.createElement(l.Loading,{className:"loading-spinner"}):b.default.createElement(m.ImageWrap,{className:"link-image",src:v||s.DEFAULT_IMG,backupSrc:s.DEFAULT_IMG,alt:g}))):b.default.createElement("div",{className:"link-image-wrapper"},f?b.default.createElement("iframe",{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${f}?&autoplay=${d?1:0}&mute=1&enablejsapi=1`,frameBorder:"0",allowFullScreen:!0,style:{position:"absolute",top:0,left:0,border:"none",overflow:"hidden"},loading:"lazy"}):h?b.default.createElement("iframe",{key:String(E),src:`https://www.facebook.com/plugins/video.php?href=${encodeURIComponent(g)}&autoplay=${d?1:0}&show_text=false&t=0&width=${y.current}&height=${C.current}`,style:{position:"absolute",top:"50%",left:"50%",border:"none",overflow:"hidden",height:C.current,width:y.current,transform:"translate(-50%, -50%)"},scrolling:"no",frameBorder:"0",allowFullScreen:!0,allow:"autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share",loading:"lazy"}):null))};var Q="KsWg8i6",K="_9tS0EUN",X="kyyRKlb",J="-Uqqka-";var Y="data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M5 10C3.9 10 3 10.9 3 12C3 13.1 3.9 14 5 14C6.1 14 7 13.1 7 12C7 10.9 6.1 10 5 10Z' fill='%233E3F58'/%3e %3cpath d='M19 10C17.9 10 17 10.9 17 12C17 13.1 17.9 14 19 14C20.1 14 21 13.1 21 12C21 10.9 20.1 10 19 10Z' fill='%233E3F58'/%3e %3cpath d='M12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10Z' fill='%233E3F58'/%3e %3c/svg%3e",ee="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='%23595959' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 13.3334L8 10.3704L4 13.3334V3.85187C4 3.53754 4.12041 3.23608 4.33474 3.01382C4.54906 2.79155 4.83975 2.66669 5.14286 2.66669H10.8571C11.1602 2.66669 11.4509 2.79155 11.6653 3.01382C11.8796 3.23608 12 3.53754 12 3.85187V13.3334Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",te="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 13.3334L8 10.3704L4 13.3334V3.85187C4 3.53754 4.12041 3.23608 4.33474 3.01382C4.54906 2.79155 4.83975 2.66669 5.14286 2.66669H10.8571C11.1602 2.66669 11.4509 2.79155 11.6653 3.01382C11.8796 3.23608 12 3.53754 12 3.85187V13.3334Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",ae="data:image/svg+xml,%3csvg width='3' height='13' viewBox='0 0 3 13' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='1.58326' cy='6.41663' r='1.25' transform='rotate(89.9997 1.58326 6.41663)' fill='%23595959'/%3e%3cellipse cx='1.58326' cy='1.41663' rx='1.25' ry='1.25' transform='rotate(89.9997 1.58326 1.41663)' fill='%23595959'/%3e%3cellipse cx='1.58326' cy='11.4166' rx='1.25' ry='1.25' transform='rotate(89.9997 1.58326 11.4166)' fill='%23595959'/%3e%3c/svg%3e",le="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 5.33337C13.1046 5.33337 14 4.43794 14 3.33337C14 2.2288 13.1046 1.33337 12 1.33337C10.8954 1.33337 10 2.2288 10 3.33337C10 4.43794 10.8954 5.33337 12 5.33337Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M4 10C5.10457 10 6 9.10457 6 8C6 6.89543 5.10457 6 4 6C2.89543 6 2 6.89543 2 8C2 9.10457 2.89543 10 4 10Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M12 14.6666C13.1046 14.6666 14 13.7712 14 12.6666C14 11.5621 13.1046 10.6666 12 10.6666C10.8954 10.6666 10 11.5621 10 12.6666C10 13.7712 10.8954 14.6666 12 14.6666Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M5.72668 9.00665L10.28 11.66' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M10.2734 4.33997L5.72668 6.9933' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",oe="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M2 4H3.33333H14' stroke='%23737373' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M5.33334 3.99992V2.66659C5.33334 2.31296 5.47382 1.97382 5.72387 1.72378C5.97392 1.47373 6.31305 1.33325 6.66668 1.33325H9.33334C9.68697 1.33325 10.0261 1.47373 10.2762 1.72378C10.5262 1.97382 10.6667 2.31296 10.6667 2.66659V3.99992M12.6667 3.99992V13.3333C12.6667 13.6869 12.5262 14.026 12.2762 14.2761C12.0261 14.5261 11.687 14.6666 11.3333 14.6666H4.66668C4.31305 14.6666 3.97392 14.5261 3.72387 14.2761C3.47382 14.026 3.33334 13.6869 3.33334 13.3333V3.99992H12.6667Z' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M6.66666 7.33325V11.3333' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M9.33334 7.33325V11.3333' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const ne=({authorEmail:a,onDeletePost:n,shareUrl:i,post:r,className:d="",popoverClassName:u="",onBookmark:m,onRemoveBookmark:p,onEditPost:v})=>{const{data:{locale:g,userInfo:f,togetherUserId:h,env:{isMarryBaby:y}},action:{pushNotifications:C}}=t.useContext(s.TogetherComponentGlobalContext),{t:E}=o.useTranslations(),[w,k]=t.useState(!1),[P,T]=t.useState(!1),[S,x]=t.useState(!1),{authActionWrapper:N}=l.useTogetherAuthRequiredAction(),A=a&&(null==f?void 0:f.email)&&a===String(null==f?void 0:f.email);return b.default.createElement("div",{className:d,onClick:e=>{e.preventDefault(),e.stopPropagation()}},S&&b.default.createElement(l.SharePopup,{url:i,text:null==r?void 0:r.title,onClose:()=>x(!1)}),P&&b.default.createElement(D,{thumbnail:c.CommonGAssets.getAssetPath("trash-bin.svg"),isThumbnailIcon:!0,title:E("popup.deletePost.title"),description:E("popup.deletePost.description"),acceptText:E("popup.deletePost.accept"),cancelText:E("popup.deletePost.cancel"),onAccept:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if((null==r?void 0:r.id)&&!w){k(!0);try{const t=yield(({id:t,locale:a})=>e.__awaiter(void 0,void 0,void 0,(function*(){if(t)return yield s.callApiWithAuth(s.getApiPath(s.PATHS.POST.DELETE,{id:t,_locale:a}),"DELETE")})))({id:r.id,locale:g});1===(null==t?void 0:t.status)&&(null==n||n())}catch(e){}k(!1)}})),onClose:()=>T(!1)}),b.default.createElement(l.TreePopoverMenu,{className:u,toggleButtonContent:b.default.createElement("img",{src:y?Y:ae,loading:"lazy"}),position:"bottom",align:"end",buttonProps:{isLoading:w},data:A?{isShowheader:!1,type:"list",list:[{icon:le,label:E("morePopover.share"),onClick:()=>x(!0)},{icon:"data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M7.16952 3.2356H2.99484C2.6785 3.2356 2.37512 3.36126 2.15143 3.58495C1.92774 3.80863 1.80208 4.11202 1.80208 4.42836V12.7777C1.80208 13.094 1.92774 13.3974 2.15143 13.6211C2.37512 13.8448 2.6785 13.9705 2.99484 13.9705H11.3442C11.6605 13.9705 11.9639 13.8448 12.1876 13.6211C12.4113 13.3974 12.537 13.094 12.537 12.7777V8.60303' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M11.6425 2.341C11.8798 2.10375 12.2016 1.97046 12.5371 1.97046C12.8726 1.97046 13.1944 2.10375 13.4317 2.341C13.6689 2.57826 13.8022 2.90005 13.8022 3.23558C13.8022 3.57111 13.6689 3.89289 13.4317 4.13015L7.76607 9.79578L5.38054 10.3922L5.97692 8.00663L11.6425 2.341Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",label:E("actionPopover.edit"),onClick:v},{icon:oe,label:E("actionPopover.delete"),onClick:()=>{N((()=>T(!0)))}}]}:{isShowheader:!1,type:"list",list:[{icon:le,label:E("morePopover.share"),onClick:()=>x(!0)},{icon:(null==r?void 0:r.bookmarked)?ee:te,label:(null==r?void 0:r.bookmarked)?E("morePopover.unsavePost"):E("morePopover.savePost"),onClick:()=>{N((()=>e.__awaiter(void 0,void 0,void 0,(function*(){if((null==f?void 0:f.id)&&(null==r?void 0:r.id))if(null==r?void 0:r.bookmarked){const e=yield s.callApiWithAuth(s.getApiPath(s.PATHS.BOOKMARK.DELETE,{_locale:g}),"DELETE",{data:{post_id:String(r.id)}});1===(null==e?void 0:e.status)?(C({title:"",message:"Removed saved post",type:"success",displayIcon:te}),p&&p()):C({title:"",message:"Remove failed",type:"danger",displayIcon:te})}else{const e=yield s.callApiWithAuth(s.getApiPath(s.PATHS.BOOKMARK.CREATE,{_locale:g}),"POST",{data:{user_id:h||f.id,post_id:r.id}});1===(null==e?void 0:e.status)?(C({title:"",message:"Post saved",type:"success",displayIcon:ee}),m&&m()):C({title:"",message:"Post saved failed",type:"danger",displayIcon:te})}}))))}},{icon:U,label:E("morePopover.report"),subTree:{title:E("morePopover.report.title"),description:E("morePopover.report.description"),isShowheader:!0,type:"list",list:Object.keys(s.REPORT_REASON_MAP).map((e=>({label:s.REPORT_REASON_MAP[e].label,reason:s.REPORT_REASON_MAP[e].reportReasonText,reasonValue:e}))).map((e=>({label:E(e.label),subTree:{title:E("morePopover.reportSubmit.title"),description:E("morePopover.reportSubmit.description"),isShowheader:!0,type:"jsx",jsxRenderer:t=>b.default.createElement(H,{reason:e.reasonValue,reasonText:E(e.reason),postId:null==r?void 0:r.id,onClose:()=>t&&t(!1)})}})))}}]}}))};const ie=({onDeleteComment:a,commentId:n,className:i="",popoverClassName:r=""})=>{const{data:{env:{isMarryBaby:d},locale:c},action:{pushNotifications:u}}=t.useContext(s.TogetherComponentGlobalContext),{t:m}=o.useTranslations(),[p,v]=t.useState(!1),{authActionWrapper:g}=l.useTogetherAuthRequiredAction();return b.default.createElement("div",{className:i,onClick:e=>{e.preventDefault(),e.stopPropagation()}},p&&b.default.createElement(D,{thumbnail:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17' fill='none'%3e%3cg stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' clip-path='url(%23clip0)'%3e%3cpath d='M2 4.008h12M5.333 4.008V2.675a1.333 1.333 0 0 1 1.334-1.333h2.666a1.333 1.333 0 0 1 1.334 1.333v1.333m2 0v9.334a1.333 1.333 0 0 1-1.334 1.333H4.667a1.333 1.333 0 0 1-1.334-1.333V4.008h9.334ZM6.667 7.342v4M9.333 7.342v4'/%3e%3c/g%3e%3cdefs%3e%3cclipPath id='clip0'%3e%3cpath fill='white' d='M0 .008h16v16H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",isThumbnailIcon:!0,title:m("popup.deleteComment.title"),description:m("popup.deleteComment.description"),acceptText:m("popup.deletePost.accept"),cancelText:m("popup.deletePost.cancel"),onAccept:()=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;if(!n)return;const t=yield(({id:e,locale:t})=>s.callApiWithAuth(s.getApiPath(s.PATHS.COMMENT.DELETE,{_locale:t,id:e}),"DELETE"))({id:n,locale:c});1===(null==t?void 0:t.status)?(a&&a(),u({title:"",message:m("notification.success"),type:"success"})):u({title:"",message:(null===(e=null==t?void 0:t.messages)||void 0===e?void 0:e[0])||m("notification.failure"),type:"danger"})})),onClose:()=>v(!1)}),b.default.createElement(l.TreePopoverMenu,{position:"bottom",align:"end",data:{isShowheader:!1,type:"list",list:[{icon:oe,label:m("actionPopover.delete"),onClick:()=>{g((()=>{v(!0)}))}}]},className:r,toggleButtonContent:b.default.createElement("img",{src:d?Y:ae,loading:"lazy"}),buttonProps:{}}))};var re="-dzIuHr";const se=({userId:e,avatar:a,name:n,role:s,title:d,className:c})=>{const{t:u}=o.useTranslations(),[m,p]=t.useState(!1);return b.default.createElement(b.default.Fragment,null,b.default.createElement(C.Button,{className:`${re} ${c}`,color:"success",size:"xs",onClick:()=>p(!0),style:{padding:"5px 8px",marginBottom:"12px",borderRadius:"4px"}},b.default.createElement("span",{className:"text"},b.default.createElement(r.Icon.Endorse,{isSolid:!0,size:18,color:i.theme.colors.green800,className:"icon"}),u("cardReply.verifyBy",{name:`${n||""}`}))),b.default.createElement(l.ProfileDetailModal,{open:m,onClose:()=>p(!1),profileModalProps:{zIndex:1e3}},b.default.createElement(l.ProfileDetail,{authorProps:{userId:e,avatar:a,name:n,role:s,title:d},hideQuestionTab:!0})))};const de=({className:a,style:n,comment:i,type:r="comment",level:c=0,replyingId:u,onPostCommentSuccess:m,post:v,onDeleteComment:g,refetchComment:f,hasQuickBookingEnable:h,handleMakeAppointment:y,cardAuthorProps:E,maxChars:w=600,disableShortenContent:k})=>{var P,T,S,x,A,I,_,M,L,j,R,B,O;const{data:{locale:z,userInfo:D,env:{isMarryBaby:U}}}=t.useContext(s.TogetherComponentGlobalContext),{t:H}=o.useTranslations(),[q,W]=t.useState(i||null),{id:V,countLikes:$,content:Z,replies:Q=[],images:K=[],author:X,liked:J,link:Y,mentionedUser:ee,mentions:te}=q,{text:ae,replyingTo:le}=(e=>{try{const t=e.match(/\[@([^\]]+)\]/),a=t?t[0].replace("[@","").replace("]",""):"";return{text:e.replace(/\[@([^\]]+)\]/,"").trim(),replyingTo:a}}catch(e){}return{text:""}})(Z),{authActionWrapper:oe}=l.useTogetherAuthRequiredAction({_joinCommunityIds:[null===(P=null==v?void 0:v.community)||void 0===P?void 0:P.id],_joinTopicIds:null===(T=null==v?void 0:v.topics)||void 0===T?void 0:T.map((e=>e.id))}),[ne,re]=t.useState(4),ce=!!(null==D?void 0:D.id)&&(null==Q?void 0:Q.some((e=>e.author.id===D.id))),ue=e=>{W((t=>{if(!t.replies.find((t=>t.id===e.id))){t.replies.unshift(e);const a=Object.assign(Object.assign({},t),{replies:t.replies.slice(),countReplies:t.countReplies+1});return f&&f(a),a}return t}))},[me,pe]=t.useState(!1),ve=t.useMemo((()=>"comment"===r&&Q&&0!=Q.length?Q.sort(((e,t)=>{const a=new Date(e.createdAt).getTime(),l=new Date(t.createdAt).getTime();return a>l?-1:a<l?1:0})):Q),[r,Q]),ge=(null==Q?void 0:Q.length)||0,fe=String(null==X?void 0:X.email)&&(null==D?void 0:D.email)&&String(null==X?void 0:X.email)===String(null==D?void 0:D.email),he=(null==X?void 0:X.name)||(null==X?void 0:X.username)||"",ye=(null==X?void 0:X.username)||(null==X?void 0:X.name)||"",Ce=null==X?void 0:X.avatar,Ee=(null==v?void 0:v.isAnonymous)||null==X?void 0:X.role,we=[...(null==v?void 0:v.isAnonymous)?[{id:(null===(S=null==v?void 0:v.author)||void 0===S?void 0:S.id)||0,name:H("cardPost.anonymous")}]:[],...te||[]],[ke,be]=t.useState(null),[Pe,Te]=t.useState(null);t.useEffect((()=>{if(null==X?void 0:X.hospitalId){const t=t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield s.callApi(s.getCarePath(s.CARE_PATHS.GET_HOSPITAL_INFO,{hospital_branch_id:t,website_url:d.domainLocales[z]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.branch)&&be(null==a?void 0:a._data.branch)}));t(X.hospitalId)}if(null==X?void 0:X.doctorId){const t=t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield s.callApi(s.getCarePath(s.CARE_PATHS.GET_DOCTOR_INFO,{doctorId:t,website_url:d.domainLocales[z]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&Te(null==a?void 0:a._data.doctor)}));t(X.doctorId)}}),[X.hospitalId,X.doctorId]);const Se=(null==Pe?void 0:Pe.valid_outpatient)||(null==Pe?void 0:Pe.valid_telemedicine),xe=((null==ke?void 0:ke.total_available_service)||(null==ke?void 0:ke.total_available_doctor))>0,Ne=h&&(Se||xe),Ae="chatbot"===(null===(x=null==q?void 0:q.author)||void 0===x?void 0:x.type);return b.default.createElement(l.TogetherAuthConfigContextProvider,{defaultParams:{_joinCommunityIds:[null===(A=null==v?void 0:v.community)||void 0===A?void 0:A.id],_joinTopicIds:null===(I=null==v?void 0:v.topics)||void 0===I?void 0:I.map((e=>e.id))}},b.default.createElement(l.StyledCardPost,{className:a,style:n,"data-is-reply":!!c,"data-is-marrybaby":U,"data-has-booking":Ne},"reply"===r&&b.default.createElement(p.Divider,{className:"top-divider",type:"solid"}),b.default.createElement("div",{style:{padding:"16px 16px 0"}},b.default.createElement(l.CardAuthor,Object.assign({avatar:Ce,name:he,username:ye,timeText:null==v?void 0:v.createdTime,community:null==v?void 0:v.community,className:"post-author "+(fe?"with-popover":""),type:r,userId:null==X?void 0:X.id,role:Ee,expertId:null==X?void 0:X.partnerId,title:null==X?void 0:X.title,doctorId:null==X?void 0:X.doctorId,hospitalId:null==X?void 0:X.hospitalId,hasQuickBooking:Ne,handleMakeAppointment:y,isAnonymous:(null==q?void 0:q.isAnonymous)||Boolean(null==v?void 0:v.isAnonymous)&&(null===(_=null==v?void 0:v.author)||void 0===_?void 0:_.username)===(null==X?void 0:X.username),hideBackground:Ae,userType:null==X?void 0:X.type},E)),Boolean(null==q?void 0:q.isVerify)&&!Boolean(null==q?void 0:q.isOppose)&&b.default.createElement(se,{title:null===(M=null==q?void 0:q.userVerify)||void 0===M?void 0:M.title,name:null===(L=null==q?void 0:q.userVerify)||void 0===L?void 0:L.name,userId:null===(j=null==q?void 0:q.userVerify)||void 0===j?void 0:j.id,role:null===(R=null==q?void 0:q.userVerify)||void 0===R?void 0:R.role,avatar:null===(B=null==q?void 0:q.userVerify)||void 0===B?void 0:B.avatar,className:"verify-tag"})),b.default.createElement(l.PostContent,{className:"post-content-wrapper",replyingTo:le,mentionedUser:ee,description:ae,mentions:we,maxChars:w,disableShortenContent:k}),b.default.createElement("span",null),b.default.createElement("span",null),K&&K.length>0?b.default.createElement("div",{key:"image-preview",className:"image-preview-wrapper","data-is-reply":!0},b.default.createElement(G,{images:K,authorName:null==X?void 0:X.username})):null,K&&0!==K.length||!Y?null:b.default.createElement("div",{key:"link-preview",className:"link-preview-wrapper","data-is-reply":!0},b.default.createElement(N,{url:Y})),"most-engaging"!==r?b.default.createElement(b.default.Fragment,null,Ae&&b.default.createElement(l.StyledSourceList,{listUrl:null==q?void 0:q.source,categorySlug:null==q?void 0:q.categorySlug}),b.default.createElement(l.CardReactions,{type:l.CardReactionType.reply,loveCount:$,replyCount:ge,className:"post-reaction",liked:J,isReplied:ce,hideCommentIcon:"reply"===r||Ae,hasShare:!1,onCommentClick:()=>oe((()=>pe((e=>!e)))),onCommentCountClick:()=>oe((()=>{pe(!0)})),onLikeClick:()=>oe((()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(V){const t=yield(({commentId:t,setLike:a=!1,locale:l})=>e.__awaiter(void 0,void 0,void 0,(function*(){return s.callApiWithAuth(s.getApiPath(a?s.PATHS.COMMENT.LIKE:s.PATHS.COMMENT.UNLIKE,{_locale:l,id:t}),"GET")})))({commentId:V,setLike:!J,locale:z});1===t.status&&W((e=>Object.assign(Object.assign({},e),{liked:!J,countLikes:e.countLikes+(J?-1:1)})))}}))))}),me&&b.default.createElement(F,{replyingId:u||q.id,replyToName:he,isReply:!0,onClose:()=>pe(!1),onPostSuccess:e=>{"reply"===r?m&&m(e):ue(e)},post:v,replyingUser:X}),"comment"===r&&Q&&Q.length>0?b.default.createElement("div",{className:"comment-reply-wrapper"},null===(O=null==ve?void 0:ve.slice(0,ne))||void 0===O?void 0:O.map((e=>b.default.createElement(de,{key:e.id,comment:e,type:"reply",className:"comment-reply-item",level:c+1,replyingId:V,onPostCommentSuccess:ue,post:v,onDeleteComment:()=>{W((t=>Object.assign(Object.assign({},t),{replies:t.replies.filter((t=>t.id!==e.id)),countReplies:t.countReplies-1})))},handleMakeAppointment:y,hasQuickBookingEnable:h}))),ge>ne&&b.default.createElement(b.default.Fragment,null,b.default.createElement(p.Divider,{className:"top-divider",type:"solid"}),b.default.createElement(C.Button,{className:"more-cmt",size:"lg",color:"ghost",onClick:()=>re((e=>e+4))},H("comment.seeMoreReplies",{count:ge-ne}),b.default.createElement("img",{className:"chevron-right",src:"data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M6 12L10 8L6 4' stroke='%232D87F3' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",loading:"lazy"})))):null):null,fe&&b.default.createElement(ie,{onDeleteComment:g,className:"popover",commentId:q.id})))},ce=(t,a)=>e.__awaiter(void 0,void 0,void 0,(function*(){var e,l,o;const n=yield s.callApiWithOptionalAuth(s.getApiPath(s.PATHS.COMMENT.LIST,{postId:t,_locale:a,sort:"popularity",perPage:1,withoutReply:1}),"GET");return null===(o=null===(l=null===(e=null==n?void 0:n.data)||void 0===e?void 0:e.comments)||void 0===l?void 0:l.map(v.formatComment))||void 0===o?void 0:o[0]}));var ue=Object.freeze({__proto__:null});exports.CardLink=N,exports.CardPost=({className:a,style:n,hideViewMoreComment:i,showMostEngaging:r,onCommentClick:d,onCommentCountClick:c,onMostEngagingCommentClick:u,onPostCommentSuccess:m,disableCardLink:p,disableShortenContent:v,onDeletePost:g,onEditPost:f,post:h,mostEngagingComment:y,onDeleteComment:E,showInputComment:w,InlineCommentsComponent:k,hasQuickBookingEnable:T,handleMakeAppointment:S,cardAuthorProps:x})=>{const[_,M]=t.useState(h),[L,j]=t.useState(!1),[R,B]=t.useState(y),{community:O,topics:z,author:D,slug:U,isPin:H,liked:q,photos:W,mentions:V,title:$,description:Q,previewUrl:K,likesCount:X,commentsCount:J,id:Y,commented:ee}=_,{data:{locale:te,env:{isMarryBaby:ae,togetherBasePath:le}},action:{pushNotifications:oe}}=t.useContext(s.TogetherComponentGlobalContext),{t:ie}=o.useTranslations(),[re,se]=t.useState(w),ue=`${le}/${(null==O?void 0:O.slug)||"_"}/${U||""}`,me=`${s.getCurrentBaseUrl(te)}${ue}`,{authActionWrapper:pe}=l.useTogetherAuthRequiredAction((null==O?void 0:O.slug)?{_joinCommunityIds:[O.id],_joinTopicIds:null==z?void 0:z.map((e=>e.id))}:void 0),[ve,ge]=t.useState(!1);t.useEffect((()=>{se(w)}),[w]);const fe=(null==D?void 0:D.name)||(null==D?void 0:D.username)||"",he=(null==D?void 0:D.username)||(null==D?void 0:D.name)||"",ye=null==D?void 0:D.avatar,Ce=(null==_?void 0:_.isAnonymous)||null==D?void 0:D.role,[Ee,we]=t.useState(null),[ke,be]=t.useState(null);t.useEffect((()=>{if(null==D?void 0:D.hospitalId){(t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield s.callApi(s.getCarePath(s.CARE_PATHS.GET_HOSPITAL_INFO,{hospital_branch_id:t,website_url:s.domainLocales[te]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.branch)&&we(null==a?void 0:a._data.branch)})))(D.hospitalId)}if(null==D?void 0:D.doctorId){(t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield s.callApi(s.getCarePath(s.CARE_PATHS.GET_DOCTOR_INFO,{doctorId:t,website_url:s.domainLocales[te]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&be(null==a?void 0:a._data.doctor)})))(D.doctorId)}}),[D.hospitalId,D.doctorId]);const Pe=(null==ke?void 0:ke.valid_outpatient)||(null==ke?void 0:ke.valid_telemedicine),Te=((null==Ee?void 0:Ee.total_available_service)||(null==Ee?void 0:Ee.total_available_doctor))>0,Se=T&&(Pe||Te);t.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){if(Y&&J&&r&&!(null==y?void 0:y.id)){const e=yield ce(Y,te);B(e)}}))}),[Y,te,J,r,null==y?void 0:y.id]),t.useEffect((()=>{B(y)}),[null==y?void 0:y.id]);const xe=t=>e.__awaiter(void 0,void 0,void 0,(function*(){if(J>1&&(null==R?void 0:R.id)&&(null==R?void 0:R.id)===(null==t?void 0:t.id)){const e=yield ce(Y,te);B(e)}M((e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount-1}))),E&&E(t)}));return b.default.createElement(l.TogetherAuthConfigContextProvider,{defaultParams:(null==O?void 0:O.slug)?{_joinCommunityIds:[O.id],_joinTopicIds:null==z?void 0:z.map((e=>e.id))}:void 0},L&&b.default.createElement(l.SharePopup,{url:me,avatar:s.DEFAULT_IMG,text:$,onClose:()=>j(!1)}),b.default.createElement(l.StyledCardPost$1,{className:a,style:n,"data-is-marrybaby":ae},H?b.default.createElement(A,{className:"post-pin"}):null,b.default.createElement("div",{style:{position:"relative",padding:"1rem 1rem 0"}},b.default.createElement(l.CardAuthor,Object.assign({avatar:ye,name:fe,username:he,url:p?void 0:ue,community:O,timeText:null==_?void 0:_.createdTime,className:"post-author",role:Ce,userId:null==D?void 0:D.id,expertId:null==D?void 0:D.partnerId,doctorId:null==D?void 0:D.doctorId,hospitalId:null==D?void 0:D.hospitalId,title:null==D?void 0:D.title,hasQuickBooking:Se,handleMakeAppointment:S,"data-testid":"name",isAnonymous:!!(null==_?void 0:_.isAnonymous),extendEle:b.default.createElement(ne,{authorEmail:String(null==D?void 0:D.email),onDeletePost:g,shareUrl:me,post:_,className:"popover",onEditPost:f})},x))),b.default.createElement("a",{href:p?void 0:ue,className:"post-content-link-wrapper"},$&&b.default.createElement(s.Heading,{className:"post-content-title",as:"h2",tag:"h5",fontWeight:"bold","data-testid":"Title of the Post"},P.default($)),b.default.createElement(l.PostContent,{className:"post-content-wrapper",description:Q,disableShortenContent:v,mentions:V,"data-testid":"Content of the Post"})),b.default.createElement("span",null),b.default.createElement("span",null),b.default.createElement("div",{key:"tag-topic"},z&&z.length>0?b.default.createElement(l.TagTopic,{topics:z,className:"post-topics"}):null),b.default.createElement("div",{key:"social-preview"},(null==_?void 0:_.introUrl)?b.default.createElement("div",{className:"social-preview-wrapper "+((null==W?void 0:W.length)?"has-image":"")},b.default.createElement(Z,{url:_.introUrl,image:_.bannerImage})):null),b.default.createElement("div",{key:"image-preview"},(null==W?void 0:W.length)?b.default.createElement("div",{className:"image-preview-wrapper"},b.default.createElement(G,{images:W,authorName:null==D?void 0:D.name})):null),b.default.createElement("div",{key:"link-preview"},(null==_?void 0:_.introUrl)||(null==W?void 0:W.length)||!(null==K?void 0:K.url)?null:b.default.createElement("div",{className:"link-preview-wrapper"},b.default.createElement(N,{title:K.title,url:K.url,image:K.image}))),b.default.createElement(l.CardReactions,{isMarryBaby:ae,type:l.CardReactionType.post,loveCount:X,replyCount:J,className:"post-reaction "+((null==W?void 0:W.length)||(null==K?void 0:K.url)?"hide-top-border":""),liked:ve?!q:q,isReplied:ee,onCommentClick:()=>pe((()=>{d?d():se((e=>!e))})),onCommentCountClick:()=>{pe((()=>{ae?se(!0):c?c():!p&&(window.location.href=ue)}))},onShareClick:()=>{j(!0)},onLikeClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(Y&&!ve){ge(!0);try{const t=yield(({id:t,locale:a})=>e.__awaiter(void 0,void 0,void 0,(function*(){if(t)return yield s.callApiWithAuth(s.getApiPath(s.PATHS.POST.LIKE,{id:t,_locale:a}),"GET")})))({id:Y,locale:te});1!==(null==t?void 0:t.status)?oe(I(ie)):M((e=>Object.assign(Object.assign({},e),{likesCount:(e.likesCount||0)+(e.liked?-1:1),liked:!e.liked})))}catch(e){oe(I(ie))}ge(!1)}})),showingMostEngaging:!(!r||!(null==R?void 0:R.id))}),re&&b.default.createElement(F,{isMainCmt:!w,onClose:()=>se(!1),onPostSuccess:e=>{0!==J||(null==R?void 0:R.id)||B(e),M((e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount+1,commented:!0}))),m&&m(e)},post:_}),r&&(null==R?void 0:R.id)?b.default.createElement("div",{className:"most-engaging-wrapper",onClick:e=>{u?(e.stopPropagation(),u()):window.location.href=ue}},b.default.createElement(de,{hasQuickBookingEnable:T,handleMakeAppointment:S,comment:R,post:_,onDeleteComment:()=>{xe&&xe(R)},className:"most-engaging-comment",type:"most-engaging",key:R.id,cardAuthorProps:x}),J>1&&!i&&b.default.createElement(C.Button,{className:"see-more-comments",color:"ghost",size:"md"},ie("comment.seeMoreComments",{count:J-1}))):null,k))},exports.CardPostPopoverMore=ne,exports.CardReply=de,exports.CardReplyPopover=ie,exports.CreateNewPostContent=({className:n,style:d,onPostCreatedEdited:m,onClose:g,communities:f=[],forceSelectCommunity:h,forceSelectTopics:y,articleId:C,optionalTopic:E,editPostData:w,defaultCommunity:k,defaultTopics:T,noFetchTopic:S,hideTopicList:x,selectAskDoctor:N,showAskDoctorOptions:A,currentPageUrl:M})=>{const L=!!(null==w?void 0:w.id),{data:{locale:R,env:{isMarryBaby:z}},action:{pushNotifications:D,sanitizeFunction:F}}=t.useContext(s.TogetherComponentGlobalContext),{t:U}=o.useTranslations(),[H,q]=t.useState(!1),[W,V]=t.useState(N),[$,G]=t.useState(!1),[Z,Q]=t.useState(!1),[K,X]=t.useState(!1),[J,Y]=t.useState(""),[ee,te]=t.useState(""),[ae,le]=t.useState(h?{label:h.name,value:`${h.id||""}-${h.mappedCategoryId||""}`}:{label:U("community.choose"),value:""}),[oe,ne]=t.useState([...y]||[]),[ie,re]=t.useState([]),[se,de]=t.useState([]),ce=h||f.find((e=>`${e.id||""}-${e.mappedCategoryId||""}`===ae.value)),ue=h?[h]:f.filter((e=>e.isActive)).sort(((e,t)=>e.name>t.name?1:e.name<t.name?-1:0)),[me,pe]=t.useState(null),[ve,ge]=t.useState([]),fe=J&&!Z&&P.default(ee)&&(E||!E&&oe.length>0)&&ce&&(!ie||ie.length<=s.MAX_IMAGE_UPLOADS)&&!(null==ve?void 0:ve.length)&&!K;t.useEffect((()=>{if(w){const e=w;Y(e.title||""),te(l.decodeMention(l.decodePostUrl(e.description||"","edit"),e.mentions)),le({label:e.community.name,value:`${e.community.id||""}-${e.community.mappedCategoryId||""}`}),ne(e.topics||[]),re(e.photos||[]),q(!!e.isAnonymous||!1),V(!!e.isAskDoctor||!1)}else k&&le({label:k.name,value:`${k.id||""}-${k.mappedCategoryId||""}`}),T&&ne(T)}),[]),t.useEffect((()=>{Q(""!==J&&!/[a-zA-Z]/.test(J))}),[J]);const he=()=>e.__awaiter(void 0,void 0,void 0,(function*(){var t,a,o,n,i,r,d,c,p;if(A&&void 0===W)return G(!0),!1;const f=yield(({title:t,description:a,communityId:o,imageFiles:n,previewUrl:i,topicIds:r,locale:d,sanitizeFunction:c,categoryCommunityId:m,categoryTopicIds:p,introUrl:v,bannerUrl:g,scheduleTime:f,isAnonymous:h,isAskDoctor:y})=>e.__awaiter(void 0,void 0,void 0,(function*(){const e=new FormData,C=l.removeBannedWordWrapper(a),E=l.removeBannedWordWrapper(t),w=l.getMentionIdsFromString(C);if(e.append("title",E),e.append("description",l.encodePostContent(C,c)),m?e.append("category_community",String(m)):o&&e.append("community_id",String(o)),e.append("is_anonymous",h?"1":"0"),e.append("is_question",y?"1":"0"),(null==i?void 0:i.title)&&e.append("preview_title",i.title),(null==i?void 0:i.description)&&e.append("preview_description",i.description),(null==i?void 0:i.url)&&e.append("preview_link",u.safeEncodeURI(i.url)),(null==i?void 0:i.image)&&e.append("preview_image",u.safeEncodeURI(i.image)),null==r||r.forEach((t=>{e.append("topics[]",String(t||""))})),null==p||p.forEach((t=>{e.append("category_topics[]",String(t||""))})),null==n?void 0:n.length){const t=yield Promise.all(n.map(((e,t)=>new Promise((a=>{setTimeout((()=>{a(l.uploadAndGetSrc(e,d))}),2e3*t)})))));null==t||t.filter(Boolean).slice(0,s.MAX_IMAGE_UPLOADS).forEach(((t,a)=>{e.append(`images[${a}]`,t)}))}else e.append("images","");return null==w||w.forEach((t=>{e.append("mention_ids[]",t)})),e.append("intro_url",v||""),e.append("banner",g||""),f&&(e.append("post_type","scheduled"),e.append("schedule_datetime",f)),e})))({title:J,description:ee,communityId:String((null==ce?void 0:ce.id)||""),imageFiles:ie,previewUrl:me,topicIds:null==oe?void 0:oe.map((e=>String(e.id||""))).filter(Boolean),locale:R,sanitizeFunction:F,categoryCommunityId:String((null==ce?void 0:ce.mappedCategoryId)||""),categoryTopicIds:null==oe?void 0:oe.map((e=>String(e.mappedCategoryId||""))).filter(Boolean),isAnonymous:H?1:0,isAskDoctor:W?1:0});let h;C&&f.append("article_id",C),L?(null==w?void 0:w.id)&&(h=yield(({id:t,locale:a,formData:l})=>e.__awaiter(void 0,void 0,void 0,(function*(){return yield s.callApiWithAuth(s.getApiPath(s.PATHS.POST.UPDATE,{id:t,_locale:a}),"POST",{data:l})})))({id:w.id,formData:f,locale:R})):h=yield(({locale:t,formData:a,isArticleComment:l})=>e.__awaiter(void 0,void 0,void 0,(function*(){return yield s.callApiWithAuth(s.getApiPath(l?s.PATHS.POST.CREATE_ARTICLE_COMMENT:s.PATHS.POST.CREATE,{_locale:t}),"POST",{data:a})})))({formData:f,locale:R,isArticleComment:!(null==ce?void 0:ce.id)&&!!(null==ce?void 0:ce.mappedCategoryId)});const y=null==h?void 0:h.data;(null==y?void 0:y.id)&&!(null===(a=null===(t=null==h?void 0:h.messages)||void 0===t?void 0:t.moderation)||void 0===a?void 0:a.type)?(D({message:U("createPost.popup.success"),type:"success"}),(e=>{m&&m(v.formatPost(e),L),g&&g()})(y)):"banned"===(null===(n=null===(o=null==h?void 0:h.messages)||void 0===o?void 0:o.moderation)||void 0===n?void 0:n.type)?(D({title:U("notification.post.blocked.title"),message:U("notification.post.blocked.message"),type:"danger"}),h.messages.moderation.words&&de(h.messages.moderation.words)):"suspect"===(null===(r=null===(i=null==h?void 0:h.messages)||void 0===i?void 0:i.moderation)||void 0===r?void 0:r.type)?(D({title:U("notification.post.suspect.title"),message:U("notification.post.suspect.message"),type:"warning"}),g&&g()):(null===(c=null===(d=null==h?void 0:h.messages)||void 0===d?void 0:d.find)||void 0===c?void 0:c.call(d,(e=>{var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(D({message:U("notification.suspend.message"),type:"danger"}),g&&g()):D({message:(null===(p=null==h?void 0:h.messages)||void 0===p?void 0:p[0])||U("notification.failure"),type:"danger"})}));return b.default.createElement(l.StyledCreateNewPost,{className:n,style:d},b.default.createElement("div",{className:"input-group-container"},b.default.createElement(B,{className:"input-group",bannedWords:se,value:J,onChange:Y}),Z&&b.default.createElement(l.StyledError,null,b.default.createElement(r.Info,{isSolid:!0,color:i.theme.colors.red700,size:14}),b.default.createElement(s.Text,{size:"p3",as:"span",color:i.theme.colors.red700},U("createPost.popup.specialCharErr"))),b.default.createElement(j,{className:"input-group",bannedWords:se,value:ee,onChange:te,onPreviewUrlChange:pe,onInvalidUrlsChange:ge,onImageFilesChange:re,imageFiles:ie}),A&&b.default.createElement(l.StyledIsQuestion,{"data-is-marry-baby":z},b.default.createElement("div",{className:"switch-label"},b.default.createElement(r.Ask,{isMarryBaby:z,size:z?32:24,color:i.theme.colors.primaryBase,className:"label-icon"}),b.default.createElement("span",{className:"label-txt"},U("createPost.askDoctor"))),b.default.createElement(p.BtnChoice,{value:W,choices:[{label:U("createPost.askDoctorChoice.yes"),value:!0,dataEventCategory:"Together",dataEventAction:"Write Post Click - Ask Doctor",dataEventLabel:M},{label:U("createPost.askDoctorChoice.no"),value:!1}],onChange:e=>{"boolean"==typeof e&&(G(!1),V(e))}})),$&&b.default.createElement(l.StyledError,null,b.default.createElement(r.Info,{isSolid:!0,color:i.theme.colors.red700,size:14}),b.default.createElement(s.Text,{size:"p3",as:"span",color:i.theme.colors.red700},U("createPost.message.askDoctorRequire"))),b.default.createElement("div",{className:"input-group"},b.default.createElement(s.Text,{size:"p4",className:"input-group-label"},U("admin.community")),b.default.createElement(l.Dropdown,{options:(null==ue?void 0:ue.map((e=>({label:e.name,value:`${e.id||""}-${e.mappedCategoryId||""}`}))))||[],id:"community-picker",placeholder:U("community.choose"),value:ae,dropdownLabelTrackingAttributes:{"data-event-category":"Together","data-event-action":"Write Post Click - Choose Community/Topic","data-event-label":M},onChange:e=>{le({label:e.label,value:String(e.value)}),ne([])},disabled:!!h}),b.default.createElement(s.Text,{size:"sm",className:"warning",color:i.theme.colors.gray400},"* ",U("commentPopup.warning.newPost"))),!x&&b.default.createElement("div",{className:"input-group"},b.default.createElement(s.Text,{size:"p4",className:"input-group-label"},U("tab.topic")),b.default.createElement("div",{className:"input-notification"},b.default.createElement("img",{src:ce?"data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 14.5C11.3137 14.5 14 11.8137 14 8.5C14 5.18629 11.3137 2.5 8 2.5C4.68629 2.5 2 5.18629 2 8.5C2 11.8137 4.68629 14.5 8 14.5Z' fill='%232D87F3'/%3e%3cpath d='M8 5.5V8.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 11.5H8.00708' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e":_,loading:"lazy"}),b.default.createElement(s.Text,{size:"base",color:i.theme.colors.gray500},U(ce?"createPost.popup.primary":"createPost.popup.warning"))),ce&&b.default.createElement(O,{className:"tag-list",communityId:ce.id,forceTopics:y,onChange:ne,selectedTopics:oe,noFetch:S,dataEventCategory:"Together",dataEventAction:"Write Post Click - Choose Community/Topic",dataEventLabel:M}))),b.default.createElement("div",{className:"form-action"},b.default.createElement("div",{className:"input-group"},b.default.createElement(a.Checkbox,{className:"swich-input-group",labelPosition:"left",name:"PostAnonymous",checked:H,color:z?"pink":void 0,"data-event-category":"Together","data-event-action":"Write Post Click - Incognito","data-event-label":M,label:b.default.createElement("div",{className:"switch-label"},b.default.createElement("img",{className:"label-icon",src:c.CommonGAssets.getAssetPath("anomyous-avatar.svg"),alt:"anomyous avatar",style:{marginRight:"10px",width:"24px"},loading:"lazy"}),b.default.createElement("span",{className:"label-txt"},U("createPost.postAnonymous"))),value:"Post Anonymous",onChange:e=>q(e.currentTarget.checked),styles:{body:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},label:{display:"flex",alignItems:"center"}}})),b.default.createElement("div",{className:"input-group"},b.default.createElement(s.Button,{className:"submit-btn pointer-event-child-none",size:"lg","data-event-category":"Ask Doctor","data-event-action":"Submit Question","data-event-label":window.location.href,onClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(fe&&!K){X(!0);try{yield he()}catch(e){console.error(e),D(I(U))}X(!1)}})),disabled:!fe,loading:K},U("createPost.popup.submit")))))},exports.CreatePostDescription=j,exports.CreatePostTitle=B,exports.ImagePreviewPopup=q,exports.InputCommentBar=F,exports.LabelPin=A,exports.PopupDanger=D,exports.PostImagePreview=G,exports.PostSingleImageViewPopup=V,exports.SkipQuestionOfExpertBtn=l=>{var{post:n,onSkip:i,btnText:d,currentPageUrl:c}=l,u=e.__rest(l,["post","onSkip","btnText","currentPageUrl"]);const{t:m}=o.useTranslations(),{data:{locale:p},action:{pushNotifications:v}}=t.useContext(s.TogetherComponentGlobalContext),[g,f]=t.useState(!1),[h,y]=t.useState(!1),C=a.useMantineTheme(),E=t.useCallback((()=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;y(!0);const t=yield s.callApiWithAuth(s.getApiPath(s.PATHS.USER.SKIP_QUESTION,{_locale:p,id:null==n?void 0:n.id}),"PUT");1===(null==t?void 0:t.status)?(null==i||i({id:(null==n?void 0:n.id)||"",communityId:(null===(e=null==n?void 0:n.community)||void 0===e?void 0:e.id)||""}),f(!1),v({title:"",message:"Skip success",type:"success"})):v({title:"",message:null==t?void 0:t.messages,type:"danger"}),y(!1)}))),[]);return b.default.createElement(a.Popover,{width:327,withArrow:!0,shadow:"md",opened:g},b.default.createElement(a.Popover.Target,null,b.default.createElement("div",Object.assign({className:`${Q} ${(null==u?void 0:u.className)||""}`,onClick:()=>f(!0)},u),d||m("profilePanel.questionNotClear"))),b.default.createElement(a.Popover.Dropdown,null,b.default.createElement("div",null,b.default.createElement("div",{className:K},m("profilePanel.skipQuestion.heading")),b.default.createElement("div",{className:X},m("profilePanel.skipQuestion.content")),b.default.createElement("div",{className:J},b.default.createElement(s.Button,{size:"md",variant:"secondary",leftIcon:b.default.createElement(r.Close,{color:C.fn.primaryColor(),size:24}),onClick:()=>f(!1),styles:()=>({leftIcon:{marginRight:0}})}),b.default.createElement(s.Button,{variant:"primary",size:"md",leftIcon:b.default.createElement(r.Check,{color:"white",size:24}),onClick:E,loading:h,"data-event-category":"Together","data-event-action":"Unclear Question Click","data-event-label":c,styles:()=>({leftIcon:{marginRight:0}})})))))},exports.SocialLinkPreview=Z,exports.SubmitReportForm=H,exports.TopicSelectList=O,exports.VerifiedTag=se,exports.types=ue;
|
package/build/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./Onboarding-
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./Onboarding-2b01db17.js");Object.defineProperty(exports,"BabyGrowthChartDuration",{enumerable:!0,get:function(){return e.BabyGrowthChartDuration}}),Object.defineProperty(exports,"BabyGrowthChartType",{enumerable:!0,get:function(){return e.BabyGrowthChartType}}),Object.defineProperty(exports,"BabyGrowthResultTab",{enumerable:!0,get:function(){return e.BabyGrowthResultTab}}),Object.defineProperty(exports,"Gender",{enumerable:!0,get:function(){return e.Gender}}),Object.defineProperty(exports,"LOCALE",{enumerable:!0,get:function(){return e.LOCALE}}),Object.defineProperty(exports,"OnboardingStep",{enumerable:!0,get:function(){return e.OnboardingStep}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react"),a=require("./Onboarding-
|
|
1
|
+
"use strict";var e=require("react"),a=require("./Onboarding-2b01db17.js"),n=require("./useTranslations-2e7d64aa.js");const t={"vi-VN":"mang-thai","id-ID":"kehamilan","ms-MY":"kehamilan","km-KH":"ពពោះ","en-PH":"pregnancy","tl-PH":"pregnancy","th-TH":"การตั้งครรภ์","my-MM":"pregnancy","zh-TW":"pregnancy","hi-IN":"pregnancy"},b={[a.LOCALE.Vietnam]:{sexualWellness:"suc-khoe-tinh-duc",health:"suc-khoe",healthyEating:"an-uong-lanh-manh",skinHealth:"da-lieu",healthyHabit:"thoi-quen-lanh-manh",drug:"thuoc",womensHealth:"suc-khoe-phu-nu",fitness:"the-duc-the-thao",pregnancy:"mang-thai",parenting:"nuoi-day-con",diabetes:"tieu-duong-dai-thao-duong",healthyMind:"tam-ly-tam-than"},[a.LOCALE.Indonesia]:{pregnancy:"kehamilan",parenting:"parenting",health:"sehat",diabetes:"diabetes",womensHealth:"wanita",drug:"obat-suplemen",sexualWellness:"",healthyEating:"",skinHealth:""},[a.LOCALE.Malaysia]:{pregnancy:"kehamilan",parenting:"keibubapaan",health:"kesihatan",diabetes:"kencing-manis",womensHealth:"kesihatan-wanita",drug:"ubat",sexualWellness:"",healthyEating:"",skinHealth:""},[a.LOCALE.Cambodia]:{pregnancy:"%e1%9e%96%e1%9e%96%e1%9f%84%e1%9f%87",parenting:"%e1%9e%85%e1%9e%b7%e1%9e%89%e1%9f%92%e1%9e%85%e1%9e%b9%e1%9e%98%e1%9e%80%e1%9e%bc%e1%9e%93",health:"%e1%9e%9f%e1%9e%bb%e1%9e%81%e1%9e%97%e1%9e%b6%e1%9e%96%e1%9e%91%e1%9e%bc%e1%9e%91%e1%9f%85",diabetes:"%e1%9e%87%e1%9f%86%e1%9e%84%e1%9e%ba%e1%9e%91%e1%9e%b9%e1%9e%80%e1%9e%93%e1%9f%84%e1%9e%98%e1%9e%95%e1%9f%92%e1%9e%a2%e1%9f%82%e1%9e%98",womensHealth:"%e1%9e%9f%e1%9e%bb%e1%9e%81%e1%9e%97%e1%9e%b6%e1%9e%96%e1%9e%9f%e1%9f%92%e1%9e%8f%e1%9f%92%e1%9e%9a%e1%9e%b8",drug:"%e1%9e%b1%e1%9e%9f%e1%9e%90%e1%9e%93%e1%9e%b7%e1%9e%84%e1%9e%a2%e1%9e%b6%e1%9e%a0%e1%9e%b6%e1%9e%9a%e1%9e%94%e1%9f%86%e1%9e%94%e1%9f%89%e1%9e%93",sexualWellness:"",healthyEating:"",skinHealth:""},[a.LOCALE.PhilippinesEnglish]:{pregnancy:"pregnancy",parenting:"parenting",health:"health",diabetes:"diabetes",womensHealth:"womens-health",drug:"drugs-supplements",sexualWellness:"",healthyEating:"",skinHealth:""},[a.LOCALE.PhilippinesTagalog]:{pregnancy:"pagbubuntis",parenting:"pagiging-magulang",health:"kalusugan",diabetes:"diabetes-fil",womensHealth:"kalusugan-kababaihan",drug:"drugs-at-supplements",sexualWellness:"",healthyEating:"",skinHealth:""},[a.LOCALE.Thailand]:{pregnancy:"%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%95%e0%b8%b1%e0%b9%89%e0%b8%87%e0%b8%84%e0%b8%a3%e0%b8%a3%e0%b8%a0%e0%b9%8c",parenting:"%e0%b8%9e%e0%b9%88%e0%b8%ad%e0%b9%81%e0%b8%a1%e0%b9%88%e0%b9%80%e0%b8%a5%e0%b8%b5%e0%b9%89%e0%b8%a2%e0%b8%87%e0%b8%a5%e0%b8%b9%e0%b8%81",health:"%e0%b8%aa%e0%b8%b8%e0%b8%82%e0%b8%a0%e0%b8%b2%e0%b8%9e",diabetes:"%e0%b9%82%e0%b8%a3%e0%b8%84%e0%b9%80%e0%b8%9a%e0%b8%b2%e0%b8%ab%e0%b8%a7%e0%b8%b2%e0%b8%99",womensHealth:"%e0%b8%aa%e0%b8%b8%e0%b8%82%e0%b8%a0%e0%b8%b2%e0%b8%9e%e0%b8%ab%e0%b8%8d%e0%b8%b4%e0%b8%87",drug:"%e0%b8%a2%e0%b8%b2%e0%b9%81%e0%b8%a5%e0%b8%b0%e0%b8%ad%e0%b8%b2%e0%b8%ab%e0%b8%b2%e0%b8%a3%e0%b9%80%e0%b8%aa%e0%b8%a3%e0%b8%b4%e0%b8%a1",sexualWellness:"",healthyEating:"",skinHealth:""},[a.LOCALE.Myanmar]:{pregnancy:"pregnancy",parenting:"parenting",health:"health",diabetes:"diabetes",womensHealth:"womens-health",drug:"drugs-az",sexualWellness:"",healthyEating:"",skinHealth:""},[a.LOCALE.Taiwan]:{pregnancy:"pregnancy",parenting:"parenting",health:"health",diabetes:"diabetes",womensHealth:"womens-health",drug:"drugs-supplement",sexualWellness:"",healthyEating:"",skinHealth:""},[a.LOCALE.India]:{pregnancy:"pregnancy",parenting:"parenting",health:"health",diabetes:"diabetes",womensHealth:"womens-health",diabetesEn:"en-diabetes",drug:"dawaai",sexualWellness:"",healthyEating:"",skinHealth:""}};exports.MAPPED_CATEGORY_SLUGS=b,exports.PREGNANCY_SLUG=t,exports.useCategory=a=>{const{locale:s}=n.useTranslations();return{isPregnancy:e.useMemo((()=>decodeURI(a.replace(/\//gi,"")).includes(t[s])),[]),isParenting:e.useMemo((()=>{var e;return decodeURI(a.replace(/\//gi,"")).includes(null===(e=b[s])||void 0===e?void 0:e.parenting)}),[]),type:e.useMemo((()=>function(e,a){const n=e.split("/");for(const e in a){const t=a[e];if(n.includes(t))return e}return null}(a,b[s])),[a,s])}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./tslib.es6-
|
|
1
|
+
"use strict";var e=require("./tslib.es6-0d31715f.js"),t=require("react"),o=require("./getDynamicHealthTool-571597e0.js");exports.useHealthToolsCache=a=>{const[i,l]=t.useState([]);t.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){const e=yield o.getDynamicHealthToolWithCache(a);l(e)}))}),[o.getDynamicHealthToolWithCache,a]);const r=t.useCallback((e=>{var t;return(null===(t=i.find((t=>t.template===e)))||void 0===t?void 0:t.link)||""}),[i]);return{allTools:i,getHealthToolLink:r}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./tslib.es6-
|
|
1
|
+
"use strict";var e=require("./tslib.es6-0d31715f.js"),t=require("react"),r=require("./cookieHelper-47e34efa.js"),n=require("./useUniqueId-86a9e1d4.js");function i(e){const t=(new TextEncoder).encode(e.trim().toLowerCase());return crypto.subtle.digest("SHA-256",t).then((e=>Array.from(new Uint8Array(e)).map((e=>e.toString(16).padStart(2,"0"))).join("")))}exports.useFbDataLayer=n=>{const a=t.useRef("");t.useEffect((()=>(e.__awaiter(void 0,void 0,void 0,(function*(){var e,t,o,u,l;if(!a.current){let e=yield fetch("https://api.ipify.org").then((e=>e.text()));e||(e=yield fetch("https://icanhazip.com").then((e=>e.text()))),a.current=e}if(null===(t=null===(e=window.localStorage)||void 0===e?void 0:e.setItem)||void 0===t||t.call(e,"fbClientIp",JSON.stringify({client_ip_address:(null===(o=a.current)||void 0===o?void 0:o.replace("\n",""))||"",client_user_agent:navigator.userAgent||""})),null==n?void 0:n.id){const[e,t,a,o,s,c]=yield Promise.all([n.email?i(n.email):null,n.phone?i(n.phone):null,n.birthday?i(n.birthday.split("-").join("")):null,n.gender?"m":"f",n.city_name?i(n.city_name).then((e=>e.replace(/\s/g,""))):null,n.name?i(n.name):null]);r.getCookie("_fbc"),r.getCookie("_fbp");const d={user_id:n.id};c&&(d.fn=c),e&&(d.em=e),t&&(d.ph=t),a&&(d.db=a),s&&(d.ct=s),null===(l=null===(u=window.localStorage)||void 0===u?void 0:u.setItem)||void 0===l||l.call(u,"fbDataLayer_userInfo",JSON.stringify(d))}})),()=>{})),[n])},exports.usePrevious=e=>{const r=t.useRef(),i=t.useRef(e);return n.useInitialMount()||i.current===e||(r.current=i.current,i.current=e),r.current},exports.useRafState=e=>{const[r,n]=t.useState(e),i=t.useRef(0),a=t.useCallback((e=>{cancelAnimationFrame(i.current),i.current=requestAnimationFrame((()=>{n(e)}))}),[]);return t.useEffect((()=>()=>cancelAnimationFrame(i.current))),[r,a]};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react"),t=require("./translationsContext-
|
|
1
|
+
"use strict";var e=require("react"),t=require("./translationsContext-f962ff63.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=a(require("string-format"));exports.useTranslations=function(){const{values:a,locale:o}=e.useContext(t.TranslationsContext)||{locale:"en-PH"};return e.useMemo((()=>({t:(e,t)=>a?a[e]?t?n.default(a[e]||e,t):a[e]||e:(console.warn(`[useTranslations] Missing translation for key ${e} and locale ${o}`),t?n.default(e,t):e):(console.error("[useTranslations] t method called before translation values are loaded"),e),locale:o})),[a,o])};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var i=require("./Onboarding-2b01db17.js");const a={[i.LOCALE.Vietnam]:"VN",[i.LOCALE.Cambodia]:"KH",[i.LOCALE.Indonesia]:"ID",[i.LOCALE.Malaysia]:"MY",[i.LOCALE.PhilippinesEnglish]:"PH",[i.LOCALE.PhilippinesTagalog]:"PH",[i.LOCALE.Taiwan]:"TW",[i.LOCALE.Thailand]:"TH",[i.LOCALE.Myanmar]:"MM"};exports.MAPPED_LOCALE=a,exports.hiddenEmailChar=(i="")=>{const a=i.indexOf("@"),n=i.substring(0,a),L=n.length>3?3:n.length;return i.replace(i.substring(L,a),i.slice(L,a).replace(/./g,"x"))};
|
package/build/vaccination.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./tslib.es6-
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./tslib.es6-0d31715f.js"),t=require("react"),a=require("@mantine/core"),l=require("./index.styles-9285e23d.js");require("@mantine/dates"),require("./index-a89b23de.js");var n=require("./Onboarding-2b01db17.js");require("./gAssets.js");var r=require("dayjs"),i=require("./screenSizeContext-4d5786c6.js"),o=require("styled-components"),c=require("./theme-1a7c14fb.js");require("./isProduction-e1b7813f.js");var s=require("./useTranslations-2e7d64aa.js");require("./index-dad94e78.js");var d=require("@mantine/hooks");require("lodash/debounce"),require("./useCategory-971481b4.js");var u=require("./index-4046269f.js");require("./translationsContext-f962ff63.js"),require("string-format");var m=require("./index-5b7dfda4.js"),f=require("./index-f36821a3.js"),C=require("@mantine/form"),p=require("dayjs/plugin/customParseFormat"),g=require("./index-2db33f49.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("./index-e022af07.js"),require("react-keyed-flatten-children"),require("@mantine/carousel"),require("./useUniqueId-86a9e1d4.js"),require("./cookieHelper-47e34efa.js"),require("slugify"),require("date-fns/locale"),require("lodash/throttle");var b=h(t),E=h(r),x=h(o),v=h(p);const y=x.default.div`
|
|
2
2
|
position: relative;
|
|
3
3
|
padding: 16px;
|
|
4
4
|
min-height: 110px;
|
package/package.json
CHANGED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ContainerProps } from '@mantine/core';
|
|
3
|
-
import { PremiumNewsletterBannerContextType } from './context';
|
|
4
|
-
import { BannerCategory } from './types';
|
|
5
|
-
export type Props = {
|
|
6
|
-
Wrapper?: React.FC<any>;
|
|
7
|
-
setShouldAcquisitionModalOpen?: () => void;
|
|
8
|
-
} & Omit<PremiumNewsletterBannerContextType, 'acquisitionInfo' | 'isLoggedIn'> & ContainerProps;
|
|
9
|
-
export declare const MAPPING_CATEGORY_PREMIUM_TYPE: {
|
|
10
|
-
[key in string]: BannerCategory;
|
|
11
|
-
};
|
|
12
|
-
export declare const MAPPING_CATEGORY_PREMIUM_API_TYPE: {
|
|
13
|
-
[key in BannerCategory]: string;
|
|
14
|
-
};
|
|
15
|
-
export declare const PremiumNewsletterBanner: ({ type: typeProp, articleId, categoryIds, isMarketing, isABTestingType, hasPremiumBanner, currentUrl, isMobile, subcribeHealthStatus, setShouldAcquisitionModalOpen, onChange, source, state: stateProp, Wrapper, ...rest }: Props) => React.JSX.Element;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ContainerProps } from '@mantine/core';
|
|
3
|
-
import { PremiumNewsletterBannerContextType } from './context';
|
|
4
|
-
import { BannerCategory } from './types';
|
|
5
|
-
export type Props = {
|
|
6
|
-
Wrapper?: React.FC<any>;
|
|
7
|
-
setShouldAcquisitionModalOpen?: () => void;
|
|
8
|
-
} & Omit<PremiumNewsletterBannerContextType, 'acquisitionInfo' | 'isLoggedIn'> & ContainerProps;
|
|
9
|
-
export declare const MAPPING_CATEGORY_PREMIUM_TYPE: {
|
|
10
|
-
[key in string]: BannerCategory;
|
|
11
|
-
};
|
|
12
|
-
export declare const MAPPING_CATEGORY_PREMIUM_API_TYPE: {
|
|
13
|
-
[key in BannerCategory]: string;
|
|
14
|
-
};
|
|
15
|
-
export declare const PremiumNewsletterBanner: ({ type: typeProp, articleId, categoryIds, isMarketing, isABTestingType, hasPremiumBanner, currentUrl, isMobile, subcribeHealthStatus, setShouldAcquisitionModalOpen, onChange, source, state: stateProp, Wrapper, ...rest }: Props) => React.JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e}from"./tslib.es6-6c588ee6.js";import t from"react";import{S as s,a}from"./index-dbfe0a73.js";const r=a=>{var{type:r,color:o,style:l}=a,c=e(a,["type","color","style"]);return t.createElement(s,Object.assign({type:r,"data-type":{h1:"headline-1",h2:"headline-2",h3:"headline-3",h4:"headline-4"}[r],style:Object.assign(Object.assign({},o&&{"--text-color":o}),l)},c))},o=s=>{var{type:r,color:o,style:l}=s,c=e(s,["type","color","style"]);return t.createElement(a,Object.assign({"data-type":r,style:Object.assign(Object.assign({},l),o&&{"--text-color":o})},c))};export{o as M,r as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as o}from"./tslib.es6-6c588ee6.js";import t from"react";import{Indicator as e}from"@mantine/core";import"dayjs";import"./screenSizeContext-10db56d9.js";import"styled-components";import{t as s}from"./theme-a4e9bb74.js";import"./index-ab6ab4f8.js";import"./isProduction-ed4525be.js";import"./Onboarding-8386c62c.js";import"./gAssets.js";const r=r=>{var{styles:i,color:n=s.colors.red700}=r,a=o(r,["styles","color"]);return t.createElement(e,Object.assign({inline:!0,position:"top-end",offset:4,styles:Object.assign({processing:{animationDirection:"alternate"}},i),color:n},a))};export{r as I};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e,{useState as t,useRef as o,useEffect as d}from"react";import{u as a}from"./useScrollbarSize-71b41011.js";import{createPortal as l}from"react-dom";import{S as c,a as n,b as r}from"./index-0816b158.js";const s="hhg-modals",m=()=>{document.querySelectorAll('.hhg-modal[data-open="true"]').length<1&&document.body.classList.remove("hhc-modal-show")},i=()=>{document.querySelectorAll('.hhg-modal[data-open="true"]').length<1&&(document.body.style.overflow="",document.body.style.paddingRight="",document.body.classList.remove("hhc-disabled-scroll"))},h=({type:h="lead",closeIcon:u,isOpen:p=!0,onClose:y,children:b,className:g="",animationType:v="slideTop",isStaticBackdrop:_=!1,siteType:f})=>{const[E,w]=t(!1),C=o(null),{width:N}=a();if(!C.current&&E&&(C.current=document.createElement("div")),d((()=>(w(!0),()=>{w(!1),m(),i()})),[]),d((()=>{if(E){const e=(()=>{let e=document.getElementById(s);return e||(e=document.createElement("div"),e.setAttribute("id",s),document.body.append(e)),e})();return e.appendChild(C.current),()=>{e.removeChild(C.current)}}}),[E]),d((()=>{p?document.body.classList.add("hhc-modal-show"):m()}),[p]),d((()=>{p?(document.body.style.overflow="hidden",document.body.style.paddingRight=N+"px",document.body.classList.add("hhc-disabled-scroll")):i()}),[p,N]),!E)return null;const S=["hhg-modal__wrapper",g,v].filter((e=>e)).join(" ");return l(e.createElement(c,{className:S,"data-open":p,"data-type":h},!_&&e.createElement(n,{"data-open":p,onClick:y,"data-type":h}),!_&&"video"===h&&!!u&&e.createElement("div",{className:"hhg-modal__close",onClick:y},u),e.createElement(r,{className:"hhg-modal","data-open":p,"data-site-type":f},e.createElement("div",{className:"video"===h?"hhg-modal__video":"hhg-modal__content"},!!u&&"video"!==h&&e.createElement("div",{className:"hhg-modal__close",onClick:y},u),b))),C.current)};export{h as M};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as o}from"./tslib.es6-6c588ee6.js";import{useState as t,useEffect as i,useCallback as e}from"react";import{a as l}from"./getDynamicHealthTool-69405709.js";const n=n=>{const[r,a]=t([]);i((()=>{o(void 0,void 0,void 0,(function*(){const o=yield l(n);a(o)}))}),[l,n]);const s=e((o=>{var t;return(null===(t=r.find((t=>t.template===o)))||void 0===t?void 0:t.link)||""}),[r]);return{allTools:r,getHealthToolLink:s}};export{n as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useContext as o,useMemo as a}from"react";import{T as r}from"./translationsContext-3b169438.js";import e from"string-format";function t(){const{values:t,locale:n}=o(r)||{locale:"en-PH"};return a((()=>({t:(o,a)=>t?t[o]?a?e(t[o]||o,a):t[o]||o:(console.warn(`[useTranslations] Missing translation for key ${o} and locale ${n}`),a?e(o,a):o):(console.error("[useTranslations] t method called before translation values are loaded"),o),locale:n})),[t,n])}export{t as u};
|
package/build/index-7109c879.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("./tslib.es6-23138875.js"),t=require("react"),s=require("@mantine/core"),r=require("./index.styles-dcdcb15d.js");require("@mantine/dates");var a=require("./index-56ad1186.js"),i=require("./Onboarding-eda97622.js");require("./gAssets.js"),require("dayjs"),require("./screenSizeContext-d3822141.js"),require("styled-components"),require("./theme-95cd4c16.js"),require("./isProduction-6603c122.js");var n=require("./useTranslations-e52e6fd2.js");require("./index-9f431a0f.js"),require("@mantine/hooks"),require("lodash/debounce"),require("./useCategory-4968c4d0.js");var c=require("./utils-b44511dc.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=d(t);const o={provinceByName:{},provinces:[],districts:[],wards:[],selectedProvince:"",selectedDistrict:"",selectedWard:""},u=(e,t)=>{switch(t.type){case"SET_DATA":return Object.assign(Object.assign({},e),t.payload);case"SET_DISTRICTS":return Object.assign(Object.assign({},e),{districts:t.payload});case"SET_WARDS":return Object.assign(Object.assign({},e),{wards:t.payload});case"SELECT_PROVINCE":return Object.assign(Object.assign({},e),{selectedProvince:t.payload,selectedDistrict:"",selectedWard:""});case"SELECT_DISTRICT":return Object.assign(Object.assign({},e),{selectedDistrict:t.payload,selectedWard:""});case"SELECT_WARD":return Object.assign(Object.assign({},e),{selectedWard:t.payload});default:return e}},p=({provinces:s})=>{const[r,n]=t.useReducer(u,o),{provinceByName:d,provinces:l,districts:p,wards:v,selectedProvince:y,selectedDistrict:E,selectedWard:h}=r,[b,j]=t.useState();t.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){var e,t,r,d;try{const l=yield fetch((d=process.env.UNIFY_LOCALE||i.LOCALE.Vietnam,`${a.CDN_ADDRESS}/cities-data-${c.MAPPED_LOCALE[d]}.json`)).then((e=>e.json()));j(l);const{list:o}=l,u=s?((e,t)=>{const s={};for(const[,e]of Object.entries(t)){const{id:t}=e;t&&(s[t]=e)}const r={};return e.map((e=>{r[e.name]=s[e.id]})),r})(s,o):o,p=Object.keys(u),v=Object.keys((null===(e=o[p[0]])||void 0===e?void 0:e.list)||{}),y=Object.keys((null===(r=null===(t=o[p[0]])||void 0===t?void 0:t[v[0]])||void 0===r?void 0:r.list)||{});n({type:"SET_DATA",payload:{provinceByName:u,provinces:p,districts:v,wards:y}})}catch(e){console.error("Error fetching address data:",e)}}))}),[process.env.UNIFY_LOCALE]);return{provinces:l,districts:p,wards:v,selectedProvince:y,selectedDistrict:E,selectedWard:h,handleProvinceChange:e=>{var t;const s=Object.keys((null===(t=d[e])||void 0===t?void 0:t.list)||{});n({type:"SET_DISTRICTS",payload:s}),n({type:"SET_WARDS",payload:[]}),n({type:"SELECT_PROVINCE",payload:e})},handleDistrictChange:e=>{var t,s;const r=Object.keys((null===(s=null===(t=d[y])||void 0===t?void 0:t.list[e])||void 0===s?void 0:s.list)||{});n({type:"SET_WARDS",payload:r}),n({type:"SELECT_DISTRICT",payload:e})},handleWardChange:e=>{n({type:"SELECT_WARD",payload:e})}}};exports.AddressInput=a=>{var{error:i,provinces:c,placeholder:d}=a,o=e.__rest(a,["error","provinces","placeholder"]);const{t:u}=n.useTranslations(),{provinces:v,districts:y,wards:E,selectedProvince:h,selectedDistrict:b,selectedWard:j,handleProvinceChange:g,handleDistrictChange:C,handleWardChange:S}=p({provinces:c}),[O,f]=t.useState("");return t.useEffect((()=>{h&&b&&j&&O?o.onChange({selectedProvince:h,selectedDistrict:b,selectedWard:j,extraInfo:O}):o.onChange(null)}),[h,b,j,O]),l.default.createElement(r.Input.Wrapper,Object.assign({withAsterisk:!0},o),l.default.createElement(s.Stack,null,l.default.createElement(r.Select,{placeholder:(null==d?void 0:d.province)||u("onboarding.similac.input.city"),data:c?v:v.sort(),searchable:!0,onChange:g,value:h}),l.default.createElement(r.Select,{placeholder:(null==d?void 0:d.district)||u("onboarding.similac.input.district"),data:y.sort(),searchable:!0,onChange:C,value:b,disabled:!h}),l.default.createElement(r.Select,{placeholder:(null==d?void 0:d.ward)||u("onboarding.similac.input.ward"),searchable:!0,data:E.sort(),value:j,onChange:S,disabled:!h||!b}),l.default.createElement(r.Input,{placeholder:(null==d?void 0:d.address)||u("onboarding.similac.input.no"),disabled:!h||!b||!j,value:O,onChange:f,style:{marginBottom:0}})),l.default.createElement(s.Input.Error,{size:"md"},i))};
|
package/build/index-7af60d34.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("./tslib.es6-23138875.js"),r=require("react"),t=require("@mantine/core");require("dayjs"),require("./screenSizeContext-d3822141.js"),require("styled-components");var s=require("./theme-95cd4c16.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("./index-56ad1186.js"),require("./isProduction-6603c122.js"),require("./Onboarding-eda97622.js"),require("./gAssets.js");var n=i(r);exports.Indicator=r=>{var{styles:i,color:o=s.theme.colors.red700}=r,a=e.__rest(r,["styles","color"]);return n.default.createElement(t.Indicator,Object.assign({inline:!0,position:"top-end",offset:4,styles:Object.assign({processing:{animationDirection:"alternate"}},i),color:o},a))};
|