@hhgtech/hhg-components 1.29.81 → 1.29.82

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 (353) hide show
  1. package/build/{WhatsApp-82018096.js → WhatsApp-46f4f408.js} +1 -1
  2. package/build/adapters.js +16 -16
  3. package/build/atoms.js +53 -51
  4. package/build/babyGrowth.js +79 -79
  5. package/build/cache.js +3 -3
  6. package/build/care.js +17 -17
  7. package/build/components.js +108 -106
  8. package/build/{constants-3a475a22.js → constants-223c01fc.js} +2 -2
  9. package/build/{constants-dd16fb4d.js → constants-f182fc32.js} +5 -5
  10. package/build/constants.js +3 -3
  11. package/build/{core-9e44ee99.js → core-9d69a722.js} +2 -2
  12. package/build/{dataTransform-c1701cbd.js → dataTransform-ded2692d.js} +1 -1
  13. package/build/{dataTransform-6b4d7a4e.js → dataTransform-e39297c1.js} +3 -3
  14. package/build/ecom.js +5 -5
  15. package/build/esm/{WhatsApp-7d3732e2.js → WhatsApp-c599b715.js} +1 -1
  16. package/build/esm/adapters.js +16 -16
  17. package/build/esm/atoms.js +47 -45
  18. package/build/esm/babyGrowth.js +80 -80
  19. package/build/esm/cache.js +3 -3
  20. package/build/esm/care.js +17 -17
  21. package/build/esm/components.js +79 -77
  22. package/build/esm/{constants-ebf80e5f.js → constants-bb470362.js} +2 -2
  23. package/build/esm/{constants-6bdb97a8.js → constants-fa475b0f.js} +5 -5
  24. package/build/esm/constants.js +3 -3
  25. package/build/esm/{core-c72e0ff5.js → core-80bfe8b7.js} +2 -2
  26. package/build/esm/{dataTransform-6c032113.js → dataTransform-55f67eed.js} +1 -1
  27. package/build/esm/{dataTransform-3e8e25ba.js → dataTransform-623716c3.js} +4 -4
  28. package/build/esm/ecom.js +5 -5
  29. package/build/esm/{fixedBottomAdBlock-13ed4a34.js → fixedBottomAdBlock-60a5d48f.js} +27 -27
  30. package/build/esm/footer.js +18 -18
  31. package/build/esm/gAssets.js +4 -4
  32. package/build/esm/{getDynamicHealthTool-7681e43a.js → getDynamicHealthTool-82855adc.js} +4 -4
  33. package/build/esm/{getSocialList-e8142513.js → getSocialList-7d2cf48d.js} +5 -5
  34. package/build/esm/healthToolsForm.js +24 -24
  35. package/build/esm/hooks.js +17 -17
  36. package/build/esm/i18n.js +2 -2
  37. package/build/esm/i18nV2.js +2 -2
  38. package/build/esm/{index-7cbe2a10.js → index-01405723.js} +12 -12
  39. package/build/esm/{index-8952ceac.js → index-01b5d2e9.js} +4 -4
  40. package/build/esm/{index-88ad2ca3.js → index-02d3f05b.js} +19 -19
  41. package/build/esm/{index-73301602.js → index-046778af.js} +2 -2
  42. package/build/esm/{index-69248434.js → index-049e0270.js} +3 -3
  43. package/build/esm/{index-29d04985.js → index-07f3f47e.js} +2 -2
  44. package/build/esm/index-0b745f46.js +1349 -0
  45. package/build/esm/{index-780a08de.js → index-0ca9b175.js} +2 -2
  46. package/build/esm/{index-2774583d.js → index-0cd3523c.js} +31 -31
  47. package/build/esm/{index-42ad7763.js → index-0ee66974.js} +2 -2
  48. package/build/esm/index-10ab6596.js +489 -0
  49. package/build/esm/{index-cb4afb33.js → index-13d8dd4b.js} +6 -6
  50. package/build/esm/{index-87a2ea8c.js → index-1c9b481b.js} +2 -2
  51. package/build/esm/{index-2b9213cf.js → index-1d3c6ce7.js} +1 -1
  52. package/build/esm/{index-cf6beac8.js → index-21256394.js} +1 -1
  53. package/build/esm/{index-7e756cb8.js → index-219e3a35.js} +11 -11
  54. package/build/esm/{index-cdac57da.js → index-29908d2c.js} +1 -1
  55. package/build/esm/{index-1ecbcf21.js → index-2dc7803d.js} +5 -5
  56. package/build/esm/{index-c200bff6.js → index-5723381f.js} +2 -2
  57. package/build/esm/{index-bef3c9bd.js → index-6210f454.js} +2 -2
  58. package/build/esm/{index-76d20d3f.js → index-7a1ea734.js} +3 -3
  59. package/build/esm/{index-598ab51b.js → index-7c384ae6.js} +5 -5
  60. package/build/esm/{index-f27edf45.js → index-8eb04f36.js} +11 -11
  61. package/build/esm/{index-e104ad21.js → index-8fcf671c.js} +8 -8
  62. package/build/esm/{index-78255d6c.js → index-9471fca1.js} +2 -2
  63. package/build/esm/{index-21eac858.js → index-9b3a8b6d.js} +10 -10
  64. package/build/esm/{index-1da2ca0b.js → index-9b9c1499.js} +2 -2
  65. package/build/esm/{index-703205e3.js → index-9f99909b.js} +3 -3
  66. package/build/esm/{index-6ac73f00.js → index-ac2a8f95.js} +16 -16
  67. package/build/esm/{index-d6201fa4.js → index-acf8b60e.js} +2 -2
  68. package/build/esm/{index-c1af3a8e.js → index-bcedec73.js} +13 -13
  69. package/build/esm/{index-9f1899f2.js → index-c013ba1b.js} +4 -4
  70. package/build/esm/{index-e26514ee.js → index-c2584051.js} +4 -4
  71. package/build/esm/{types-2580132c.js → index-c430773c.js} +559 -3517
  72. package/build/esm/index-cdc50618.js +25 -0
  73. package/build/esm/{index-d218b94e.js → index-cfedca38.js} +2 -2
  74. package/build/esm/{index-38f50764.js → index-d6a5f5cf.js} +16 -16
  75. package/build/esm/{index-376bee14.js → index-e0b0d6a2.js} +7 -7
  76. package/build/esm/{index-996f7caf.js → index-ea63e0d2.js} +4 -4
  77. package/build/esm/{index-b1bb27aa.js → index-f22f6e6e.js} +10 -45
  78. package/build/esm/index-f4b938f2.js +18 -0
  79. package/build/esm/{index-16514f4d.js → index-f660abb7.js} +3 -3
  80. package/build/esm/index-fa67d66e.js +789 -0
  81. package/build/esm/index.js +91 -82
  82. package/build/esm/labelSorting-7351409a.js +47 -0
  83. package/build/esm/lead.js +21 -21
  84. package/build/esm/{logoIcon-d93bc56e.js → logoIcon-3a581efb.js} +2 -2
  85. package/build/esm/mantine.js +22 -22
  86. package/build/esm/misc.js +21 -21
  87. package/build/esm/molecules.js +56 -56
  88. package/build/esm/navigation.js +36 -36
  89. package/build/esm/onboardingV2.js +25 -25
  90. package/build/esm/organisms.js +40 -40
  91. package/build/esm/pwg.js +19 -19
  92. package/build/esm/{routing-bebdc8b7.js → routing-9e330438.js} +2 -2
  93. package/build/esm/subot.js +29 -29
  94. package/build/esm/surveyOrPremiumBanner.js +28 -28
  95. package/build/esm/surveyQuestionCard.js +10 -10
  96. package/build/esm/{surveyThankyouCard-bf6080eb.js → surveyThankyouCard-ec204631.js} +6 -6
  97. package/build/esm/together.js +51 -42
  98. package/build/esm/togetherAtoms.js +41 -0
  99. package/build/esm/togetherComponentGlobalContext.js +12 -0
  100. package/build/esm/togetherMolecules.js +53 -0
  101. package/build/esm/togetherOrganisms.js +57 -0
  102. package/build/esm/treePopoverMenu-cb214db6.js +332 -0
  103. package/build/esm/types-721e7a66.js +5 -0
  104. package/build/esm/{types-be952df2.js → types-ffcf5fb4.js} +13 -13
  105. package/build/esm/types.js +1 -1
  106. package/build/esm/{useCategory-8f109eb7.js → useCategory-553bee0b.js} +5 -5
  107. package/build/esm/{useHealthToolCache-d97dfa00.js → useHealthToolCache-6ce1724e.js} +2 -2
  108. package/build/esm/{useMantineLocale-4fb67342.js → useMantineLocale-453f8013.js} +3 -3
  109. package/build/esm/{usePlacesAutocomplete-fe2e4cbe.js → usePlacesAutocomplete-8925d4fb.js} +1 -1
  110. package/build/esm/useTogetherAuthRequiredAction.js +60 -0
  111. package/build/esm/{useTranslations-fbf6a6ab.js → useTranslations-b970f667.js} +1 -1
  112. package/build/esm/{utils-d5a0b58f.js → utils-3b29eb79.js} +6 -6
  113. package/build/esm/{utils-cef111b6.js → utils-6d45bdd1.js} +1 -1
  114. package/build/esm/vaccination.js +18 -18
  115. package/build/{fixedBottomAdBlock-0d4379d1.js → fixedBottomAdBlock-0129a006.js} +27 -27
  116. package/build/footer.js +18 -18
  117. package/build/gAssets.js +4 -4
  118. package/build/{getDynamicHealthTool-2a92e1a5.js → getDynamicHealthTool-f08b5fab.js} +4 -4
  119. package/build/{getSocialList-97e7bcc1.js → getSocialList-8cc32f7c.js} +5 -5
  120. package/build/healthToolsForm.js +24 -24
  121. package/build/hooks.js +17 -17
  122. package/build/i18n.js +1 -1
  123. package/build/i18nV2.js +1 -1
  124. package/build/{index-3d0d22b3.js → index-00a78d81.js} +16 -16
  125. package/build/index-077bf48f.js +803 -0
  126. package/build/{index-6bc3f8c3.js → index-0b727664.js} +5 -5
  127. package/build/{index-dcbd8bf3.js → index-10760994.js} +3 -3
  128. package/build/{index-247a9eb2.js → index-130e0f35.js} +33 -33
  129. package/build/{index-d5b4089d.js → index-16ed0d98.js} +12 -50
  130. package/build/{index-f1f4fbb9.js → index-1e1d8eb1.js} +13 -13
  131. package/build/{index-d34cd464.js → index-1fdf2f01.js} +2 -2
  132. package/build/{index-b773bc3d.js → index-206afefb.js} +4 -4
  133. package/build/{types-6c5643a2.js → index-2afbeb3d.js} +749 -3713
  134. package/build/{index-fe7345fa.js → index-2fd9063e.js} +2 -2
  135. package/build/{index-f10efb61.js → index-33432b02.js} +4 -4
  136. package/build/{index-a7de42d1.js → index-3eb666e6.js} +1 -1
  137. package/build/{index-264eeddd.js → index-405faafa.js} +2 -2
  138. package/build/{index-bef2bc73.js → index-4357a324.js} +11 -11
  139. package/build/index-466a2c32.js +1362 -0
  140. package/build/{index-73cde644.js → index-4b7d4b5b.js} +4 -4
  141. package/build/{index-77a2b9ee.js → index-4bc690c9.js} +1 -1
  142. package/build/index-4cdcdbbe.js +498 -0
  143. package/build/{index-06fa8444.js → index-53e14542.js} +2 -2
  144. package/build/{index-4af08ec2.js → index-54aeefca.js} +2 -2
  145. package/build/{index-058b3c0f.js → index-60f6d762.js} +16 -16
  146. package/build/{index-1efa7d84.js → index-64d8db08.js} +2 -2
  147. package/build/{index-cb0544e5.js → index-6aeb5ff5.js} +7 -7
  148. package/build/{index-3dcb9bc6.js → index-71843eb4.js} +4 -4
  149. package/build/{index-ee964d3c.js → index-765ed75d.js} +4 -4
  150. package/build/{index-dd1392e3.js → index-7953fb8e.js} +3 -3
  151. package/build/{index-7c1dc717.js → index-7ecc69af.js} +12 -12
  152. package/build/index-9e8877c0.js +25 -0
  153. package/build/{index-7da7b531.js → index-a2664204.js} +3 -3
  154. package/build/{index-f28c47ce.js → index-a6a9855f.js} +1 -1
  155. package/build/{index-aa818139.js → index-a8680a58.js} +2 -2
  156. package/build/{index-def9867a.js → index-a9bbb5aa.js} +11 -11
  157. package/build/{index-c225ef22.js → index-a9bdf889.js} +5 -5
  158. package/build/{index-838b0f95.js → index-b66ae554.js} +6 -6
  159. package/build/{index-dba2e361.js → index-ca616373.js} +2 -2
  160. package/build/{index-6c27b627.js → index-d9919cd2.js} +32 -32
  161. package/build/index-dd074159.js +32 -0
  162. package/build/{index-05f106c2.js → index-dff7ee1b.js} +10 -10
  163. package/build/{index-a86ea1b6.js → index-e3bbd009.js} +2 -2
  164. package/build/{index-6acb08c0.js → index-ec34e358.js} +8 -8
  165. package/build/{index-c2900d8c.js → index-f222ee45.js} +2 -2
  166. package/build/{index-f6575703.js → index-fd3e1d16.js} +2 -2
  167. package/build/index.js +176 -167
  168. package/build/labelSorting-f86081b7.js +53 -0
  169. package/build/lead.js +21 -21
  170. package/build/{logoIcon-ee9a5501.js → logoIcon-21a16853.js} +2 -2
  171. package/build/mantine.js +18 -18
  172. package/build/misc.js +21 -21
  173. package/build/molecules.js +56 -56
  174. package/build/navigation.js +36 -36
  175. package/build/onboardingV2.js +24 -24
  176. package/build/organisms.js +40 -40
  177. package/build/pwg.js +19 -19
  178. package/build/{routing-f6d54205.js → routing-d6c9099a.js} +2 -2
  179. package/build/subot.js +100 -100
  180. package/build/surveyOrPremiumBanner.js +28 -28
  181. package/build/surveyQuestionCard.js +10 -10
  182. package/build/{surveyThankyouCard-ead6b355.js → surveyThankyouCard-5b23b8f6.js} +6 -6
  183. package/build/together.js +99 -90
  184. package/build/togetherAtoms.js +55 -0
  185. package/build/togetherComponentGlobalContext.js +26 -0
  186. package/build/togetherMolecules.js +86 -0
  187. package/build/togetherOrganisms.js +71 -0
  188. package/build/treePopoverMenu-c0cb395f.js +343 -0
  189. package/build/{types-4ba4268f.js → types-8d9c5f21.js} +13 -13
  190. package/build/types-b25ffde0.js +7 -0
  191. package/build/types.js +1 -1
  192. package/build/{useCategory-e2c91f59.js → useCategory-b695fd3a.js} +5 -5
  193. package/build/{useHealthToolCache-2a53367b.js → useHealthToolCache-048807ea.js} +2 -2
  194. package/build/{useMantineLocale-a4f0c61d.js → useMantineLocale-0d63dfea.js} +3 -3
  195. package/build/{usePlacesAutocomplete-c76d0caf.js → usePlacesAutocomplete-9520e525.js} +1 -1
  196. package/build/useTogetherAuthRequiredAction.js +70 -0
  197. package/build/{useTranslations-200168a3.js → useTranslations-685f989b.js} +1 -1
  198. package/build/{utils-95d9832e.js → utils-169c6a7d.js} +6 -6
  199. package/build/{utils-af695515.js → utils-1a00c0f8.js} +1 -1
  200. package/build/vaccination.js +18 -18
  201. package/package.json +1 -1
  202. /package/build/{BMI_BOYS.percentile.monthly-71fb1c9f.js → BMI_BOYS.percentile.monthly-1aa95e30.js} +0 -0
  203. /package/build/{BMI_BOYS.percentile.weekly-b2b344a7.js → BMI_BOYS.percentile.weekly-61d78e1c.js} +0 -0
  204. /package/build/{BMI_BOYS.percentile.yearly-031ddade.js → BMI_BOYS.percentile.yearly-f80e040e.js} +0 -0
  205. /package/build/{BMI_BOYS.zscore.monthly-bb1f9962.js → BMI_BOYS.zscore.monthly-a6c7c8ff.js} +0 -0
  206. /package/build/{BMI_BOYS.zscore.weekly-d6198d53.js → BMI_BOYS.zscore.weekly-742f7028.js} +0 -0
  207. /package/build/{BMI_BOYS.zscore.yearly-48255337.js → BMI_BOYS.zscore.yearly-c19cccd5.js} +0 -0
  208. /package/build/{BMI_GIRLS.percentile.monthly-e3e284ee.js → BMI_GIRLS.percentile.monthly-089d3981.js} +0 -0
  209. /package/build/{BMI_GIRLS.percentile.weekly-9f2d3977.js → BMI_GIRLS.percentile.weekly-0cc52cda.js} +0 -0
  210. /package/build/{BMI_GIRLS.percentile.yearly-c79f34ce.js → BMI_GIRLS.percentile.yearly-10bc603f.js} +0 -0
  211. /package/build/{BMI_GIRLS.zscore.monthly-11092df0.js → BMI_GIRLS.zscore.monthly-c3fe57f3.js} +0 -0
  212. /package/build/{BMI_GIRLS.zscore.weekly-5c375d2b.js → BMI_GIRLS.zscore.weekly-b83a54db.js} +0 -0
  213. /package/build/{BMI_GIRLS.zscore.yearly-adbba8e3.js → BMI_GIRLS.zscore.yearly-5f13cda2.js} +0 -0
  214. /package/build/{ChevronDown-f7e25d61.js → ChevronDown-2fd86d66.js} +0 -0
  215. /package/build/{Close-36b0da99.js → Close-711196b0.js} +0 -0
  216. /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-163b99ad.js → HEAD CIRCUM_BOYS.percentile.monthly-03b8d7fb.js} +0 -0
  217. /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-c9882014.js → HEAD CIRCUM_BOYS.percentile.weekly-9ebd3eb6.js} +0 -0
  218. /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-9d2bc91e.js → HEAD CIRCUM_BOYS.percentile.yearly-8e97b738.js} +0 -0
  219. /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-1d2a215c.js → HEAD CIRCUM_BOYS.zscore.monthly-e7892261.js} +0 -0
  220. /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-1f139c91.js → HEAD CIRCUM_BOYS.zscore.weekly-47c5af84.js} +0 -0
  221. /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-ba15501b.js → HEAD CIRCUM_BOYS.zscore.yearly-9a1bc325.js} +0 -0
  222. /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-a546201a.js → HEAD CIRCUM_GIRLS.percentile.monthly-d84491d7.js} +0 -0
  223. /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-66cd5a7e.js → HEAD CIRCUM_GIRLS.percentile.weekly-a6f38c3e.js} +0 -0
  224. /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-9db3c653.js → HEAD CIRCUM_GIRLS.percentile.yearly-5771d277.js} +0 -0
  225. /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-0405e2cb.js → HEAD CIRCUM_GIRLS.zscore.monthly-e3633bcc.js} +0 -0
  226. /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-b2cc3ad2.js → HEAD CIRCUM_GIRLS.zscore.weekly-23b0ab1a.js} +0 -0
  227. /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-3115f993.js → HEAD CIRCUM_GIRLS.zscore.yearly-20f29cf1.js} +0 -0
  228. /package/build/{HEIGHT_BOYS.percentile.monthly-35138a98.js → HEIGHT_BOYS.percentile.monthly-57cc12ee.js} +0 -0
  229. /package/build/{HEIGHT_BOYS.percentile.weekly-0216c35b.js → HEIGHT_BOYS.percentile.weekly-c788506a.js} +0 -0
  230. /package/build/{HEIGHT_BOYS.percentile.yearly-f698e45d.js → HEIGHT_BOYS.percentile.yearly-ac56c1f2.js} +0 -0
  231. /package/build/{HEIGHT_BOYS.zscore.monthly-01195728.js → HEIGHT_BOYS.zscore.monthly-1bb78253.js} +0 -0
  232. /package/build/{HEIGHT_BOYS.zscore.weekly-993e9cf2.js → HEIGHT_BOYS.zscore.weekly-22737c43.js} +0 -0
  233. /package/build/{HEIGHT_BOYS.zscore.yearly-fee3ed69.js → HEIGHT_BOYS.zscore.yearly-90f6cd0a.js} +0 -0
  234. /package/build/{HEIGHT_GIRLS.percentile.monthly-27b2474a.js → HEIGHT_GIRLS.percentile.monthly-019f80d2.js} +0 -0
  235. /package/build/{HEIGHT_GIRLS.percentile.weekly-77bff236.js → HEIGHT_GIRLS.percentile.weekly-ceed9817.js} +0 -0
  236. /package/build/{HEIGHT_GIRLS.percentile.yearly-6200a720.js → HEIGHT_GIRLS.percentile.yearly-3e5192ac.js} +0 -0
  237. /package/build/{HEIGHT_GIRLS.zscore.monthly-94978e64.js → HEIGHT_GIRLS.zscore.monthly-f8fca0b6.js} +0 -0
  238. /package/build/{HEIGHT_GIRLS.zscore.weekly-7951beb1.js → HEIGHT_GIRLS.zscore.weekly-827b17e8.js} +0 -0
  239. /package/build/{HEIGHT_GIRLS.zscore.yearly-c2eca714.js → HEIGHT_GIRLS.zscore.yearly-3cdb483d.js} +0 -0
  240. /package/build/{Visible-eee51ba6.js → Visible-515a4eec.js} +0 -0
  241. /package/build/{WEIGHT_BOYS.percentile.monthly-6a6f901b.js → WEIGHT_BOYS.percentile.monthly-2ecbd498.js} +0 -0
  242. /package/build/{WEIGHT_BOYS.percentile.weekly-737fb867.js → WEIGHT_BOYS.percentile.weekly-75c9c25c.js} +0 -0
  243. /package/build/{WEIGHT_BOYS.percentile.yearly-7772b5e5.js → WEIGHT_BOYS.percentile.yearly-03e7cea6.js} +0 -0
  244. /package/build/{WEIGHT_BOYS.zscore.monthly-8db2e7d6.js → WEIGHT_BOYS.zscore.monthly-2ff9fb56.js} +0 -0
  245. /package/build/{WEIGHT_BOYS.zscore.weekly-ddd37c1a.js → WEIGHT_BOYS.zscore.weekly-e9f7fe2d.js} +0 -0
  246. /package/build/{WEIGHT_BOYS.zscore.yearly-332a8f7b.js → WEIGHT_BOYS.zscore.yearly-4a96f34f.js} +0 -0
  247. /package/build/{WEIGHT_GIRLS.percentile.monthly-3edad688.js → WEIGHT_GIRLS.percentile.monthly-5bf09e30.js} +0 -0
  248. /package/build/{WEIGHT_GIRLS.percentile.weekly-f113a82a.js → WEIGHT_GIRLS.percentile.weekly-f737ae23.js} +0 -0
  249. /package/build/{WEIGHT_GIRLS.percentile.yearly-95afbeaf.js → WEIGHT_GIRLS.percentile.yearly-56ebc8eb.js} +0 -0
  250. /package/build/{WEIGHT_GIRLS.zscore.monthly-d27c4bd4.js → WEIGHT_GIRLS.zscore.monthly-4697d3b5.js} +0 -0
  251. /package/build/{WEIGHT_GIRLS.zscore.weekly-2b113519.js → WEIGHT_GIRLS.zscore.weekly-3633820e.js} +0 -0
  252. /package/build/{WEIGHT_GIRLS.zscore.yearly-c82b04db.js → WEIGHT_GIRLS.zscore.yearly-a9a04790.js} +0 -0
  253. /package/build/{animation-e1375a3b.js → animation-85d012ee.js} +0 -0
  254. /package/build/{cart-67147d06.js → cart-8877bd63.js} +0 -0
  255. /package/build/{constants-936f45e9.js → constants-8743b014.js} +0 -0
  256. /package/build/{constants-513a9a41.js → constants-a78fa8b3.js} +0 -0
  257. /package/build/{cookieHelper-17491ce8.js → cookieHelper-86ae022e.js} +0 -0
  258. /package/build/{defaultClassWrapper-e87ca8ef.js → defaultClassWrapper-b7719693.js} +0 -0
  259. /package/build/{doctor-17b525f8.js → doctor-2c14fed1.js} +0 -0
  260. /package/build/esm/{BMI_BOYS.percentile.monthly-7c9d4923.js → BMI_BOYS.percentile.monthly-42ff2c64.js} +0 -0
  261. /package/build/esm/{BMI_BOYS.percentile.weekly-c410294a.js → BMI_BOYS.percentile.weekly-b4a6c521.js} +0 -0
  262. /package/build/esm/{BMI_BOYS.percentile.yearly-695a4fe2.js → BMI_BOYS.percentile.yearly-d3bc1a77.js} +0 -0
  263. /package/build/esm/{BMI_BOYS.zscore.monthly-9fb9f281.js → BMI_BOYS.zscore.monthly-c4506dfa.js} +0 -0
  264. /package/build/esm/{BMI_BOYS.zscore.weekly-d2109e4b.js → BMI_BOYS.zscore.weekly-ddf3b3f9.js} +0 -0
  265. /package/build/esm/{BMI_BOYS.zscore.yearly-bfa5361b.js → BMI_BOYS.zscore.yearly-e0e3139e.js} +0 -0
  266. /package/build/esm/{BMI_GIRLS.percentile.monthly-f5f60596.js → BMI_GIRLS.percentile.monthly-96686bcc.js} +0 -0
  267. /package/build/esm/{BMI_GIRLS.percentile.weekly-26e4e864.js → BMI_GIRLS.percentile.weekly-c3106a65.js} +0 -0
  268. /package/build/esm/{BMI_GIRLS.percentile.yearly-5a2b297d.js → BMI_GIRLS.percentile.yearly-b38c1f1f.js} +0 -0
  269. /package/build/esm/{BMI_GIRLS.zscore.monthly-4e80bed5.js → BMI_GIRLS.zscore.monthly-f8a7836f.js} +0 -0
  270. /package/build/esm/{BMI_GIRLS.zscore.weekly-03b79f0b.js → BMI_GIRLS.zscore.weekly-4c1fc771.js} +0 -0
  271. /package/build/esm/{BMI_GIRLS.zscore.yearly-822ed949.js → BMI_GIRLS.zscore.yearly-dce5e66a.js} +0 -0
  272. /package/build/esm/{ChevronDown-74267eb8.js → ChevronDown-31ea3e19.js} +0 -0
  273. /package/build/esm/{Close-372aa467.js → Close-40d598bc.js} +0 -0
  274. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-21b04c4c.js → HEAD CIRCUM_BOYS.percentile.monthly-34e3fa1c.js} +0 -0
  275. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-049a9d97.js → HEAD CIRCUM_BOYS.percentile.weekly-d3f3568f.js} +0 -0
  276. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-a4bbbaba.js → HEAD CIRCUM_BOYS.percentile.yearly-dfae3ad2.js} +0 -0
  277. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-7cb348c6.js → HEAD CIRCUM_BOYS.zscore.monthly-95840c2f.js} +0 -0
  278. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-678a1a52.js → HEAD CIRCUM_BOYS.zscore.weekly-8b198c1c.js} +0 -0
  279. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-db81b17e.js → HEAD CIRCUM_BOYS.zscore.yearly-b7d639ad.js} +0 -0
  280. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-cee33cd5.js → HEAD CIRCUM_GIRLS.percentile.monthly-47caa070.js} +0 -0
  281. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-2cec19c3.js → HEAD CIRCUM_GIRLS.percentile.weekly-bae46665.js} +0 -0
  282. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-5949e664.js → HEAD CIRCUM_GIRLS.percentile.yearly-81989cdd.js} +0 -0
  283. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-7c2bffab.js → HEAD CIRCUM_GIRLS.zscore.monthly-f2f7d985.js} +0 -0
  284. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-356dd00a.js → HEAD CIRCUM_GIRLS.zscore.weekly-e287ddb7.js} +0 -0
  285. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-e7b62215.js → HEAD CIRCUM_GIRLS.zscore.yearly-8790b62a.js} +0 -0
  286. /package/build/esm/{HEIGHT_BOYS.percentile.monthly-359c4335.js → HEIGHT_BOYS.percentile.monthly-5d2b6466.js} +0 -0
  287. /package/build/esm/{HEIGHT_BOYS.percentile.weekly-a4d4acd3.js → HEIGHT_BOYS.percentile.weekly-a38ad13e.js} +0 -0
  288. /package/build/esm/{HEIGHT_BOYS.percentile.yearly-ec9a7f9b.js → HEIGHT_BOYS.percentile.yearly-e4841712.js} +0 -0
  289. /package/build/esm/{HEIGHT_BOYS.zscore.monthly-12331258.js → HEIGHT_BOYS.zscore.monthly-d8e722f8.js} +0 -0
  290. /package/build/esm/{HEIGHT_BOYS.zscore.weekly-172054d3.js → HEIGHT_BOYS.zscore.weekly-a92ea3ca.js} +0 -0
  291. /package/build/esm/{HEIGHT_BOYS.zscore.yearly-bb47a3be.js → HEIGHT_BOYS.zscore.yearly-3af1adce.js} +0 -0
  292. /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-c93c0b34.js → HEIGHT_GIRLS.percentile.monthly-c5203801.js} +0 -0
  293. /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-f1f83097.js → HEIGHT_GIRLS.percentile.weekly-4c25d07f.js} +0 -0
  294. /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-ccee4e55.js → HEIGHT_GIRLS.percentile.yearly-f91e2e27.js} +0 -0
  295. /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-caf5410c.js → HEIGHT_GIRLS.zscore.monthly-b2a60aca.js} +0 -0
  296. /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-b1e28b0e.js → HEIGHT_GIRLS.zscore.weekly-0a98c520.js} +0 -0
  297. /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-c3af35d3.js → HEIGHT_GIRLS.zscore.yearly-8070d58f.js} +0 -0
  298. /package/build/esm/{Visible-3f9d7dca.js → Visible-e3e4fb6f.js} +0 -0
  299. /package/build/esm/{WEIGHT_BOYS.percentile.monthly-8a4647df.js → WEIGHT_BOYS.percentile.monthly-b262b97d.js} +0 -0
  300. /package/build/esm/{WEIGHT_BOYS.percentile.weekly-a2a6adf1.js → WEIGHT_BOYS.percentile.weekly-7e817f9f.js} +0 -0
  301. /package/build/esm/{WEIGHT_BOYS.percentile.yearly-073df8b7.js → WEIGHT_BOYS.percentile.yearly-b7f1786a.js} +0 -0
  302. /package/build/esm/{WEIGHT_BOYS.zscore.monthly-bb9e73d2.js → WEIGHT_BOYS.zscore.monthly-014af835.js} +0 -0
  303. /package/build/esm/{WEIGHT_BOYS.zscore.weekly-ef32ce7a.js → WEIGHT_BOYS.zscore.weekly-4577f724.js} +0 -0
  304. /package/build/esm/{WEIGHT_BOYS.zscore.yearly-6cc77688.js → WEIGHT_BOYS.zscore.yearly-08fd3f13.js} +0 -0
  305. /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-a4b518bc.js → WEIGHT_GIRLS.percentile.monthly-a6e1aa0d.js} +0 -0
  306. /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-dcedaebb.js → WEIGHT_GIRLS.percentile.weekly-4c0b6f94.js} +0 -0
  307. /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-9e66577e.js → WEIGHT_GIRLS.percentile.yearly-bf689a3a.js} +0 -0
  308. /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-c07cb81f.js → WEIGHT_GIRLS.zscore.monthly-f82fc3c8.js} +0 -0
  309. /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-9c5c3e8e.js → WEIGHT_GIRLS.zscore.weekly-854ce987.js} +0 -0
  310. /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-e99ce511.js → WEIGHT_GIRLS.zscore.yearly-2a3b869a.js} +0 -0
  311. /package/build/esm/{animation-0b2299dc.js → animation-85d9a0ed.js} +0 -0
  312. /package/build/esm/{cart-f961dadc.js → cart-1ac23ce7.js} +0 -0
  313. /package/build/esm/{constants-71d9f33b.js → constants-a5827634.js} +0 -0
  314. /package/build/esm/{constants-f77fc231.js → constants-f6b2e49d.js} +0 -0
  315. /package/build/esm/{cookieHelper-73ce3871.js → cookieHelper-6c3b4790.js} +0 -0
  316. /package/build/esm/{defaultClassWrapper-31caf23b.js → defaultClassWrapper-00903c00.js} +0 -0
  317. /package/build/esm/{doctor-8a07ca44.js → doctor-e0c2476d.js} +0 -0
  318. /package/build/esm/{index-e3787b20.js → index-189d7601.js} +0 -0
  319. /package/build/esm/{index-c3264b34.js → index-21bca818.js} +0 -0
  320. /package/build/esm/{index-782fed08.js → index-266a32ff.js} +0 -0
  321. /package/build/esm/{index-b65a8764.js → index-8684181f.js} +0 -0
  322. /package/build/esm/{index-3078acec.js → index-ad1c7c38.js} +0 -0
  323. /package/build/esm/{isProduction-5684a28c.js → isProduction-1937d355.js} +0 -0
  324. /package/build/esm/{localizeNumberFormat-42ae8d89.js → localizeNumberFormat-1f000110.js} +0 -0
  325. /package/build/esm/{normalizeLink-d6f57223.js → normalizeLink-7a93ebb9.js} +0 -0
  326. /package/build/esm/{number-13f075cf.js → number-1d1ba14a.js} +0 -0
  327. /package/build/esm/{paths-49a813e7.js → paths-b83be1a0.js} +0 -0
  328. /package/build/esm/{theme-f18c2351.js → theme-7dadf4a1.js} +0 -0
  329. /package/build/esm/{translationsContext-f3d1a7bd.js → translationsContext-42a1fa63.js} +0 -0
  330. /package/build/esm/{tslib.es6-761239c7.js → tslib.es6-06ba3978.js} +0 -0
  331. /package/build/esm/{useIsInit-ee864235.js → useIsInit-f4dec279.js} +0 -0
  332. /package/build/esm/{useOutsideClick-7451aa57.js → useOutsideClick-210c1134.js} +0 -0
  333. /package/build/esm/{useScrollbarSize-84bb5b47.js → useScrollbarSize-909ae7ec.js} +0 -0
  334. /package/build/esm/{useUniqueId-c23213b6.js → useUniqueId-5885911d.js} +0 -0
  335. /package/build/esm/{utils-f8761b9d.js → utils-d7bbdb52.js} +0 -0
  336. /package/build/{index-df5cd44b.js → index-1f3fc2e3.js} +0 -0
  337. /package/build/{index-bba97c2e.js → index-2de1eb4a.js} +0 -0
  338. /package/build/{index-ba3797bb.js → index-6fdcd09d.js} +0 -0
  339. /package/build/{index-e0bf03ac.js → index-82c85f9d.js} +0 -0
  340. /package/build/{index-97ebd7e1.js → index-bc9e8eae.js} +0 -0
  341. /package/build/{isProduction-aa963bf9.js → isProduction-20cd663d.js} +0 -0
  342. /package/build/{localizeNumberFormat-90d4f9d5.js → localizeNumberFormat-7ff6bd3a.js} +0 -0
  343. /package/build/{normalizeLink-451ae6d8.js → normalizeLink-d307f624.js} +0 -0
  344. /package/build/{number-c2338382.js → number-dddf656c.js} +0 -0
  345. /package/build/{paths-e0bbfce7.js → paths-7da79c64.js} +0 -0
  346. /package/build/{theme-e4f7f487.js → theme-be20929b.js} +0 -0
  347. /package/build/{translationsContext-39528d2f.js → translationsContext-00fdb62e.js} +0 -0
  348. /package/build/{tslib.es6-7e140b89.js → tslib.es6-bd3f8718.js} +0 -0
  349. /package/build/{useIsInit-38cec0c4.js → useIsInit-e06b96f5.js} +0 -0
  350. /package/build/{useOutsideClick-e579e1ac.js → useOutsideClick-d95a32b6.js} +0 -0
  351. /package/build/{useScrollbarSize-5a8be010.js → useScrollbarSize-1499b1c3.js} +0 -0
  352. /package/build/{useUniqueId-8929fe5f.js → useUniqueId-1af8848e.js} +0 -0
  353. /package/build/{utils-524bda7c.js → utils-15a9772e.js} +0 -0
@@ -0,0 +1,789 @@
1
+ import { a as __awaiter, _ as __rest } from './tslib.es6-06ba3978.js';
2
+ import React__default, { useState, useRef, useEffect, useCallback, useContext, useMemo } from 'react';
3
+ import { Info, Ask } from '@hhgtech/icons/other';
4
+ import { Checkbox, useMantineTheme, Popover } from '@mantine/core';
5
+ import { D as Dropdown } from './index-29908d2c.js';
6
+ import { u as useTranslations } from './useTranslations-b970f667.js';
7
+ import innertext from 'innertext';
8
+ import { t as theme } from './theme-7dadf4a1.js';
9
+ import './index-9b3a8b6d.js';
10
+ import '@mantine/dates';
11
+ import './index-6210f454.js';
12
+ import './index-189d7601.js';
13
+ import { C as CommonGAssets } from './index-9471fca1.js';
14
+ import './useMantineLocale-453f8013.js';
15
+ import { T as Text } from './index-5723381f.js';
16
+ import { B as Button } from './index-1d3c6ce7.js';
17
+ import '@mantine/hooks';
18
+ import './utils-d7bbdb52.js';
19
+ import { T as TogetherComponentGlobalContext, c as callApi, d as getApiPath, P as PATHS, b as callApiWithAuth } from './utils-3b29eb79.js';
20
+ import { u as useImagePicker, n as StyledCreatePostDescription, R as RichTextEditor, L as Loading, o as IconCloseCircle, p as highlightBadWords, q as decodeMention, r as decodePostUrl, s as getDefaultFailNoti, t as getPostFormData, v as editPost, w as createPost } from './index-c430773c.js';
21
+ import styled from '@emotion/styled';
22
+ import { B as BtnChoice } from './index-cdc50618.js';
23
+ import { g as formatTopic, b as formatPost } from './dataTransform-623716c3.js';
24
+ import { M as MAX_IMAGE_UPLOADS } from './constants-a5827634.js';
25
+ import { C as CardLink } from './index-10ab6596.js';
26
+ import { I as Input } from './index-f660abb7.js';
27
+ import debounce from 'lodash/debounce';
28
+ import ContentEditable from 'react-contenteditable';
29
+ import { Close, Check } from '@hhgtech/icons/core';
30
+
31
+ const StyledCreateNewPost = styled.div `
32
+ position: relative;
33
+ display: flex;
34
+ height: 100%;
35
+ flex-direction: column;
36
+ padding: 16px 24px;
37
+
38
+ .input-group-container {
39
+ flex: 1;
40
+ padding-right: 2px;
41
+ padding-left: 2px;
42
+ margin-bottom: 0.5rem;
43
+ -ms-overflow-style: none; /* IE and Edge */
44
+ overflow-y: auto;
45
+ scrollbar-width: none; /* Firefox */
46
+ &::-webkit-scrollbar {
47
+ display: none;
48
+ }
49
+ }
50
+
51
+ .input-group {
52
+ :not(:last-child) {
53
+ margin-bottom: 0.6rem;
54
+ }
55
+
56
+ input:focus,
57
+ textarea:focus,
58
+ [contenteditable='true'] {
59
+ outline: none;
60
+ }
61
+
62
+ label {
63
+ margin-bottom: 5px;
64
+ color: ${theme.colors.gray600};
65
+ /* font-family: 'Open Sans', sans-serif; */
66
+ font-size: 13px;
67
+ font-weight: bold;
68
+ }
69
+
70
+ .input-group-label {
71
+ margin-bottom: 5px;
72
+ color: ${theme.colors.gray600};
73
+ /* font-family: 'Open Sans', sans-serif; */
74
+ font-size: 13px;
75
+ font-weight: bold;
76
+ }
77
+
78
+ .input-notification {
79
+ display: flex;
80
+
81
+ & > img {
82
+ width: 16px;
83
+ height: 16px;
84
+ margin-top: 1.5px;
85
+ margin-right: 8px;
86
+ }
87
+ }
88
+
89
+ .tag-list {
90
+ }
91
+ }
92
+
93
+ .warning {
94
+ margin-top: 16px;
95
+ }
96
+
97
+ .submit-btn {
98
+ width: 100%;
99
+ }
100
+
101
+ .switch-label {
102
+ display: flex;
103
+ align-items: center;
104
+ }
105
+
106
+ .swich-input-group {
107
+ padding: 12px 16px;
108
+ border-radius: 8px;
109
+ background: ${theme.colors.neutral50};
110
+
111
+ &.askdoctor-switch {
112
+ background: ${theme.colors.primary50};
113
+ &.mb-color {
114
+ background: ${theme.mbColors.tonePink};
115
+ }
116
+ }
117
+
118
+ .mantine-Switch-labelWrapper {
119
+ flex-grow: 1;
120
+ }
121
+ .mantine-Checkbox-body {
122
+ display: flex;
123
+ width: 100%;
124
+ align-items: center;
125
+ justify-content: space-between;
126
+ }
127
+ .mantine-Switch-track {
128
+ margin-bottom: 0;
129
+ }
130
+ .label-txt {
131
+ font-weight: normal;
132
+ font-size: 14px;
133
+ color: ${theme.colors.gray800};
134
+ margin-left: 10px;
135
+ }
136
+ }
137
+ `;
138
+ const StyledIsQuestion = styled.div `
139
+ display: flex;
140
+ width: 100%;
141
+ align-items: center;
142
+ justify-content: space-between;
143
+ padding: 12px 16px;
144
+ border-radius: 8px;
145
+ background: ${theme.colors.primary50};
146
+
147
+ &[data-is-marry-baby='true'] {
148
+ background: ${theme.mbColors.tonePink};
149
+ }
150
+ .switch-label {
151
+ display: flex;
152
+ align-items: center;
153
+ gap: 12px;
154
+ }
155
+ margin-bottom: 12px;
156
+ `;
157
+ const StyledError = styled.div `
158
+ margin-bottom: 12px;
159
+ color: ${theme.colors.red700};
160
+ svg {
161
+ margin-right: 5px;
162
+ }
163
+ svg,
164
+ span {
165
+ vertical-align: middle;
166
+ }
167
+ `;
168
+
169
+ var img$1 = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17' fill='none'%3e%3cpath fill='%232D87F3' d='M8 14.5a6 6 0 1 0 0-12 6 6 0 0 0 0 12'/%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 5.5v3M8 11.5h.007'/%3e%3c/svg%3e";
170
+ var IconAlertCirclePrimary = img$1;
171
+
172
+ var img = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17' fill='none'%3e%3cpath fill='%23FE921D' d='M8 14.5a6 6 0 1 0 0-12 6 6 0 0 0 0 12'/%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 5.5v3M8 11.5h.007'/%3e%3c/svg%3e";
173
+ var IconAlertCircleWarning = img;
174
+
175
+ const CreatePostDescription = ({ className, style, bannedWords = [], value, onChange, onPreviewUrlChange, onInvalidUrlsChange, onImageFilesChange, imageFiles: imageFilesProp, isReplying, }) => {
176
+ const { t } = useTranslations();
177
+ const [previewUrl, setPreviewUrl] = useState(null);
178
+ const imagePicker = useRef(null);
179
+ const { onSelectImages, onRemoveImage, imageSrcs,
180
+ // imageFiles,
181
+ } = useImagePicker(imageFilesProp, onImageFilesChange);
182
+ useEffect(() => {
183
+ if (onPreviewUrlChange) {
184
+ if (previewUrl === null || previewUrl === void 0 ? void 0 : previewUrl.url)
185
+ onPreviewUrlChange({
186
+ title: previewUrl.title || '',
187
+ url: previewUrl.url || '',
188
+ image: previewUrl.image || '',
189
+ description: previewUrl.description || '',
190
+ });
191
+ else
192
+ onPreviewUrlChange(null);
193
+ }
194
+ }, [previewUrl]);
195
+ return (React__default.createElement(StyledCreatePostDescription, { className: className, style: style },
196
+ React__default.createElement(Text, { size: "p4", className: "description-label" }, t('createPost.popup.description')),
197
+ React__default.createElement("div", { className: `textarea-control` },
198
+ React__default.createElement("div", { className: "textarea-wrapper" },
199
+ React__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 }))),
200
+ React__default.createElement(Text, { size: "p4", className: "count-string" },
201
+ t('character'),
202
+ ": ",
203
+ innertext(value || '').length),
204
+ (!imageSrcs || imageSrcs.length === 0) && previewUrl && (React__default.createElement("div", { className: "link-preview-wrapper" }, previewUrl.isFetching ? (React__default.createElement(Loading, null)) : (React__default.createElement(React__default.Fragment, null,
205
+ React__default.createElement(CardLink, { title: previewUrl.title, url: previewUrl.url || '#', image: previewUrl.image, noRefetch: true }),
206
+ React__default.createElement("img", { src: IconCloseCircle, className: "icon-close", onClick: () => setPreviewUrl(null), loading: "lazy" }))))),
207
+ React__default.createElement("input", { ref: imagePicker, type: "file", accept: "image/png, image/gif, image/jpeg", multiple: true, style: { display: 'none' }, onChange: onSelectImages }),
208
+ imageSrcs.length > MAX_IMAGE_UPLOADS ? (React__default.createElement("div", { className: "input-notification" },
209
+ React__default.createElement("img", { src: IconAlertCircleWarning, loading: "lazy" }),
210
+ React__default.createElement(Text, { size: "p4", color: theme.colors.alertWarning }, t(`createPost.popup.warningImage`)))) : null,
211
+ imageSrcs.length > 0 && (React__default.createElement("div", { className: "image-gallery" }, imageSrcs.map((src, i) => (React__default.createElement("div", { key: i, className: "image-item" },
212
+ React__default.createElement("img", { src: src, loading: "lazy" }),
213
+ React__default.createElement("img", { className: "close-btn", src: IconCloseCircle, onClick: () => onRemoveImage(i), loading: "lazy" }))))))));
214
+ };
215
+
216
+ const StyledCreatePostTitle = styled.div `
217
+ input:focus,
218
+ textarea:focus,
219
+ [contenteditable='true'] {
220
+ outline: none;
221
+ }
222
+
223
+ .title-input {
224
+ overflow: hidden;
225
+ width: 100%;
226
+ padding: 12px 16px;
227
+ border: solid 1px #d9d9d9;
228
+ border-radius: ${theme.borderRadius};
229
+ font-size: 16px;
230
+ line-height: 1.2;
231
+ white-space: nowrap;
232
+ :focus {
233
+ border-color: ${theme.colors.primaryBase};
234
+ box-shadow: 0px 0px 2px 2px ${theme.colors.primary200};
235
+ }
236
+ br {
237
+ display: none;
238
+ }
239
+ * {
240
+ display: inline;
241
+ white-space: nowrap;
242
+ }
243
+ mocka {
244
+ padding: 2px 6px;
245
+ border-radius: 1rem;
246
+ &[data-error='true'] {
247
+ background-color: #ffeeee;
248
+ color: red;
249
+ text-decoration: underline;
250
+ font-style: bold;
251
+ }
252
+ }
253
+ ol,
254
+ ul {
255
+ padding-left: 1rem;
256
+ }
257
+ }
258
+
259
+ label {
260
+ display: block;
261
+ margin-bottom: 5px;
262
+ color: ${theme.colors.gray600};
263
+ font-size: 13px;
264
+ font-weight: bold;
265
+ }
266
+
267
+ .count-string {
268
+ margin-top: 5px;
269
+ color: ${theme.colors.gray500};
270
+ font-size: 11px;
271
+ text-align: right;
272
+ }
273
+ `;
274
+
275
+ const TITLE_LIMIT = 120;
276
+ const inputModify = (value, opts) => {
277
+ if (!opts)
278
+ return value;
279
+ const { limit, bannedWords = [] } = opts;
280
+ const shorten = typeof limit === 'number' && limit >= 0 ? value.substring(0, limit) : value;
281
+ const processedValue = highlightBadWords(shorten, bannedWords);
282
+ return processedValue;
283
+ };
284
+ const CreatePostTitle = ({ className, style, bannedWords = [], value, onChange, }) => {
285
+ var _a;
286
+ const { t } = useTranslations();
287
+ const [titleValue, setTitleValue] = useState('');
288
+ const titleRef = useRef(null);
289
+ useEffect(() => {
290
+ if (titleRef.current) {
291
+ const pasteHandler = (e) => {
292
+ var _a;
293
+ e.preventDefault();
294
+ const text = (_a = e.clipboardData) === null || _a === void 0 ? void 0 : _a.getData('text/plain');
295
+ document.execCommand('insertHTML', false, text);
296
+ };
297
+ const contentDiv = titleRef.current;
298
+ contentDiv.addEventListener('paste', pasteHandler, {
299
+ passive: true,
300
+ });
301
+ return () => contentDiv.removeEventListener('paste', pasteHandler);
302
+ }
303
+ }, [titleRef]);
304
+ const bannedString = (bannedWords === null || bannedWords === void 0 ? void 0 : bannedWords.join(',')) || '';
305
+ useEffect(() => {
306
+ var _a;
307
+ if (bannedString) {
308
+ const titleText = (_a = titleRef.current) === null || _a === void 0 ? void 0 : _a.innerText;
309
+ if (titleText) {
310
+ const titleValueWithBanned = highlightBadWords(titleText, bannedWords);
311
+ if (titleValueWithBanned !== titleText) {
312
+ onChange && onChange(titleValueWithBanned);
313
+ setTitleValue(titleValueWithBanned);
314
+ }
315
+ }
316
+ }
317
+ }, [bannedString]);
318
+ const debounceInputModify = useCallback(debounce(() => {
319
+ if (titleRef.current) {
320
+ const shortenString = inputModify(titleRef.current.innerText, {
321
+ limit: TITLE_LIMIT,
322
+ bannedWords,
323
+ });
324
+ onChange && onChange(shortenString);
325
+ setTitleValue(shortenString);
326
+ }
327
+ }, 300), []);
328
+ useEffect(() => {
329
+ setTimeout(() => {
330
+ var _a;
331
+ (_a = titleRef.current) === null || _a === void 0 ? void 0 : _a.focus();
332
+ }, 500);
333
+ }, []);
334
+ return (React__default.createElement(StyledCreatePostTitle, { className: className, style: style },
335
+ React__default.createElement(Input, { name: "title", value: value || titleValue, size: "md", label: t('createPost.title'), CustomInput: React__default.createElement(ContentEditable, { innerRef: titleRef, html: value || titleValue, onChange: () => {
336
+ if (titleRef.current &&
337
+ titleRef.current.innerText !== (value || titleValue)) {
338
+ const initialValue = inputModify(titleRef.current.innerText, {
339
+ bannedWords,
340
+ });
341
+ onChange && onChange(initialValue);
342
+ setTitleValue(initialValue);
343
+ debounceInputModify();
344
+ }
345
+ }, className: "title-input" }) }),
346
+ React__default.createElement(Text, { size: "p4", className: "count-string" }, t('createPost.popup.wordCount', {
347
+ count: ((_a = titleRef.current) === null || _a === void 0 ? void 0 : _a.innerText.length) || 0,
348
+ max: TITLE_LIMIT,
349
+ }))));
350
+ };
351
+
352
+ const StyledTopicSelectList = styled.div `
353
+ display: flex;
354
+ width: 100%;
355
+ flex-wrap: wrap;
356
+ margin-top: 1rem;
357
+
358
+ .tag-item {
359
+ min-height: 32px;
360
+ padding: 5px 12px;
361
+ border: 1px solid ${theme.colors.neutral100};
362
+ margin-right: 1rem;
363
+ margin-bottom: 8px;
364
+ border-radius: 1rem;
365
+ color: ${theme.colors.gray800};
366
+ cursor: pointer;
367
+ font-size: 13px;
368
+ line-height: 22px;
369
+ transition: all 0.2s;
370
+
371
+ &.--active {
372
+ border-color: ${theme.colors.primary50};
373
+ background: ${theme.colors.primary50};
374
+ color: ${theme.colors.primaryBase};
375
+ }
376
+ &[data-disabled='true'] {
377
+ background: ${theme.colors.gray100};
378
+ color: ${theme.colors.gray800};
379
+ }
380
+ }
381
+ .topic-spinner {
382
+ margin-right: auto;
383
+ margin-left: auto;
384
+ & > button {
385
+ width: 24px;
386
+ height: 24px;
387
+ }
388
+ }
389
+ &[data-is-marrybaby='true'] {
390
+ .tag-item {
391
+ border-color: transparent;
392
+ background: #f3f3f3;
393
+ color: #3e3f58;
394
+ &.--active {
395
+ border-color: #b6cdff;
396
+ background: #e0e9fb;
397
+ color: #3e3f58;
398
+ }
399
+ }
400
+ }
401
+ `;
402
+
403
+ const TopicSelectList = ({ className, style, topics: topicsProp, communityId, onChange, isLoading, disabled, forceTopics, selectedTopics: selectedTopicsProp, noFetch, dataEventCategory, dataEventAction, dataEventLabel, }) => {
404
+ const { data: { locale, env: { isMarryBaby }, }, } = useContext(TogetherComponentGlobalContext);
405
+ const [topics, setTopics] = useState(topicsProp ? [...topicsProp] : []);
406
+ const [selectedTopics, setSelectedTopics] = useState(selectedTopicsProp ? [...selectedTopicsProp] : []);
407
+ const [isLoadingTopics, setIsLoadingTopics] = useState(false);
408
+ const topicsPropRef = useRef(topicsProp);
409
+ topicsPropRef.current = topicsProp;
410
+ useEffect(() => {
411
+ var _a;
412
+ if (communityId && !noFetch && !((_a = topicsPropRef.current) === null || _a === void 0 ? void 0 : _a.length)) {
413
+ setTopics([]);
414
+ setIsLoadingTopics(true);
415
+ (() => __awaiter(void 0, void 0, void 0, function* () {
416
+ var _b;
417
+ try {
418
+ const res = yield callApi(getApiPath(PATHS.TOPIC.LIST, {
419
+ communityId: communityId,
420
+ _locale: locale,
421
+ }), 'GET');
422
+ const topicRes = (_b = res === null || res === void 0 ? void 0 : res.data) === null || _b === void 0 ? void 0 : _b.topics;
423
+ if (Array.isArray(topicRes)) {
424
+ setTopics(() => (topicRes === null || topicRes === void 0 ? void 0 : topicRes.map(formatTopic).sort((t1, t2) => (t1.order || 0) - (t2.order || 0))) || []);
425
+ }
426
+ }
427
+ catch (e) {
428
+ console.log(e);
429
+ setIsLoadingTopics(false);
430
+ }
431
+ setIsLoadingTopics(false);
432
+ }))();
433
+ }
434
+ }, [communityId, noFetch]);
435
+ const topicsPropString = topicsProp === null || topicsProp === void 0 ? void 0 : topicsProp.map((t) => t.id).join('-');
436
+ const topicsStateString = topics === null || topics === void 0 ? void 0 : topics.map((t) => t.id).join('-');
437
+ const forceTopicsPropString = forceTopics === null || forceTopics === void 0 ? void 0 : forceTopics.map((t) => t.id).join('-');
438
+ useEffect(() => {
439
+ if (topicsProp &&
440
+ typeof topicsPropString !== 'undefined' &&
441
+ topicsPropString !== topicsStateString) {
442
+ setTopics(topicsProp);
443
+ }
444
+ }, [topicsProp, topicsPropString, topicsStateString]);
445
+ const topicsWithoutForced = useMemo(() => topics.filter((t) => !(forceTopics === null || forceTopics === void 0 ? void 0 : forceTopics.some((ft) => (ft.id && ft.id === t.id) ||
446
+ (ft.mappedCategoryId &&
447
+ ft.mappedCategoryId === t.mappedCategoryId)))), [topicsStateString, forceTopicsPropString]);
448
+ return (React__default.createElement(StyledTopicSelectList, { "data-is-marrybaby": isMarryBaby, className: className, style: style },
449
+ forceTopics.map((topic) => (React__default.createElement(TopicItem, { key: `${topic.id}-${topic.mappedCategoryId}`, topic: topic, disabled: true, selected: true, dataEventAction: dataEventAction, dataEventCategory: dataEventCategory, dataEventLabel: dataEventLabel }))),
450
+ topicsWithoutForced.map((topic) => (React__default.createElement(TopicItem, { key: `${topic.id}-${topic.mappedCategoryId}`, topic: topic, disabled: disabled, selected: (selectedTopicsProp || selectedTopics).some((t) => (t.id && t.id === topic.id) ||
451
+ (t.mappedCategoryId &&
452
+ t.mappedCategoryId === topic.mappedCategoryId)), onClick: () => {
453
+ const _selected = selectedTopicsProp || selectedTopics;
454
+ const foundIndex = _selected.findIndex((_selected) => (_selected.id && _selected.id === topic.id) ||
455
+ (_selected.mappedCategoryId &&
456
+ _selected.mappedCategoryId === topic.mappedCategoryId));
457
+ if (foundIndex !== -1) {
458
+ _selected.splice(foundIndex, 1);
459
+ }
460
+ else {
461
+ _selected.push(topic);
462
+ }
463
+ if (onChange && selectedTopicsProp) {
464
+ onChange(_selected.slice());
465
+ }
466
+ else {
467
+ onChange && onChange(_selected.slice());
468
+ setSelectedTopics(_selected.slice());
469
+ }
470
+ }, dataEventAction: dataEventAction, dataEventCategory: dataEventCategory, dataEventLabel: dataEventLabel }))),
471
+ (isLoading || isLoadingTopics) && React__default.createElement(Loading, { className: "topic-spinner" })));
472
+ };
473
+ const TopicItem = (_a) => {
474
+ var { topic, disabled, selected, onClick } = _a, rest = __rest(_a, ["topic", "disabled", "selected", "onClick"]);
475
+ return (React__default.createElement("div", Object.assign({ className: 'tag-item' + (selected ? ' --active' : ''), "data-disabled": disabled, onClick: !disabled ? onClick : undefined }, rest), topic.name));
476
+ };
477
+
478
+ const CreateNewPostContent = ({ className, style, onPostCreatedEdited, onClose, communities = [], forceSelectCommunity, forceSelectTopics, articleId, optionalTopic, editPostData, defaultCommunity, defaultTopics, noFetchTopic, hideTopicList, selectAskDoctor, showAskDoctorOptions, currentPageUrl, }) => {
479
+ const isInEditMode = !!(editPostData === null || editPostData === void 0 ? void 0 : editPostData.id);
480
+ const { data: { locale, env: { isMarryBaby }, }, action: { pushNotifications, sanitizeFunction }, } = useContext(TogetherComponentGlobalContext);
481
+ const { t } = useTranslations();
482
+ const [isAnonymous, setIsAnonymous] = useState(false);
483
+ const [isAskDoctor, setIsAskDoctor] = useState(selectAskDoctor);
484
+ const [showAskDoctorRequired, setShowAskDoctorRequired] = useState(false);
485
+ const [specialCharErr, setspecialCharErr] = useState(false);
486
+ const [isSubmitting, setIsSubmitting] = useState(false);
487
+ const [titleValue, setTitleValue] = useState('');
488
+ const [descriptionValue, setDescriptionValue] = useState('');
489
+ const [communityValue, setCommunityValue] = useState(forceSelectCommunity
490
+ ? {
491
+ label: forceSelectCommunity.name,
492
+ value: `${forceSelectCommunity.id || ''}-${forceSelectCommunity.mappedCategoryId || ''}`,
493
+ }
494
+ : {
495
+ label: t('community.choose'),
496
+ value: '',
497
+ });
498
+ const [selectedTopics, setSelectedTopics] = useState([...forceSelectTopics] || []);
499
+ const [imageFiles, setImageFiles] = useState([]);
500
+ const [bannedWords, setBannedWords] = useState([]);
501
+ const currentCommunity = forceSelectCommunity ||
502
+ communities.find((c) => `${c.id || ''}-${c.mappedCategoryId || ''}` === communityValue.value);
503
+ const communitiesList = forceSelectCommunity
504
+ ? [forceSelectCommunity]
505
+ : communities
506
+ .filter((c) => c.isActive)
507
+ .sort((a, b) => {
508
+ if (a.name > b.name)
509
+ return 1;
510
+ if (a.name < b.name)
511
+ return -1;
512
+ return 0;
513
+ });
514
+ const [previewUrl, setPreviewUrl] = useState(null);
515
+ const [invalidUrls, setInvalidUrls] = useState([]);
516
+ const isReadyToSubmit = titleValue &&
517
+ !specialCharErr &&
518
+ innertext(descriptionValue) &&
519
+ (optionalTopic || (!optionalTopic && selectedTopics.length > 0)) &&
520
+ currentCommunity &&
521
+ (!imageFiles || imageFiles.length <= MAX_IMAGE_UPLOADS) &&
522
+ !(invalidUrls === null || invalidUrls === void 0 ? void 0 : invalidUrls.length) &&
523
+ !isSubmitting;
524
+ // HANDLE etra action when OPEN AND CLOSE
525
+ useEffect(() => {
526
+ if (editPostData) {
527
+ const post = editPostData;
528
+ setTitleValue(post.title || '');
529
+ setDescriptionValue(decodeMention(decodePostUrl(post.description || '', 'edit'), post.mentions));
530
+ setCommunityValue({
531
+ label: post.community.name,
532
+ value: `${post.community.id || ''}-${post.community.mappedCategoryId || ''}`,
533
+ });
534
+ setSelectedTopics(post.topics || []);
535
+ setImageFiles(post.photos || []);
536
+ setIsAnonymous(!!post.isAnonymous || false);
537
+ setIsAskDoctor(!!post.isAskDoctor || false);
538
+ }
539
+ else {
540
+ if (defaultCommunity) {
541
+ setCommunityValue({
542
+ label: defaultCommunity.name,
543
+ value: `${defaultCommunity.id || ''}-${defaultCommunity.mappedCategoryId || ''}`,
544
+ });
545
+ }
546
+ if (defaultTopics) {
547
+ setSelectedTopics(defaultTopics);
548
+ }
549
+ }
550
+ }, []);
551
+ useEffect(() => {
552
+ setspecialCharErr(titleValue !== '' && !/[a-zA-Z]/.test(titleValue));
553
+ }, [titleValue]);
554
+ const onCreateEditSuccess = (res) => {
555
+ if (onPostCreatedEdited) {
556
+ onPostCreatedEdited(formatPost(res), isInEditMode);
557
+ }
558
+ onClose && onClose();
559
+ };
560
+ const submitPost = () => __awaiter(void 0, void 0, void 0, function* () {
561
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
562
+ if (showAskDoctorOptions && typeof isAskDoctor === 'undefined') {
563
+ setShowAskDoctorRequired(true);
564
+ return false;
565
+ }
566
+ const bodyFormData = yield getPostFormData({
567
+ title: titleValue,
568
+ description: descriptionValue,
569
+ communityId: String((currentCommunity === null || currentCommunity === void 0 ? void 0 : currentCommunity.id) || ''),
570
+ imageFiles,
571
+ previewUrl,
572
+ topicIds: selectedTopics === null || selectedTopics === void 0 ? void 0 : selectedTopics.map((topic) => String(topic.id || '')).filter(Boolean),
573
+ locale,
574
+ sanitizeFunction,
575
+ categoryCommunityId: String((currentCommunity === null || currentCommunity === void 0 ? void 0 : currentCommunity.mappedCategoryId) || ''),
576
+ categoryTopicIds: selectedTopics === null || selectedTopics === void 0 ? void 0 : selectedTopics.map((topic) => String(topic.mappedCategoryId || '')).filter(Boolean),
577
+ isAnonymous: isAnonymous ? 1 : 0,
578
+ isAskDoctor: isAskDoctor ? 1 : 0,
579
+ });
580
+ if (articleId) {
581
+ bodyFormData.append('article_id', articleId);
582
+ }
583
+ let res;
584
+ if (isInEditMode) {
585
+ if (editPostData === null || editPostData === void 0 ? void 0 : editPostData.id) {
586
+ res = yield editPost({
587
+ id: editPostData.id,
588
+ formData: bodyFormData,
589
+ locale,
590
+ });
591
+ }
592
+ }
593
+ else {
594
+ res = yield createPost({
595
+ formData: bodyFormData,
596
+ locale,
597
+ isArticleComment: !(currentCommunity === null || currentCommunity === void 0 ? void 0 : currentCommunity.id) && !!(currentCommunity === null || currentCommunity === void 0 ? void 0 : currentCommunity.mappedCategoryId),
598
+ });
599
+ }
600
+ const resData = res === null || res === void 0 ? void 0 : res.data;
601
+ 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)) {
602
+ pushNotifications({
603
+ message: t('createPost.popup.success'),
604
+ type: 'success',
605
+ });
606
+ onCreateEditSuccess(resData);
607
+ }
608
+ else {
609
+ 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') {
610
+ pushNotifications({
611
+ title: t('notification.post.blocked.title'),
612
+ message: t('notification.post.blocked.message'),
613
+ type: 'danger',
614
+ });
615
+ if (res.messages.moderation.words) {
616
+ setBannedWords(res.messages.moderation.words);
617
+ }
618
+ }
619
+ 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') {
620
+ pushNotifications({
621
+ title: t('notification.post.suspect.title'),
622
+ message: t('notification.post.suspect.message'),
623
+ type: 'warning',
624
+ });
625
+ onClose && onClose();
626
+ }
627
+ 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')); })) {
628
+ pushNotifications({
629
+ message: t('notification.suspend.message'),
630
+ type: 'danger',
631
+ });
632
+ onClose && onClose();
633
+ }
634
+ else {
635
+ pushNotifications({
636
+ message: ((_j = res === null || res === void 0 ? void 0 : res.messages) === null || _j === void 0 ? void 0 : _j[0]) || t('notification.failure'),
637
+ type: 'danger',
638
+ });
639
+ }
640
+ }
641
+ });
642
+ return (React__default.createElement(StyledCreateNewPost, { className: className, style: style },
643
+ React__default.createElement("div", { className: "input-group-container" },
644
+ React__default.createElement(CreatePostTitle, { className: "input-group", bannedWords: bannedWords, value: titleValue, onChange: setTitleValue }),
645
+ specialCharErr && (React__default.createElement(StyledError, null,
646
+ React__default.createElement(Info, { isSolid: true, color: theme.colors.red700, size: 14 }),
647
+ React__default.createElement(Text, { size: "p3", as: "span", color: theme.colors.red700 }, t('createPost.popup.specialCharErr')))),
648
+ React__default.createElement(CreatePostDescription, { className: "input-group", bannedWords: bannedWords, value: descriptionValue, onChange: setDescriptionValue, onPreviewUrlChange: setPreviewUrl, onInvalidUrlsChange: setInvalidUrls, onImageFilesChange: setImageFiles, imageFiles: imageFiles }),
649
+ showAskDoctorOptions && (React__default.createElement(StyledIsQuestion, { "data-is-marry-baby": isMarryBaby },
650
+ React__default.createElement("div", { className: "switch-label" },
651
+ React__default.createElement(Ask, { isMarryBaby: isMarryBaby, size: isMarryBaby ? 32 : 24, color: theme.colors.primaryBase, className: "label-icon" }),
652
+ React__default.createElement("span", { className: "label-txt" }, t('createPost.askDoctor'))),
653
+ React__default.createElement(BtnChoice, { value: isAskDoctor, choices: [
654
+ {
655
+ label: t('createPost.askDoctorChoice.yes'),
656
+ value: true,
657
+ dataEventCategory: 'Together',
658
+ dataEventAction: 'Write Post Click - Ask Doctor',
659
+ dataEventLabel: currentPageUrl,
660
+ },
661
+ {
662
+ label: t('createPost.askDoctorChoice.no'),
663
+ value: false,
664
+ },
665
+ ], onChange: (v) => {
666
+ if (typeof v === 'boolean') {
667
+ setShowAskDoctorRequired(false);
668
+ setIsAskDoctor(v);
669
+ }
670
+ } }))),
671
+ showAskDoctorRequired && (React__default.createElement(StyledError, null,
672
+ React__default.createElement(Info, { isSolid: true, color: theme.colors.red700, size: 14 }),
673
+ React__default.createElement(Text, { size: "p3", as: "span", color: theme.colors.red700 }, t('createPost.message.askDoctorRequire')))),
674
+ React__default.createElement("div", { className: "input-group" },
675
+ React__default.createElement(Text, { size: "p4", className: "input-group-label" }, t('admin.community')),
676
+ React__default.createElement(Dropdown, { options: (communitiesList === null || communitiesList === void 0 ? void 0 : communitiesList.map((c) => ({
677
+ label: c.name,
678
+ value: `${c.id || ''}-${c.mappedCategoryId || ''}`,
679
+ }))) || [], id: "community-picker", placeholder: t('community.choose'), value: communityValue, dropdownLabelTrackingAttributes: {
680
+ 'data-event-category': 'Together',
681
+ 'data-event-action': 'Write Post Click - Choose Community/Topic',
682
+ 'data-event-label': currentPageUrl,
683
+ }, onChange: (option) => {
684
+ setCommunityValue({
685
+ label: option.label,
686
+ value: String(option.value),
687
+ });
688
+ setSelectedTopics([]);
689
+ }, disabled: !!forceSelectCommunity }),
690
+ React__default.createElement(Text, { size: "sm", className: "warning", color: theme.colors.gray400 },
691
+ "* ",
692
+ t('commentPopup.warning.newPost'))),
693
+ !hideTopicList && (React__default.createElement("div", { className: "input-group" },
694
+ React__default.createElement(Text, { size: "p4", className: "input-group-label" }, t('tab.topic')),
695
+ React__default.createElement("div", { className: "input-notification" },
696
+ React__default.createElement("img", { src: currentCommunity
697
+ ? IconAlertCirclePrimary
698
+ : IconAlertCircleWarning, loading: "lazy" }),
699
+ React__default.createElement(Text, { size: "base", color: theme.colors.gray500 }, t(currentCommunity
700
+ ? 'createPost.popup.primary'
701
+ : 'createPost.popup.warning'))),
702
+ currentCommunity && (React__default.createElement(TopicSelectList, { className: "tag-list", communityId: currentCommunity.id, forceTopics: forceSelectTopics, onChange: setSelectedTopics, selectedTopics: selectedTopics, noFetch: noFetchTopic, dataEventCategory: "Together", dataEventAction: "Write Post Click - Choose Community/Topic", dataEventLabel: currentPageUrl }))))),
703
+ React__default.createElement("div", { className: "form-action" },
704
+ React__default.createElement("div", { className: "input-group" },
705
+ React__default.createElement(Checkbox, { className: "swich-input-group", labelPosition: "left", name: "PostAnonymous", checked: isAnonymous, color: isMarryBaby ? 'pink' : undefined, "data-event-category": "Together", "data-event-action": "Write Post Click - Incognito", "data-event-label": currentPageUrl, label: React__default.createElement("div", { className: "switch-label" },
706
+ React__default.createElement("img", { className: "label-icon", src: CommonGAssets.getAssetPath('anomyous-avatar.svg'), alt: "anomyous avatar", style: { marginRight: '10px', width: '24px' }, loading: "lazy" }),
707
+ React__default.createElement("span", { className: "label-txt" }, t('createPost.postAnonymous'))), value: "Post Anonymous", onChange: (event) => setIsAnonymous(event.currentTarget.checked), styles: {
708
+ body: {
709
+ display: 'flex',
710
+ width: '100%',
711
+ justifyContent: 'space-between',
712
+ alignItems: 'center',
713
+ },
714
+ label: {
715
+ display: 'flex',
716
+ alignItems: 'center',
717
+ },
718
+ } })),
719
+ React__default.createElement("div", { className: "input-group" },
720
+ React__default.createElement(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: () => __awaiter(void 0, void 0, void 0, function* () {
721
+ if (isReadyToSubmit && !isSubmitting) {
722
+ setIsSubmitting(true);
723
+ try {
724
+ yield submitPost();
725
+ }
726
+ catch (e) {
727
+ console.error(e);
728
+ pushNotifications(getDefaultFailNoti(t));
729
+ }
730
+ setIsSubmitting(false);
731
+ }
732
+ }), disabled: !isReadyToSubmit, loading: isSubmitting }, t('createPost.popup.submit'))))));
733
+ };
734
+
735
+ var styles = {"skipBtn":"KsWg8i6","alertHeading":"_9tS0EUN","alertDesc":"kyyRKlb","alertAction":"-Uqqka-"};
736
+
737
+ const SkipQuestionOfExpertBtn = (_a) => {
738
+ var { post, onSkip, btnText, currentPageUrl } = _a, rest = __rest(_a, ["post", "onSkip", "btnText", "currentPageUrl"]);
739
+ const { t } = useTranslations();
740
+ const { data: { locale }, action: { pushNotifications }, } = useContext(TogetherComponentGlobalContext);
741
+ const [showAlert, setShowAlert] = useState(false);
742
+ const [loading, setLoading] = useState(false);
743
+ const _theme = useMantineTheme();
744
+ const handleSkip = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
745
+ var _b;
746
+ setLoading(true);
747
+ const res = yield callApiWithAuth(getApiPath(PATHS.USER.SKIP_QUESTION, {
748
+ _locale: locale,
749
+ id: post === null || post === void 0 ? void 0 : post.id,
750
+ }), 'PUT');
751
+ if ((res === null || res === void 0 ? void 0 : res.status) === 1) {
752
+ 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) || '' });
753
+ setShowAlert(false);
754
+ pushNotifications({
755
+ title: '',
756
+ message: 'Skip success',
757
+ type: 'success',
758
+ });
759
+ }
760
+ else {
761
+ pushNotifications({
762
+ title: '',
763
+ message: res === null || res === void 0 ? void 0 : res.messages,
764
+ type: 'danger',
765
+ });
766
+ }
767
+ setLoading(false);
768
+ }), []);
769
+ return (React__default.createElement(Popover, { width: 327, withArrow: true, shadow: "md", opened: showAlert },
770
+ React__default.createElement(Popover.Target, null,
771
+ React__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'))),
772
+ React__default.createElement(Popover.Dropdown, null,
773
+ React__default.createElement("div", null,
774
+ React__default.createElement("div", { className: styles.alertHeading }, t('profilePanel.skipQuestion.heading')),
775
+ React__default.createElement("div", { className: styles.alertDesc }, t('profilePanel.skipQuestion.content')),
776
+ React__default.createElement("div", { className: styles.alertAction },
777
+ React__default.createElement(Button, { size: "md", variant: "secondary", leftIcon: React__default.createElement(Close, { color: _theme.fn.primaryColor(), size: 24 }), onClick: () => setShowAlert(false), styles: () => ({
778
+ leftIcon: {
779
+ marginRight: 0,
780
+ },
781
+ }) }),
782
+ React__default.createElement(Button, { variant: "primary", size: "md", leftIcon: React__default.createElement(Check, { color: 'white', size: 24 }), onClick: handleSkip, loading: loading, "data-event-category": "Together", "data-event-action": "Unclear Question Click", "data-event-label": currentPageUrl, styles: () => ({
783
+ leftIcon: {
784
+ marginRight: 0,
785
+ },
786
+ }) }))))));
787
+ };
788
+
789
+ export { CreateNewPostContent as C, SkipQuestionOfExpertBtn as S, TopicSelectList as T, CreatePostDescription as a, CreatePostTitle as b };