@hhgtech/hhg-components 1.29.332-beta-9 → 1.29.332-beta-11

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.
Files changed (549) hide show
  1. package/build/{LastPeriod-7daf5d99.js → LastPeriod-f7675a4c.js} +1 -1
  2. package/build/{MobileBottomNavigationIcon-2b66613f.js → MobileBottomNavigationIcon-acf5432f.js} +3 -3
  3. package/build/{Spinner-cde7d18f.js → Spinner-6b2a4af0.js} +1 -1
  4. package/build/{WhatsApp-2daf65a7.js → WhatsApp-ccee36b9.js} +1 -1
  5. package/build/adapters.js +19 -19
  6. package/build/atoms.js +46 -46
  7. package/build/babyGrowth.js +83 -83
  8. package/build/cache.js +2 -2
  9. package/build/care.js +17 -17
  10. package/build/careBookingSearchBar.js +14 -14
  11. package/build/careBookingSearchBarV2.js +15 -15
  12. package/build/components.js +90 -90
  13. package/build/{constants-5b7ecf5c.js → constants-fb2bac42.js} +1 -1
  14. package/build/constants.js +3 -3
  15. package/build/constantsDomainLocales.js +1 -1
  16. package/build/constantsRiskScreener.js +2 -2
  17. package/build/constantsSite.js +2 -2
  18. package/build/{core-02686407.js → core-755482e3.js} +1 -1
  19. package/build/{dataTransform-d2b09e0f.js → dataTransform-0c2530cb.js} +1 -1
  20. package/build/ecom.js +4 -4
  21. package/build/{editor-071c917e.js → editor-1b7f4cb1.js} +12 -11
  22. package/build/embeddedHeathToolCards_babyGrowth.js +23 -23
  23. package/build/embeddedHeathToolCards_babyPoop.js +19 -19
  24. package/build/embeddedHeathToolCards_babyVaccine.js +22 -22
  25. package/build/embeddedHeathToolCards_bmi_bmi.js +25 -25
  26. package/build/embeddedHeathToolCards_bmrBmr.js +25 -25
  27. package/build/embeddedHeathToolCards_dueDate_dueDate.js +22 -22
  28. package/build/embeddedHeathToolCards_ovulation_ovulation.js +22 -22
  29. package/build/embeddedHeathToolCards_pwg_pwg.js +26 -26
  30. package/build/embeddedHeathToolCards_targetHeartRate.js +27 -27
  31. package/build/esm/{LastPeriod-61e2acb7.js → LastPeriod-7967dc4c.js} +1 -1
  32. package/build/esm/{MobileBottomNavigationIcon-058bb723.js → MobileBottomNavigationIcon-9e696fda.js} +3 -3
  33. package/build/esm/{Spinner-5811672e.js → Spinner-41231aa0.js} +1 -1
  34. package/build/esm/{WhatsApp-a2f02ef4.js → WhatsApp-fb4b7d48.js} +1 -1
  35. package/build/esm/adapters.js +19 -19
  36. package/build/esm/atoms.js +46 -46
  37. package/build/esm/babyGrowth.js +83 -83
  38. package/build/esm/cache.js +2 -2
  39. package/build/esm/care.js +17 -17
  40. package/build/esm/careBookingSearchBar.js +14 -14
  41. package/build/esm/careBookingSearchBarV2.js +15 -15
  42. package/build/esm/components.js +90 -90
  43. package/build/esm/{constants-e99ae5ef.js → constants-5b231c69.js} +1 -1
  44. package/build/esm/constants.js +3 -3
  45. package/build/esm/constantsDomainLocales.js +1 -1
  46. package/build/esm/constantsRiskScreener.js +2 -2
  47. package/build/esm/constantsSite.js +2 -2
  48. package/build/esm/{core-4fcd11fb.js → core-531435b5.js} +1 -1
  49. package/build/esm/{dataTransform-ad84bf44.js → dataTransform-cbfccb61.js} +1 -1
  50. package/build/esm/ecom.js +4 -4
  51. package/build/esm/{editor-d1bb7972.js → editor-7e462cf0.js} +12 -12
  52. package/build/esm/embeddedHeathToolCards_babyGrowth.js +23 -23
  53. package/build/esm/embeddedHeathToolCards_babyPoop.js +19 -19
  54. package/build/esm/embeddedHeathToolCards_babyVaccine.js +22 -22
  55. package/build/esm/embeddedHeathToolCards_bmi_bmi.js +25 -25
  56. package/build/esm/embeddedHeathToolCards_bmrBmr.js +25 -25
  57. package/build/esm/embeddedHeathToolCards_dueDate_dueDate.js +22 -22
  58. package/build/esm/embeddedHeathToolCards_ovulation_ovulation.js +22 -22
  59. package/build/esm/embeddedHeathToolCards_pwg_pwg.js +26 -26
  60. package/build/esm/embeddedHeathToolCards_targetHeartRate.js +27 -27
  61. package/build/esm/footer.js +21 -21
  62. package/build/esm/gAssets.js +2 -2
  63. package/build/esm/healthToolsCardWrapper.js +18 -18
  64. package/build/esm/healthToolsForm.js +33 -33
  65. package/build/esm/hooks.js +13 -13
  66. package/build/esm/i18n/translationKeys.d.ts +1 -1
  67. package/build/esm/i18n-values/en-PH.js +8 -1
  68. package/build/esm/i18n-values/hi-IN.js +8 -1
  69. package/build/esm/i18n-values/id-ID.js +8 -1
  70. package/build/esm/i18n-values/km-KH.js +8 -1
  71. package/build/esm/i18n-values/ms-MY.js +8 -1
  72. package/build/esm/i18n-values/my-MM.js +8 -1
  73. package/build/esm/i18n-values/th-TH.js +8 -1
  74. package/build/esm/i18n-values/tl-PH.js +7 -0
  75. package/build/esm/i18n-values/vi-VN.js +9 -2
  76. package/build/esm/i18n-values/vi-VN_MB.js +9 -2
  77. package/build/esm/i18n-values/zh-TW.js +8 -1
  78. package/build/esm/i18n.js +2 -2
  79. package/build/esm/i18nV2.js +2 -2
  80. package/build/esm/{index-a2fcd284.js → index-0380f2e6.js} +1 -1
  81. package/build/esm/{index-0514ce32.js → index-059cfa74.js} +7 -7
  82. package/build/esm/{index-0a085a1f.js → index-0a0bc1bf.js} +2 -2
  83. package/build/esm/{index-ef0887d7.js → index-0a3b65a9.js} +21 -21
  84. package/build/esm/{index-fa2305b2.js → index-11d4a6bb.js} +30 -30
  85. package/build/esm/{index-5b54b46d.js → index-14d0ccea.js} +3 -3
  86. package/build/esm/{index-5fd39bd1.js → index-1cbf08f6.js} +4 -4
  87. package/build/esm/{index-a7591e2a.js → index-1e7d5f26.js} +3 -3
  88. package/build/esm/{index-b72932e4.js → index-243bdfe8.js} +2 -2
  89. package/build/esm/{index-471bff40.js → index-2ecd3639.js} +3 -3
  90. package/build/esm/{index-4b981d7b.js → index-31dc15a7.js} +6 -6
  91. package/build/esm/{index-e1f94097.js → index-324d0f62.js} +17 -17
  92. package/build/esm/{index-e5dfe29b.js → index-35854868.js} +2 -2
  93. package/build/esm/{index-a09d15df.js → index-368d77b2.js} +11 -11
  94. package/build/esm/{index-a032ee3e.js → index-3a1ef34f.js} +7 -7
  95. package/build/esm/{index-d53edbc9.js → index-3f305782.js} +2 -2
  96. package/build/esm/{index-a4d7c5c2.js → index-40bc7df6.js} +13 -13
  97. package/build/esm/{index-cea59887.js → index-49849712.js} +13 -13
  98. package/build/esm/{index-6e4681ff.js → index-4a5bd664.js} +16 -16
  99. package/build/esm/{index-9faaab94.js → index-4b2d8815.js} +2 -2
  100. package/build/esm/{index-755497e5.js → index-5083fc00.js} +18 -24
  101. package/build/esm/{index-5b6b3f05.js → index-524c611d.js} +10 -10
  102. package/build/esm/{index-64947051.js → index-53450fbd.js} +16 -16
  103. package/build/esm/{index-7f8de431.js → index-5856deda.js} +2 -2
  104. package/build/esm/{index-5ad4119c.js → index-5f360bed.js} +16 -16
  105. package/build/esm/{index-48fbb74f.js → index-60df582b.js} +3 -3
  106. package/build/esm/{index-4b8cc126.js → index-62006413.js} +2 -2
  107. package/build/esm/{index-c5d6c055.js → index-63b7a592.js} +1 -1
  108. package/build/esm/{index-beab22ed.js → index-6cd5719c.js} +15 -15
  109. package/build/esm/{index-c2535d68.js → index-815b3fd3.js} +10 -10
  110. package/build/esm/{index-df766caf.js → index-8256947e.js} +3 -3
  111. package/build/esm/{index-33d49a31.js → index-8f8607ef.js} +6 -6
  112. package/build/esm/{index-c625f19a.js → index-8fdeab44.js} +15 -15
  113. package/build/esm/{index-c337faa6.js → index-956c505c.js} +32 -32
  114. package/build/esm/{index-e3d08f60.js → index-97c7c39b.js} +1 -1
  115. package/build/esm/{index-ca8d9128.js → index-9df98b57.js} +1 -1
  116. package/build/esm/{index-2007b9e0.js → index-a21b01f2.js} +5 -5
  117. package/build/esm/{index-b8d0d481.js → index-a4ccfa71.js} +2 -2
  118. package/build/esm/{index-ba3d1bcc.js → index-a8b61592.js} +3 -3
  119. package/build/esm/{index-0698f9a5.js → index-a92455de.js} +1 -1
  120. package/build/esm/{index-26fc8146.js → index-ace49d58.js} +16 -16
  121. package/build/esm/{index-09b7ca10.js → index-b06c1827.js} +3 -3
  122. package/build/esm/index-b0e58910.js +3961 -0
  123. package/build/esm/{index-7520e10e.js → index-b4b8ce4d.js} +13 -13
  124. package/build/esm/{index-58052a3a.js → index-bff99474.js} +1 -1
  125. package/build/esm/{index-aff433a3.js → index-c24614c8.js} +2 -2
  126. package/build/esm/{index-c43fd33b.js → index-c7baf68d.js} +18 -18
  127. package/build/esm/{index-47eb0b6f.js → index-c8406d9a.js} +1 -1
  128. package/build/esm/{index-6b03522a.js → index-d6e7471c.js} +24 -24
  129. package/build/esm/{index-6446d243.js → index-da9bc065.js} +6 -6
  130. package/build/esm/{index-a03c2d78.js → index-dcf0a7e3.js} +2 -2
  131. package/build/esm/{index-337323d3.js → index-dd7efe6a.js} +5 -5
  132. package/build/esm/{index-8c02ca88.js → index-df69e34d.js} +17 -17
  133. package/build/esm/{index-f09ff303.js → index-e30d30b5.js} +13 -13
  134. package/build/esm/{index-f455d515.js → index-e99637c5.js} +24 -24
  135. package/build/esm/{index-fdf4e371.js → index-ee38b2a0.js} +17 -17
  136. package/build/esm/{index-35a0cefb.js → index-f5027e94.js} +1 -1
  137. package/build/esm/{index-c297547c.js → index-f5454220.js} +20 -20
  138. package/build/esm/{index-de93555e.js → index-f6ef13f1.js} +1 -1
  139. package/build/esm/{index-533d87ce.js → index-f75fcf1b.js} +2 -2
  140. package/build/esm/{index-7d65d07c.js → index-fe697af0.js} +2 -2
  141. package/build/esm/index.js +112 -112
  142. package/build/esm/{labelSorting-f9aa4d77.js → labelSorting-a85fc423.js} +4 -4
  143. package/build/esm/lead.js +24 -24
  144. package/build/esm/{logoIcon-a1022cf6.js → logoIcon-4a5fffa7.js} +2 -2
  145. package/build/esm/mantine.js +25 -25
  146. package/build/esm/misc.js +16 -16
  147. package/build/esm/miscGetDynamicHealthTool.js +4 -4
  148. package/build/esm/miscGetSocialList.js +8 -8
  149. package/build/esm/miscScreenSizeContext.js +1 -1
  150. package/build/esm/mobileBottomNavigation.js +5 -5
  151. package/build/esm/mobileBottomNavigationIcon.js +5 -5
  152. package/build/esm/molecules.js +69 -69
  153. package/build/esm/moleculesArticleCard.js +6 -6
  154. package/build/esm/moleculesArticleCardV2.js +16 -16
  155. package/build/esm/navigation.js +40 -40
  156. package/build/esm/navigationLogoutPopup.js +9 -9
  157. package/build/esm/navigationProfileButton.js +23 -23
  158. package/build/esm/onboardingV2.js +29 -29
  159. package/build/esm/organisms.js +44 -44
  160. package/build/esm/{post-ff84e1cc.js → post-75785bfa.js} +3 -3
  161. package/build/esm/profileNavigation.js +19 -19
  162. package/build/esm/progressBar.js +1 -1
  163. package/build/esm/pwg.js +22 -22
  164. package/build/esm/ssoV2.js +27 -27
  165. package/build/esm/{store-54a49969.js → store-6ad704d4.js} +4 -4
  166. package/build/esm/subot.js +33 -33
  167. package/build/esm/surveyOrPremiumBanner.js +31 -31
  168. package/build/esm/surveyQuestionCard.js +10 -10
  169. package/build/esm/{surveyThankyouCard-ed11070a.js → surveyThankyouCard-0f826dbc.js} +5 -5
  170. package/build/esm/together/api/paths.d.ts +2 -0
  171. package/build/esm/together/api/utils.d.ts +3 -0
  172. package/build/esm/together/components/molecules/createNewPostContentV2/createPostCommunity/cardPostCommunity/index.d.ts +7 -0
  173. package/build/esm/together/components/molecules/createNewPostContentV2/createPostCommunity/cardPostCommunity/index.styled.d.ts +5 -0
  174. package/build/esm/together/components/molecules/createNewPostContentV2/createPostCommunity/commonCommunity/index.d.ts +15 -0
  175. package/build/esm/together/components/molecules/createNewPostContentV2/createPostCommunity/commonCommunity/index.styled.d.ts +13 -0
  176. package/build/esm/together/components/molecules/createNewPostContentV2/createPostCommunity/index.d.ts +31 -0
  177. package/build/esm/together/components/molecules/createNewPostContentV2/createPostCommunity/index.styled.d.ts +9 -0
  178. package/build/esm/together/components/molecules/createNewPostContentV2/createPostCommunity/index.styles.d.ts +12 -0
  179. package/build/esm/together/components/molecules/createNewPostContentV2/createPostCommunity/suggestedCommunity/index.d.ts +11 -0
  180. package/build/esm/together/components/molecules/createNewPostContentV2/createPostCommunity/suggestedCommunity/index.styled.d.ts +17 -0
  181. package/build/esm/together/components/molecules/createNewPostContentV2/createPostDescription/editor.d.ts +20 -0
  182. package/build/esm/together/components/molecules/createNewPostContentV2/createPostDescription/index.d.ts +20 -0
  183. package/build/esm/together/components/molecules/createNewPostContentV2/createPostDescription/index.styled.d.ts +9 -0
  184. package/build/esm/together/components/molecules/createNewPostContentV2/createPostPhotos/index.d.ts +7 -0
  185. package/build/esm/together/components/molecules/createNewPostContentV2/createPostTitle/index.d.ts +10 -0
  186. package/build/esm/together/components/molecules/createNewPostContentV2/createPostTitle/index.styled.d.ts +12 -0
  187. package/build/esm/together/components/molecules/createNewPostContentV2/index.d.ts +27 -0
  188. package/build/esm/together/components/molecules/createNewPostContentV2/index.styled.d.ts +33 -0
  189. package/build/esm/together/components/molecules/createNewPostContentV2/postPhotosReview/index.d.ts +10 -0
  190. package/build/esm/together/components/molecules/createNewPostContentV2/postPhotosReview/index.styled.d.ts +5 -0
  191. package/build/esm/together/components/molecules/createNewPostContentV2/postPhotosReview/index.styles.d.ts +12 -0
  192. package/build/esm/together/components/molecules/createNewPostContentV2/topicSelectList/index.d.ts +16 -0
  193. package/build/esm/together/components/molecules/createNewPostContentV2/topicSelectList/index.styled.d.ts +5 -0
  194. package/build/esm/together/components/molecules/createNewPostContentV2/type.d.ts +4 -0
  195. package/build/esm/together/components/molecules/createNewPostContentV2/types.d.ts +14 -0
  196. package/build/esm/together/components/molecules/index.d.ts +1 -0
  197. package/build/esm/together/togetherComponentGlobalContext.d.ts +1 -0
  198. package/build/esm/together.js +53 -53
  199. package/build/esm/togetherApiPaths.js +4 -2
  200. package/build/esm/togetherApiUtils.js +4 -4
  201. package/build/esm/togetherAtoms.js +30 -30
  202. package/build/esm/togetherComponentGlobalContext.js +4 -4
  203. package/build/esm/togetherMolecules.js +48 -48
  204. package/build/esm/togetherMoleculesCardAuthor.js +27 -27
  205. package/build/esm/togetherMoleculesPostImagePreview.js +11 -11
  206. package/build/esm/togetherMoleculesProfileDetail.js +37 -37
  207. package/build/esm/togetherOrganisms.js +47 -47
  208. package/build/esm/togetherRichTextEditor.js +17 -17
  209. package/build/esm/togetherShareBox.js +11 -26
  210. package/build/esm/{treePopoverMenu-92c30887.js → treePopoverMenu-7287c1cc.js} +19 -19
  211. package/build/esm/{types-f1926833.js → types-3bbd115d.js} +2 -2
  212. package/build/esm/types.js +2 -2
  213. package/build/esm/{useCategory-066eea42.js → useCategory-6bde85b5.js} +5 -5
  214. package/build/esm/{useHealthToolCache-52af05fd.js → useHealthToolCache-f38448be.js} +1 -1
  215. package/build/esm/{useMantineLocale-70c5b5ba.js → useMantineLocale-23c2090e.js} +6 -6
  216. package/build/esm/{usePlacesAutocomplete-751ce32e.js → usePlacesAutocomplete-bb2fcccb.js} +1 -1
  217. package/build/esm/{useScreenSize-00a6d109.js → useScreenSize-0c7f9376.js} +2 -2
  218. package/build/esm/useTogetherAuthRequiredAction.js +9 -9
  219. package/build/esm/{utils-4bf5671b.js → utils-c3f2f203.js} +2 -2
  220. package/build/esm/{utils-5fcba9d5.js → utils-c671b808.js} +13 -4
  221. package/build/esm/{utils-f3da0e39.js → utils-f7f1390a.js} +2 -2
  222. package/build/esm/vaccination.js +21 -21
  223. package/build/footer.js +21 -21
  224. package/build/gAssets.js +2 -2
  225. package/build/healthToolsCardWrapper.js +18 -18
  226. package/build/healthToolsForm.js +33 -33
  227. package/build/hooks.js +13 -13
  228. package/build/i18n/translationKeys.d.ts +1 -1
  229. package/build/i18n-values/en-PH.js +8 -1
  230. package/build/i18n-values/hi-IN.js +8 -1
  231. package/build/i18n-values/id-ID.js +8 -1
  232. package/build/i18n-values/km-KH.js +8 -1
  233. package/build/i18n-values/ms-MY.js +8 -1
  234. package/build/i18n-values/my-MM.js +8 -1
  235. package/build/i18n-values/th-TH.js +8 -1
  236. package/build/i18n-values/tl-PH.js +7 -0
  237. package/build/i18n-values/vi-VN.js +9 -2
  238. package/build/i18n-values/vi-VN_MB.js +9 -2
  239. package/build/i18n-values/zh-TW.js +8 -1
  240. package/build/i18n.js +1 -1
  241. package/build/i18nV2.js +1 -1
  242. package/build/{index-7e998c37.js → index-05e389b0.js} +2 -2
  243. package/build/{index-a8fb9264.js → index-07683098.js} +6 -6
  244. package/build/{index-2c94b7f6.js → index-0fd0fe8f.js} +1 -1
  245. package/build/{index-0f02fdc3.js → index-14104315.js} +1 -1
  246. package/build/{index-098161ee.js → index-145d886b.js} +15 -15
  247. package/build/{index-6ebc2c9e.js → index-187a773b.js} +16 -16
  248. package/build/{index-b62a0a2f.js → index-1a3f129b.js} +2 -2
  249. package/build/{index-863c8f47.js → index-1e94c0a6.js} +24 -24
  250. package/build/{index-86876356.js → index-1f90039e.js} +2 -2
  251. package/build/{index-bab9ec2c.js → index-22d1e0e0.js} +4 -4
  252. package/build/{index-64d63b56.js → index-23243ca0.js} +30 -30
  253. package/build/{index-320f6abb.js → index-27b516f9.js} +2 -2
  254. package/build/{index-31fc6a7c.js → index-2922a83f.js} +2 -2
  255. package/build/{index-77d58636.js → index-2e7c6751.js} +18 -24
  256. package/build/{index-dbdcba37.js → index-343893ef.js} +24 -24
  257. package/build/{index-d0ea50e0.js → index-3529d7bb.js} +2 -2
  258. package/build/{index-b1129d60.js → index-3889a161.js} +5 -5
  259. package/build/{index-6d192a83.js → index-4f20dcd4.js} +5 -5
  260. package/build/{index-d7c01bde.js → index-51c72e5b.js} +32 -32
  261. package/build/{index-d0980314.js → index-526a6c5d.js} +17 -17
  262. package/build/{index-27510ba4.js → index-5ab2ddd7.js} +20 -20
  263. package/build/{index-3c3ee0d4.js → index-5fd97e2c.js} +21 -21
  264. package/build/{index-813c9ebd.js → index-6adf0279.js} +3 -3
  265. package/build/{index-ee723b93.js → index-6b85ce04.js} +1 -1
  266. package/build/{index-b68e243a.js → index-78eada3b.js} +16 -16
  267. package/build/{index-92801d44.js → index-7cb0ee24.js} +17 -17
  268. package/build/{index-6b1795a0.js → index-7da7afbe.js} +7 -7
  269. package/build/{index-fe9a9230.js → index-7f3d20b2.js} +3 -3
  270. package/build/{index-6ef78162.js → index-7fcf0436.js} +17 -17
  271. package/build/{index-75e5da2e.js → index-8025fa76.js} +1 -1
  272. package/build/{index-27ffb195.js → index-84d4d7c2.js} +2 -2
  273. package/build/{index-49277493.js → index-90cf004c.js} +1 -1
  274. package/build/{index-95fc2d5c.js → index-9116e66e.js} +3 -3
  275. package/build/{index-cc9390bc.js → index-917db768.js} +1 -1
  276. package/build/{index-785251f4.js → index-91b39121.js} +13 -13
  277. package/build/{index-665af378.js → index-937ed1b1.js} +18 -18
  278. package/build/{index-94d69766.js → index-96c3ff69.js} +6 -6
  279. package/build/{index-969ce075.js → index-970c4a9c.js} +13 -13
  280. package/build/{index-787af641.js → index-99d3e1a7.js} +3 -3
  281. package/build/index-9a27c5aa.js +3995 -0
  282. package/build/{index-762a13db.js → index-b2d37e1d.js} +13 -13
  283. package/build/{index-98a7537c.js → index-b81a4ebb.js} +13 -13
  284. package/build/{index-f7572c4a.js → index-c2716b70.js} +10 -10
  285. package/build/{index-d2a05382.js → index-c5174326.js} +2 -2
  286. package/build/{index-29be015d.js → index-c6ec06a1.js} +15 -15
  287. package/build/{index-9894733c.js → index-cc1f73b6.js} +3 -3
  288. package/build/{index-f6ac3713.js → index-ce6f9d02.js} +6 -6
  289. package/build/{index-61f76f2f.js → index-cf734351.js} +3 -3
  290. package/build/{index-4298a2e7.js → index-d032bf89.js} +10 -9
  291. package/build/{index-a48885c0.js → index-d8475e87.js} +2 -2
  292. package/build/{index-cc111a78.js → index-dfd4f4c9.js} +7 -7
  293. package/build/{index-684cd462.js → index-e1abdd1a.js} +3 -3
  294. package/build/{index-a03ed51a.js → index-e45dfb52.js} +2 -2
  295. package/build/{index-5dc8d608.js → index-e5a0f130.js} +11 -11
  296. package/build/{index-92022e27.js → index-e7617b7e.js} +1 -1
  297. package/build/{index-e398e367.js → index-e9f53b2d.js} +1 -1
  298. package/build/{index-69bfcd40.js → index-f06d7f6b.js} +1 -1
  299. package/build/{index-d95af9a6.js → index-f2e9c5ad.js} +16 -16
  300. package/build/{index-4a5afa2c.js → index-f302223f.js} +16 -16
  301. package/build/{index-ca4a0e8c.js → index-f766a23c.js} +2 -2
  302. package/build/{index-51d85310.js → index-fae4f302.js} +2 -2
  303. package/build/index.js +113 -112
  304. package/build/{labelSorting-ff74d73d.js → labelSorting-4d977e9a.js} +4 -4
  305. package/build/lead.js +24 -24
  306. package/build/{logoIcon-8e87ee06.js → logoIcon-c1012040.js} +2 -2
  307. package/build/mantine.js +22 -22
  308. package/build/misc.js +16 -16
  309. package/build/miscGetDynamicHealthTool.js +4 -4
  310. package/build/miscGetSocialList.js +8 -8
  311. package/build/miscScreenSizeContext.js +1 -1
  312. package/build/mobileBottomNavigation.js +5 -5
  313. package/build/mobileBottomNavigationIcon.js +5 -5
  314. package/build/molecules.js +69 -69
  315. package/build/moleculesArticleCard.js +6 -6
  316. package/build/moleculesArticleCardV2.js +16 -16
  317. package/build/navigation.js +40 -40
  318. package/build/navigationLogoutPopup.js +9 -9
  319. package/build/navigationProfileButton.js +23 -23
  320. package/build/onboardingV2.js +28 -28
  321. package/build/organisms.js +44 -44
  322. package/build/{post-04a7462b.js → post-be7956f8.js} +2 -2
  323. package/build/profileNavigation.js +19 -19
  324. package/build/progressBar.js +1 -1
  325. package/build/pwg.js +22 -22
  326. package/build/ssoV2.js +26 -26
  327. package/build/{store-2ae372f9.js → store-1a0d3c04.js} +4 -4
  328. package/build/subot.js +32 -32
  329. package/build/surveyOrPremiumBanner.js +31 -31
  330. package/build/surveyQuestionCard.js +10 -10
  331. package/build/{surveyThankyouCard-c7cefc26.js → surveyThankyouCard-1a1f28a0.js} +5 -5
  332. package/build/together/api/paths.d.ts +2 -0
  333. package/build/together/api/utils.d.ts +3 -0
  334. package/build/together/components/molecules/createNewPostContentV2/createPostCommunity/cardPostCommunity/index.d.ts +7 -0
  335. package/build/together/components/molecules/createNewPostContentV2/createPostCommunity/cardPostCommunity/index.styled.d.ts +5 -0
  336. package/build/together/components/molecules/createNewPostContentV2/createPostCommunity/commonCommunity/index.d.ts +15 -0
  337. package/build/together/components/molecules/createNewPostContentV2/createPostCommunity/commonCommunity/index.styled.d.ts +13 -0
  338. package/build/together/components/molecules/createNewPostContentV2/createPostCommunity/index.d.ts +31 -0
  339. package/build/together/components/molecules/createNewPostContentV2/createPostCommunity/index.styled.d.ts +9 -0
  340. package/build/together/components/molecules/createNewPostContentV2/createPostCommunity/index.styles.d.ts +12 -0
  341. package/build/together/components/molecules/createNewPostContentV2/createPostCommunity/suggestedCommunity/index.d.ts +11 -0
  342. package/build/together/components/molecules/createNewPostContentV2/createPostCommunity/suggestedCommunity/index.styled.d.ts +17 -0
  343. package/build/together/components/molecules/createNewPostContentV2/createPostDescription/editor.d.ts +20 -0
  344. package/build/together/components/molecules/createNewPostContentV2/createPostDescription/index.d.ts +20 -0
  345. package/build/together/components/molecules/createNewPostContentV2/createPostDescription/index.styled.d.ts +9 -0
  346. package/build/together/components/molecules/createNewPostContentV2/createPostPhotos/index.d.ts +7 -0
  347. package/build/together/components/molecules/createNewPostContentV2/createPostTitle/index.d.ts +10 -0
  348. package/build/together/components/molecules/createNewPostContentV2/createPostTitle/index.styled.d.ts +12 -0
  349. package/build/together/components/molecules/createNewPostContentV2/index.d.ts +27 -0
  350. package/build/together/components/molecules/createNewPostContentV2/index.styled.d.ts +33 -0
  351. package/build/together/components/molecules/createNewPostContentV2/postPhotosReview/index.d.ts +10 -0
  352. package/build/together/components/molecules/createNewPostContentV2/postPhotosReview/index.styled.d.ts +5 -0
  353. package/build/together/components/molecules/createNewPostContentV2/postPhotosReview/index.styles.d.ts +12 -0
  354. package/build/together/components/molecules/createNewPostContentV2/topicSelectList/index.d.ts +16 -0
  355. package/build/together/components/molecules/createNewPostContentV2/topicSelectList/index.styled.d.ts +5 -0
  356. package/build/together/components/molecules/createNewPostContentV2/type.d.ts +4 -0
  357. package/build/together/components/molecules/createNewPostContentV2/types.d.ts +14 -0
  358. package/build/together/components/molecules/index.d.ts +1 -0
  359. package/build/together/togetherComponentGlobalContext.d.ts +1 -0
  360. package/build/together.js +54 -53
  361. package/build/togetherApiPaths.js +4 -2
  362. package/build/togetherApiUtils.js +5 -4
  363. package/build/togetherAtoms.js +30 -30
  364. package/build/togetherComponentGlobalContext.js +4 -4
  365. package/build/togetherMolecules.js +49 -48
  366. package/build/togetherMoleculesCardAuthor.js +27 -27
  367. package/build/togetherMoleculesPostImagePreview.js +11 -11
  368. package/build/togetherMoleculesProfileDetail.js +37 -37
  369. package/build/togetherOrganisms.js +47 -47
  370. package/build/togetherRichTextEditor.js +17 -17
  371. package/build/togetherShareBox.js +11 -26
  372. package/build/{treePopoverMenu-efb92a13.js → treePopoverMenu-6f076a9b.js} +19 -19
  373. package/build/{types-1cb25886.js → types-ad03664a.js} +2 -2
  374. package/build/types.js +2 -2
  375. package/build/{useCategory-e108e34d.js → useCategory-26ab9950.js} +5 -5
  376. package/build/{useHealthToolCache-0e9c7143.js → useHealthToolCache-d45757c6.js} +1 -1
  377. package/build/{useMantineLocale-6a6a3532.js → useMantineLocale-001e819a.js} +6 -6
  378. package/build/{usePlacesAutocomplete-04e34548.js → usePlacesAutocomplete-e26d99ad.js} +1 -1
  379. package/build/{useScreenSize-d69e7ea0.js → useScreenSize-170f507a.js} +2 -2
  380. package/build/useTogetherAuthRequiredAction.js +9 -9
  381. package/build/{utils-e4d7a80c.js → utils-865ff999.js} +13 -3
  382. package/build/{utils-98aee497.js → utils-dbe6a27e.js} +2 -2
  383. package/build/{utils-ebd370a3.js → utils-f42ab58d.js} +2 -2
  384. package/build/vaccination.js +21 -21
  385. package/package.json +1 -1
  386. package/build/esm/index-e82bd10b.js +0 -1533
  387. package/build/index-b8148397.js +0 -1547
  388. /package/build/{BMI_BOYS.percentile.monthly-42e42bbc.js → BMI_BOYS.percentile.monthly-e7fd800e.js} +0 -0
  389. /package/build/{BMI_BOYS.percentile.weekly-d3e79702.js → BMI_BOYS.percentile.weekly-6f1f1151.js} +0 -0
  390. /package/build/{BMI_BOYS.percentile.yearly-bcd8ac41.js → BMI_BOYS.percentile.yearly-72800c2e.js} +0 -0
  391. /package/build/{BMI_BOYS.zscore.monthly-3b72bc2b.js → BMI_BOYS.zscore.monthly-744336bd.js} +0 -0
  392. /package/build/{BMI_BOYS.zscore.weekly-6fb6d0fb.js → BMI_BOYS.zscore.weekly-27794c94.js} +0 -0
  393. /package/build/{BMI_BOYS.zscore.yearly-50da133b.js → BMI_BOYS.zscore.yearly-1b5eba3b.js} +0 -0
  394. /package/build/{BMI_GIRLS.percentile.monthly-4a813449.js → BMI_GIRLS.percentile.monthly-46697e50.js} +0 -0
  395. /package/build/{BMI_GIRLS.percentile.weekly-e170b644.js → BMI_GIRLS.percentile.weekly-6d4ff0a5.js} +0 -0
  396. /package/build/{BMI_GIRLS.percentile.yearly-9a1b6e01.js → BMI_GIRLS.percentile.yearly-f23406fa.js} +0 -0
  397. /package/build/{BMI_GIRLS.zscore.monthly-b9d387c8.js → BMI_GIRLS.zscore.monthly-8d1dbd47.js} +0 -0
  398. /package/build/{BMI_GIRLS.zscore.weekly-7908ccba.js → BMI_GIRLS.zscore.weekly-97ab3fdf.js} +0 -0
  399. /package/build/{BMI_GIRLS.zscore.yearly-afb0bcc6.js → BMI_GIRLS.zscore.yearly-809fdf2d.js} +0 -0
  400. /package/build/{ChevronDown-6986feb4.js → ChevronDown-2285ec37.js} +0 -0
  401. /package/build/{Close-25f9cea0.js → Close-ea576e53.js} +0 -0
  402. /package/build/{Google-cbbb72c8.js → Google-941649ed.js} +0 -0
  403. /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-5b34e5b7.js → HEAD CIRCUM_BOYS.percentile.monthly-6cd2ec0e.js} +0 -0
  404. /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-69ff80bc.js → HEAD CIRCUM_BOYS.percentile.weekly-6f2c4369.js} +0 -0
  405. /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-398a9a44.js → HEAD CIRCUM_BOYS.percentile.yearly-54786a6d.js} +0 -0
  406. /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-bf13c101.js → HEAD CIRCUM_BOYS.zscore.monthly-a2c49426.js} +0 -0
  407. /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-6f2c3902.js → HEAD CIRCUM_BOYS.zscore.weekly-1d1da03e.js} +0 -0
  408. /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-8c13e061.js → HEAD CIRCUM_BOYS.zscore.yearly-4d96d239.js} +0 -0
  409. /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-7557ef19.js → HEAD CIRCUM_GIRLS.percentile.monthly-7b1d41be.js} +0 -0
  410. /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-7843d397.js → HEAD CIRCUM_GIRLS.percentile.weekly-63229cac.js} +0 -0
  411. /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-11b6dad4.js → HEAD CIRCUM_GIRLS.percentile.yearly-5c8d23f6.js} +0 -0
  412. /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-7e0cb741.js → HEAD CIRCUM_GIRLS.zscore.monthly-815cff93.js} +0 -0
  413. /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-e8b3045e.js → HEAD CIRCUM_GIRLS.zscore.weekly-f4a515d0.js} +0 -0
  414. /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-93952f5d.js → HEAD CIRCUM_GIRLS.zscore.yearly-ca0b1a47.js} +0 -0
  415. /package/build/{HEIGHT_BOYS.percentile.monthly-88ec3b51.js → HEIGHT_BOYS.percentile.monthly-579650c3.js} +0 -0
  416. /package/build/{HEIGHT_BOYS.percentile.weekly-d17a9192.js → HEIGHT_BOYS.percentile.weekly-3ad72595.js} +0 -0
  417. /package/build/{HEIGHT_BOYS.percentile.yearly-3decbf66.js → HEIGHT_BOYS.percentile.yearly-3e3ccff7.js} +0 -0
  418. /package/build/{HEIGHT_BOYS.zscore.monthly-d4fddeb3.js → HEIGHT_BOYS.zscore.monthly-c35c2404.js} +0 -0
  419. /package/build/{HEIGHT_BOYS.zscore.weekly-70fdda3f.js → HEIGHT_BOYS.zscore.weekly-3a67bb21.js} +0 -0
  420. /package/build/{HEIGHT_BOYS.zscore.yearly-dc7f7351.js → HEIGHT_BOYS.zscore.yearly-7e2a1e2a.js} +0 -0
  421. /package/build/{HEIGHT_GIRLS.percentile.monthly-dd1291a5.js → HEIGHT_GIRLS.percentile.monthly-7e35f96c.js} +0 -0
  422. /package/build/{HEIGHT_GIRLS.percentile.weekly-75e17d0b.js → HEIGHT_GIRLS.percentile.weekly-15693e10.js} +0 -0
  423. /package/build/{HEIGHT_GIRLS.percentile.yearly-3a8b203a.js → HEIGHT_GIRLS.percentile.yearly-a6887fbd.js} +0 -0
  424. /package/build/{HEIGHT_GIRLS.zscore.monthly-a8d4bc5e.js → HEIGHT_GIRLS.zscore.monthly-a1c07cf6.js} +0 -0
  425. /package/build/{HEIGHT_GIRLS.zscore.weekly-62cd5c15.js → HEIGHT_GIRLS.zscore.weekly-5ba95fb0.js} +0 -0
  426. /package/build/{HEIGHT_GIRLS.zscore.yearly-998697cd.js → HEIGHT_GIRLS.zscore.yearly-c95b09f3.js} +0 -0
  427. /package/build/{Locale-59c8f2ff.js → Locale-19ffd740.js} +0 -0
  428. /package/build/{Visible-eb45a729.js → Visible-ff061e0e.js} +0 -0
  429. /package/build/{WEIGHT_BOYS.percentile.monthly-32137e61.js → WEIGHT_BOYS.percentile.monthly-14aa0af2.js} +0 -0
  430. /package/build/{WEIGHT_BOYS.percentile.weekly-021cc88a.js → WEIGHT_BOYS.percentile.weekly-aba7d078.js} +0 -0
  431. /package/build/{WEIGHT_BOYS.percentile.yearly-6f89ba05.js → WEIGHT_BOYS.percentile.yearly-b2bda30a.js} +0 -0
  432. /package/build/{WEIGHT_BOYS.zscore.monthly-b3ae6081.js → WEIGHT_BOYS.zscore.monthly-24967cdf.js} +0 -0
  433. /package/build/{WEIGHT_BOYS.zscore.weekly-c10d1b7b.js → WEIGHT_BOYS.zscore.weekly-fdd362e4.js} +0 -0
  434. /package/build/{WEIGHT_BOYS.zscore.yearly-14d96bd7.js → WEIGHT_BOYS.zscore.yearly-4c633ea8.js} +0 -0
  435. /package/build/{WEIGHT_GIRLS.percentile.monthly-d2293f07.js → WEIGHT_GIRLS.percentile.monthly-6326f461.js} +0 -0
  436. /package/build/{WEIGHT_GIRLS.percentile.weekly-ad845f1d.js → WEIGHT_GIRLS.percentile.weekly-c2311f94.js} +0 -0
  437. /package/build/{WEIGHT_GIRLS.percentile.yearly-86bf3f82.js → WEIGHT_GIRLS.percentile.yearly-7b1e0140.js} +0 -0
  438. /package/build/{WEIGHT_GIRLS.zscore.monthly-ffff40d7.js → WEIGHT_GIRLS.zscore.monthly-52960373.js} +0 -0
  439. /package/build/{WEIGHT_GIRLS.zscore.weekly-51a13361.js → WEIGHT_GIRLS.zscore.weekly-a5051ccb.js} +0 -0
  440. /package/build/{WEIGHT_GIRLS.zscore.yearly-e63510b9.js → WEIGHT_GIRLS.zscore.yearly-b1cd45d2.js} +0 -0
  441. /package/build/{animation-b76ef735.js → animation-61ab139b.js} +0 -0
  442. /package/build/{constants-6481b2f7.js → constants-0a05e562.js} +0 -0
  443. /package/build/{constants-a4f7741b.js → constants-55ce73df.js} +0 -0
  444. /package/build/{constants-4cc3f647.js → constants-ef5b314b.js} +0 -0
  445. /package/build/{dataTransform-8708d064.js → dataTransform-22198304.js} +0 -0
  446. /package/build/{doctor-69450f32.js → doctor-7823cea2.js} +0 -0
  447. /package/build/esm/{BMI_BOYS.percentile.monthly-d0e3a78e.js → BMI_BOYS.percentile.monthly-688a9341.js} +0 -0
  448. /package/build/esm/{BMI_BOYS.percentile.weekly-5fc2fbfe.js → BMI_BOYS.percentile.weekly-1179e875.js} +0 -0
  449. /package/build/esm/{BMI_BOYS.percentile.yearly-2217d2d9.js → BMI_BOYS.percentile.yearly-33c069c8.js} +0 -0
  450. /package/build/esm/{BMI_BOYS.zscore.monthly-32caef32.js → BMI_BOYS.zscore.monthly-ef0f3e6c.js} +0 -0
  451. /package/build/esm/{BMI_BOYS.zscore.weekly-a8982a1e.js → BMI_BOYS.zscore.weekly-e4a90df9.js} +0 -0
  452. /package/build/esm/{BMI_BOYS.zscore.yearly-489a541a.js → BMI_BOYS.zscore.yearly-522dd0d8.js} +0 -0
  453. /package/build/esm/{BMI_GIRLS.percentile.monthly-e44d76cf.js → BMI_GIRLS.percentile.monthly-38c3f895.js} +0 -0
  454. /package/build/esm/{BMI_GIRLS.percentile.weekly-ca6eeb38.js → BMI_GIRLS.percentile.weekly-9b5f59bc.js} +0 -0
  455. /package/build/esm/{BMI_GIRLS.percentile.yearly-a4c1aafb.js → BMI_GIRLS.percentile.yearly-b3e61478.js} +0 -0
  456. /package/build/esm/{BMI_GIRLS.zscore.monthly-7c200ede.js → BMI_GIRLS.zscore.monthly-93b37c1a.js} +0 -0
  457. /package/build/esm/{BMI_GIRLS.zscore.weekly-3f01dce4.js → BMI_GIRLS.zscore.weekly-2bdfbf3b.js} +0 -0
  458. /package/build/esm/{BMI_GIRLS.zscore.yearly-fe5ae0af.js → BMI_GIRLS.zscore.yearly-d1aab9be.js} +0 -0
  459. /package/build/esm/{ChevronDown-e97fab1f.js → ChevronDown-a9ef412b.js} +0 -0
  460. /package/build/esm/{Close-10089dcc.js → Close-4c722ae0.js} +0 -0
  461. /package/build/esm/{Google-e7935185.js → Google-55200333.js} +0 -0
  462. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-329ed94c.js → HEAD CIRCUM_BOYS.percentile.monthly-3f768fdb.js} +0 -0
  463. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-41003bad.js → HEAD CIRCUM_BOYS.percentile.weekly-ac79abd7.js} +0 -0
  464. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-e809db7c.js → HEAD CIRCUM_BOYS.percentile.yearly-36ab41b5.js} +0 -0
  465. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-a2e504e7.js → HEAD CIRCUM_BOYS.zscore.monthly-aa40d2d1.js} +0 -0
  466. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-443e7162.js → HEAD CIRCUM_BOYS.zscore.weekly-98cdc3c7.js} +0 -0
  467. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-1e61a1db.js → HEAD CIRCUM_BOYS.zscore.yearly-f2f8a8ab.js} +0 -0
  468. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-3dc736f0.js → HEAD CIRCUM_GIRLS.percentile.monthly-745af27a.js} +0 -0
  469. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-9b52cc1a.js → HEAD CIRCUM_GIRLS.percentile.weekly-44c1b50e.js} +0 -0
  470. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-39163dfd.js → HEAD CIRCUM_GIRLS.percentile.yearly-e4acf7ce.js} +0 -0
  471. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-c3eae855.js → HEAD CIRCUM_GIRLS.zscore.monthly-02086c3d.js} +0 -0
  472. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-4026073a.js → HEAD CIRCUM_GIRLS.zscore.weekly-7eb66d6d.js} +0 -0
  473. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-29aa729b.js → HEAD CIRCUM_GIRLS.zscore.yearly-6f697a79.js} +0 -0
  474. /package/build/esm/{HEIGHT_BOYS.percentile.monthly-60c5b2dd.js → HEIGHT_BOYS.percentile.monthly-adf9fbfc.js} +0 -0
  475. /package/build/esm/{HEIGHT_BOYS.percentile.weekly-72e40347.js → HEIGHT_BOYS.percentile.weekly-dc6f3335.js} +0 -0
  476. /package/build/esm/{HEIGHT_BOYS.percentile.yearly-5ff0aae1.js → HEIGHT_BOYS.percentile.yearly-7ccfca32.js} +0 -0
  477. /package/build/esm/{HEIGHT_BOYS.zscore.monthly-39dbf623.js → HEIGHT_BOYS.zscore.monthly-46474ded.js} +0 -0
  478. /package/build/esm/{HEIGHT_BOYS.zscore.weekly-762e5eec.js → HEIGHT_BOYS.zscore.weekly-4f75ac69.js} +0 -0
  479. /package/build/esm/{HEIGHT_BOYS.zscore.yearly-3f5b3674.js → HEIGHT_BOYS.zscore.yearly-01db754a.js} +0 -0
  480. /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-15ad5ee3.js → HEIGHT_GIRLS.percentile.monthly-e7d64bc2.js} +0 -0
  481. /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-eb87267f.js → HEIGHT_GIRLS.percentile.weekly-e7b25882.js} +0 -0
  482. /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-453f16ba.js → HEIGHT_GIRLS.percentile.yearly-51db9825.js} +0 -0
  483. /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-474c254c.js → HEIGHT_GIRLS.zscore.monthly-dd87f94d.js} +0 -0
  484. /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-efd8a6bb.js → HEIGHT_GIRLS.zscore.weekly-5fe30dbc.js} +0 -0
  485. /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-39108ce9.js → HEIGHT_GIRLS.zscore.yearly-043d28d4.js} +0 -0
  486. /package/build/esm/{Locale-4c6794d2.js → Locale-8d86a8a9.js} +0 -0
  487. /package/build/esm/{Visible-7d890c09.js → Visible-1f3e97e0.js} +0 -0
  488. /package/build/esm/{WEIGHT_BOYS.percentile.monthly-5aaf843a.js → WEIGHT_BOYS.percentile.monthly-02d95828.js} +0 -0
  489. /package/build/esm/{WEIGHT_BOYS.percentile.weekly-f3843b0f.js → WEIGHT_BOYS.percentile.weekly-59d54878.js} +0 -0
  490. /package/build/esm/{WEIGHT_BOYS.percentile.yearly-f40f7ce9.js → WEIGHT_BOYS.percentile.yearly-d14fb4bd.js} +0 -0
  491. /package/build/esm/{WEIGHT_BOYS.zscore.monthly-a4aa71d7.js → WEIGHT_BOYS.zscore.monthly-cba42995.js} +0 -0
  492. /package/build/esm/{WEIGHT_BOYS.zscore.weekly-75f2e0e5.js → WEIGHT_BOYS.zscore.weekly-5e75187e.js} +0 -0
  493. /package/build/esm/{WEIGHT_BOYS.zscore.yearly-6db893a5.js → WEIGHT_BOYS.zscore.yearly-13ba1ac3.js} +0 -0
  494. /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-e12c4fd2.js → WEIGHT_GIRLS.percentile.monthly-d631c4e9.js} +0 -0
  495. /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-6c2bd745.js → WEIGHT_GIRLS.percentile.weekly-2a8d843e.js} +0 -0
  496. /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-4ed8d1ae.js → WEIGHT_GIRLS.percentile.yearly-3d0d4d59.js} +0 -0
  497. /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-e7c60e50.js → WEIGHT_GIRLS.zscore.monthly-0ff9e192.js} +0 -0
  498. /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-3b8385b1.js → WEIGHT_GIRLS.zscore.weekly-c9ebbe93.js} +0 -0
  499. /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-257a37c9.js → WEIGHT_GIRLS.zscore.yearly-6de5f96e.js} +0 -0
  500. /package/build/esm/{animation-26d50fdf.js → animation-c916174b.js} +0 -0
  501. /package/build/esm/{constants-66738d0d.js → constants-197344e7.js} +0 -0
  502. /package/build/esm/{constants-afb0a5ae.js → constants-1b662ce0.js} +0 -0
  503. /package/build/esm/{constants-d8655e44.js → constants-e28c872e.js} +0 -0
  504. /package/build/esm/{dataTransform-f99083eb.js → dataTransform-32118b27.js} +0 -0
  505. /package/build/esm/{doctor-283ec7f3.js → doctor-c136eca9.js} +0 -0
  506. /package/build/esm/{index-f790fb24.js → index-02d825e1.js} +0 -0
  507. /package/build/esm/{index-c832a75e.js → index-399c3751.js} +0 -0
  508. /package/build/esm/{index-22f4126e.js → index-514db505.js} +0 -0
  509. /package/build/esm/{index-8f955050.js → index-894e3dcf.js} +0 -0
  510. /package/build/esm/{index-ce5d9fdb.js → index-c4fb7956.js} +0 -0
  511. /package/build/esm/{index-8b1c8c83.js → index-c70fb732.js} +0 -0
  512. /package/build/esm/{index-e2ee710f.js → index-eb3b75e0.js} +0 -0
  513. /package/build/esm/{index-e3185bed.js → index-fd35bc29.js} +0 -0
  514. /package/build/esm/{index-c61375af.js → index-ffc96988.js} +0 -0
  515. /package/build/esm/{index.styles-ca8dfcc5.js → index.styles-2c3af767.js} +0 -0
  516. /package/build/esm/{localizeNumberFormat-4887c818.js → localizeNumberFormat-e2e3afc1.js} +0 -0
  517. /package/build/esm/{normalizeLink-61de4b8f.js → normalizeLink-51459370.js} +0 -0
  518. /package/build/esm/{other-c8a532f4.js → other-b6b2398a.js} +0 -0
  519. /package/build/esm/{paths-25327ec6.js → paths-3c3bf13c.js} +0 -0
  520. /package/build/esm/{translationsContext-a6adc797.js → translationsContext-a2d67e07.js} +0 -0
  521. /package/build/esm/{tslib.es6-6faca69f.js → tslib.es6-9c7616a9.js} +0 -0
  522. /package/build/esm/{types-83b9a291.js → types-27c9eb85.js} +0 -0
  523. /package/build/esm/{useIsInit-f838d39e.js → useIsInit-17abe414.js} +0 -0
  524. /package/build/esm/{useOutsideClick-7acf3603.js → useOutsideClick-737e87c1.js} +0 -0
  525. /package/build/esm/{useScrollbarSize-b01af278.js → useScrollbarSize-ecbc318c.js} +0 -0
  526. /package/build/esm/{useUniqueId-1abc912b.js → useUniqueId-fdf641ed.js} +0 -0
  527. /package/build/esm/{utils-0eccc86b.js → utils-11ddb7c1.js} +0 -0
  528. /package/build/{index-a3ce059f.js → index-14de2d04.js} +0 -0
  529. /package/build/{index-8fdc7501.js → index-36b3f0ab.js} +0 -0
  530. /package/build/{index-50f1bd96.js → index-426fad14.js} +0 -0
  531. /package/build/{index-c41b5997.js → index-82d03256.js} +0 -0
  532. /package/build/{index-c6667e97.js → index-91bec39a.js} +0 -0
  533. /package/build/{index-77fa3574.js → index-a409f966.js} +0 -0
  534. /package/build/{index-3232dbd1.js → index-bf10023b.js} +0 -0
  535. /package/build/{index-26aa8e9a.js → index-d47e87fd.js} +0 -0
  536. /package/build/{index-c4c494a4.js → index-f9bd9eee.js} +0 -0
  537. /package/build/{index.styles-84618a52.js → index.styles-b050ad8b.js} +0 -0
  538. /package/build/{localizeNumberFormat-d9455b23.js → localizeNumberFormat-93548044.js} +0 -0
  539. /package/build/{normalizeLink-f8d0fbdf.js → normalizeLink-f7a36162.js} +0 -0
  540. /package/build/{other-b6278fe8.js → other-78cc653a.js} +0 -0
  541. /package/build/{paths-97742418.js → paths-6e9c0f6b.js} +0 -0
  542. /package/build/{translationsContext-e8e3064f.js → translationsContext-a7f83fd8.js} +0 -0
  543. /package/build/{tslib.es6-19595f43.js → tslib.es6-9bd4bb1f.js} +0 -0
  544. /package/build/{types-60aaa39d.js → types-e6b1c0aa.js} +0 -0
  545. /package/build/{useIsInit-da3a3533.js → useIsInit-2bf1b8f0.js} +0 -0
  546. /package/build/{useOutsideClick-bf35cbb8.js → useOutsideClick-63072953.js} +0 -0
  547. /package/build/{useScrollbarSize-80661c87.js → useScrollbarSize-25b3befd.js} +0 -0
  548. /package/build/{useUniqueId-366f946b.js → useUniqueId-1bb40954.js} +0 -0
  549. /package/build/{utils-99eb2b0f.js → utils-1463ac9f.js} +0 -0
@@ -0,0 +1,3995 @@
1
+ 'use strict';
2
+
3
+ var tslib_es6 = require('./tslib.es6-9bd4bb1f.js');
4
+ var React = require('react');
5
+ var other = require('@hhgtech/icons/other');
6
+ var index$8 = require('./index-91bec39a.js');
7
+ var index = require('./index-917db768.js');
8
+ var innertext = require('innertext');
9
+ var miscTheme = require('./miscTheme.js');
10
+ var index$5 = require('./index-e5a0f130.js');
11
+ var core = require('@mantine/core');
12
+ require('@mantine/dates');
13
+ require('./index-e45dfb52.js');
14
+ require('./index-f06d7f6b.js');
15
+ require('./index-bf10023b.js');
16
+ require('./useMantineLocale-001e819a.js');
17
+ var index$2 = require('./index-3529d7bb.js');
18
+ var index$1 = require('./index-0fd0fe8f.js');
19
+ require('./index.styles-b050ad8b.js');
20
+ require('@mantine/hooks');
21
+ var utils = require('./utils-1463ac9f.js');
22
+ require('./other-78cc653a.js');
23
+ require('./index-cc1f73b6.js');
24
+ var index$3 = require('./index-2e7c6751.js');
25
+ var togetherComponentGlobalContext = require('./utils-865ff999.js');
26
+ var styled = require('@emotion/styled');
27
+ var dataTransform = require('./dataTransform-0c2530cb.js');
28
+ var constants = require('./constants-ef5b314b.js');
29
+ var post = require('./post-be7956f8.js');
30
+ var togetherMoleculesCardAuthor = require('./index-145d886b.js');
31
+ var togetherRichTextEditor = require('./editor-1b7f4cb1.js');
32
+ var index$4 = require('./index-f766a23c.js');
33
+ var debounce = require('lodash/debounce');
34
+ var ContentEditable = require('react-contenteditable');
35
+ var togetherApiPaths = require('./togetherApiPaths.js');
36
+ var index$6 = require('./index-d8475e87.js');
37
+ var index$7 = require('./index-4f20dcd4.js');
38
+ var index$9 = require('./index-8025fa76.js');
39
+ var Locale = require('./Locale-19ffd740.js');
40
+ var ReactDOM = require('react-dom');
41
+ var togetherMoleculesPostImagePreview = require('./index-d032bf89.js');
42
+ var index$c = require('./index-27b516f9.js');
43
+ var miscCookieHelper = require('./miscCookieHelper.js');
44
+ var useUniqueId = require('./useUniqueId-1bb40954.js');
45
+ var index$a = require('./index-1f90039e.js');
46
+ var index$b = require('./index-c5174326.js');
47
+ var core$1 = require('@hhgtech/icons/core');
48
+
49
+ function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
50
+
51
+ function _interopNamespace(e) {
52
+ if (e && e.__esModule) return e;
53
+ var n = Object.create(null);
54
+ if (e) {
55
+ Object.keys(e).forEach(function (k) {
56
+ if (k !== 'default') {
57
+ var d = Object.getOwnPropertyDescriptor(e, k);
58
+ Object.defineProperty(n, k, d.get ? d : {
59
+ enumerable: true,
60
+ get: function () { return e[k]; }
61
+ });
62
+ }
63
+ });
64
+ }
65
+ n["default"] = e;
66
+ return Object.freeze(n);
67
+ }
68
+
69
+ var React__default = /*#__PURE__*/_interopDefault(React);
70
+ var innertext__default = /*#__PURE__*/_interopDefault(innertext);
71
+ var styled__default = /*#__PURE__*/_interopDefault(styled);
72
+ var debounce__default = /*#__PURE__*/_interopDefault(debounce);
73
+ var ContentEditable__default = /*#__PURE__*/_interopDefault(ContentEditable);
74
+ var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
75
+
76
+ const StyledCreateNewPost$1 = styled__default["default"].div `
77
+ position: relative;
78
+ display: flex;
79
+ height: 100%;
80
+ flex-direction: column;
81
+ padding: 16px 24px;
82
+
83
+ ${utils.MediaQueries.mbDown} {
84
+ padding: 16px 16px;
85
+ }
86
+
87
+ .input-group-container {
88
+ flex: 1;
89
+ padding-right: 2px;
90
+ padding-left: 2px;
91
+ margin-bottom: 24px;
92
+ -ms-overflow-style: none; /* IE and Edge */
93
+ overflow-y: auto;
94
+ scrollbar-width: none; /* Firefox */
95
+ &::-webkit-scrollbar {
96
+ display: none;
97
+ }
98
+ }
99
+
100
+ .input-group {
101
+ :not(:last-child) {
102
+ margin-bottom: 0.6rem;
103
+ }
104
+
105
+ input:focus,
106
+ textarea:focus,
107
+ [contenteditable='true'] {
108
+ outline: none;
109
+ }
110
+
111
+ label {
112
+ margin-bottom: 5px;
113
+ color: ${miscTheme.theme.colors.gray600};
114
+ /* font-family: 'Open Sans', sans-serif; */
115
+ font-size: 13px;
116
+ font-weight: bold;
117
+ }
118
+
119
+ .input-group-label {
120
+ margin-bottom: 5px;
121
+ color: ${miscTheme.theme.colors.gray600};
122
+ /* font-family: 'Open Sans', sans-serif; */
123
+ font-size: 13px;
124
+ font-weight: bold;
125
+ }
126
+
127
+ .input-notification {
128
+ display: flex;
129
+
130
+ & > img {
131
+ width: 16px;
132
+ height: 16px;
133
+ margin-top: 1.5px;
134
+ margin-right: 8px;
135
+ }
136
+ }
137
+
138
+ .tag-list {
139
+ }
140
+ }
141
+
142
+ .warning {
143
+ margin-top: 16px;
144
+ }
145
+
146
+ .submit-btn {
147
+ width: 100%;
148
+ }
149
+
150
+ .switch-label {
151
+ display: flex;
152
+ align-items: center;
153
+ }
154
+
155
+ .swich-input-group {
156
+ padding: 12px 16px;
157
+ border-radius: 8px;
158
+ background: ${miscTheme.theme.colors.neutral50};
159
+
160
+ &.askdoctor-switch {
161
+ background: ${miscTheme.theme.colors.primary50};
162
+ &.mb-color {
163
+ background: ${miscTheme.theme.mbColors.tonePink};
164
+ }
165
+ }
166
+
167
+ .mantine-Switch-labelWrapper {
168
+ flex-grow: 1;
169
+ }
170
+ .mantine-Checkbox-body {
171
+ display: flex;
172
+ width: 100%;
173
+ align-items: center;
174
+ justify-content: space-between;
175
+ }
176
+ .mantine-Switch-track {
177
+ margin-bottom: 0;
178
+ }
179
+ .label-txt {
180
+ font-weight: normal;
181
+ font-size: 14px;
182
+ color: ${miscTheme.theme.colors.gray800};
183
+ margin-left: 10px;
184
+ }
185
+ }
186
+ `;
187
+ const StyledIsQuestion$1 = styled__default["default"].div `
188
+ display: flex;
189
+ width: 100%;
190
+ align-items: center;
191
+ justify-content: space-between;
192
+ padding: 8px 12px;
193
+ border-radius: 0 0 8px 8px;
194
+ background: ${miscTheme.theme.colors.neutral50};
195
+ border: 1px solid ${miscTheme.theme.colors.gray200};
196
+ gap: 12px;
197
+
198
+ &.has-error {
199
+ border: 1px solid ${miscTheme.theme.colors.red600};
200
+ }
201
+ &.error-description {
202
+ border: 1px solid ${miscTheme.theme.colors.red600};
203
+ border-top: none;
204
+ }
205
+
206
+ &[data-is-marry-baby='true'] {
207
+ background: ${miscTheme.theme.mbColors.tonePink};
208
+ }
209
+
210
+ .switch-label {
211
+ display: flex;
212
+ gap: 4px;
213
+ align-items: flex-start;
214
+
215
+ svg {
216
+ margin-top: 2px;
217
+ }
218
+
219
+ .wrapper-text {
220
+ .label-txt {
221
+ color: ${miscTheme.theme.colors.gray800};
222
+ font-size: 14px;
223
+ font-weight: 600;
224
+ line-height: 22px;
225
+ }
226
+ .description-txt {
227
+ color: ${miscTheme.theme.colors.gray700};
228
+ font-size: 12px;
229
+ font-weight: 400;
230
+ line-height: 18px;
231
+ }
232
+ }
233
+ }
234
+
235
+ button {
236
+ height: 40px;
237
+ &:hover,
238
+ &.primary {
239
+ border-radius: 16px;
240
+ border: 1px solid ${miscTheme.theme.colors.blue100};
241
+ background: ${miscTheme.theme.colors.blue50};
242
+ color: ${miscTheme.theme.colors.primaryBase};
243
+ }
244
+ }
245
+ `;
246
+ const StyledError$1 = styled__default["default"].div `
247
+ margin-bottom: 12px;
248
+ color: ${miscTheme.theme.colors.red700};
249
+ svg {
250
+ margin-right: 5px;
251
+ }
252
+ svg,
253
+ span {
254
+ vertical-align: middle;
255
+ }
256
+ `;
257
+ const StyledFormGroupInner$1 = styled__default["default"].div `
258
+ .swich-input-group {
259
+ padding: 12px 16px;
260
+ border-radius: 8px;
261
+ background: ${miscTheme.theme.colors.neutral50};
262
+
263
+ &.askdoctor-switch {
264
+ background: ${miscTheme.theme.colors.blue50};
265
+ }
266
+
267
+ .switch-label {
268
+ display: flex;
269
+ align-items: center;
270
+ }
271
+ .mantine-Switch-labelWrapper {
272
+ flex-grow: 1;
273
+ }
274
+ .mantine-Checkbox-body {
275
+ display: flex;
276
+ width: 100%;
277
+ align-items: center;
278
+ justify-content: space-between;
279
+ }
280
+ .mantine-Switch-track {
281
+ margin-bottom: 0;
282
+ }
283
+ .label-txt {
284
+ font-weight: normal;
285
+ font-size: 14px;
286
+ color: ${miscTheme.theme.colors.gray800};
287
+ margin-left: 14px;
288
+ }
289
+ }
290
+ `;
291
+ const StylePostAction$1 = styled__default["default"].div `
292
+ display: flex;
293
+ gap: 12px;
294
+ .avatar {
295
+ width: 40px;
296
+ height: 40px;
297
+ border-radius: 100%;
298
+
299
+ img {
300
+ border-radius: 100%;
301
+ }
302
+
303
+ .author-avatar {
304
+ .col-left {
305
+ display: none;
306
+ }
307
+ }
308
+ }
309
+
310
+ .post-action-form {
311
+ display: flex;
312
+ flex-direction: column;
313
+ gap: 4px;
314
+ }
315
+
316
+ .post-action-by {
317
+ color: ${miscTheme.theme.colors.gray800};
318
+ font-size: 16px;
319
+ font-weight: 600;
320
+ line-height: 24px;
321
+ }
322
+
323
+ .post-action-result {
324
+ display: flex;
325
+ position: relative;
326
+ &:after {
327
+ content: '';
328
+ display: inline-block;
329
+ width: 5px;
330
+ height: 5px;
331
+ background-color: ${miscTheme.theme.colors.error};
332
+ border-radius: 100%;
333
+ position: absolute;
334
+ right: 7px;
335
+ }
336
+ }
337
+
338
+ .dropdown-post-action {
339
+ background: ${miscTheme.theme.colors.white} !important;
340
+ border-radius: 2px;
341
+ border: 1px solid ${miscTheme.theme.colors.neutral200} !important;
342
+
343
+ > div {
344
+ padding: 3px 8px;
345
+ }
346
+
347
+ span {
348
+ flex: 1;
349
+ color: ${miscTheme.theme.colors.gray600};
350
+ font-size: 12px;
351
+ font-weight: 600;
352
+ line-height: 18px;
353
+ }
354
+
355
+ ul {
356
+ width: 130px;
357
+ li {
358
+ img {
359
+ flex: 0 0 16px;
360
+ width: 16px;
361
+ }
362
+ }
363
+ }
364
+ }
365
+ `;
366
+ const StyleSessionRow$1 = styled__default["default"].div `
367
+ display: inline-flex;
368
+ gap: 8px;
369
+ align-items: center;
370
+ cursor: pointer;
371
+
372
+ .session-title {
373
+ color: ${miscTheme.theme.colors.gray700};
374
+ font-size: 14px;
375
+ font-weight: 400;
376
+ line-height: 22px;
377
+ flex: 1;
378
+ }
379
+ `;
380
+
381
+ var img$7 = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3e%3cpath d='M8.78785 10.7863H7.21084C5.77572 10.237 4.20739 10.237 2.77223 10.7863H1.55404V11.6457H2.41467V11.6537C2.41802 13.0707 3.57408 14.2238 4.99111 14.2238C6.4069 14.2238 7.56293 13.072 7.56797 11.6566L7.56803 11.6457H8.4303V11.6537C8.43365 13.0707 9.58971 14.2238 11.0067 14.2238C12.4225 14.2238 13.5786 13.072 13.5836 11.6566L13.5837 11.6457H14.4447V10.7863H13.2265C11.7913 10.237 10.223 10.237 8.78785 10.7863Z' fill='%238C8C8C'/%3e%3cpath d='M0.666016 6.48926V6.91895C0.666016 8.10354 1.62986 9.06738 2.81445 9.06738H13.1842C14.3688 9.06738 15.3327 8.10354 15.3327 6.91895V6.48926H0.666016Z' fill='%238C8C8C'/%3e%3cpath d='M12.36 3.18227C11.9916 2.07614 10.961 1.33301 9.7953 1.33301C9.13524 1.33301 8.48902 1.58185 7.99935 2.01991C7.50965 1.58185 6.86346 1.33301 6.2034 1.33301C5.03772 1.33301 4.00712 2.07614 3.63871 3.18184L2.8207 5.62988H13.1779L12.36 3.18227Z' fill='%238C8C8C'/%3e%3c/svg%3e";
382
+ var IconAnonymous = img$7;
383
+
384
+ var img$6 = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3e%3cpath d='M8.00045 14.3336C7.12449 14.3336 6.30114 14.1674 5.53038 13.835C4.75962 13.5025 4.08916 13.0513 3.51902 12.4815C2.94886 11.9116 2.49749 11.2414 2.1649 10.471C1.83231 9.70056 1.66602 8.87738 1.66602 8.00143C1.66602 7.12547 1.83224 6.30211 2.16468 5.53136C2.49713 4.76059 2.94829 4.09014 3.51818 3.51999C4.08808 2.94984 4.75824 2.49847 5.52867 2.16588C6.29908 1.83329 7.12226 1.66699 7.99822 1.66699C8.87417 1.66699 9.69753 1.83322 10.4683 2.16566C11.239 2.4981 11.9095 2.94927 12.4796 3.51916C13.0498 4.08906 13.5012 4.75922 13.8338 5.52964C14.1664 6.30005 14.3327 7.12324 14.3327 7.99919C14.3327 8.87515 14.1664 9.6985 13.834 10.4693C13.5015 11.24 13.0504 11.9105 12.4805 12.4806C11.9106 13.0508 11.2404 13.5022 10.47 13.8347C9.69959 14.1673 8.8764 14.3336 8.00045 14.3336ZM7.99933 13.3336C9.48822 13.3336 10.7493 12.817 11.7827 11.7836C12.816 10.7503 13.3327 9.4892 13.3327 8.00031C13.3327 7.92253 13.331 7.84304 13.3275 7.76184C13.3241 7.68065 13.3203 7.608 13.316 7.54389C13.2733 7.85329 13.1393 8.10928 12.9141 8.31184C12.6889 8.51441 12.4181 8.61569 12.1019 8.61569H10.5891C10.2506 8.61569 9.96087 8.49527 9.71985 8.25441C9.47883 8.01357 9.35832 7.72403 9.35832 7.38581V6.77088H6.89678V5.54099C6.89678 5.20277 7.01729 4.91272 7.25832 4.67084C7.49935 4.42896 7.78909 4.30803 8.12755 4.30803H8.74293V4.05159C8.74293 3.76185 8.83054 3.52189 9.00575 3.33173C9.18097 3.14155 9.39209 3.00885 9.6391 2.93364C9.37841 2.84818 9.11262 2.78236 8.84173 2.73621C8.57084 2.69005 8.29004 2.66698 7.99933 2.66698C6.51044 2.66698 5.24933 3.18364 4.216 4.21698C3.18267 5.25031 2.666 6.51142 2.666 8.00031V8.09648C2.666 8.12639 2.66814 8.15844 2.67242 8.19263H5.83265C6.5147 8.19263 7.09547 8.43237 7.57495 8.91186C8.05444 9.39134 8.29418 9.97114 8.29418 10.6513V11.2695H6.44803V13.0965C6.6959 13.1734 6.94847 13.2321 7.20573 13.2727C7.463 13.3133 7.72753 13.3336 7.99933 13.3336Z' fill='%238C8C8C'/%3e%3c/svg%3e";
385
+ var IconPublic = img$6;
386
+
387
+ styled__default["default"].div `
388
+ background-color: white;
389
+ z-index: 1000;
390
+ top: 0;
391
+ left: 0;
392
+ height: 100%;
393
+ position: absolute;
394
+ width: 100%;
395
+
396
+ .drawer-header {
397
+ display: flex;
398
+ gap: 12px;
399
+ align-items: center;
400
+ padding: 12px 16px;
401
+ border-bottom: 1px solid ${miscTheme.theme.colors.gray200};
402
+
403
+ .input-group-label {
404
+ flex: 1;
405
+ }
406
+
407
+ img {
408
+ cursor: pointer;
409
+ }
410
+
411
+ p {
412
+ flex: 1;
413
+ }
414
+ }
415
+
416
+ .drawer-content {
417
+ padding: 16px;
418
+ display: flex;
419
+ flex-direction: column;
420
+ gap: 16px;
421
+ overflow-y: auto;
422
+ height: calc(100% - 49px);
423
+
424
+ .input-field-label {
425
+ margin-bottom: 8px;
426
+ }
427
+
428
+ &.drawer-content-full-screen {
429
+ max-width: 680px;
430
+ margin: 0 auto;
431
+ padding: 16px 24px;
432
+ }
433
+ }
434
+ `;
435
+ const StyleCommunityReivew = styled__default["default"].div `
436
+ display: flex;
437
+ flex-direction: column;
438
+ gap: 8px;
439
+ margin-top: 8px;
440
+
441
+ .topic-review {
442
+ display: flex;
443
+ gap: 4px;
444
+ flex-wrap: wrap;
445
+ }
446
+
447
+ .community-review {
448
+ .tag-item {
449
+ background-color: ${miscTheme.theme.colors.neutral50};
450
+
451
+ img {
452
+ border-radius: 50%;
453
+ margin-right: 8px;
454
+ }
455
+ }
456
+ }
457
+ `;
458
+
459
+ var img$5 = "data:image/svg+xml,%3csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M4.86019 13.3957C4.98735 13.5229 5.14492 13.5865 5.33291 13.5865H13.3233L15.9771 16.2403V5.91343C15.9771 5.72546 15.9135 5.56789 15.7864 5.44072C15.6592 5.31356 15.5016 5.24998 15.3136 5.24998H14.1887V12.036L13.9507 11.798H4.66944V12.923C4.66944 13.111 4.73302 13.2686 4.86019 13.3957ZM2.01562 3.28847V12.9519L4.66944 10.298H12.0252C12.2132 10.298 12.3708 10.2345 12.4979 10.1073C12.6251 9.98014 12.6887 9.82257 12.6887 9.63459V3.28847C12.6887 3.10048 12.6251 2.94291 12.4979 2.81574C12.3708 2.68858 12.2132 2.625 12.0252 2.625H2.67909C2.49111 2.625 2.33353 2.68858 2.20637 2.81574C2.07921 2.94291 2.01562 3.10048 2.01562 3.28847Z' fill='%232D87F3'/%3e%3c/svg%3e";
460
+ var IconCommunity = img$5;
461
+
462
+ const PostCommunityReview = ({ selectedTopics, currentCommunity }) => {
463
+ return (React__default["default"].createElement(StyleCommunityReivew, null,
464
+ React__default["default"].createElement("div", { className: "community-review" },
465
+ React__default["default"].createElement(index$1.Button, { skipHover: true, size: "md", radius: "xl", className: "tag-item", variant: "tertiary" },
466
+ React__default["default"].createElement(index$2.Text, { size: "p4", as: "span", color: "inherit" }, currentCommunity.name))),
467
+ React__default["default"].createElement("div", { className: "topic-review", style: { display: 'none' } }, selectedTopics.map((topic) => {
468
+ return (React__default["default"].createElement(index$1.Button, { skipHover: true, size: "sm", radius: "xl", className: "tag-item", key: topic.id, variant: "tertiary" },
469
+ React__default["default"].createElement(index$2.Text, { size: "p4", as: "span", color: "inherit" }, topic.name)));
470
+ }))));
471
+ };
472
+ const CreatePostCommunity$1 = ({ communitiesList, currentCommunity, selectedTopics, forceTopics, communityValue,
473
+ // error,
474
+ isFullscreen, isInEditMode, setSelectedTopics, setCommunityValue, removeKeyError, }) => {
475
+ const { t } = index.useTranslations();
476
+ const props = {
477
+ communitiesList,
478
+ currentCommunity,
479
+ selectedTopics,
480
+ communityValue,
481
+ isFullscreen,
482
+ isInEditMode,
483
+ forceTopics,
484
+ setSelectedTopics,
485
+ setCommunityValue,
486
+ removeKeyError,
487
+ };
488
+ console.log(props);
489
+ return (React__default["default"].createElement("div", { className: "input-group" },
490
+ React__default["default"].createElement(StyleSessionRow$1, null,
491
+ React__default["default"].createElement("img", { alt: "anonymous-icon", src: IconCommunity, style: {
492
+ width: '18px',
493
+ height: '18px',
494
+ objectFit: 'contain',
495
+ marginLeft: 'auto',
496
+ } }),
497
+ React__default["default"].createElement("div", { className: "session-title" }, t('createPost.communityAndTopic'))),
498
+ React__default["default"].createElement(PostCommunityReview, { selectedTopics: selectedTopics, currentCommunity: currentCommunity })));
499
+ };
500
+
501
+ const CreatePostDescription$1 = ({ className, style, bannedWords = [], value, onChange, onPreviewUrlChange, onInvalidUrlsChange,
502
+ // onImageFilesChange,
503
+ // imageFiles: imageFilesProp,
504
+ isReplying, footerEditor, }) => {
505
+ const { t } = index.useTranslations();
506
+ const [previewUrl, setPreviewUrl] = React.useState(null);
507
+ const imagePicker = React.useRef(null);
508
+ // const {
509
+ // onSelectImages,
510
+ // onRemoveImage,
511
+ // imageSrcs,
512
+ // // imageFiles,
513
+ // } = useImagePicker(imageFilesProp, onImageFilesChange)
514
+ React.useEffect(() => {
515
+ if (onPreviewUrlChange) {
516
+ if (previewUrl === null || previewUrl === void 0 ? void 0 : previewUrl.url)
517
+ onPreviewUrlChange({
518
+ title: previewUrl.title || '',
519
+ url: previewUrl.url || '',
520
+ image: previewUrl.image || '',
521
+ description: previewUrl.description || '',
522
+ });
523
+ else
524
+ onPreviewUrlChange(null);
525
+ }
526
+ }, [previewUrl]);
527
+ return (React__default["default"].createElement(togetherRichTextEditor.StyledCreatePostDescription, { className: className, style: style },
528
+ React__default["default"].createElement(index$2.Text, { size: "p4", className: "description-label" }, t('createPost.popup.description')),
529
+ React__default["default"].createElement("div", { className: `textarea-control` },
530
+ React__default["default"].createElement("div", { className: "textarea-wrapper" },
531
+ React__default["default"].createElement(togetherRichTextEditor.RichTextEditor, { html: value || '', onChange: onChange, bannedWords: bannedWords, onImagePickerClick: () => { var _a; return (_a = imagePicker.current) === null || _a === void 0 ? void 0 : _a.click(); }, onPreviewUrlChange: setPreviewUrl, onInvalidUrlsChange: onInvalidUrlsChange, isReplying: isReplying }))),
532
+ footerEditor,
533
+ React__default["default"].createElement(index$2.Text, { size: "p4", className: "count-string" },
534
+ t('character'),
535
+ ": ",
536
+ innertext__default["default"](value || '').length)));
537
+ };
538
+
539
+ var img$4 = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3e%3cpath d='M5.3077 20.5C4.80257 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V5.3077C3.5 4.80257 3.675 4.375 4.025 4.025C4.375 3.675 4.80257 3.5 5.3077 3.5H18.6923C19.1974 3.5 19.625 3.675 19.975 4.025C20.325 4.375 20.5 4.80257 20.5 5.3077V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H5.3077ZM7.65388 16.75H16.423C16.6038 16.75 16.7377 16.6679 16.8249 16.5038C16.9121 16.3397 16.8987 16.1807 16.7845 16.0269L14.4 12.8327C14.3064 12.7122 14.1859 12.6519 14.0384 12.6519C13.891 12.6519 13.7705 12.7122 13.6769 12.8327L11.2308 16.0192L9.5923 13.9192C9.49872 13.8051 9.37981 13.7481 9.23558 13.7481C9.09134 13.7481 8.97243 13.8083 8.87885 13.9289L7.30195 16.0269C7.18143 16.1807 7.16477 16.3397 7.25195 16.5038C7.33913 16.6679 7.47311 16.75 7.65388 16.75Z' fill='%232D87F3'/%3e%3c/svg%3e";
540
+ var IconPhone = img$4;
541
+
542
+ const CreatePostPhotos$1 = ({ imageFiles: imageFilesInit, setImageFiles, }) => {
543
+ const imageRef = React.useRef(null);
544
+ const { t } = index.useTranslations();
545
+ const { onSelectImages } = index$3.useImagePicker(imageFilesInit, setImageFiles);
546
+ const handleClick = () => {
547
+ var _a;
548
+ (_a = imageRef === null || imageRef === void 0 ? void 0 : imageRef.current) === null || _a === void 0 ? void 0 : _a.click();
549
+ };
550
+ return (React__default["default"].createElement("div", { className: "input-group" },
551
+ React__default["default"].createElement(StyleSessionRow$1, { onClick: handleClick },
552
+ React__default["default"].createElement("img", { alt: "anonymous-icon", src: IconPhone, style: {
553
+ width: '18px',
554
+ height: '18px',
555
+ objectFit: 'contain',
556
+ marginLeft: 'auto',
557
+ } }),
558
+ React__default["default"].createElement("div", { className: "session-title" }, t('createPost.photos'))),
559
+ React__default["default"].createElement("input", { ref: imageRef, type: "file", accept: "image/png, image/gif, image/jpeg", multiple: true, style: { display: 'none' }, onChange: (e) => onSelectImages(e) })));
560
+ };
561
+
562
+ const StyledCreatePostTitle$1 = styled__default["default"].div `
563
+ input:focus,
564
+ textarea:focus,
565
+ [contenteditable='true'] {
566
+ outline: none;
567
+ }
568
+
569
+ .title-input {
570
+ overflow: hidden;
571
+ width: 100%;
572
+ padding: 12px 16px;
573
+ border: solid 1px #d9d9d9;
574
+ border-radius: ${miscTheme.theme.borderRadius};
575
+ font-size: 16px;
576
+ line-height: 1.2;
577
+ white-space: nowrap;
578
+ :focus {
579
+ border-color: ${(props) => props.color};
580
+ box-shadow: 0px 0px 2px 2px ${(props) => props.colorShadow};
581
+ }
582
+ br {
583
+ display: none;
584
+ }
585
+ * {
586
+ display: inline;
587
+ white-space: nowrap;
588
+ }
589
+ mocka {
590
+ padding: 2px 6px;
591
+ border-radius: 1rem;
592
+ &[data-error='true'] {
593
+ background-color: #ffeeee;
594
+ color: red;
595
+ text-decoration: underline;
596
+ font-style: bold;
597
+ }
598
+ }
599
+ ol,
600
+ ul {
601
+ padding-left: 1rem;
602
+ }
603
+ }
604
+
605
+ label {
606
+ display: block;
607
+ margin-bottom: 5px;
608
+ color: ${miscTheme.theme.colors.gray600};
609
+ font-size: 13px;
610
+ font-weight: bold;
611
+ }
612
+
613
+ .count-string {
614
+ margin-top: 5px;
615
+ color: ${miscTheme.theme.colors.gray500};
616
+ font-size: 11px;
617
+ text-align: right;
618
+ }
619
+ `;
620
+
621
+ const TITLE_LIMIT$1 = 120;
622
+ const inputModify$3 = (value, opts) => {
623
+ if (!opts)
624
+ return value;
625
+ const { limit, bannedWords = [] } = opts;
626
+ const shorten = typeof limit === 'number' && limit >= 0 ? value.substring(0, limit) : value;
627
+ const processedValue = post.highlightBadWords(shorten, bannedWords);
628
+ return processedValue;
629
+ };
630
+ const CreatePostTitle$1 = ({ className, style, bannedWords = [], value, onChange, }) => {
631
+ var _a;
632
+ const _theme = core.useMantineTheme();
633
+ const { t } = index.useTranslations();
634
+ const [titleValue, setTitleValue] = React.useState('');
635
+ const titleRef = React.useRef(null);
636
+ React.useEffect(() => {
637
+ if (titleRef.current) {
638
+ const pasteHandler = (e) => {
639
+ var _a;
640
+ e.preventDefault();
641
+ const text = (_a = e.clipboardData) === null || _a === void 0 ? void 0 : _a.getData('text/plain');
642
+ document.execCommand('insertHTML', false, text);
643
+ };
644
+ const contentDiv = titleRef.current;
645
+ contentDiv.addEventListener('paste', pasteHandler, {
646
+ passive: true,
647
+ });
648
+ return () => contentDiv.removeEventListener('paste', pasteHandler);
649
+ }
650
+ }, [titleRef]);
651
+ const bannedString = (bannedWords === null || bannedWords === void 0 ? void 0 : bannedWords.join(',')) || '';
652
+ React.useEffect(() => {
653
+ var _a;
654
+ if (bannedString) {
655
+ const titleText = (_a = titleRef.current) === null || _a === void 0 ? void 0 : _a.innerText;
656
+ if (titleText) {
657
+ const titleValueWithBanned = post.highlightBadWords(titleText, bannedWords);
658
+ if (titleValueWithBanned !== titleText) {
659
+ onChange && onChange(titleValueWithBanned);
660
+ setTitleValue(titleValueWithBanned);
661
+ }
662
+ }
663
+ }
664
+ }, [bannedString]);
665
+ const debounceInputModify = React.useCallback(debounce__default["default"](() => {
666
+ if (titleRef.current) {
667
+ const shortenString = inputModify$3(titleRef.current.innerText, {
668
+ limit: TITLE_LIMIT$1,
669
+ bannedWords,
670
+ });
671
+ onChange && onChange(shortenString);
672
+ setTitleValue(shortenString);
673
+ }
674
+ }, 300), []);
675
+ React.useEffect(() => {
676
+ setTimeout(() => {
677
+ var _a;
678
+ (_a = titleRef.current) === null || _a === void 0 ? void 0 : _a.focus();
679
+ }, 500);
680
+ }, []);
681
+ return (React__default["default"].createElement(StyledCreatePostTitle$1, { className: className, style: style, color: _theme.colors[_theme.primaryColor][0], colorShadow: _theme.colors[_theme.primaryColor][2] },
682
+ React__default["default"].createElement(index$4.Input, { name: "title", value: value || titleValue, size: "md", label: t('createPost.title'), CustomInput: React__default["default"].createElement(ContentEditable__default["default"], { innerRef: titleRef, html: value || titleValue, onChange: () => {
683
+ if (titleRef.current &&
684
+ titleRef.current.innerText !== (value || titleValue)) {
685
+ const initialValue = inputModify$3(titleRef.current.innerText, {
686
+ bannedWords,
687
+ });
688
+ onChange && onChange(initialValue);
689
+ setTitleValue(initialValue);
690
+ debounceInputModify();
691
+ }
692
+ }, className: "title-input" }) }),
693
+ React__default["default"].createElement(index$2.Text, { size: "p4", className: "count-string" }, t('createPost.popup.wordCount', {
694
+ count: ((_a = titleRef.current) === null || _a === void 0 ? void 0 : _a.innerText.length) || 0,
695
+ max: TITLE_LIMIT$1,
696
+ }))));
697
+ };
698
+
699
+ const StyledPopupFrame = styled__default["default"](index$3.PopupFrame) `
700
+ & > div[data-open]:first-child {
701
+ z-index: 1000;
702
+ height: auto;
703
+ max-width: 448px;
704
+ }
705
+ .custom-media-dialog {
706
+ padding: 1rem;
707
+ .image-gallery {
708
+ display: none;
709
+ .image-item {
710
+ &.no-image {
711
+ cursor: pointer;
712
+ }
713
+ .camera-btn {
714
+ position: absolute;
715
+ top: calc(100% - 32px);
716
+ right: 8px;
717
+ left: unset;
718
+ width: 24px;
719
+ height: 24px;
720
+ }
721
+ }
722
+ }
723
+ .custom-media-add-btn {
724
+ margin-left: auto;
725
+ display: block;
726
+ }
727
+ }
728
+ `;
729
+ const StyledInput = styled__default["default"](index$5.Input) `
730
+ margin-bottom: 10px;
731
+ `;
732
+ const StyleWrapperInfo = styled__default["default"].div `
733
+ display: flex;
734
+ gap: 4px;
735
+ align-items: flex-start;
736
+ margin-bottom: 14px;
737
+
738
+ img {
739
+ margin-top: 2px;
740
+ max-width: 16px;
741
+ }
742
+ `;
743
+
744
+ var img$3 = "data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8.0026 1.33334C4.3206 1.33334 1.33594 4.31801 1.33594 8.00001C1.33594 11.682 4.3206 14.6667 8.0026 14.6667C11.6846 14.6667 14.6693 11.682 14.6693 8.00001C14.6693 4.31801 11.6846 1.33334 8.0026 1.33334ZM8.0026 11.3333C7.6346 11.3333 7.33594 11.0347 7.33594 10.6667V8.00001C7.33594 7.63201 7.6346 7.33334 8.0026 7.33334C8.3706 7.33334 8.66927 7.63201 8.66927 8.00001V10.6667C8.66927 11.0347 8.3706 11.3333 8.0026 11.3333ZM8.33594 6.00001H7.66927C7.48527 6.00001 7.33594 5.85068 7.33594 5.66668V5.00001C7.33594 4.81601 7.48527 4.66668 7.66927 4.66668H8.33594C8.51994 4.66668 8.66927 4.81601 8.66927 5.00001V5.66668C8.66927 5.85068 8.51994 6.00001 8.33594 6.00001Z' fill='%232D87F3'/%3e%3c/svg%3e";
745
+ var IconInfo = img$3;
746
+
747
+ const SocialLinkPopup = ({ isOpen, onClose, onSocialLinkChanged, socialLinkData, }) => {
748
+ const { t } = index.useTranslations();
749
+ const imagePickerRef = React.useRef(null);
750
+ const [socialLink, setSocialLinkUrl] = React.useState('');
751
+ const { onSelectImages, onRemoveImage, imageSrcs, imageFiles } = index$3.useImagePicker();
752
+ React.useEffect(() => {
753
+ if (isOpen) {
754
+ setSocialLinkUrl((socialLinkData === null || socialLinkData === void 0 ? void 0 : socialLinkData.url) || '');
755
+ }
756
+ }, [isOpen]);
757
+ const isAcceptedLink = socialLink.includes('youtu.be') ||
758
+ socialLink.includes('youtube.com') ||
759
+ socialLink.includes('facebook.com') ||
760
+ socialLink.includes('fb.watch') ||
761
+ socialLink.includes('tiktok.com');
762
+ const isValid = !!socialLink && isAcceptedLink;
763
+ return (React__default["default"].createElement(React__default["default"].Fragment, null,
764
+ React__default["default"].createElement("input", { ref: imagePickerRef, type: "file", accept: "image/png, image/gif, image/jpeg", style: { display: 'none' }, onChange: onSelectImages }),
765
+ React__default["default"].createElement(StyledPopupFrame, { isOpen: isOpen, onClose: onClose, heading: "Insert", style: {
766
+ zIndex: 3,
767
+ } },
768
+ React__default["default"].createElement("div", { className: "custom-media-dialog", onClick: (e) => e.stopPropagation() },
769
+ React__default["default"].createElement(StyledInput, { size: "md", name: "custom-media-url", placeholder: "URL", value: socialLink, onChange: (v) => setSocialLinkUrl(v), label: "" }),
770
+ React__default["default"].createElement(StyleWrapperInfo, null,
771
+ React__default["default"].createElement("img", { src: IconInfo, alt: "" }),
772
+ React__default["default"].createElement(index$2.Text, { size: "c2", color: "#737373" }, t('editor.addSocialLink.warningDomain'))),
773
+ !imageSrcs[0] ? (React__default["default"].createElement("div", { className: "image-gallery" },
774
+ React__default["default"].createElement("div", { className: "image-item no-image", onClick: () => { var _a; return (_a = imagePickerRef.current) === null || _a === void 0 ? void 0 : _a.click(); } }))) : (React__default["default"].createElement("div", { className: "image-gallery" },
775
+ React__default["default"].createElement("div", { className: "image-item" },
776
+ React__default["default"].createElement("img", { src: imageSrcs[0], alt: "" }),
777
+ React__default["default"].createElement("img", { className: "close-btn", alt: "", onClick: () => onRemoveImage(0) })))),
778
+ React__default["default"].createElement(index$1.Button, { color: "primary", size: "md", variant: "primary", type: "button", className: "custom-media-add-btn", onClick: (e) => {
779
+ e === null || e === void 0 ? void 0 : e.preventDefault();
780
+ e === null || e === void 0 ? void 0 : e.stopPropagation();
781
+ if (isValid) {
782
+ onSocialLinkChanged === null || onSocialLinkChanged === void 0 ? void 0 : onSocialLinkChanged({
783
+ url: !socialLink.includes('http')
784
+ ? 'https://' + socialLink
785
+ : socialLink,
786
+ banner: imageFiles[0],
787
+ });
788
+ onClose === null || onClose === void 0 ? void 0 : onClose();
789
+ }
790
+ }, disabled: !isValid }, t('editor.addSocialLink.addLink'))))));
791
+ };
792
+
793
+ var img$2 = "data:image/svg+xml,%3csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M3.23078 14.625C2.85193 14.625 2.53125 14.4937 2.26875 14.2312C2.00625 13.9687 1.875 13.648 1.875 13.2692V4.73078C1.875 4.35193 2.00625 4.03125 2.26875 3.76875C2.53125 3.50625 2.85193 3.375 3.23078 3.375H14.7692C15.148 3.375 15.4687 3.50625 15.7312 3.76875C15.9937 4.03125 16.125 4.35193 16.125 4.73078V10.315C15.8029 10.1922 15.4534 10.125 15.0882 10.125H11.9117C10.3036 10.125 8.99998 11.4286 8.99998 13.0368C8.99998 13.6227 9.17304 14.1682 9.47085 14.625H3.23078ZM7.83606 11.6899L11.5846 9.28988C11.6875 9.21969 11.7389 9.12306 11.7389 8.99998C11.7389 8.87691 11.6875 8.78028 11.5846 8.71009L7.83606 6.31011C7.72067 6.23222 7.60456 6.22597 7.48774 6.29136C7.37091 6.35673 7.3125 6.45721 7.3125 6.59278V11.4072C7.3125 11.5428 7.37091 11.6432 7.48774 11.7086C7.60456 11.774 7.72067 11.7677 7.83606 11.6899ZM10.7181 14.6953C11.1136 15.0907 11.5889 15.2884 12.1442 15.2884H12.8099C12.9325 15.2884 13.0352 15.247 13.1182 15.1642C13.2011 15.0813 13.2426 14.9786 13.2426 14.856C13.2426 14.7333 13.2011 14.6305 13.1182 14.5475C13.0352 14.4646 12.9325 14.4231 12.8099 14.4231H12.1442C11.8269 14.4231 11.5553 14.3101 11.3293 14.0841C11.1033 13.8582 10.9903 13.5865 10.9903 13.2692C10.9903 12.9519 11.1033 12.6803 11.3293 12.4543C11.5553 12.2284 11.8269 12.1154 12.1442 12.1154H12.8099C12.9325 12.1154 13.0352 12.074 13.1182 11.9911C13.2011 11.9083 13.2426 11.8055 13.2426 11.6829C13.2426 11.5602 13.2011 11.4574 13.1182 11.3745C13.0352 11.2915 12.9325 11.25 12.8099 11.25H12.1442C11.5889 11.25 11.1136 11.4477 10.7181 11.8432C10.3227 12.2386 10.125 12.7139 10.125 13.2692C10.125 13.8245 10.3227 14.2999 10.7181 14.6953ZM12.2686 13.5775C12.3515 13.6604 12.4543 13.7019 12.5769 13.7019H15.1731C15.2957 13.7019 15.3984 13.6605 15.4814 13.5776C15.5643 13.4948 15.6058 13.3921 15.6058 13.2694C15.6058 13.1468 15.5643 13.044 15.4814 12.961C15.3984 12.878 15.2957 12.8365 15.1731 12.8365H12.5769C12.4543 12.8365 12.3515 12.878 12.2686 12.9608C12.1857 13.0436 12.1442 13.1464 12.1442 13.269C12.1442 13.3917 12.1857 13.4945 12.2686 13.5775ZM14.9401 15.2884H15.6058C16.161 15.2884 16.6364 15.0911 17.0318 14.6966C17.4273 14.3019 17.625 13.8268 17.625 13.271C17.625 12.7068 17.4273 12.2289 17.0318 11.8374C16.6364 11.4458 16.161 11.25 15.6058 11.25H14.9401C14.8175 11.25 14.7147 11.2914 14.6318 11.3743C14.5488 11.4571 14.5074 11.5598 14.5074 11.6825C14.5074 11.8051 14.5488 11.908 14.6318 11.9909C14.7147 12.0739 14.8175 12.1154 14.9401 12.1154H15.6058C15.9231 12.1154 16.1947 12.2284 16.4207 12.4543C16.6466 12.6803 16.7596 12.9519 16.7596 13.2692C16.7596 13.5865 16.6466 13.8582 16.4207 14.0841C16.1947 14.3101 15.9231 14.4231 15.6058 14.4231H14.9401C14.8175 14.4231 14.7147 14.4645 14.6318 14.5473C14.5488 14.6302 14.5074 14.7329 14.5074 14.8556C14.5074 14.9782 14.5488 15.081 14.6318 15.164C14.7147 15.247 14.8175 15.2884 14.9401 15.2884Z' fill='%23F44D2C'/%3e%3c/svg%3e";
794
+ var IconVideo = img$2;
795
+
796
+ const CreatePostVideo = ({ socialLinkData, setSocialLinkData, }) => {
797
+ const { t } = index.useTranslations();
798
+ const [activeModal, setActiveModal] = React.useState(false);
799
+ const handleClick = () => {
800
+ setActiveModal(true);
801
+ };
802
+ return (React__default["default"].createElement("div", { className: "input-group" },
803
+ React__default["default"].createElement(StyleSessionRow$1, { onClick: handleClick },
804
+ React__default["default"].createElement("img", { alt: "anonymous-icon", src: IconVideo, style: {
805
+ width: '18px',
806
+ height: '18px',
807
+ objectFit: 'contain',
808
+ marginLeft: 'auto',
809
+ } }),
810
+ React__default["default"].createElement("div", { className: "session-title" }, t('createPost.videoOrLink'))),
811
+ React__default["default"].createElement(SocialLinkPopup, { isOpen: activeModal, onClose: () => setActiveModal(false), onSocialLinkChanged: setSocialLinkData, socialLinkData: socialLinkData })));
812
+ };
813
+
814
+ const StyleReviewPhoto$1 = styled__default["default"].div `
815
+ .mantine-Text-root {
816
+ margin-bottom: 4px;
817
+ }
818
+ .preview-images-container {
819
+ display: flex;
820
+ gap: 8px;
821
+ overflow-x: auto;
822
+ overflow-y: hidden;
823
+ .image-src-wrapper {
824
+ flex: 0 0 140px;
825
+ width: 140px;
826
+ height: 96px;
827
+ border-radius: 4px;
828
+ position: relative;
829
+ img {
830
+ border-radius: 4px;
831
+ }
832
+ .icon-close {
833
+ position: absolute;
834
+ top: 6px;
835
+ right: 6px;
836
+ cursor: pointer;
837
+ z-index: 10;
838
+ max-height: 24px;
839
+ max-width: 24px;
840
+ }
841
+ }
842
+ }
843
+ `;
844
+
845
+ const PostPhotosReview$1 = ({ error, imageFiles: imageFilesInit, setImageFiles, removeKeyError, }) => {
846
+ const { t } = index.useTranslations();
847
+ const { imageSrcs, onRemoveImage } = index$3.useImagePicker(imageFilesInit, setImageFiles);
848
+ return (React__default["default"].createElement(StyleReviewPhoto$1, { className: "input-group" },
849
+ React__default["default"].createElement(index$2.Text, { size: "p5", weight: "semiBold" }, t('createPost.photos')),
850
+ React__default["default"].createElement("div", { className: "preview-images-container" }, imageSrcs === null || imageSrcs === void 0 ? void 0 : imageSrcs.map((src, index) => {
851
+ return (React__default["default"].createElement("div", { className: "image-src-wrapper", key: index },
852
+ React__default["default"].createElement("img", { src: src, className: "preview-image", alt: "", style: {
853
+ width: '100%',
854
+ height: '100%',
855
+ objectFit: 'cover',
856
+ } }),
857
+ React__default["default"].createElement("img", { alt: "", className: "icon-close", src: index$3.IconCloseCircle, onClick: () => {
858
+ removeKeyError && removeKeyError('photos');
859
+ onRemoveImage(index);
860
+ } })));
861
+ })),
862
+ error && (error === null || error === void 0 ? void 0 : error.photos) && (React__default["default"].createElement(StyledError$1, null,
863
+ React__default["default"].createElement(index$2.Text, { size: "p5", color: miscTheme.theme.colors.red600 }, error.photos)))));
864
+ };
865
+
866
+ const inputModify$2 = (value, opts) => {
867
+ var _a;
868
+ const { formatUrl, bannedWords = [] } = opts || {};
869
+ const removedFormat = post.fixMalformedMention(post.removeFontFormat(value));
870
+ if (!formatUrl)
871
+ return {
872
+ value: post.highlightBadWords(removedFormat, bannedWords),
873
+ };
874
+ let descriptionWithWrappedAnchor = post.removeEdittedBannedWord(post.wrapAnchorAroundUrls(removedFormat));
875
+ const urls = post.getUrlsFromEditorString(removedFormat);
876
+ if (urls) {
877
+ const invalidUrls = [];
878
+ let previewUrl = '';
879
+ urls.forEach((url) => {
880
+ if (!url)
881
+ return;
882
+ try {
883
+ const jsUrl = new URL(url);
884
+ // Check url has must into domain hellohealthgroup
885
+ if (!post.ALLOW_DOMAIN_URL.some((o) => jsUrl.origin.endsWith(o))) {
886
+ invalidUrls.push('notification.limitUrlDomain');
887
+ return;
888
+ }
889
+ // Check url have special character
890
+ if (url.endsWith('&')) {
891
+ invalidUrls.push('notification.urlWrongFormat');
892
+ return;
893
+ }
894
+ }
895
+ catch (_a) {
896
+ invalidUrls.push(url);
897
+ }
898
+ });
899
+ if (invalidUrls.length > 0) {
900
+ descriptionWithWrappedAnchor = descriptionWithWrappedAnchor
901
+ .replace(new RegExp(`data-url="true">(${invalidUrls.map(post.escapeRegExp).join('|')})<`, 'gi'), 'data-error="true" data-url="true">$1<')
902
+ .replace(new RegExp(`data-href="(${invalidUrls
903
+ .map(post.escapeRegExp)
904
+ .join('|')})" data-url="true">`, 'gi'), 'data-href="$1" data-error="true" data-url="true">');
905
+ }
906
+ previewUrl = (_a = urls.filter((u) => invalidUrls.indexOf(u) === -1)) === null || _a === void 0 ? void 0 : _a[0];
907
+ return {
908
+ invalidUrls,
909
+ previewUrl,
910
+ value: post.highlightBadWords(descriptionWithWrappedAnchor, bannedWords),
911
+ };
912
+ }
913
+ return {
914
+ value: post.highlightBadWords(descriptionWithWrappedAnchor, bannedWords),
915
+ };
916
+ };
917
+ const usePreviewUrl = (bannedWords, onChange) => {
918
+ const { data: { locale }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
919
+ const [previewUrl, setPreviewUrl] = React.useState(null);
920
+ const bannedWordsRef = React.useRef([]);
921
+ bannedWordsRef.current = bannedWords;
922
+ const fetchPreviewData = (url) => {
923
+ if (!previewUrl || previewUrl.url !== url) {
924
+ setPreviewUrl === null || setPreviewUrl === void 0 ? void 0 : setPreviewUrl({
925
+ url,
926
+ isFetching: true,
927
+ });
928
+ togetherComponentGlobalContext.callApi(togetherComponentGlobalContext.getApiPath(togetherApiPaths.PATHS.FETCH_PREVIEW, {
929
+ _locale: locale,
930
+ }), 'POST', {
931
+ data: {
932
+ link: url,
933
+ },
934
+ headers: {
935
+ 'Content-Type': 'application/json',
936
+ },
937
+ })
938
+ .then((res) => {
939
+ var _a, _b, _c, _d;
940
+ setPreviewUrl === null || setPreviewUrl === void 0 ? void 0 : setPreviewUrl({
941
+ title: (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.title,
942
+ description: (_b = res === null || res === void 0 ? void 0 : res.data) === null || _b === void 0 ? void 0 : _b.description,
943
+ image: ((_c = res === null || res === void 0 ? void 0 : res.data) === null || _c === void 0 ? void 0 : _c.image) || ((_d = res === null || res === void 0 ? void 0 : res.data) === null || _d === void 0 ? void 0 : _d.logo),
944
+ url,
945
+ });
946
+ })
947
+ .catch(() => {
948
+ setPreviewUrl === null || setPreviewUrl === void 0 ? void 0 : setPreviewUrl(null);
949
+ });
950
+ }
951
+ };
952
+ const fetchPreviewDataRef = React.useRef(fetchPreviewData);
953
+ fetchPreviewDataRef.current = fetchPreviewData;
954
+ const [invalidUrls, setInvalidUrls] = React.useState([]);
955
+ const debounceInputModify = React.useCallback(debounce__default["default"]((v) => {
956
+ if (v) {
957
+ const processedInput = inputModify$2(v, {
958
+ bannedWords: bannedWordsRef.current,
959
+ formatUrl: true,
960
+ });
961
+ const { invalidUrls: _invalidUrls, previewUrl: _previewUrl, value, } = processedInput;
962
+ if (_invalidUrls && (_invalidUrls === null || _invalidUrls === void 0 ? void 0 : _invalidUrls.length)) {
963
+ setInvalidUrls(_invalidUrls);
964
+ setPreviewUrl === null || setPreviewUrl === void 0 ? void 0 : setPreviewUrl(null);
965
+ }
966
+ else {
967
+ setInvalidUrls([]);
968
+ if (_previewUrl) {
969
+ fetchPreviewDataRef.current(_previewUrl);
970
+ }
971
+ else
972
+ setPreviewUrl === null || setPreviewUrl === void 0 ? void 0 : setPreviewUrl(null);
973
+ if (value !== v) {
974
+ onChange === null || onChange === void 0 ? void 0 : onChange(value);
975
+ }
976
+ }
977
+ }
978
+ }, 500), []);
979
+ return {
980
+ previewUrl,
981
+ setPreviewUrl,
982
+ invalidUrls,
983
+ debounceInputModify,
984
+ fetchPreviewData,
985
+ };
986
+ };
987
+
988
+ const StyleReviewVideo = styled__default["default"].div `
989
+ .link-preview-wrapper {
990
+ position: relative;
991
+ .icon-close {
992
+ position: absolute;
993
+ top: 6px;
994
+ right: 6px;
995
+ cursor: pointer;
996
+ z-index: 10;
997
+ max-width: 24px;
998
+ max-height: 24px;
999
+ }
1000
+ }
1001
+ .mantine-Text-root {
1002
+ margin-bottom: 4px;
1003
+ }
1004
+ `;
1005
+
1006
+ const PostVideoReview = ({ socialLinkData, bannedWords, onChange, onInvalidUrlsChange, onSocialLinkChanged, }) => {
1007
+ const { t } = index.useTranslations();
1008
+ const { invalidUrls, previewUrl, fetchPreviewData, setPreviewUrl } = usePreviewUrl(bannedWords || [], onChange);
1009
+ React.useEffect(() => {
1010
+ if (socialLinkData && socialLinkData.url) {
1011
+ fetchPreviewData(socialLinkData.url);
1012
+ }
1013
+ }, [socialLinkData, fetchPreviewData]);
1014
+ React.useEffect(() => {
1015
+ if (invalidUrls) {
1016
+ onInvalidUrlsChange === null || onInvalidUrlsChange === void 0 ? void 0 : onInvalidUrlsChange(invalidUrls);
1017
+ }
1018
+ }, [invalidUrls]);
1019
+ return (React__default["default"].createElement(StyleReviewVideo, { className: "input-group" },
1020
+ React__default["default"].createElement(index$2.Text, { size: "p5", weight: "semiBold" }, t('createPost.video')),
1021
+ React__default["default"].createElement("div", { className: "link-preview-wrapper" }, (socialLinkData === null || socialLinkData === void 0 ? void 0 : socialLinkData.url) && previewUrl && (React__default["default"].createElement("div", { className: "link-preview-wrapper" }, previewUrl.isFetching ? (React__default["default"].createElement(index$6.Loading, null)) : (React__default["default"].createElement(React__default["default"].Fragment, null,
1022
+ React__default["default"].createElement(index$7.CardLink, { title: previewUrl.title, url: previewUrl.url || '#', image: previewUrl.image, noRefetch: true }),
1023
+ React__default["default"].createElement("img", { alt: "", src: index$3.IconCloseCircle, className: "icon-close", onClick: () => {
1024
+ setPreviewUrl(null);
1025
+ onSocialLinkChanged && onSocialLinkChanged(null);
1026
+ } }))))))));
1027
+ };
1028
+
1029
+ const MAX_SIZE_FILE_UPLOAD$1 = 10 * 1024 * 1024;
1030
+ const applySpecialCharSite$1 = [
1031
+ Locale.LOCALE.PhilippinesEnglish,
1032
+ Locale.LOCALE.PhilippinesTagalog,
1033
+ Locale.LOCALE.Indonesia,
1034
+ Locale.LOCALE.Malaysia,
1035
+ Locale.LOCALE.Vietnam,
1036
+ ];
1037
+ const CreateNewPostContent = ({ className, style, onPostCreatedEdited, onClose, communities = [], forceSelectCommunity, forceSelectTopics, articleId, optionalTopic, editPostData, defaultCommunity, defaultTopics, selectAskDoctor, showAskDoctorOptions, userInfo, isMarryBaby = false, }) => {
1038
+ const isInEditMode = !!(editPostData === null || editPostData === void 0 ? void 0 : editPostData.id);
1039
+ const { data: { locale, router, env: { togetherBasePath }, }, action: { pushNotifications, sanitizeFunction }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
1040
+ const { asPath } = router || {};
1041
+ const { t } = index.useTranslations();
1042
+ // const [isAnonymous, setIsAnonymous] = useState<boolean>(false)
1043
+ const [isAskDoctor, setIsAskDoctor] = React.useState(selectAskDoctor);
1044
+ const [specialCharErr, setspecialCharErr] = React.useState(false);
1045
+ const [isSubmitting, setIsSubmitting] = React.useState(false);
1046
+ const [titleValue, setTitleValue] = React.useState('');
1047
+ const [descriptionValue, setDescriptionValue] = React.useState('');
1048
+ const [communityValue, setCommunityValue] = React.useState(forceSelectCommunity
1049
+ ? {
1050
+ label: forceSelectCommunity.name,
1051
+ value: `${forceSelectCommunity.id || ''}-${forceSelectCommunity.mappedCategoryId || ''}`,
1052
+ }
1053
+ : {
1054
+ label: t('community.choose'),
1055
+ value: '',
1056
+ });
1057
+ const [selectedTopics, setSelectedTopics] = React.useState([...forceSelectTopics] || []);
1058
+ const [socialLinkData, setSocialLinkData] = React.useState();
1059
+ const [error, setError] = React.useState({});
1060
+ const [imageFiles, setImageFiles] = React.useState([]);
1061
+ const [bannedWords, setBannedWords] = React.useState([]);
1062
+ const [postActionValue, setPostActionValue] = React.useState({
1063
+ label: t('cardPost.public'),
1064
+ value: 'public',
1065
+ });
1066
+ const { imageSrcs = [] } = index$3.useImagePicker(imageFiles);
1067
+ const currentCommunity = forceSelectCommunity ||
1068
+ communities.find((c) => `${c.id || ''}-${c.mappedCategoryId || ''}` === communityValue.value);
1069
+ const communitiesList = forceSelectCommunity
1070
+ ? [forceSelectCommunity]
1071
+ : communities
1072
+ .filter((c) => c.isActive)
1073
+ .sort((a, b) => {
1074
+ if (a.name > b.name)
1075
+ return 1;
1076
+ if (a.name < b.name)
1077
+ return -1;
1078
+ return 0;
1079
+ });
1080
+ const [previewUrl, setPreviewUrl] = React.useState(null);
1081
+ const [invalidUrls, setInvalidUrls] = React.useState([]);
1082
+ const isReadyToSubmit = titleValue &&
1083
+ !specialCharErr &&
1084
+ innertext__default["default"](descriptionValue) &&
1085
+ (optionalTopic || (!optionalTopic && selectedTopics.length > 0)) &&
1086
+ currentCommunity &&
1087
+ (!imageFiles || imageFiles.length <= constants.MAX_IMAGE_UPLOADS) &&
1088
+ !(invalidUrls === null || invalidUrls === void 0 ? void 0 : invalidUrls.length) &&
1089
+ !isSubmitting;
1090
+ const postActionType = [
1091
+ {
1092
+ label: t('cardPost.public'),
1093
+ value: 'public',
1094
+ icon: (React__default["default"].createElement("img", { alt: "anonymous-icon", src: IconPublic, style: {
1095
+ width: '100%',
1096
+ height: '100%',
1097
+ objectFit: 'contain',
1098
+ marginLeft: 'auto',
1099
+ } })),
1100
+ },
1101
+ {
1102
+ label: t('cardPost.anonymous'),
1103
+ value: 'anonymous',
1104
+ icon: (React__default["default"].createElement("img", { alt: "anonymous-icon", src: IconAnonymous, style: {
1105
+ width: '100%',
1106
+ height: '100%',
1107
+ objectFit: 'contain',
1108
+ marginLeft: 'auto',
1109
+ } })),
1110
+ },
1111
+ ];
1112
+ // HANDLE etra action when OPEN AND CLOSE
1113
+ React.useEffect(() => {
1114
+ if (editPostData) {
1115
+ const post$1 = editPostData;
1116
+ setTitleValue(post$1.title || '');
1117
+ setDescriptionValue(post.decodeMention(post.decodePostUrl(post$1.description || '', 'edit'), post$1.mentions));
1118
+ setCommunityValue({
1119
+ label: post$1.community.name,
1120
+ value: `${post$1.community.id || ''}-${post$1.community.mappedCategoryId || ''}`,
1121
+ });
1122
+ setSelectedTopics(post$1.topics || []);
1123
+ setImageFiles(post$1.photos || []);
1124
+ // setIsAnonymous(!!post.isAnonymous || false)
1125
+ setIsAskDoctor(!!post$1.isAskDoctor || false);
1126
+ }
1127
+ else {
1128
+ if (defaultCommunity) {
1129
+ setCommunityValue({
1130
+ label: defaultCommunity.name,
1131
+ value: `${defaultCommunity.id || ''}-${defaultCommunity.mappedCategoryId || ''}`,
1132
+ });
1133
+ }
1134
+ if (defaultTopics) {
1135
+ setSelectedTopics(defaultTopics);
1136
+ }
1137
+ }
1138
+ }, []);
1139
+ React.useEffect(() => {
1140
+ setspecialCharErr(applySpecialCharSite$1.includes(locale) &&
1141
+ titleValue !== '' &&
1142
+ !/[a-zA-Z]/.test(titleValue));
1143
+ setError({});
1144
+ }, [titleValue]);
1145
+ const onCreateEditSuccess = (res) => {
1146
+ if (onPostCreatedEdited) {
1147
+ onPostCreatedEdited(dataTransform.formatPost(res), isInEditMode);
1148
+ }
1149
+ onClose && onClose();
1150
+ };
1151
+ const validationUploadPhoto = (files) => {
1152
+ const errorMessage = Object.assign({}, error);
1153
+ if (files && files.length > 10) {
1154
+ errorMessage.photos = t('createPost.message.photoMaxium');
1155
+ }
1156
+ if (files && files.length) {
1157
+ const inValidSizeFile = files.some((file) => (file === null || file === void 0 ? void 0 : file.size) > MAX_SIZE_FILE_UPLOAD$1);
1158
+ if (inValidSizeFile) {
1159
+ errorMessage.photos = t('createPost.message.photoSize');
1160
+ }
1161
+ }
1162
+ setError(errorMessage);
1163
+ };
1164
+ const validationPost = () => {
1165
+ let hasError = false;
1166
+ const errorMessage = {};
1167
+ const description = innertext__default["default"](descriptionValue);
1168
+ if (!description) {
1169
+ errorMessage.description = t('createPost.message.requiredDescription');
1170
+ hasError = true;
1171
+ }
1172
+ if (isInEditMode && !titleValue) {
1173
+ errorMessage.title = t('createPost.message.requiredTitle');
1174
+ hasError = true;
1175
+ }
1176
+ if (description && description.split(' ').length < 10) {
1177
+ errorMessage.description = t('createPost.message.lengthDescription');
1178
+ hasError = true;
1179
+ }
1180
+ if (showAskDoctorOptions &&
1181
+ !(errorMessage === null || errorMessage === void 0 ? void 0 : errorMessage.description) &&
1182
+ typeof isAskDoctor === 'undefined') {
1183
+ errorMessage.askDoctor = t('createPost.message.askDoctorRequireMess');
1184
+ hasError = true;
1185
+ }
1186
+ if (imageFiles && imageFiles.length > 10) {
1187
+ errorMessage.photos = t('createPost.message.photoMaxium');
1188
+ hasError = true;
1189
+ }
1190
+ if (imageFiles && imageFiles.length) {
1191
+ const inValidSizeFile = imageFiles.some((file) => (file === null || file === void 0 ? void 0 : file.size) > MAX_SIZE_FILE_UPLOAD$1);
1192
+ if (inValidSizeFile) {
1193
+ errorMessage.photos = t('createPost.message.photoSize');
1194
+ hasError = true;
1195
+ }
1196
+ }
1197
+ if (invalidUrls && invalidUrls.length) {
1198
+ errorMessage.video = 'Invalid video url';
1199
+ hasError = true;
1200
+ }
1201
+ setError(errorMessage);
1202
+ return hasError;
1203
+ };
1204
+ const removeKeyError = (deleteKey) => {
1205
+ if (error[deleteKey]) {
1206
+ const _a = Object.assign({}, error), _b = `${deleteKey}`, value = _a[_b], rest = tslib_es6.__rest(_a, [typeof _b === "symbol" ? _b : _b + ""]);
1207
+ setError(rest);
1208
+ console.log(value);
1209
+ }
1210
+ };
1211
+ const submitPost = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
1212
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1213
+ const isError = validationPost();
1214
+ if (isError)
1215
+ return;
1216
+ const bodyFormData = yield index$3.getPostFormData({
1217
+ title: titleValue,
1218
+ description: descriptionValue,
1219
+ communityId: String((currentCommunity === null || currentCommunity === void 0 ? void 0 : currentCommunity.id) || ''),
1220
+ imageFiles,
1221
+ previewUrl,
1222
+ topicIds: selectedTopics === null || selectedTopics === void 0 ? void 0 : selectedTopics.map((topic) => String(topic.id || '')).filter(Boolean),
1223
+ locale,
1224
+ sanitizeFunction,
1225
+ categoryCommunityId: String((currentCommunity === null || currentCommunity === void 0 ? void 0 : currentCommunity.mappedCategoryId) || ''),
1226
+ categoryTopicIds: selectedTopics === null || selectedTopics === void 0 ? void 0 : selectedTopics.map((topic) => String((topic === null || topic === void 0 ? void 0 : topic.mappedCategoryId) || '')).filter(Boolean),
1227
+ isAnonymous: (postActionValue === null || postActionValue === void 0 ? void 0 : postActionValue.value) === 'anonymous' ? 1 : 0,
1228
+ isAskDoctor: isAskDoctor ? 1 : 0,
1229
+ introUrl: (socialLinkData === null || socialLinkData === void 0 ? void 0 : socialLinkData.url) || '',
1230
+ });
1231
+ if (articleId) {
1232
+ bodyFormData.append('article_id', articleId);
1233
+ }
1234
+ let res;
1235
+ if (isInEditMode) {
1236
+ if (editPostData === null || editPostData === void 0 ? void 0 : editPostData.id) {
1237
+ res = yield index$3.editPost({
1238
+ id: editPostData.id,
1239
+ formData: bodyFormData,
1240
+ locale,
1241
+ });
1242
+ }
1243
+ }
1244
+ else {
1245
+ res = yield index$3.createPost({
1246
+ formData: bodyFormData,
1247
+ locale,
1248
+ isArticleComment: !(currentCommunity === null || currentCommunity === void 0 ? void 0 : currentCommunity.id) && !!(currentCommunity === null || currentCommunity === void 0 ? void 0 : currentCommunity.mappedCategoryId),
1249
+ });
1250
+ }
1251
+ const resData = res === null || res === void 0 ? void 0 : res.data;
1252
+ if ((resData === null || resData === void 0 ? void 0 : resData.id) && !((_b = (_a = res === null || res === void 0 ? void 0 : res.messages) === null || _a === void 0 ? void 0 : _a.moderation) === null || _b === void 0 ? void 0 : _b.type)) {
1253
+ pushNotifications({
1254
+ message: t('createPost.popup.success'),
1255
+ type: 'success',
1256
+ });
1257
+ onCreateEditSuccess(resData);
1258
+ }
1259
+ else {
1260
+ if (((_d = (_c = res === null || res === void 0 ? void 0 : res.messages) === null || _c === void 0 ? void 0 : _c.moderation) === null || _d === void 0 ? void 0 : _d.type) === 'banned') {
1261
+ pushNotifications({
1262
+ title: t('notification.post.blocked.title'),
1263
+ message: t('notification.post.blocked.message'),
1264
+ type: 'danger',
1265
+ });
1266
+ if (res.messages.moderation.words) {
1267
+ setBannedWords(res.messages.moderation.words);
1268
+ }
1269
+ }
1270
+ else if (((_f = (_e = res === null || res === void 0 ? void 0 : res.messages) === null || _e === void 0 ? void 0 : _e.moderation) === null || _f === void 0 ? void 0 : _f.type) === 'suspect') {
1271
+ pushNotifications({
1272
+ title: t('notification.post.suspect.title'),
1273
+ message: t('notification.post.suspect.message'),
1274
+ type: 'warning',
1275
+ });
1276
+ onClose && onClose();
1277
+ }
1278
+ else if ((_h = (_g = res === null || res === void 0 ? void 0 : res.messages) === null || _g === void 0 ? void 0 : _g.find) === null || _h === void 0 ? void 0 : _h.call(_g, (m) => { var _a; return !!((_a = m === null || m === void 0 ? void 0 : m.includes) === null || _a === void 0 ? void 0 : _a.call(m, 'suspend')); })) {
1279
+ pushNotifications({
1280
+ message: t('notification.suspend.message'),
1281
+ type: 'danger',
1282
+ });
1283
+ onClose && onClose();
1284
+ }
1285
+ else {
1286
+ pushNotifications({
1287
+ message: ((_j = res === null || res === void 0 ? void 0 : res.messages) === null || _j === void 0 ? void 0 : _j[0]) || t('notification.failure'),
1288
+ type: 'danger',
1289
+ });
1290
+ }
1291
+ }
1292
+ });
1293
+ return (React__default["default"].createElement(StyledCreateNewPost$1, { className: `${className} create-post-popup-frame`, style: style },
1294
+ React__default["default"].createElement("div", { className: "input-group-container" },
1295
+ React__default["default"].createElement(StyledFormGroupInner$1, null,
1296
+ React__default["default"].createElement("div", { className: "input-group" },
1297
+ React__default["default"].createElement(StylePostAction$1, null,
1298
+ React__default["default"].createElement("div", { className: "avatar" }, (userInfo === null || userInfo === void 0 ? void 0 : userInfo.avatar) ? (React__default["default"].createElement("img", { alt: "avatar-icon", src: userInfo === null || userInfo === void 0 ? void 0 : userInfo.avatar, style: {
1299
+ width: '100%',
1300
+ height: '100%',
1301
+ objectFit: 'contain',
1302
+ marginLeft: 'auto',
1303
+ } })) : (React__default["default"].createElement(togetherMoleculesCardAuthor.CardAuthor, { showDetailPopup: false, avatar: "", avatarProps: { size: 40 }, name: userInfo === null || userInfo === void 0 ? void 0 : userInfo.name, userId: userInfo === null || userInfo === void 0 ? void 0 : userInfo.userId, className: "author-avatar" }))),
1304
+ React__default["default"].createElement("div", { className: "post-action-form" },
1305
+ React__default["default"].createElement("div", { className: "post-action-by" }, (userInfo === null || userInfo === void 0 ? void 0 : userInfo.name) || ''),
1306
+ React__default["default"].createElement(index$8.Dropdown, { disabled: isInEditMode, options: postActionType, id: "post-action-type", size: "sm", className: "dropdown-post-action", placeholder: t('community.choose'), value: postActionValue, onChange: (option) => {
1307
+ setPostActionValue({
1308
+ label: option.label,
1309
+ value: String(option.value),
1310
+ });
1311
+ }, placeholderIcon: React__default["default"].createElement("div", { className: "post-action-result" }, postActionValue.value === 'public' ? (React__default["default"].createElement("img", { alt: "public-icon", src: IconPublic, style: {
1312
+ width: '100%',
1313
+ height: '100%',
1314
+ objectFit: 'contain',
1315
+ marginLeft: 'auto',
1316
+ } })) : (React__default["default"].createElement("img", { alt: "anonymous-icon", src: IconAnonymous, style: {
1317
+ width: '100%',
1318
+ height: '100%',
1319
+ objectFit: 'contain',
1320
+ marginLeft: 'auto',
1321
+ } }))), style: {
1322
+ zIndex: 10,
1323
+ width: 'calc(100% + 20px)',
1324
+ } })))),
1325
+ React__default["default"].createElement(CreatePostTitle$1, { className: "input-group", bannedWords: bannedWords, value: titleValue, onChange: setTitleValue }),
1326
+ specialCharErr && (React__default["default"].createElement(StyledError$1, null,
1327
+ React__default["default"].createElement(other.Info, { isSolid: true, color: miscTheme.theme.colors.red700, size: 14 }),
1328
+ React__default["default"].createElement(index$2.Text, { size: "p3", as: "span", color: miscTheme.theme.colors.red700 }, t('createPost.popup.specialCharErr')))),
1329
+ React__default["default"].createElement("div", { className: "input-group" },
1330
+ React__default["default"].createElement(CreatePostDescription$1, { bannedWords: bannedWords, value: descriptionValue, onChange: (v) => {
1331
+ setDescriptionValue(v);
1332
+ removeKeyError('description');
1333
+ }, onPreviewUrlChange: setPreviewUrl, onInvalidUrlsChange: setInvalidUrls, onImageFilesChange: setImageFiles, imageFiles: imageFiles, className: `${error && (error === null || error === void 0 ? void 0 : error.description) ? 'error-description' : ''} ${showAskDoctorOptions ? 'has-ask-doctor-option' : ''}`, footerEditor: React__default["default"].createElement(React__default["default"].Fragment, null,
1334
+ showAskDoctorOptions && (React__default["default"].createElement(StyledIsQuestion$1, { color: "", className: `${error && (error === null || error === void 0 ? void 0 : error.askDoctor) ? 'has-error' : ''} ${error && (error === null || error === void 0 ? void 0 : error.description) ? 'error-description' : ''}` },
1335
+ React__default["default"].createElement("div", { className: "switch-label" },
1336
+ React__default["default"].createElement(other.Ask, { size: isMarryBaby ? 32 : 24, isMarryBaby: isMarryBaby }),
1337
+ React__default["default"].createElement("div", { className: "wrapper-text" },
1338
+ React__default["default"].createElement("div", { className: "label-txt" }, t('createPost.askDoctor')),
1339
+ React__default["default"].createElement("div", { className: "description-txt" }, t('createPost.askDoctor.description')))),
1340
+ React__default["default"].createElement(index$9.BtnChoice, { value: isAskDoctor, choices: [
1341
+ {
1342
+ label: t('createPost.askDoctorChoice.yes'),
1343
+ value: true,
1344
+ dataEventCategory: 'Together',
1345
+ dataEventAction: 'Write Post Click - Ask Doctor',
1346
+ dataEventLabel: togetherComponentGlobalContext.getCurrentHref(locale, togetherBasePath, asPath),
1347
+ },
1348
+ {
1349
+ label: t('createPost.askDoctorChoice.no'),
1350
+ value: false,
1351
+ },
1352
+ ], onChange: (v) => {
1353
+ if (typeof v === 'boolean') {
1354
+ setIsAskDoctor(v);
1355
+ removeKeyError('askDoctor');
1356
+ }
1357
+ } }))),
1358
+ error && (error === null || error === void 0 ? void 0 : error.askDoctor) && (React__default["default"].createElement(StyledError$1, { style: { margin: '4px 0 0' } },
1359
+ React__default["default"].createElement(index$2.Text, { size: "p5", as: "span", color: miscTheme.theme.colors.red600 }, error.askDoctor))),
1360
+ error && (error === null || error === void 0 ? void 0 : error.description) && (React__default["default"].createElement(StyledError$1, { style: { margin: '4px 0 0' } },
1361
+ React__default["default"].createElement(index$2.Text, { size: "p5", as: "span", color: miscTheme.theme.colors.red600 }, error.description)))) })),
1362
+ imageSrcs.length > 0 && (React__default["default"].createElement(PostPhotosReview$1, { imageFiles: imageFiles, error: error, setImageFiles: setImageFiles, removeKeyError: removeKeyError })),
1363
+ socialLinkData && (React__default["default"].createElement(PostVideoReview, { bannedWords: bannedWords, socialLinkData: socialLinkData, onSocialLinkChanged: setSocialLinkData, onInvalidUrlsChange: setInvalidUrls, onChange: (v) => {
1364
+ setDescriptionValue(v);
1365
+ } })),
1366
+ React__default["default"].createElement(CreatePostCommunity$1, { communitiesList: communitiesList, currentCommunity: currentCommunity, selectedTopics: selectedTopics, forceTopics: forceSelectTopics, communityValue: communityValue, error: error, isFullscreen: false, isInEditMode: isInEditMode, setSelectedTopics: setSelectedTopics, setCommunityValue: setCommunityValue }),
1367
+ React__default["default"].createElement(CreatePostPhotos$1, { imageFiles: imageFiles, setImageFiles: (data) => {
1368
+ setImageFiles(data);
1369
+ validationUploadPhoto(data);
1370
+ } }),
1371
+ React__default["default"].createElement(CreatePostVideo, { socialLinkData: socialLinkData, setSocialLinkData: setSocialLinkData }))),
1372
+ React__default["default"].createElement("div", { className: "form-action" },
1373
+ React__default["default"].createElement("div", { className: "input-group" },
1374
+ React__default["default"].createElement(index$1.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: () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
1375
+ if (isReadyToSubmit && !isSubmitting) {
1376
+ setIsSubmitting(true);
1377
+ try {
1378
+ yield submitPost();
1379
+ }
1380
+ catch (e) {
1381
+ console.error(e);
1382
+ pushNotifications(index$3.getDefaultFailNoti(t));
1383
+ }
1384
+ setIsSubmitting(false);
1385
+ }
1386
+ }), disabled: !isReadyToSubmit, loading: isSubmitting }, t('createPost.popup.submit'))))));
1387
+ };
1388
+
1389
+ const StyleContainer$2 = styled__default["default"].div ``;
1390
+ const StyleContentWrapper$1 = styled__default["default"].div `
1391
+ display: flex;
1392
+ flex-direction: column;
1393
+ gap: 16px;
1394
+
1395
+ .mantine-TopicSelectList-root {
1396
+ padding: 0;
1397
+ }
1398
+
1399
+ .mantine-TopicSelectList-list {
1400
+ gap: 12px;
1401
+ }
1402
+
1403
+ .tag-list {
1404
+ margin: 0;
1405
+ }
1406
+ `;
1407
+ const StyleWrapperButton$1 = styled__default["default"].div `
1408
+ display: flex;
1409
+ flex-direction: column;
1410
+ gap: 8px;
1411
+ .other-btn-community {
1412
+ color: ${miscTheme.theme.colors.gray400};
1413
+ font-size: 16px;
1414
+ font-weight: 600;
1415
+ line-height: 24px;
1416
+ cursor: pointer;
1417
+ }
1418
+ `;
1419
+
1420
+ const StyledTopicSelectList$1 = styled__default["default"].div `
1421
+ display: flex;
1422
+ width: 100%;
1423
+ flex-wrap: wrap;
1424
+ margin-top: 1rem;
1425
+ gap: 12px;
1426
+
1427
+ .tag-item {
1428
+ min-height: 32px;
1429
+ padding: 5px 12px;
1430
+ border: 1px solid ${miscTheme.theme.colors.neutral100};
1431
+ border-radius: 1rem;
1432
+ color: ${miscTheme.theme.colors.gray800};
1433
+ cursor: pointer;
1434
+ font-size: 13px;
1435
+ line-height: 22px;
1436
+ transition: all 0.2s;
1437
+
1438
+ &.--active {
1439
+ border-color: ${miscTheme.theme.colors.primary50};
1440
+ background: ${miscTheme.theme.colors.primary50};
1441
+ color: ${miscTheme.theme.colors.primaryBase};
1442
+ }
1443
+ &[data-disabled='true'] {
1444
+ background: ${miscTheme.theme.colors.gray100};
1445
+ color: ${miscTheme.theme.colors.gray800};
1446
+ }
1447
+ }
1448
+ .topic-spinner {
1449
+ margin-right: auto;
1450
+ margin-left: auto;
1451
+ & > button {
1452
+ width: 24px;
1453
+ height: 24px;
1454
+ }
1455
+ }
1456
+ &[data-is-marrybaby='true'] {
1457
+ .tag-item {
1458
+ border-color: transparent;
1459
+ background: #f3f3f3;
1460
+ color: #3e3f58;
1461
+ &.--active {
1462
+ border-color: #b6cdff;
1463
+ background: #e0e9fb;
1464
+ color: #3e3f58;
1465
+ }
1466
+ }
1467
+ }
1468
+ `;
1469
+
1470
+ const TopicSelectList$1 = ({ className, style, topics: topicsProp, communityId, onChange, isLoading, disabled, forceTopics, selectedTopics: selectedTopicsProp, noFetch, dataEventCategory, dataEventAction, dataEventLabel, }) => {
1471
+ const { data: { locale, env: { isMarryBaby }, }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
1472
+ const [topics, setTopics] = React.useState(topicsProp ? [...topicsProp] : []);
1473
+ const [selectedTopics, setSelectedTopics] = React.useState(selectedTopicsProp ? [...selectedTopicsProp] : []);
1474
+ const [isLoadingTopics, setIsLoadingTopics] = React.useState(false);
1475
+ const topicsPropRef = React.useRef(topicsProp);
1476
+ topicsPropRef.current = topicsProp;
1477
+ React.useEffect(() => {
1478
+ var _a;
1479
+ if (communityId && !noFetch && !((_a = topicsPropRef.current) === null || _a === void 0 ? void 0 : _a.length)) {
1480
+ setTopics([]);
1481
+ setIsLoadingTopics(true);
1482
+ (() => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
1483
+ var _b;
1484
+ try {
1485
+ const res = yield togetherComponentGlobalContext.callApi(togetherComponentGlobalContext.getApiPath(togetherApiPaths.PATHS.TOPIC.LIST, {
1486
+ communityId: communityId,
1487
+ _locale: locale,
1488
+ }), 'GET');
1489
+ const topicRes = (_b = res === null || res === void 0 ? void 0 : res.data) === null || _b === void 0 ? void 0 : _b.topics;
1490
+ if (Array.isArray(topicRes)) {
1491
+ setTopics(() => (topicRes === null || topicRes === void 0 ? void 0 : topicRes.map(dataTransform.formatTopic).sort((t1, t2) => (t1.order || 0) - (t2.order || 0))) || []);
1492
+ }
1493
+ }
1494
+ catch (e) {
1495
+ console.log(e);
1496
+ setIsLoadingTopics(false);
1497
+ }
1498
+ setIsLoadingTopics(false);
1499
+ }))();
1500
+ }
1501
+ }, [communityId, noFetch]);
1502
+ const topicsPropString = topicsProp === null || topicsProp === void 0 ? void 0 : topicsProp.map((t) => t.id).join('-');
1503
+ const topicsStateString = topics === null || topics === void 0 ? void 0 : topics.map((t) => t.id).join('-');
1504
+ const forceTopicsPropString = forceTopics === null || forceTopics === void 0 ? void 0 : forceTopics.map((t) => t.id).join('-');
1505
+ React.useEffect(() => {
1506
+ if (topicsProp &&
1507
+ typeof topicsPropString !== 'undefined' &&
1508
+ topicsPropString !== topicsStateString) {
1509
+ setTopics(topicsProp);
1510
+ }
1511
+ }, [topicsProp, topicsPropString, topicsStateString]);
1512
+ const topicsWithoutForced = React.useMemo(() => topics.filter((t) => !(forceTopics === null || forceTopics === void 0 ? void 0 : forceTopics.some((ft) => (ft.id && ft.id === t.id) ||
1513
+ (ft.mappedCategoryId &&
1514
+ ft.mappedCategoryId === t.mappedCategoryId)))), [topicsStateString, forceTopicsPropString]);
1515
+ return (React__default["default"].createElement(StyledTopicSelectList$1, { "data-is-marrybaby": isMarryBaby, className: className, style: style },
1516
+ forceTopics.map((topic) => (React__default["default"].createElement(TopicItem$1, { key: `${topic.id}-${topic.mappedCategoryId}`, topic: topic, disabled: true, selected: true, dataEventAction: dataEventAction, dataEventCategory: dataEventCategory, dataEventLabel: dataEventLabel }))),
1517
+ topicsWithoutForced.map((topic) => (React__default["default"].createElement(TopicItem$1, { key: `${topic.id}-${topic.mappedCategoryId}`, topic: topic, disabled: disabled, selected: (selectedTopicsProp || selectedTopics).some((t) => (t.id && t.id === topic.id) ||
1518
+ (t.mappedCategoryId &&
1519
+ t.mappedCategoryId === topic.mappedCategoryId)), onClick: () => {
1520
+ const _selected = selectedTopicsProp || selectedTopics;
1521
+ const foundIndex = _selected.findIndex((_selected) => (_selected.id && _selected.id === topic.id) ||
1522
+ (_selected.mappedCategoryId &&
1523
+ _selected.mappedCategoryId === topic.mappedCategoryId));
1524
+ if (foundIndex !== -1) {
1525
+ _selected.splice(foundIndex, 1);
1526
+ }
1527
+ else {
1528
+ _selected.push(topic);
1529
+ }
1530
+ if (onChange && selectedTopicsProp) {
1531
+ onChange(_selected.slice());
1532
+ }
1533
+ else {
1534
+ onChange && onChange(_selected.slice());
1535
+ setSelectedTopics(_selected.slice());
1536
+ }
1537
+ }, dataEventAction: dataEventAction, dataEventCategory: dataEventCategory, dataEventLabel: dataEventLabel }))),
1538
+ (isLoading || isLoadingTopics) && React__default["default"].createElement(togetherMoleculesCardAuthor.Loading, { className: "topic-spinner" })));
1539
+ };
1540
+ const TopicItem$1 = (_a) => {
1541
+ var { topic, disabled, selected, onClick } = _a, rest = tslib_es6.__rest(_a, ["topic", "disabled", "selected", "onClick"]);
1542
+ return (React__default["default"].createElement("div", Object.assign({ className: 'tag-item' + (selected ? ' --active' : ''), "data-disabled": disabled, onClick: !disabled ? onClick : undefined }, rest), topic.name));
1543
+ };
1544
+
1545
+ const StyleContainer$1 = styled__default["default"].div `
1546
+ border-radius: 8px;
1547
+ border: 1px solid ${miscTheme.theme.colors.neutral100};
1548
+ background: ${miscTheme.theme.colors.white};
1549
+ border: 1px solid ${miscTheme.theme.colors.neutral100};
1550
+ .card-header {
1551
+ padding: 12px 16px;
1552
+ color: ${miscTheme.theme.colors.gray800};
1553
+ font-size: 14px;
1554
+ font-weight: 600;
1555
+ line-height: 22px;
1556
+ border-bottom: 1px solid ${miscTheme.theme.colors.neutral100};
1557
+ background: ${miscTheme.theme.colors.neutral50};
1558
+ border-radius: 8px 8px 0px 0px;
1559
+ }
1560
+ .card-body {
1561
+ padding: 16px;
1562
+ }
1563
+ `;
1564
+
1565
+ const CardPostCommunity = ({ title, children }) => {
1566
+ return (React__default["default"].createElement(StyleContainer$1, null,
1567
+ React__default["default"].createElement("div", { className: "card-header" }, title),
1568
+ React__default["default"].createElement("div", { className: "card-body" }, children)));
1569
+ };
1570
+
1571
+ const CommonCommunity = ({ communitiesList, communityValue, selectedTopics, defaultCommunity, isInEditMode, setCommunityValue, setSelectedTopics, onSubmitPost, }) => {
1572
+ const { t } = index.useTranslations();
1573
+ React.useEffect(() => {
1574
+ if (defaultCommunity && !isInEditMode) {
1575
+ setCommunityValue({
1576
+ label: defaultCommunity.name,
1577
+ value: defaultCommunity.id,
1578
+ });
1579
+ }
1580
+ }, [defaultCommunity, isInEditMode]);
1581
+ return (React__default["default"].createElement(StyleContainer$2, null,
1582
+ React__default["default"].createElement(StyleContentWrapper$1, null,
1583
+ React__default["default"].createElement(CardPostCommunity, { title: t('admin.community') },
1584
+ React__default["default"].createElement(index$8.Dropdown, { options: (communitiesList === null || communitiesList === void 0 ? void 0 : communitiesList.map((c) => ({
1585
+ label: c.name,
1586
+ value: c.id || '',
1587
+ }))) || [], id: "community-picker", disabled: isInEditMode, value: communityValue, placeholder: t('community.choose'), onChange: (option) => {
1588
+ setCommunityValue({
1589
+ label: option.label,
1590
+ value: String(option.value),
1591
+ });
1592
+ setSelectedTopics([]);
1593
+ }, style: {
1594
+ zIndex: 1,
1595
+ } })),
1596
+ React__default["default"].createElement(CardPostCommunity, { title: t('tab.topic') }, communityValue.value ? (React__default["default"].createElement(TopicSelectList$1, { className: "tag-list", communityId: Number(communityValue.value), onChange: (topics) => setSelectedTopics(topics), selectedTopics: selectedTopics, forceTopics: [] })) : (React__default["default"].createElement("div", { style: { height: '30px' } }))),
1597
+ React__default["default"].createElement(StyleWrapperButton$1, null,
1598
+ React__default["default"].createElement(index$1.Button, { className: "submit-btn", size: "lg", "data-event-category": "Ask Doctor", "data-event-action": "Submit Question", "data-event-label": window.location.href, "data-testid": "Button Post", disabled: !communityValue.value, onClick: () => onSubmitPost() }, t('createPost.popup.submit'))))));
1599
+ };
1600
+
1601
+ styled__default["default"].div `
1602
+ display: flex;
1603
+ flex-direction: column;
1604
+ gap: 8px;
1605
+ margin-top: 8px;
1606
+
1607
+ .topic-review {
1608
+ display: flex;
1609
+ gap: 4px;
1610
+ flex-wrap: wrap;
1611
+ }
1612
+
1613
+ .community-review {
1614
+ .tag-item {
1615
+ background-color: ${miscTheme.theme.colors.neutral50};
1616
+
1617
+ img {
1618
+ border-radius: 50%;
1619
+ margin-right: 8px;
1620
+ }
1621
+ }
1622
+ }
1623
+ `;
1624
+ const StyleDrawer = styled__default["default"].div `
1625
+ background-color: white;
1626
+ z-index: 1000;
1627
+ top: 0;
1628
+ left: 0;
1629
+ height: 100%;
1630
+ position: absolute;
1631
+ width: 100%;
1632
+
1633
+ .drawer-header {
1634
+ display: flex;
1635
+ gap: 12px;
1636
+ align-items: center;
1637
+ padding: 12px 16px;
1638
+ border-bottom: 1px solid ${miscTheme.theme.colors.gray200};
1639
+
1640
+ img {
1641
+ cursor: pointer;
1642
+ }
1643
+
1644
+ p {
1645
+ flex: 1;
1646
+ }
1647
+ }
1648
+
1649
+ .drawer-content {
1650
+ padding: 24px;
1651
+ display: flex;
1652
+ flex-direction: column;
1653
+ gap: 16px;
1654
+ overflow-y: auto;
1655
+ height: calc(100% - 49px);
1656
+
1657
+ ${utils.MediaQueries.mbDown} {
1658
+ padding: 16px;
1659
+ &.drawer-content-adjust {
1660
+ justify-content: center;
1661
+ }
1662
+ }
1663
+
1664
+ .input-field-label {
1665
+ margin-bottom: 8px;
1666
+ }
1667
+
1668
+ &.drawer-content-full-screen {
1669
+ max-width: 680px;
1670
+ margin: 0 auto;
1671
+ padding: 16px 24px;
1672
+ }
1673
+ }
1674
+ `;
1675
+
1676
+ const StyleContainer = styled__default["default"].div `
1677
+ display: flex;
1678
+ flex-direction: column;
1679
+ gap: 32px;
1680
+ `;
1681
+ const StyleSearchWrapper = styled__default["default"].div `
1682
+ display: flex;
1683
+ flex-direction: column;
1684
+ justify-content: center;
1685
+ gap: 24px;
1686
+ align-items: center;
1687
+ max-width: 400px;
1688
+ margin: 0 auto;
1689
+ .search-description {
1690
+ text-align: center;
1691
+ font-size: 16px;
1692
+ font-weight: 600;
1693
+ line-height: 24px;
1694
+ background: linear-gradient(92deg, #45a4ff 16.17%, #00c076 98.95%);
1695
+ background-clip: text;
1696
+ -webkit-background-clip: text;
1697
+ -webkit-text-fill-color: transparent;
1698
+ }
1699
+ .result-search-description {
1700
+ color: ${miscTheme.theme.colors.gray800};
1701
+ font-size: 16px;
1702
+ font-weight: 400;
1703
+ line-height: 24px;
1704
+ text-align: center;
1705
+ }
1706
+ `;
1707
+ const StyleContentWrapper = styled__default["default"].div `
1708
+ display: flex;
1709
+ flex-direction: column;
1710
+ gap: 16px;
1711
+
1712
+ .tag-item-review {
1713
+ display: flex;
1714
+ align-items: center;
1715
+ gap: 12px;
1716
+
1717
+ .tag-item-label {
1718
+ flex: 1;
1719
+ color: ${miscTheme.theme.colors.gray800};
1720
+ font-size: 16px;
1721
+ font-weight: 400;
1722
+ line-height: 24px;
1723
+ }
1724
+ }
1725
+ .topic-item-review-wrapper {
1726
+ display: flex;
1727
+ gap: 12px;
1728
+ flex-wrap: wrap;
1729
+ }
1730
+ .topic-item-review {
1731
+ border-radius: 40px;
1732
+ background: ${miscTheme.theme.colors.blue50};
1733
+ padding: 6px 12px;
1734
+ }
1735
+ `;
1736
+ const StyleWrapperButton = styled__default["default"].div `
1737
+ display: flex;
1738
+ flex-direction: column;
1739
+ gap: 8px;
1740
+ .other-btn-community {
1741
+ color: ${miscTheme.theme.colors.gray400};
1742
+ font-size: 16px;
1743
+ font-weight: 600;
1744
+ line-height: 24px;
1745
+ cursor: pointer;
1746
+ }
1747
+ `;
1748
+
1749
+ var img$1 = "data:image/svg+xml,%3csvg width='268' height='268' viewBox='0 0 268 268' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cg filter='url(%23filter0_f_270_203608)'%3e%3ccircle cx='134.175' cy='134.174' r='99.1225' fill='url(%23paint0_linear_270_203608)'/%3e%3c/g%3e%3cpath d='M143.63 122.941C143.884 121.934 145.315 121.934 145.569 122.941L146.243 125.609C147.585 130.925 151.907 134.969 157.301 135.954L158.295 136.136C159.389 136.336 159.389 137.903 158.295 138.103L157.301 138.285C151.907 139.271 147.585 143.314 146.243 148.631L145.569 151.299C145.315 152.306 143.884 152.306 143.63 151.299L142.956 148.631C141.614 143.314 137.292 139.271 131.899 138.285L130.904 138.103C129.81 137.904 129.81 136.336 130.904 136.136L131.899 135.954C137.292 134.969 141.614 130.925 142.956 125.609L143.63 122.941Z' fill='url(%23paint1_linear_270_203608)'/%3e%3cpath d='M134.365 89.0399C134.461 88.2144 135.659 88.2144 135.755 89.04L135.958 90.7817C136.317 93.8718 138.673 96.3541 141.74 96.8746L143.713 97.2094C144.49 97.3413 144.49 98.4578 143.713 98.5897L141.74 98.9246C138.673 99.4451 136.317 101.927 135.958 105.017L135.755 106.759C135.659 107.585 134.461 107.585 134.365 106.759L134.162 105.017C133.803 101.927 131.447 99.4451 128.38 98.9246L126.407 98.5897C125.629 98.4578 125.629 97.3413 126.407 97.2094L128.38 96.8746C131.447 96.3541 133.803 93.8718 134.162 90.7816L134.365 89.0399Z' fill='url(%23paint2_linear_270_203608)'/%3e%3cdefs%3e%3cfilter id='filter0_f_270_203608' x='0.782799' y='0.781822' width='266.784' height='266.785' filterUnits='userSpaceOnUse' color-interpolation-filters='sRGB'%3e%3cfeFlood flood-opacity='0' result='BackgroundImageFix'/%3e%3cfeBlend mode='normal' in='SourceGraphic' in2='BackgroundImageFix' result='shape'/%3e%3cfeGaussianBlur stdDeviation='17.135' result='effect1_foregroundBlur_270_203608'/%3e%3c/filter%3e%3clinearGradient id='paint0_linear_270_203608' x1='55.5444' y1='48.7129' x2='193.903' y2='233.297' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='%23A7D2FF'/%3e%3cstop offset='1' stop-color='%2376EE9A' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint1_linear_270_203608' x1='144.6' y1='118.518' x2='144.6' y2='155.721' gradientUnits='userSpaceOnUse'%3e%3cstop offset='0.26' stop-color='%2378B0F6'/%3e%3cstop offset='1' stop-color='%2376F197'/%3e%3c/linearGradient%3e%3clinearGradient id='paint2_linear_270_203608' x1='135.06' y1='82.5809' x2='135.06' y2='113.218' gradientUnits='userSpaceOnUse'%3e%3cstop offset='0.26' stop-color='%2378B0F6'/%3e%3cstop offset='1' stop-color='%2376F197'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e";
1750
+ var IconSuggestSearch = img$1;
1751
+
1752
+ const SuggestedCommunity = ({ currentCommunity, selectedTopics, isLoading, clickOtherCommunity, onSubmitPost, }) => {
1753
+ const { t } = index.useTranslations();
1754
+ return (React__default["default"].createElement(StyleContainer, null,
1755
+ isLoading || !currentCommunity ? (React__default["default"].createElement(StyleSearchWrapper, null,
1756
+ React__default["default"].createElement("img", { alt: "anonymous-icon", src: IconSuggestSearch, style: {
1757
+ width: '212px',
1758
+ height: '212px',
1759
+ objectFit: 'contain',
1760
+ } }),
1761
+ isLoading ? (React__default["default"].createElement("div", { className: "search-description" },
1762
+ t('createPost.message.suggestLoading'),
1763
+ "...")) : (React__default["default"].createElement("div", { className: "result-search-description" }, t('createPost.message.suggestResult'))))) : (React__default["default"].createElement(StyleContentWrapper, null,
1764
+ React__default["default"].createElement(CardPostCommunity, { title: t('admin.community') },
1765
+ React__default["default"].createElement(React__default["default"].Fragment, null, currentCommunity && (React__default["default"].createElement("div", { className: "tag-item-review" },
1766
+ React__default["default"].createElement("img", { alt: "community-thumbnail", src: currentCommunity.thumbnail, style: {
1767
+ width: '40px',
1768
+ height: '40px',
1769
+ objectFit: 'contain',
1770
+ marginLeft: 'auto',
1771
+ flex: '0 0 40px',
1772
+ } }),
1773
+ React__default["default"].createElement(index$2.Text, { size: "p4", as: "span", color: "inherit", className: "tag-item-label" }, currentCommunity.name))))),
1774
+ selectedTopics.length > 0 && (React__default["default"].createElement(CardPostCommunity, { title: t('tab.topic') },
1775
+ React__default["default"].createElement("div", { className: "topic-item-review-wrapper" }, selectedTopics.map((item, index) => (React__default["default"].createElement("div", { className: "topic-item-review", key: index },
1776
+ React__default["default"].createElement(index$2.Text, { size: "p4", as: "span", color: "inherit", className: "tag-item-label" }, item.name))))))))),
1777
+ !isLoading && (React__default["default"].createElement(StyleWrapperButton, null,
1778
+ React__default["default"].createElement(index$1.Button, { className: "submit-btn", size: "lg", "data-testid": "Button Post", "data-event-category": "Ask Doctor", "data-event-action": "Submit Question", "data-event-label": window.location.href, onClick: () => onSubmitPost(!currentCommunity) }, t('createPost.now')),
1779
+ React__default["default"].createElement(index$1.Button, { variant: "ghost", className: "other-btn-community", type: "button", onClick: clickOtherCommunity }, currentCommunity
1780
+ ? t('choose.other.community')
1781
+ : t('choose.community'))))));
1782
+ };
1783
+
1784
+ const CreatePostCommunity = ({ communitiesList, currentCommunity, selectedTopics, communityValue, isInEditMode, isLoadingSuggest, defaultCommunity, isMarryBaby = false, setSelectedTopics, setCommunityValue, onSubmitPost, setStepPost, }) => {
1785
+ const { t, locale } = index.useTranslations();
1786
+ const [typeSelectionCommunity, setTypeSelectionCommunity] = React.useState('chatbot');
1787
+ const clickOtherCommunity = () => {
1788
+ setTypeSelectionCommunity('manual');
1789
+ setCommunityValue({
1790
+ label: t('community.choose'),
1791
+ value: '',
1792
+ });
1793
+ setSelectedTopics([]);
1794
+ };
1795
+ return ReactDOM__namespace.createPortal(React__default["default"].createElement(StyleDrawer, null,
1796
+ React__default["default"].createElement("div", { className: "drawer-header" },
1797
+ React__default["default"].createElement("img", { alt: "public-icon", src: togetherMoleculesPostImagePreview.IconArrowLeft, onClick: () => setStepPost && setStepPost('step_info'), style: {
1798
+ width: '24px',
1799
+ height: '24px',
1800
+ objectFit: 'contain',
1801
+ marginLeft: 'auto',
1802
+ } }),
1803
+ React__default["default"].createElement(index$2.Text, { size: "p3", className: "input-group-label", weight: "semiBold" }, t('createPost.communityAndTopic'))),
1804
+ React__default["default"].createElement("div", { className: `drawer-content` }, !isInEditMode &&
1805
+ typeSelectionCommunity === 'chatbot' &&
1806
+ locale === Locale.LOCALE.Vietnam &&
1807
+ !isMarryBaby ? (React__default["default"].createElement(SuggestedCommunity, { selectedTopics: selectedTopics, currentCommunity: currentCommunity, isLoading: isLoadingSuggest, clickOtherCommunity: clickOtherCommunity, onSubmitPost: onSubmitPost })) : (React__default["default"].createElement(CommonCommunity, { communitiesList: communitiesList, communityValue: communityValue, selectedTopics: selectedTopics, isInEditMode: isInEditMode, defaultCommunity: defaultCommunity, setCommunityValue: setCommunityValue, setSelectedTopics: setSelectedTopics, onSubmitPost: onSubmitPost })))), document.querySelector('.create-post-popup-frame') || document.body);
1808
+ };
1809
+
1810
+ const StyledCreatePostDescription = styled__default["default"].div `
1811
+ input:focus,
1812
+ textarea:focus,
1813
+ [contenteditable='true'] {
1814
+ outline: none;
1815
+ }
1816
+
1817
+ &.has-ask-doctor-option {
1818
+ .textarea-control {
1819
+ border-bottom: none;
1820
+ border-radius: 4px 4px 0 0;
1821
+ }
1822
+ }
1823
+
1824
+ &.error-description {
1825
+ .textarea-control {
1826
+ border: 1px solid ${miscTheme.theme.colors.red600};
1827
+ border-bottom: none;
1828
+ }
1829
+ }
1830
+
1831
+ .textarea-control {
1832
+ position: relative;
1833
+ border: 1px solid ${miscTheme.theme.colors.gray200};
1834
+ border-bottom: none;
1835
+ border-radius: 8px 8px 0 0;
1836
+ &.--focus {
1837
+ border-color: ${miscTheme.theme.colors.primaryBase};
1838
+ box-shadow: 0px 0px 2px 2px ${miscTheme.theme.colors.primary200};
1839
+ }
1840
+
1841
+ .textarea-wrapper {
1842
+ width: 100%;
1843
+ min-height: 268px;
1844
+ height: auto;
1845
+ }
1846
+
1847
+ .control-tool {
1848
+ position: absolute;
1849
+ bottom: 0;
1850
+ left: 0;
1851
+ display: flex;
1852
+ width: calc(100% - 2rem);
1853
+ height: 40px;
1854
+ align-items: center;
1855
+ justify-content: flex-end;
1856
+ border-top: 1px solid ${miscTheme.theme.colors.gray200};
1857
+ margin: 0 1rem;
1858
+
1859
+ .tool-button {
1860
+ display: flex;
1861
+ width: 2rem;
1862
+ height: 2rem;
1863
+ align-items: center;
1864
+ justify-content: center;
1865
+ background: transparent;
1866
+ cursor: pointer;
1867
+ }
1868
+ .image-icon {
1869
+ vertical-align: middle;
1870
+ }
1871
+ }
1872
+ }
1873
+
1874
+ .link-preview-wrapper {
1875
+ position: relative;
1876
+ .icon-close {
1877
+ position: absolute;
1878
+ top: 5px;
1879
+ right: 5px;
1880
+ width: 24px;
1881
+ height: 24px;
1882
+ cursor: pointer;
1883
+ }
1884
+ }
1885
+
1886
+ .image-gallery {
1887
+ margin-bottom: 1rem;
1888
+
1889
+ .image-item {
1890
+ position: relative;
1891
+ overflow: hidden;
1892
+ width: 100%;
1893
+ height: 0;
1894
+ padding-top: 67%;
1895
+ margin-top: 1rem;
1896
+ border-radius: ${miscTheme.theme.borderRadius};
1897
+
1898
+ & > img {
1899
+ position: absolute;
1900
+ top: 0;
1901
+ left: 0;
1902
+ width: 100%;
1903
+ height: 100%;
1904
+ object-fit: cover;
1905
+ }
1906
+
1907
+ .close-btn {
1908
+ position: absolute;
1909
+ top: 8px;
1910
+ right: 8px;
1911
+ left: unset;
1912
+ width: 24px;
1913
+ height: 24px;
1914
+ cursor: pointer;
1915
+ }
1916
+ }
1917
+ }
1918
+
1919
+ .description-label {
1920
+ margin-bottom: 5px;
1921
+ color: ${miscTheme.theme.colors.gray600};
1922
+ /* font-family: 'Open Sans', sans-serif; */
1923
+ font-size: 13px;
1924
+ font-weight: bold;
1925
+ }
1926
+
1927
+ .count-string {
1928
+ margin-top: 5px;
1929
+ color: ${miscTheme.theme.colors.gray500};
1930
+ font-size: 11px;
1931
+ text-align: right;
1932
+ }
1933
+
1934
+ .input-notification {
1935
+ display: flex;
1936
+
1937
+ & > img {
1938
+ width: 16px;
1939
+ height: 16px;
1940
+ margin-top: 1.5px;
1941
+ margin-right: 8px;
1942
+ }
1943
+ }
1944
+ `;
1945
+ const StyledEditorContainer = styled__default["default"].div `
1946
+ height: 100%;
1947
+ position: relative;
1948
+ width: 100%;
1949
+ display: flex;
1950
+ flex-direction: column;
1951
+ .ql-toolbar.ql-snow {
1952
+ top: 0;
1953
+ width: 100%;
1954
+ // position: sticky;
1955
+ z-index: 3;
1956
+ border: none;
1957
+ border-bottom: 1px solid #ccc;
1958
+ border-radius: 8px 8px 0 0;
1959
+ background: white;
1960
+ .ql-formats {
1961
+ display: inline-flex;
1962
+ align-items: center;
1963
+ margin-right: 0.5rem;
1964
+ .link-tool-wrapper {
1965
+ .popover-menu__content {
1966
+ padding: 0.5rem;
1967
+ transform: translateX(calc(-50% - 1rem));
1968
+ max-width: calc(100vw - 4rem);
1969
+ ::before {
1970
+ right: calc(50% - 8px);
1971
+ }
1972
+ .link-tool-popover {
1973
+ input {
1974
+ padding-left: 1rem;
1975
+ }
1976
+ .link-input-url {
1977
+ margin-bottom: 0.5rem;
1978
+ }
1979
+ .link-input-text {
1980
+ margin-bottom: 0.5rem;
1981
+ }
1982
+ label {
1983
+ display: inline-block;
1984
+ margin-bottom: 0.2rem;
1985
+ }
1986
+ .link-input-button-wrapper {
1987
+ &[data-is-marrybaby='true'] {
1988
+ .link-input-button {
1989
+ border: solid 2px ${miscTheme.theme.mbColors.pink};
1990
+ background-color: ${miscTheme.theme.mbColors.pink};
1991
+ &:hover:not(:disabled) {
1992
+ border: solid 2px ${miscTheme.theme.mbColors.pink};
1993
+ background-color: ${miscTheme.theme.colors.white};
1994
+ color: ${miscTheme.theme.mbColors.pink};
1995
+ }
1996
+ }
1997
+ }
1998
+ }
1999
+ .link-input-button {
2000
+ width: auto;
2001
+ height: auto;
2002
+ padding: 0.4rem 1rem;
2003
+ background-color: ${miscTheme.theme.colors.primaryBase};
2004
+
2005
+ &:disabled {
2006
+ border-color: #bfbfbf;
2007
+ background-color: #bfbfbf;
2008
+ color: #fff;
2009
+ cursor: not-allowed;
2010
+ }
2011
+ &:hover:not(:disabled) {
2012
+ background-color: ${miscTheme.theme.colors.primaryHover};
2013
+ }
2014
+ }
2015
+ .error-text {
2016
+ padding: 0;
2017
+ margin-bottom: 0.5rem;
2018
+ font-weight: 600;
2019
+ color: ${miscTheme.theme.colors.red700};
2020
+ }
2021
+ }
2022
+ }
2023
+ }
2024
+ }
2025
+ @media (max-width: 450px) {
2026
+ position: relative;
2027
+ .ql-formats {
2028
+ .link-tool-wrapper {
2029
+ position: unset;
2030
+ .popover-menu__content {
2031
+ left: 0;
2032
+ transform: unset;
2033
+ max-width: 100%;
2034
+ }
2035
+ }
2036
+ }
2037
+ }
2038
+ }
2039
+ .quill {
2040
+ flex: 1;
2041
+ overflow-y: hidden;
2042
+ .ql-container {
2043
+ display: inline-block;
2044
+ width: 100%;
2045
+ min-height: 100%;
2046
+ /* padding: 14px 16px; */
2047
+ border: none;
2048
+ border-radius: ${miscTheme.theme.borderRadius};
2049
+ color: ${miscTheme.theme.colors.gray800};
2050
+ font-size: 1rem;
2051
+ line-height: 1.5;
2052
+ resize: none;
2053
+ white-space: break-spaces;
2054
+ .ql-editor {
2055
+ word-break: break-word;
2056
+ overflow-wrap: break-word;
2057
+ /* -ms-overflow-style: none;
2058
+ scrollbar-width: none;
2059
+ &::-webkit-scrollbar {
2060
+ display: none;
2061
+ } */
2062
+ }
2063
+ mocka {
2064
+ padding: 2px 6px;
2065
+ border-radius: 1rem;
2066
+ &[data-url='true'] {
2067
+ /* background-color: #eeeeff; */
2068
+ font-style: italic;
2069
+ color: #1890ff;
2070
+ cursor: pointer;
2071
+ outline: none;
2072
+ text-decoration: underline;
2073
+ }
2074
+ &[data-error='true'] {
2075
+ background-color: #ffeeee;
2076
+ color: red;
2077
+ text-decoration: underline;
2078
+ font-style: bold;
2079
+ }
2080
+ }
2081
+ mention {
2082
+ padding: 2px 6px;
2083
+ border-radius: 1rem;
2084
+ background-color: #eeeeff;
2085
+ color: #1890ff;
2086
+ cursor: pointer;
2087
+ outline: none;
2088
+ text-decoration: none;
2089
+ }
2090
+ ol,
2091
+ ul {
2092
+ padding-left: 1rem;
2093
+ }
2094
+ }
2095
+ }
2096
+ .mention-search-container {
2097
+ position: absolute;
2098
+ background: white;
2099
+ border-radius: ${miscTheme.theme.borderRadius};
2100
+ filter: drop-shadow(0px 10px 16px rgba(0, 0, 0, 0.04))
2101
+ drop-shadow(0px 2px 8px rgba(0, 0, 0, 0.04))
2102
+ drop-shadow(0px 0px 1px rgba(0, 0, 0, 0.04));
2103
+ overflow-y: scroll;
2104
+ z-index: 99;
2105
+ ::-webkit-scrollbar {
2106
+ -webkit-appearance: none;
2107
+ }
2108
+ ::-webkit-scrollbar:vertical {
2109
+ width: 14px;
2110
+ }
2111
+ ::-webkit-scrollbar-thumb {
2112
+ border-radius: ${miscTheme.theme.borderRadius};
2113
+ background-color: #d9d9d9;
2114
+ @supports (background-clip: padding-box) {
2115
+ border: 3px solid rgba(0, 0, 0, 0);
2116
+ background-clip: padding-box;
2117
+ }
2118
+ @supports not (background-clip: padding-box) {
2119
+ border: 3px solid white;
2120
+ }
2121
+ }
2122
+ ::-webkit-scrollbar-track {
2123
+ background-color: #fff;
2124
+ border-radius: 0 6px 6px 0;
2125
+ border-left: 1px solid #f2f2f2;
2126
+ }
2127
+ .mention-search-item {
2128
+ cursor: pointer;
2129
+ padding: 12px 1rem;
2130
+ display: flex;
2131
+ align-items: center;
2132
+ &.item-selected {
2133
+ background-color: ${miscTheme.theme.colors.gray100};
2134
+ }
2135
+ .search-avatar {
2136
+ width: 40px;
2137
+ height: 40px;
2138
+ font-size: 20px;
2139
+ margin-right: 20px;
2140
+ }
2141
+ }
2142
+ }
2143
+ `;
2144
+
2145
+ let ReactQuill = null;
2146
+ (() => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
2147
+ if (typeof window === 'undefined')
2148
+ return;
2149
+ const QuillRes = yield Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('react-quill')); });
2150
+ ReactQuill = QuillRes.default;
2151
+ const Quill = QuillRes.Quill || ReactQuill.Quill;
2152
+ class PreserveWhiteSpace {
2153
+ constructor(quill, options) {
2154
+ this.quill = quill;
2155
+ this.options = options;
2156
+ quill.container.style.whiteSpace = 'pre-line';
2157
+ }
2158
+ }
2159
+ Quill.register('modules/preserveWhiteSpace', PreserveWhiteSpace);
2160
+ const Inline = Quill.import('blots/inline');
2161
+ class MockABlot extends Inline {
2162
+ static create(options) {
2163
+ if (!options)
2164
+ return super.create(false);
2165
+ const node = super.create(options);
2166
+ MockABlot.setNodeConfigurations(node, options);
2167
+ return node;
2168
+ }
2169
+ static formats(node) {
2170
+ if (node.innerText &&
2171
+ (node.getAttribute('data-href') ||
2172
+ node.getAttribute('data-url') ||
2173
+ node.getAttribute('data-error') ||
2174
+ node.getAttribute('data-bad-word'))) {
2175
+ return {
2176
+ 'data-bad-word': node.getAttribute('data-bad-word'),
2177
+ 'data-error': node.getAttribute('data-error'),
2178
+ 'data-href': node.getAttribute('data-href'),
2179
+ 'data-url': node.getAttribute('data-url'),
2180
+ 'data-text': node.innerText || node.getAttribute('data-href'),
2181
+ };
2182
+ }
2183
+ else {
2184
+ return false;
2185
+ }
2186
+ }
2187
+ /* To prevent the node from accidentally being built in different ways. */
2188
+ static setNodeConfigurations(node, value) {
2189
+ var _a, _b;
2190
+ if (!value)
2191
+ return;
2192
+ if (!((_b = (_a = value === null || value === void 0 ? void 0 : value['data-text']) === null || _a === void 0 ? void 0 : _a.replace(/(\&nbsp;)+/g, ' ')) === null || _b === void 0 ? void 0 : _b.replace(/(\u200c|&zwnj;)+/g, '')))
2193
+ return;
2194
+ if (value['data-bad-word'])
2195
+ node.setAttribute('data-bad-word', value['data-bad-word']);
2196
+ if (value['data-href'])
2197
+ node.setAttribute('data-href', value['data-href']);
2198
+ if (value['data-error'])
2199
+ node.setAttribute('data-error', value['data-error']);
2200
+ // setTimeout(() => {
2201
+ // if (value['data-text'] !== node.innerText && !node.innerText)
2202
+ // node.innerHTML = value['data-text']
2203
+ // }, 200)
2204
+ if (value['data-url'])
2205
+ node.setAttribute('data-url', value['data-url']);
2206
+ // if (value['data-text']) node.innerText = value['data-text']
2207
+ // console.log(value, node.outerHTML, node)
2208
+ }
2209
+ }
2210
+ MockABlot.blotName = 'mocka1';
2211
+ MockABlot.tagName = 'mocka';
2212
+ Quill.register(MockABlot);
2213
+ class MentionBlot extends Inline {
2214
+ static create(options) {
2215
+ if (!options)
2216
+ return super.create(false);
2217
+ const node = super.create(options);
2218
+ MentionBlot.setNodeConfigurations(node, options);
2219
+ return node;
2220
+ }
2221
+ static formats(node) {
2222
+ if (node.getAttribute('data-name') && node.getAttribute('data-id')) {
2223
+ return {
2224
+ 'data-name': node.getAttribute('data-name'),
2225
+ 'data-id': node.getAttribute('data-id'),
2226
+ };
2227
+ }
2228
+ else {
2229
+ return false;
2230
+ }
2231
+ }
2232
+ /* To prevent the node from accidentally being built in different ways. */
2233
+ static setNodeConfigurations(node, value) {
2234
+ var _a, _b;
2235
+ if (!value)
2236
+ return;
2237
+ if (!value['data-id'] ||
2238
+ !((_b = (_a = value === null || value === void 0 ? void 0 : value['data-name']) === null || _a === void 0 ? void 0 : _a.replace(/(\&nbsp;)+/g, ' ')) === null || _b === void 0 ? void 0 : _b.replace(/(\u200c|&zwnj;)+/g, '')))
2239
+ return;
2240
+ if (value['data-id'])
2241
+ node.setAttribute('data-id', value['data-id']);
2242
+ if (value['data-name']) {
2243
+ // node.setAttribute('contenteditable', false)
2244
+ node.setAttribute('data-name', value['data-name']);
2245
+ }
2246
+ }
2247
+ }
2248
+ MentionBlot.blotName = 'mention';
2249
+ MentionBlot.tagName = 'mention';
2250
+ Quill.register(MentionBlot);
2251
+ }))();
2252
+ function getCaretCharacterOffsetWithin(element) {
2253
+ var _a, _b;
2254
+ let caretOffset = -1;
2255
+ if (typeof window.getSelection != 'undefined') {
2256
+ const sel = window.getSelection();
2257
+ if ((sel === null || sel === void 0 ? void 0 : sel.rangeCount) && (sel === null || sel === void 0 ? void 0 : sel.rangeCount) > 0) {
2258
+ const range = (_a = window.getSelection()) === null || _a === void 0 ? void 0 : _a.getRangeAt(0);
2259
+ if (range) {
2260
+ const preCaretRange = range.cloneRange();
2261
+ // preCaretRange.setStart(element, 0)
2262
+ preCaretRange.selectNodeContents(element);
2263
+ preCaretRange.setEnd(range.endContainer, range.endOffset);
2264
+ caretOffset = calculateChildNodeOffset(preCaretRange.cloneContents().childNodes, caretOffset);
2265
+ const parentMockAElement = (_b = range.endContainer.parentElement) === null || _b === void 0 ? void 0 : _b.closest('mocka');
2266
+ const lastNodeValue = range.endContainer.nodeValue ||
2267
+ range.endContainer.outerHTML;
2268
+ if (parentMockAElement && (lastNodeValue === null || lastNodeValue === void 0 ? void 0 : lastNodeValue.length)) {
2269
+ /// set selector to end of <mocka elemt, prevent select in the middle
2270
+ caretOffset =
2271
+ caretOffset -
2272
+ range.endOffset +
2273
+ (parentMockAElement.outerHTML.length -
2274
+ (parentMockAElement === null || parentMockAElement === void 0 ? void 0 : parentMockAElement.outerHTML.lastIndexOf(lastNodeValue)));
2275
+ }
2276
+ }
2277
+ }
2278
+ }
2279
+ return caretOffset;
2280
+ }
2281
+ function calculateChildNodeOffset(childNodes, caretOffset) {
2282
+ childNodes.forEach((node, index) => {
2283
+ const isLast = index + 1 === childNodes.length;
2284
+ if (node.nodeType === Node.ELEMENT_NODE) {
2285
+ const outerHTML = node.outerHTML;
2286
+ if (!isLast) {
2287
+ caretOffset += outerHTML.length;
2288
+ return;
2289
+ }
2290
+ else {
2291
+ caretOffset += outerHTML.indexOf('>') + 1;
2292
+ caretOffset = calculateChildNodeOffset(node.childNodes, caretOffset);
2293
+ }
2294
+ }
2295
+ else if (node.nodeType === Node.TEXT_NODE) {
2296
+ caretOffset += (node.nodeValue || '')
2297
+ .replace(/&/g, '&amp;')
2298
+ .replace(/</g, '&lt;')
2299
+ .replace(/>/g, '&gt;')
2300
+ .replace(/"/g, '&quot;')
2301
+ .replace(/'/g, '&#039;').length;
2302
+ }
2303
+ });
2304
+ return caretOffset;
2305
+ }
2306
+ function getSearchName(root) {
2307
+ var _a, _b;
2308
+ let res = null;
2309
+ if (typeof window.getSelection != 'undefined') {
2310
+ const sel = window.getSelection();
2311
+ if ((sel === null || sel === void 0 ? void 0 : sel.rangeCount) && (sel === null || sel === void 0 ? void 0 : sel.rangeCount) > 0) {
2312
+ const range = (_a = window.getSelection()) === null || _a === void 0 ? void 0 : _a.getRangeAt(0);
2313
+ if (range) {
2314
+ const preCaretRange = range.cloneRange();
2315
+ // preCaretRange.setStart(element, 0)
2316
+ preCaretRange.selectNodeContents(root);
2317
+ preCaretRange.setEnd(range.endContainer, range.endOffset);
2318
+ const endText = (preCaretRange.endContainer.nodeValue || '').substring(0, range.endOffset);
2319
+ // only allow @ at start of text or has space before it
2320
+ const lastAnchorSymbolIndex = endText.lastIndexOf('@');
2321
+ if (lastAnchorSymbolIndex + 1 < endText.length &&
2322
+ (lastAnchorSymbolIndex === 0 ||
2323
+ endText.slice(lastAnchorSymbolIndex - 1, lastAnchorSymbolIndex + 1) === ' @')) {
2324
+ const name = (_b = endText.slice(lastAnchorSymbolIndex + 1)) === null || _b === void 0 ? void 0 : _b.trim();
2325
+ if (name) {
2326
+ preCaretRange.setStart(range.endContainer, lastAnchorSymbolIndex);
2327
+ const replaceRange = preCaretRange.cloneRange();
2328
+ replaceRange.setStart(replaceRange.endContainer, lastAnchorSymbolIndex);
2329
+ res = {
2330
+ name,
2331
+ rect: preCaretRange.getBoundingClientRect(),
2332
+ replaceRange,
2333
+ };
2334
+ }
2335
+ }
2336
+ }
2337
+ }
2338
+ }
2339
+ return res;
2340
+ }
2341
+ const inputModify$1 = (value, opts) => {
2342
+ var _a;
2343
+ const { formatUrl, bannedWords = [] } = opts || {};
2344
+ const removedFormat = post.fixMalformedMention(post.removeFontFormat(value));
2345
+ if (!formatUrl)
2346
+ return {
2347
+ value: post.highlightBadWords(removedFormat, bannedWords),
2348
+ };
2349
+ let descriptionWithWrappedAnchor = post.removeEdittedBannedWord(post.wrapAnchorAroundUrls(removedFormat));
2350
+ const urls = post.getUrlsFromEditorString(removedFormat);
2351
+ if (urls) {
2352
+ const invalidUrls = [];
2353
+ let previewUrl = '';
2354
+ urls.forEach((url) => {
2355
+ if (!url)
2356
+ return;
2357
+ try {
2358
+ const jsUrl = new URL(url);
2359
+ if (post.ALLOW_DOMAIN_URL.some((o) => jsUrl.origin.endsWith(o))) {
2360
+ // is valid
2361
+ }
2362
+ else {
2363
+ invalidUrls.push(url);
2364
+ // is not valid
2365
+ }
2366
+ }
2367
+ catch (_a) {
2368
+ invalidUrls.push(url);
2369
+ }
2370
+ });
2371
+ if (invalidUrls.length > 0) {
2372
+ descriptionWithWrappedAnchor = descriptionWithWrappedAnchor
2373
+ .replace(new RegExp(`data-url="true">(${invalidUrls.map(post.escapeRegExp).join('|')})<`, 'gi'), 'data-error="true" data-url="true">$1<')
2374
+ .replace(new RegExp(`data-href="(${invalidUrls
2375
+ .map(post.escapeRegExp)
2376
+ .join('|')})" data-url="true">`, 'gi'), 'data-href="$1" data-error="true" data-url="true">');
2377
+ }
2378
+ previewUrl = (_a = urls.filter((u) => invalidUrls.indexOf(u) === -1)) === null || _a === void 0 ? void 0 : _a[0];
2379
+ return {
2380
+ invalidUrls,
2381
+ previewUrl,
2382
+ value: post.highlightBadWords(descriptionWithWrappedAnchor, bannedWords),
2383
+ };
2384
+ }
2385
+ return {
2386
+ value: post.highlightBadWords(descriptionWithWrappedAnchor, bannedWords),
2387
+ };
2388
+ };
2389
+ const RichTextEditor = ({ html, onChange, className, style, onImagePickerClick, bannedWords = [], onInvalidUrlsChange, onPreviewUrlChange, setEditorRef, isReplying, }) => {
2390
+ var _a, _b, _c, _d;
2391
+ const bannedWordsRef = React.useRef([]);
2392
+ bannedWordsRef.current = bannedWords;
2393
+ const [invalidUrls, setInvalidUrls] = React.useState([]);
2394
+ const [previewUrl, setPreviewUrl] = React.useState(null);
2395
+ const { data: { locale }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
2396
+ const bannedString = (bannedWords === null || bannedWords === void 0 ? void 0 : bannedWords.join(',')) || '';
2397
+ React.useEffect(() => {
2398
+ var _a, _b;
2399
+ const currHTML = (_b = (_a = reactQuillRef.current) === null || _a === void 0 ? void 0 : _a.getEditor()) === null || _b === void 0 ? void 0 : _b.root.innerHTML;
2400
+ debounceInputModify(currHTML);
2401
+ }, [bannedString]);
2402
+ const fetchPreviewData = (url) => {
2403
+ if (!previewUrl || previewUrl.url !== url) {
2404
+ setPreviewUrl({
2405
+ url,
2406
+ isFetching: true,
2407
+ });
2408
+ togetherComponentGlobalContext.callApi(togetherComponentGlobalContext.getApiPath(togetherApiPaths.PATHS.FETCH_PREVIEW, {
2409
+ _locale: locale,
2410
+ }), 'POST', {
2411
+ data: {
2412
+ link: url,
2413
+ },
2414
+ })
2415
+ .then((res) => {
2416
+ var _a, _b, _c, _d;
2417
+ setPreviewUrl({
2418
+ title: (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.title,
2419
+ description: (_b = res === null || res === void 0 ? void 0 : res.data) === null || _b === void 0 ? void 0 : _b.description,
2420
+ image: ((_c = res === null || res === void 0 ? void 0 : res.data) === null || _c === void 0 ? void 0 : _c.image) || ((_d = res === null || res === void 0 ? void 0 : res.data) === null || _d === void 0 ? void 0 : _d.logo),
2421
+ url,
2422
+ });
2423
+ })
2424
+ .catch(() => {
2425
+ setPreviewUrl(null);
2426
+ });
2427
+ }
2428
+ };
2429
+ const fetchPreviewDataRef = React.useRef(fetchPreviewData);
2430
+ fetchPreviewDataRef.current = fetchPreviewData;
2431
+ const debounceInputModify = React.useCallback(debounce__default["default"]((v) => {
2432
+ if (v) {
2433
+ const processedInput = inputModify$1(v, {
2434
+ bannedWords: bannedWordsRef.current,
2435
+ formatUrl: true,
2436
+ });
2437
+ const { invalidUrls: _invalidUrls, previewUrl: _previewUrl, value, } = processedInput;
2438
+ if (_invalidUrls) {
2439
+ setInvalidUrls(_invalidUrls);
2440
+ }
2441
+ if (_previewUrl) {
2442
+ fetchPreviewDataRef.current(_previewUrl);
2443
+ }
2444
+ else
2445
+ setPreviewUrl(null);
2446
+ if (value !== v) {
2447
+ onChange === null || onChange === void 0 ? void 0 : onChange(value);
2448
+ }
2449
+ }
2450
+ }, 500), []);
2451
+ React.useEffect(() => {
2452
+ onInvalidUrlsChange && onInvalidUrlsChange(invalidUrls);
2453
+ }, [invalidUrls]);
2454
+ React.useEffect(() => {
2455
+ if (onPreviewUrlChange) {
2456
+ if (previewUrl === null || previewUrl === void 0 ? void 0 : previewUrl.url)
2457
+ onPreviewUrlChange({
2458
+ title: previewUrl.title || '',
2459
+ url: previewUrl.url || '',
2460
+ image: previewUrl.image || '',
2461
+ description: previewUrl.description || '',
2462
+ });
2463
+ else
2464
+ onPreviewUrlChange(null);
2465
+ }
2466
+ }, [previewUrl]);
2467
+ const imageHandlerRef = React.useRef(onImagePickerClick);
2468
+ imageHandlerRef.current = onImagePickerClick;
2469
+ const toolbarId = useUniqueId.useUniqueId();
2470
+ const cachedModules = React.useRef({
2471
+ toolbar: {
2472
+ handlers: {
2473
+ image: () => { var _a; return (_a = imageHandlerRef.current) === null || _a === void 0 ? void 0 : _a.call(imageHandlerRef); },
2474
+ link: () => false,
2475
+ },
2476
+ container: '#toolbar-' + toolbarId,
2477
+ },
2478
+ // toolbar: [
2479
+ // ['bold', 'italic', 'underline'],
2480
+ // [{ list: 'ordered' }, { list: 'bullet' }],
2481
+ // ],
2482
+ preserveWhiteSpace: true,
2483
+ });
2484
+ const contentEditableCaretPos = React.useRef(-1);
2485
+ const reactQuillRef = React.useRef(null);
2486
+ setEditorRef &&
2487
+ ((_b = (_a = reactQuillRef.current) === null || _a === void 0 ? void 0 : _a.getEditor()) === null || _b === void 0 ? void 0 : _b.root) &&
2488
+ setEditorRef((_d = (_c = reactQuillRef.current) === null || _c === void 0 ? void 0 : _c.getEditor()) === null || _d === void 0 ? void 0 : _d.root);
2489
+ const handleSelectionChange = () => {
2490
+ var _a, _b, _c, _d, _e, _f, _g, _h;
2491
+ if ((_b = (_a = reactQuillRef.current) === null || _a === void 0 ? void 0 : _a.getEditor()) === null || _b === void 0 ? void 0 : _b.root) {
2492
+ const newCaretPos = getCaretCharacterOffsetWithin((_d = (_c = reactQuillRef.current) === null || _c === void 0 ? void 0 : _c.getEditor()) === null || _d === void 0 ? void 0 : _d.root);
2493
+ const currHTML = (_f = (_e = reactQuillRef.current) === null || _e === void 0 ? void 0 : _e.getEditor()) === null || _f === void 0 ? void 0 : _f.root.innerHTML;
2494
+ // in case of clicking on a div outside editor while focus, we get caret position too large
2495
+ if (newCaretPos >= 0 && newCaretPos < currHTML.length) {
2496
+ const mentionIds = post.getMentionIdsFromString(currHTML, true);
2497
+ if (mentionIds.length < post.LIMIT_MENTION - (isReplying ? 1 : 0)) {
2498
+ const searchData = getSearchName((_h = (_g = reactQuillRef.current) === null || _g === void 0 ? void 0 : _g.getEditor()) === null || _h === void 0 ? void 0 : _h.root);
2499
+ if (searchData) {
2500
+ searchUser(searchData.name, searchData.rect);
2501
+ replaceRangeRef.current = searchData.replaceRange;
2502
+ }
2503
+ else {
2504
+ replaceRangeRef.current = null;
2505
+ // to avoid race condition, we reuse this function to clear foundUsers
2506
+ searchUser('', null);
2507
+ }
2508
+ }
2509
+ else {
2510
+ replaceRangeRef.current = null;
2511
+ // to avoid race condition, we reuse this function to clear foundUsers
2512
+ searchUser('', null);
2513
+ }
2514
+ // const insertIndex = newCaretPos + 1
2515
+ // const currHTML = reactQuillRef.current?.getEditor()?.root.innerHTML
2516
+ // console.log(
2517
+ // currHTML?.substring(0, insertIndex) || '',
2518
+ // '========',
2519
+ // currHTML?.substring(insertIndex) || '',
2520
+ // )
2521
+ contentEditableCaretPos.current = newCaretPos;
2522
+ }
2523
+ }
2524
+ else {
2525
+ setFoundUsers([]);
2526
+ }
2527
+ };
2528
+ const [foundUsers, setFoundUsers] = React.useState([]);
2529
+ const [searchUserPosition, setSearchUserPosition] = React.useState({
2530
+ top: 0,
2531
+ left: 0,
2532
+ });
2533
+ const searchUser = React.useCallback(debounce__default["default"]((name, rect, excludeIds) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
2534
+ var _e, _f, _g, _h;
2535
+ if (!name || !DOMRect) {
2536
+ return setFoundUsers([]);
2537
+ }
2538
+ const res = yield ((((_e = miscCookieHelper.getCookie(constants.BEARER_TOKEN_COOKIE)) === null || _e === void 0 ? void 0 : _e.length) || 0) > 0
2539
+ ? togetherComponentGlobalContext.callApiWithAuth(togetherComponentGlobalContext.getApiPath(togetherApiPaths.PATHS.SEARCH_USER, {
2540
+ _locale: locale,
2541
+ name: name,
2542
+ }), 'get')
2543
+ : togetherComponentGlobalContext.callApiWithAdminAuth(togetherComponentGlobalContext.getApiPath(togetherApiPaths.ADMIN_PATHS.SEARCH_USER, {
2544
+ _locale: locale,
2545
+ name: name,
2546
+ }), 'get'));
2547
+ setSelectTagUserIndex(0);
2548
+ setFoundUsers((_g = (_f = res === null || res === void 0 ? void 0 : res.data) === null || _f === void 0 ? void 0 : _f.users) === null || _g === void 0 ? void 0 : _g.filter((u) => !(excludeIds === null || excludeIds === void 0 ? void 0 : excludeIds.includes(String(u.id)))));
2549
+ const textNodeRect = rect;
2550
+ const containerRect = (_h = containerRef.current) === null || _h === void 0 ? void 0 : _h.getBoundingClientRect();
2551
+ if (textNodeRect && containerRect) {
2552
+ const idealWidth = 343;
2553
+ const idealHeight = 256;
2554
+ const styleConfig = {
2555
+ top: textNodeRect.bottom - containerRect.top,
2556
+ width: `min(343px, 100%)`,
2557
+ maxHeight: idealHeight,
2558
+ };
2559
+ const tempRightWidth = containerRect.width - (textNodeRect.left - containerRect.left);
2560
+ if (tempRightWidth < idealWidth) {
2561
+ styleConfig.right = 0;
2562
+ }
2563
+ else {
2564
+ styleConfig.left = textNodeRect.left - containerRect.left;
2565
+ }
2566
+ setSearchUserPosition(styleConfig);
2567
+ }
2568
+ }), 500), []);
2569
+ const setSelectUser = (id, name) => {
2570
+ var _a, _b, _c;
2571
+ if (replaceRangeRef.current) {
2572
+ replaceRangeRef.current.deleteContents();
2573
+ const newMention = document.createElement('mention');
2574
+ newMention.setAttribute('data-id', id);
2575
+ newMention.setAttribute('data-name', name);
2576
+ // newMention.setAttribute('contenteditable', 'false')
2577
+ newMention.innerText = name;
2578
+ const newPostText = document.createTextNode(' ');
2579
+ replaceRangeRef.current.insertNode(newPostText);
2580
+ replaceRangeRef.current.insertNode(newMention);
2581
+ const editorRoot = (_b = (_a = reactQuillRef.current) === null || _a === void 0 ? void 0 : _a.getEditor()) === null || _b === void 0 ? void 0 : _b.root;
2582
+ editorRoot.focus();
2583
+ const range = (_c = window.getSelection()) === null || _c === void 0 ? void 0 : _c.getRangeAt(0);
2584
+ range === null || range === void 0 ? void 0 : range.setStart(replaceRangeRef.current.endContainer, replaceRangeRef.current.endOffset);
2585
+ range === null || range === void 0 ? void 0 : range.setEnd(replaceRangeRef.current.endContainer, replaceRangeRef.current.endOffset);
2586
+ }
2587
+ setFoundUsers([]);
2588
+ };
2589
+ const containerRef = React.useRef(null);
2590
+ const replaceRangeRef = React.useRef(null);
2591
+ const foundUsersListRef = React.useRef(null);
2592
+ const [selectTagUserIndex, setSelectTagUserIndex] = React.useState(0);
2593
+ React.useEffect(() => {
2594
+ // convenient behavior, scroll item into view when select using keyboard
2595
+ if (foundUsersListRef.current) {
2596
+ const parentElement = foundUsersListRef.current;
2597
+ const childElement = parentElement.children.item(selectTagUserIndex);
2598
+ if (childElement) {
2599
+ const containerRect = parentElement.getBoundingClientRect();
2600
+ const childRect = childElement.getBoundingClientRect();
2601
+ if (childElement.offsetTop < parentElement.scrollTop)
2602
+ parentElement.scrollTop = childElement.offsetTop;
2603
+ else if (childElement.offsetTop + childRect.height >
2604
+ parentElement.scrollTop + containerRect.height) {
2605
+ parentElement.scrollTop =
2606
+ childElement.offsetTop - containerRect.height + childRect.height;
2607
+ }
2608
+ }
2609
+ }
2610
+ }, [selectTagUserIndex]);
2611
+ React.useEffect(() => {
2612
+ const clickHandler = function (e) {
2613
+ var _a;
2614
+ if (!((_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target))) {
2615
+ // Clicked outside the box
2616
+ setFoundUsers([]);
2617
+ }
2618
+ };
2619
+ window.addEventListener('click', clickHandler, {
2620
+ passive: true,
2621
+ });
2622
+ return () => {
2623
+ window.removeEventListener('click', clickHandler);
2624
+ };
2625
+ }, []);
2626
+ return (React__default["default"].createElement(StyledEditorContainer, { ref: containerRef, className: className, style: style, onKeyDownCapture: (e) => {
2627
+ // convenient behavior, use arrow to select tag user and enter to choose
2628
+ if (foundUsers === null || foundUsers === void 0 ? void 0 : foundUsers.length) {
2629
+ let preventKey = false;
2630
+ if (e.key === 'ArrowDown') {
2631
+ preventKey = true;
2632
+ setSelectTagUserIndex((s) => s + 1 >= foundUsers.length ? 0 : s + 1);
2633
+ }
2634
+ else if (e.key === 'Escape') {
2635
+ preventKey = true;
2636
+ setSelectTagUserIndex(0);
2637
+ setFoundUsers([]);
2638
+ }
2639
+ else if (e.key === 'ArrowUp') {
2640
+ preventKey = true;
2641
+ setSelectTagUserIndex((s) => s - 1 < 0 ? foundUsers.length - 1 : s - 1);
2642
+ }
2643
+ else if (e.key === 'Enter' || e.key === 'Tab') {
2644
+ const user = foundUsers[selectTagUserIndex];
2645
+ if (user) {
2646
+ preventKey = true;
2647
+ setSelectUser(user.id, user.name);
2648
+ }
2649
+ }
2650
+ if (preventKey) {
2651
+ e.preventDefault();
2652
+ return false;
2653
+ }
2654
+ }
2655
+ } },
2656
+ React__default["default"].createElement(CustomToolbar, { id: toolbarId, onAddLink: (text, href) => {
2657
+ var _a, _b;
2658
+ const insertIndex = contentEditableCaretPos.current + 1;
2659
+ const currHTML = (_b = (_a = reactQuillRef.current) === null || _a === void 0 ? void 0 : _a.getEditor()) === null || _b === void 0 ? void 0 : _b.root.innerHTML;
2660
+ const newHTML = ((currHTML === null || currHTML === void 0 ? void 0 : currHTML.substring(0, insertIndex)) || '') +
2661
+ `<mocka data-href="${href}" data-url="true">${text}</mocka> ` +
2662
+ ((currHTML === null || currHTML === void 0 ? void 0 : currHTML.substring(insertIndex)) || '');
2663
+ onChange === null || onChange === void 0 ? void 0 : onChange(newHTML);
2664
+ debounceInputModify(newHTML);
2665
+ } }),
2666
+ ReactQuill && (React__default["default"].createElement(ReactQuill, { ref: reactQuillRef, theme: "snow", value: html, onChange: (t) => {
2667
+ onChange === null || onChange === void 0 ? void 0 : onChange(t);
2668
+ debounceInputModify(t);
2669
+ handleSelectionChange();
2670
+ }, onChangeSelection: () => {
2671
+ handleSelectionChange();
2672
+ }, modules: cachedModules.current, formats: [
2673
+ 'mocka1',
2674
+ 'mention',
2675
+ 'id',
2676
+ 'key',
2677
+ 'bold',
2678
+ 'italic',
2679
+ 'underline',
2680
+ 'list',
2681
+ 'bullet',
2682
+ ] })),
2683
+ !!(foundUsers === null || foundUsers === void 0 ? void 0 : foundUsers.length) && (React__default["default"].createElement("div", { ref: foundUsersListRef, className: "mention-search-container", style: searchUserPosition }, foundUsers.map((foundUser, index) => (React__default["default"].createElement("div", { className: `mention-search-item ${selectTagUserIndex === index ? 'item-selected' : ''}`, key: foundUser.id, onClick: (e) => {
2684
+ e.preventDefault();
2685
+ e.stopPropagation();
2686
+ setSelectUser(foundUser.id, foundUser.name);
2687
+ }, onMouseEnter: () => {
2688
+ setSelectTagUserIndex(index);
2689
+ } },
2690
+ React__default["default"].createElement(index$a.UserAvatar, { className: "search-avatar", username: foundUser.name, avatar: foundUser.avatar }),
2691
+ React__default["default"].createElement("div", null,
2692
+ React__default["default"].createElement(index$2.Text, { size: "p2" }, foundUser.name),
2693
+ React__default["default"].createElement(index$2.Text, { size: "p4", color: "#595959" },
2694
+ "@",
2695
+ foundUser.username)))))))));
2696
+ };
2697
+ const CustomToolbar = ({ onAddLink, id, }) => {
2698
+ return (React__default["default"].createElement("div", { id: 'toolbar-' + id, onClick: (e) => {
2699
+ e.preventDefault();
2700
+ e.stopPropagation();
2701
+ } },
2702
+ React__default["default"].createElement("span", { className: "ql-formats" },
2703
+ React__default["default"].createElement("button", { className: "ql-bold", type: "button" }),
2704
+ React__default["default"].createElement("button", { className: "ql-italic", type: "button" }),
2705
+ React__default["default"].createElement("button", { className: "ql-underline", type: "button" })),
2706
+ React__default["default"].createElement("span", { className: "ql-formats" },
2707
+ React__default["default"].createElement("button", { className: "ql-list", value: "ordered", type: "button" }),
2708
+ React__default["default"].createElement("button", { className: "ql-list", value: "bullet", type: "button" })),
2709
+ React__default["default"].createElement("span", { className: "ql-formats" }, onAddLink && (React__default["default"].createElement(index$b.PopoverMenu, { className: "link-tool-wrapper", toggleButtonContent: React__default["default"].createElement("img", { className: "link-icon", src: togetherRichTextEditor.IconLink, loading: "lazy" }), buttonProps: {
2710
+ size: 'md',
2711
+ color: 'transparent',
2712
+ }, align: "end" }, ({ setShow }) => (React__default["default"].createElement(LinkToolInputPopover, { onAddUrl: onAddLink, setShow: setShow })))))));
2713
+ };
2714
+ const URL_WARN_MAP = [
2715
+ 'notification.limitUrlDomain',
2716
+ 'notification.urlWrongFormat',
2717
+ ];
2718
+ const LinkToolInputPopover = ({ onAddUrl, setShow }) => {
2719
+ const { data: { env: { isMarryBaby }, }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
2720
+ const { t } = index.useTranslations();
2721
+ const [urlValue, setUrlValue] = React.useState('');
2722
+ const [textValue, setTextValue] = React.useState('');
2723
+ const [urlWarnType, setUrlWarnType] = React.useState(-1);
2724
+ const checkUrlValid = (v) => {
2725
+ const trimmedUrl = post.reformatUrl(v.trim());
2726
+ try {
2727
+ const jsUrl = new URL(trimmedUrl);
2728
+ if (!jsUrl.protocol.startsWith('http')) {
2729
+ setUrlWarnType(1);
2730
+ return false;
2731
+ }
2732
+ if (!post.ALLOW_DOMAIN_URL.some((o) => jsUrl.origin.endsWith('/' + o) || jsUrl.origin.endsWith('.' + o))) {
2733
+ setUrlWarnType(0);
2734
+ return false;
2735
+ }
2736
+ setUrlWarnType(-1);
2737
+ return true;
2738
+ }
2739
+ catch (_a) {
2740
+ setUrlWarnType(1);
2741
+ return false;
2742
+ }
2743
+ };
2744
+ const isValid = urlValue.trim() && textValue.trim() && urlWarnType < 0;
2745
+ return (React__default["default"].createElement("div", { className: "link-tool-popover" },
2746
+ React__default["default"].createElement(index$4.Input, { name: "url", value: urlValue, size: "md", label: "URL", placeholder: t('placeholder.enterUrlHere'), type: "text", className: "link-input-url", onChange: (v) => {
2747
+ setUrlValue(v);
2748
+ checkUrlValid(v);
2749
+ } }),
2750
+ urlWarnType >= 0 && (React__default["default"].createElement(index$2.Text, { size: "c2", className: "error-text" }, t(URL_WARN_MAP[urlWarnType]))),
2751
+ React__default["default"].createElement(index$4.Input, { name: "text", value: textValue, size: "md", label: t('createPost.urlText'), placeholder: t('placeholder.enterUrlTextHere'), type: "text", className: "link-input-text", onChange: (v) => setTextValue(v) }),
2752
+ React__default["default"].createElement("div", { "data-is-marrybaby": isMarryBaby, className: "link-input-button-wrapper" },
2753
+ React__default["default"].createElement(index$c.Button, { theme: isMarryBaby ? 'marryBaby' : 'helloSites', size: "sm", color: "primary", className: "link-input-button", onClick: () => {
2754
+ if (!isValid)
2755
+ return;
2756
+ onAddUrl(textValue.trim(), post.reformatUrl(urlValue.trim()));
2757
+ setShow && setShow(false);
2758
+ }, isDisabled: !isValid }, t('insert')))));
2759
+ };
2760
+
2761
+ const StyledCreatePostTitle = styled__default["default"].div `
2762
+ input:focus,
2763
+ textarea:focus,
2764
+ [contenteditable='true'] {
2765
+ outline: none;
2766
+ }
2767
+
2768
+ .title-input {
2769
+ overflow: hidden;
2770
+ width: 100%;
2771
+ padding: 12px 16px;
2772
+ border: solid 1px #d9d9d9;
2773
+ border-radius: ${miscTheme.theme.borderRadius};
2774
+ font-size: 16px;
2775
+ line-height: 1.2;
2776
+ white-space: nowrap;
2777
+ :focus {
2778
+ border-color: ${(props) => props.color};
2779
+ box-shadow: 0px 0px 2px 2px ${(props) => props.colorShadow};
2780
+ }
2781
+ br {
2782
+ display: none;
2783
+ }
2784
+ * {
2785
+ display: inline;
2786
+ white-space: nowrap;
2787
+ }
2788
+ mocka {
2789
+ padding: 2px 6px;
2790
+ border-radius: 1rem;
2791
+ &[data-error='true'] {
2792
+ background-color: #ffeeee;
2793
+ color: red;
2794
+ text-decoration: underline;
2795
+ font-style: bold;
2796
+ }
2797
+ }
2798
+ ol,
2799
+ ul {
2800
+ padding-left: 1rem;
2801
+ }
2802
+ }
2803
+
2804
+ label {
2805
+ display: block;
2806
+ margin-bottom: 5px;
2807
+ color: ${miscTheme.theme.colors.gray600};
2808
+ font-size: 13px;
2809
+ font-weight: bold;
2810
+ }
2811
+
2812
+ .count-string {
2813
+ color: ${miscTheme.theme.colors.gray400};
2814
+ font-size: 14px;
2815
+ text-align: right;
2816
+ font-weight: 400;
2817
+ line-height: 22px;
2818
+ letter-spacing: -0.2px;
2819
+ }
2820
+
2821
+ .has-input-error {
2822
+ input {
2823
+ border: 1px solid ${miscTheme.theme.colors.red600};
2824
+ }
2825
+ }
2826
+ `;
2827
+ const StyleWrapperTitle = styled__default["default"].div `
2828
+ display: flex;
2829
+ justify-content: space-between;
2830
+ align-items: center;
2831
+ margin-bottom: 2px;
2832
+
2833
+ .field-label {
2834
+ color: ${miscTheme.theme.colors.gray600};
2835
+ font-size: 14px;
2836
+ font-weight: 600;
2837
+ line-height: 22px;
2838
+ }
2839
+ `;
2840
+
2841
+ var ErrorFieldKey;
2842
+ (function (ErrorFieldKey) {
2843
+ ErrorFieldKey["title"] = "create-post-title-field";
2844
+ ErrorFieldKey["description"] = "create-post-description-field";
2845
+ ErrorFieldKey["photos"] = "create-post-photos-field";
2846
+ })(ErrorFieldKey || (ErrorFieldKey = {}));
2847
+ const orderErrorFieldKey = ['title', 'description', 'photos'];
2848
+
2849
+ const CreatePostDescription = ({ className, style, bannedWords = [], value, onChange, onPreviewUrlChange, onInvalidUrlsChange, isReplying, footerEditor, }) => {
2850
+ const { t } = index.useTranslations();
2851
+ const [previewUrl, setPreviewUrl] = React.useState(null);
2852
+ const imagePicker = React.useRef(null);
2853
+ React.useEffect(() => {
2854
+ if (onPreviewUrlChange) {
2855
+ if (previewUrl === null || previewUrl === void 0 ? void 0 : previewUrl.url)
2856
+ onPreviewUrlChange({
2857
+ title: previewUrl.title || '',
2858
+ url: previewUrl.url || '',
2859
+ image: previewUrl.image || '',
2860
+ description: previewUrl.description || '',
2861
+ });
2862
+ else
2863
+ onPreviewUrlChange(null);
2864
+ }
2865
+ }, [previewUrl]);
2866
+ return (React__default["default"].createElement("div", null,
2867
+ React__default["default"].createElement(StyleWrapperTitle, null,
2868
+ React__default["default"].createElement(index$2.Text, { size: "p4", className: "field-label" }, t('createPost.popup.description'))),
2869
+ React__default["default"].createElement(StyledCreatePostDescription, { className: className, style: style },
2870
+ React__default["default"].createElement("div", { className: `textarea-control ${ErrorFieldKey.description}` },
2871
+ React__default["default"].createElement("div", { className: "textarea-wrapper" },
2872
+ React__default["default"].createElement(RichTextEditor, { html: value || '', onChange: onChange, bannedWords: bannedWords, onImagePickerClick: () => { var _a; return (_a = imagePicker.current) === null || _a === void 0 ? void 0 : _a.click(); }, onPreviewUrlChange: setPreviewUrl, onInvalidUrlsChange: onInvalidUrlsChange, isReplying: isReplying }))),
2873
+ footerEditor)));
2874
+ };
2875
+
2876
+ const StyledCreateNewPost = styled__default["default"].div `
2877
+ position: relative;
2878
+ display: flex;
2879
+ height: 100%;
2880
+ flex-direction: column;
2881
+
2882
+ ${utils.MediaQueries.mbDown} {
2883
+ padding: 16px 16px;
2884
+ }
2885
+
2886
+ .input-group-container {
2887
+ flex: 1;
2888
+ padding: 16px 24px;
2889
+ -ms-overflow-style: none; /* IE and Edge */
2890
+ overflow-y: auto;
2891
+ scrollbar-width: none; /* Firefox */
2892
+ &::-webkit-scrollbar {
2893
+ display: none;
2894
+ }
2895
+ }
2896
+
2897
+ .input-group {
2898
+ :not(:last-child) {
2899
+ margin-bottom: 0.6rem;
2900
+ }
2901
+
2902
+ input:focus,
2903
+ textarea:focus,
2904
+ [contenteditable='true'] {
2905
+ outline: none;
2906
+ }
2907
+
2908
+ label {
2909
+ margin-bottom: 5px;
2910
+ color: ${miscTheme.theme.colors.gray600};
2911
+ /* font-family: 'Open Sans', sans-serif; */
2912
+ font-size: 13px;
2913
+ font-weight: bold;
2914
+ }
2915
+
2916
+ .input-group-label {
2917
+ margin-bottom: 5px;
2918
+ color: ${miscTheme.theme.colors.gray600};
2919
+ /* font-family: 'Open Sans', sans-serif; */
2920
+ font-size: 13px;
2921
+ font-weight: bold;
2922
+ }
2923
+
2924
+ .input-notification {
2925
+ display: flex;
2926
+
2927
+ & > img {
2928
+ width: 16px;
2929
+ height: 16px;
2930
+ margin-top: 1.5px;
2931
+ margin-right: 8px;
2932
+ }
2933
+ }
2934
+
2935
+ .tag-list {
2936
+ }
2937
+ }
2938
+
2939
+ .warning {
2940
+ margin-top: 16px;
2941
+ }
2942
+
2943
+ .submit-btn {
2944
+ width: 100%;
2945
+ }
2946
+
2947
+ .switch-label {
2948
+ display: flex;
2949
+ align-items: center;
2950
+ }
2951
+
2952
+ .swich-input-group {
2953
+ padding: 12px 16px;
2954
+ border-radius: 8px;
2955
+ background: ${miscTheme.theme.colors.neutral50};
2956
+
2957
+ &.askdoctor-switch {
2958
+ background: ${miscTheme.theme.colors.primary50};
2959
+ &.mb-color {
2960
+ background: ${miscTheme.theme.mbColors.tonePink};
2961
+ }
2962
+ }
2963
+
2964
+ .mantine-Switch-labelWrapper {
2965
+ flex-grow: 1;
2966
+ }
2967
+ .mantine-Checkbox-body {
2968
+ display: flex;
2969
+ width: 100%;
2970
+ align-items: center;
2971
+ justify-content: space-between;
2972
+ }
2973
+ .mantine-Switch-track {
2974
+ margin-bottom: 0;
2975
+ }
2976
+ .label-txt {
2977
+ font-weight: normal;
2978
+ font-size: 14px;
2979
+ color: ${miscTheme.theme.colors.gray800};
2980
+ margin-left: 10px;
2981
+ }
2982
+ }
2983
+ `;
2984
+ const StyledIsQuestion = styled__default["default"].div `
2985
+ display: flex;
2986
+ width: 100%;
2987
+ align-items: center;
2988
+ justify-content: space-between;
2989
+ padding: 12px;
2990
+ border-radius: 0 0 8px 8px;
2991
+ background: ${miscTheme.theme.colors.neutral50};
2992
+ gap: 12px;
2993
+
2994
+ &.has-error {
2995
+ border: 1px solid ${miscTheme.theme.colors.red600};
2996
+ }
2997
+ &.error-description {
2998
+ border: 1px solid ${miscTheme.theme.colors.red600};
2999
+ border-top: none;
3000
+ }
3001
+
3002
+ &[data-is-marry-baby='true'] {
3003
+ background: ${miscTheme.theme.mbColors.tonePink};
3004
+ }
3005
+
3006
+ .switch-label {
3007
+ display: flex;
3008
+ gap: 12px;
3009
+ align-items: center;
3010
+
3011
+ .wrapper-text {
3012
+ .label-txt {
3013
+ color: ${miscTheme.theme.colors.gray800};
3014
+ font-size: 14px;
3015
+ font-weight: 600;
3016
+ line-height: 22px;
3017
+ }
3018
+ .description-txt {
3019
+ color: ${miscTheme.theme.colors.gray700};
3020
+ font-size: 12px;
3021
+ font-weight: 400;
3022
+ line-height: 18px;
3023
+ }
3024
+ }
3025
+ }
3026
+
3027
+ .switch-btn {
3028
+ .mantine-Switch-track {
3029
+ margin: 0;
3030
+ min-width: 40px;
3031
+ width: 40px;
3032
+ }
3033
+ .mantine-Switch-labelWrapper {
3034
+ display: none;
3035
+ }
3036
+ }
3037
+
3038
+ button {
3039
+ height: 40px;
3040
+ &:hover,
3041
+ &.primary {
3042
+ border-radius: 16px;
3043
+ border: 1px solid ${miscTheme.theme.colors.blue100};
3044
+ background: ${miscTheme.theme.colors.blue50};
3045
+ color: ${miscTheme.theme.colors.primaryBase};
3046
+ }
3047
+ }
3048
+ `;
3049
+ const StyledError = styled__default["default"].div `
3050
+ margin-bottom: 12px;
3051
+ color: ${miscTheme.theme.colors.red700};
3052
+ svg {
3053
+ margin-right: 5px;
3054
+ }
3055
+ svg,
3056
+ span {
3057
+ vertical-align: middle;
3058
+ }
3059
+ .mantine-Text-root {
3060
+ color: ${miscTheme.theme.colors.red600};
3061
+ font-size: 12px;
3062
+ font-weight: 400;
3063
+ line-height: 18px;
3064
+ display: block;
3065
+ }
3066
+ `;
3067
+ const StyledFormGroupInner = styled__default["default"].div `
3068
+ .swich-input-group {
3069
+ padding: 12px 16px;
3070
+ border-radius: 8px;
3071
+ background: ${miscTheme.theme.colors.neutral50};
3072
+
3073
+ &.askdoctor-switch {
3074
+ background: ${miscTheme.theme.colors.blue50};
3075
+ }
3076
+
3077
+ .switch-label {
3078
+ display: flex;
3079
+ align-items: center;
3080
+ }
3081
+ .mantine-Switch-labelWrapper {
3082
+ flex-grow: 1;
3083
+ }
3084
+ .mantine-Checkbox-body {
3085
+ display: flex;
3086
+ width: 100%;
3087
+ align-items: center;
3088
+ justify-content: space-between;
3089
+ }
3090
+ .mantine-Switch-track {
3091
+ margin-bottom: 0;
3092
+ }
3093
+ .label-txt {
3094
+ font-weight: normal;
3095
+ font-size: 14px;
3096
+ color: ${miscTheme.theme.colors.gray800};
3097
+ margin-left: 14px;
3098
+ }
3099
+ }
3100
+ `;
3101
+ const StylePostAction = styled__default["default"].div `
3102
+ display: flex;
3103
+ gap: 12px;
3104
+ .avatar {
3105
+ width: 40px;
3106
+ height: 40px;
3107
+ border-radius: 100%;
3108
+
3109
+ &.avatar-anonymous {
3110
+ background: ${miscTheme.theme.colors.neutral100};
3111
+ }
3112
+
3113
+ img {
3114
+ border-radius: 100%;
3115
+ }
3116
+
3117
+ .author-avatar {
3118
+ .col-left {
3119
+ display: none;
3120
+ }
3121
+ }
3122
+ }
3123
+
3124
+ .post-action-form {
3125
+ display: flex;
3126
+ flex-direction: column;
3127
+ gap: 4px;
3128
+ }
3129
+
3130
+ .post-action-by {
3131
+ color: ${miscTheme.theme.colors.gray800};
3132
+ font-size: 16px;
3133
+ font-weight: 600;
3134
+ line-height: 24px;
3135
+ }
3136
+
3137
+ .post-action-result {
3138
+ display: flex;
3139
+ position: relative;
3140
+ }
3141
+
3142
+ .dropdown-post-action {
3143
+ background: ${miscTheme.theme.colors.white} !important;
3144
+ border-radius: 8px;
3145
+ border: 1px solid ${miscTheme.theme.colors.neutral200} !important;
3146
+
3147
+ > div {
3148
+ padding: 3px 8px;
3149
+ }
3150
+
3151
+ span {
3152
+ flex: 1;
3153
+ color: ${miscTheme.theme.colors.gray600};
3154
+ font-size: 12px;
3155
+ font-weight: 600;
3156
+ line-height: 18px;
3157
+ }
3158
+
3159
+ ul {
3160
+ width: 130px;
3161
+ li {
3162
+ img {
3163
+ flex: 0 0 16px;
3164
+ width: 16px;
3165
+ }
3166
+ }
3167
+ }
3168
+ }
3169
+ `;
3170
+ const StyleSessionRow = styled__default["default"].div `
3171
+ display: inline-flex;
3172
+ gap: 8px;
3173
+ align-items: center;
3174
+ cursor: pointer;
3175
+
3176
+ .session-title {
3177
+ color: ${miscTheme.theme.colors.gray700};
3178
+ font-size: 14px;
3179
+ font-weight: 400;
3180
+ line-height: 22px;
3181
+ flex: 1;
3182
+ }
3183
+ `;
3184
+ const StyledIsQuestionWrapper = styled__default["default"].div `
3185
+ padding: 8px 8px;
3186
+ border: 1px solid ${miscTheme.theme.colors.gray200};
3187
+ border-top: none;
3188
+ border-radius: 0 0 8px 8px;
3189
+ &.has-error {
3190
+ border: 1px solid ${miscTheme.theme.colors.red600};
3191
+ }
3192
+ &.error-description {
3193
+ border: 1px solid ${miscTheme.theme.colors.red600};
3194
+ border-top: none;
3195
+ }
3196
+ `;
3197
+ const StyleActionFooter = styled__default["default"].div `
3198
+ display: flex;
3199
+ padding: 16px 24px 24px 24px;
3200
+ justify-content: space-between;
3201
+ align-items: center;
3202
+ box-shadow: 0px -2px 10px 0px rgba(0, 0, 0, 0.08);
3203
+ ${utils.MediaQueries.mbDown} {
3204
+ padding: 8px 16px 12px 16px;
3205
+ gap: 12px;
3206
+ flex-direction: column;
3207
+ justify-content: flex-start;
3208
+ align-items: flex-start;
3209
+ }
3210
+ .input-group {
3211
+ margin-bottom: 0 !important;
3212
+ }
3213
+ `;
3214
+
3215
+ const CreatePostPhotos = ({ imageFiles: imageFilesInit, setImageFiles, }) => {
3216
+ const imageRef = React.useRef(null);
3217
+ const { t } = index.useTranslations();
3218
+ const { onSelectImages } = index$3.useImagePicker(imageFilesInit, setImageFiles);
3219
+ const handleClick = () => {
3220
+ var _a;
3221
+ (_a = imageRef === null || imageRef === void 0 ? void 0 : imageRef.current) === null || _a === void 0 ? void 0 : _a.click();
3222
+ };
3223
+ return (React__default["default"].createElement("div", { className: "input-group" },
3224
+ React__default["default"].createElement(StyleSessionRow, { onClick: handleClick },
3225
+ React__default["default"].createElement("img", { alt: "anonymous-icon", src: IconPhone, style: {
3226
+ width: '18px',
3227
+ height: '18px',
3228
+ objectFit: 'contain',
3229
+ marginLeft: 'auto',
3230
+ } }),
3231
+ React__default["default"].createElement("div", { className: "session-title" }, t('createPost.photos'))),
3232
+ React__default["default"].createElement("input", { ref: imageRef, type: "file", accept: "image/png, image/gif, image/jpeg", multiple: true, style: { display: 'none' }, onChange: (e) => onSelectImages(e) })));
3233
+ };
3234
+
3235
+ const TITLE_LIMIT = 120;
3236
+ const inputModify = (value, opts) => {
3237
+ if (!opts)
3238
+ return value;
3239
+ const { limit, bannedWords = [] } = opts;
3240
+ const shorten = typeof limit === 'number' && limit >= 0 ? value.substring(0, limit) : value;
3241
+ const processedValue = post.highlightBadWords(shorten, bannedWords);
3242
+ return processedValue;
3243
+ };
3244
+ const CreatePostTitle = ({ className, style, bannedWords = [], value, error, onChange, }) => {
3245
+ var _a;
3246
+ const _theme = core.useMantineTheme();
3247
+ const { t } = index.useTranslations();
3248
+ const [titleValue, setTitleValue] = React.useState('');
3249
+ const titleRef = React.useRef(null);
3250
+ React.useEffect(() => {
3251
+ if (titleRef.current) {
3252
+ const pasteHandler = (e) => {
3253
+ var _a;
3254
+ e.preventDefault();
3255
+ const text = (_a = e.clipboardData) === null || _a === void 0 ? void 0 : _a.getData('text/plain');
3256
+ document.execCommand('insertHTML', false, text);
3257
+ };
3258
+ const contentDiv = titleRef.current;
3259
+ contentDiv.addEventListener('paste', pasteHandler, {
3260
+ passive: true,
3261
+ });
3262
+ return () => contentDiv.removeEventListener('paste', pasteHandler);
3263
+ }
3264
+ }, [titleRef]);
3265
+ const bannedString = (bannedWords === null || bannedWords === void 0 ? void 0 : bannedWords.join(',')) || '';
3266
+ React.useEffect(() => {
3267
+ var _a;
3268
+ if (bannedString) {
3269
+ const titleText = (_a = titleRef.current) === null || _a === void 0 ? void 0 : _a.innerText;
3270
+ if (titleText) {
3271
+ const titleValueWithBanned = post.highlightBadWords(titleText, bannedWords);
3272
+ if (titleValueWithBanned !== titleText) {
3273
+ onChange && onChange(titleValueWithBanned);
3274
+ setTitleValue(titleValueWithBanned);
3275
+ }
3276
+ }
3277
+ }
3278
+ }, [bannedString]);
3279
+ React.useEffect(() => {
3280
+ setTimeout(() => {
3281
+ var _a;
3282
+ (_a = titleRef.current) === null || _a === void 0 ? void 0 : _a.focus();
3283
+ }, 500);
3284
+ }, []);
3285
+ return (React__default["default"].createElement(StyledCreatePostTitle, { className: className, style: style, color: _theme.colors[_theme.primaryColor][0], colorShadow: _theme.colors[_theme.primaryColor][2] },
3286
+ React__default["default"].createElement(StyleWrapperTitle, null,
3287
+ React__default["default"].createElement(index$2.Text, { size: "p4", className: "field-label" }, t('createPost.title')),
3288
+ React__default["default"].createElement(index$2.Text, { size: "p4", className: "count-string" }, t('createPost.popup.wordCount', {
3289
+ count: ((_a = titleRef.current) === null || _a === void 0 ? void 0 : _a.innerText.length) || 0,
3290
+ max: TITLE_LIMIT,
3291
+ }))),
3292
+ React__default["default"].createElement(index$4.Input, { name: "title", value: value || titleValue, size: "md", label: "", onChange: (str) => {
3293
+ const initialValue = inputModify(str, {
3294
+ bannedWords,
3295
+ });
3296
+ onChange && onChange(initialValue);
3297
+ setTitleValue(initialValue);
3298
+ }, className: `${ErrorFieldKey.title} ${error && (error === null || error === void 0 ? void 0 : error.title) ? 'has-input-error' : ''}` }),
3299
+ error && (error === null || error === void 0 ? void 0 : error.title) && (React__default["default"].createElement(StyledError, { style: { margin: '4px 0 0' } },
3300
+ React__default["default"].createElement(index$2.Text, { size: "p5", as: "span", color: miscTheme.theme.colors.red600 }, error.title)))));
3301
+ };
3302
+
3303
+ const StyleReviewPhoto = styled__default["default"].div `
3304
+ .mantine-Text-root {
3305
+ margin-bottom: 4px;
3306
+ }
3307
+ .preview-images-container {
3308
+ display: flex;
3309
+ gap: 8px;
3310
+ overflow-x: auto;
3311
+ overflow-y: hidden;
3312
+ .image-src-wrapper {
3313
+ flex: 0 0 116px;
3314
+ width: 116px;
3315
+ height: 116px;
3316
+ border-radius: 4px;
3317
+ position: relative;
3318
+ img {
3319
+ border-radius: 4px;
3320
+ }
3321
+ .icon-close {
3322
+ position: absolute;
3323
+ top: 6px;
3324
+ right: 6px;
3325
+ cursor: pointer;
3326
+ z-index: 10;
3327
+ max-height: 24px;
3328
+ max-width: 24px;
3329
+ }
3330
+
3331
+ &.image-has-error {
3332
+ .preview-image {
3333
+ border: 1.5px solid ${miscTheme.theme.colors.red600};
3334
+ }
3335
+ }
3336
+ }
3337
+ }
3338
+ `;
3339
+
3340
+ const PostPhotosReview = ({ error, imageFiles: imageFilesInit, indexImageError = [], setIndexImageError, setImageFiles, removeKeyError, }) => {
3341
+ const { t } = index.useTranslations();
3342
+ const { imageSrcs, onRemoveImage } = index$3.useImagePicker(imageFilesInit, setImageFiles);
3343
+ return (React__default["default"].createElement(StyleReviewPhoto, { className: "input-group" },
3344
+ React__default["default"].createElement(index$2.Text, { size: "p5", weight: "semiBold" }, t('createPost.photos')),
3345
+ React__default["default"].createElement("div", { className: `${ErrorFieldKey.photos} preview-images-container` }, imageSrcs === null || imageSrcs === void 0 ? void 0 : imageSrcs.map((src, index) => {
3346
+ const imageError = indexImageError.includes(index);
3347
+ return (React__default["default"].createElement("div", { className: `image-src-wrapper ${imageError ? 'image-has-error' : ''}`, key: index },
3348
+ React__default["default"].createElement("img", { src: src, className: "preview-image", alt: "", style: {
3349
+ width: '100%',
3350
+ height: '100%',
3351
+ objectFit: 'cover',
3352
+ } }),
3353
+ React__default["default"].createElement("img", { alt: "", className: "icon-close", src: index$3.IconCloseCircle, onClick: () => {
3354
+ removeKeyError && removeKeyError('photos');
3355
+ onRemoveImage(index);
3356
+ const newIndexError = indexImageError.filter((item) => item !== index) || [];
3357
+ setIndexImageError(newIndexError);
3358
+ } })));
3359
+ })),
3360
+ error && (error === null || error === void 0 ? void 0 : error.photos) && (React__default["default"].createElement(StyledError, null,
3361
+ React__default["default"].createElement(index$2.Text, { size: "p5", color: miscTheme.theme.colors.red600 }, error.photos)))));
3362
+ };
3363
+
3364
+ var img = "data:image/svg+xml,%3csvg width='27' height='34' viewBox='0 0 27 34' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M26.6198 30.8276C26.1994 29.8612 25.6858 28.938 25.0862 28.0712C24.7039 27.4646 24.1752 26.9639 23.5487 26.6152L20.809 24.8984H6.56441L3.82386 26.6152C3.19735 26.9639 2.66863 27.4646 2.28637 28.0712C1.68686 28.938 1.1733 29.8612 0.752979 30.8276C0.66293 31.0085 0.641973 31.216 0.694039 31.4113C0.746105 31.6065 0.867615 31.776 1.03578 31.8881C3.0517 33.0766 8.44044 33.6133 13.6865 33.6133C18.9327 33.6133 24.3197 33.0766 26.3357 31.8881C26.5041 31.7762 26.6259 31.6068 26.6782 31.4116C26.7305 31.2163 26.7098 31.0087 26.6198 30.8276Z' fill='%23626D7C'/%3e%3cpath d='M10.0127 16.6728C11.3205 16.6728 12.3808 15.6125 12.3808 14.3046C12.3808 12.9968 11.3205 11.9365 10.0127 11.9365C8.70478 11.9365 7.64453 12.9968 7.64453 14.3046C7.64453 15.6125 8.70478 16.6728 10.0127 16.6728Z' fill='%23626D7C'/%3e%3cpath d='M17.3642 16.6728C18.6721 16.6728 19.7323 15.6125 19.7323 14.3046C19.7323 12.9968 18.6721 11.9365 17.3642 11.9365C16.0563 11.9365 14.9961 12.9968 14.9961 14.3046C14.9961 15.6125 16.0563 16.6728 17.3642 16.6728Z' fill='%23626D7C'/%3e%3cpath d='M21.9864 28.0466C22.082 29.5658 21.4126 32.585 21.0465 33.4184C20.347 33.5359 19.612 33.6342 18.8497 33.7162C19.2541 28.6723 18.254 25.817 17.3633 23.1885C19.6065 23.9945 20.3088 24.4426 20.8088 24.8989C21.6531 25.664 21.8006 26.2187 21.6094 26.5192C21.4181 26.828 20.5082 27.0438 20.5082 27.0438C21.6831 27.3225 21.9564 27.5958 21.9864 28.0466Z' fill='%2387909C'/%3e%3cpath d='M10.0121 23.1885C9.11859 25.817 8.11855 28.6723 8.52293 33.7162C7.76061 33.6342 7.02561 33.5359 6.32613 33.4184C5.95999 32.585 5.29057 29.5658 5.3862 28.0466C5.41625 27.5958 5.68949 27.3225 6.8644 27.0438C6.8644 27.0438 5.95726 26.828 5.76326 26.5219C5.56927 26.2159 5.72228 25.664 6.56384 24.8989C7.06659 24.4426 7.76881 23.9945 10.0121 23.1885Z' fill='%2387909C'/%3e%3cpath d='M3.82307 26.6153L6.56361 24.8994C5.72205 25.6645 5.57177 26.2191 5.76304 26.5224C5.9543 26.8257 6.86417 27.0443 6.86417 27.0443C5.68926 27.323 5.41603 27.5962 5.38597 28.0471C5.29034 29.5663 5.95977 32.5855 6.3259 33.4189C3.99248 33.0391 2.07164 32.4981 1.03608 31.8888C0.868115 31.7766 0.746669 31.6072 0.694385 31.4122C0.6421 31.2171 0.662547 31.0097 0.751911 30.8286C1.17295 29.8624 1.68628 28.9392 2.28476 28.0717C2.66772 27.4653 3.19662 26.9645 3.82307 26.6153Z' fill='%23626D7C'/%3e%3cpath d='M26.6201 30.8286C26.7101 31.0096 26.7309 31.2172 26.6786 31.4124C26.6262 31.6077 26.5044 31.7771 26.3359 31.8888C25.3031 32.4981 23.3822 33.0391 21.0461 33.4189C21.4122 32.5855 22.0816 29.5663 21.986 28.0471C21.956 27.5962 21.6827 27.323 20.5078 27.0443C20.5078 27.0443 21.4177 26.8285 21.6089 26.5197C21.8002 26.2191 21.6527 25.6645 20.8084 24.8994L23.5489 26.6153C24.1754 26.9645 24.7043 27.4653 25.0872 28.0717C25.6863 28.9388 26.1996 29.8621 26.6201 30.8286Z' fill='%23626D7C'/%3e%3cpath d='M17.3632 23.1885C18.254 25.817 19.254 28.6723 18.8496 33.7162C17.1356 33.9049 15.4126 33.9998 13.6882 34.0004C11.963 33.9997 10.239 33.9049 8.5241 33.7162C8.11971 28.6723 9.11975 25.817 10.0132 23.1885C10.2264 22.4453 10.5843 22.3497 10.8411 22.3797C11.4805 22.4562 12.1171 23.0136 13.6828 23.0136H13.691C15.2566 23.0136 15.896 22.4562 16.5326 22.3797C16.7895 22.3497 17.1501 22.4453 17.3632 23.1885Z' fill='%23D2D6DC'/%3e%3cpath d='M21.5965 8.49707H5.7789C3.77117 8.55172 2.41347 9.08289 2.59189 9.89057C2.8889 11.2362 7.55957 13.0035 13.6877 13.0035C19.8158 13.0035 24.4865 11.2362 24.7835 9.89057C24.9619 9.08289 23.6042 8.55117 21.5965 8.49707Z' fill='%2387909C'/%3e%3cpath d='M21.6065 8.49671C21.6725 8.82817 21.7208 9.1629 21.7513 9.49949C21.7513 10.2072 18.1009 11.2263 13.6882 11.2263C9.27542 11.2263 5.625 10.2072 5.625 9.49949C5.65547 9.1629 5.70381 8.82817 5.76981 8.49671C6.50755 4.6441 9.52133 -0.744085 12.8001 1.00735C13.0736 1.15268 13.3785 1.22867 13.6882 1.22867C13.9978 1.22867 14.3027 1.15268 14.5762 1.00735C17.855 -0.744085 20.8688 4.6441 21.6065 8.49671Z' fill='%23626D7C'/%3e%3c/svg%3e";
3365
+ var AvatarAnonymous = img;
3366
+
3367
+ const MAX_SIZE_FILE_UPLOAD = 10 * 1024 * 1024;
3368
+ const applySpecialCharSite = [
3369
+ Locale.LOCALE.PhilippinesEnglish,
3370
+ Locale.LOCALE.PhilippinesTagalog,
3371
+ Locale.LOCALE.Indonesia,
3372
+ Locale.LOCALE.Malaysia,
3373
+ Locale.LOCALE.Vietnam,
3374
+ ];
3375
+ const CreateNewPostContentV2 = ({ className, style, onClose, forceSelectCommunity, articleId, editPostData, defaultCommunity, defaultTopics, userInfo, isMarryBaby = false, }) => {
3376
+ const isInEditMode = !!(editPostData === null || editPostData === void 0 ? void 0 : editPostData.id);
3377
+ const { data: { locale, env: { togetherBasePath }, }, action: { pushNotifications, sanitizeFunction }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
3378
+ const { t } = index.useTranslations();
3379
+ const containerRef = React.useRef(null);
3380
+ const [isAskDoctor, setIsAskDoctor] = React.useState(false);
3381
+ const [specialCharErr, setspecialCharErr] = React.useState(false);
3382
+ const [titleValue, setTitleValue] = React.useState('');
3383
+ const [descriptionValue, setDescriptionValue] = React.useState('');
3384
+ const [communityValue, setCommunityValue] = React.useState({
3385
+ label: t('community.choose'),
3386
+ value: '',
3387
+ });
3388
+ const [selectedTopics, setSelectedTopics] = React.useState([]);
3389
+ const [error, setError] = React.useState({});
3390
+ const [imageFiles, setImageFiles] = React.useState([]);
3391
+ const [bannedWords, setBannedWords] = React.useState([]);
3392
+ const [indexImageError, setIndexImageError] = React.useState([]);
3393
+ const [postActionValue, setPostActionValue] = React.useState({
3394
+ label: t('cardPost.public'),
3395
+ value: 'public',
3396
+ });
3397
+ const [communitiesList, setCommunitiesList] = React.useState([]);
3398
+ const [topicsList, setTopicsList] = React.useState([]);
3399
+ const { imageSrcs = [] } = index$3.useImagePicker(imageFiles);
3400
+ const [previewUrl, setPreviewUrl] = React.useState(null);
3401
+ const [invalidUrls, setInvalidUrls] = React.useState([]);
3402
+ const [stepPost, setStepPost] = React.useState('step_info');
3403
+ const [isLoadingSuggest, setIsLoadingSuggest] = React.useState(false);
3404
+ const [uncategorizedId, setUncategorizedId] = React.useState('');
3405
+ const postActionType = [
3406
+ {
3407
+ label: t('cardPost.public'),
3408
+ value: 'public',
3409
+ icon: (React__default["default"].createElement("img", { alt: "anonymous-icon", src: IconPublic, style: {
3410
+ width: '100%',
3411
+ height: '100%',
3412
+ objectFit: 'contain',
3413
+ marginLeft: 'auto',
3414
+ } })),
3415
+ },
3416
+ {
3417
+ label: t('cardPost.option.anonymous'),
3418
+ value: 'anonymous',
3419
+ icon: (React__default["default"].createElement("img", { alt: "anonymous-icon", src: IconAnonymous, style: {
3420
+ width: '100%',
3421
+ height: '100%',
3422
+ objectFit: 'contain',
3423
+ marginLeft: 'auto',
3424
+ } })),
3425
+ },
3426
+ ];
3427
+ const currentCommunity = React.useMemo(() => {
3428
+ if (!communityValue.value)
3429
+ return null;
3430
+ const result = communitiesList.find((item) => String(item.id) === String(communityValue.value));
3431
+ if (!result)
3432
+ return null;
3433
+ return result;
3434
+ }, [communityValue, communitiesList]);
3435
+ // HANDLE etra action when OPEN AND CLOSE
3436
+ React.useEffect(() => {
3437
+ if (editPostData) {
3438
+ const post$1 = editPostData;
3439
+ setTitleValue(post$1.title || '');
3440
+ setDescriptionValue(post.decodeMention(post.decodePostUrl(post$1.description || '', 'edit'), post$1.mentions));
3441
+ setCommunityValue({
3442
+ label: post$1.community.name,
3443
+ value: `${post$1.community.id || ''}-${post$1.community.mappedCategoryId || ''}`,
3444
+ });
3445
+ setSelectedTopics(post$1.topics || []);
3446
+ setImageFiles(post$1.photos || []);
3447
+ setIsAskDoctor(!!post$1.isAskDoctor || false);
3448
+ }
3449
+ else {
3450
+ if (defaultCommunity) {
3451
+ setCommunityValue({
3452
+ label: defaultCommunity.name,
3453
+ value: `${defaultCommunity.id || ''}-${defaultCommunity.mappedCategoryId || ''}`,
3454
+ });
3455
+ }
3456
+ if (defaultTopics) {
3457
+ setSelectedTopics(defaultTopics);
3458
+ }
3459
+ }
3460
+ }, []);
3461
+ React.useEffect(() => {
3462
+ setspecialCharErr(applySpecialCharSite.includes(locale) &&
3463
+ titleValue !== '' &&
3464
+ !/[a-zA-Z]/.test(titleValue));
3465
+ setError({});
3466
+ }, [titleValue]);
3467
+ React.useEffect(() => {
3468
+ (() => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
3469
+ var _a, _b, _c;
3470
+ const [resListCommunity, resListTopic, resUncategorized] = yield Promise.all([
3471
+ togetherComponentGlobalContext.callApiWithAuth(togetherComponentGlobalContext.getApiPath(togetherApiPaths.PATHS.COMMUNITY.LIST, {
3472
+ _locale: locale,
3473
+ pageSize: 100,
3474
+ }), 'GET'),
3475
+ togetherComponentGlobalContext.callApiWithAuth(togetherComponentGlobalContext.getApiPath(togetherApiPaths.PATHS.TOPIC.LIST, {
3476
+ _locale: locale,
3477
+ pageSize: 100,
3478
+ }), 'GET'),
3479
+ togetherComponentGlobalContext.callApiWithAuth(togetherComponentGlobalContext.getApiPath(togetherApiPaths.PATHS.COMMUNITY.GET_UNCATEGORIZED, {
3480
+ _locale: locale,
3481
+ }), 'GET'),
3482
+ ]);
3483
+ const communitiesApi = (_a = resListCommunity === null || resListCommunity === void 0 ? void 0 : resListCommunity.data) === null || _a === void 0 ? void 0 : _a.communities;
3484
+ if (Array.isArray(communitiesApi) && communitiesApi.length) {
3485
+ setCommunitiesList(communitiesApi);
3486
+ }
3487
+ const topicRes = (_b = resListTopic === null || resListTopic === void 0 ? void 0 : resListTopic.data) === null || _b === void 0 ? void 0 : _b.topics;
3488
+ if (Array.isArray(topicRes)) {
3489
+ setTopicsList(() => topicRes === null || topicRes === void 0 ? void 0 : topicRes.map(dataTransform.formatTopic));
3490
+ }
3491
+ const uncategorizedApi = (_c = resUncategorized === null || resUncategorized === void 0 ? void 0 : resUncategorized.data) === null || _c === void 0 ? void 0 : _c.communities;
3492
+ if (Array.isArray(uncategorizedApi) && uncategorizedApi.length) {
3493
+ setUncategorizedId(String(uncategorizedApi[0].id));
3494
+ }
3495
+ }))();
3496
+ }, []);
3497
+ const validationUploadPhoto = (files) => {
3498
+ const errorMessage = Object.assign({}, error);
3499
+ if (files && files.length > 10) {
3500
+ errorMessage.photos = t('createPost.message.photoMaxium');
3501
+ }
3502
+ if (files && files.length) {
3503
+ let inValidSizeFile = false;
3504
+ const indexInValid = [];
3505
+ files.forEach((file, index) => {
3506
+ if ((file === null || file === void 0 ? void 0 : file.size) > MAX_SIZE_FILE_UPLOAD) {
3507
+ inValidSizeFile = true;
3508
+ indexInValid.push(index);
3509
+ }
3510
+ });
3511
+ if (inValidSizeFile) {
3512
+ errorMessage.photos = t('createPost.message.photoSize');
3513
+ }
3514
+ setIndexImageError(indexInValid);
3515
+ }
3516
+ else {
3517
+ setIndexImageError([]);
3518
+ }
3519
+ setError(errorMessage);
3520
+ };
3521
+ const validationPost = () => {
3522
+ let hasError = false;
3523
+ const errorMessage = {};
3524
+ const description = innertext__default["default"](descriptionValue);
3525
+ if (!description) {
3526
+ errorMessage.description = t('createPost.message.requiredDescription');
3527
+ hasError = true;
3528
+ }
3529
+ if (!titleValue) {
3530
+ errorMessage.title = t('createPost.message.requiredTitle');
3531
+ hasError = true;
3532
+ }
3533
+ if (description && description.split(' ').length < 10) {
3534
+ errorMessage.description = t('createPost.message.lengthDescription', {
3535
+ currentLength: description.split(' ').length,
3536
+ });
3537
+ hasError = true;
3538
+ }
3539
+ if (titleValue && titleValue.split(' ').length < 5) {
3540
+ errorMessage.title = t('createPost.message.lengthTitle');
3541
+ hasError = true;
3542
+ }
3543
+ if (imageFiles && imageFiles.length > 10) {
3544
+ errorMessage.photos = t('createPost.message.photoMaxium');
3545
+ hasError = true;
3546
+ }
3547
+ if (imageFiles && imageFiles.length) {
3548
+ let inValidSizeFile = false;
3549
+ const indexInValid = [];
3550
+ imageFiles.forEach((file, index) => {
3551
+ if ((file === null || file === void 0 ? void 0 : file.size) > MAX_SIZE_FILE_UPLOAD) {
3552
+ inValidSizeFile = true;
3553
+ indexInValid.push(index);
3554
+ }
3555
+ });
3556
+ if (inValidSizeFile) {
3557
+ errorMessage.photos = t('createPost.message.photoSize');
3558
+ hasError = true;
3559
+ }
3560
+ setIndexImageError(indexInValid);
3561
+ }
3562
+ else {
3563
+ setIndexImageError([]);
3564
+ }
3565
+ if (invalidUrls && invalidUrls.length) {
3566
+ errorMessage.video = 'Invalid video url';
3567
+ hasError = true;
3568
+ }
3569
+ setError(errorMessage);
3570
+ return hasError;
3571
+ };
3572
+ const removeKeyError = (deleteKey) => {
3573
+ if (error[deleteKey]) {
3574
+ const _a = Object.assign({}, error), _b = `${deleteKey}`, value = _a[_b], rest = tslib_es6.__rest(_a, [typeof _b === "symbol" ? _b : _b + ""]);
3575
+ setError(rest);
3576
+ console.log(value);
3577
+ }
3578
+ };
3579
+ const submitPost = (uncategorized) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
3580
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
3581
+ const isError = validationPost();
3582
+ if (isError)
3583
+ return;
3584
+ const bodyFormData = yield index$3.getPostFormData({
3585
+ title: titleValue,
3586
+ description: descriptionValue,
3587
+ communityId: uncategorized
3588
+ ? uncategorizedId
3589
+ : String((currentCommunity === null || currentCommunity === void 0 ? void 0 : currentCommunity.id) || ''),
3590
+ imageFiles,
3591
+ previewUrl,
3592
+ topicIds: uncategorized
3593
+ ? []
3594
+ : selectedTopics === null || selectedTopics === void 0 ? void 0 : selectedTopics.map((topic) => String(topic.id || '')).filter(Boolean),
3595
+ locale,
3596
+ sanitizeFunction,
3597
+ categoryCommunityId: String((currentCommunity === null || currentCommunity === void 0 ? void 0 : currentCommunity.mappedCategoryId) || ''),
3598
+ categoryTopicIds: selectedTopics === null || selectedTopics === void 0 ? void 0 : selectedTopics.map((topic) => String((topic === null || topic === void 0 ? void 0 : topic.mappedCategoryId) || '')).filter(Boolean),
3599
+ isAnonymous: (postActionValue === null || postActionValue === void 0 ? void 0 : postActionValue.value) === 'anonymous' ? 1 : 0,
3600
+ isAskDoctor: isAskDoctor ? 1 : 0,
3601
+ introUrl: '',
3602
+ });
3603
+ if (articleId) {
3604
+ bodyFormData.append('article_id', articleId);
3605
+ }
3606
+ let res;
3607
+ if (isInEditMode) {
3608
+ if (editPostData === null || editPostData === void 0 ? void 0 : editPostData.id) {
3609
+ res = yield index$3.editPost({
3610
+ id: editPostData.id,
3611
+ formData: bodyFormData,
3612
+ locale,
3613
+ });
3614
+ }
3615
+ }
3616
+ else {
3617
+ res = yield index$3.createPost({
3618
+ formData: bodyFormData,
3619
+ locale,
3620
+ isArticleComment: !(currentCommunity === null || currentCommunity === void 0 ? void 0 : currentCommunity.id) && !!(currentCommunity === null || currentCommunity === void 0 ? void 0 : currentCommunity.mappedCategoryId),
3621
+ });
3622
+ }
3623
+ const resData = res === null || res === void 0 ? void 0 : res.data;
3624
+ if ((resData === null || resData === void 0 ? void 0 : resData.id) && !((_b = (_a = res === null || res === void 0 ? void 0 : res.messages) === null || _a === void 0 ? void 0 : _a.moderation) === null || _b === void 0 ? void 0 : _b.type)) {
3625
+ const params = `action=${editPostData ? 'editPost' : 'createPost'}&askDoctor=${(resData === null || resData === void 0 ? void 0 : resData.isAskDoctor) ? 'true' : 'false'}`;
3626
+ const postHref = `${togetherComponentGlobalContext.getCurrentBaseUrl(locale)}/${togetherBasePath}${(_c = resData === null || resData === void 0 ? void 0 : resData.community) === null || _c === void 0 ? void 0 : _c.slug}/${resData === null || resData === void 0 ? void 0 : resData.slug}/?${params}`;
3627
+ window.location.href = postHref;
3628
+ }
3629
+ else {
3630
+ if (((_e = (_d = res === null || res === void 0 ? void 0 : res.messages) === null || _d === void 0 ? void 0 : _d.moderation) === null || _e === void 0 ? void 0 : _e.type) === 'banned') {
3631
+ pushNotifications({
3632
+ title: t('notification.post.blocked.title'),
3633
+ message: t('notification.post.blocked.message'),
3634
+ type: 'danger',
3635
+ });
3636
+ if (res.messages.moderation.words) {
3637
+ setBannedWords(res.messages.moderation.words);
3638
+ }
3639
+ }
3640
+ else if (((_g = (_f = res === null || res === void 0 ? void 0 : res.messages) === null || _f === void 0 ? void 0 : _f.moderation) === null || _g === void 0 ? void 0 : _g.type) === 'suspect') {
3641
+ pushNotifications({
3642
+ title: t('notification.post.suspect.title'),
3643
+ message: t('notification.post.suspect.message'),
3644
+ type: 'warning',
3645
+ });
3646
+ onClose && onClose();
3647
+ }
3648
+ else if ((_j = (_h = res === null || res === void 0 ? void 0 : res.messages) === null || _h === void 0 ? void 0 : _h.find) === null || _j === void 0 ? void 0 : _j.call(_h, (m) => { var _a; return !!((_a = m === null || m === void 0 ? void 0 : m.includes) === null || _a === void 0 ? void 0 : _a.call(m, 'suspend')); })) {
3649
+ pushNotifications({
3650
+ message: t('notification.suspend.message'),
3651
+ type: 'danger',
3652
+ });
3653
+ onClose && onClose();
3654
+ }
3655
+ else {
3656
+ pushNotifications({
3657
+ message: ((_k = res === null || res === void 0 ? void 0 : res.messages) === null || _k === void 0 ? void 0 : _k[0]) || t('notification.failure'),
3658
+ type: 'danger',
3659
+ });
3660
+ }
3661
+ }
3662
+ });
3663
+ const getFirstOrderErroKey = (orderKey) => {
3664
+ const result = orderKey.find((key) => {
3665
+ if (error.hasOwnProperty(key) && error[key]) {
3666
+ return true;
3667
+ }
3668
+ return false;
3669
+ });
3670
+ if (!result)
3671
+ return '';
3672
+ return ErrorFieldKey[result];
3673
+ };
3674
+ const handleScrollToError = (selectorKey) => {
3675
+ if ((containerRef === null || containerRef === void 0 ? void 0 : containerRef.current) && selectorKey) {
3676
+ const errorFieldElm = document.querySelector(`.${selectorKey}`);
3677
+ if (errorFieldElm && containerRef.current) {
3678
+ const elm = containerRef.current;
3679
+ if (elm) {
3680
+ elm.scrollTo({
3681
+ top: errorFieldElm.offsetTop - 40,
3682
+ behavior: 'smooth',
3683
+ });
3684
+ }
3685
+ }
3686
+ }
3687
+ };
3688
+ const onSubmitContinuePost = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
3689
+ const isError = validationPost();
3690
+ if (isError) {
3691
+ const keyElmToScroll = getFirstOrderErroKey(orderErrorFieldKey);
3692
+ handleScrollToError(keyElmToScroll);
3693
+ return;
3694
+ }
3695
+ setStepPost('step_community');
3696
+ // Current just apply ai suggest community for Vietnam site
3697
+ if (locale === Locale.LOCALE.Vietnam && !isMarryBaby && !isInEditMode) {
3698
+ try {
3699
+ setIsLoadingSuggest(true);
3700
+ const res = yield togetherComponentGlobalContext.callApiWithAuth(togetherComponentGlobalContext.getChatbotAiApiPath(togetherApiPaths.PATHS.CHATBOT.GET_SUGGEST_COMMUNITY), 'POST', {
3701
+ data: {
3702
+ title: titleValue,
3703
+ description: descriptionValue,
3704
+ },
3705
+ headers: {
3706
+ 'Content-Type': 'application/json',
3707
+ },
3708
+ });
3709
+ if (!res)
3710
+ throw new Error();
3711
+ if (res === null || res === void 0 ? void 0 : res.community) {
3712
+ // Check community is exist list communities
3713
+ const suggestResult = communitiesList.find((item) => String(item.id) === String(res === null || res === void 0 ? void 0 : res.community.id));
3714
+ if (suggestResult) {
3715
+ setCommunityValue({
3716
+ label: suggestResult.name,
3717
+ value: String(suggestResult.id),
3718
+ });
3719
+ const topicSuggested = [];
3720
+ res.topic.forEach((item) => {
3721
+ const topicResult = topicsList.find((x) => String(x === null || x === void 0 ? void 0 : x.id) === String(item.id));
3722
+ if (topicResult) {
3723
+ topicSuggested.push(topicResult);
3724
+ }
3725
+ });
3726
+ setSelectedTopics(topicSuggested);
3727
+ }
3728
+ }
3729
+ }
3730
+ catch (err) {
3731
+ console.log('err');
3732
+ }
3733
+ finally {
3734
+ setIsLoadingSuggest(false);
3735
+ }
3736
+ }
3737
+ });
3738
+ return (React__default["default"].createElement(StyledCreateNewPost, { className: `${className} create-post-popup-frame`, style: style },
3739
+ React__default["default"].createElement("div", { className: "input-group-container", ref: containerRef },
3740
+ React__default["default"].createElement(StyledFormGroupInner, null,
3741
+ React__default["default"].createElement("div", { className: "input-group" },
3742
+ React__default["default"].createElement(StylePostAction, null,
3743
+ React__default["default"].createElement("div", { className: `avatar ${postActionValue.value === 'anonymous'
3744
+ ? 'avatar-anonymous'
3745
+ : ''}` }, postActionValue.value === 'anonymous' ? (React__default["default"].createElement("img", { alt: "avatar-icon", src: AvatarAnonymous, style: {
3746
+ width: '100%',
3747
+ height: '100%',
3748
+ objectFit: 'contain',
3749
+ marginLeft: 'auto',
3750
+ } })) : (userInfo === null || userInfo === void 0 ? void 0 : userInfo.avatar) ? (React__default["default"].createElement("img", { alt: "avatar-icon", src: userInfo === null || userInfo === void 0 ? void 0 : userInfo.avatar, style: {
3751
+ width: '100%',
3752
+ height: '100%',
3753
+ objectFit: 'contain',
3754
+ marginLeft: 'auto',
3755
+ } })) : (React__default["default"].createElement(togetherMoleculesCardAuthor.CardAuthor, { showDetailPopup: false, avatar: "", avatarProps: { size: 40 }, name: userInfo === null || userInfo === void 0 ? void 0 : userInfo.name, userId: userInfo === null || userInfo === void 0 ? void 0 : userInfo.userId, className: "author-avatar" }))),
3756
+ React__default["default"].createElement("div", { className: "post-action-form" },
3757
+ React__default["default"].createElement("div", { className: "post-action-by" }, (postActionValue === null || postActionValue === void 0 ? void 0 : postActionValue.value) === 'anonymous'
3758
+ ? t('cardPost.anonymous')
3759
+ : userInfo === null || userInfo === void 0 ? void 0 : userInfo.name),
3760
+ React__default["default"].createElement(index$8.Dropdown, { disabled: isInEditMode, options: postActionType, id: "post-action-type", size: "sm", className: "dropdown-post-action", placeholder: t('community.choose'), value: postActionValue, onChange: (option) => {
3761
+ setPostActionValue({
3762
+ label: option.label,
3763
+ value: String(option.value),
3764
+ });
3765
+ }, placeholderIcon: React__default["default"].createElement("div", { className: "post-action-result" }, postActionValue.value === 'public' ? (React__default["default"].createElement("img", { alt: "public-icon", src: IconPublic, style: {
3766
+ width: '100%',
3767
+ height: '100%',
3768
+ objectFit: 'contain',
3769
+ marginLeft: 'auto',
3770
+ } })) : (React__default["default"].createElement("img", { alt: "anonymous-icon", src: IconAnonymous, style: {
3771
+ width: '100%',
3772
+ height: '100%',
3773
+ objectFit: 'contain',
3774
+ marginLeft: 'auto',
3775
+ } }))), style: {
3776
+ zIndex: 10,
3777
+ width: 'calc(100% + 20px)',
3778
+ } })))),
3779
+ React__default["default"].createElement(CreatePostTitle, { className: "input-group", bannedWords: bannedWords, value: titleValue, error: error, onChange: setTitleValue }),
3780
+ specialCharErr && (React__default["default"].createElement(StyledError, null,
3781
+ React__default["default"].createElement(other.Info, { isSolid: true, color: miscTheme.theme.colors.red700, size: 14 }),
3782
+ React__default["default"].createElement(index$2.Text, { size: "p3", as: "span", color: miscTheme.theme.colors.red700 }, t('createPost.popup.specialCharErr')))),
3783
+ React__default["default"].createElement("div", { className: "input-group" },
3784
+ React__default["default"].createElement(CreatePostDescription, { bannedWords: bannedWords, value: descriptionValue, onChange: (v) => {
3785
+ setDescriptionValue(v);
3786
+ removeKeyError('description');
3787
+ }, onPreviewUrlChange: setPreviewUrl, onInvalidUrlsChange: setInvalidUrls, onImageFilesChange: setImageFiles, imageFiles: imageFiles, className: `${error && (error === null || error === void 0 ? void 0 : error.description) ? 'error-description' : ''}`, footerEditor: React__default["default"].createElement(React__default["default"].Fragment, null,
3788
+ React__default["default"].createElement(StyledIsQuestionWrapper, { className: `${error && (error === null || error === void 0 ? void 0 : error.description) ? 'error-description' : ''}` },
3789
+ React__default["default"].createElement(StyledIsQuestion, { color: miscTheme.theme.colors.primaryBase },
3790
+ React__default["default"].createElement("div", { className: "switch-label" },
3791
+ React__default["default"].createElement(other.Ask, { isMarryBaby: isMarryBaby, size: isMarryBaby ? 32 : 24, color: miscTheme.theme.colors.primaryBase, className: "label-icon" }),
3792
+ React__default["default"].createElement("div", { className: "wrapper-text" },
3793
+ React__default["default"].createElement("div", { className: "label-txt" }, t('createPost.askDoctor.description')))),
3794
+ React__default["default"].createElement(core.Switch, { checked: isAskDoctor, label: "", className: "switch-btn", size: "md", onChange: (v) => {
3795
+ setIsAskDoctor(v.target.checked);
3796
+ } }))),
3797
+ error && (error === null || error === void 0 ? void 0 : error.description) && (React__default["default"].createElement(StyledError, { style: { margin: '4px 0 0' } },
3798
+ React__default["default"].createElement(index$2.Text, { size: "p5", as: "span", color: miscTheme.theme.colors.red600 }, error.description)))) })),
3799
+ stepPost === 'step_community' && (React__default["default"].createElement(CreatePostCommunity, { communitiesList: communitiesList, currentCommunity: currentCommunity, selectedTopics: selectedTopics, communityValue: communityValue, defaultCommunity: forceSelectCommunity, error: error, isFullscreen: false, isMarryBaby: isMarryBaby, isInEditMode: isInEditMode, isLoadingSuggest: isLoadingSuggest, setSelectedTopics: setSelectedTopics, setCommunityValue: setCommunityValue, removeKeyError: removeKeyError, setStepPost: setStepPost, onSubmitPost: submitPost })),
3800
+ imageSrcs.length > 0 && (React__default["default"].createElement(PostPhotosReview, { imageFiles: imageFiles, error: error, indexImageError: indexImageError, setIndexImageError: setIndexImageError, setImageFiles: setImageFiles, removeKeyError: removeKeyError })))),
3801
+ React__default["default"].createElement(StyleActionFooter, null,
3802
+ React__default["default"].createElement(CreatePostPhotos, { imageFiles: imageFiles, setImageFiles: (data) => {
3803
+ setImageFiles(data);
3804
+ validationUploadPhoto(data);
3805
+ } }),
3806
+ React__default["default"].createElement("div", null,
3807
+ React__default["default"].createElement(index$1.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: onSubmitContinuePost, loading: isLoadingSuggest, disabled: isLoadingSuggest }, t('onboarding.button.continue'))))));
3808
+ };
3809
+
3810
+ const StyledTopicSelectList = styled__default["default"].div `
3811
+ display: flex;
3812
+ width: 100%;
3813
+ flex-wrap: wrap;
3814
+ margin-top: 1rem;
3815
+
3816
+ .tag-item {
3817
+ min-height: 32px;
3818
+ padding: 5px 12px;
3819
+ border: 1px solid ${miscTheme.theme.colors.neutral100};
3820
+ margin-right: 1rem;
3821
+ margin-bottom: 8px;
3822
+ border-radius: 1rem;
3823
+ color: ${miscTheme.theme.colors.gray800};
3824
+ cursor: pointer;
3825
+ font-size: 13px;
3826
+ line-height: 22px;
3827
+ transition: all 0.2s;
3828
+
3829
+ &.--active {
3830
+ border-color: ${miscTheme.theme.colors.primary50};
3831
+ background: ${miscTheme.theme.colors.primary50};
3832
+ color: ${miscTheme.theme.colors.primaryBase};
3833
+ }
3834
+ &[data-disabled='true'] {
3835
+ background: ${miscTheme.theme.colors.gray100};
3836
+ color: ${miscTheme.theme.colors.gray800};
3837
+ }
3838
+ }
3839
+ .topic-spinner {
3840
+ margin-right: auto;
3841
+ margin-left: auto;
3842
+ & > button {
3843
+ width: 24px;
3844
+ height: 24px;
3845
+ }
3846
+ }
3847
+ &[data-is-marrybaby='true'] {
3848
+ .tag-item {
3849
+ border-color: transparent;
3850
+ background: #f3f3f3;
3851
+ color: #3e3f58;
3852
+ &.--active {
3853
+ border-color: #b6cdff;
3854
+ background: #e0e9fb;
3855
+ color: #3e3f58;
3856
+ }
3857
+ }
3858
+ }
3859
+ `;
3860
+
3861
+ const TopicSelectList = ({ className, style, topics: topicsProp, communityId, onChange, isLoading, disabled, forceTopics, selectedTopics: selectedTopicsProp, noFetch, dataEventCategory, dataEventAction, dataEventLabel, }) => {
3862
+ const { data: { locale, env: { isMarryBaby }, }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
3863
+ const [topics, setTopics] = React.useState(topicsProp ? [...topicsProp] : []);
3864
+ const [selectedTopics, setSelectedTopics] = React.useState(selectedTopicsProp ? [...selectedTopicsProp] : []);
3865
+ const [isLoadingTopics, setIsLoadingTopics] = React.useState(false);
3866
+ const topicsPropRef = React.useRef(topicsProp);
3867
+ topicsPropRef.current = topicsProp;
3868
+ React.useEffect(() => {
3869
+ var _a;
3870
+ if (communityId && !noFetch && !((_a = topicsPropRef.current) === null || _a === void 0 ? void 0 : _a.length)) {
3871
+ setTopics([]);
3872
+ setIsLoadingTopics(true);
3873
+ (() => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
3874
+ var _b;
3875
+ try {
3876
+ const res = yield togetherComponentGlobalContext.callApi(togetherComponentGlobalContext.getApiPath(togetherApiPaths.PATHS.TOPIC.LIST, {
3877
+ communityId: communityId,
3878
+ _locale: locale,
3879
+ }), 'GET');
3880
+ const topicRes = (_b = res === null || res === void 0 ? void 0 : res.data) === null || _b === void 0 ? void 0 : _b.topics;
3881
+ if (Array.isArray(topicRes)) {
3882
+ setTopics(() => (topicRes === null || topicRes === void 0 ? void 0 : topicRes.map(dataTransform.formatTopic).sort((t1, t2) => (t1.order || 0) - (t2.order || 0))) || []);
3883
+ }
3884
+ }
3885
+ catch (e) {
3886
+ console.log(e);
3887
+ setIsLoadingTopics(false);
3888
+ }
3889
+ setIsLoadingTopics(false);
3890
+ }))();
3891
+ }
3892
+ }, [communityId, noFetch]);
3893
+ const topicsPropString = topicsProp === null || topicsProp === void 0 ? void 0 : topicsProp.map((t) => t.id).join('-');
3894
+ const topicsStateString = topics === null || topics === void 0 ? void 0 : topics.map((t) => t.id).join('-');
3895
+ const forceTopicsPropString = forceTopics === null || forceTopics === void 0 ? void 0 : forceTopics.map((t) => t.id).join('-');
3896
+ React.useEffect(() => {
3897
+ if (topicsProp &&
3898
+ typeof topicsPropString !== 'undefined' &&
3899
+ topicsPropString !== topicsStateString) {
3900
+ setTopics(topicsProp);
3901
+ }
3902
+ }, [topicsProp, topicsPropString, topicsStateString]);
3903
+ const topicsWithoutForced = React.useMemo(() => topics.filter((t) => !(forceTopics === null || forceTopics === void 0 ? void 0 : forceTopics.some((ft) => (ft.id && ft.id === t.id) ||
3904
+ (ft.mappedCategoryId &&
3905
+ ft.mappedCategoryId === t.mappedCategoryId)))), [topicsStateString, forceTopicsPropString]);
3906
+ return (React__default["default"].createElement(StyledTopicSelectList, { "data-is-marrybaby": isMarryBaby, className: className, style: style },
3907
+ forceTopics.map((topic) => (React__default["default"].createElement(TopicItem, { key: `${topic.id}-${topic.mappedCategoryId}`, topic: topic, disabled: true, selected: true, dataEventAction: dataEventAction, dataEventCategory: dataEventCategory, dataEventLabel: dataEventLabel }))),
3908
+ topicsWithoutForced.map((topic) => (React__default["default"].createElement(TopicItem, { key: `${topic.id}-${topic.mappedCategoryId}`, topic: topic, disabled: disabled, selected: (selectedTopicsProp || selectedTopics).some((t) => (t.id && t.id === topic.id) ||
3909
+ (t.mappedCategoryId &&
3910
+ t.mappedCategoryId === topic.mappedCategoryId)), onClick: () => {
3911
+ const _selected = selectedTopicsProp || selectedTopics;
3912
+ const foundIndex = _selected.findIndex((_selected) => (_selected.id && _selected.id === topic.id) ||
3913
+ (_selected.mappedCategoryId &&
3914
+ _selected.mappedCategoryId === topic.mappedCategoryId));
3915
+ if (foundIndex !== -1) {
3916
+ _selected.splice(foundIndex, 1);
3917
+ }
3918
+ else {
3919
+ _selected.push(topic);
3920
+ }
3921
+ if (onChange && selectedTopicsProp) {
3922
+ onChange(_selected.slice());
3923
+ }
3924
+ else {
3925
+ onChange && onChange(_selected.slice());
3926
+ setSelectedTopics(_selected.slice());
3927
+ }
3928
+ }, dataEventAction: dataEventAction, dataEventCategory: dataEventCategory, dataEventLabel: dataEventLabel }))),
3929
+ (isLoading || isLoadingTopics) && React__default["default"].createElement(togetherMoleculesCardAuthor.Loading, { className: "topic-spinner" })));
3930
+ };
3931
+ const TopicItem = (_a) => {
3932
+ var { topic, disabled, selected, onClick } = _a, rest = tslib_es6.__rest(_a, ["topic", "disabled", "selected", "onClick"]);
3933
+ return (React__default["default"].createElement("div", Object.assign({ className: 'tag-item' + (selected ? ' --active' : ''), "data-disabled": disabled, onClick: !disabled ? onClick : undefined }, rest), topic.name));
3934
+ };
3935
+
3936
+ var styles = {"skipBtn":"KsWg8i6","alertHeading":"_9tS0EUN","alertDesc":"kyyRKlb","alertAction":"-Uqqka-"};
3937
+
3938
+ const SkipQuestionOfExpertBtn = (_a) => {
3939
+ var { post, onSkip, btnText, currentPageUrl } = _a, rest = tslib_es6.__rest(_a, ["post", "onSkip", "btnText", "currentPageUrl"]);
3940
+ const { t } = index.useTranslations();
3941
+ const { data: { locale }, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
3942
+ const [showAlert, setShowAlert] = React.useState(false);
3943
+ const [loading, setLoading] = React.useState(false);
3944
+ const _theme = core.useMantineTheme();
3945
+ const handleSkip = React.useCallback(() => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
3946
+ var _b;
3947
+ setLoading(true);
3948
+ const res = yield togetherComponentGlobalContext.callApiWithAuth(togetherComponentGlobalContext.getApiPath(togetherApiPaths.PATHS.USER.SKIP_QUESTION, {
3949
+ _locale: locale,
3950
+ id: post === null || post === void 0 ? void 0 : post.id,
3951
+ }), 'PUT');
3952
+ if ((res === null || res === void 0 ? void 0 : res.status) === 1) {
3953
+ onSkip === null || onSkip === void 0 ? void 0 : onSkip({ id: (post === null || post === void 0 ? void 0 : post.id) || '', communityId: ((_b = post === null || post === void 0 ? void 0 : post.community) === null || _b === void 0 ? void 0 : _b.id) || '' });
3954
+ setShowAlert(false);
3955
+ pushNotifications({
3956
+ title: '',
3957
+ message: 'Skip success',
3958
+ type: 'success',
3959
+ });
3960
+ }
3961
+ else {
3962
+ pushNotifications({
3963
+ title: '',
3964
+ message: res === null || res === void 0 ? void 0 : res.messages,
3965
+ type: 'danger',
3966
+ });
3967
+ }
3968
+ setLoading(false);
3969
+ }), []);
3970
+ return (React__default["default"].createElement(core.Popover, { width: 327, withArrow: true, shadow: "md", opened: showAlert },
3971
+ React__default["default"].createElement(core.Popover.Target, null,
3972
+ React__default["default"].createElement("div", Object.assign({ className: `${styles.skipBtn} ${(rest === null || rest === void 0 ? void 0 : rest.className) || ''}`, onClick: () => setShowAlert(true) }, rest), btnText || t('profilePanel.questionNotClear'))),
3973
+ React__default["default"].createElement(core.Popover.Dropdown, null,
3974
+ React__default["default"].createElement("div", null,
3975
+ React__default["default"].createElement("div", { className: styles.alertHeading }, t('profilePanel.skipQuestion.heading')),
3976
+ React__default["default"].createElement("div", { className: styles.alertDesc }, t('profilePanel.skipQuestion.content')),
3977
+ React__default["default"].createElement("div", { className: styles.alertAction },
3978
+ React__default["default"].createElement(index$1.Button, { size: "md", variant: "secondary", leftIcon: React__default["default"].createElement(core$1.Close, { color: _theme.fn.primaryColor(), size: 24 }), onClick: () => setShowAlert(false), styles: () => ({
3979
+ leftIcon: {
3980
+ marginRight: 0,
3981
+ },
3982
+ }) }),
3983
+ React__default["default"].createElement(index$1.Button, { variant: "primary", size: "md", leftIcon: React__default["default"].createElement(core$1.Check, { color: 'white', size: 24 }), onClick: handleSkip, loading: loading, "data-event-category": "Together", "data-event-action": "Unclear Question Click", "data-event-label": currentPageUrl, styles: () => ({
3984
+ leftIcon: {
3985
+ marginRight: 0,
3986
+ },
3987
+ }) }))))));
3988
+ };
3989
+
3990
+ exports.CreateNewPostContent = CreateNewPostContent;
3991
+ exports.CreateNewPostContentV2 = CreateNewPostContentV2;
3992
+ exports.CreatePostDescription = CreatePostDescription$1;
3993
+ exports.CreatePostTitle = CreatePostTitle$1;
3994
+ exports.SkipQuestionOfExpertBtn = SkipQuestionOfExpertBtn;
3995
+ exports.TopicSelectList = TopicSelectList;