@hhgtech/hhg-components 1.26.77 → 1.26.78
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/mantine/tabs/index.d.ts +2 -3
- package/build/components.js +1 -1
- package/build/constants.js +1 -1
- package/build/{core-76852e1e.js → core-6c13ac93.js} +1 -1
- package/build/{dataTransform-1a0c47c9.js → dataTransform-9b96697d.js} +1 -1
- package/build/ecom.js +1 -1
- package/build/esm/babyGrowth.js +7 -7
- package/build/esm/cache.js +1 -1
- package/build/esm/care.js +1 -1
- package/build/esm/components.js +1 -1
- package/build/esm/constants.js +1 -1
- package/build/esm/{core-bf29c4da.js → core-5d5bef88.js} +1 -1
- package/build/esm/{dataTransform-abc1b8c5.js → dataTransform-72f03a9b.js} +1 -1
- package/build/esm/ecom.js +1 -1
- package/build/esm/{fixedBottomAdBlock-5abdaf41.js → fixedBottomAdBlock-6ccd3f76.js} +1 -1
- package/build/esm/footer.js +1 -1
- package/build/esm/gAssets.js +1 -1
- package/build/esm/{getDynamicHealthTool-c7b85613.js → getDynamicHealthTool-10789dfb.js} +1 -1
- package/build/esm/{getSocialList-dca20053.js → getSocialList-8b019a64.js} +1 -1
- package/build/esm/hooks.js +1 -1
- package/build/esm/i18n.js +1 -1
- package/build/esm/{index-00515101.js → index-028ceeb9.js} +1 -1
- package/build/esm/{index-dda70478.js → index-07fc0c05.js} +2 -2
- package/build/esm/{index-036ee565.js → index-0a1c242a.js} +1 -1
- package/build/esm/{index-11f88ca8.js → index-1b93ef0f.js} +1 -1
- package/build/esm/{index-c41699a9.js → index-2215d68f.js} +1 -1
- package/build/esm/{index-20fe866b.js → index-2f44c069.js} +1 -1
- package/build/esm/{index-80bef2f8.js → index-308babef.js} +1 -1
- package/build/esm/{index-d2713624.js → index-31064c30.js} +1 -1
- package/build/esm/{index-c40fffcb.js → index-529f30e2.js} +1 -1
- package/build/esm/index-5694f07e.js +1 -0
- package/build/esm/{index-d7c48dc7.js → index-58dc48d8.js} +1 -1
- package/build/esm/index-63c4ba6b.js +1 -0
- package/build/esm/{index-da7cf04c.js → index-970a7eb0.js} +1 -1
- package/build/esm/{index-0da3bb05.js → index-97c5e5aa.js} +1 -1
- package/build/esm/index-b80c910c.js +1 -0
- package/build/esm/{index-075526fc.js → index-bdcf02d1.js} +1 -1
- package/build/esm/{index-cd8b6c99.js → index-be00d0db.js} +1 -1
- package/build/esm/{index-28a8939a.js → index-c9acebcd.js} +1 -1
- package/build/esm/{index-0f09ecd8.js → index-cd979eef.js} +1 -1
- package/build/esm/{index-a60485e0.js → index-d0e50440.js} +1 -1
- package/build/esm/{index-eafed0fb.js → index-e6868891.js} +1 -1
- package/build/esm/{index-20fb7b58.js → index-fcecaa7d.js} +1 -1
- package/build/esm/index.js +1 -1
- package/build/esm/{index.styled-40c23a45.js → index.styled-66f20e0f.js} +1 -1
- package/build/esm/{index.styled-ecd8593a.js → index.styled-a53c6d25.js} +1 -1
- package/build/esm/{index.styled-af234633.js → index.styled-a5772fa0.js} +6 -6
- 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/onboarding.js +1 -1
- package/build/esm/pwg.js +2 -2
- package/build/esm/{routing-807653a4.js → routing-474f0395.js} +1 -1
- package/build/esm/{screenSizeContext-6f9575de.js → screenSizeContext-7df25130.js} +4 -4
- package/build/esm/together.js +1 -1
- package/build/esm/translationsContext-e1b113ab.js +1 -0
- package/build/esm/translationsProvider-04bd7539.js +1 -0
- package/build/esm/{types-01e0a9e9.js → types-05296a9e.js} +1 -1
- package/build/esm/{types-829974a9.js → types-b8ccf4e7.js} +143 -144
- package/build/esm/types.js +1 -1
- package/build/esm/{useHealthToolCache-182bb1c9.js → useHealthToolCache-3a427f7d.js} +1 -1
- package/build/esm/{useRafState-2ab13cc8.js → useRafState-37aeb55b.js} +1 -1
- package/build/esm/{useTranslations-b0fc04a0.js → useTranslations-c82ca698.js} +1 -1
- package/build/esm/{utils-e1220184.js → utils-874b4b93.js} +4 -4
- package/build/esm/vaccination.js +4 -4
- package/build/{fixedBottomAdBlock-21f21ce6.js → fixedBottomAdBlock-d8549495.js} +1 -1
- package/build/footer.js +1 -1
- package/build/gAssets.js +1 -1
- package/build/getDynamicHealthTool-3aa224ba.js +1 -0
- package/build/{getSocialList-5d5f08ca.js → getSocialList-1d904833.js} +1 -1
- package/build/hooks.js +1 -1
- package/build/i18n.js +1 -1
- package/build/{index-5ca678e5.js → index-0cf7da16.js} +1 -1
- package/build/{index-df26fa49.js → index-1e0d1ad4.js} +1 -1
- package/build/{index-a2815cc3.js → index-24359f62.js} +1 -1
- package/build/{index-6d7720a1.js → index-37553ebc.js} +2 -2
- package/build/index-5898712c.js +1 -0
- package/build/{index-9f522d94.js → index-6454232b.js} +1 -1
- package/build/{index-571245c9.js → index-658a7d60.js} +1 -1
- package/build/{index-9c464e45.js → index-6fb09a3b.js} +1 -1
- package/build/{index-6e0f097c.js → index-70d48bae.js} +1 -1
- package/build/{index-55df9387.js → index-729eb71c.js} +1 -1
- package/build/{index-02905eb6.js → index-8813d7b5.js} +1 -1
- package/build/{index-fb502017.js → index-8c8de50a.js} +1 -1
- package/build/{index-1fdd13cf.js → index-97db8edf.js} +1 -1
- package/build/{index-55fef0a5.js → index-a4632eac.js} +1 -1
- package/build/{index-fab5f98a.js → index-b89a15a7.js} +1 -1
- package/build/{index-79ded7b0.js → index-bff3b40e.js} +1 -1
- package/build/{index-5b811ac9.js → index-c890c32d.js} +1 -1
- package/build/{index-e0243d99.js → index-cdcbac00.js} +1 -1
- package/build/{index-2c296740.js → index-de30c0be.js} +1 -1
- package/build/{index-13fb5c20.js → index-e03a10e8.js} +1 -1
- package/build/{index-ff3cca2c.js → index-f66673c8.js} +1 -1
- package/build/{index-99d358b0.js → index-fae30c25.js} +1 -1
- package/build/index.js +1 -1
- package/build/{index.styled-85d4db5b.js → index.styled-25a704cb.js} +3 -3
- package/build/{index.styled-35faf4d5.js → index.styled-53f32922.js} +1 -1
- package/build/{index.styled-9b8171a4.js → index.styled-f8ab0097.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/onboarding.js +1 -1
- package/build/pwg.js +1 -1
- package/build/{routing-45b9d791.js → routing-7f23b855.js} +1 -1
- package/build/screenSizeContext-11883242.js +81 -0
- package/build/together.js +1 -1
- package/build/translationsContext-bd368228.js +1 -0
- package/build/translationsProvider-d1cd788a.js +1 -0
- package/build/{types-124735be.js → types-359f96fe.js} +143 -144
- package/build/{types-44319b37.js → types-cffa84b7.js} +1 -1
- package/build/types.js +1 -1
- package/build/{useHealthToolCache-3eeae9c2.js → useHealthToolCache-e82d64d7.js} +1 -1
- package/build/{useRafState-4724b69b.js → useRafState-6fe3213c.js} +1 -1
- package/build/useTranslations-e0bc8660.js +1 -0
- package/build/{utils-9b56ecde.js → utils-22d1381d.js} +1 -1
- package/build/vaccination.js +1 -1
- package/package.json +1 -1
- package/build/esm/index-4763cb0e.js +0 -1
- package/build/esm/index-53ff3fc7.js +0 -1
- package/build/esm/index-c742a8b0.js +0 -1
- package/build/esm/translationsContext-5d6ae5bc.js +0 -1
- package/build/esm/translationsProvider-27bf4e3e.js +0 -1
- package/build/getDynamicHealthTool-b9b7da0b.js +0 -1
- package/build/index-1df4f5cf.js +0 -1
- package/build/screenSizeContext-0b1c2c7e.js +0 -81
- package/build/translationsContext-ba06fd90.js +0 -1
- package/build/translationsProvider-f11b8982.js +0 -1
- package/build/useTranslations-ecb51065.js +0 -1
- /package/build/{BMI_BOYS.percentile.monthly-a61f121c.js → BMI_BOYS.percentile.monthly-30807afc.js} +0 -0
- /package/build/{BMI_BOYS.percentile.weekly-5d8c445b.js → BMI_BOYS.percentile.weekly-e22d587f.js} +0 -0
- /package/build/{BMI_BOYS.percentile.yearly-0c08a881.js → BMI_BOYS.percentile.yearly-ac6705a0.js} +0 -0
- /package/build/{BMI_BOYS.zscore.monthly-dad37273.js → BMI_BOYS.zscore.monthly-891bd101.js} +0 -0
- /package/build/{BMI_BOYS.zscore.weekly-89cf0aec.js → BMI_BOYS.zscore.weekly-d185f10d.js} +0 -0
- /package/build/{BMI_BOYS.zscore.yearly-654f1485.js → BMI_BOYS.zscore.yearly-f5e46b5e.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.monthly-80a868d4.js → BMI_GIRLS.percentile.monthly-9d2ef588.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.weekly-e94fa568.js → BMI_GIRLS.percentile.weekly-30d18404.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.yearly-1fb75a94.js → BMI_GIRLS.percentile.yearly-e403996a.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.monthly-04ee6a3c.js → BMI_GIRLS.zscore.monthly-7ed8c6ce.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.weekly-978b14be.js → BMI_GIRLS.zscore.weekly-2bad10c5.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.yearly-c46c7baa.js → BMI_GIRLS.zscore.yearly-cc7eab3f.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-a46f8c0a.js → HEAD CIRCUM_BOYS.percentile.monthly-ab77805c.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-aa05788d.js → HEAD CIRCUM_BOYS.percentile.weekly-0b380513.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-69d97954.js → HEAD CIRCUM_BOYS.percentile.yearly-f99b0c9d.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-0aaf7389.js → HEAD CIRCUM_BOYS.zscore.monthly-0eb4b812.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-89a9b256.js → HEAD CIRCUM_BOYS.zscore.weekly-80273228.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-0cc5d999.js → HEAD CIRCUM_BOYS.zscore.yearly-177da9e8.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-b4871e45.js → HEAD CIRCUM_GIRLS.percentile.monthly-b305ed19.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-d4066b62.js → HEAD CIRCUM_GIRLS.percentile.weekly-a79d6af9.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-6431d42b.js → HEAD CIRCUM_GIRLS.percentile.yearly-5ef6fa1b.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-0972b624.js → HEAD CIRCUM_GIRLS.zscore.monthly-2de43e02.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-fe1a7e9a.js → HEAD CIRCUM_GIRLS.zscore.weekly-17b22fcd.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-208cbb1d.js → HEAD CIRCUM_GIRLS.zscore.yearly-fdff18b7.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.monthly-a2f63b53.js → HEIGHT_BOYS.percentile.monthly-b975f6b5.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.weekly-efb9b4da.js → HEIGHT_BOYS.percentile.weekly-36234aff.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.yearly-2ed3ba54.js → HEIGHT_BOYS.percentile.yearly-a236c22d.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.monthly-7ace0852.js → HEIGHT_BOYS.zscore.monthly-91b4baba.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.weekly-92ef6fab.js → HEIGHT_BOYS.zscore.weekly-c1234307.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.yearly-3244c378.js → HEIGHT_BOYS.zscore.yearly-19b23773.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.monthly-db231252.js → HEIGHT_GIRLS.percentile.monthly-d605452e.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.weekly-2adfd96c.js → HEIGHT_GIRLS.percentile.weekly-c258c049.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.yearly-85b12383.js → HEIGHT_GIRLS.percentile.yearly-c85d9800.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.monthly-1ab59517.js → HEIGHT_GIRLS.zscore.monthly-5dc7354f.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.weekly-6e0192bb.js → HEIGHT_GIRLS.zscore.weekly-599c3c5d.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.yearly-f07a1164.js → HEIGHT_GIRLS.zscore.yearly-8e052666.js} +0 -0
- /package/build/{Onboarding-ef0026fc.js → Onboarding-a7f1c726.js} +0 -0
- /package/build/{Visible-cba1bb48.js → Visible-8a98d149.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.monthly-72fb080e.js → WEIGHT_BOYS.percentile.monthly-1bef9894.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.weekly-d10e60eb.js → WEIGHT_BOYS.percentile.weekly-9064d021.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.yearly-1c7b8b54.js → WEIGHT_BOYS.percentile.yearly-b011e1ae.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.monthly-97d07eab.js → WEIGHT_BOYS.zscore.monthly-4c42fe9f.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.weekly-173279e1.js → WEIGHT_BOYS.zscore.weekly-aecf2697.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.yearly-0d005c27.js → WEIGHT_BOYS.zscore.yearly-b3afd823.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.monthly-5a042795.js → WEIGHT_GIRLS.percentile.monthly-b9605bcd.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.weekly-45431a77.js → WEIGHT_GIRLS.percentile.weekly-1e9ed516.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.yearly-63cdeb83.js → WEIGHT_GIRLS.percentile.yearly-0f8211a3.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.monthly-60c26703.js → WEIGHT_GIRLS.zscore.monthly-6fe64a2e.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.weekly-8196ec45.js → WEIGHT_GIRLS.zscore.weekly-b399025f.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.yearly-93eaad1b.js → WEIGHT_GIRLS.zscore.yearly-2c3e6f4f.js} +0 -0
- /package/build/{constants-0148ba3e.js → constants-3fe9d63e.js} +0 -0
- /package/build/{cookieHelper-dac88eba.js → cookieHelper-19ea025c.js} +0 -0
- /package/build/{dataTransform-86bd33e2.js → dataTransform-4295b66e.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.monthly-658bf3e9.js → BMI_BOYS.percentile.monthly-9e8b5e7b.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.weekly-a4eaf785.js → BMI_BOYS.percentile.weekly-71e6c8af.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.yearly-2ff5da73.js → BMI_BOYS.percentile.yearly-a47654bf.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.monthly-d05c2792.js → BMI_BOYS.zscore.monthly-5a25ad0e.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.weekly-f8ae621f.js → BMI_BOYS.zscore.weekly-677c38cb.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.yearly-9477e7e0.js → BMI_BOYS.zscore.yearly-21a9cfcf.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.monthly-875bb68a.js → BMI_GIRLS.percentile.monthly-7609f9fe.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.weekly-e5a3472e.js → BMI_GIRLS.percentile.weekly-8cf21aa5.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.yearly-6f745e55.js → BMI_GIRLS.percentile.yearly-6380efec.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.monthly-acd17d93.js → BMI_GIRLS.zscore.monthly-793229b9.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.weekly-d9d5c748.js → BMI_GIRLS.zscore.weekly-53ddb3ba.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.yearly-03e3edb0.js → BMI_GIRLS.zscore.yearly-5a7ed20f.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-f42c2164.js → HEAD CIRCUM_BOYS.percentile.monthly-4c2dab5c.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-59a4d782.js → HEAD CIRCUM_BOYS.percentile.weekly-34ee115e.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-c9deaf61.js → HEAD CIRCUM_BOYS.percentile.yearly-bcd6bb9d.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-39a7bf24.js → HEAD CIRCUM_BOYS.zscore.monthly-6dfb40df.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-40d20662.js → HEAD CIRCUM_BOYS.zscore.weekly-d4469b2a.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-5b4708bd.js → HEAD CIRCUM_BOYS.zscore.yearly-63470d35.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-eb05242b.js → HEAD CIRCUM_GIRLS.percentile.monthly-c5831ab1.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-ffddec12.js → HEAD CIRCUM_GIRLS.percentile.weekly-9cb54ddd.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-b4bfe0f0.js → HEAD CIRCUM_GIRLS.percentile.yearly-03ea570d.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-d14c698a.js → HEAD CIRCUM_GIRLS.zscore.monthly-d5547f72.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-1cd18628.js → HEAD CIRCUM_GIRLS.zscore.weekly-acd5a834.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-760193ee.js → HEAD CIRCUM_GIRLS.zscore.yearly-ccd8f2c9.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.monthly-d4fe2e84.js → HEIGHT_BOYS.percentile.monthly-92cce238.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.weekly-d2293971.js → HEIGHT_BOYS.percentile.weekly-b63e88d3.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.yearly-b1ab8c74.js → HEIGHT_BOYS.percentile.yearly-f02a23cb.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.monthly-932d6b93.js → HEIGHT_BOYS.zscore.monthly-816997fa.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.weekly-d84d7386.js → HEIGHT_BOYS.zscore.weekly-2942d911.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.yearly-ecebea4d.js → HEIGHT_BOYS.zscore.yearly-4c4ddd7c.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-c3fa9f5c.js → HEIGHT_GIRLS.percentile.monthly-8455a93d.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-341cd946.js → HEIGHT_GIRLS.percentile.weekly-e6e8511f.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-f17be139.js → HEIGHT_GIRLS.percentile.yearly-b855d440.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-4786bd0b.js → HEIGHT_GIRLS.zscore.monthly-931e6843.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-c4af111f.js → HEIGHT_GIRLS.zscore.weekly-2ed8138e.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-e0660fed.js → HEIGHT_GIRLS.zscore.yearly-4b7f5532.js} +0 -0
- /package/build/esm/{Onboarding-c78a082b.js → Onboarding-0d390a7e.js} +0 -0
- /package/build/esm/{Visible-c8c46797.js → Visible-51c104d4.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.monthly-6918e22c.js → WEIGHT_BOYS.percentile.monthly-a213dee1.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.weekly-e49b4839.js → WEIGHT_BOYS.percentile.weekly-5bf0d4cf.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.yearly-6fc24cf8.js → WEIGHT_BOYS.percentile.yearly-6f21b73b.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.monthly-32c31366.js → WEIGHT_BOYS.zscore.monthly-b06729e0.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.weekly-d9bc0e4f.js → WEIGHT_BOYS.zscore.weekly-7ce70e39.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.yearly-60944d85.js → WEIGHT_BOYS.zscore.yearly-78cb02f9.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-29525f78.js → WEIGHT_GIRLS.percentile.monthly-a25ab68a.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-e181b7d4.js → WEIGHT_GIRLS.percentile.weekly-6dbd8348.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-0a0ebfab.js → WEIGHT_GIRLS.percentile.yearly-ea547573.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-a5013667.js → WEIGHT_GIRLS.zscore.monthly-3d2dac19.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-52c7ca98.js → WEIGHT_GIRLS.zscore.weekly-196a5acb.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-02976188.js → WEIGHT_GIRLS.zscore.yearly-b57f695e.js} +0 -0
- /package/build/esm/{constants-e0e1f3af.js → constants-bbf9ff1e.js} +0 -0
- /package/build/esm/{cookieHelper-645ee730.js → cookieHelper-64b2d633.js} +0 -0
- /package/build/esm/{dataTransform-2ca319f7.js → dataTransform-a77e6a93.js} +0 -0
- /package/build/esm/{index-4bd03a58.js → index-85608020.js} +0 -0
- /package/build/esm/{isProduction-0cff20bf.js → isProduction-a5a1f5b5.js} +0 -0
- /package/build/esm/{localizeNumberFormat-7c1579eb.js → localizeNumberFormat-49b847fd.js} +0 -0
- /package/build/esm/{normalizeLink-f684d390.js → normalizeLink-bab96905.js} +0 -0
- /package/build/esm/{theme-7af6d141.js → theme-5634f75c.js} +0 -0
- /package/build/esm/{tslib.es6-16065c04.js → tslib.es6-24360486.js} +0 -0
- /package/build/esm/{types-e397b730.js → types-57b4bf53.js} +0 -0
- /package/build/esm/{useIsInit-f5de1828.js → useIsInit-13acffb5.js} +0 -0
- /package/build/esm/{useOutsideClick-bff348b1.js → useOutsideClick-74ec4ceb.js} +0 -0
- /package/build/esm/{useScrollbarSize-03addf5b.js → useScrollbarSize-22cb7784.js} +0 -0
- /package/build/esm/{useUniqueId-3af3be5d.js → useUniqueId-9207f143.js} +0 -0
- /package/build/esm/{utils-9f6dcc74.js → utils-265e7646.js} +0 -0
- /package/build/{index-85e0eb9d.js → index-ca3a35f1.js} +0 -0
- /package/build/{isProduction-d1798c89.js → isProduction-739eb23f.js} +0 -0
- /package/build/{localizeNumberFormat-35208be0.js → localizeNumberFormat-04564045.js} +0 -0
- /package/build/{normalizeLink-9a84e2d6.js → normalizeLink-bedc93a3.js} +0 -0
- /package/build/{theme-46214f6c.js → theme-ce33ba3c.js} +0 -0
- /package/build/{tslib.es6-a12e0ed5.js → tslib.es6-28c50672.js} +0 -0
- /package/build/{types-aabcdab9.js → types-f490d6fd.js} +0 -0
- /package/build/{useIsInit-79a5b5d5.js → useIsInit-af399917.js} +0 -0
- /package/build/{useOutsideClick-521195fb.js → useOutsideClick-85f388f7.js} +0 -0
- /package/build/{useScrollbarSize-03e379c5.js → useScrollbarSize-3914fcd8.js} +0 -0
- /package/build/{useUniqueId-a1f484a1.js → useUniqueId-4eda1b9c.js} +0 -0
- /package/build/{utils-e4120b96.js → utils-8757f7c9.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var e=require("./tslib.es6-
|
|
1
|
+
"use strict";var e=require("./tslib.es6-28c50672.js"),t=require("react"),a=require("@mantine/core"),l=require("./index-8c8de50a.js"),o=require("./useTranslations-e0bc8660.js"),n=require("innertext"),i=require("./theme-ce33ba3c.js"),r=require("./index-37553ebc.js"),s=require("./gAssets.js");require("@mantine/dates");var d=require("./index-fae30c25.js");require("./Onboarding-a7f1c726.js");var c=require("dayjs");require("./screenSizeContext-11883242.js");var u=require("styled-components"),m=require("./utils-8757f7c9.js");require("./isProduction-739eb23f.js"),require("./index-e03a10e8.js"),require("@mantine/hooks");var p=require("./index.styled-f8ab0097.js"),g=require("./index-658a7d60.js"),h=require("./dataTransform-9b96697d.js"),f=require("./index-cdcbac00.js"),v=require("./index-6fb09a3b.js"),b=require("lodash/debounce"),x=require("react-contenteditable"),w=require("./index-729eb71c.js"),y=require("./cookieHelper-19ea025c.js"),C=require("react-dom");require("./index-b89a15a7.js"),require("./index-0cf7da16.js"),require("./index.styled-53f32922.js");var E=require("date-fns");require("react-day-picker/DayPickerInput"),require("./index-70d48bae.js"),require("lodash/throttle"),require("keen-slider/react"),require("./types-f490d6fd.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-25a704cb.js"),require("uuid"),require("string-format");var k=require("dayjs/plugin/relativeTime"),A=require("./index-97db8edf.js"),N=require("./useUniqueId-4eda1b9c.js");require("./translationsContext-bd368228.js");var T=require("./routing-7f23b855.js");function S(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function P(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)}var L=P(t),M=S(t),I=S(n),R=S(c),B=S(u),z=S(b),j=S(x),F=P(C),O=S(k);const D=e=>L.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},e),L.createElement("path",{d:"M3.99403 3.32695C3.86141 3.32698 3.73181 3.36657 3.62181 3.44065C3.5118 3.51472 3.42638 3.61992 3.37648 3.7428C3.32658 3.86567 3.31445 4.00064 3.34165 4.13044C3.36885 4.26024 3.43415 4.37898 3.52919 4.47148L7.05784 8.00013L3.52919 11.5288C3.46521 11.5902 3.41413 11.6638 3.37894 11.7452C3.34375 11.8266 3.32516 11.9142 3.32425 12.0029C3.32335 12.0916 3.34015 12.1796 3.37368 12.2617C3.40721 12.3438 3.45678 12.4185 3.5195 12.4812C3.58222 12.5439 3.65682 12.5935 3.73894 12.627C3.82106 12.6605 3.90904 12.6773 3.99774 12.6764C4.08643 12.6755 4.17405 12.6569 4.25547 12.6217C4.33689 12.5865 4.41047 12.5355 4.4719 12.4715L8.00054 8.94283L11.5292 12.4715C11.5906 12.5355 11.6642 12.5865 11.7456 12.6217C11.827 12.6569 11.9147 12.6755 12.0034 12.6764C12.092 12.6773 12.18 12.6605 12.2621 12.627C12.3443 12.5935 12.4189 12.5439 12.4816 12.4812C12.5443 12.4185 12.5939 12.3439 12.6274 12.2617C12.6609 12.1796 12.6777 12.0916 12.6768 12.0029C12.6759 11.9142 12.6573 11.8266 12.6222 11.7452C12.587 11.6638 12.5359 11.5902 12.4719 11.5288L8.94325 8.00013L12.4719 4.47148C12.5682 4.37784 12.634 4.25728 12.6607 4.1256C12.6873 3.99392 12.6735 3.85726 12.6212 3.73354C12.5688 3.60982 12.4803 3.5048 12.3672 3.43224C12.2542 3.35969 12.1218 3.32299 11.9875 3.32695C11.8143 3.33211 11.6499 3.4045 11.5292 3.52877L8.00054 7.05742L4.4719 3.52877C4.40977 3.46491 4.33548 3.41415 4.2534 3.37948C4.17132 3.34482 4.08313 3.32696 3.99403 3.32695Z"})),U=t.createContext({}),V=({children:e,defaultParams:t})=>M.default.createElement(U.Provider,{value:{defaultParams:t}},e),_=e=>{const{data:{userInfo:a,env:{togetherBasePath:l}}}=t.useContext(p.TogetherComponentGlobalContext),{defaultParams:o}=t.useContext(U)||{},n=null==a?void 0:a.id,i=a&&"number"==typeof a.communities_interacted&&0===a.communities_interacted;return{authActionWrapper:(t,a)=>{const r=Object.assign(Object.assign(Object.assign({},o),e),a);if(!n||i){n||y.deleteCookie(p.BEARER_TOKEN_COOKIE),(null==r?void 0:r._joinCommunityIds)&&(localStorage.setItem("to_join_community_ids",JSON.stringify(Array.from(new Set((JSON.parse(localStorage.getItem("to_join_community_ids")||"[]")||[]).concat(r._joinCommunityIds).filter(Boolean))))),null==r||delete r._joinCommunityIds),(null==r?void 0:r._joinTopicIds)&&(localStorage.setItem("to_join_topic_ids",JSON.stringify(Array.from(new Set((JSON.parse(localStorage.getItem("to_join_topic_ids")||"[]")||[]).concat(r._joinTopicIds).filter(Boolean))))),null==r||delete r._joinTopicIds);const e=(null==r?void 0:r._location)||window.location.href;return null==r||delete r._location,window.location.href=p.getUrlToSignUp(e,r,l),null}return t&&t()},params:Object.assign(Object.assign({},o),e)}},H=B.default.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
@@ -959,7 +959,141 @@
|
|
|
959
959
|
width: 24px;
|
|
960
960
|
height: 24px;
|
|
961
961
|
}
|
|
962
|
-
`;const Xe=({isOpen:e=!0,onClose:a,enableAnimation:l=!0,hospitalId:n,locale:r,isMobile:d,overwriteProfileProps:c,avatarFallback:u=s.CommonGAssets.getAssetPath("avatar.jpg"),trackingCategory:m="Together"})=>{const{t:h}=o.useTranslations(),[v,b]=t.useState(null),[x,y]=t.useState(!1);t.useEffect((()=>{if(e&&n&&String(null==v?void 0:v.id)!==String(n)){y(!0);try{b(null),p.callApi(p.getCarePath(p.CARE_PATHS.GET_HOSPITAL_INFO,{hospital_branch_id:n,website_url:p.domainLocales[r]}),"get").then((e=>{b(Object.assign(Object.assign({},null==e?void 0:e._data.branch),c))}))}catch(e){console.error(e)}y(!1)}}),[e,n,null==v?void 0:v.id]);const C=(null==v?void 0:v.specialties)||[],E=t.useMemo((()=>C.map((e=>e.name))),[C]);return M.default.createElement(M.default.Fragment,null,M.default.createElement(qe,{"data-open":e,"data-animation":l,onClick:e=>e.stopPropagation()},x||!v?M.default.createElement(q,null):M.default.createElement("div",{className:"popup-content"},M.default.createElement("div",{className:"close-button",onClick:a},M.default.createElement("img",{src:ze,style:{width:20,height:20},alt:"close-icon"})),M.default.createElement("div",{className:"main-info"},M.default.createElement("div",{className:"border-banner"}),M.default.createElement("div",{className:"avatar-title"},M.default.createElement(Ze,null,M.default.createElement("div",{className:"image-container"},M.default.createElement("div",{style:{position:"relative"}},M.default.createElement(g.ImageWithHandler,{src:null==v?void 0:v.logo,className:"profile-image",alt:"avatar",fallbackSrc:u}),M.default.createElement("img",{className:"badge-avatar",src:je,alt:"badge"})))),M.default.createElement(Qe,null,M.default.createElement(f.Text,{size:"s3",type:"semiBold",className:"full-name"},null==v?void 0:v.name),M.default.createElement("div",{className:"specialty"},C&&M.default.createElement(f.Text,{size:"p4",color:i.theme.colors.gray800},E.join(" • "),"•"),M.default.createElement("a",{href:p.getCareHospitalUrl({id:v.id,name:v.name,slug:v.slug,locale:r}),className:"organisation",target:"_blank",rel:"noreferrer"},M.default.createElement(f.Text,{size:"p4",className:"organisation",color:i.theme.colors.gray800,style:{textDecoration:"underline"}},null==v?void 0:v.name))))),!d&&M.default.createElement("a",{href:p.getCareHospitalUrl({id:v.id,name:v.name,slug:v.slug,locale:r})},M.default.createElement("div",{className:"btn-wrapper"},M.default.createElement(w.Button,{color:"primary",size:"md",className:"btn-booking"},h("careBooking.bookAnAppointment"))))),M.default.createElement(Qe,null,M.default.createElement("div",{className:"experience"},M.default.createElement(f.Text,{type:"bold",size:"s3",color:i.theme.colors.gray800,style:{paddingBottom:16}},h("hospital.content.description").toUpperCase()),M.default.createElement(f.Text,{size:"p2",color:i.theme.colors.gray500},v.about),d?M.default.createElement("a",{href:p.getCareHospitalUrl({id:v.id,name:v.name,slug:v.slug,locale:r})},M.default.createElement("div",{className:"btn-wrapper"},M.default.createElement(w.Button,{color:"primary",size:"md",className:"btn-booking"},h("careBooking.bookAnAppointment")))):M.default.createElement("a",{href:p.getCareHospitalUrl({id:v.id,name:v.name,slug:v.slug,locale:r})},M.default.createElement(f.Text,{size:"s4",color:"#2D87F3",as:"span","data-event-category":m,"data-event-action":"See Full Hospital Profile","data-event-label":p.getCurrentBaseUrl(r)+p.getCareHospitalUrl({id:v.id,name:v.name,slug:v.slug,locale:r})},h("home.seeHospital"))))))),M.default.createElement(Ge,{"data-open":e,onClick:e=>{e.stopPropagation(),a()}}))};var Ke="_2UKyiK1",$e="E5ga-tI",Ye="_8Y2nWXX",Je="d0T7kSP";const et=({open:e,onClose:t,children:a,profileModalProps:l})=>{const{t:n}=o.useTranslations();return M.default.createElement(A.Modal,Object.assign({className:Ke,opened:e,onClose:t,overlayOpacity:.2,overflow:"inside",styles:{inner:{padding:0,justifyContent:"flex-end"},modal:{height:"100%",borderRadius:0},body:{padding:"24px",maxHeight:"100%"},content:{maxHeight:"100%",height:"100%",borderRadius:0}},title:"Profile"},l),M.default.createElement("div",{className:$e},M.default.createElement("div",{className:Ye},n("profilePanel.modal.heading")),M.default.createElement("div",{className:Je,onClick:t},M.default.createElement(D,null))),a)};var tt=a.createStyles((()=>({root:{},authorBadge:{background:"yellow"}})));R.default.extend(O.default);const at=t.createContext({}),lt=({siteType:e})=>{const{t:a}=o.useTranslations(),{handleMakeAppointment:l,doctorId:n,hospitalId:i,currentUrl:s}=t.useContext(at);return M.default.createElement(w.Button,{theme:e,color:"primary",size:"xs",onClick:e=>{null==l||l(n,i),e.stopPropagation()},dataEventCategory:"Care",dataEventAction:"Comment - Quick Booking",dataEventLabel:s,icon:M.default.createElement(r.ArrowRight,{className:"buttonIcon",size:18}),iconPosition:"right",style:{whiteSpace:"nowrap"}},M.default.createElement("span",null,a("careBooking.bookAnAppointment")))},ot=e=>{const{className:l="",community:n,name:c,username:u,url:h,avatar:f,role:v,title:b,userType:x="user",expertId:w,isMarryBaby:y,doctorId:C,hospitalId:E,hasQuickBooking:k,handleMakeAppointment:A,communityTrackingAttr:N,isAnonymous:T,showDetailPopup:S,subLine:P,authActionWrapper:L,profileProps:I,profileModalProps:R,extendEle:B,avatarProps:z,hideInfo:j,timeText:F,onCloseFromPost:O,avatarIcon:D,badgeIconSize:U,hideBackground:V,children:_,styles:H,dataEventCategory:W,dataEventAction:q,dataEventLabel:G}=e,{data:{locale:Z,router:Q,env:{isMarryBaby:X,togetherBasePath:K}}}=t.useContext(p.TogetherComponentGlobalContext),{t:$}=o.useTranslations(),{classes:Y}=tt(void 0,{name:"CardAuthor",styles:H}),J="boolean"==typeof y?y:X,ee=J?"marryBaby":"helloSites",te=T?$("cardPost.anonymous"):c||u||"",ae=T?s.CommonGAssets.getAssetPath("avatar.jpg"):f,le=T?void 0:v,[oe,ne]=t.useState(!1),{asPath:ie}=Q||{},re=`https://${d.domainLocales[Z]}${ie}`,se=()=>{if(T||"chatbot"===x)return!1;S?ce(!0):h&&(window.location.href=h)};t.useEffect((()=>{m.toggleNoScroll(oe)}),[oe]);const[de,ce]=t.useState(!1),ue="expert"===(null==e?void 0:e.role),[me,pe]=t.useState(null);return t.useEffect((()=>{de&&!me&&Promise.resolve().then((function(){return Ml})).then((e=>{pe((()=>e.ProfileDetail))}))}),[de]),M.default.createElement(at.Provider,{value:{handleMakeAppointment:A,doctorId:C,hospitalId:E,currentUrl:re}},M.default.createElement(et,{open:de,onClose:()=>ce(!1),profileModalProps:R},me&&M.default.createElement(me,Object.assign({currentPageUrl:G,authorProps:{userId:null==e?void 0:e.userId,avatar:ae,name:null==e?void 0:e.name,role:null==e?void 0:e.role,title:null==e?void 0:e.title},authActionWrapper:L,onCloseFromPost:()=>{ce(!1),null==O||O()}},I))),"expert"===le&&w?M.default.createElement(We,{isOpen:oe,onClose:()=>ne(!1),expertId:w}):null,"expert"===le&&C?M.default.createElement(Fe,{isOpen:oe,onClose:()=>ne(!1),doctorId:C,locale:Z}):null,"expert"===le&&E?M.default.createElement(Xe,{isOpen:oe,onClose:()=>ne(!1),hospitalId:E,locale:Z}):null,M.default.createElement("div",{className:`hhg-card-author ${Y.root} ${l} ${ue?"expert-author":""}`,"data-background":!V&&ue,"data-is-marrybaby":J},M.default.createElement(Pe,{dataEventCategory:W,dataEventAction:q,dataEventLabel:G,onAvatarClick:se,avatarProps:Object.assign(Object.assign({avatar:T?s.CommonGAssets.getAssetPath(J?"anomyous-avatar-1.svg":"anomyous-avatar.svg"):ae,username:te},z),{style:{cursor:T||!h&&!S?"default":"pointer"}}),avatarIcon:D||ue&&M.default.createElement(ve,{size:U||15})},_?M.default.createElement("div",{onClick:se},_):!j&&M.default.createElement(Pe.Row,null,M.default.createElement(Pe.ColLeft,null,M.default.createElement(a.Flex,{align:"center",onClick:se},M.default.createElement(Pe.MainText,{onClick:se},te,"chatbot"===x?M.default.createElement(M.default.Fragment,null," ",M.default.createElement(r.ShieldCheck,{color:i.theme.colors.primaryBase,size:16,style:{display:"inline-block",transform:"translate(0, 2px)"}})):le&&M.default.createElement(g.AuthorBadge,{className:Y.authorBadge,siteType:ee,role:le,title:b,style:{verticalAlign:"bottom"}}))),P||M.default.createElement(Pe.SubTextRow,null,(null==n?void 0:n.name)&&M.default.createElement(Pe.SubText,null,M.default.createElement("a",Object.assign({href:(null==n?void 0:n.slug)&&n.isActive&&!n.isHidden?`${K}/${null==n?void 0:n.slug}`:void 0,className:"author-community-name"},N),`${null==n?void 0:n.name}`)),F&&M.default.createElement(M.default.Fragment,null,M.default.createElement(Pe.SubDivider,null),M.default.createElement(Pe.SubText,{className:"time-text"},F)))),k&&M.default.createElement(Pe.ColRight,null,M.default.createElement(lt,{siteType:ee})))),B&&B))};ot.BookingBtn=lt,ot.MainText=Pe.MainText,ot.SubText=Pe.SubText,ot.SubTextRow=Pe.SubTextRow,ot.SubDivider=Pe.SubDivider;const nt=e=>({message:e("notification.failure"),type:"danger"});var it="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 rt=/<mocka ([^>]*)data-url="true"[^<>]*>(.*?)<\/mocka>/gim,st=/((?:=")|(?:data-url="true">)|)(https?:\/\/(www\.)?(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$]))/gim,dt=/\[a\+href="([^<"]+)"(?:\+text=\"([^<"]+)")?\]/gim,ct=/<mention [^>]*data-id="([^<"]+)"[^>]*>([^<]+)<\/mention>/gim,ut=/<mention [^>]*data-id="([^<"]+)" [^\>]*data-name="([^<"]+)"[^>]*>([^<]+)<\/mention>/gim,mt=/\[mention\+id="([^<"]+)"([^\]]*)\]/gim,pt=/^(https?:\/\/(www\.)?(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$]))$/gim,gt=/^((https?:\/\/)?(www\.)?(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$]))$/gim,ht=/<a [^>]*href="([^>"]+)"[^>]*>([^<]+)<\/a>/gim,ft=/<mocka [^\>]*data-bad-word="[^\"]*" [^\>]*data-error="true"[^\>]*>(.*?)<\/mocka>/gim,vt=({url:e,text:t,method:a})=>{const l=t.indexOf(t.trimStart()),o=t.trimEnd().length,n=t.substring(0,l),i=t.substring(l,o),r=t.substring(o);return"edit"===a?`${n}<mocka data-href="${e}" data-url="true">${i}</mocka>${r}`:"display"===a&&(e.startsWith("http://")||e.startsWith("https://"))?`${n}<a href="${e}" target="_blank">${i}</a>${r}`:t},bt=(e,t)=>e.replace(dt,((e,a,l)=>vt({text:l||a,url:a,method:t}))).replace(ht,((e,a,l)=>vt({text:l||a,url:a,method:t}))),xt=(e,t=[])=>e.replace(mt,((e,a,l)=>{const o=t.find((e=>String(e.id)===a));if(!o){if(!l)return"";let e="";return l.replace(/\+name="([^<"]+)"/i,((t,a)=>(e=a,t))),`<mention data-id="${a}" data-name="${e}">${e}</mention>`}return`<mention data-id="${a}" data-name="${o.name}">${o.name}</mention>`})),wt=e=>{const t=[];return e.replace(/(\&)+/g,"&").replace(st,((e,a,l)=>('="'!==a&&'data-url="true">'!==a&&t.push(l),e))),t},yt=(e,t)=>{const a=[];return e.replace(ct,((e,t)=>(a.push(t),e))).replace(mt,((e,t)=>(a.push(t),e))),t?a:Array.from(new Set(a)).slice(0,30)},Ct=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Et=e=>e.replace(ft,"$1"),kt=(e,t=(e=>e))=>((e,t=(e=>e))=>{var a;return t(null===(a=e.replace(/(\ )+/g," ").replace(/(\&)+/g,"&"))||void 0===a?void 0:a.replace(/(\u200c|‌)+/g,"").replace(st,((e,t,a)=>'="'!==t&&'data-url="true">'!==t?`<a href="${a}" target="_blank">${a}</a>`:e)).replace(rt,((e,t,a)=>{var l;const o=null===(l=t.match(/data-href="([^"]*)"/im))||void 0===l?void 0:l[1];return o?`<a href="${o}" target="_blank">${a}</a>`:`<a href="${a}" target="_blank">${a}</a>`})))})((e=>e.replace(ct,((e,t,a)=>`[mention+id="${t}"+name="${a}"]`)))(Et(e)),t),At=["hellobacsi.com","hellosehat.com","hellodoktor.com","hellokrupet.com","hellodoctor.com.ph","hellokhunmor.com","hellosayarwon.com","helloyishi.com.tw","helloswasthya.com","marrybaby.vn"],Nt=e=>e.match(gt)?e.startsWith("https://")||e.startsWith("http://")?e:`https://${e}`:"",Tt=(e,t)=>{const a=t.filter(Boolean);if(e&&a.length>0){return Et(e).replace(new RegExp(`\\b(${a.map((e=>Ct(e))).join("|")})\\b`,"gi"),((e,t)=>{const a=document.createElement("mocka");return a.setAttribute("data-bad-word",t),a.setAttribute("data-error","true"),a.innerText=t,`${a.outerHTML}`}))}return e},St=(t,a,l)=>"string"==typeof t?Promise.resolve(t):e.__awaiter(void 0,void 0,void 0,(function*(){var e;const o=new FormData;if(t.type.startsWith("image/gif"))o.append("image",t);else{const e=yield Promise.resolve().then((function(){return P(require("browser-image-compression"))})),a=yield e.default(t,{maxSizeMB:.4,maxWidthOrHeight:1536,useWebWorker:!0});o.append("image",a)}const n=l?p.callApiWithAdminAuth:p.callApiWithAuth,i=yield n(p.getApiPath(l?p.ADMIN_PATHS.COMMENT.IMAGE_UPLOAD:p.PATHS.COMMENT.IMAGE_UPLOAD,{_locale:a}),"POST",{data:o});return(null===(e=null==i?void 0:i.data)||void 0===e?void 0:e.image)||""})),Pt=(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}},Lt=B.default.div`
|
|
962
|
+
`;const Xe=({isOpen:e=!0,onClose:a,enableAnimation:l=!0,hospitalId:n,locale:r,isMobile:d,overwriteProfileProps:c,avatarFallback:u=s.CommonGAssets.getAssetPath("avatar.jpg"),trackingCategory:m="Together"})=>{const{t:h}=o.useTranslations(),[v,b]=t.useState(null),[x,y]=t.useState(!1);t.useEffect((()=>{if(e&&n&&String(null==v?void 0:v.id)!==String(n)){y(!0);try{b(null),p.callApi(p.getCarePath(p.CARE_PATHS.GET_HOSPITAL_INFO,{hospital_branch_id:n,website_url:p.domainLocales[r]}),"get").then((e=>{b(Object.assign(Object.assign({},null==e?void 0:e._data.branch),c))}))}catch(e){console.error(e)}y(!1)}}),[e,n,null==v?void 0:v.id]);const C=(null==v?void 0:v.specialties)||[],E=t.useMemo((()=>C.map((e=>e.name))),[C]);return M.default.createElement(M.default.Fragment,null,M.default.createElement(qe,{"data-open":e,"data-animation":l,onClick:e=>e.stopPropagation()},x||!v?M.default.createElement(q,null):M.default.createElement("div",{className:"popup-content"},M.default.createElement("div",{className:"close-button",onClick:a},M.default.createElement("img",{src:ze,style:{width:20,height:20},alt:"close-icon"})),M.default.createElement("div",{className:"main-info"},M.default.createElement("div",{className:"border-banner"}),M.default.createElement("div",{className:"avatar-title"},M.default.createElement(Ze,null,M.default.createElement("div",{className:"image-container"},M.default.createElement("div",{style:{position:"relative"}},M.default.createElement(g.ImageWithHandler,{src:null==v?void 0:v.logo,className:"profile-image",alt:"avatar",fallbackSrc:u}),M.default.createElement("img",{className:"badge-avatar",src:je,alt:"badge"})))),M.default.createElement(Qe,null,M.default.createElement(f.Text,{size:"s3",type:"semiBold",className:"full-name"},null==v?void 0:v.name),M.default.createElement("div",{className:"specialty"},C&&M.default.createElement(f.Text,{size:"p4",color:i.theme.colors.gray800},E.join(" • "),"•"),M.default.createElement("a",{href:p.getCareHospitalUrl({id:v.id,name:v.name,slug:v.slug,locale:r}),className:"organisation",target:"_blank",rel:"noreferrer"},M.default.createElement(f.Text,{size:"p4",className:"organisation",color:i.theme.colors.gray800,style:{textDecoration:"underline"}},null==v?void 0:v.name))))),!d&&M.default.createElement("a",{href:p.getCareHospitalUrl({id:v.id,name:v.name,slug:v.slug,locale:r})},M.default.createElement("div",{className:"btn-wrapper"},M.default.createElement(w.Button,{color:"primary",size:"md",className:"btn-booking"},h("careBooking.bookAnAppointment"))))),M.default.createElement(Qe,null,M.default.createElement("div",{className:"experience"},M.default.createElement(f.Text,{type:"bold",size:"s3",color:i.theme.colors.gray800,style:{paddingBottom:16}},h("hospital.content.description").toUpperCase()),M.default.createElement(f.Text,{size:"p2",color:i.theme.colors.gray500},v.about),d?M.default.createElement("a",{href:p.getCareHospitalUrl({id:v.id,name:v.name,slug:v.slug,locale:r})},M.default.createElement("div",{className:"btn-wrapper"},M.default.createElement(w.Button,{color:"primary",size:"md",className:"btn-booking"},h("careBooking.bookAnAppointment")))):M.default.createElement("a",{href:p.getCareHospitalUrl({id:v.id,name:v.name,slug:v.slug,locale:r})},M.default.createElement(f.Text,{size:"s4",color:"#2D87F3",as:"span","data-event-category":m,"data-event-action":"See Full Hospital Profile","data-event-label":p.getCurrentBaseUrl(r)+p.getCareHospitalUrl({id:v.id,name:v.name,slug:v.slug,locale:r})},h("home.seeHospital"))))))),M.default.createElement(Ge,{"data-open":e,onClick:e=>{e.stopPropagation(),a()}}))};var Ke="_2UKyiK1",$e="E5ga-tI",Ye="_8Y2nWXX",Je="d0T7kSP";const et=({open:e,onClose:t,children:a,profileModalProps:l})=>{const{t:n}=o.useTranslations();return M.default.createElement(A.Modal,Object.assign({className:Ke,opened:e,onClose:t,overlayOpacity:.2,overflow:"inside",styles:{inner:{padding:0,justifyContent:"flex-end"},modal:{height:"100%",borderRadius:0},body:{padding:"24px",maxHeight:"100%"},content:{maxHeight:"100%",height:"100%",borderRadius:0}},title:"Profile"},l),M.default.createElement("div",{className:$e},M.default.createElement("div",{className:Ye},n("profilePanel.modal.heading")),M.default.createElement("div",{className:Je,onClick:t},M.default.createElement(D,null))),a)};var tt=a.createStyles((()=>({root:{},authorBadge:{background:"yellow"}})));R.default.extend(O.default);const at=t.createContext({}),lt=({siteType:e})=>{const{t:a}=o.useTranslations(),{handleMakeAppointment:l,doctorId:n,hospitalId:i,currentUrl:s}=t.useContext(at);return M.default.createElement(w.Button,{theme:e,color:"primary",size:"xs",onClick:e=>{null==l||l(n,i),e.stopPropagation()},dataEventCategory:"Care",dataEventAction:"Comment - Quick Booking",dataEventLabel:s,icon:M.default.createElement(r.ArrowRight,{className:"buttonIcon",size:18}),iconPosition:"right",style:{whiteSpace:"nowrap"}},M.default.createElement("span",null,a("careBooking.bookAnAppointment")))},ot=e=>{const{className:l="",community:n,name:c,username:u,url:h,avatar:f,role:v,title:b,userType:x="user",expertId:w,isMarryBaby:y,doctorId:C,hospitalId:E,hasQuickBooking:k,handleMakeAppointment:A,communityTrackingAttr:N,isAnonymous:T,showDetailPopup:S,subLine:P,authActionWrapper:L,profileProps:I,profileModalProps:R,extendEle:B,avatarProps:z,hideInfo:j,timeText:F,onCloseFromPost:O,avatarIcon:D,badgeIconSize:U,hideBackground:V,children:_,styles:H,dataEventCategory:W,dataEventAction:q,dataEventLabel:G}=e,{data:{locale:Z,router:Q,env:{isMarryBaby:X,togetherBasePath:K}}}=t.useContext(p.TogetherComponentGlobalContext),{t:$}=o.useTranslations(),{classes:Y}=tt(void 0,{name:"CardAuthor",styles:H}),J="boolean"==typeof y?y:X,ee=J?"marryBaby":"helloSites",te=T?$("cardPost.anonymous"):c||u||"",ae=T?s.CommonGAssets.getAssetPath("avatar.jpg"):f,le=T?void 0:v,[oe,ne]=t.useState(!1),{asPath:ie}=Q||{},re=`https://${d.domainLocales[Z]}${ie}`,se=()=>{if(T||"chatbot"===x)return!1;S?ce(!0):h&&(window.location.href=h)};t.useEffect((()=>{m.toggleNoScroll(oe)}),[oe]);const[de,ce]=t.useState(!1),ue="expert"===(null==e?void 0:e.role),[me,pe]=t.useState(null);return t.useEffect((()=>{de&&!me&&Promise.resolve().then((function(){return Ml})).then((e=>{pe((()=>e.ProfileDetail))}))}),[de]),M.default.createElement(at.Provider,{value:{handleMakeAppointment:A,doctorId:C,hospitalId:E,currentUrl:re}},M.default.createElement(et,{open:de,onClose:()=>ce(!1),profileModalProps:R},me&&M.default.createElement(me,Object.assign({currentPageUrl:G,authorProps:{userId:null==e?void 0:e.userId,avatar:ae,name:null==e?void 0:e.name,role:null==e?void 0:e.role,title:null==e?void 0:e.title},authActionWrapper:L,onCloseFromPost:()=>{ce(!1),null==O||O()}},I))),"expert"===le&&w?M.default.createElement(We,{isOpen:oe,onClose:()=>ne(!1),expertId:w}):null,"expert"===le&&C?M.default.createElement(Fe,{isOpen:oe,onClose:()=>ne(!1),doctorId:C,locale:Z}):null,"expert"===le&&E?M.default.createElement(Xe,{isOpen:oe,onClose:()=>ne(!1),hospitalId:E,locale:Z}):null,M.default.createElement("div",{className:`hhg-card-author ${Y.root} ${l} ${ue?"expert-author":""}`,"data-background":!V&&ue,"data-is-marrybaby":J},M.default.createElement(Pe,{dataEventCategory:W,dataEventAction:q,dataEventLabel:G,onAvatarClick:se,avatarProps:Object.assign(Object.assign({avatar:T?s.CommonGAssets.getAssetPath(J?"anomyous-avatar-1.svg":"anomyous-avatar.svg"):ae,username:te},z),{style:{cursor:T||!h&&!S?"default":"pointer"}}),avatarIcon:D||ue&&M.default.createElement(ve,{size:U||15})},_?M.default.createElement("div",{onClick:se},_):!j&&M.default.createElement(Pe.Row,null,M.default.createElement(Pe.ColLeft,null,M.default.createElement(a.Flex,{align:"center",onClick:se},M.default.createElement(Pe.MainText,{onClick:se},te,"chatbot"===x?M.default.createElement(M.default.Fragment,null," ",M.default.createElement(r.ShieldCheck,{color:i.theme.colors.primaryBase,size:16,style:{display:"inline-block",transform:"translate(0, 2px)"}})):le&&M.default.createElement(g.AuthorBadge,{className:Y.authorBadge,siteType:ee,role:le,title:b,style:{verticalAlign:"bottom"}}))),P||M.default.createElement(Pe.SubTextRow,null,(null==n?void 0:n.name)&&M.default.createElement(Pe.SubText,null,M.default.createElement("a",Object.assign({href:(null==n?void 0:n.slug)&&n.isActive&&!n.isHidden?`${K}/${null==n?void 0:n.slug}`:void 0,className:"author-community-name"},N),`${null==n?void 0:n.name}`)),F&&M.default.createElement(M.default.Fragment,null,M.default.createElement(Pe.SubDivider,null),M.default.createElement(Pe.SubText,{className:"time-text"},F)))),k&&M.default.createElement(Pe.ColRight,null,M.default.createElement(lt,{siteType:ee})))),B&&B))};ot.BookingBtn=lt,ot.MainText=Pe.MainText,ot.SubText=Pe.SubText,ot.SubTextRow=Pe.SubTextRow,ot.SubDivider=Pe.SubDivider;const nt=e=>({message:e("notification.failure"),type:"danger"}),it=B.default.div`
|
|
963
|
+
position: relative;
|
|
964
|
+
display: flex;
|
|
965
|
+
height: 100%;
|
|
966
|
+
flex-direction: column;
|
|
967
|
+
padding: 16px 24px;
|
|
968
|
+
|
|
969
|
+
.input-group-container {
|
|
970
|
+
flex: 1;
|
|
971
|
+
padding-right: 2px;
|
|
972
|
+
padding-left: 2px;
|
|
973
|
+
margin-bottom: 0.5rem;
|
|
974
|
+
-ms-overflow-style: none; /* IE and Edge */
|
|
975
|
+
overflow-y: auto;
|
|
976
|
+
scrollbar-width: none; /* Firefox */
|
|
977
|
+
&::-webkit-scrollbar {
|
|
978
|
+
display: none;
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
.input-group {
|
|
983
|
+
:not(:last-child) {
|
|
984
|
+
margin-bottom: 0.6rem;
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
input:focus,
|
|
988
|
+
textarea:focus,
|
|
989
|
+
[contenteditable='true'] {
|
|
990
|
+
outline: none;
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
label {
|
|
994
|
+
margin-bottom: 5px;
|
|
995
|
+
color: ${e=>e.theme.colors.gray600};
|
|
996
|
+
/* font-family: 'Open Sans', sans-serif; */
|
|
997
|
+
font-size: 13px;
|
|
998
|
+
font-weight: bold;
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
.input-group-label {
|
|
1002
|
+
margin-bottom: 5px;
|
|
1003
|
+
color: ${e=>e.theme.colors.gray600};
|
|
1004
|
+
/* font-family: 'Open Sans', sans-serif; */
|
|
1005
|
+
font-size: 13px;
|
|
1006
|
+
font-weight: bold;
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
.input-notification {
|
|
1010
|
+
display: flex;
|
|
1011
|
+
|
|
1012
|
+
& > img {
|
|
1013
|
+
width: 16px;
|
|
1014
|
+
height: 16px;
|
|
1015
|
+
margin-top: 1.5px;
|
|
1016
|
+
margin-right: 8px;
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
.tag-list {
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
.warning {
|
|
1025
|
+
margin-top: 16px;
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
.submit-btn {
|
|
1029
|
+
width: 100%;
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
.switch-label {
|
|
1033
|
+
display: flex;
|
|
1034
|
+
align-items: center;
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
.swich-input-group {
|
|
1038
|
+
padding: 12px 16px;
|
|
1039
|
+
border-radius: 8px;
|
|
1040
|
+
background: ${i.theme.colors.neutral50};
|
|
1041
|
+
|
|
1042
|
+
&.askdoctor-switch {
|
|
1043
|
+
background: ${i.theme.colors.primary50};
|
|
1044
|
+
&.mb-color {
|
|
1045
|
+
background: ${i.theme.mbColors.tonePink};
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
|
|
1049
|
+
.mantine-Switch-labelWrapper {
|
|
1050
|
+
flex-grow: 1;
|
|
1051
|
+
}
|
|
1052
|
+
.mantine-Checkbox-body {
|
|
1053
|
+
display: flex;
|
|
1054
|
+
width: 100%;
|
|
1055
|
+
align-items: center;
|
|
1056
|
+
justify-content: space-between;
|
|
1057
|
+
}
|
|
1058
|
+
.mantine-Switch-track {
|
|
1059
|
+
margin-bottom: 0;
|
|
1060
|
+
}
|
|
1061
|
+
.label-txt {
|
|
1062
|
+
font-weight: normal;
|
|
1063
|
+
font-size: 14px;
|
|
1064
|
+
color: ${i.theme.colors.gray800};
|
|
1065
|
+
margin-left: 10px;
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
`,rt=B.default.div`
|
|
1069
|
+
display: flex;
|
|
1070
|
+
width: 100%;
|
|
1071
|
+
align-items: center;
|
|
1072
|
+
justify-content: space-between;
|
|
1073
|
+
padding: 12px 16px;
|
|
1074
|
+
border-radius: 8px;
|
|
1075
|
+
background: ${i.theme.colors.primary50};
|
|
1076
|
+
|
|
1077
|
+
&[data-is-marry-baby='true'] {
|
|
1078
|
+
background: ${i.theme.mbColors.tonePink};
|
|
1079
|
+
}
|
|
1080
|
+
.switch-label {
|
|
1081
|
+
display: flex;
|
|
1082
|
+
align-items: center;
|
|
1083
|
+
gap: 12px;
|
|
1084
|
+
}
|
|
1085
|
+
margin-bottom: 12px;
|
|
1086
|
+
`,st=B.default.div`
|
|
1087
|
+
margin-bottom: 12px;
|
|
1088
|
+
color: ${i.theme.colors.red700};
|
|
1089
|
+
svg {
|
|
1090
|
+
margin-right: 5px;
|
|
1091
|
+
}
|
|
1092
|
+
svg,
|
|
1093
|
+
span {
|
|
1094
|
+
vertical-align: middle;
|
|
1095
|
+
}
|
|
1096
|
+
`;var dt="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 ct=/<mocka ([^>]*)data-url="true"[^<>]*>(.*?)<\/mocka>/gim,ut=/((?:=")|(?:data-url="true">)|)(https?:\/\/(www\.)?(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$]))/gim,mt=/\[a\+href="([^<"]+)"(?:\+text=\"([^<"]+)")?\]/gim,pt=/<mention [^>]*data-id="([^<"]+)"[^>]*>([^<]+)<\/mention>/gim,gt=/<mention [^>]*data-id="([^<"]+)" [^\>]*data-name="([^<"]+)"[^>]*>([^<]+)<\/mention>/gim,ht=/\[mention\+id="([^<"]+)"([^\]]*)\]/gim,ft=/^(https?:\/\/(www\.)?(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$]))$/gim,vt=/^((https?:\/\/)?(www\.)?(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$]))$/gim,bt=/<a [^>]*href="([^>"]+)"[^>]*>([^<]+)<\/a>/gim,xt=/<mocka [^\>]*data-bad-word="[^\"]*" [^\>]*data-error="true"[^\>]*>(.*?)<\/mocka>/gim,wt=({url:e,text:t,method:a})=>{const l=t.indexOf(t.trimStart()),o=t.trimEnd().length,n=t.substring(0,l),i=t.substring(l,o),r=t.substring(o);return"edit"===a?`${n}<mocka data-href="${e}" data-url="true">${i}</mocka>${r}`:"display"===a&&(e.startsWith("http://")||e.startsWith("https://"))?`${n}<a href="${e}" target="_blank">${i}</a>${r}`:t},yt=(e,t)=>e.replace(mt,((e,a,l)=>wt({text:l||a,url:a,method:t}))).replace(bt,((e,a,l)=>wt({text:l||a,url:a,method:t}))),Ct=(e,t=[])=>e.replace(ht,((e,a,l)=>{const o=t.find((e=>String(e.id)===a));if(!o){if(!l)return"";let e="";return l.replace(/\+name="([^<"]+)"/i,((t,a)=>(e=a,t))),`<mention data-id="${a}" data-name="${e}">${e}</mention>`}return`<mention data-id="${a}" data-name="${o.name}">${o.name}</mention>`})),Et=e=>{const t=[];return e.replace(/(\&)+/g,"&").replace(ut,((e,a,l)=>('="'!==a&&'data-url="true">'!==a&&t.push(l),e))),t},kt=(e,t)=>{const a=[];return e.replace(pt,((e,t)=>(a.push(t),e))).replace(ht,((e,t)=>(a.push(t),e))),t?a:Array.from(new Set(a)).slice(0,30)},At=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Nt=e=>e.replace(xt,"$1"),Tt=(e,t=(e=>e))=>((e,t=(e=>e))=>{var a;return t(null===(a=e.replace(/(\ )+/g," ").replace(/(\&)+/g,"&"))||void 0===a?void 0:a.replace(/(\u200c|‌)+/g,"").replace(ut,((e,t,a)=>'="'!==t&&'data-url="true">'!==t?`<a href="${a}" target="_blank">${a}</a>`:e)).replace(ct,((e,t,a)=>{var l;const o=null===(l=t.match(/data-href="([^"]*)"/im))||void 0===l?void 0:l[1];return o?`<a href="${o}" target="_blank">${a}</a>`:`<a href="${a}" target="_blank">${a}</a>`})))})((e=>e.replace(pt,((e,t,a)=>`[mention+id="${t}"+name="${a}"]`)))(Nt(e)),t),St=["hellobacsi.com","hellosehat.com","hellodoktor.com","hellokrupet.com","hellodoctor.com.ph","hellokhunmor.com","hellosayarwon.com","helloyishi.com.tw","helloswasthya.com","marrybaby.vn"],Pt=e=>e.match(vt)?e.startsWith("https://")||e.startsWith("http://")?e:`https://${e}`:"",Lt=(e,t)=>{const a=t.filter(Boolean);if(e&&a.length>0){return Nt(e).replace(new RegExp(`\\b(${a.map((e=>At(e))).join("|")})\\b`,"gi"),((e,t)=>{const a=document.createElement("mocka");return a.setAttribute("data-bad-word",t),a.setAttribute("data-error","true"),a.innerText=t,`${a.outerHTML}`}))}return e},Mt=(t,a,l)=>"string"==typeof t?Promise.resolve(t):e.__awaiter(void 0,void 0,void 0,(function*(){var e;const o=new FormData;if(t.type.startsWith("image/gif"))o.append("image",t);else{const e=yield Promise.resolve().then((function(){return P(require("browser-image-compression"))})),a=yield e.default(t,{maxSizeMB:.4,maxWidthOrHeight:1536,useWebWorker:!0});o.append("image",a)}const n=l?p.callApiWithAdminAuth:p.callApiWithAuth,i=yield n(p.getApiPath(l?p.ADMIN_PATHS.COMMENT.IMAGE_UPLOAD:p.PATHS.COMMENT.IMAGE_UPLOAD,{_locale:a}),"POST",{data:o});return(null===(e=null==i?void 0:i.data)||void 0===e?void 0:e.image)||""})),It=(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}},Rt=B.default.div`
|
|
963
1097
|
input:focus,
|
|
964
1098
|
textarea:focus,
|
|
965
1099
|
[contenteditable='true'] {
|
|
@@ -1078,7 +1212,7 @@
|
|
|
1078
1212
|
margin-right: 8px;
|
|
1079
1213
|
}
|
|
1080
1214
|
}
|
|
1081
|
-
`,
|
|
1215
|
+
`,Bt=B.default.div`
|
|
1082
1216
|
height: 100%;
|
|
1083
1217
|
position: relative;
|
|
1084
1218
|
width: 100%;
|
|
@@ -1277,7 +1411,7 @@
|
|
|
1277
1411
|
}
|
|
1278
1412
|
}
|
|
1279
1413
|
}
|
|
1280
|
-
`;let It=null;function Rt(e){var t,a;let l=-1;if(void 0!==window.getSelection){const o=window.getSelection();if((null==o?void 0:o.rangeCount)&&(null==o?void 0:o.rangeCount)>0){const o=null===(t=window.getSelection())||void 0===t?void 0:t.getRangeAt(0);if(o){const t=o.cloneRange();t.selectNodeContents(e),t.setEnd(o.endContainer,o.endOffset),l=Bt(t.cloneContents().childNodes,l);const n=null===(a=o.endContainer.parentElement)||void 0===a?void 0:a.closest("mocka"),i=o.endContainer.nodeValue||o.endContainer.outerHTML;n&&(null==i?void 0:i.length)&&(l=l-o.endOffset+(n.outerHTML.length-(null==n?void 0:n.outerHTML.lastIndexOf(i))))}}}return l}function Bt(e,t){return e.forEach(((a,l)=>{const o=l+1===e.length;if(a.nodeType===Node.ELEMENT_NODE){const e=a.outerHTML;if(!o)return void(t+=e.length);t+=e.indexOf(">")+1,t=Bt(a.childNodes,t)}else a.nodeType===Node.TEXT_NODE&&(t+=(a.nodeValue||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").length)})),t}e.__awaiter(void 0,void 0,void 0,(function*(){if("undefined"==typeof window)return;const e=yield Promise.resolve().then((function(){return P(require("react-quill"))}));It=e.default;const t=e.Quill||It.Quill;t.register("modules/preserveWhiteSpace",class{constructor(e,t){this.quill=e,this.options=t,e.container.style.whiteSpace="pre-line"}});const a=t.import("blots/inline");class l extends a{static create(e){if(!e)return super.create(!1);const t=super.create(e);return l.setNodeConfigurations(t,e),t}static formats(e){return!(!e.innerText||!(e.getAttribute("data-href")||e.getAttribute("data-url")||e.getAttribute("data-error")||e.getAttribute("data-bad-word")))&&{"data-bad-word":e.getAttribute("data-bad-word"),"data-error":e.getAttribute("data-error"),"data-href":e.getAttribute("data-href"),"data-url":e.getAttribute("data-url"),"data-text":e.innerText||e.getAttribute("data-href")}}static setNodeConfigurations(e,t){var a,l;t&&(null===(l=null===(a=null==t?void 0:t["data-text"])||void 0===a?void 0:a.replace(/(\ )+/g," "))||void 0===l?void 0:l.replace(/(\u200c|‌)+/g,""))&&(t["data-bad-word"]&&e.setAttribute("data-bad-word",t["data-bad-word"]),t["data-href"]&&e.setAttribute("data-href",t["data-href"]),t["data-error"]&&e.setAttribute("data-error",t["data-error"]),t["data-url"]&&e.setAttribute("data-url",t["data-url"]))}}l.blotName="mocka1",l.tagName="mocka",t.register(l);class o extends a{static create(e){if(!e)return super.create(!1);const t=super.create(e);return o.setNodeConfigurations(t,e),t}static formats(e){return!(!e.getAttribute("data-name")||!e.getAttribute("data-id"))&&{"data-name":e.getAttribute("data-name"),"data-id":e.getAttribute("data-id")}}static setNodeConfigurations(e,t){var a,l;t&&t["data-id"]&&(null===(l=null===(a=null==t?void 0:t["data-name"])||void 0===a?void 0:a.replace(/(\ )+/g," "))||void 0===l?void 0:l.replace(/(\u200c|‌)+/g,""))&&(t["data-id"]&&e.setAttribute("data-id",t["data-id"]),t["data-name"]&&e.setAttribute("data-name",t["data-name"]))}}o.blotName="mention",o.tagName="mention",t.register(o)}));const zt=(e,t)=>{var a;const{formatUrl:l,bannedWords:o=[]}=t||{},n=e.replace(/<font [^\>]*>(.+)<\/font>/gim,((e,t)=>t.replace(/<u[^\>]*>(.+)<\/u>/gim,"$1"))).replace(ut,((e,t,a,l)=>{if(l!==a){const e=a.split(" "),o=e.findIndex(((t,a)=>{const o=e.slice(0,a+1).join(" ");return!l.startsWith(o)}));if(0===o)return`@${l}`;{const a=(o<0?e:e.slice(0,o)).join(" "),n=l.slice(a.length).trim();return console.log(o,a,n),`<mention data-id="${t}" data-name="${a}">${a}</mention> ${n} `}}return e}));if(!l)return{value:Tt(n,o)};let i=(e=>e.replace(ft,((e,t)=>{const a=document.createElement("div");a.innerHTML=e;const l=a.firstChild;return(null==l?void 0:l.innerText)!==(null==l?void 0:l.getAttribute("data-bad-word"))?t:e})))((e=>{var t,a;return null===(a=null===(t=e.replace(/(\ )+/g," "))||void 0===t?void 0:t.replace(/(\u200c|‌)+/g,""))||void 0===a?void 0:a.replace(rt,((e,t,a)=>{var l;const o=null===(l=t.match(/data-href="([^"]*)"/im))||void 0===l?void 0:l[1];return!o||o===a||a.match(pt)?a:o?`<a href="${o}">${a}</a>`:`<a href="${a}">${a}</a>`})).replace(st,((e,t,a)=>{if('="'!==t&&'data-url="true">'!==t){const e=a.toLowerCase(),t=`${e.startsWith("http")?"":" https://"}${e}`;return vt({text:t,url:t,method:"edit"})}return e})).replace(ht,((e,t,a)=>vt({text:a||t,url:t,method:"edit"})))})(n));const r=(e=>{var t;return[...wt(e),...(null===(t=e.match(rt))||void 0===t?void 0:t.map((e=>{var t,a;const l=null===(t=e.match(/data-href="([^"]*)"/im))||void 0===t?void 0:t[1],o=null===(a=e.match(/>(.*?)<\/mocka>/im))||void 0===a?void 0:a[1];return l||o})))||[]].filter((e=>!!e))})(n);if(r){const e=[];let t="";return r.forEach((t=>{if(t)try{const a=new URL(t);At.some((e=>a.origin.endsWith(e)))||e.push(t)}catch(a){e.push(t)}})),e.length>0&&(i=i.replace(new RegExp(`data-url="true">(${e.map(Ct).join("|")})<`,"gi"),'data-error="true" data-url="true">$1<').replace(new RegExp(`data-href="(${e.map(Ct).join("|")})" data-url="true">`,"gi"),'data-href="$1" data-error="true" data-url="true">')),t=null===(a=r.filter((t=>-1===e.indexOf(t))))||void 0===a?void 0:a[0],{invalidUrls:e,previewUrl:t,value:Tt(i,o)}}return{value:Tt(i,o)}},jt=({html:a,onChange:l,className:o,style:n,onImagePickerClick:i,bannedWords:r=[],onInvalidUrlsChange:s,onPreviewUrlChange:d,setEditorRef:c,isReplying:u})=>{var m,g,h,v;const b=t.useRef([]);b.current=r;const[x,w]=t.useState([]),[C,E]=t.useState(null),{data:{locale:k}}=t.useContext(p.TogetherComponentGlobalContext),A=(null==r?void 0:r.join(","))||"";t.useEffect((()=>{var e,t;const a=null===(t=null===(e=j.current)||void 0===e?void 0:e.getEditor())||void 0===t?void 0:t.root.innerHTML;P(a)}),[A]);const T=e=>{C&&C.url===e||(E({url:e,isFetching:!0}),p.callApi(p.getApiPath(p.PATHS.FETCH_PREVIEW,{_locale:k}),"POST",{data:{link:e}}).then((t=>{var a,l,o,n;E({title:null===(a=null==t?void 0:t.data)||void 0===a?void 0:a.title,description:null===(l=null==t?void 0:t.data)||void 0===l?void 0:l.description,image:(null===(o=null==t?void 0:t.data)||void 0===o?void 0:o.image)||(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.logo),url:e})})).catch((()=>{E(null)})))},S=t.useRef(T);S.current=T;const P=t.useCallback(z.default((e=>{if(e){const t=zt(e,{bannedWords:b.current,formatUrl:!0}),{invalidUrls:a,previewUrl:o,value:n}=t;a&&w(a),o?S.current(o):E(null),n!==e&&(null==l||l(n))}}),500),[]);t.useEffect((()=>{s&&s(x)}),[x]),t.useEffect((()=>{d&&((null==C?void 0:C.url)?d({title:C.title||"",url:C.url||"",image:C.image||"",description:C.description||""}):d(null))}),[C]);const L=t.useRef(i);L.current=i;const I=N.useUniqueId(),R=t.useRef({toolbar:{handlers:{image:()=>{var e;return null===(e=L.current)||void 0===e?void 0:e.call(L)},link:()=>!1},container:"#toolbar-"+I},preserveWhiteSpace:!0}),B=t.useRef(-1),j=t.useRef(null);c&&(null===(g=null===(m=j.current)||void 0===m?void 0:m.getEditor())||void 0===g?void 0:g.root)&&c(null===(v=null===(h=j.current)||void 0===h?void 0:h.getEditor())||void 0===v?void 0:v.root);const F=()=>{var e,t,a,l,o,n,i,r;if(null===(t=null===(e=j.current)||void 0===e?void 0:e.getEditor())||void 0===t?void 0:t.root){const e=Rt(null===(l=null===(a=j.current)||void 0===a?void 0:a.getEditor())||void 0===l?void 0:l.root),t=null===(n=null===(o=j.current)||void 0===o?void 0:o.getEditor())||void 0===n?void 0:n.root.innerHTML;if(e>=0&&e<t.length){if(yt(t,!0).length<30-(u?1:0)){const e=function(e){var t,a;let l=null;if(void 0!==window.getSelection){const o=window.getSelection();if((null==o?void 0:o.rangeCount)&&(null==o?void 0:o.rangeCount)>0){const o=null===(t=window.getSelection())||void 0===t?void 0:t.getRangeAt(0);if(o){const t=o.cloneRange();t.selectNodeContents(e),t.setEnd(o.endContainer,o.endOffset);const n=(t.endContainer.nodeValue||"").substring(0,o.endOffset),i=n.lastIndexOf("@");if(i+1<n.length&&(0===i||" @"===n.slice(i-1,i+1))){const e=null===(a=n.slice(i+1))||void 0===a?void 0:a.trim();if(e){t.setStart(o.endContainer,i);const a=t.cloneRange();a.setStart(a.endContainer,i),l={name:e,rect:t.getBoundingClientRect(),replaceRange:a}}}}}}return l}(null===(r=null===(i=j.current)||void 0===i?void 0:i.getEditor())||void 0===r?void 0:r.root);e?(_(e.name,e.rect),q.current=e.replaceRange):(q.current=null,_("",null))}else q.current=null,_("",null);B.current=e}}else D([])},[O,D]=t.useState([]),[U,V]=t.useState({top:0,left:0}),_=t.useCallback(z.default(((t,a,l)=>e.__awaiter(void 0,void 0,void 0,(function*(){var e,o,n,i;if(!t||!DOMRect)return D([]);const r=yield((null===(e=y.getCookie(p.BEARER_TOKEN_COOKIE))||void 0===e?void 0:e.length)||0)>0?p.callApiWithAuth(p.getApiPath(p.PATHS.SEARCH_USER,{_locale:k,name:t}),"get"):p.callApiWithAdminAuth(p.getApiPath(p.ADMIN_PATHS.SEARCH_USER,{_locale:k,name:t}),"get");Q(0),D(null===(n=null===(o=null==r?void 0:r.data)||void 0===o?void 0:o.users)||void 0===n?void 0:n.filter((e=>!(null==l?void 0:l.includes(String(e.id))))));const s=a,d=null===(i=W.current)||void 0===i?void 0:i.getBoundingClientRect();if(s&&d){const e=343,t=256,a={top:s.bottom-d.top,width:"min(343px, 100%)",maxHeight:t};d.width-(s.left-d.left)<e?a.right=0:a.left=s.left-d.left,V(a)}}))),500),[]),H=(e,t)=>{var a,l,o;if(q.current){q.current.deleteContents();const n=document.createElement("mention");n.setAttribute("data-id",e),n.setAttribute("data-name",t),n.innerText=t;const i=document.createTextNode(" ");q.current.insertNode(i),q.current.insertNode(n);(null===(l=null===(a=j.current)||void 0===a?void 0:a.getEditor())||void 0===l?void 0:l.root).focus();const r=null===(o=window.getSelection())||void 0===o?void 0:o.getRangeAt(0);null==r||r.setStart(q.current.endContainer,q.current.endOffset),null==r||r.setEnd(q.current.endContainer,q.current.endOffset)}D([])},W=t.useRef(null),q=t.useRef(null),G=t.useRef(null),[Z,Q]=t.useState(0);return t.useEffect((()=>{if(G.current){const e=G.current,t=e.children.item(Z);if(t){const a=e.getBoundingClientRect(),l=t.getBoundingClientRect();t.offsetTop<e.scrollTop?e.scrollTop=t.offsetTop:t.offsetTop+l.height>e.scrollTop+a.height&&(e.scrollTop=t.offsetTop-a.height+l.height)}}}),[Z]),t.useEffect((()=>{const e=function(e){var t;(null===(t=W.current)||void 0===t?void 0:t.contains(e.target))||D([])};return window.addEventListener("click",e,{passive:!0}),()=>{window.removeEventListener("click",e)}}),[]),M.default.createElement(Mt,{ref:W,className:o,style:n,onKeyDownCapture:e=>{if(null==O?void 0:O.length){let t=!1;if("ArrowDown"===e.key)t=!0,Q((e=>e+1>=O.length?0:e+1));else if("Escape"===e.key)t=!0,Q(0),D([]);else if("ArrowUp"===e.key)t=!0,Q((e=>e-1<0?O.length-1:e-1));else if("Enter"===e.key||"Tab"===e.key){const e=O[Z];e&&(t=!0,H(e.id,e.name))}if(t)return e.preventDefault(),!1}}},M.default.createElement(Ft,{id:I,onAddLink:(e,t)=>{var a,o;const n=B.current+1,i=null===(o=null===(a=j.current)||void 0===a?void 0:a.getEditor())||void 0===o?void 0:o.root.innerHTML,r=((null==i?void 0:i.substring(0,n))||"")+`<mocka data-href="${t}" data-url="true">${e}</mocka> `+((null==i?void 0:i.substring(n))||"");null==l||l(r),P(r)}}),It&&M.default.createElement(It,{ref:j,theme:"snow",value:a,onChange:e=>{null==l||l(e),P(e),F()},onChangeSelection:()=>{F()},modules:R.current,formats:["mocka1","mention","id","key","bold","italic","underline","list","bullet"]}),!!(null==O?void 0:O.length)&&M.default.createElement("div",{ref:G,className:"mention-search-container",style:U},O.map(((e,t)=>M.default.createElement("div",{className:"mention-search-item "+(Z===t?"item-selected":""),key:e.id,onClick:t=>{t.preventDefault(),t.stopPropagation(),H(e.id,e.name)},onMouseEnter:()=>{Q(t)}},M.default.createElement(p.UserAvatar,{className:"search-avatar",username:e.name,avatar:e.avatar}),M.default.createElement("div",null,M.default.createElement(f.Text,{size:"p2"},e.name),M.default.createElement(f.Text,{size:"p4",color:"#595959"},"@",e.username)))))))},Ft=({onAddLink:e,id:t})=>M.default.createElement("div",{id:"toolbar-"+t,onClick:e=>{e.preventDefault(),e.stopPropagation()}},M.default.createElement("span",{className:"ql-formats"},M.default.createElement("button",{className:"ql-bold",type:"button"}),M.default.createElement("button",{className:"ql-italic",type:"button"}),M.default.createElement("button",{className:"ql-underline",type:"button"})),M.default.createElement("span",{className:"ql-formats"},M.default.createElement("button",{className:"ql-list",value:"ordered",type:"button"}),M.default.createElement("button",{className:"ql-list",value:"bullet",type:"button"})),M.default.createElement("span",{className:"ql-formats"},M.default.createElement("button",{className:"ql-image",type:"button"}),e&&M.default.createElement(pe,{className:"link-tool-wrapper",toggleButtonContent:M.default.createElement("img",{className:"link-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='M9.54545 16H7.09091C6.55368 16 6.02172 15.8965 5.52539 15.6955C5.02905 15.4945 4.57808 15.1999 4.1982 14.8284C3.43101 14.0783 3 13.0609 3 12C3 10.9391 3.43101 9.92172 4.1982 9.17157C4.96539 8.42143 6.00593 8 7.09091 8H9.54545M13.9256 8H16.9091C17.4463 8 17.9783 8.10346 18.4746 8.30448C18.9709 8.5055 19.4219 8.80014 19.8018 9.17157C20.1817 9.54301 20.483 9.98396 20.6886 10.4693C20.8942 10.9546 21 11.4747 21 12C21 12.5253 20.8942 13.0454 20.6886 13.5307C20.483 14.016 20.1817 14.457 19.8018 14.8284C19.4219 15.1999 18.9709 15.4945 18.4746 15.6955C17.9783 15.8965 17.4463 16 16.9091 16H13.9256' stroke='%23737373' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M9 12H15' stroke='%23737373' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e"}),buttonProps:{size:"md",color:"transparent"},align:"end"},(({setShow:t})=>M.default.createElement(Dt,{onAddUrl:e,setShow:t}))))),Ot=["notification.limitUrlDomain","notification.urlWrongFormat"],Dt=({onAddUrl:e,setShow:a})=>{const{data:{env:{isMarryBaby:l}}}=t.useContext(p.TogetherComponentGlobalContext),{t:n}=o.useTranslations(),[i,r]=t.useState(""),[s,d]=t.useState(""),[c,u]=t.useState(-1),m=i.trim()&&s.trim()&&c<0;return M.default.createElement("div",{className:"link-tool-popover"},M.default.createElement(v.Input,{name:"url",value:i,size:"md",label:"URL",placeholder:n("placeholder.enterUrlHere"),type:"text",className:"link-input-url",onChange:e=>{r(e),(e=>{const t=Nt(e.trim());try{const e=new URL(t);return e.protocol.startsWith("http")?At.some((t=>e.origin.endsWith("/"+t)||e.origin.endsWith("."+t)))?(u(-1),!0):(u(0),!1):(u(1),!1)}catch(e){return u(1),!1}})(e)}}),c>=0&&M.default.createElement(f.Text,{size:"c2",className:"error-text"},n(Ot[c])),M.default.createElement(v.Input,{name:"text",value:s,size:"md",label:n("createPost.urlText"),placeholder:n("placeholder.enterUrlTextHere"),type:"text",className:"link-input-text",onChange:e=>d(e)}),M.default.createElement("div",{"data-is-marrybaby":l,className:"link-input-button-wrapper"},M.default.createElement(w.Button,{theme:l?"marryBaby":"helloSites",size:"sm",color:"primary",className:"link-input-button",onClick:()=>{m&&(e(s.trim(),Nt(i.trim())),a&&a(!1))},isDisabled:!m},n("insert"))))};var Ut="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 Vt=({className:e,style:a,bannedWords:l=[],value:n,onChange:r,onPreviewUrlChange:s,onInvalidUrlsChange:d,onImageFilesChange:c,imageFiles:u,isReplying:m})=>{const{t:g}=o.useTranslations(),[h,v]=t.useState(null),b=t.useRef(null),{onSelectImages:x,onRemoveImage:w,imageSrcs:y}=Pt(u,c);return t.useEffect((()=>{s&&((null==h?void 0:h.url)?s({title:h.title||"",url:h.url||"",image:h.image||"",description:h.description||""}):s(null))}),[h]),M.default.createElement(Lt,{className:e,style:a},M.default.createElement(f.Text,{size:"p4",className:"description-label"},g("createPost.popup.description")),M.default.createElement("div",{className:"textarea-control"},M.default.createElement("div",{className:"textarea-wrapper"},M.default.createElement(jt,{html:n||"",onChange:r,bannedWords:l,onImagePickerClick:()=>{var e;return null===(e=b.current)||void 0===e?void 0:e.click()},onPreviewUrlChange:v,onInvalidUrlsChange:d,isReplying:m}))),M.default.createElement(f.Text,{size:"p4",className:"count-string"},g("character"),": ",I.default(n||"").length),(!y||0===y.length)&&h&&M.default.createElement("div",{className:"link-preview-wrapper"},h.isFetching?M.default.createElement(q,null):M.default.createElement(M.default.Fragment,null,M.default.createElement(Z,{title:h.title,url:h.url||"#",image:h.image,noRefetch:!0}),M.default.createElement("img",{src:Ut,className:"icon-close",onClick:()=>v(null)}))),M.default.createElement("input",{ref:b,type:"file",accept:"image/png, image/gif, image/jpeg",multiple:!0,style:{display:"none"},onChange:x}),y.length>p.MAX_IMAGE_UPLOADS?M.default.createElement("div",{className:"input-notification"},M.default.createElement("img",{src:it}),M.default.createElement(f.Text,{size:"p4",color:i.theme.colors.alertWarning},g("createPost.popup.warningImage"))):null,y.length>0&&M.default.createElement("div",{className:"image-gallery"},y.map(((e,t)=>M.default.createElement("div",{key:t,className:"image-item"},M.default.createElement("img",{src:e}),M.default.createElement("img",{className:"close-btn",src:Ut,onClick:()=>w(t)}))))))},_t=B.default.div`
|
|
1414
|
+
`;let zt=null;function jt(e){var t,a;let l=-1;if(void 0!==window.getSelection){const o=window.getSelection();if((null==o?void 0:o.rangeCount)&&(null==o?void 0:o.rangeCount)>0){const o=null===(t=window.getSelection())||void 0===t?void 0:t.getRangeAt(0);if(o){const t=o.cloneRange();t.selectNodeContents(e),t.setEnd(o.endContainer,o.endOffset),l=Ft(t.cloneContents().childNodes,l);const n=null===(a=o.endContainer.parentElement)||void 0===a?void 0:a.closest("mocka"),i=o.endContainer.nodeValue||o.endContainer.outerHTML;n&&(null==i?void 0:i.length)&&(l=l-o.endOffset+(n.outerHTML.length-(null==n?void 0:n.outerHTML.lastIndexOf(i))))}}}return l}function Ft(e,t){return e.forEach(((a,l)=>{const o=l+1===e.length;if(a.nodeType===Node.ELEMENT_NODE){const e=a.outerHTML;if(!o)return void(t+=e.length);t+=e.indexOf(">")+1,t=Ft(a.childNodes,t)}else a.nodeType===Node.TEXT_NODE&&(t+=(a.nodeValue||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").length)})),t}e.__awaiter(void 0,void 0,void 0,(function*(){if("undefined"==typeof window)return;const e=yield Promise.resolve().then((function(){return P(require("react-quill"))}));zt=e.default;const t=e.Quill||zt.Quill;t.register("modules/preserveWhiteSpace",class{constructor(e,t){this.quill=e,this.options=t,e.container.style.whiteSpace="pre-line"}});const a=t.import("blots/inline");class l extends a{static create(e){if(!e)return super.create(!1);const t=super.create(e);return l.setNodeConfigurations(t,e),t}static formats(e){return!(!e.innerText||!(e.getAttribute("data-href")||e.getAttribute("data-url")||e.getAttribute("data-error")||e.getAttribute("data-bad-word")))&&{"data-bad-word":e.getAttribute("data-bad-word"),"data-error":e.getAttribute("data-error"),"data-href":e.getAttribute("data-href"),"data-url":e.getAttribute("data-url"),"data-text":e.innerText||e.getAttribute("data-href")}}static setNodeConfigurations(e,t){var a,l;t&&(null===(l=null===(a=null==t?void 0:t["data-text"])||void 0===a?void 0:a.replace(/(\ )+/g," "))||void 0===l?void 0:l.replace(/(\u200c|‌)+/g,""))&&(t["data-bad-word"]&&e.setAttribute("data-bad-word",t["data-bad-word"]),t["data-href"]&&e.setAttribute("data-href",t["data-href"]),t["data-error"]&&e.setAttribute("data-error",t["data-error"]),t["data-url"]&&e.setAttribute("data-url",t["data-url"]))}}l.blotName="mocka1",l.tagName="mocka",t.register(l);class o extends a{static create(e){if(!e)return super.create(!1);const t=super.create(e);return o.setNodeConfigurations(t,e),t}static formats(e){return!(!e.getAttribute("data-name")||!e.getAttribute("data-id"))&&{"data-name":e.getAttribute("data-name"),"data-id":e.getAttribute("data-id")}}static setNodeConfigurations(e,t){var a,l;t&&t["data-id"]&&(null===(l=null===(a=null==t?void 0:t["data-name"])||void 0===a?void 0:a.replace(/(\ )+/g," "))||void 0===l?void 0:l.replace(/(\u200c|‌)+/g,""))&&(t["data-id"]&&e.setAttribute("data-id",t["data-id"]),t["data-name"]&&e.setAttribute("data-name",t["data-name"]))}}o.blotName="mention",o.tagName="mention",t.register(o)}));const Ot=(e,t)=>{var a;const{formatUrl:l,bannedWords:o=[]}=t||{},n=e.replace(/<font [^\>]*>(.+)<\/font>/gim,((e,t)=>t.replace(/<u[^\>]*>(.+)<\/u>/gim,"$1"))).replace(gt,((e,t,a,l)=>{if(l!==a){const e=a.split(" "),o=e.findIndex(((t,a)=>{const o=e.slice(0,a+1).join(" ");return!l.startsWith(o)}));if(0===o)return`@${l}`;{const a=(o<0?e:e.slice(0,o)).join(" "),n=l.slice(a.length).trim();return console.log(o,a,n),`<mention data-id="${t}" data-name="${a}">${a}</mention> ${n} `}}return e}));if(!l)return{value:Lt(n,o)};let i=(e=>e.replace(xt,((e,t)=>{const a=document.createElement("div");a.innerHTML=e;const l=a.firstChild;return(null==l?void 0:l.innerText)!==(null==l?void 0:l.getAttribute("data-bad-word"))?t:e})))((e=>{var t,a;return null===(a=null===(t=e.replace(/(\ )+/g," "))||void 0===t?void 0:t.replace(/(\u200c|‌)+/g,""))||void 0===a?void 0:a.replace(ct,((e,t,a)=>{var l;const o=null===(l=t.match(/data-href="([^"]*)"/im))||void 0===l?void 0:l[1];return!o||o===a||a.match(ft)?a:o?`<a href="${o}">${a}</a>`:`<a href="${a}">${a}</a>`})).replace(ut,((e,t,a)=>{if('="'!==t&&'data-url="true">'!==t){const e=a.toLowerCase(),t=`${e.startsWith("http")?"":" https://"}${e}`;return wt({text:t,url:t,method:"edit"})}return e})).replace(bt,((e,t,a)=>wt({text:a||t,url:t,method:"edit"})))})(n));const r=(e=>{var t;return[...Et(e),...(null===(t=e.match(ct))||void 0===t?void 0:t.map((e=>{var t,a;const l=null===(t=e.match(/data-href="([^"]*)"/im))||void 0===t?void 0:t[1],o=null===(a=e.match(/>(.*?)<\/mocka>/im))||void 0===a?void 0:a[1];return l||o})))||[]].filter((e=>!!e))})(n);if(r){const e=[];let t="";return r.forEach((t=>{if(t)try{const a=new URL(t);St.some((e=>a.origin.endsWith(e)))||e.push(t)}catch(a){e.push(t)}})),e.length>0&&(i=i.replace(new RegExp(`data-url="true">(${e.map(At).join("|")})<`,"gi"),'data-error="true" data-url="true">$1<').replace(new RegExp(`data-href="(${e.map(At).join("|")})" data-url="true">`,"gi"),'data-href="$1" data-error="true" data-url="true">')),t=null===(a=r.filter((t=>-1===e.indexOf(t))))||void 0===a?void 0:a[0],{invalidUrls:e,previewUrl:t,value:Lt(i,o)}}return{value:Lt(i,o)}},Dt=({html:a,onChange:l,className:o,style:n,onImagePickerClick:i,bannedWords:r=[],onInvalidUrlsChange:s,onPreviewUrlChange:d,setEditorRef:c,isReplying:u})=>{var m,g,h,v;const b=t.useRef([]);b.current=r;const[x,w]=t.useState([]),[C,E]=t.useState(null),{data:{locale:k}}=t.useContext(p.TogetherComponentGlobalContext),A=(null==r?void 0:r.join(","))||"";t.useEffect((()=>{var e,t;const a=null===(t=null===(e=j.current)||void 0===e?void 0:e.getEditor())||void 0===t?void 0:t.root.innerHTML;P(a)}),[A]);const T=e=>{C&&C.url===e||(E({url:e,isFetching:!0}),p.callApi(p.getApiPath(p.PATHS.FETCH_PREVIEW,{_locale:k}),"POST",{data:{link:e}}).then((t=>{var a,l,o,n;E({title:null===(a=null==t?void 0:t.data)||void 0===a?void 0:a.title,description:null===(l=null==t?void 0:t.data)||void 0===l?void 0:l.description,image:(null===(o=null==t?void 0:t.data)||void 0===o?void 0:o.image)||(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.logo),url:e})})).catch((()=>{E(null)})))},S=t.useRef(T);S.current=T;const P=t.useCallback(z.default((e=>{if(e){const t=Ot(e,{bannedWords:b.current,formatUrl:!0}),{invalidUrls:a,previewUrl:o,value:n}=t;a&&w(a),o?S.current(o):E(null),n!==e&&(null==l||l(n))}}),500),[]);t.useEffect((()=>{s&&s(x)}),[x]),t.useEffect((()=>{d&&((null==C?void 0:C.url)?d({title:C.title||"",url:C.url||"",image:C.image||"",description:C.description||""}):d(null))}),[C]);const L=t.useRef(i);L.current=i;const I=N.useUniqueId(),R=t.useRef({toolbar:{handlers:{image:()=>{var e;return null===(e=L.current)||void 0===e?void 0:e.call(L)},link:()=>!1},container:"#toolbar-"+I},preserveWhiteSpace:!0}),B=t.useRef(-1),j=t.useRef(null);c&&(null===(g=null===(m=j.current)||void 0===m?void 0:m.getEditor())||void 0===g?void 0:g.root)&&c(null===(v=null===(h=j.current)||void 0===h?void 0:h.getEditor())||void 0===v?void 0:v.root);const F=()=>{var e,t,a,l,o,n,i,r;if(null===(t=null===(e=j.current)||void 0===e?void 0:e.getEditor())||void 0===t?void 0:t.root){const e=jt(null===(l=null===(a=j.current)||void 0===a?void 0:a.getEditor())||void 0===l?void 0:l.root),t=null===(n=null===(o=j.current)||void 0===o?void 0:o.getEditor())||void 0===n?void 0:n.root.innerHTML;if(e>=0&&e<t.length){if(kt(t,!0).length<30-(u?1:0)){const e=function(e){var t,a;let l=null;if(void 0!==window.getSelection){const o=window.getSelection();if((null==o?void 0:o.rangeCount)&&(null==o?void 0:o.rangeCount)>0){const o=null===(t=window.getSelection())||void 0===t?void 0:t.getRangeAt(0);if(o){const t=o.cloneRange();t.selectNodeContents(e),t.setEnd(o.endContainer,o.endOffset);const n=(t.endContainer.nodeValue||"").substring(0,o.endOffset),i=n.lastIndexOf("@");if(i+1<n.length&&(0===i||" @"===n.slice(i-1,i+1))){const e=null===(a=n.slice(i+1))||void 0===a?void 0:a.trim();if(e){t.setStart(o.endContainer,i);const a=t.cloneRange();a.setStart(a.endContainer,i),l={name:e,rect:t.getBoundingClientRect(),replaceRange:a}}}}}}return l}(null===(r=null===(i=j.current)||void 0===i?void 0:i.getEditor())||void 0===r?void 0:r.root);e?(_(e.name,e.rect),q.current=e.replaceRange):(q.current=null,_("",null))}else q.current=null,_("",null);B.current=e}}else D([])},[O,D]=t.useState([]),[U,V]=t.useState({top:0,left:0}),_=t.useCallback(z.default(((t,a,l)=>e.__awaiter(void 0,void 0,void 0,(function*(){var e,o,n,i;if(!t||!DOMRect)return D([]);const r=yield((null===(e=y.getCookie(p.BEARER_TOKEN_COOKIE))||void 0===e?void 0:e.length)||0)>0?p.callApiWithAuth(p.getApiPath(p.PATHS.SEARCH_USER,{_locale:k,name:t}),"get"):p.callApiWithAdminAuth(p.getApiPath(p.ADMIN_PATHS.SEARCH_USER,{_locale:k,name:t}),"get");Q(0),D(null===(n=null===(o=null==r?void 0:r.data)||void 0===o?void 0:o.users)||void 0===n?void 0:n.filter((e=>!(null==l?void 0:l.includes(String(e.id))))));const s=a,d=null===(i=W.current)||void 0===i?void 0:i.getBoundingClientRect();if(s&&d){const e=343,t=256,a={top:s.bottom-d.top,width:"min(343px, 100%)",maxHeight:t};d.width-(s.left-d.left)<e?a.right=0:a.left=s.left-d.left,V(a)}}))),500),[]),H=(e,t)=>{var a,l,o;if(q.current){q.current.deleteContents();const n=document.createElement("mention");n.setAttribute("data-id",e),n.setAttribute("data-name",t),n.innerText=t;const i=document.createTextNode(" ");q.current.insertNode(i),q.current.insertNode(n);(null===(l=null===(a=j.current)||void 0===a?void 0:a.getEditor())||void 0===l?void 0:l.root).focus();const r=null===(o=window.getSelection())||void 0===o?void 0:o.getRangeAt(0);null==r||r.setStart(q.current.endContainer,q.current.endOffset),null==r||r.setEnd(q.current.endContainer,q.current.endOffset)}D([])},W=t.useRef(null),q=t.useRef(null),G=t.useRef(null),[Z,Q]=t.useState(0);return t.useEffect((()=>{if(G.current){const e=G.current,t=e.children.item(Z);if(t){const a=e.getBoundingClientRect(),l=t.getBoundingClientRect();t.offsetTop<e.scrollTop?e.scrollTop=t.offsetTop:t.offsetTop+l.height>e.scrollTop+a.height&&(e.scrollTop=t.offsetTop-a.height+l.height)}}}),[Z]),t.useEffect((()=>{const e=function(e){var t;(null===(t=W.current)||void 0===t?void 0:t.contains(e.target))||D([])};return window.addEventListener("click",e,{passive:!0}),()=>{window.removeEventListener("click",e)}}),[]),M.default.createElement(Bt,{ref:W,className:o,style:n,onKeyDownCapture:e=>{if(null==O?void 0:O.length){let t=!1;if("ArrowDown"===e.key)t=!0,Q((e=>e+1>=O.length?0:e+1));else if("Escape"===e.key)t=!0,Q(0),D([]);else if("ArrowUp"===e.key)t=!0,Q((e=>e-1<0?O.length-1:e-1));else if("Enter"===e.key||"Tab"===e.key){const e=O[Z];e&&(t=!0,H(e.id,e.name))}if(t)return e.preventDefault(),!1}}},M.default.createElement(Ut,{id:I,onAddLink:(e,t)=>{var a,o;const n=B.current+1,i=null===(o=null===(a=j.current)||void 0===a?void 0:a.getEditor())||void 0===o?void 0:o.root.innerHTML,r=((null==i?void 0:i.substring(0,n))||"")+`<mocka data-href="${t}" data-url="true">${e}</mocka> `+((null==i?void 0:i.substring(n))||"");null==l||l(r),P(r)}}),zt&&M.default.createElement(zt,{ref:j,theme:"snow",value:a,onChange:e=>{null==l||l(e),P(e),F()},onChangeSelection:()=>{F()},modules:R.current,formats:["mocka1","mention","id","key","bold","italic","underline","list","bullet"]}),!!(null==O?void 0:O.length)&&M.default.createElement("div",{ref:G,className:"mention-search-container",style:U},O.map(((e,t)=>M.default.createElement("div",{className:"mention-search-item "+(Z===t?"item-selected":""),key:e.id,onClick:t=>{t.preventDefault(),t.stopPropagation(),H(e.id,e.name)},onMouseEnter:()=>{Q(t)}},M.default.createElement(p.UserAvatar,{className:"search-avatar",username:e.name,avatar:e.avatar}),M.default.createElement("div",null,M.default.createElement(f.Text,{size:"p2"},e.name),M.default.createElement(f.Text,{size:"p4",color:"#595959"},"@",e.username)))))))},Ut=({onAddLink:e,id:t})=>M.default.createElement("div",{id:"toolbar-"+t,onClick:e=>{e.preventDefault(),e.stopPropagation()}},M.default.createElement("span",{className:"ql-formats"},M.default.createElement("button",{className:"ql-bold",type:"button"}),M.default.createElement("button",{className:"ql-italic",type:"button"}),M.default.createElement("button",{className:"ql-underline",type:"button"})),M.default.createElement("span",{className:"ql-formats"},M.default.createElement("button",{className:"ql-list",value:"ordered",type:"button"}),M.default.createElement("button",{className:"ql-list",value:"bullet",type:"button"})),M.default.createElement("span",{className:"ql-formats"},M.default.createElement("button",{className:"ql-image",type:"button"}),e&&M.default.createElement(pe,{className:"link-tool-wrapper",toggleButtonContent:M.default.createElement("img",{className:"link-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='M9.54545 16H7.09091C6.55368 16 6.02172 15.8965 5.52539 15.6955C5.02905 15.4945 4.57808 15.1999 4.1982 14.8284C3.43101 14.0783 3 13.0609 3 12C3 10.9391 3.43101 9.92172 4.1982 9.17157C4.96539 8.42143 6.00593 8 7.09091 8H9.54545M13.9256 8H16.9091C17.4463 8 17.9783 8.10346 18.4746 8.30448C18.9709 8.5055 19.4219 8.80014 19.8018 9.17157C20.1817 9.54301 20.483 9.98396 20.6886 10.4693C20.8942 10.9546 21 11.4747 21 12C21 12.5253 20.8942 13.0454 20.6886 13.5307C20.483 14.016 20.1817 14.457 19.8018 14.8284C19.4219 15.1999 18.9709 15.4945 18.4746 15.6955C17.9783 15.8965 17.4463 16 16.9091 16H13.9256' stroke='%23737373' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M9 12H15' stroke='%23737373' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e"}),buttonProps:{size:"md",color:"transparent"},align:"end"},(({setShow:t})=>M.default.createElement(_t,{onAddUrl:e,setShow:t}))))),Vt=["notification.limitUrlDomain","notification.urlWrongFormat"],_t=({onAddUrl:e,setShow:a})=>{const{data:{env:{isMarryBaby:l}}}=t.useContext(p.TogetherComponentGlobalContext),{t:n}=o.useTranslations(),[i,r]=t.useState(""),[s,d]=t.useState(""),[c,u]=t.useState(-1),m=i.trim()&&s.trim()&&c<0;return M.default.createElement("div",{className:"link-tool-popover"},M.default.createElement(v.Input,{name:"url",value:i,size:"md",label:"URL",placeholder:n("placeholder.enterUrlHere"),type:"text",className:"link-input-url",onChange:e=>{r(e),(e=>{const t=Pt(e.trim());try{const e=new URL(t);return e.protocol.startsWith("http")?St.some((t=>e.origin.endsWith("/"+t)||e.origin.endsWith("."+t)))?(u(-1),!0):(u(0),!1):(u(1),!1)}catch(e){return u(1),!1}})(e)}}),c>=0&&M.default.createElement(f.Text,{size:"c2",className:"error-text"},n(Vt[c])),M.default.createElement(v.Input,{name:"text",value:s,size:"md",label:n("createPost.urlText"),placeholder:n("placeholder.enterUrlTextHere"),type:"text",className:"link-input-text",onChange:e=>d(e)}),M.default.createElement("div",{"data-is-marrybaby":l,className:"link-input-button-wrapper"},M.default.createElement(w.Button,{theme:l?"marryBaby":"helloSites",size:"sm",color:"primary",className:"link-input-button",onClick:()=>{m&&(e(s.trim(),Pt(i.trim())),a&&a(!1))},isDisabled:!m},n("insert"))))};var Ht="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 Wt=({className:e,style:a,bannedWords:l=[],value:n,onChange:r,onPreviewUrlChange:s,onInvalidUrlsChange:d,onImageFilesChange:c,imageFiles:u,isReplying:m})=>{const{t:g}=o.useTranslations(),[h,v]=t.useState(null),b=t.useRef(null),{onSelectImages:x,onRemoveImage:w,imageSrcs:y}=It(u,c);return t.useEffect((()=>{s&&((null==h?void 0:h.url)?s({title:h.title||"",url:h.url||"",image:h.image||"",description:h.description||""}):s(null))}),[h]),M.default.createElement(Rt,{className:e,style:a},M.default.createElement(f.Text,{size:"p4",className:"description-label"},g("createPost.popup.description")),M.default.createElement("div",{className:"textarea-control"},M.default.createElement("div",{className:"textarea-wrapper"},M.default.createElement(Dt,{html:n||"",onChange:r,bannedWords:l,onImagePickerClick:()=>{var e;return null===(e=b.current)||void 0===e?void 0:e.click()},onPreviewUrlChange:v,onInvalidUrlsChange:d,isReplying:m}))),M.default.createElement(f.Text,{size:"p4",className:"count-string"},g("character"),": ",I.default(n||"").length),(!y||0===y.length)&&h&&M.default.createElement("div",{className:"link-preview-wrapper"},h.isFetching?M.default.createElement(q,null):M.default.createElement(M.default.Fragment,null,M.default.createElement(Z,{title:h.title,url:h.url||"#",image:h.image,noRefetch:!0}),M.default.createElement("img",{src:Ht,className:"icon-close",onClick:()=>v(null)}))),M.default.createElement("input",{ref:b,type:"file",accept:"image/png, image/gif, image/jpeg",multiple:!0,style:{display:"none"},onChange:x}),y.length>p.MAX_IMAGE_UPLOADS?M.default.createElement("div",{className:"input-notification"},M.default.createElement("img",{src:dt}),M.default.createElement(f.Text,{size:"p4",color:i.theme.colors.alertWarning},g("createPost.popup.warningImage"))):null,y.length>0&&M.default.createElement("div",{className:"image-gallery"},y.map(((e,t)=>M.default.createElement("div",{key:t,className:"image-item"},M.default.createElement("img",{src:e}),M.default.createElement("img",{className:"close-btn",src:Ht,onClick:()=>w(t)}))))))},qt=B.default.div`
|
|
1281
1415
|
input:focus,
|
|
1282
1416
|
textarea:focus,
|
|
1283
1417
|
[contenteditable='true'] {
|
|
@@ -1335,7 +1469,7 @@
|
|
|
1335
1469
|
font-size: 11px;
|
|
1336
1470
|
text-align: right;
|
|
1337
1471
|
}
|
|
1338
|
-
`,
|
|
1472
|
+
`,Gt=(e,t)=>{if(!t)return e;const{limit:a,bannedWords:l=[]}=t,o="number"==typeof a&&a>=0?e.substring(0,a):e;return Lt(o,l)},Zt=({className:e,style:a,bannedWords:l=[],value:n,onChange:i})=>{var r;const{t:s}=o.useTranslations(),[d,c]=t.useState(""),u=t.useRef(null);t.useEffect((()=>{if(u.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=u.current;return t.addEventListener("paste",e,{passive:!0}),()=>t.removeEventListener("paste",e)}}),[u]);const m=(null==l?void 0:l.join(","))||"";t.useEffect((()=>{var e;if(m){const t=null===(e=u.current)||void 0===e?void 0:e.innerText;if(t){const e=Lt(t,l);e!==t&&(i&&i(e),c(e))}}}),[m]);const p=t.useCallback(z.default((()=>{if(u.current){const e=Gt(u.current.innerText,{limit:120,bannedWords:l});i&&i(e),c(e)}}),300),[]);return t.useEffect((()=>{setTimeout((()=>{var e;null===(e=u.current)||void 0===e||e.focus()}),500)}),[]),M.default.createElement(qt,{className:e,style:a},M.default.createElement(v.Input,{name:"title",value:n||d,size:"md",label:s("createPost.title"),CustomInput:M.default.createElement(j.default,{innerRef:u,html:n||d,onChange:()=>{if(u.current&&u.current.innerText!==(n||d)){const e=Gt(u.current.innerText,{bannedWords:l});i&&i(e),c(e),p()}},className:"title-input"})}),M.default.createElement(f.Text,{size:"p4",className:"count-string"},s("createPost.popup.wordCount",{count:(null===(r=u.current)||void 0===r?void 0:r.innerText.length)||0,max:120})))},Qt=B.default.div`
|
|
1339
1473
|
display: flex;
|
|
1340
1474
|
width: 100%;
|
|
1341
1475
|
flex-wrap: wrap;
|
|
@@ -1384,142 +1518,7 @@
|
|
|
1384
1518
|
}
|
|
1385
1519
|
}
|
|
1386
1520
|
}
|
|
1387
|
-
`,
|
|
1388
|
-
position: relative;
|
|
1389
|
-
display: flex;
|
|
1390
|
-
height: 100%;
|
|
1391
|
-
flex-direction: column;
|
|
1392
|
-
padding: 16px 24px;
|
|
1393
|
-
|
|
1394
|
-
.input-group-container {
|
|
1395
|
-
flex: 1;
|
|
1396
|
-
padding-right: 2px;
|
|
1397
|
-
padding-left: 2px;
|
|
1398
|
-
margin-bottom: 0.5rem;
|
|
1399
|
-
-ms-overflow-style: none; /* IE and Edge */
|
|
1400
|
-
overflow-y: auto;
|
|
1401
|
-
scrollbar-width: none; /* Firefox */
|
|
1402
|
-
&::-webkit-scrollbar {
|
|
1403
|
-
display: none;
|
|
1404
|
-
}
|
|
1405
|
-
}
|
|
1406
|
-
|
|
1407
|
-
.input-group {
|
|
1408
|
-
:not(:last-child) {
|
|
1409
|
-
margin-bottom: 0.6rem;
|
|
1410
|
-
}
|
|
1411
|
-
|
|
1412
|
-
input:focus,
|
|
1413
|
-
textarea:focus,
|
|
1414
|
-
[contenteditable='true'] {
|
|
1415
|
-
outline: none;
|
|
1416
|
-
}
|
|
1417
|
-
|
|
1418
|
-
label {
|
|
1419
|
-
margin-bottom: 5px;
|
|
1420
|
-
color: ${e=>e.theme.colors.gray600};
|
|
1421
|
-
/* font-family: 'Open Sans', sans-serif; */
|
|
1422
|
-
font-size: 13px;
|
|
1423
|
-
font-weight: bold;
|
|
1424
|
-
}
|
|
1425
|
-
|
|
1426
|
-
.input-group-label {
|
|
1427
|
-
margin-bottom: 5px;
|
|
1428
|
-
color: ${e=>e.theme.colors.gray600};
|
|
1429
|
-
/* font-family: 'Open Sans', sans-serif; */
|
|
1430
|
-
font-size: 13px;
|
|
1431
|
-
font-weight: bold;
|
|
1432
|
-
}
|
|
1433
|
-
|
|
1434
|
-
.input-notification {
|
|
1435
|
-
display: flex;
|
|
1436
|
-
|
|
1437
|
-
& > img {
|
|
1438
|
-
width: 16px;
|
|
1439
|
-
height: 16px;
|
|
1440
|
-
margin-top: 1.5px;
|
|
1441
|
-
margin-right: 8px;
|
|
1442
|
-
}
|
|
1443
|
-
}
|
|
1444
|
-
|
|
1445
|
-
.tag-list {
|
|
1446
|
-
}
|
|
1447
|
-
}
|
|
1448
|
-
|
|
1449
|
-
.warning {
|
|
1450
|
-
margin-top: 16px;
|
|
1451
|
-
}
|
|
1452
|
-
|
|
1453
|
-
.submit-btn {
|
|
1454
|
-
width: 100%;
|
|
1455
|
-
}
|
|
1456
|
-
|
|
1457
|
-
.switch-label {
|
|
1458
|
-
display: flex;
|
|
1459
|
-
align-items: center;
|
|
1460
|
-
}
|
|
1461
|
-
|
|
1462
|
-
.swich-input-group {
|
|
1463
|
-
padding: 12px 16px;
|
|
1464
|
-
border-radius: 8px;
|
|
1465
|
-
background: ${i.theme.colors.neutral50};
|
|
1466
|
-
|
|
1467
|
-
&.askdoctor-switch {
|
|
1468
|
-
background: ${i.theme.colors.primary50};
|
|
1469
|
-
&.mb-color {
|
|
1470
|
-
background: ${i.theme.mbColors.tonePink};
|
|
1471
|
-
}
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
.mantine-Switch-labelWrapper {
|
|
1475
|
-
flex-grow: 1;
|
|
1476
|
-
}
|
|
1477
|
-
.mantine-Checkbox-body {
|
|
1478
|
-
display: flex;
|
|
1479
|
-
width: 100%;
|
|
1480
|
-
align-items: center;
|
|
1481
|
-
justify-content: space-between;
|
|
1482
|
-
}
|
|
1483
|
-
.mantine-Switch-track {
|
|
1484
|
-
margin-bottom: 0;
|
|
1485
|
-
}
|
|
1486
|
-
.label-txt {
|
|
1487
|
-
font-weight: normal;
|
|
1488
|
-
font-size: 14px;
|
|
1489
|
-
color: ${i.theme.colors.gray800};
|
|
1490
|
-
margin-left: 10px;
|
|
1491
|
-
}
|
|
1492
|
-
}
|
|
1493
|
-
`,Xt=B.default.div`
|
|
1494
|
-
display: flex;
|
|
1495
|
-
width: 100%;
|
|
1496
|
-
align-items: center;
|
|
1497
|
-
justify-content: space-between;
|
|
1498
|
-
padding: 12px 16px;
|
|
1499
|
-
border-radius: 8px;
|
|
1500
|
-
background: ${i.theme.colors.primary50};
|
|
1501
|
-
|
|
1502
|
-
&[data-is-marry-baby='true'] {
|
|
1503
|
-
background: ${i.theme.mbColors.tonePink};
|
|
1504
|
-
}
|
|
1505
|
-
.switch-label {
|
|
1506
|
-
display: flex;
|
|
1507
|
-
align-items: center;
|
|
1508
|
-
gap: 12px;
|
|
1509
|
-
}
|
|
1510
|
-
margin-bottom: 12px;
|
|
1511
|
-
`,Kt=B.default.div`
|
|
1512
|
-
margin-bottom: 12px;
|
|
1513
|
-
color: ${i.theme.colors.red700};
|
|
1514
|
-
svg {
|
|
1515
|
-
margin-right: 5px;
|
|
1516
|
-
}
|
|
1517
|
-
svg,
|
|
1518
|
-
span {
|
|
1519
|
-
display: inline-block;
|
|
1520
|
-
vertical-align: middle;
|
|
1521
|
-
}
|
|
1522
|
-
`,$t=B.default.div`
|
|
1521
|
+
`,Xt=({className:a,style:l,topics:o,communityId:n,onChange:i,isLoading:r,disabled:s,forceTopics:d,selectedTopics:c,noFetch:u,dataEventCategory:m,dataEventAction:g,dataEventLabel:f})=>{const{data:{locale:v,env:{isMarryBaby:b}}}=t.useContext(p.TogetherComponentGlobalContext),[x,w]=t.useState(o?[...o]:[]),[y,C]=t.useState(c?[...c]:[]),[E,k]=t.useState(!1),A=t.useRef(o);A.current=o,t.useEffect((()=>{var t;!n||u||(null===(t=A.current)||void 0===t?void 0:t.length)||(w([]),k(!0),e.__awaiter(void 0,void 0,void 0,(function*(){var e;try{const t=yield p.callApi(p.getApiPath(p.PATHS.TOPIC.LIST,{communityId:n,_locale:v}),"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(h.formatTopic).sort(((e,t)=>(e.order||0)-(t.order||0))))||[]))}catch(e){console.log(e),k(!1)}k(!1)})))}),[n,u]);const N=null==o?void 0:o.map((e=>e.id)).join("-"),T=null==x?void 0:x.map((e=>e.id)).join("-"),S=null==d?void 0:d.map((e=>e.id)).join("-");t.useEffect((()=>{o&&void 0!==N&&N!==T&&w(o)}),[o,N,T]);const P=t.useMemo((()=>x.filter((e=>!(null==d?void 0:d.some((t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId)))))),[T,S]);return M.default.createElement(Qt,{"data-is-marrybaby":b,className:a,style:l},d.map((e=>M.default.createElement(Kt,{key:`${e.id}-${e.mappedCategoryId}`,topic:e,disabled:!0,selected:!0,dataEventAction:g,dataEventCategory:m,dataEventLabel:f}))),P.map((e=>M.default.createElement(Kt,{key:`${e.id}-${e.mappedCategoryId}`,topic:e,disabled:s,selected:(c||y).some((t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId)),onClick:()=>{const t=c||y,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),i&&c?i(t.slice()):(i&&i(t.slice()),C(t.slice()))},dataEventAction:g,dataEventCategory:m,dataEventLabel:f}))),(r||E)&&M.default.createElement(q,{className:"topic-spinner"}))},Kt=t=>{var{topic:a,disabled:l,selected:o,onClick:n}=t,i=e.__rest(t,["topic","disabled","selected","onClick"]);return M.default.createElement("div",Object.assign({className:"tag-item"+(o?" --active":""),"data-disabled":l,onClick:l?void 0:n},i),a.name)},$t=B.default.div`
|
|
1523
1522
|
[data-type='confirm'] {
|
|
1524
1523
|
width: min(360px, 100%);
|
|
1525
1524
|
height: auto;
|
|
@@ -1975,7 +1974,7 @@
|
|
|
1975
1974
|
}
|
|
1976
1975
|
}
|
|
1977
1976
|
}
|
|
1978
|
-
`,oa=t.createContext({});const na=({isReply:a,className:l,onClose:n,replyToName:i,style:r,replyingId:s,replyingUser:d,onPostSuccess:c,post:u,isMarryBaby:m})=>{const{action:{pushNotifications:g,sanitizeFunction:b},data:{userInfo:x,locale:y,env:{isMarryBaby:C}}}=t.useContext(p.TogetherComponentGlobalContext),E="boolean"==typeof m?m:C,{t:k}=o.useTranslations(),{onSelectImages:A,onRemoveImage:N,imageSrcs:T,onRemoveAllImages:S,imageFiles:P}=
|
|
1977
|
+
`,oa=t.createContext({});const na=({isReply:a,className:l,onClose:n,replyToName:i,style:r,replyingId:s,replyingUser:d,onPostSuccess:c,post:u,isMarryBaby:m})=>{const{action:{pushNotifications:g,sanitizeFunction:b},data:{userInfo:x,locale:y,env:{isMarryBaby:C}}}=t.useContext(p.TogetherComponentGlobalContext),E="boolean"==typeof m?m:C,{t:k}=o.useTranslations(),{onSelectImages:A,onRemoveImage:N,imageSrcs:T,onRemoveAllImages:S,imageFiles:P}=It(),[L,I]=t.useState(""),{trigger:R}=t.useContext(oa),[B,z]=t.useState(!1),j=t.useRef(null),F=t.useRef(null),O=t.useRef(null),[D,U]=t.useState([]),[V,_]=t.useState([]),[H,W]=t.useState(null);return t.useEffect((()=>{var e;null===(e=O.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"start"}),setTimeout((()=>{var e;null===(e=F.current)||void 0===e||e.focus()}),400)}),[R]),M.default.createElement(la,{"data-is-reply":a,className:l,style:r},a&&M.default.createElement("div",{className:"reply-to-container"},M.default.createElement(f.Text,{size:"p4"},M.default.createElement("span",{dangerouslySetInnerHTML:{__html:k("inputComment.replyTo",{name:`<span style="color: #2D87F3; cursor: pointer">@${i||""}</span>`})}})),M.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:()=>n&&n()})),M.default.createElement("div",{className:"input-container",ref:O},M.default.createElement(p.UserAvatar,{className:"avatar-wrapper "+(a?"avatar-wrapper-reply":""),avatar:(null==x?void 0:x.id)?x.avatar:p.DEFAULT_AVATAR_IMG,username:(null==x?void 0:x.name)||(null==x?void 0:x.username)}),M.default.createElement("input",{ref:j,onChange:A,type:"file",multiple:!0,accept:"image/png,image/jpeg",name:"images",style:{display:"none"}}),M.default.createElement(v.Input,{value:L,name:"input",size:"md",className:"input-wrapper",displayIcon:M.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"}),CustomInput:M.default.createElement("div",{className:"as-input"},M.default.createElement(Dt,{className:"textarea",html:L,onChange:I,onImagePickerClick:()=>{var e;return null===(e=j.current)||void 0===e?void 0:e.click()},bannedWords:V,onPreviewUrlChange:W,onInvalidUrlsChange:U,setEditorRef:e=>F.current=e,isReplying:a}))}),M.default.createElement(w.Button,{theme:E?"marryBaby":"helloSites",className:"send-button",size:"sm",onClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){var t,l,o,i,r,m,f,v,x;if((null==u?void 0:u.id)&&!B){z(!0);try{const w=e=>{I(""),S(),n&&n();const t=h.formatComment(e.data);"string"==typeof t.images&&(t.images=JSON.parse(t.images)),c&&c(t)},C=yield(({postId:t,message:a,photos:l,link:o,locale:n,sanitizeFunction:i,replyingUserId:r,replyingUserName:s,replyingId:d})=>e.__awaiter(void 0,void 0,void 0,(function*(){const e=new FormData;let c=Tt(a.replace(/(\ )+/g," "),i);const u=kt(c);return l&&l.length>0&&(yield Promise.all(null==l?void 0:l.map((e=>Mt(e,n))))).filter(Boolean).slice(0,p.MAX_IMAGE_UPLOADS).forEach((t=>{e.append("images[]",t)})),o&&e.append("link",o),null==u||u.forEach((t=>{e.append("mention_ids[]",t)})),e.append("post_id",t),d&&e.append("parent_id",d),r&&(u.unshift(r),c=`[mention+id="${r}"+name="${(s||"").replace('"',"'")}"]${c}`,e.append("parent_user_id",String(r))),e.append("content",c),e.append("content",c),e})))(Object.assign({message:L,photos:P,postId:String(u.id),link:null==H?void 0:H.url,sanitizeFunction:b,locale:y},a&&s?{replyingUserId:String((null==d?void 0:d.id)||(null===(t=null==u?void 0:u.author)||void 0===t?void 0:t.id)||""),replyingId:s,replyingUserName:(null==d?void 0:d.name)||(null==d?void 0:d.username)||""}:{})),E=yield a&&s?((t,a)=>e.__awaiter(void 0,void 0,void 0,(function*(){return p.callApiWithAuth(p.getApiPath(p.PATHS.COMMENT.REPLY,{_locale:a}),"POST",{data:t})})))(C,y):((t,a)=>e.__awaiter(void 0,void 0,void 0,(function*(){return p.callApiWithAuth(p.getApiPath(p.PATHS.COMMENT.CREATE,{_locale:a}),"POST",{data:t})})))(C,y),A=null==E?void 0:E.data;(null==A?void 0:A.id)&&!(null===(o=null===(l=null==E?void 0:E.messages)||void 0===l?void 0:l.moderation)||void 0===o?void 0:o.type)?w(E):"banned"===(null===(r=null===(i=null==E?void 0:E.messages)||void 0===i?void 0:i.moderation)||void 0===r?void 0:r.type)?(g({title:k("notification.comment.blocked.title"),message:k("notification.comment.blocked.message"),type:"danger"}),E.messages.moderation.words&&_(E.messages.moderation.words)):"suspect"===(null===(f=null===(m=null==E?void 0:E.messages)||void 0===m?void 0:m.moderation)||void 0===f?void 0:f.type)?(g({title:k("notification.comment.suspect.title"),message:k("notification.comment.suspect.message"),type:"warning"}),I(""),S(),n&&n()):(null===(v=null==E?void 0:E.messages)||void 0===v?void 0:v.find((e=>{var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(g({message:k("notification.suspend.message"),type:"warning"}),I(""),S(),n&&n()):g({title:"",message:(null===(x=null==E?void 0:E.messages)||void 0===x?void 0:x[0])||k("notification.comment.somethingWrong"),type:"danger"})}catch(e){g({title:"",message:k("notification.comment.somethingWrong"),type:"danger"})}z(!1)}})),isLoading:B,isDisabled:!!(null==D?void 0:D.length)||B||!L||(null==L?void 0:L.length)<2||!L.trim()},M.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"}))),(null==D?void 0:D.length)?M.default.createElement("div",{className:"error-text"},k("notification.limitUrlDomain")):null,(!T||0===T.length)&&H&&M.default.createElement("div",{className:"link-preview-wrapper"},H.isFetching?M.default.createElement(q,null):M.default.createElement(M.default.Fragment,null,M.default.createElement(Z,{title:H.title,url:H.url||"#",image:H.image,noRefetch:!0}),M.default.createElement("img",{src:Ht,className:"icon-close",onClick:()=>W(null)}))),T&&T.length>0&&M.default.createElement("div",{className:"preview-images-container"},T.map(((e,t)=>M.default.createElement("div",{key:t,className:"image-src-wrapper"},M.default.createElement("img",{className:"preview-image",src:e}),M.default.createElement("img",{src:Ht,className:"icon-close-circle",onClick:()=>N(t)}))))))},ia=B.default.a`
|
|
1979
1978
|
* {
|
|
1980
1979
|
pointer-events: none;
|
|
1981
1980
|
}
|
|
@@ -2290,7 +2289,7 @@
|
|
|
2290
2289
|
}
|
|
2291
2290
|
}
|
|
2292
2291
|
}
|
|
2293
|
-
`;var ha=a.createStyles((e=>({root:{mention:{color:e.fn.primaryColor()},a:{"&,&:visited,&:focus":{color:e.fn.primaryColor()}},".create-post-link":{display:"inline",color:e.fn.primaryColor(),cursor:"pointer"}}})));const fa=l=>{var{trackingCategory:n,url:i,className:r,style:s,replyingTo:d,mentionedUser:c,description:u,disableShortenContent:m,mentions:g=[],maxChars:h=1e3,hideShowAllBtn:f,styles:v,onClickCreatePostLink:b}=l,x=e.__rest(l,["trackingCategory","url","className","style","replyingTo","mentionedUser","description","disableShortenContent","mentions","maxChars","hideShowAllBtn","styles","onClickCreatePostLink"]);const{classes:w,theme:y}=ha(void 0,{name:"PostContent",styles:v}),[C,E]=t.useState(!1),{t:k}=o.useTranslations(),{authActionWrapper:A}=_(),[N,T]=t.useState(!1),S=
|
|
2292
|
+
`;var ha=a.createStyles((e=>({root:{mention:{color:e.fn.primaryColor()},a:{"&,&:visited,&:focus":{color:e.fn.primaryColor()}},".create-post-link":{display:"inline",color:e.fn.primaryColor(),cursor:"pointer"}}})));const fa=l=>{var{trackingCategory:n,url:i,className:r,style:s,replyingTo:d,mentionedUser:c,description:u,disableShortenContent:m,mentions:g=[],maxChars:h=1e3,hideShowAllBtn:f,styles:v,onClickCreatePostLink:b}=l,x=e.__rest(l,["trackingCategory","url","className","style","replyingTo","mentionedUser","description","disableShortenContent","mentions","maxChars","hideShowAllBtn","styles","onClickCreatePostLink"]);const{classes:w,theme:y}=ha(void 0,{name:"PostContent",styles:v}),[C,E]=t.useState(!1),{t:k}=o.useTranslations(),{authActionWrapper:A}=_(),[N,T]=t.useState(!1),S=Ct(yt(u||"","display"),g),{action:{sanitizeFunction:P}}=t.useContext(p.TogetherComponentGlobalContext),L=t.useMemo((()=>{const e=P(S||"");if(m||C)return{showContent:e,hasSeeMore:!1};const t=e.slice(0,h),a=h-27*((t.match(/<\/div>/g)||[]).length-1),l=(t||"").slice(0,a<40?40:a),o=P(l.replace(/(<|<\/)( +|[a-zA-Z]*)$/gi,"")),n=o.length<e.length-10;return{showContent:n?o:e,hasSeeMore:n}}),[m,C,S]),I=(null==c?void 0:c.name)||d,R="expert"===(null==c?void 0:c.role)&&!!(null==c?void 0:c.partnerId),B=t.useRef(null),z=e=>{e.preventDefault(),null==b||b()};return t.useEffect((()=>{var e;return null===(e=null==B?void 0:B.current)||void 0===e||e.querySelectorAll("[data-create-post]").forEach((e=>{e.addEventListener("click",z,{passive:!0})})),()=>{var e;null===(e=null==B?void 0:B.current)||void 0===e||e.querySelectorAll("[data-create-post]").forEach((e=>{e.removeEventListener("click",z,!1)}))}}),[m,C,S]),M.default.createElement(M.default.Fragment,null,R&&M.default.createElement(We,{isOpen:N,onClose:()=>T(!1),expertId:String(null==c?void 0:c.partnerId)}),M.default.createElement(ga,Object.assign({ref:B,className:`${w.root} ${r} no-replace-click`,style:s,mentionColor:y.fn.primaryColor()},x),I&&M.default.createElement(a.Anchor,{onClick:()=>R&&T(!0),className:"post-content-replying"},"@",I),(null==u?void 0:u.startsWith("[mention+id="))&&M.default.createElement("span",{className:"post-content-replying tag-only",style:{color:y.fn.primaryColor()}},"@"),M.default.createElement("span",{dangerouslySetInnerHTML:{__html:L.showContent},className:"post-content "+(L.hasSeeMore?"has-see-more":"")}),L.hasSeeMore&&!C&&M.default.createElement("span",null,"... ",!f&&M.default.createElement(a.Anchor,Object.assign({onClick:e=>{e.preventDefault(),e.stopPropagation(),A((()=>E(!0)))},className:"see-more-text"},n?{"data-event-category":n,"data-event-action":"See More Post Click","data-event-label":i}:{}),k("post.seeMore")))))},va=B.default.div`
|
|
2294
2293
|
padding: 14px 16px 14px 17px;
|
|
2295
2294
|
background: ${e=>e.bgColor};
|
|
2296
2295
|
border-left: 3px solid ${e=>e.highlight};
|
|
@@ -3076,4 +3075,4 @@
|
|
|
3076
3075
|
`,uo=B.default(so)`
|
|
3077
3076
|
margin-top: 12px;
|
|
3078
3077
|
padding: 0.5rem 1rem 1rem;
|
|
3079
|
-
`;var mo="-dzIuHr";const po=({userId:e,avatar:a,name:l,role:n,title:s,className:d})=>{const{t:c}=o.useTranslations(),[u,m]=t.useState(!1);return M.default.createElement(M.default.Fragment,null,M.default.createElement(w.Button,{className:`${mo} ${d}`,color:"success",size:"xs",onClick:()=>m(!0),style:{padding:"5px 8px",marginBottom:"12px",borderRadius:"4px"}},M.default.createElement("span",{className:"text"},M.default.createElement(r.Icon.Endorse,{isSolid:!0,size:18,color:i.theme.colors.green800,className:"icon"}),c("cardReply.verifyBy",{name:`${l||""}`}))),M.default.createElement(et,{open:u,onClose:()=>m(!1),profileModalProps:{zIndex:1e3}},M.default.createElement(Ll,{authorProps:{userId:e,avatar:a,name:l,role:n,title:s},hideQuestionTab:!0})))};const go=({className:a,style:l,comment:n,type:i="comment",level:r=0,replyingId:s,onPostCommentSuccess:c,post:u,onDeleteComment:m,refetchComment:h,hasQuickBookingEnable:f,handleMakeAppointment:v,cardAuthorProps:b,maxChars:x=600,disableShortenContent:y})=>{var C,E,k,A,N,T,S,P,L,I,R,B;const{data:{locale:z,userInfo:j,env:{isMarryBaby:F}}}=t.useContext(p.TogetherComponentGlobalContext),{t:O}=o.useTranslations(),[D,U]=t.useState(n||null),{id:H,countLikes:W,content:q,replies:G=[],images:Q=[],author:X,liked:K,link:$,mentionedUser:Y,mentions:ee}=D,{text:te,replyingTo:ae}=(e=>{try{const t=e.match(/\[@([^\]]+)\]/),a=t?t[0].replace("[@","").replace("]",""):"";return{text:e.replace(/\[@([^\]]+)\]/,"").trim(),replyingTo:a}}catch(e){}return{text:""}})(q),{authActionWrapper:le}=_({_joinCommunityIds:[null===(C=null==u?void 0:u.community)||void 0===C?void 0:C.id],_joinTopicIds:null===(E=null==u?void 0:u.topics)||void 0===E?void 0:E.map((e=>e.id))}),[oe,ie]=t.useState(4),re=!!(null==j?void 0:j.id)&&(null==G?void 0:G.some((e=>e.author.id===j.id))),se=e=>{U((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 h&&h(a),a}return t}))},[de,ce]=t.useState(!1),ue=t.useMemo((()=>"comment"===i&&G&&0!=G.length?G.sort(((e,t)=>{const a=new Date(e.createdAt).getTime(),l=new Date(t.createdAt).getTime();return a>l?-1:a<l?1:0})):G),[i,G]),me=(null==G?void 0:G.length)||0,pe=String(null==X?void 0:X.email)&&(null==j?void 0:j.email)&&String(null==X?void 0:X.email)===String(null==j?void 0:j.email),ge=(null==X?void 0:X.name)||(null==X?void 0:X.username)||"",he=(null==X?void 0:X.username)||(null==X?void 0:X.name)||"",fe=null==X?void 0:X.avatar,ve=(null==u?void 0:u.isAnonymous)||null==X?void 0:X.role,be=[...(null==u?void 0:u.isAnonymous)?[{id:(null===(k=null==u?void 0:u.author)||void 0===k?void 0:k.id)||0,name:O("cardPost.anonymous")}]:[],...ee||[]],[xe,we]=t.useState(null),[ye,Ce]=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 p.callApi(p.getCarePath(p.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)&&we(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 p.callApi(p.getCarePath(p.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)&&Ce(null==a?void 0:a._data.doctor)}));t(X.doctorId)}}),[X.hospitalId,X.doctorId]);const Ee=(null==ye?void 0:ye.valid_outpatient)||(null==ye?void 0:ye.valid_telemedicine),ke=((null==xe?void 0:xe.total_available_service)||(null==xe?void 0:xe.total_available_doctor))>0,Ae=f&&(Ee||ke),Ne="chatbot"===(null===(A=null==D?void 0:D.author)||void 0===A?void 0:A.type);return M.default.createElement(V,{defaultParams:{_joinCommunityIds:[null===(N=null==u?void 0:u.community)||void 0===N?void 0:N.id],_joinTopicIds:null===(T=null==u?void 0:u.topics)||void 0===T?void 0:T.map((e=>e.id))}},M.default.createElement(co,{className:a,style:l,"data-is-reply":!!r,"data-is-marrybaby":F,"data-has-booking":Ae},"reply"===i&&M.default.createElement(g.Divider,{className:"top-divider",type:"solid"}),M.default.createElement("div",{style:{padding:"16px 16px 0"}},M.default.createElement(ot,Object.assign({avatar:fe,name:ge,username:he,timeText:null==u?void 0:u.createdTime,community:null==u?void 0:u.community,className:"post-author "+(pe?"with-popover":""),type:i,userId:null==X?void 0:X.id,role:ve,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:Ae,handleMakeAppointment:v,isAnonymous:!!(null==u?void 0:u.isAnonymous),hideBackground:Ne,userType:null==X?void 0:X.type},b)),Boolean(null==D?void 0:D.isVerify)&&!Boolean(null==D?void 0:D.isOppose)&&M.default.createElement(po,{title:null===(S=null==D?void 0:D.userVerify)||void 0===S?void 0:S.title,name:null===(P=null==D?void 0:D.userVerify)||void 0===P?void 0:P.name,userId:null===(L=null==D?void 0:D.userVerify)||void 0===L?void 0:L.id,role:null===(I=null==D?void 0:D.userVerify)||void 0===I?void 0:I.role,avatar:null===(R=null==D?void 0:D.userVerify)||void 0===R?void 0:R.avatar,className:"verify-tag"})),M.default.createElement(fa,{className:"post-content-wrapper",replyingTo:ae,mentionedUser:Y,description:te,mentions:be,maxChars:x,disableShortenContent:y}),M.default.createElement("span",null),M.default.createElement("span",null),Q&&Q.length>0?M.default.createElement("div",{key:"image-preview",className:"image-preview-wrapper","data-is-reply":!0},M.default.createElement(Oa,{images:Q,authorName:null==X?void 0:X.username})):null,Q&&0!==Q.length||!$?null:M.default.createElement("div",{key:"link-preview",className:"link-preview-wrapper","data-is-reply":!0},M.default.createElement(Z,{url:$})),"most-engaging"!==i?M.default.createElement(M.default.Fragment,null,Ne&&M.default.createElement(uo,{listUrl:null==D?void 0:D.source,categorySlug:null==D?void 0:D.categorySlug}),M.default.createElement(ne,{type:J.reply,loveCount:W,replyCount:me,className:"post-reaction",liked:K,isReplied:re,hideCommentIcon:"reply"===i||Ne,hasShare:!1,onCommentClick:()=>le((()=>ce((e=>!e)))),onCommentCountClick:()=>le((()=>{ce(!0)})),onLikeClick:()=>le((()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(H){const t=yield(({commentId:t,setLike:a=!1,locale:l})=>e.__awaiter(void 0,void 0,void 0,(function*(){return p.callApiWithAuth(p.getApiPath(a?p.PATHS.COMMENT.LIKE:p.PATHS.COMMENT.UNLIKE,{_locale:l,id:t}),"GET")})))({commentId:H,setLike:!K,locale:z});1===t.status&&U((e=>Object.assign(Object.assign({},e),{liked:!K,countLikes:e.countLikes+(K?-1:1)})))}}))))}),de&&M.default.createElement(na,{replyingId:s||D.id,replyToName:ge,isReply:!0,onClose:()=>ce(!1),onPostSuccess:e=>{"reply"===i?c&&c(e):se(e)},post:u,replyingUser:X}),"comment"===i&&G&&G.length>0?M.default.createElement("div",{className:"comment-reply-wrapper"},null===(B=null==ue?void 0:ue.slice(0,oe))||void 0===B?void 0:B.map((e=>M.default.createElement(go,{key:e.id,comment:e,type:"reply",className:"comment-reply-item",level:r+1,replyingId:H,onPostCommentSuccess:se,post:u,onDeleteComment:()=>{U((t=>Object.assign(Object.assign({},t),{replies:t.replies.filter((t=>t.id!==e.id)),countReplies:t.countReplies-1})))},handleMakeAppointment:v,hasQuickBookingEnable:f}))),me>oe&&M.default.createElement(M.default.Fragment,null,M.default.createElement(g.Divider,{className:"top-divider",type:"solid"}),M.default.createElement(w.Button,{className:"more-cmt",size:"lg",color:"ghost",onClick:()=>ie((e=>e+4))},O("comment.seeMoreReplies",{count:me-oe}),M.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"})))):null):null,pe&&M.default.createElement(Wl,{onDeleteComment:m,className:"popover",commentId:D.id})))},ho=(t,a)=>e.__awaiter(void 0,void 0,void 0,(function*(){var e,l,o;const n=yield p.callApiWithOptionalAuth(p.getApiPath(p.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(h.formatComment))||void 0===o?void 0:o[0]}));var fo=Object.freeze({__proto__:null});exports.CardAuthor=ot,exports.CardLink=Z,exports.CardPost=({className:a,style:l,hideViewMoreComment:n,showMostEngaging:i,onCommentClick:s,onCommentCountClick:d,onMostEngagingCommentClick:c,onPostCommentSuccess:u,disableCardLink:m,disableShortenContent:g,onDeletePost:h,onEditPost:f,post:v,mostEngagingComment:b,onDeleteComment:x,showInputComment:y,InlineCommentsComponent:C,hasQuickBookingEnable:E,handleMakeAppointment:k,cardAuthorProps:A})=>{const[N,T]=t.useState(v),[S,P]=t.useState(!1),[L,R]=t.useState(b),{community:B,topics:z,author:j,slug:F,isPin:O,liked:D,photos:U,mentions:H,title:W,description:q,previewUrl:G,likesCount:Q,commentsCount:X,id:K,commented:$}=N,{data:{locale:Y,env:{isMarryBaby:ee,togetherBasePath:te}},action:{pushNotifications:ae}}=t.useContext(p.TogetherComponentGlobalContext),{t:le}=o.useTranslations(),[oe,ie]=t.useState(y),se=`${te}/${(null==B?void 0:B.slug)||"_"}/${F||""}`,de=`${p.getCurrentBaseUrl(Y)}${se}`,{authActionWrapper:ue}=_((null==B?void 0:B.slug)?{_joinCommunityIds:[B.id],_joinTopicIds:null==z?void 0:z.map((e=>e.id))}:void 0),[me,pe]=t.useState(!1);t.useEffect((()=>{ie(y)}),[y]);const ge=(null==j?void 0:j.name)||(null==j?void 0:j.username)||"",he=(null==j?void 0:j.username)||(null==j?void 0:j.name)||"",fe=null==j?void 0:j.avatar,ve=(null==N?void 0:N.isAnonymous)||null==j?void 0:j.role,[be,xe]=t.useState(null),[we,ye]=t.useState(null);t.useEffect((()=>{if(null==j?void 0:j.hospitalId){(t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield p.callApi(p.getCarePath(p.CARE_PATHS.GET_HOSPITAL_INFO,{hospital_branch_id:t,website_url:p.domainLocales[Y]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.branch)&&xe(null==a?void 0:a._data.branch)})))(j.hospitalId)}if(null==j?void 0:j.doctorId){(t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield p.callApi(p.getCarePath(p.CARE_PATHS.GET_DOCTOR_INFO,{doctorId:t,website_url:p.domainLocales[Y]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&ye(null==a?void 0:a._data.doctor)})))(j.doctorId)}}),[j.hospitalId,j.doctorId]);const Ce=(null==we?void 0:we.valid_outpatient)||(null==we?void 0:we.valid_telemedicine),Ee=((null==be?void 0:be.total_available_service)||(null==be?void 0:be.total_available_doctor))>0,ke=E&&(Ce||Ee);t.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){if(K&&X&&i&&!(null==b?void 0:b.id)){const e=yield ho(K,Y);R(e)}}))}),[K,Y,X,i,null==b?void 0:b.id]),t.useEffect((()=>{R(b)}),[null==b?void 0:b.id]);const Ae=t=>e.__awaiter(void 0,void 0,void 0,(function*(){if(X>1&&(null==L?void 0:L.id)&&(null==L?void 0:L.id)===(null==t?void 0:t.id)){const e=yield ho(K,Y);R(e)}T((e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount-1}))),x&&x(t)}));return M.default.createElement(V,{defaultParams:(null==B?void 0:B.slug)?{_joinCommunityIds:[B.id],_joinTopicIds:null==z?void 0:z.map((e=>e.id))}:void 0},S&&M.default.createElement(da,{url:de,avatar:p.DEFAULT_IMG,text:W,onClose:()=>P(!1)}),M.default.createElement(Hl,{className:a,style:l,"data-is-marrybaby":ee},O?M.default.createElement(ce,{className:"post-pin"}):null,M.default.createElement("div",{style:{position:"relative",padding:"1rem 1rem 0"}},M.default.createElement(ot,Object.assign({avatar:fe,name:ge,username:he,url:m?void 0:se,community:B,timeText:null==N?void 0:N.createdTime,className:"post-author",role:ve,userId:null==j?void 0:j.id,expertId:null==j?void 0:j.partnerId,doctorId:null==j?void 0:j.doctorId,hospitalId:null==j?void 0:j.hospitalId,title:null==j?void 0:j.title,hasQuickBooking:ke,handleMakeAppointment:k,"data-testid":"name",isAnonymous:!!(null==N?void 0:N.isAnonymous),extendEle:M.default.createElement(_l,{authorEmail:String(null==j?void 0:j.email),onDeletePost:h,shareUrl:de,post:N,className:"popover",onEditPost:f})},A))),M.default.createElement("a",{href:m?void 0:se,className:"post-content-link-wrapper"},W&&M.default.createElement(r.Heading,{className:"post-content-title",as:"h2",tag:"h5",fontWeight:"bold","data-testid":"Title of the Post"},I.default(W)),M.default.createElement(fa,{className:"post-content-wrapper",description:q,disableShortenContent:g,mentions:H,"data-testid":"Content of the Post"})),M.default.createElement("span",null),M.default.createElement("span",null),M.default.createElement("div",{key:"tag-topic"},z&&z.length>0?M.default.createElement(re,{topics:z,className:"post-topics"}):null),M.default.createElement("div",{key:"social-preview"},(null==N?void 0:N.introUrl)?M.default.createElement("div",{className:"social-preview-wrapper "+((null==U?void 0:U.length)?"has-image":"")},M.default.createElement(Ua,{url:N.introUrl,image:N.bannerImage})):null),M.default.createElement("div",{key:"image-preview"},(null==U?void 0:U.length)?M.default.createElement("div",{className:"image-preview-wrapper"},M.default.createElement(Oa,{images:U,authorName:null==j?void 0:j.name})):null),M.default.createElement("div",{key:"link-preview"},(null==N?void 0:N.introUrl)||(null==U?void 0:U.length)||!(null==G?void 0:G.url)?null:M.default.createElement("div",{className:"link-preview-wrapper"},M.default.createElement(Z,{title:G.title,url:G.url,image:G.image}))),M.default.createElement(ne,{isMarryBaby:ee,type:J.post,loveCount:Q,replyCount:X,className:"post-reaction "+((null==U?void 0:U.length)||(null==G?void 0:G.url)?"hide-top-border":""),liked:me?!D:D,isReplied:$,onCommentClick:()=>ue((()=>{s?s():ie((e=>!e))})),onCommentCountClick:()=>{ue((()=>{ee?ie(!0):d?d():!m&&(window.location.href=se)}))},onShareClick:()=>{P(!0)},onLikeClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(K&&!me){pe(!0);try{const t=yield(({id:t,locale:a})=>e.__awaiter(void 0,void 0,void 0,(function*(){if(t)return yield p.callApiWithAuth(p.getApiPath(p.PATHS.POST.LIKE,{id:t,_locale:a}),"GET")})))({id:K,locale:Y});1!==(null==t?void 0:t.status)?ae(nt(le)):T((e=>Object.assign(Object.assign({},e),{likesCount:(e.likesCount||0)+(e.liked?-1:1),liked:!e.liked})))}catch(e){ae(nt(le))}pe(!1)}})),showingMostEngaging:!(!i||!(null==L?void 0:L.id))}),oe&&M.default.createElement(na,{isMainCmt:!y,onClose:()=>ie(!1),onPostSuccess:e=>{0!==X||(null==L?void 0:L.id)||R(e),T((e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount+1,commented:!0}))),u&&u(e)},post:N}),i&&(null==L?void 0:L.id)?M.default.createElement("div",{className:"most-engaging-wrapper",onClick:e=>{c?(e.stopPropagation(),c()):window.location.href=se}},M.default.createElement(go,{hasQuickBookingEnable:E,handleMakeAppointment:k,comment:L,post:N,onDeleteComment:()=>{Ae&&Ae(L)},className:"most-engaging-comment",type:"most-engaging",key:L.id,cardAuthorProps:A}),X>1&&!n&&M.default.createElement(w.Button,{className:"see-more-comments",color:"ghost",size:"md"},le("comment.seeMoreComments",{count:X-1}))):null,C))},exports.CardPostPopoverMore=_l,exports.CardReactions=ne,exports.CardReply=go,exports.CardReplyPopover=Wl,exports.Close=D,exports.CreateNewPostContent=({className:n,style:d,onPostCreatedEdited:c,onClose:u,communities:f=[],forceSelectCommunity:v,forceSelectTopics:b,articleId:x,optionalTopic:w,editPostData:y,defaultCommunity:C,defaultTopics:E,noFetchTopic:k,hideTopicList:A,selectAskDoctor:N,showAskDoctorOptions:T,currentPageUrl:S})=>{const P=!!(null==y?void 0:y.id),{data:{locale:L,env:{isMarryBaby:R}},action:{pushNotifications:B,sanitizeFunction:z}}=t.useContext(p.TogetherComponentGlobalContext),{t:j}=o.useTranslations(),[F,O]=t.useState(!1),[D,U]=t.useState(N),[V,_]=t.useState(!1),[H,W]=t.useState(!1),[q,G]=t.useState(""),[Z,Q]=t.useState(""),[X,K]=t.useState(v?{label:v.name,value:`${v.id||""}-${v.mappedCategoryId||""}`}:{label:j("community.choose"),value:""}),[$,Y]=t.useState([...b]||[]),[J,ee]=t.useState([]),[te,ae]=t.useState([]),le=v||f.find((e=>`${e.id||""}-${e.mappedCategoryId||""}`===X.value)),oe=v?[v]:f.filter((e=>e.isActive)).sort(((e,t)=>e.name>t.name?1:e.name<t.name?-1:0)),[ne,ie]=t.useState(null),[re,se]=t.useState([]),de=q&&I.default(Z)&&(w||!w&&$.length>0)&&le&&(!J||J.length<=p.MAX_IMAGE_UPLOADS)&&!(null==re?void 0:re.length)&&!H;t.useEffect((()=>{if(y){const e=y;G(e.title||""),Q(xt(bt(e.description||"","edit"),e.mentions)),K({label:e.community.name,value:`${e.community.id||""}-${e.community.mappedCategoryId||""}`}),Y(e.topics||[]),ee(e.photos||[]),O(!!e.isAnonymous||!1),U(!!e.isAskDoctor||!1)}else C&&K({label:C.name,value:`${C.id||""}-${C.mappedCategoryId||""}`}),E&&Y(E)}),[]);const ce=()=>e.__awaiter(void 0,void 0,void 0,(function*(){var t,a,l,o,n,i,r,s,d;if(T&&void 0===D)return _(!0),!1;const g=yield(({title:t,description:a,communityId:l,imageFiles:o,previewUrl:n,topicIds:i,locale:r,sanitizeFunction:s,categoryCommunityId:d,categoryTopicIds:c,introUrl:u,bannerUrl:g,scheduleTime:h,isAnonymous:f,isAskDoctor:v})=>e.__awaiter(void 0,void 0,void 0,(function*(){const e=new FormData,b=Et(a),x=Et(t),w=yt(b);if(e.append("title",x),e.append("description",kt(b,s)),d?e.append("category_community",String(d)):l&&e.append("community_id",String(l)),e.append("is_anonymous",f?"1":"0"),e.append("is_question",v?"1":"0"),(null==n?void 0:n.title)&&e.append("preview_title",n.title),(null==n?void 0:n.description)&&e.append("preview_description",n.description),(null==n?void 0:n.url)&&e.append("preview_link",m.safeEncodeURI(n.url)),(null==n?void 0:n.image)&&e.append("preview_image",m.safeEncodeURI(n.image)),null==i||i.forEach((t=>{e.append("topics[]",String(t||""))})),null==c||c.forEach((t=>{e.append("category_topics[]",String(t||""))})),null==o?void 0:o.length){const t=yield Promise.all(o.map(((e,t)=>new Promise((a=>{setTimeout((()=>{a(St(e,r))}),2e3*t)})))));null==t||t.filter(Boolean).slice(0,p.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",u||""),e.append("banner",g||""),h&&(e.append("post_type","scheduled"),e.append("schedule_datetime",h)),e})))({title:q,description:Z,communityId:String((null==le?void 0:le.id)||""),imageFiles:J,previewUrl:ne,topicIds:null==$?void 0:$.map((e=>String(e.id||""))).filter(Boolean),locale:L,sanitizeFunction:z,categoryCommunityId:String((null==le?void 0:le.mappedCategoryId)||""),categoryTopicIds:null==$?void 0:$.map((e=>String(e.mappedCategoryId||""))).filter(Boolean),isAnonymous:F?1:0,isAskDoctor:D?1:0});let f;x&&g.append("article_id",x),P?(null==y?void 0:y.id)&&(f=yield(({id:t,locale:a,formData:l})=>e.__awaiter(void 0,void 0,void 0,(function*(){return yield p.callApiWithAuth(p.getApiPath(p.PATHS.POST.UPDATE,{id:t,_locale:a}),"POST",{data:l})})))({id:y.id,formData:g,locale:L})):f=yield(({locale:t,formData:a,isArticleComment:l})=>e.__awaiter(void 0,void 0,void 0,(function*(){return yield p.callApiWithAuth(p.getApiPath(l?p.PATHS.POST.CREATE_ARTICLE_COMMENT:p.PATHS.POST.CREATE,{_locale:t}),"POST",{data:a})})))({formData:g,locale:L,isArticleComment:!(null==le?void 0:le.id)&&!!(null==le?void 0:le.mappedCategoryId)});const v=null==f?void 0:f.data;(null==v?void 0:v.id)&&!(null===(a=null===(t=null==f?void 0:f.messages)||void 0===t?void 0:t.moderation)||void 0===a?void 0:a.type)?(B({message:j("createPost.popup.success"),type:"success"}),(e=>{c&&c(h.formatPost(e),P),u&&u()})(v)):"banned"===(null===(o=null===(l=null==f?void 0:f.messages)||void 0===l?void 0:l.moderation)||void 0===o?void 0:o.type)?(B({title:j("notification.post.blocked.title"),message:j("notification.post.blocked.message"),type:"danger"}),f.messages.moderation.words&&ae(f.messages.moderation.words)):"suspect"===(null===(i=null===(n=null==f?void 0:f.messages)||void 0===n?void 0:n.moderation)||void 0===i?void 0:i.type)?(B({title:j("notification.post.suspect.title"),message:j("notification.post.suspect.message"),type:"warning"}),u&&u()):(null===(s=null===(r=null==f?void 0:f.messages)||void 0===r?void 0:r.find)||void 0===s?void 0:s.call(r,(e=>{var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(B({message:j("notification.suspend.message"),type:"danger"}),u&&u()):B({message:(null===(d=null==f?void 0:f.messages)||void 0===d?void 0:d[0])||j("notification.failure"),type:"danger"})}));return M.default.createElement(Qt,{className:n,style:d},M.default.createElement("div",{className:"input-group-container"},M.default.createElement(Wt,{className:"input-group",bannedWords:te,value:q,onChange:G}),M.default.createElement(Vt,{className:"input-group",bannedWords:te,value:Z,onChange:Q,onPreviewUrlChange:ie,onInvalidUrlsChange:se,onImageFilesChange:ee,imageFiles:J}),T&&M.default.createElement(Xt,{"data-is-marry-baby":R},M.default.createElement("div",{className:"switch-label"},M.default.createElement(r.Ask,{isMarryBaby:R,size:R?32:24,color:i.theme.colors.primaryBase,className:"label-icon"}),M.default.createElement("span",{className:"label-txt"},j("createPost.askDoctor"))),M.default.createElement(g.BtnChoice,{value:D,choices:[{label:j("createPost.askDoctorChoice.yes"),value:!0,dataEventCategory:"Together",dataEventAction:"Write Post Click - Ask Doctor",dataEventLabel:S},{label:j("createPost.askDoctorChoice.no"),value:!1}],onChange:e=>{"boolean"==typeof e&&(_(!1),U(e))}})),V&&M.default.createElement(Kt,null,M.default.createElement(r.Info,{isSolid:!0,color:i.theme.colors.red700,size:14}),M.default.createElement(r.Text,{size:"p3",as:"span",color:i.theme.colors.red700},j("createPost.message.askDoctorRequire"))),M.default.createElement("div",{className:"input-group"},M.default.createElement(r.Text,{size:"p4",className:"input-group-label"},j("admin.community")),M.default.createElement(l.Dropdown,{options:(null==oe?void 0:oe.map((e=>({label:e.name,value:`${e.id||""}-${e.mappedCategoryId||""}`}))))||[],id:"community-picker",placeholder:j("community.choose"),value:X,dropdownLabelTrackingAttributes:{"data-event-category":"Together","data-event-action":"Write Post Click - Choose Community/Topic","data-event-label":S},onChange:e=>{K({label:e.label,value:String(e.value)}),Y([])},disabled:!!v}),M.default.createElement(r.Text,{size:"sm",className:"warning",color:i.theme.colors.gray400},"* ",j("commentPopup.warning.newPost"))),!A&&M.default.createElement("div",{className:"input-group"},M.default.createElement(r.Text,{size:"p4",className:"input-group-label"},j("tab.topic")),M.default.createElement("div",{className:"input-notification"},M.default.createElement("img",{src:le?"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":it}),M.default.createElement(r.Text,{size:"base",color:i.theme.colors.gray500},j(le?"createPost.popup.primary":"createPost.popup.warning"))),le&&M.default.createElement(Gt,{className:"tag-list",communityId:le.id,forceTopics:b,onChange:Y,selectedTopics:$,noFetch:k,dataEventCategory:"Together",dataEventAction:"Write Post Click - Choose Community/Topic",dataEventLabel:S}))),M.default.createElement("div",{className:"form-action"},M.default.createElement("div",{className:"input-group"},M.default.createElement(a.Checkbox,{className:"swich-input-group",labelPosition:"left",name:"PostAnonymous",checked:F,color:R?"pink":void 0,"data-event-category":"Together","data-event-action":"Write Post Click - Incognito","data-event-label":S,label:M.default.createElement("div",{className:"switch-label"},M.default.createElement("img",{className:"label-icon",src:s.CommonGAssets.getAssetPath("anomyous-avatar.svg"),alt:"anomyous avatar",style:{marginRight:"10px",width:"24px"}}),M.default.createElement("span",{className:"label-txt"},j("createPost.postAnonymous"))),value:"Post Anonymous",onChange:e=>O(e.currentTarget.checked),styles:{body:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},label:{display:"flex",alignItems:"center"}}})),M.default.createElement("div",{className:"input-group"},M.default.createElement(r.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(de&&!H){W(!0);try{yield ce()}catch(e){console.error(e),B(nt(j))}W(!1)}})),disabled:!de,loading:H},j("createPost.popup.submit")))))},exports.CreatePostDescription=Vt,exports.CreatePostTitle=Wt,exports.ImagePreviewPopup=ka,exports.InputCommentBar=na,exports.LabelPin=ce,exports.LabelSortPin=de,exports.LabelSorting=({onChange:e,className:a,style:l,leftLabel:o,rightLabel:n,color:i,value:r,choices:s})=>{const{data:{env:{isMarryBaby:d}}}=t.useContext(p.TogetherComponentGlobalContext);return M.default.createElement(de,{label:o,rightLabel:M.default.createElement(ge,{position:"bottom",align:"end",data:{isShowheader:!1,type:"list",list:s.map((t=>({label:t.label,onClick:()=>e&&e(String(t.value)),selected:t.value===r,className:"bold-item"})))},toggleButtonContent:M.default.createElement("div",{style:{display:"flex"}},M.default.createElement(f.Text,{style:{display:"flex",alignItems:"center",fontWeight:"normal",marginRight:12},size:"p4"},n),M.default.createElement("img",{src:d?"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='M8 14L12 18L16 14' stroke='%233E3F58' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath d='M16 10L12 6L8 10' stroke='%233E3F58' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3c/svg%3e":"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='M4.49992 7H11.4998C11.6352 7 11.7525 6.94506 11.8514 6.83509C11.9502 6.72515 11.9999 6.59496 11.9999 6.44449C11.9999 6.29402 11.9503 6.16389 11.8514 6.0538L8.35141 2.16491C8.25252 2.05509 8.13538 2 7.99988 2C7.86437 2 7.74723 2.05509 7.64826 2.16491L4.1483 6.0538C4.04932 6.16377 3.99988 6.29402 3.99988 6.44449C3.99988 6.59493 4.04932 6.72515 4.1483 6.83509C4.24738 6.94506 4.36452 7 4.49992 7Z' fill='%238C8C8C'/%3e%3cpath d='M11.4998 9H4.49992C4.36441 9 4.24727 9.05497 4.1483 9.16482C4.04932 9.2748 3.99988 9.40496 3.99988 9.55543C3.99988 9.7059 4.04932 9.83616 4.1483 9.94607L7.64826 13.835C7.74734 13.9449 7.86448 14 7.99988 14C8.13527 14 8.25252 13.9449 8.35141 13.835L11.8514 9.94604C11.9502 9.83616 11.9999 9.7059 11.9999 9.5554C11.9999 9.40496 11.9503 9.2748 11.8514 9.16479C11.7525 9.05485 11.6352 9 11.4998 9Z' fill='%238C8C8C'/%3e%3c/svg%3e",style:{width:16,height:16,alignSelf:"center"}}))}),color:"gray",className:a,style:l})},exports.Loading=q,exports.PopoverMenu=pe,exports.PopupDanger=aa,exports.PopupDoctor=Fe,exports.PopupExpert=We,exports.PopupFrame=ta,exports.PopupHospital=Xe,exports.PostContent=fa,exports.PostImagePreview=Oa,exports.PostSingleImageViewPopup=Ma,exports.ProfileDetail=Ll,exports.ProfileDetailModal=et,exports.ShareBox=sa,exports.SharePopup=da,exports.SkipQuestionOfExpertBtn=l=>{var{post:n,onSkip:i,btnText:s,currentPageUrl:d}=l,c=e.__rest(l,["post","onSkip","btnText","currentPageUrl"]);const{t:u}=o.useTranslations(),{data:{locale:m},action:{pushNotifications:g}}=t.useContext(p.TogetherComponentGlobalContext),[h,f]=t.useState(!1),[v,b]=t.useState(!1),x=a.useMantineTheme(),w=t.useCallback((()=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;b(!0);const t=yield p.callApiWithAuth(p.getApiPath(p.PATHS.USER.SKIP_QUESTION,{_locale:m,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),g({title:"",message:"Skip success",type:"success"})):g({title:"",message:null==t?void 0:t.messages,type:"danger"}),b(!1)}))),[]);return M.default.createElement(a.Popover,{width:327,withArrow:!0,shadow:"md",opened:h},M.default.createElement(a.Popover.Target,null,M.default.createElement("div",Object.assign({className:`${Il} ${(null==c?void 0:c.className)||""}`,onClick:()=>f(!0)},c),s||u("profilePanel.questionNotClear"))),M.default.createElement(a.Popover.Dropdown,null,M.default.createElement("div",null,M.default.createElement("div",{className:Rl},u("profilePanel.skipQuestion.heading")),M.default.createElement("div",{className:Bl},u("profilePanel.skipQuestion.content")),M.default.createElement("div",{className:zl},M.default.createElement(r.Button,{size:"md",variant:"secondary",leftIcon:M.default.createElement(r.Close,{color:x.fn.primaryColor(),size:24}),onClick:()=>f(!1),styles:()=>({leftIcon:{marginRight:0}})}),M.default.createElement(r.Button,{variant:"primary",size:"md",leftIcon:M.default.createElement(r.Check,{color:"white",size:24}),onClick:w,loading:v,"data-event-category":"Together","data-event-action":"Unclear Question Click","data-event-label":d,styles:()=>({leftIcon:{marginRight:0}})})))))},exports.SocialLinkPreview=Ua,exports.SourceList=so,exports.SubmitReportForm=pa,exports.TagTopic=re,exports.TogetherAuthConfigContext=U,exports.TogetherAuthConfigContextProvider=V,exports.TopicSelectList=Gt,exports.VerifiedTag=po,exports.types=fo,exports.useTogetherAuthRequiredAction=_;
|
|
3078
|
+
`;var mo="-dzIuHr";const po=({userId:e,avatar:a,name:l,role:n,title:s,className:d})=>{const{t:c}=o.useTranslations(),[u,m]=t.useState(!1);return M.default.createElement(M.default.Fragment,null,M.default.createElement(w.Button,{className:`${mo} ${d}`,color:"success",size:"xs",onClick:()=>m(!0),style:{padding:"5px 8px",marginBottom:"12px",borderRadius:"4px"}},M.default.createElement("span",{className:"text"},M.default.createElement(r.Icon.Endorse,{isSolid:!0,size:18,color:i.theme.colors.green800,className:"icon"}),c("cardReply.verifyBy",{name:`${l||""}`}))),M.default.createElement(et,{open:u,onClose:()=>m(!1),profileModalProps:{zIndex:1e3}},M.default.createElement(Ll,{authorProps:{userId:e,avatar:a,name:l,role:n,title:s},hideQuestionTab:!0})))};const go=({className:a,style:l,comment:n,type:i="comment",level:r=0,replyingId:s,onPostCommentSuccess:c,post:u,onDeleteComment:m,refetchComment:h,hasQuickBookingEnable:f,handleMakeAppointment:v,cardAuthorProps:b,maxChars:x=600,disableShortenContent:y})=>{var C,E,k,A,N,T,S,P,L,I,R,B;const{data:{locale:z,userInfo:j,env:{isMarryBaby:F}}}=t.useContext(p.TogetherComponentGlobalContext),{t:O}=o.useTranslations(),[D,U]=t.useState(n||null),{id:H,countLikes:W,content:q,replies:G=[],images:Q=[],author:X,liked:K,link:$,mentionedUser:Y,mentions:ee}=D,{text:te,replyingTo:ae}=(e=>{try{const t=e.match(/\[@([^\]]+)\]/),a=t?t[0].replace("[@","").replace("]",""):"";return{text:e.replace(/\[@([^\]]+)\]/,"").trim(),replyingTo:a}}catch(e){}return{text:""}})(q),{authActionWrapper:le}=_({_joinCommunityIds:[null===(C=null==u?void 0:u.community)||void 0===C?void 0:C.id],_joinTopicIds:null===(E=null==u?void 0:u.topics)||void 0===E?void 0:E.map((e=>e.id))}),[oe,ie]=t.useState(4),re=!!(null==j?void 0:j.id)&&(null==G?void 0:G.some((e=>e.author.id===j.id))),se=e=>{U((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 h&&h(a),a}return t}))},[de,ce]=t.useState(!1),ue=t.useMemo((()=>"comment"===i&&G&&0!=G.length?G.sort(((e,t)=>{const a=new Date(e.createdAt).getTime(),l=new Date(t.createdAt).getTime();return a>l?-1:a<l?1:0})):G),[i,G]),me=(null==G?void 0:G.length)||0,pe=String(null==X?void 0:X.email)&&(null==j?void 0:j.email)&&String(null==X?void 0:X.email)===String(null==j?void 0:j.email),ge=(null==X?void 0:X.name)||(null==X?void 0:X.username)||"",he=(null==X?void 0:X.username)||(null==X?void 0:X.name)||"",fe=null==X?void 0:X.avatar,ve=(null==u?void 0:u.isAnonymous)||null==X?void 0:X.role,be=[...(null==u?void 0:u.isAnonymous)?[{id:(null===(k=null==u?void 0:u.author)||void 0===k?void 0:k.id)||0,name:O("cardPost.anonymous")}]:[],...ee||[]],[xe,we]=t.useState(null),[ye,Ce]=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 p.callApi(p.getCarePath(p.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)&&we(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 p.callApi(p.getCarePath(p.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)&&Ce(null==a?void 0:a._data.doctor)}));t(X.doctorId)}}),[X.hospitalId,X.doctorId]);const Ee=(null==ye?void 0:ye.valid_outpatient)||(null==ye?void 0:ye.valid_telemedicine),ke=((null==xe?void 0:xe.total_available_service)||(null==xe?void 0:xe.total_available_doctor))>0,Ae=f&&(Ee||ke),Ne="chatbot"===(null===(A=null==D?void 0:D.author)||void 0===A?void 0:A.type);return M.default.createElement(V,{defaultParams:{_joinCommunityIds:[null===(N=null==u?void 0:u.community)||void 0===N?void 0:N.id],_joinTopicIds:null===(T=null==u?void 0:u.topics)||void 0===T?void 0:T.map((e=>e.id))}},M.default.createElement(co,{className:a,style:l,"data-is-reply":!!r,"data-is-marrybaby":F,"data-has-booking":Ae},"reply"===i&&M.default.createElement(g.Divider,{className:"top-divider",type:"solid"}),M.default.createElement("div",{style:{padding:"16px 16px 0"}},M.default.createElement(ot,Object.assign({avatar:fe,name:ge,username:he,timeText:null==u?void 0:u.createdTime,community:null==u?void 0:u.community,className:"post-author "+(pe?"with-popover":""),type:i,userId:null==X?void 0:X.id,role:ve,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:Ae,handleMakeAppointment:v,isAnonymous:!!(null==u?void 0:u.isAnonymous),hideBackground:Ne,userType:null==X?void 0:X.type},b)),Boolean(null==D?void 0:D.isVerify)&&!Boolean(null==D?void 0:D.isOppose)&&M.default.createElement(po,{title:null===(S=null==D?void 0:D.userVerify)||void 0===S?void 0:S.title,name:null===(P=null==D?void 0:D.userVerify)||void 0===P?void 0:P.name,userId:null===(L=null==D?void 0:D.userVerify)||void 0===L?void 0:L.id,role:null===(I=null==D?void 0:D.userVerify)||void 0===I?void 0:I.role,avatar:null===(R=null==D?void 0:D.userVerify)||void 0===R?void 0:R.avatar,className:"verify-tag"})),M.default.createElement(fa,{className:"post-content-wrapper",replyingTo:ae,mentionedUser:Y,description:te,mentions:be,maxChars:x,disableShortenContent:y}),M.default.createElement("span",null),M.default.createElement("span",null),Q&&Q.length>0?M.default.createElement("div",{key:"image-preview",className:"image-preview-wrapper","data-is-reply":!0},M.default.createElement(Oa,{images:Q,authorName:null==X?void 0:X.username})):null,Q&&0!==Q.length||!$?null:M.default.createElement("div",{key:"link-preview",className:"link-preview-wrapper","data-is-reply":!0},M.default.createElement(Z,{url:$})),"most-engaging"!==i?M.default.createElement(M.default.Fragment,null,Ne&&M.default.createElement(uo,{listUrl:null==D?void 0:D.source,categorySlug:null==D?void 0:D.categorySlug}),M.default.createElement(ne,{type:J.reply,loveCount:W,replyCount:me,className:"post-reaction",liked:K,isReplied:re,hideCommentIcon:"reply"===i||Ne,hasShare:!1,onCommentClick:()=>le((()=>ce((e=>!e)))),onCommentCountClick:()=>le((()=>{ce(!0)})),onLikeClick:()=>le((()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(H){const t=yield(({commentId:t,setLike:a=!1,locale:l})=>e.__awaiter(void 0,void 0,void 0,(function*(){return p.callApiWithAuth(p.getApiPath(a?p.PATHS.COMMENT.LIKE:p.PATHS.COMMENT.UNLIKE,{_locale:l,id:t}),"GET")})))({commentId:H,setLike:!K,locale:z});1===t.status&&U((e=>Object.assign(Object.assign({},e),{liked:!K,countLikes:e.countLikes+(K?-1:1)})))}}))))}),de&&M.default.createElement(na,{replyingId:s||D.id,replyToName:ge,isReply:!0,onClose:()=>ce(!1),onPostSuccess:e=>{"reply"===i?c&&c(e):se(e)},post:u,replyingUser:X}),"comment"===i&&G&&G.length>0?M.default.createElement("div",{className:"comment-reply-wrapper"},null===(B=null==ue?void 0:ue.slice(0,oe))||void 0===B?void 0:B.map((e=>M.default.createElement(go,{key:e.id,comment:e,type:"reply",className:"comment-reply-item",level:r+1,replyingId:H,onPostCommentSuccess:se,post:u,onDeleteComment:()=>{U((t=>Object.assign(Object.assign({},t),{replies:t.replies.filter((t=>t.id!==e.id)),countReplies:t.countReplies-1})))},handleMakeAppointment:v,hasQuickBookingEnable:f}))),me>oe&&M.default.createElement(M.default.Fragment,null,M.default.createElement(g.Divider,{className:"top-divider",type:"solid"}),M.default.createElement(w.Button,{className:"more-cmt",size:"lg",color:"ghost",onClick:()=>ie((e=>e+4))},O("comment.seeMoreReplies",{count:me-oe}),M.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"})))):null):null,pe&&M.default.createElement(Wl,{onDeleteComment:m,className:"popover",commentId:D.id})))},ho=(t,a)=>e.__awaiter(void 0,void 0,void 0,(function*(){var e,l,o;const n=yield p.callApiWithOptionalAuth(p.getApiPath(p.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(h.formatComment))||void 0===o?void 0:o[0]}));var fo=Object.freeze({__proto__:null});exports.CardAuthor=ot,exports.CardLink=Z,exports.CardPost=({className:a,style:l,hideViewMoreComment:n,showMostEngaging:i,onCommentClick:s,onCommentCountClick:d,onMostEngagingCommentClick:c,onPostCommentSuccess:u,disableCardLink:m,disableShortenContent:g,onDeletePost:h,onEditPost:f,post:v,mostEngagingComment:b,onDeleteComment:x,showInputComment:y,InlineCommentsComponent:C,hasQuickBookingEnable:E,handleMakeAppointment:k,cardAuthorProps:A})=>{const[N,T]=t.useState(v),[S,P]=t.useState(!1),[L,R]=t.useState(b),{community:B,topics:z,author:j,slug:F,isPin:O,liked:D,photos:U,mentions:H,title:W,description:q,previewUrl:G,likesCount:Q,commentsCount:X,id:K,commented:$}=N,{data:{locale:Y,env:{isMarryBaby:ee,togetherBasePath:te}},action:{pushNotifications:ae}}=t.useContext(p.TogetherComponentGlobalContext),{t:le}=o.useTranslations(),[oe,ie]=t.useState(y),se=`${te}/${(null==B?void 0:B.slug)||"_"}/${F||""}`,de=`${p.getCurrentBaseUrl(Y)}${se}`,{authActionWrapper:ue}=_((null==B?void 0:B.slug)?{_joinCommunityIds:[B.id],_joinTopicIds:null==z?void 0:z.map((e=>e.id))}:void 0),[me,pe]=t.useState(!1);t.useEffect((()=>{ie(y)}),[y]);const ge=(null==j?void 0:j.name)||(null==j?void 0:j.username)||"",he=(null==j?void 0:j.username)||(null==j?void 0:j.name)||"",fe=null==j?void 0:j.avatar,ve=(null==N?void 0:N.isAnonymous)||null==j?void 0:j.role,[be,xe]=t.useState(null),[we,ye]=t.useState(null);t.useEffect((()=>{if(null==j?void 0:j.hospitalId){(t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield p.callApi(p.getCarePath(p.CARE_PATHS.GET_HOSPITAL_INFO,{hospital_branch_id:t,website_url:p.domainLocales[Y]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.branch)&&xe(null==a?void 0:a._data.branch)})))(j.hospitalId)}if(null==j?void 0:j.doctorId){(t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield p.callApi(p.getCarePath(p.CARE_PATHS.GET_DOCTOR_INFO,{doctorId:t,website_url:p.domainLocales[Y]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&ye(null==a?void 0:a._data.doctor)})))(j.doctorId)}}),[j.hospitalId,j.doctorId]);const Ce=(null==we?void 0:we.valid_outpatient)||(null==we?void 0:we.valid_telemedicine),Ee=((null==be?void 0:be.total_available_service)||(null==be?void 0:be.total_available_doctor))>0,ke=E&&(Ce||Ee);t.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){if(K&&X&&i&&!(null==b?void 0:b.id)){const e=yield ho(K,Y);R(e)}}))}),[K,Y,X,i,null==b?void 0:b.id]),t.useEffect((()=>{R(b)}),[null==b?void 0:b.id]);const Ae=t=>e.__awaiter(void 0,void 0,void 0,(function*(){if(X>1&&(null==L?void 0:L.id)&&(null==L?void 0:L.id)===(null==t?void 0:t.id)){const e=yield ho(K,Y);R(e)}T((e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount-1}))),x&&x(t)}));return M.default.createElement(V,{defaultParams:(null==B?void 0:B.slug)?{_joinCommunityIds:[B.id],_joinTopicIds:null==z?void 0:z.map((e=>e.id))}:void 0},S&&M.default.createElement(da,{url:de,avatar:p.DEFAULT_IMG,text:W,onClose:()=>P(!1)}),M.default.createElement(Hl,{className:a,style:l,"data-is-marrybaby":ee},O?M.default.createElement(ce,{className:"post-pin"}):null,M.default.createElement("div",{style:{position:"relative",padding:"1rem 1rem 0"}},M.default.createElement(ot,Object.assign({avatar:fe,name:ge,username:he,url:m?void 0:se,community:B,timeText:null==N?void 0:N.createdTime,className:"post-author",role:ve,userId:null==j?void 0:j.id,expertId:null==j?void 0:j.partnerId,doctorId:null==j?void 0:j.doctorId,hospitalId:null==j?void 0:j.hospitalId,title:null==j?void 0:j.title,hasQuickBooking:ke,handleMakeAppointment:k,"data-testid":"name",isAnonymous:!!(null==N?void 0:N.isAnonymous),extendEle:M.default.createElement(_l,{authorEmail:String(null==j?void 0:j.email),onDeletePost:h,shareUrl:de,post:N,className:"popover",onEditPost:f})},A))),M.default.createElement("a",{href:m?void 0:se,className:"post-content-link-wrapper"},W&&M.default.createElement(r.Heading,{className:"post-content-title",as:"h2",tag:"h5",fontWeight:"bold","data-testid":"Title of the Post"},I.default(W)),M.default.createElement(fa,{className:"post-content-wrapper",description:q,disableShortenContent:g,mentions:H,"data-testid":"Content of the Post"})),M.default.createElement("span",null),M.default.createElement("span",null),M.default.createElement("div",{key:"tag-topic"},z&&z.length>0?M.default.createElement(re,{topics:z,className:"post-topics"}):null),M.default.createElement("div",{key:"social-preview"},(null==N?void 0:N.introUrl)?M.default.createElement("div",{className:"social-preview-wrapper "+((null==U?void 0:U.length)?"has-image":"")},M.default.createElement(Ua,{url:N.introUrl,image:N.bannerImage})):null),M.default.createElement("div",{key:"image-preview"},(null==U?void 0:U.length)?M.default.createElement("div",{className:"image-preview-wrapper"},M.default.createElement(Oa,{images:U,authorName:null==j?void 0:j.name})):null),M.default.createElement("div",{key:"link-preview"},(null==N?void 0:N.introUrl)||(null==U?void 0:U.length)||!(null==G?void 0:G.url)?null:M.default.createElement("div",{className:"link-preview-wrapper"},M.default.createElement(Z,{title:G.title,url:G.url,image:G.image}))),M.default.createElement(ne,{isMarryBaby:ee,type:J.post,loveCount:Q,replyCount:X,className:"post-reaction "+((null==U?void 0:U.length)||(null==G?void 0:G.url)?"hide-top-border":""),liked:me?!D:D,isReplied:$,onCommentClick:()=>ue((()=>{s?s():ie((e=>!e))})),onCommentCountClick:()=>{ue((()=>{ee?ie(!0):d?d():!m&&(window.location.href=se)}))},onShareClick:()=>{P(!0)},onLikeClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(K&&!me){pe(!0);try{const t=yield(({id:t,locale:a})=>e.__awaiter(void 0,void 0,void 0,(function*(){if(t)return yield p.callApiWithAuth(p.getApiPath(p.PATHS.POST.LIKE,{id:t,_locale:a}),"GET")})))({id:K,locale:Y});1!==(null==t?void 0:t.status)?ae(nt(le)):T((e=>Object.assign(Object.assign({},e),{likesCount:(e.likesCount||0)+(e.liked?-1:1),liked:!e.liked})))}catch(e){ae(nt(le))}pe(!1)}})),showingMostEngaging:!(!i||!(null==L?void 0:L.id))}),oe&&M.default.createElement(na,{isMainCmt:!y,onClose:()=>ie(!1),onPostSuccess:e=>{0!==X||(null==L?void 0:L.id)||R(e),T((e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount+1,commented:!0}))),u&&u(e)},post:N}),i&&(null==L?void 0:L.id)?M.default.createElement("div",{className:"most-engaging-wrapper",onClick:e=>{c?(e.stopPropagation(),c()):window.location.href=se}},M.default.createElement(go,{hasQuickBookingEnable:E,handleMakeAppointment:k,comment:L,post:N,onDeleteComment:()=>{Ae&&Ae(L)},className:"most-engaging-comment",type:"most-engaging",key:L.id,cardAuthorProps:A}),X>1&&!n&&M.default.createElement(w.Button,{className:"see-more-comments",color:"ghost",size:"md"},le("comment.seeMoreComments",{count:X-1}))):null,C))},exports.CardPostPopoverMore=_l,exports.CardReactions=ne,exports.CardReply=go,exports.CardReplyPopover=Wl,exports.Close=D,exports.CreateNewPostContent=({className:n,style:d,onPostCreatedEdited:c,onClose:u,communities:f=[],forceSelectCommunity:v,forceSelectTopics:b,articleId:x,optionalTopic:w,editPostData:y,defaultCommunity:C,defaultTopics:E,noFetchTopic:k,hideTopicList:A,selectAskDoctor:N,showAskDoctorOptions:T,currentPageUrl:S})=>{const P=!!(null==y?void 0:y.id),{data:{locale:L,env:{isMarryBaby:R}},action:{pushNotifications:B,sanitizeFunction:z}}=t.useContext(p.TogetherComponentGlobalContext),{t:j}=o.useTranslations(),[F,O]=t.useState(!1),[D,U]=t.useState(N),[V,_]=t.useState(!1),[H,W]=t.useState(!1),[q,G]=t.useState(!1),[Z,Q]=t.useState(""),[X,K]=t.useState(""),[$,Y]=t.useState(v?{label:v.name,value:`${v.id||""}-${v.mappedCategoryId||""}`}:{label:j("community.choose"),value:""}),[J,ee]=t.useState([...b]||[]),[te,ae]=t.useState([]),[le,oe]=t.useState([]),ne=v||f.find((e=>`${e.id||""}-${e.mappedCategoryId||""}`===$.value)),ie=v?[v]:f.filter((e=>e.isActive)).sort(((e,t)=>e.name>t.name?1:e.name<t.name?-1:0)),[re,se]=t.useState(null),[de,ce]=t.useState([]),ue=Z&&!H&&I.default(X)&&(w||!w&&J.length>0)&&ne&&(!te||te.length<=p.MAX_IMAGE_UPLOADS)&&!(null==de?void 0:de.length)&&!q;t.useEffect((()=>{if(y){const e=y;Q(e.title||""),K(Ct(yt(e.description||"","edit"),e.mentions)),Y({label:e.community.name,value:`${e.community.id||""}-${e.community.mappedCategoryId||""}`}),ee(e.topics||[]),ae(e.photos||[]),O(!!e.isAnonymous||!1),U(!!e.isAskDoctor||!1)}else C&&Y({label:C.name,value:`${C.id||""}-${C.mappedCategoryId||""}`}),E&&ee(E)}),[]),t.useEffect((()=>{W(""!==Z&&!/[a-zA-Z]/.test(Z))}),[Z]);const me=()=>e.__awaiter(void 0,void 0,void 0,(function*(){var t,a,l,o,n,i,r,s,d;if(T&&void 0===D)return _(!0),!1;const g=yield(({title:t,description:a,communityId:l,imageFiles:o,previewUrl:n,topicIds:i,locale:r,sanitizeFunction:s,categoryCommunityId:d,categoryTopicIds:c,introUrl:u,bannerUrl:g,scheduleTime:h,isAnonymous:f,isAskDoctor:v})=>e.__awaiter(void 0,void 0,void 0,(function*(){const e=new FormData,b=Nt(a),x=Nt(t),w=kt(b);if(e.append("title",x),e.append("description",Tt(b,s)),d?e.append("category_community",String(d)):l&&e.append("community_id",String(l)),e.append("is_anonymous",f?"1":"0"),e.append("is_question",v?"1":"0"),(null==n?void 0:n.title)&&e.append("preview_title",n.title),(null==n?void 0:n.description)&&e.append("preview_description",n.description),(null==n?void 0:n.url)&&e.append("preview_link",m.safeEncodeURI(n.url)),(null==n?void 0:n.image)&&e.append("preview_image",m.safeEncodeURI(n.image)),null==i||i.forEach((t=>{e.append("topics[]",String(t||""))})),null==c||c.forEach((t=>{e.append("category_topics[]",String(t||""))})),null==o?void 0:o.length){const t=yield Promise.all(o.map(((e,t)=>new Promise((a=>{setTimeout((()=>{a(Mt(e,r))}),2e3*t)})))));null==t||t.filter(Boolean).slice(0,p.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",u||""),e.append("banner",g||""),h&&(e.append("post_type","scheduled"),e.append("schedule_datetime",h)),e})))({title:Z,description:X,communityId:String((null==ne?void 0:ne.id)||""),imageFiles:te,previewUrl:re,topicIds:null==J?void 0:J.map((e=>String(e.id||""))).filter(Boolean),locale:L,sanitizeFunction:z,categoryCommunityId:String((null==ne?void 0:ne.mappedCategoryId)||""),categoryTopicIds:null==J?void 0:J.map((e=>String(e.mappedCategoryId||""))).filter(Boolean),isAnonymous:F?1:0,isAskDoctor:D?1:0});let f;x&&g.append("article_id",x),P?(null==y?void 0:y.id)&&(f=yield(({id:t,locale:a,formData:l})=>e.__awaiter(void 0,void 0,void 0,(function*(){return yield p.callApiWithAuth(p.getApiPath(p.PATHS.POST.UPDATE,{id:t,_locale:a}),"POST",{data:l})})))({id:y.id,formData:g,locale:L})):f=yield(({locale:t,formData:a,isArticleComment:l})=>e.__awaiter(void 0,void 0,void 0,(function*(){return yield p.callApiWithAuth(p.getApiPath(l?p.PATHS.POST.CREATE_ARTICLE_COMMENT:p.PATHS.POST.CREATE,{_locale:t}),"POST",{data:a})})))({formData:g,locale:L,isArticleComment:!(null==ne?void 0:ne.id)&&!!(null==ne?void 0:ne.mappedCategoryId)});const v=null==f?void 0:f.data;(null==v?void 0:v.id)&&!(null===(a=null===(t=null==f?void 0:f.messages)||void 0===t?void 0:t.moderation)||void 0===a?void 0:a.type)?(B({message:j("createPost.popup.success"),type:"success"}),(e=>{c&&c(h.formatPost(e),P),u&&u()})(v)):"banned"===(null===(o=null===(l=null==f?void 0:f.messages)||void 0===l?void 0:l.moderation)||void 0===o?void 0:o.type)?(B({title:j("notification.post.blocked.title"),message:j("notification.post.blocked.message"),type:"danger"}),f.messages.moderation.words&&oe(f.messages.moderation.words)):"suspect"===(null===(i=null===(n=null==f?void 0:f.messages)||void 0===n?void 0:n.moderation)||void 0===i?void 0:i.type)?(B({title:j("notification.post.suspect.title"),message:j("notification.post.suspect.message"),type:"warning"}),u&&u()):(null===(s=null===(r=null==f?void 0:f.messages)||void 0===r?void 0:r.find)||void 0===s?void 0:s.call(r,(e=>{var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(B({message:j("notification.suspend.message"),type:"danger"}),u&&u()):B({message:(null===(d=null==f?void 0:f.messages)||void 0===d?void 0:d[0])||j("notification.failure"),type:"danger"})}));return M.default.createElement(it,{className:n,style:d},M.default.createElement("div",{className:"input-group-container"},M.default.createElement(Zt,{className:"input-group",bannedWords:le,value:Z,onChange:Q}),H&&M.default.createElement(st,null,M.default.createElement(r.Info,{isSolid:!0,color:i.theme.colors.red700,size:14}),M.default.createElement(r.Text,{size:"p3",as:"span",color:i.theme.colors.red700},j("createPost.popup.specialCharErr"))),M.default.createElement(Wt,{className:"input-group",bannedWords:le,value:X,onChange:K,onPreviewUrlChange:se,onInvalidUrlsChange:ce,onImageFilesChange:ae,imageFiles:te}),T&&M.default.createElement(rt,{"data-is-marry-baby":R},M.default.createElement("div",{className:"switch-label"},M.default.createElement(r.Ask,{isMarryBaby:R,size:R?32:24,color:i.theme.colors.primaryBase,className:"label-icon"}),M.default.createElement("span",{className:"label-txt"},j("createPost.askDoctor"))),M.default.createElement(g.BtnChoice,{value:D,choices:[{label:j("createPost.askDoctorChoice.yes"),value:!0,dataEventCategory:"Together",dataEventAction:"Write Post Click - Ask Doctor",dataEventLabel:S},{label:j("createPost.askDoctorChoice.no"),value:!1}],onChange:e=>{"boolean"==typeof e&&(_(!1),U(e))}})),V&&M.default.createElement(st,null,M.default.createElement(r.Info,{isSolid:!0,color:i.theme.colors.red700,size:14}),M.default.createElement(r.Text,{size:"p3",as:"span",color:i.theme.colors.red700},j("createPost.message.askDoctorRequire"))),M.default.createElement("div",{className:"input-group"},M.default.createElement(r.Text,{size:"p4",className:"input-group-label"},j("admin.community")),M.default.createElement(l.Dropdown,{options:(null==ie?void 0:ie.map((e=>({label:e.name,value:`${e.id||""}-${e.mappedCategoryId||""}`}))))||[],id:"community-picker",placeholder:j("community.choose"),value:$,dropdownLabelTrackingAttributes:{"data-event-category":"Together","data-event-action":"Write Post Click - Choose Community/Topic","data-event-label":S},onChange:e=>{Y({label:e.label,value:String(e.value)}),ee([])},disabled:!!v}),M.default.createElement(r.Text,{size:"sm",className:"warning",color:i.theme.colors.gray400},"* ",j("commentPopup.warning.newPost"))),!A&&M.default.createElement("div",{className:"input-group"},M.default.createElement(r.Text,{size:"p4",className:"input-group-label"},j("tab.topic")),M.default.createElement("div",{className:"input-notification"},M.default.createElement("img",{src:ne?"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":dt}),M.default.createElement(r.Text,{size:"base",color:i.theme.colors.gray500},j(ne?"createPost.popup.primary":"createPost.popup.warning"))),ne&&M.default.createElement(Xt,{className:"tag-list",communityId:ne.id,forceTopics:b,onChange:ee,selectedTopics:J,noFetch:k,dataEventCategory:"Together",dataEventAction:"Write Post Click - Choose Community/Topic",dataEventLabel:S}))),M.default.createElement("div",{className:"form-action"},M.default.createElement("div",{className:"input-group"},M.default.createElement(a.Checkbox,{className:"swich-input-group",labelPosition:"left",name:"PostAnonymous",checked:F,color:R?"pink":void 0,"data-event-category":"Together","data-event-action":"Write Post Click - Incognito","data-event-label":S,label:M.default.createElement("div",{className:"switch-label"},M.default.createElement("img",{className:"label-icon",src:s.CommonGAssets.getAssetPath("anomyous-avatar.svg"),alt:"anomyous avatar",style:{marginRight:"10px",width:"24px"}}),M.default.createElement("span",{className:"label-txt"},j("createPost.postAnonymous"))),value:"Post Anonymous",onChange:e=>O(e.currentTarget.checked),styles:{body:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},label:{display:"flex",alignItems:"center"}}})),M.default.createElement("div",{className:"input-group"},M.default.createElement(r.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(ue&&!q){G(!0);try{yield me()}catch(e){console.error(e),B(nt(j))}G(!1)}})),disabled:!ue,loading:q},j("createPost.popup.submit")))))},exports.CreatePostDescription=Wt,exports.CreatePostTitle=Zt,exports.ImagePreviewPopup=ka,exports.InputCommentBar=na,exports.LabelPin=ce,exports.LabelSortPin=de,exports.LabelSorting=({onChange:e,className:a,style:l,leftLabel:o,rightLabel:n,color:i,value:r,choices:s})=>{const{data:{env:{isMarryBaby:d}}}=t.useContext(p.TogetherComponentGlobalContext);return M.default.createElement(de,{label:o,rightLabel:M.default.createElement(ge,{position:"bottom",align:"end",data:{isShowheader:!1,type:"list",list:s.map((t=>({label:t.label,onClick:()=>e&&e(String(t.value)),selected:t.value===r,className:"bold-item"})))},toggleButtonContent:M.default.createElement("div",{style:{display:"flex"}},M.default.createElement(f.Text,{style:{display:"flex",alignItems:"center",fontWeight:"normal",marginRight:12},size:"p4"},n),M.default.createElement("img",{src:d?"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='M8 14L12 18L16 14' stroke='%233E3F58' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath d='M16 10L12 6L8 10' stroke='%233E3F58' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3c/svg%3e":"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='M4.49992 7H11.4998C11.6352 7 11.7525 6.94506 11.8514 6.83509C11.9502 6.72515 11.9999 6.59496 11.9999 6.44449C11.9999 6.29402 11.9503 6.16389 11.8514 6.0538L8.35141 2.16491C8.25252 2.05509 8.13538 2 7.99988 2C7.86437 2 7.74723 2.05509 7.64826 2.16491L4.1483 6.0538C4.04932 6.16377 3.99988 6.29402 3.99988 6.44449C3.99988 6.59493 4.04932 6.72515 4.1483 6.83509C4.24738 6.94506 4.36452 7 4.49992 7Z' fill='%238C8C8C'/%3e%3cpath d='M11.4998 9H4.49992C4.36441 9 4.24727 9.05497 4.1483 9.16482C4.04932 9.2748 3.99988 9.40496 3.99988 9.55543C3.99988 9.7059 4.04932 9.83616 4.1483 9.94607L7.64826 13.835C7.74734 13.9449 7.86448 14 7.99988 14C8.13527 14 8.25252 13.9449 8.35141 13.835L11.8514 9.94604C11.9502 9.83616 11.9999 9.7059 11.9999 9.5554C11.9999 9.40496 11.9503 9.2748 11.8514 9.16479C11.7525 9.05485 11.6352 9 11.4998 9Z' fill='%238C8C8C'/%3e%3c/svg%3e",style:{width:16,height:16,alignSelf:"center"}}))}),color:"gray",className:a,style:l})},exports.Loading=q,exports.PopoverMenu=pe,exports.PopupDanger=aa,exports.PopupDoctor=Fe,exports.PopupExpert=We,exports.PopupFrame=ta,exports.PopupHospital=Xe,exports.PostContent=fa,exports.PostImagePreview=Oa,exports.PostSingleImageViewPopup=Ma,exports.ProfileDetail=Ll,exports.ProfileDetailModal=et,exports.ShareBox=sa,exports.SharePopup=da,exports.SkipQuestionOfExpertBtn=l=>{var{post:n,onSkip:i,btnText:s,currentPageUrl:d}=l,c=e.__rest(l,["post","onSkip","btnText","currentPageUrl"]);const{t:u}=o.useTranslations(),{data:{locale:m},action:{pushNotifications:g}}=t.useContext(p.TogetherComponentGlobalContext),[h,f]=t.useState(!1),[v,b]=t.useState(!1),x=a.useMantineTheme(),w=t.useCallback((()=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;b(!0);const t=yield p.callApiWithAuth(p.getApiPath(p.PATHS.USER.SKIP_QUESTION,{_locale:m,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),g({title:"",message:"Skip success",type:"success"})):g({title:"",message:null==t?void 0:t.messages,type:"danger"}),b(!1)}))),[]);return M.default.createElement(a.Popover,{width:327,withArrow:!0,shadow:"md",opened:h},M.default.createElement(a.Popover.Target,null,M.default.createElement("div",Object.assign({className:`${Il} ${(null==c?void 0:c.className)||""}`,onClick:()=>f(!0)},c),s||u("profilePanel.questionNotClear"))),M.default.createElement(a.Popover.Dropdown,null,M.default.createElement("div",null,M.default.createElement("div",{className:Rl},u("profilePanel.skipQuestion.heading")),M.default.createElement("div",{className:Bl},u("profilePanel.skipQuestion.content")),M.default.createElement("div",{className:zl},M.default.createElement(r.Button,{size:"md",variant:"secondary",leftIcon:M.default.createElement(r.Close,{color:x.fn.primaryColor(),size:24}),onClick:()=>f(!1),styles:()=>({leftIcon:{marginRight:0}})}),M.default.createElement(r.Button,{variant:"primary",size:"md",leftIcon:M.default.createElement(r.Check,{color:"white",size:24}),onClick:w,loading:v,"data-event-category":"Together","data-event-action":"Unclear Question Click","data-event-label":d,styles:()=>({leftIcon:{marginRight:0}})})))))},exports.SocialLinkPreview=Ua,exports.SourceList=so,exports.SubmitReportForm=pa,exports.TagTopic=re,exports.TogetherAuthConfigContext=U,exports.TogetherAuthConfigContextProvider=V,exports.TopicSelectList=Xt,exports.VerifiedTag=po,exports.types=fo,exports.useTogetherAuthRequiredAction=_;
|