@hhgtech/hhg-components 1.29.87 → 1.29.89

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 (459) hide show
  1. package/build/{LastPeriod-671d5143.js → LastPeriod-c8c46da3.js} +1 -1
  2. package/build/MobileBottomNavigationIcon-efacfc0c.js +193 -0
  3. package/build/{WhatsApp-07eb4e4a.js → WhatsApp-8a1d6d0c.js} +1 -1
  4. package/build/adapters.js +18 -16
  5. package/build/atoms.js +47 -45
  6. package/build/babyGrowth.js +82 -80
  7. package/build/cache.js +2 -2
  8. package/build/care.js +28 -25
  9. package/build/careBookingSearchBar.js +1594 -0
  10. package/build/careBookingSearchBarV2.js +1665 -0
  11. package/build/components.js +125 -115
  12. package/build/{constants-970e6cf6.js → constants-f5c5e2ae.js} +1 -1
  13. package/build/constants.js +3 -3
  14. package/build/constantsDomainLocales.js +1 -1
  15. package/build/constantsRiskScreener.js +2 -2
  16. package/build/constantsSite.js +2 -2
  17. package/build/{core-bcde5ba8.js → core-58a245c5.js} +1 -1
  18. package/build/{dataTransform-567bc0c2.js → dataTransform-9ec385e3.js} +1 -1
  19. package/build/ecom.js +4 -4
  20. package/build/editor-40386fe7.js +986 -0
  21. package/build/embeddedHeathToolCards_babyGrowth.js +22 -20
  22. package/build/embeddedHeathToolCards_babyPoop.js +18 -16
  23. package/build/embeddedHeathToolCards_babyVaccine.js +21 -19
  24. package/build/embeddedHeathToolCards_bmi_bmi.js +25 -23
  25. package/build/embeddedHeathToolCards_bmrBmr.js +25 -23
  26. package/build/embeddedHeathToolCards_dueDate_dueDate.js +21 -19
  27. package/build/embeddedHeathToolCards_ovulation_ovulation.js +21 -19
  28. package/build/embeddedHeathToolCards_pwg_pwg.js +26 -24
  29. package/build/embeddedHeathToolCards_targetHeartRate.js +27 -25
  30. package/build/esm/{LastPeriod-ebfcf053.js → LastPeriod-46d6c03f.js} +1 -1
  31. package/build/esm/MobileBottomNavigationIcon-ae6490d7.js +185 -0
  32. package/build/esm/{WhatsApp-c6c8eded.js → WhatsApp-ed8ce0f2.js} +1 -1
  33. package/build/esm/adapters.js +18 -16
  34. package/build/esm/atoms.js +44 -42
  35. package/build/esm/babyGrowth.js +82 -80
  36. package/build/esm/cache.js +2 -2
  37. package/build/esm/care.js +26 -23
  38. package/build/esm/careBookingSearchBar.js +1582 -0
  39. package/build/esm/careBookingSearchBarV2.js +1655 -0
  40. package/build/esm/components.js +93 -83
  41. package/build/esm/{constants-bdf5e358.js → constants-e9ebe043.js} +1 -1
  42. package/build/esm/constants.js +3 -3
  43. package/build/esm/constantsDomainLocales.js +1 -1
  44. package/build/esm/constantsRiskScreener.js +2 -2
  45. package/build/esm/constantsSite.js +2 -2
  46. package/build/esm/{core-b4f1131e.js → core-6d8629c2.js} +1 -1
  47. package/build/esm/{dataTransform-ad9d785b.js → dataTransform-2023858d.js} +2 -2
  48. package/build/esm/ecom.js +4 -4
  49. package/build/esm/editor-82c3d476.js +959 -0
  50. package/build/esm/embeddedHeathToolCards_babyGrowth.js +22 -20
  51. package/build/esm/embeddedHeathToolCards_babyPoop.js +18 -16
  52. package/build/esm/embeddedHeathToolCards_babyVaccine.js +21 -19
  53. package/build/esm/embeddedHeathToolCards_bmi_bmi.js +25 -23
  54. package/build/esm/embeddedHeathToolCards_bmrBmr.js +25 -23
  55. package/build/esm/embeddedHeathToolCards_dueDate_dueDate.js +21 -19
  56. package/build/esm/embeddedHeathToolCards_ovulation_ovulation.js +21 -19
  57. package/build/esm/embeddedHeathToolCards_pwg_pwg.js +26 -24
  58. package/build/esm/embeddedHeathToolCards_targetHeartRate.js +27 -25
  59. package/build/esm/{fixedBottomAdBlock-e5747eb3.js → fixedBottomAdBlock-2af1606f.js} +26 -662
  60. package/build/esm/footer.js +20 -18
  61. package/build/esm/gAssets.js +2 -2
  62. package/build/esm/healthToolsCardWrapper.js +17 -15
  63. package/build/esm/healthToolsForm.js +33 -31
  64. package/build/esm/hooks.js +15 -15
  65. package/build/esm/i18n.js +2 -2
  66. package/build/esm/i18nV2.js +2 -2
  67. package/build/esm/{index-9d2cc0b2.js → index-04ba5caa.js} +1 -1
  68. package/build/esm/{index-8f953b02.js → index-082a24ae.js} +12 -11
  69. package/build/esm/{index-46a2a5d7.js → index-1313a7ac.js} +12 -11
  70. package/build/esm/{index-1322446c.js → index-13783871.js} +2 -2
  71. package/build/esm/{index-3685677f.js → index-16a4f1c7.js} +16 -15
  72. package/build/esm/{index-cc650c45.js → index-19f27bd3.js} +2 -2
  73. package/build/esm/{index-7c6e33e0.js → index-1a2bc551.js} +2 -2
  74. package/build/esm/{index-029c478e.js → index-275c8526.js} +14 -13
  75. package/build/esm/{index-e7c62f10.js → index-277566f7.js} +1 -1
  76. package/build/esm/{index-240e2930.js → index-2ac50d8f.js} +15 -14
  77. package/build/esm/{index-0f6906bb.js → index-2c4a2d31.js} +1 -1
  78. package/build/esm/{index-69dd7596.js → index-32a968a1.js} +6 -6
  79. package/build/esm/{index-0025652b.js → index-346fd194.js} +21 -19
  80. package/build/esm/{index-d4941998.js → index-38b87b21.js} +12 -11
  81. package/build/esm/{index-27a9a555.js → index-46c22744.js} +6 -6
  82. package/build/esm/index-4cf37916.js +22 -0
  83. package/build/esm/{index-5407e81e.js → index-4d27d02e.js} +15 -14
  84. package/build/esm/{index-dbb0b265.js → index-52d04cc5.js} +7 -7
  85. package/build/esm/index-538ca8aa.js +860 -0
  86. package/build/esm/{index-691f32bb.js → index-57da0f13.js} +16 -88
  87. package/build/esm/{index-2449d246.js → index-5e17f985.js} +16 -15
  88. package/build/esm/{index-ffd3c918.js → index-605eed95.js} +35 -800
  89. package/build/esm/{index-b1022535.js → index-628c5e84.js} +2 -2
  90. package/build/esm/{index-0cc19c33.js → index-64b1cd5c.js} +1 -1
  91. package/build/esm/index-673fd5bd.js +1264 -0
  92. package/build/esm/{index-804dcc5a.js → index-70883b48.js} +17 -16
  93. package/build/esm/{index-32114d1a.js → index-71c8b83f.js} +3 -142
  94. package/build/esm/{index-1f077f71.js → index-72c269cf.js} +3 -3
  95. package/build/esm/index-7ad9db02.js +1030 -0
  96. package/build/esm/{index-394c352b.js → index-7ca4ec53.js} +15 -14
  97. package/build/esm/{index-f56ad865.js → index-7decdf27.js} +1 -1
  98. package/build/esm/index-7e95ba03.js +144 -0
  99. package/build/esm/{index-0dd98ba5.js → index-84b3ef3d.js} +3 -3
  100. package/build/esm/{index-4e0ef954.js → index-8b9c7b45.js} +3 -3
  101. package/build/esm/{index-b97f14ca.js → index-930b0a77.js} +16 -15
  102. package/build/esm/{index-79b8f3a0.js → index-93c8863d.js} +2 -2
  103. package/build/esm/{index-16ed17c9.js → index-949f771c.js} +6 -6
  104. package/build/esm/{index-22dbd9d2.js → index-99551970.js} +2 -2
  105. package/build/esm/{index-bf7b2785.js → index-9c268a93.js} +2 -2
  106. package/build/esm/{index-8801ddf9.js → index-9d7d3a53.js} +4 -4
  107. package/build/esm/{index-02019218.js → index-9e220aaa.js} +2 -2
  108. package/build/esm/{index-f4468b77.js → index-a424a33d.js} +3 -3
  109. package/build/esm/{index-b4866578.js → index-a54b6536.js} +14 -13
  110. package/build/esm/{index-53ca94ab.js → index-b09ced58.js} +1 -1
  111. package/build/esm/{index-b13c7add.js → index-b5ed732f.js} +5 -5
  112. package/build/esm/{index-68f3752c.js → index-b867d267.js} +1 -1
  113. package/build/esm/{index-d72f98d1.js → index-c4b04b5f.js} +1 -1
  114. package/build/esm/{index-7aa8728c.js → index-c5286b89.js} +12 -11
  115. package/build/esm/{index-151b9162.js → index-cbb45a5d.js} +2 -2
  116. package/build/esm/{index-2e4a2f44.js → index-d4dcfb68.js} +2 -2
  117. package/build/esm/{index-d7019532.js → index-dec46974.js} +20 -17
  118. package/build/esm/index-e19da15e.js +468 -0
  119. package/build/esm/{index-63825539.js → index-e1d35fec.js} +7 -6
  120. package/build/esm/{index-5eda6b48.js → index-e477c2a3.js} +23 -19
  121. package/build/esm/{index-d0d73bc9.js → index-ed292946.js} +2 -2
  122. package/build/esm/index-f3f06437.js +281 -0
  123. package/build/esm/index.js +118 -98
  124. package/build/esm/index.styles-25454e9c.js +62 -0
  125. package/build/esm/interfaces/types/Subot.d.ts +3 -3
  126. package/build/esm/{labelSorting-eaf1959d.js → labelSorting-27ecf45e.js} +4 -4
  127. package/build/esm/lead.js +22 -20
  128. package/build/esm/{logoIcon-cb9c1f10.js → logoIcon-ef6d9e4c.js} +2 -2
  129. package/build/esm/mantine.js +24 -22
  130. package/build/esm/misc.js +18 -18
  131. package/build/esm/miscGetDynamicHealthTool.js +7 -7
  132. package/build/esm/miscGetSocialList.js +12 -12
  133. package/build/esm/miscScreenSizeContext.js +1 -1
  134. package/build/esm/mobileBottomNavigation.js +19 -0
  135. package/build/esm/mobileBottomNavigationIcon.js +10 -0
  136. package/build/esm/molecules.js +71 -64
  137. package/build/esm/moleculesArticleCard.js +85 -0
  138. package/build/esm/moleculesArticleCardV2.js +171 -0
  139. package/build/esm/navigation.js +40 -35
  140. package/build/esm/navigationLogoutPopup.js +116 -0
  141. package/build/esm/navigationProfileButton.js +43 -0
  142. package/build/esm/{normalizeLink-c66d19ce.js → normalizeLink-d756e5e6.js} +1 -1
  143. package/build/esm/onboardingV2.js +27 -25
  144. package/build/esm/organisms.js +46 -41
  145. package/build/esm/post-86117110.js +267 -0
  146. package/build/esm/profileNavigation.js +441 -0
  147. package/build/esm/progressBar.js +250 -0
  148. package/build/esm/pwg.js +21 -19
  149. package/build/esm/{routing-f3629b7f.js → routing-b81b8f17.js} +1 -1
  150. package/build/esm/subot.js +29 -27
  151. package/build/esm/surveyOrPremiumBanner.js +30 -28
  152. package/build/esm/surveyQuestionCard.js +10 -10
  153. package/build/esm/{surveyThankyouCard-169d4956.js → surveyThankyouCard-1b30aa0b.js} +5 -5
  154. package/build/esm/together.js +53 -44
  155. package/build/esm/togetherApiUtils.js +4 -4
  156. package/build/esm/togetherAtoms.js +29 -26
  157. package/build/esm/togetherComponentGlobalContext.js +4 -4
  158. package/build/esm/togetherMolecules.js +56 -47
  159. package/build/esm/togetherMoleculesCardAuthor.js +41 -0
  160. package/build/esm/togetherMoleculesPostImagePreview.js +21 -0
  161. package/build/esm/togetherMoleculesProfileDetail.js +53 -0
  162. package/build/esm/togetherOrganisms.js +53 -44
  163. package/build/esm/togetherRichTextEditor.js +27 -0
  164. package/build/esm/togetherShareBox.js +305 -0
  165. package/build/esm/{treePopoverMenu-32a26245.js → treePopoverMenu-04ded0ef.js} +18 -17
  166. package/build/esm/types-3eb97d85.js +44 -0
  167. package/build/esm/types.js +2 -2
  168. package/build/esm/{useCategory-0995f0b4.js → useCategory-391ffab0.js} +5 -5
  169. package/build/esm/{useHealthToolCache-7387a56d.js → useHealthToolCache-931ab3ca.js} +1 -1
  170. package/build/esm/{useMantineLocale-7d4ef853.js → useMantineLocale-b29ca68b.js} +5 -5
  171. package/build/esm/{usePlacesAutocomplete-7f23b876.js → usePlacesAutocomplete-91226a4d.js} +1 -1
  172. package/build/esm/useTogetherAuthRequiredAction.js +4 -4
  173. package/build/esm/{useTranslations-12762455.js → useTranslations-b66d9f2b.js} +1 -1
  174. package/build/esm/utils-92e2bc22.js +206 -0
  175. package/build/esm/{utils-24afe0f1.js → utils-f4b925d7.js} +2 -2
  176. package/build/esm/{utils-aa5734af.js → utils-f873578b.js} +4 -4
  177. package/build/esm/vaccination.js +20 -18
  178. package/build/{fixedBottomAdBlock-4db856c1.js → fixedBottomAdBlock-605a8692.js} +49 -691
  179. package/build/footer.js +20 -18
  180. package/build/gAssets.js +2 -2
  181. package/build/healthToolsCardWrapper.js +17 -15
  182. package/build/healthToolsForm.js +33 -31
  183. package/build/hooks.js +15 -15
  184. package/build/i18n.js +1 -1
  185. package/build/i18nV2.js +1 -1
  186. package/build/{index-a91bff81.js → index-0afde39e.js} +2 -2
  187. package/build/{index-5d3563a4.js → index-0cb2de9d.js} +3 -3
  188. package/build/{index-922333dc.js → index-188e2316.js} +15 -14
  189. package/build/index-1b06e81f.js +151 -0
  190. package/build/{index-46a71da2.js → index-1cdccd4e.js} +2 -2
  191. package/build/index-27e50de1.js +478 -0
  192. package/build/{index-ad9d0b0a.js → index-32abfb15.js} +12 -11
  193. package/build/{index-82a0b931.js → index-36723718.js} +6 -6
  194. package/build/{index-ce1b7f76.js → index-36ba9947.js} +2 -2
  195. package/build/{index-c09c64b7.js → index-3c593ede.js} +6 -6
  196. package/build/{index-0450bf33.js → index-4bf6b5da.js} +24 -99
  197. package/build/{index-281daa83.js → index-4fd69136.js} +16 -15
  198. package/build/{index-4c15723a.js → index-526cee72.js} +6 -6
  199. package/build/{index-b64c981f.js → index-549b9e8c.js} +1 -1
  200. package/build/{index-5e984f33.js → index-5b52b076.js} +38 -34
  201. package/build/{index-776f2478.js → index-5dbd317c.js} +34 -33
  202. package/build/index-5dcd87b7.js +289 -0
  203. package/build/{index-169bae02.js → index-648aac83.js} +2 -2
  204. package/build/{index-34ca22f2.js → index-6b7b4292.js} +3 -3
  205. package/build/{index-743255db.js → index-6b95442c.js} +2 -2
  206. package/build/{index-a5526d77.js → index-6b9e8dda.js} +3 -3
  207. package/build/{index-e256aef8.js → index-767f9ac6.js} +2 -2
  208. package/build/{index-deec7e58.js → index-7ce45455.js} +16 -15
  209. package/build/{index-6223ea5f.js → index-81ff6094.js} +7 -7
  210. package/build/{index-0236dd90.js → index-86ecfc48.js} +3 -3
  211. package/build/{index-ddc36398.js → index-8a19ce1b.js} +96 -864
  212. package/build/{index-e3bbbf6e.js → index-8d9663db.js} +9 -8
  213. package/build/{index-ffc38f11.js → index-9151d357.js} +2 -2
  214. package/build/index-922020ed.js +1045 -0
  215. package/build/{index-ac40492f.js → index-a76596ef.js} +1 -1
  216. package/build/{index-0485f54b.js → index-a839c6ca.js} +3 -3
  217. package/build/{index-477ad803.js → index-a8705384.js} +1 -1
  218. package/build/{index-418220e9.js → index-aad249ab.js} +2 -2
  219. package/build/{index-d4801d2c.js → index-af48fea3.js} +5 -5
  220. package/build/{index-41b74c44.js → index-b04c5212.js} +16 -15
  221. package/build/{index-7072811b.js → index-b4fd3100.js} +1 -1
  222. package/build/{index-d903234f.js → index-be0a9d63.js} +17 -16
  223. package/build/{index-b502b7a7.js → index-be262a50.js} +2 -2
  224. package/build/index-becfec7a.js +1307 -0
  225. package/build/index-bf3796aa.js +870 -0
  226. package/build/{index-8a509409.js → index-cc4ce0c4.js} +1 -1
  227. package/build/{index-e6f93e28.js → index-cd0db938.js} +34 -31
  228. package/build/{index-e2ca51d6.js → index-d0610b0f.js} +14 -13
  229. package/build/{index-28f47f15.js → index-d393d57e.js} +1 -1
  230. package/build/{index-538200cd.js → index-d471ff2d.js} +1 -1
  231. package/build/{index-4e5179a2.js → index-d5d9ceb9.js} +15 -14
  232. package/build/{index-cd94cd77.js → index-de26b5d1.js} +12 -11
  233. package/build/{index-3efdbdaf.js → index-dec3abcf.js} +15 -14
  234. package/build/{index-b2757afe.js → index-e018af91.js} +31 -29
  235. package/build/index-e8dc7fdb.js +29 -0
  236. package/build/{index-a0ee5e9f.js → index-f30e56f1.js} +12 -11
  237. package/build/{index-b7e7f5d7.js → index-f6b32484.js} +12 -11
  238. package/build/{index-8e183dab.js → index-f91ed3be.js} +4 -4
  239. package/build/{index-38d090ba.js → index-faa2908c.js} +3 -143
  240. package/build/{index-212720b1.js → index-fbb369ff.js} +1 -1
  241. package/build/{index-3c06bcfd.js → index-fde11604.js} +2 -2
  242. package/build/index.js +182 -162
  243. package/build/index.styles-9031f6d6.js +65 -0
  244. package/build/interfaces/types/Subot.d.ts +3 -3
  245. package/build/{labelSorting-8542da52.js → labelSorting-11165c8e.js} +4 -4
  246. package/build/lead.js +22 -20
  247. package/build/{logoIcon-bd143b65.js → logoIcon-f3283bfd.js} +2 -2
  248. package/build/mantine.js +20 -18
  249. package/build/misc.js +18 -18
  250. package/build/miscGetDynamicHealthTool.js +7 -7
  251. package/build/miscGetSocialList.js +12 -12
  252. package/build/miscScreenSizeContext.js +1 -1
  253. package/build/mobileBottomNavigation.js +27 -0
  254. package/build/mobileBottomNavigationIcon.js +18 -0
  255. package/build/molecules.js +76 -69
  256. package/build/moleculesArticleCard.js +93 -0
  257. package/build/moleculesArticleCardV2.js +180 -0
  258. package/build/navigation.js +40 -35
  259. package/build/navigationLogoutPopup.js +125 -0
  260. package/build/navigationProfileButton.js +51 -0
  261. package/build/onboardingV2.js +29 -27
  262. package/build/organisms.js +49 -44
  263. package/build/post-0fec66f4.js +303 -0
  264. package/build/profileNavigation.js +450 -0
  265. package/build/progressBar.js +260 -0
  266. package/build/pwg.js +21 -19
  267. package/build/{routing-90dba95d.js → routing-7a9c8608.js} +1 -1
  268. package/build/subot.js +28 -26
  269. package/build/surveyOrPremiumBanner.js +30 -28
  270. package/build/surveyQuestionCard.js +10 -10
  271. package/build/{surveyThankyouCard-9aad36f8.js → surveyThankyouCard-db73c893.js} +5 -5
  272. package/build/together.js +77 -68
  273. package/build/togetherApiUtils.js +4 -4
  274. package/build/togetherAtoms.js +29 -26
  275. package/build/togetherComponentGlobalContext.js +4 -4
  276. package/build/togetherMolecules.js +79 -70
  277. package/build/togetherMoleculesCardAuthor.js +49 -0
  278. package/build/togetherMoleculesPostImagePreview.js +29 -0
  279. package/build/togetherMoleculesProfileDetail.js +70 -0
  280. package/build/togetherOrganisms.js +53 -44
  281. package/build/togetherRichTextEditor.js +36 -0
  282. package/build/togetherShareBox.js +314 -0
  283. package/build/{treePopoverMenu-3f7e6767.js → treePopoverMenu-61ebd05c.js} +18 -17
  284. package/build/types-57052089.js +52 -0
  285. package/build/types.js +2 -2
  286. package/build/{useCategory-a808e6a6.js → useCategory-d9f73b82.js} +5 -5
  287. package/build/{useHealthToolCache-42222cc2.js → useHealthToolCache-4b5bfb11.js} +1 -1
  288. package/build/{useMantineLocale-8df90961.js → useMantineLocale-cc272195.js} +5 -5
  289. package/build/{usePlacesAutocomplete-4e21e680.js → usePlacesAutocomplete-a0156f14.js} +1 -1
  290. package/build/useTogetherAuthRequiredAction.js +4 -4
  291. package/build/{useTranslations-6363932f.js → useTranslations-8a9fa84d.js} +1 -1
  292. package/build/{utils-87deb74b.js → utils-251b2841.js} +3 -3
  293. package/build/{utils-4058dee5.js → utils-c29214c6.js} +2 -2
  294. package/build/utils-f47b2d2d.js +229 -0
  295. package/build/vaccination.js +24 -22
  296. package/package.json +1 -1
  297. package/build/esm/index-43aaedbb.js +0 -5060
  298. package/build/esm/types-996bf08e.js +0 -3433
  299. package/build/index-05199dd8.js +0 -5123
  300. package/build/types-89c90eb3.js +0 -3447
  301. /package/build/{BMI_BOYS.percentile.monthly-00dc2939.js → BMI_BOYS.percentile.monthly-5f29289b.js} +0 -0
  302. /package/build/{BMI_BOYS.percentile.weekly-eebf395b.js → BMI_BOYS.percentile.weekly-53584232.js} +0 -0
  303. /package/build/{BMI_BOYS.percentile.yearly-fa98b4c9.js → BMI_BOYS.percentile.yearly-84aaf8fb.js} +0 -0
  304. /package/build/{BMI_BOYS.zscore.monthly-cc66463f.js → BMI_BOYS.zscore.monthly-76d7fd0e.js} +0 -0
  305. /package/build/{BMI_BOYS.zscore.weekly-e1c85879.js → BMI_BOYS.zscore.weekly-ed3d66f2.js} +0 -0
  306. /package/build/{BMI_BOYS.zscore.yearly-88d58724.js → BMI_BOYS.zscore.yearly-7e74f0e8.js} +0 -0
  307. /package/build/{BMI_GIRLS.percentile.monthly-82aff448.js → BMI_GIRLS.percentile.monthly-6973d8b0.js} +0 -0
  308. /package/build/{BMI_GIRLS.percentile.weekly-c5767e28.js → BMI_GIRLS.percentile.weekly-a873a4e6.js} +0 -0
  309. /package/build/{BMI_GIRLS.percentile.yearly-e45d9106.js → BMI_GIRLS.percentile.yearly-e86761bb.js} +0 -0
  310. /package/build/{BMI_GIRLS.zscore.monthly-120aa581.js → BMI_GIRLS.zscore.monthly-9a12fa84.js} +0 -0
  311. /package/build/{BMI_GIRLS.zscore.weekly-2f64347e.js → BMI_GIRLS.zscore.weekly-5936ed5b.js} +0 -0
  312. /package/build/{BMI_GIRLS.zscore.yearly-ed842624.js → BMI_GIRLS.zscore.yearly-d40d8356.js} +0 -0
  313. /package/build/{ChevronDown-89002c32.js → ChevronDown-a6775d48.js} +0 -0
  314. /package/build/{Close-5e8e15ce.js → Close-9fa735bc.js} +0 -0
  315. /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-b1965149.js → HEAD CIRCUM_BOYS.percentile.monthly-873a839f.js} +0 -0
  316. /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-7c8df376.js → HEAD CIRCUM_BOYS.percentile.weekly-bbe3965d.js} +0 -0
  317. /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-ebafd6df.js → HEAD CIRCUM_BOYS.percentile.yearly-645dfc78.js} +0 -0
  318. /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-b5a0cdd1.js → HEAD CIRCUM_BOYS.zscore.monthly-9fe137bf.js} +0 -0
  319. /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-4c32261f.js → HEAD CIRCUM_BOYS.zscore.weekly-2ccb15fb.js} +0 -0
  320. /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-7642a6b6.js → HEAD CIRCUM_BOYS.zscore.yearly-48aed724.js} +0 -0
  321. /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-37a5b7b2.js → HEAD CIRCUM_GIRLS.percentile.monthly-d99d6d30.js} +0 -0
  322. /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-909278a6.js → HEAD CIRCUM_GIRLS.percentile.weekly-8a49b504.js} +0 -0
  323. /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-bd7732f5.js → HEAD CIRCUM_GIRLS.percentile.yearly-d747b0cd.js} +0 -0
  324. /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-5a1dc106.js → HEAD CIRCUM_GIRLS.zscore.monthly-8ef18721.js} +0 -0
  325. /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-19531ac2.js → HEAD CIRCUM_GIRLS.zscore.weekly-853cca20.js} +0 -0
  326. /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-3e9b57e2.js → HEAD CIRCUM_GIRLS.zscore.yearly-4d5b2175.js} +0 -0
  327. /package/build/{HEIGHT_BOYS.percentile.monthly-75d3928f.js → HEIGHT_BOYS.percentile.monthly-070590b8.js} +0 -0
  328. /package/build/{HEIGHT_BOYS.percentile.weekly-49d0eac1.js → HEIGHT_BOYS.percentile.weekly-56741428.js} +0 -0
  329. /package/build/{HEIGHT_BOYS.percentile.yearly-ca043db8.js → HEIGHT_BOYS.percentile.yearly-9c81f767.js} +0 -0
  330. /package/build/{HEIGHT_BOYS.zscore.monthly-0ef5a0b0.js → HEIGHT_BOYS.zscore.monthly-729982c3.js} +0 -0
  331. /package/build/{HEIGHT_BOYS.zscore.weekly-897641f9.js → HEIGHT_BOYS.zscore.weekly-ddb206fb.js} +0 -0
  332. /package/build/{HEIGHT_BOYS.zscore.yearly-2f57ee05.js → HEIGHT_BOYS.zscore.yearly-5fc7ea6a.js} +0 -0
  333. /package/build/{HEIGHT_GIRLS.percentile.monthly-35a2bd2b.js → HEIGHT_GIRLS.percentile.monthly-8cbc8d18.js} +0 -0
  334. /package/build/{HEIGHT_GIRLS.percentile.weekly-6682008a.js → HEIGHT_GIRLS.percentile.weekly-7145e94f.js} +0 -0
  335. /package/build/{HEIGHT_GIRLS.percentile.yearly-1490cd28.js → HEIGHT_GIRLS.percentile.yearly-ab0e4f4e.js} +0 -0
  336. /package/build/{HEIGHT_GIRLS.zscore.monthly-ab0ba051.js → HEIGHT_GIRLS.zscore.monthly-b851b1d7.js} +0 -0
  337. /package/build/{HEIGHT_GIRLS.zscore.weekly-8cd489df.js → HEIGHT_GIRLS.zscore.weekly-98aef3cf.js} +0 -0
  338. /package/build/{HEIGHT_GIRLS.zscore.yearly-547aa680.js → HEIGHT_GIRLS.zscore.yearly-65d990f7.js} +0 -0
  339. /package/build/{Locale-126bf6bd.js → Locale-07aceee9.js} +0 -0
  340. /package/build/{Visible-7090d851.js → Visible-ddeaf4cc.js} +0 -0
  341. /package/build/{WEIGHT_BOYS.percentile.monthly-2c6444a6.js → WEIGHT_BOYS.percentile.monthly-0ce96694.js} +0 -0
  342. /package/build/{WEIGHT_BOYS.percentile.weekly-d43234b7.js → WEIGHT_BOYS.percentile.weekly-b5397f20.js} +0 -0
  343. /package/build/{WEIGHT_BOYS.percentile.yearly-361c6438.js → WEIGHT_BOYS.percentile.yearly-80cccd42.js} +0 -0
  344. /package/build/{WEIGHT_BOYS.zscore.monthly-1a56d8b2.js → WEIGHT_BOYS.zscore.monthly-12907f1f.js} +0 -0
  345. /package/build/{WEIGHT_BOYS.zscore.weekly-b1548cdf.js → WEIGHT_BOYS.zscore.weekly-a1af17eb.js} +0 -0
  346. /package/build/{WEIGHT_BOYS.zscore.yearly-17b0334c.js → WEIGHT_BOYS.zscore.yearly-2649ff58.js} +0 -0
  347. /package/build/{WEIGHT_GIRLS.percentile.monthly-64e137c6.js → WEIGHT_GIRLS.percentile.monthly-222d7201.js} +0 -0
  348. /package/build/{WEIGHT_GIRLS.percentile.weekly-98c2fb5d.js → WEIGHT_GIRLS.percentile.weekly-2997b740.js} +0 -0
  349. /package/build/{WEIGHT_GIRLS.percentile.yearly-533341f7.js → WEIGHT_GIRLS.percentile.yearly-3dc5928a.js} +0 -0
  350. /package/build/{WEIGHT_GIRLS.zscore.monthly-d17a0d64.js → WEIGHT_GIRLS.zscore.monthly-742b7617.js} +0 -0
  351. /package/build/{WEIGHT_GIRLS.zscore.weekly-36a412aa.js → WEIGHT_GIRLS.zscore.weekly-5ee1ca40.js} +0 -0
  352. /package/build/{WEIGHT_GIRLS.zscore.yearly-68f9f66b.js → WEIGHT_GIRLS.zscore.yearly-d6ca7d60.js} +0 -0
  353. /package/build/{animation-fce92928.js → animation-a1ed71d8.js} +0 -0
  354. /package/build/{cart-d32faa71.js → cart-7bc1b943.js} +0 -0
  355. /package/build/{constants-83e17a08.js → constants-4cad9f4d.js} +0 -0
  356. /package/build/{constants-ef1d9e50.js → constants-81b95117.js} +0 -0
  357. /package/build/{constants-6b5e2780.js → constants-c3b9c9a9.js} +0 -0
  358. /package/build/{dataTransform-64f3ba4c.js → dataTransform-867c472c.js} +0 -0
  359. /package/build/{doctor-2a2b78b0.js → doctor-dca6d1b2.js} +0 -0
  360. /package/build/esm/{BMI_BOYS.percentile.monthly-71f6615e.js → BMI_BOYS.percentile.monthly-2388d98f.js} +0 -0
  361. /package/build/esm/{BMI_BOYS.percentile.weekly-8729108b.js → BMI_BOYS.percentile.weekly-8ebe6955.js} +0 -0
  362. /package/build/esm/{BMI_BOYS.percentile.yearly-fe8dc27c.js → BMI_BOYS.percentile.yearly-3a97e95b.js} +0 -0
  363. /package/build/esm/{BMI_BOYS.zscore.monthly-aa14f52a.js → BMI_BOYS.zscore.monthly-f7572dcd.js} +0 -0
  364. /package/build/esm/{BMI_BOYS.zscore.weekly-6857bca0.js → BMI_BOYS.zscore.weekly-d6281906.js} +0 -0
  365. /package/build/esm/{BMI_BOYS.zscore.yearly-05894e8d.js → BMI_BOYS.zscore.yearly-fbebaaca.js} +0 -0
  366. /package/build/esm/{BMI_GIRLS.percentile.monthly-99639eee.js → BMI_GIRLS.percentile.monthly-a75c8880.js} +0 -0
  367. /package/build/esm/{BMI_GIRLS.percentile.weekly-241a8c86.js → BMI_GIRLS.percentile.weekly-652bc9af.js} +0 -0
  368. /package/build/esm/{BMI_GIRLS.percentile.yearly-a7d673ad.js → BMI_GIRLS.percentile.yearly-8bcb5a6e.js} +0 -0
  369. /package/build/esm/{BMI_GIRLS.zscore.monthly-ac552c64.js → BMI_GIRLS.zscore.monthly-ecbe2982.js} +0 -0
  370. /package/build/esm/{BMI_GIRLS.zscore.weekly-d3bd5cf8.js → BMI_GIRLS.zscore.weekly-3abed735.js} +0 -0
  371. /package/build/esm/{BMI_GIRLS.zscore.yearly-68c40e02.js → BMI_GIRLS.zscore.yearly-d88a34a0.js} +0 -0
  372. /package/build/esm/{ChevronDown-1c6ac70a.js → ChevronDown-dfd91883.js} +0 -0
  373. /package/build/esm/{Close-9dbbc4f5.js → Close-b8fc27b1.js} +0 -0
  374. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-e844f279.js → HEAD CIRCUM_BOYS.percentile.monthly-ff980a90.js} +0 -0
  375. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-c0ea6fc4.js → HEAD CIRCUM_BOYS.percentile.weekly-eb86eac9.js} +0 -0
  376. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-58273474.js → HEAD CIRCUM_BOYS.percentile.yearly-27ed6504.js} +0 -0
  377. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-867569e0.js → HEAD CIRCUM_BOYS.zscore.monthly-0d345597.js} +0 -0
  378. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-1c2e6c46.js → HEAD CIRCUM_BOYS.zscore.weekly-c182ab46.js} +0 -0
  379. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-4d2f300f.js → HEAD CIRCUM_BOYS.zscore.yearly-d45dbce1.js} +0 -0
  380. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-5d75244f.js → HEAD CIRCUM_GIRLS.percentile.monthly-61919e45.js} +0 -0
  381. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-73bd9176.js → HEAD CIRCUM_GIRLS.percentile.weekly-51fa8f98.js} +0 -0
  382. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-d1a55615.js → HEAD CIRCUM_GIRLS.percentile.yearly-c1fa6006.js} +0 -0
  383. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-4d365a9f.js → HEAD CIRCUM_GIRLS.zscore.monthly-4dfc55d8.js} +0 -0
  384. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-41370dfb.js → HEAD CIRCUM_GIRLS.zscore.weekly-b21b5bf1.js} +0 -0
  385. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-06ac6807.js → HEAD CIRCUM_GIRLS.zscore.yearly-c42836fa.js} +0 -0
  386. /package/build/esm/{HEIGHT_BOYS.percentile.monthly-3b18440a.js → HEIGHT_BOYS.percentile.monthly-24ff8afa.js} +0 -0
  387. /package/build/esm/{HEIGHT_BOYS.percentile.weekly-01a65af3.js → HEIGHT_BOYS.percentile.weekly-2be7b66e.js} +0 -0
  388. /package/build/esm/{HEIGHT_BOYS.percentile.yearly-c8203619.js → HEIGHT_BOYS.percentile.yearly-ac02aa2d.js} +0 -0
  389. /package/build/esm/{HEIGHT_BOYS.zscore.monthly-a3319613.js → HEIGHT_BOYS.zscore.monthly-b43667dc.js} +0 -0
  390. /package/build/esm/{HEIGHT_BOYS.zscore.weekly-981efa8b.js → HEIGHT_BOYS.zscore.weekly-abcfcf3a.js} +0 -0
  391. /package/build/esm/{HEIGHT_BOYS.zscore.yearly-a98e3bc6.js → HEIGHT_BOYS.zscore.yearly-71598c16.js} +0 -0
  392. /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-6959773b.js → HEIGHT_GIRLS.percentile.monthly-7f9d679c.js} +0 -0
  393. /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-128bb11e.js → HEIGHT_GIRLS.percentile.weekly-6ce1d4e7.js} +0 -0
  394. /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-29a94e1c.js → HEIGHT_GIRLS.percentile.yearly-c398fd6b.js} +0 -0
  395. /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-dd466c09.js → HEIGHT_GIRLS.zscore.monthly-8d33bc28.js} +0 -0
  396. /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-b602fae7.js → HEIGHT_GIRLS.zscore.weekly-eb44c302.js} +0 -0
  397. /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-358063df.js → HEIGHT_GIRLS.zscore.yearly-10b4d1fe.js} +0 -0
  398. /package/build/esm/{Locale-f781df87.js → Locale-b86a7a92.js} +0 -0
  399. /package/build/esm/{Visible-46717d08.js → Visible-69da852f.js} +0 -0
  400. /package/build/esm/{WEIGHT_BOYS.percentile.monthly-00996ab0.js → WEIGHT_BOYS.percentile.monthly-fd349fe7.js} +0 -0
  401. /package/build/esm/{WEIGHT_BOYS.percentile.weekly-c3c6f755.js → WEIGHT_BOYS.percentile.weekly-d5e52d60.js} +0 -0
  402. /package/build/esm/{WEIGHT_BOYS.percentile.yearly-c4571ef6.js → WEIGHT_BOYS.percentile.yearly-929119b3.js} +0 -0
  403. /package/build/esm/{WEIGHT_BOYS.zscore.monthly-b5eaafd1.js → WEIGHT_BOYS.zscore.monthly-3f0f08cd.js} +0 -0
  404. /package/build/esm/{WEIGHT_BOYS.zscore.weekly-b058aef3.js → WEIGHT_BOYS.zscore.weekly-b9fd3298.js} +0 -0
  405. /package/build/esm/{WEIGHT_BOYS.zscore.yearly-4557bb07.js → WEIGHT_BOYS.zscore.yearly-9945948d.js} +0 -0
  406. /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-094c8315.js → WEIGHT_GIRLS.percentile.monthly-1e83ae51.js} +0 -0
  407. /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-59bd62f7.js → WEIGHT_GIRLS.percentile.weekly-c3531852.js} +0 -0
  408. /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-7064def2.js → WEIGHT_GIRLS.percentile.yearly-3c0040b0.js} +0 -0
  409. /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-3e264c0b.js → WEIGHT_GIRLS.zscore.monthly-3baeda15.js} +0 -0
  410. /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-8402d0e1.js → WEIGHT_GIRLS.zscore.weekly-2d8e6618.js} +0 -0
  411. /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-58908f5c.js → WEIGHT_GIRLS.zscore.yearly-826f5bdd.js} +0 -0
  412. /package/build/esm/{animation-12f6a99a.js → animation-7207941a.js} +0 -0
  413. /package/build/esm/{cart-5cbf8fde.js → cart-4f482601.js} +0 -0
  414. /package/build/esm/{constants-c65d5e73.js → constants-0497b893.js} +0 -0
  415. /package/build/esm/{constants-7447b364.js → constants-af02be2a.js} +0 -0
  416. /package/build/esm/{constants-28f21bf7.js → constants-f7943ab2.js} +0 -0
  417. /package/build/esm/{dataTransform-4564c01a.js → dataTransform-610e61bf.js} +0 -0
  418. /package/build/esm/{doctor-a6dcb5b0.js → doctor-63e09ada.js} +0 -0
  419. /package/build/esm/{index-d1c6a5eb.js → index-20192854.js} +0 -0
  420. /package/build/esm/{index-3dfef0e2.js → index-20199246.js} +0 -0
  421. /package/build/esm/{index-7149c324.js → index-5364f2db.js} +0 -0
  422. /package/build/esm/{index-9d1a8bc8.js → index-56d0ac47.js} +0 -0
  423. /package/build/esm/{index-e2a19de9.js → index-9f076f64.js} +0 -0
  424. /package/build/esm/{index-31ca33d1.js → index-a2506e52.js} +0 -0
  425. /package/build/esm/{index-b503d8ca.js → index-c130afdc.js} +0 -0
  426. /package/build/esm/{index-5bd25778.js → index-c9467e39.js} +0 -0
  427. /package/build/esm/{localizeNumberFormat-fe248dc9.js → localizeNumberFormat-3bf28240.js} +0 -0
  428. /package/build/esm/{number-59fe2c76.js → number-d26abebe.js} +0 -0
  429. /package/build/esm/{other-8082eeb8.js → other-08d0b30e.js} +0 -0
  430. /package/build/esm/{paths-a31c249e.js → paths-ce59b252.js} +0 -0
  431. /package/build/esm/{translationsContext-f05845a3.js → translationsContext-8afb0ce3.js} +0 -0
  432. /package/build/esm/{tslib.es6-2813a841.js → tslib.es6-e0840efa.js} +0 -0
  433. /package/build/esm/{types-e1b0b130.js → types-41242882.js} +0 -0
  434. /package/build/esm/{useIsInit-6417c32d.js → useIsInit-f59c6bd2.js} +0 -0
  435. /package/build/esm/{useOutsideClick-cabe5b52.js → useOutsideClick-12815e56.js} +0 -0
  436. /package/build/esm/{useScrollbarSize-93f9665c.js → useScrollbarSize-431cf33c.js} +0 -0
  437. /package/build/esm/{useUniqueId-0c237f04.js → useUniqueId-8f710187.js} +0 -0
  438. /package/build/esm/{utils-5ac430a2.js → utils-8a1f05c9.js} +0 -0
  439. /package/build/{index-9a3d05f1.js → index-017f99b2.js} +0 -0
  440. /package/build/{index-ddd1ae54.js → index-1a6a94cd.js} +0 -0
  441. /package/build/{index-126368b4.js → index-668f591b.js} +0 -0
  442. /package/build/{index-eae45243.js → index-70abc2ac.js} +0 -0
  443. /package/build/{index-1fab78b5.js → index-c6b0831a.js} +0 -0
  444. /package/build/{index-d0ba8956.js → index-ce2d2850.js} +0 -0
  445. /package/build/{index-31ba7c80.js → index-e3e72aed.js} +0 -0
  446. /package/build/{index-b895e598.js → index-f70c0edf.js} +0 -0
  447. /package/build/{localizeNumberFormat-52a8a959.js → localizeNumberFormat-30e7f015.js} +0 -0
  448. /package/build/{normalizeLink-8a458cb4.js → normalizeLink-c1b2b407.js} +0 -0
  449. /package/build/{number-8f639a87.js → number-20d56f69.js} +0 -0
  450. /package/build/{other-fcf0cbba.js → other-eedaf6ca.js} +0 -0
  451. /package/build/{paths-822d5ab1.js → paths-4c182009.js} +0 -0
  452. /package/build/{translationsContext-1fe0412c.js → translationsContext-cd046df4.js} +0 -0
  453. /package/build/{tslib.es6-d6f7eba3.js → tslib.es6-f3c387c0.js} +0 -0
  454. /package/build/{types-7b239cb4.js → types-2614ec58.js} +0 -0
  455. /package/build/{useIsInit-3c23a980.js → useIsInit-e56642e4.js} +0 -0
  456. /package/build/{useOutsideClick-dcf05d21.js → useOutsideClick-f18dfe3f.js} +0 -0
  457. /package/build/{useScrollbarSize-e144fad0.js → useScrollbarSize-4aaa4dd1.js} +0 -0
  458. /package/build/{useUniqueId-47d33d64.js → useUniqueId-621ec272.js} +0 -0
  459. /package/build/{utils-03c7b063.js → utils-ae9740c0.js} +0 -0
@@ -0,0 +1,959 @@
1
+ import { a as __awaiter } from './tslib.es6-e0840efa.js';
2
+ import React__default, { useRef, useState, useContext, useEffect, useCallback } from 'react';
3
+ import { B as Button } from './index-9c268a93.js';
4
+ import { I as Input } from './index-d4dcfb68.js';
5
+ import { T as Text } from './index-99551970.js';
6
+ import { u as useTranslations } from './useTranslations-b66d9f2b.js';
7
+ import debounce from 'lodash/debounce';
8
+ import { getCookie } from './miscCookieHelper.js';
9
+ import { a as useUniqueId } from './useUniqueId-8f710187.js';
10
+ import { T as TogetherComponentGlobalContext, b as callApiWithAuth, d as getApiPath, r as callApiWithAdminAuth, c as callApi } from './utils-f873578b.js';
11
+ import styled from '@emotion/styled';
12
+ import { theme } from './miscTheme.js';
13
+ import { PATHS, ADMIN_PATHS } from './togetherApiPaths.js';
14
+ import { B as BEARER_TOKEN_COOKIE } from './constants-0497b893.js';
15
+ import { b as reformatUrl, f as fixMalformedMention, c as removeFontFormat, h as highlightBadWords, i as removeEdittedBannedWord, w as wrapAnchorAroundUrls, j as getUrlsFromEditorString, A as ALLOW_DOMAIN_URL, k as escapeRegExp, g as getMentionIdsFromString, L as LIMIT_MENTION } from './post-86117110.js';
16
+ import { U as UserAvatar } from './index-93c8863d.js';
17
+ import { P as PopoverMenu } from './index-71c8b83f.js';
18
+
19
+ const StyledCreatePostDescription = styled.div `
20
+ input:focus,
21
+ textarea:focus,
22
+ [contenteditable='true'] {
23
+ outline: none;
24
+ }
25
+
26
+ .textarea-control {
27
+ position: relative;
28
+ border: 1px solid ${theme.colors.gray200};
29
+ border-radius: ${theme.borderRadius};
30
+ &.--focus {
31
+ border-color: ${theme.colors.primaryBase};
32
+ box-shadow: 0px 0px 2px 2px ${theme.colors.primary200};
33
+ }
34
+
35
+ .textarea-wrapper {
36
+ width: 100%;
37
+ height: 200px;
38
+ }
39
+
40
+ .control-tool {
41
+ position: absolute;
42
+ bottom: 0;
43
+ left: 0;
44
+ display: flex;
45
+ width: calc(100% - 2rem);
46
+ height: 40px;
47
+ align-items: center;
48
+ justify-content: flex-end;
49
+ border-top: 1px solid ${theme.colors.gray200};
50
+ margin: 0 1rem;
51
+
52
+ .tool-button {
53
+ display: flex;
54
+ width: 2rem;
55
+ height: 2rem;
56
+ align-items: center;
57
+ justify-content: center;
58
+ background: transparent;
59
+ cursor: pointer;
60
+ }
61
+ .image-icon {
62
+ vertical-align: middle;
63
+ }
64
+ }
65
+ }
66
+
67
+ .link-preview-wrapper {
68
+ position: relative;
69
+ .icon-close {
70
+ position: absolute;
71
+ top: 5px;
72
+ right: 5px;
73
+ width: 24px;
74
+ height: 24px;
75
+ cursor: pointer;
76
+ }
77
+ }
78
+
79
+ .image-gallery {
80
+ margin-bottom: 1rem;
81
+
82
+ .image-item {
83
+ position: relative;
84
+ overflow: hidden;
85
+ width: 100%;
86
+ height: 0;
87
+ padding-top: 67%;
88
+ margin-top: 1rem;
89
+ border-radius: ${theme.borderRadius};
90
+
91
+ & > img {
92
+ position: absolute;
93
+ top: 0;
94
+ left: 0;
95
+ width: 100%;
96
+ height: 100%;
97
+ object-fit: cover;
98
+ }
99
+
100
+ .close-btn {
101
+ position: absolute;
102
+ top: 8px;
103
+ right: 8px;
104
+ left: unset;
105
+ width: 24px;
106
+ height: 24px;
107
+ cursor: pointer;
108
+ }
109
+ }
110
+ }
111
+
112
+ .description-label {
113
+ margin-bottom: 5px;
114
+ color: ${theme.colors.gray600};
115
+ /* font-family: 'Open Sans', sans-serif; */
116
+ font-size: 13px;
117
+ font-weight: bold;
118
+ }
119
+
120
+ .count-string {
121
+ margin-top: 5px;
122
+ color: ${theme.colors.gray500};
123
+ font-size: 11px;
124
+ text-align: right;
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
+ const StyledEditorContainer = styled.div `
139
+ height: 100%;
140
+ position: relative;
141
+ width: 100%;
142
+ display: flex;
143
+ flex-direction: column;
144
+ .ql-toolbar.ql-snow {
145
+ top: 0;
146
+ width: 100%;
147
+ position: sticky;
148
+ z-index: 3;
149
+ border: none;
150
+ border-bottom: 1px solid #ccc;
151
+ background: white;
152
+ .ql-formats {
153
+ display: inline-flex;
154
+ align-items: center;
155
+ margin-right: 0.5rem;
156
+ .link-tool-wrapper {
157
+ .popover-menu__content {
158
+ padding: 0.5rem;
159
+ transform: translateX(calc(-50% - 1rem));
160
+ max-width: calc(100vw - 4rem);
161
+ ::before {
162
+ right: calc(50% - 8px);
163
+ }
164
+ .link-tool-popover {
165
+ input {
166
+ padding-left: 1rem;
167
+ }
168
+ .link-input-url {
169
+ margin-bottom: 0.5rem;
170
+ }
171
+ .link-input-text {
172
+ margin-bottom: 0.5rem;
173
+ }
174
+ label {
175
+ display: inline-block;
176
+ margin-bottom: 0.2rem;
177
+ }
178
+ .link-input-button-wrapper {
179
+ &[data-is-marrybaby='true'] {
180
+ .link-input-button {
181
+ border: solid 2px ${theme.mbColors.pink};
182
+ background-color: ${theme.mbColors.pink};
183
+ &:hover:not(:disabled) {
184
+ border: solid 2px ${theme.mbColors.pink};
185
+ background-color: ${theme.colors.white};
186
+ color: ${theme.mbColors.pink};
187
+ }
188
+ }
189
+ }
190
+ }
191
+ .link-input-button {
192
+ width: auto;
193
+ height: auto;
194
+ padding: 0.4rem 1rem;
195
+ background-color: ${theme.colors.primaryBase};
196
+
197
+ &:disabled {
198
+ border-color: #bfbfbf;
199
+ background-color: #bfbfbf;
200
+ color: #fff;
201
+ cursor: not-allowed;
202
+ }
203
+ &:hover:not(:disabled) {
204
+ background-color: ${theme.colors.primaryHover};
205
+ }
206
+ }
207
+ .error-text {
208
+ padding: 0;
209
+ margin-bottom: 0.5rem;
210
+ font-weight: 600;
211
+ color: ${theme.colors.red700};
212
+ }
213
+ }
214
+ }
215
+ }
216
+ }
217
+ @media (max-width: 450px) {
218
+ position: relative;
219
+ .ql-formats {
220
+ .link-tool-wrapper {
221
+ position: unset;
222
+ .popover-menu__content {
223
+ left: 0;
224
+ transform: unset;
225
+ max-width: 100%;
226
+ }
227
+ }
228
+ }
229
+ }
230
+ }
231
+ .quill {
232
+ flex: 1;
233
+ overflow-y: hidden;
234
+ .ql-container {
235
+ display: inline-block;
236
+ width: 100%;
237
+ min-height: 100%;
238
+ /* padding: 14px 16px; */
239
+ border: none;
240
+ border-radius: ${theme.borderRadius};
241
+ color: ${theme.colors.gray800};
242
+ font-size: 1rem;
243
+ line-height: 1.5;
244
+ resize: none;
245
+ white-space: break-spaces;
246
+ .ql-editor {
247
+ word-break: break-word;
248
+ overflow-wrap: break-word;
249
+ /* -ms-overflow-style: none;
250
+ scrollbar-width: none;
251
+ &::-webkit-scrollbar {
252
+ display: none;
253
+ } */
254
+ }
255
+ mocka {
256
+ padding: 2px 6px;
257
+ border-radius: 1rem;
258
+ &[data-url='true'] {
259
+ /* background-color: #eeeeff; */
260
+ font-style: italic;
261
+ color: #1890ff;
262
+ cursor: pointer;
263
+ outline: none;
264
+ text-decoration: underline;
265
+ }
266
+ &[data-error='true'] {
267
+ background-color: #ffeeee;
268
+ color: red;
269
+ text-decoration: underline;
270
+ font-style: bold;
271
+ }
272
+ }
273
+ mention {
274
+ padding: 2px 6px;
275
+ border-radius: 1rem;
276
+ background-color: #eeeeff;
277
+ color: #1890ff;
278
+ cursor: pointer;
279
+ outline: none;
280
+ text-decoration: none;
281
+ }
282
+ ol,
283
+ ul {
284
+ padding-left: 1rem;
285
+ }
286
+ }
287
+ }
288
+ .mention-search-container {
289
+ position: absolute;
290
+ background: white;
291
+ border-radius: ${theme.borderRadius};
292
+ filter: drop-shadow(0px 10px 16px rgba(0, 0, 0, 0.04))
293
+ drop-shadow(0px 2px 8px rgba(0, 0, 0, 0.04))
294
+ drop-shadow(0px 0px 1px rgba(0, 0, 0, 0.04));
295
+ overflow-y: scroll;
296
+ z-index: 99;
297
+ ::-webkit-scrollbar {
298
+ -webkit-appearance: none;
299
+ }
300
+ ::-webkit-scrollbar:vertical {
301
+ width: 14px;
302
+ }
303
+ ::-webkit-scrollbar-thumb {
304
+ border-radius: ${theme.borderRadius};
305
+ background-color: #d9d9d9;
306
+ @supports (background-clip: padding-box) {
307
+ border: 3px solid rgba(0, 0, 0, 0);
308
+ background-clip: padding-box;
309
+ }
310
+ @supports not (background-clip: padding-box) {
311
+ border: 3px solid white;
312
+ }
313
+ }
314
+ ::-webkit-scrollbar-track {
315
+ background-color: #fff;
316
+ border-radius: 0 6px 6px 0;
317
+ border-left: 1px solid #f2f2f2;
318
+ }
319
+ .mention-search-item {
320
+ cursor: pointer;
321
+ padding: 12px 1rem;
322
+ display: flex;
323
+ align-items: center;
324
+ &.item-selected {
325
+ background-color: ${theme.colors.gray100};
326
+ }
327
+ .search-avatar {
328
+ width: 40px;
329
+ height: 40px;
330
+ font-size: 20px;
331
+ margin-right: 20px;
332
+ }
333
+ }
334
+ }
335
+ `;
336
+
337
+ var img = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3cpath stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='M9.545 16H7.091c-.537 0-1.07-.104-1.566-.305a4.1 4.1 0 0 1-1.327-.867A3.96 3.96 0 0 1 3 12c0-1.06.431-2.078 1.198-2.828A4.14 4.14 0 0 1 7.091 8h2.454m4.38 0h2.984c.537 0 1.07.103 1.566.304a4.1 4.1 0 0 1 1.327.868c.38.371.681.812.887 1.297a3.92 3.92 0 0 1 0 3.062 4 4 0 0 1-.887 1.297c-.38.372-.831.667-1.327.867a4.2 4.2 0 0 1-1.566.305h-2.983M9 12h6'/%3e%3c/svg%3e";
338
+ var IconLink = img;
339
+
340
+ // import 'react-quill/dist/quill.snow.css'
341
+ let ReactQuill = null;
342
+ (() => __awaiter(void 0, void 0, void 0, function* () {
343
+ if (typeof window === 'undefined')
344
+ return;
345
+ const QuillRes = yield import('react-quill');
346
+ ReactQuill = QuillRes.default;
347
+ const Quill = QuillRes.Quill || ReactQuill.Quill;
348
+ class PreserveWhiteSpace {
349
+ constructor(quill, options) {
350
+ this.quill = quill;
351
+ this.options = options;
352
+ quill.container.style.whiteSpace = 'pre-line';
353
+ }
354
+ }
355
+ Quill.register('modules/preserveWhiteSpace', PreserveWhiteSpace);
356
+ const Inline = Quill.import('blots/inline');
357
+ class MockABlot extends Inline {
358
+ static create(options) {
359
+ if (!options)
360
+ return super.create(false);
361
+ const node = super.create(options);
362
+ MockABlot.setNodeConfigurations(node, options);
363
+ return node;
364
+ }
365
+ static formats(node) {
366
+ if (node.innerText &&
367
+ (node.getAttribute('data-href') ||
368
+ node.getAttribute('data-url') ||
369
+ node.getAttribute('data-error') ||
370
+ node.getAttribute('data-bad-word'))) {
371
+ return {
372
+ 'data-bad-word': node.getAttribute('data-bad-word'),
373
+ 'data-error': node.getAttribute('data-error'),
374
+ 'data-href': node.getAttribute('data-href'),
375
+ 'data-url': node.getAttribute('data-url'),
376
+ 'data-text': node.innerText || node.getAttribute('data-href'),
377
+ };
378
+ }
379
+ else {
380
+ return false;
381
+ }
382
+ }
383
+ /* To prevent the node from accidentally being built in different ways. */
384
+ static setNodeConfigurations(node, value) {
385
+ var _a, _b;
386
+ if (!value)
387
+ return;
388
+ if (!((_b = (_a = value === null || value === void 0 ? void 0 : value['data-text']) === null || _a === void 0 ? void 0 : _a.replace(/(\ )+/g, ' ')) === null || _b === void 0 ? void 0 : _b.replace(/(\u200c|‌)+/g, '')))
389
+ return;
390
+ if (value['data-bad-word'])
391
+ node.setAttribute('data-bad-word', value['data-bad-word']);
392
+ if (value['data-href'])
393
+ node.setAttribute('data-href', value['data-href']);
394
+ if (value['data-error'])
395
+ node.setAttribute('data-error', value['data-error']);
396
+ // setTimeout(() => {
397
+ // if (value['data-text'] !== node.innerText && !node.innerText)
398
+ // node.innerHTML = value['data-text']
399
+ // }, 200)
400
+ if (value['data-url'])
401
+ node.setAttribute('data-url', value['data-url']);
402
+ // if (value['data-text']) node.innerText = value['data-text']
403
+ // console.log(value, node.outerHTML, node)
404
+ }
405
+ }
406
+ MockABlot.blotName = 'mocka1';
407
+ MockABlot.tagName = 'mocka';
408
+ Quill.register(MockABlot);
409
+ class MentionBlot extends Inline {
410
+ static create(options) {
411
+ if (!options)
412
+ return super.create(false);
413
+ const node = super.create(options);
414
+ MentionBlot.setNodeConfigurations(node, options);
415
+ return node;
416
+ }
417
+ static formats(node) {
418
+ if (node.getAttribute('data-name') && node.getAttribute('data-id')) {
419
+ return {
420
+ 'data-name': node.getAttribute('data-name'),
421
+ 'data-id': node.getAttribute('data-id'),
422
+ };
423
+ }
424
+ else {
425
+ return false;
426
+ }
427
+ }
428
+ /* To prevent the node from accidentally being built in different ways. */
429
+ static setNodeConfigurations(node, value) {
430
+ var _a, _b;
431
+ if (!value)
432
+ return;
433
+ if (!value['data-id'] ||
434
+ !((_b = (_a = value === null || value === void 0 ? void 0 : value['data-name']) === null || _a === void 0 ? void 0 : _a.replace(/(\ )+/g, ' ')) === null || _b === void 0 ? void 0 : _b.replace(/(\u200c|‌)+/g, '')))
435
+ return;
436
+ if (value['data-id'])
437
+ node.setAttribute('data-id', value['data-id']);
438
+ if (value['data-name']) {
439
+ // node.setAttribute('contenteditable', false)
440
+ node.setAttribute('data-name', value['data-name']);
441
+ }
442
+ }
443
+ }
444
+ MentionBlot.blotName = 'mention';
445
+ MentionBlot.tagName = 'mention';
446
+ Quill.register(MentionBlot);
447
+ }))();
448
+ function getCaretCharacterOffsetWithin(element) {
449
+ var _a, _b;
450
+ let caretOffset = -1;
451
+ if (typeof window.getSelection != 'undefined') {
452
+ const sel = window.getSelection();
453
+ if ((sel === null || sel === void 0 ? void 0 : sel.rangeCount) && (sel === null || sel === void 0 ? void 0 : sel.rangeCount) > 0) {
454
+ const range = (_a = window.getSelection()) === null || _a === void 0 ? void 0 : _a.getRangeAt(0);
455
+ if (range) {
456
+ const preCaretRange = range.cloneRange();
457
+ // preCaretRange.setStart(element, 0)
458
+ preCaretRange.selectNodeContents(element);
459
+ preCaretRange.setEnd(range.endContainer, range.endOffset);
460
+ caretOffset = calculateChildNodeOffset(preCaretRange.cloneContents().childNodes, caretOffset);
461
+ const parentMockAElement = (_b = range.endContainer.parentElement) === null || _b === void 0 ? void 0 : _b.closest('mocka');
462
+ const lastNodeValue = range.endContainer.nodeValue ||
463
+ range.endContainer.outerHTML;
464
+ if (parentMockAElement && (lastNodeValue === null || lastNodeValue === void 0 ? void 0 : lastNodeValue.length)) {
465
+ /// set selector to end of <mocka elemt, prevent select in the middle
466
+ caretOffset =
467
+ caretOffset -
468
+ range.endOffset +
469
+ (parentMockAElement.outerHTML.length -
470
+ (parentMockAElement === null || parentMockAElement === void 0 ? void 0 : parentMockAElement.outerHTML.lastIndexOf(lastNodeValue)));
471
+ }
472
+ }
473
+ }
474
+ }
475
+ return caretOffset;
476
+ }
477
+ function calculateChildNodeOffset(childNodes, caretOffset) {
478
+ childNodes.forEach((node, index) => {
479
+ const isLast = index + 1 === childNodes.length;
480
+ if (node.nodeType === Node.ELEMENT_NODE) {
481
+ const outerHTML = node.outerHTML;
482
+ if (!isLast) {
483
+ caretOffset += outerHTML.length;
484
+ return;
485
+ }
486
+ else {
487
+ caretOffset += outerHTML.indexOf('>') + 1;
488
+ caretOffset = calculateChildNodeOffset(node.childNodes, caretOffset);
489
+ }
490
+ }
491
+ else if (node.nodeType === Node.TEXT_NODE) {
492
+ caretOffset += (node.nodeValue || '')
493
+ .replace(/&/g, '&amp;')
494
+ .replace(/</g, '&lt;')
495
+ .replace(/>/g, '&gt;')
496
+ .replace(/"/g, '&quot;')
497
+ .replace(/'/g, '&#039;').length;
498
+ }
499
+ });
500
+ return caretOffset;
501
+ }
502
+ function getSearchName(root) {
503
+ var _a, _b;
504
+ let res = null;
505
+ if (typeof window.getSelection != 'undefined') {
506
+ const sel = window.getSelection();
507
+ if ((sel === null || sel === void 0 ? void 0 : sel.rangeCount) && (sel === null || sel === void 0 ? void 0 : sel.rangeCount) > 0) {
508
+ const range = (_a = window.getSelection()) === null || _a === void 0 ? void 0 : _a.getRangeAt(0);
509
+ if (range) {
510
+ const preCaretRange = range.cloneRange();
511
+ // preCaretRange.setStart(element, 0)
512
+ preCaretRange.selectNodeContents(root);
513
+ preCaretRange.setEnd(range.endContainer, range.endOffset);
514
+ const endText = (preCaretRange.endContainer.nodeValue || '').substring(0, range.endOffset);
515
+ // only allow @ at start of text or has space before it
516
+ const lastAnchorSymbolIndex = endText.lastIndexOf('@');
517
+ if (lastAnchorSymbolIndex + 1 < endText.length &&
518
+ (lastAnchorSymbolIndex === 0 ||
519
+ endText.slice(lastAnchorSymbolIndex - 1, lastAnchorSymbolIndex + 1) === ' @')) {
520
+ const name = (_b = endText.slice(lastAnchorSymbolIndex + 1)) === null || _b === void 0 ? void 0 : _b.trim();
521
+ if (name) {
522
+ preCaretRange.setStart(range.endContainer, lastAnchorSymbolIndex);
523
+ const replaceRange = preCaretRange.cloneRange();
524
+ replaceRange.setStart(replaceRange.endContainer, lastAnchorSymbolIndex);
525
+ res = {
526
+ name,
527
+ rect: preCaretRange.getBoundingClientRect(),
528
+ replaceRange,
529
+ };
530
+ }
531
+ }
532
+ }
533
+ }
534
+ }
535
+ return res;
536
+ }
537
+ const inputModify = (value, opts) => {
538
+ var _a;
539
+ const { formatUrl, bannedWords = [] } = opts || {};
540
+ const removedFormat = fixMalformedMention(removeFontFormat(value));
541
+ if (!formatUrl)
542
+ return {
543
+ value: highlightBadWords(removedFormat, bannedWords),
544
+ };
545
+ let descriptionWithWrappedAnchor = removeEdittedBannedWord(wrapAnchorAroundUrls(removedFormat));
546
+ const urls = getUrlsFromEditorString(removedFormat);
547
+ if (urls) {
548
+ const invalidUrls = [];
549
+ let previewUrl = '';
550
+ urls.forEach((url) => {
551
+ if (!url)
552
+ return;
553
+ try {
554
+ const jsUrl = new URL(url);
555
+ if (ALLOW_DOMAIN_URL.some((o) => jsUrl.origin.endsWith(o))) {
556
+ // is valid
557
+ }
558
+ else {
559
+ invalidUrls.push(url);
560
+ // is not valid
561
+ }
562
+ }
563
+ catch (_a) {
564
+ invalidUrls.push(url);
565
+ }
566
+ });
567
+ if (invalidUrls.length > 0) {
568
+ descriptionWithWrappedAnchor = descriptionWithWrappedAnchor
569
+ .replace(new RegExp(`data-url="true">(${invalidUrls.map(escapeRegExp).join('|')})<`, 'gi'), 'data-error="true" data-url="true">$1<')
570
+ .replace(new RegExp(`data-href="(${invalidUrls
571
+ .map(escapeRegExp)
572
+ .join('|')})" data-url="true">`, 'gi'), 'data-href="$1" data-error="true" data-url="true">');
573
+ }
574
+ previewUrl = (_a = urls.filter((u) => invalidUrls.indexOf(u) === -1)) === null || _a === void 0 ? void 0 : _a[0];
575
+ return {
576
+ invalidUrls,
577
+ previewUrl,
578
+ value: highlightBadWords(descriptionWithWrappedAnchor, bannedWords),
579
+ };
580
+ }
581
+ return {
582
+ value: highlightBadWords(descriptionWithWrappedAnchor, bannedWords),
583
+ };
584
+ };
585
+ const RichTextEditor = ({ html, onChange, className, style, onImagePickerClick, bannedWords = [], onInvalidUrlsChange, onPreviewUrlChange, setEditorRef, isReplying, }) => {
586
+ var _a, _b, _c, _d;
587
+ const bannedWordsRef = useRef([]);
588
+ bannedWordsRef.current = bannedWords;
589
+ const [invalidUrls, setInvalidUrls] = useState([]);
590
+ const [previewUrl, setPreviewUrl] = useState(null);
591
+ const { data: { locale }, } = useContext(TogetherComponentGlobalContext);
592
+ const bannedString = (bannedWords === null || bannedWords === void 0 ? void 0 : bannedWords.join(',')) || '';
593
+ useEffect(() => {
594
+ var _a, _b;
595
+ const currHTML = (_b = (_a = reactQuillRef.current) === null || _a === void 0 ? void 0 : _a.getEditor()) === null || _b === void 0 ? void 0 : _b.root.innerHTML;
596
+ debounceInputModify(currHTML);
597
+ }, [bannedString]);
598
+ const fetchPreviewData = (url) => {
599
+ if (!previewUrl || previewUrl.url !== url) {
600
+ setPreviewUrl({
601
+ url,
602
+ isFetching: true,
603
+ });
604
+ callApi(getApiPath(PATHS.FETCH_PREVIEW, {
605
+ _locale: locale,
606
+ }), 'POST', {
607
+ data: {
608
+ link: url,
609
+ },
610
+ })
611
+ .then((res) => {
612
+ var _a, _b, _c, _d;
613
+ setPreviewUrl({
614
+ title: (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.title,
615
+ description: (_b = res === null || res === void 0 ? void 0 : res.data) === null || _b === void 0 ? void 0 : _b.description,
616
+ 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),
617
+ url,
618
+ });
619
+ })
620
+ .catch(() => {
621
+ setPreviewUrl(null);
622
+ });
623
+ }
624
+ };
625
+ const fetchPreviewDataRef = useRef(fetchPreviewData);
626
+ fetchPreviewDataRef.current = fetchPreviewData;
627
+ const debounceInputModify = useCallback(debounce((v) => {
628
+ if (v) {
629
+ const processedInput = inputModify(v, {
630
+ bannedWords: bannedWordsRef.current,
631
+ formatUrl: true,
632
+ });
633
+ const { invalidUrls: _invalidUrls, previewUrl: _previewUrl, value, } = processedInput;
634
+ if (_invalidUrls) {
635
+ setInvalidUrls(_invalidUrls);
636
+ }
637
+ if (_previewUrl) {
638
+ fetchPreviewDataRef.current(_previewUrl);
639
+ }
640
+ else
641
+ setPreviewUrl(null);
642
+ if (value !== v) {
643
+ onChange === null || onChange === void 0 ? void 0 : onChange(value);
644
+ }
645
+ }
646
+ }, 500), []);
647
+ useEffect(() => {
648
+ onInvalidUrlsChange && onInvalidUrlsChange(invalidUrls);
649
+ }, [invalidUrls]);
650
+ useEffect(() => {
651
+ if (onPreviewUrlChange) {
652
+ if (previewUrl === null || previewUrl === void 0 ? void 0 : previewUrl.url)
653
+ onPreviewUrlChange({
654
+ title: previewUrl.title || '',
655
+ url: previewUrl.url || '',
656
+ image: previewUrl.image || '',
657
+ description: previewUrl.description || '',
658
+ });
659
+ else
660
+ onPreviewUrlChange(null);
661
+ }
662
+ }, [previewUrl]);
663
+ const imageHandlerRef = useRef(onImagePickerClick);
664
+ imageHandlerRef.current = onImagePickerClick;
665
+ const toolbarId = useUniqueId();
666
+ const cachedModules = useRef({
667
+ toolbar: {
668
+ handlers: {
669
+ image: () => { var _a; return (_a = imageHandlerRef.current) === null || _a === void 0 ? void 0 : _a.call(imageHandlerRef); },
670
+ link: () => false,
671
+ },
672
+ container: '#toolbar-' + toolbarId,
673
+ },
674
+ // toolbar: [
675
+ // ['bold', 'italic', 'underline'],
676
+ // [{ list: 'ordered' }, { list: 'bullet' }],
677
+ // ],
678
+ preserveWhiteSpace: true,
679
+ });
680
+ const contentEditableCaretPos = useRef(-1);
681
+ const reactQuillRef = useRef(null);
682
+ setEditorRef &&
683
+ ((_b = (_a = reactQuillRef.current) === null || _a === void 0 ? void 0 : _a.getEditor()) === null || _b === void 0 ? void 0 : _b.root) &&
684
+ setEditorRef((_d = (_c = reactQuillRef.current) === null || _c === void 0 ? void 0 : _c.getEditor()) === null || _d === void 0 ? void 0 : _d.root);
685
+ const handleSelectionChange = () => {
686
+ var _a, _b, _c, _d, _e, _f, _g, _h;
687
+ if ((_b = (_a = reactQuillRef.current) === null || _a === void 0 ? void 0 : _a.getEditor()) === null || _b === void 0 ? void 0 : _b.root) {
688
+ const newCaretPos = getCaretCharacterOffsetWithin((_d = (_c = reactQuillRef.current) === null || _c === void 0 ? void 0 : _c.getEditor()) === null || _d === void 0 ? void 0 : _d.root);
689
+ const currHTML = (_f = (_e = reactQuillRef.current) === null || _e === void 0 ? void 0 : _e.getEditor()) === null || _f === void 0 ? void 0 : _f.root.innerHTML;
690
+ // in case of clicking on a div outside editor while focus, we get caret position too large
691
+ if (newCaretPos >= 0 && newCaretPos < currHTML.length) {
692
+ const mentionIds = getMentionIdsFromString(currHTML, true);
693
+ if (mentionIds.length < LIMIT_MENTION - (isReplying ? 1 : 0)) {
694
+ const searchData = getSearchName((_h = (_g = reactQuillRef.current) === null || _g === void 0 ? void 0 : _g.getEditor()) === null || _h === void 0 ? void 0 : _h.root);
695
+ if (searchData) {
696
+ searchUser(searchData.name, searchData.rect);
697
+ replaceRangeRef.current = searchData.replaceRange;
698
+ }
699
+ else {
700
+ replaceRangeRef.current = null;
701
+ // to avoid race condition, we reuse this function to clear foundUsers
702
+ searchUser('', null);
703
+ }
704
+ }
705
+ else {
706
+ replaceRangeRef.current = null;
707
+ // to avoid race condition, we reuse this function to clear foundUsers
708
+ searchUser('', null);
709
+ }
710
+ // const insertIndex = newCaretPos + 1
711
+ // const currHTML = reactQuillRef.current?.getEditor()?.root.innerHTML
712
+ // console.log(
713
+ // currHTML?.substring(0, insertIndex) || '',
714
+ // '========',
715
+ // currHTML?.substring(insertIndex) || '',
716
+ // )
717
+ contentEditableCaretPos.current = newCaretPos;
718
+ }
719
+ }
720
+ else {
721
+ setFoundUsers([]);
722
+ }
723
+ };
724
+ const [foundUsers, setFoundUsers] = useState([]);
725
+ const [searchUserPosition, setSearchUserPosition] = useState({
726
+ top: 0,
727
+ left: 0,
728
+ });
729
+ const searchUser = useCallback(debounce((name, rect, excludeIds) => __awaiter(void 0, void 0, void 0, function* () {
730
+ var _e, _f, _g, _h;
731
+ if (!name || !DOMRect) {
732
+ return setFoundUsers([]);
733
+ }
734
+ const res = yield ((((_e = getCookie(BEARER_TOKEN_COOKIE)) === null || _e === void 0 ? void 0 : _e.length) || 0) > 0
735
+ ? callApiWithAuth(getApiPath(PATHS.SEARCH_USER, {
736
+ _locale: locale,
737
+ name: name,
738
+ }), 'get')
739
+ : callApiWithAdminAuth(getApiPath(ADMIN_PATHS.SEARCH_USER, {
740
+ _locale: locale,
741
+ name: name,
742
+ }), 'get'));
743
+ setSelectTagUserIndex(0);
744
+ 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)))));
745
+ const textNodeRect = rect;
746
+ const containerRect = (_h = containerRef.current) === null || _h === void 0 ? void 0 : _h.getBoundingClientRect();
747
+ if (textNodeRect && containerRect) {
748
+ const idealWidth = 343;
749
+ const idealHeight = 256;
750
+ const styleConfig = {
751
+ top: textNodeRect.bottom - containerRect.top,
752
+ width: `min(343px, 100%)`,
753
+ maxHeight: idealHeight,
754
+ };
755
+ const tempRightWidth = containerRect.width - (textNodeRect.left - containerRect.left);
756
+ if (tempRightWidth < idealWidth) {
757
+ styleConfig.right = 0;
758
+ }
759
+ else {
760
+ styleConfig.left = textNodeRect.left - containerRect.left;
761
+ }
762
+ setSearchUserPosition(styleConfig);
763
+ }
764
+ }), 500), []);
765
+ const setSelectUser = (id, name) => {
766
+ var _a, _b, _c;
767
+ if (replaceRangeRef.current) {
768
+ replaceRangeRef.current.deleteContents();
769
+ const newMention = document.createElement('mention');
770
+ newMention.setAttribute('data-id', id);
771
+ newMention.setAttribute('data-name', name);
772
+ // newMention.setAttribute('contenteditable', 'false')
773
+ newMention.innerText = name;
774
+ const newPostText = document.createTextNode(' ');
775
+ replaceRangeRef.current.insertNode(newPostText);
776
+ replaceRangeRef.current.insertNode(newMention);
777
+ const editorRoot = (_b = (_a = reactQuillRef.current) === null || _a === void 0 ? void 0 : _a.getEditor()) === null || _b === void 0 ? void 0 : _b.root;
778
+ editorRoot.focus();
779
+ const range = (_c = window.getSelection()) === null || _c === void 0 ? void 0 : _c.getRangeAt(0);
780
+ range === null || range === void 0 ? void 0 : range.setStart(replaceRangeRef.current.endContainer, replaceRangeRef.current.endOffset);
781
+ range === null || range === void 0 ? void 0 : range.setEnd(replaceRangeRef.current.endContainer, replaceRangeRef.current.endOffset);
782
+ }
783
+ setFoundUsers([]);
784
+ };
785
+ const containerRef = useRef(null);
786
+ const replaceRangeRef = useRef(null);
787
+ const foundUsersListRef = useRef(null);
788
+ const [selectTagUserIndex, setSelectTagUserIndex] = useState(0);
789
+ useEffect(() => {
790
+ // convenient behavior, scroll item into view when select using keyboard
791
+ if (foundUsersListRef.current) {
792
+ const parentElement = foundUsersListRef.current;
793
+ const childElement = parentElement.children.item(selectTagUserIndex);
794
+ if (childElement) {
795
+ const containerRect = parentElement.getBoundingClientRect();
796
+ const childRect = childElement.getBoundingClientRect();
797
+ if (childElement.offsetTop < parentElement.scrollTop)
798
+ parentElement.scrollTop = childElement.offsetTop;
799
+ else if (childElement.offsetTop + childRect.height >
800
+ parentElement.scrollTop + containerRect.height) {
801
+ parentElement.scrollTop =
802
+ childElement.offsetTop - containerRect.height + childRect.height;
803
+ }
804
+ }
805
+ }
806
+ }, [selectTagUserIndex]);
807
+ useEffect(() => {
808
+ const clickHandler = function (e) {
809
+ var _a;
810
+ if (!((_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target))) {
811
+ // Clicked outside the box
812
+ setFoundUsers([]);
813
+ }
814
+ };
815
+ window.addEventListener('click', clickHandler, {
816
+ passive: true,
817
+ });
818
+ return () => {
819
+ window.removeEventListener('click', clickHandler);
820
+ };
821
+ }, []);
822
+ return (React__default.createElement(StyledEditorContainer, { ref: containerRef, className: className, style: style, onKeyDownCapture: (e) => {
823
+ // convenient behavior, use arrow to select tag user and enter to choose
824
+ if (foundUsers === null || foundUsers === void 0 ? void 0 : foundUsers.length) {
825
+ let preventKey = false;
826
+ if (e.key === 'ArrowDown') {
827
+ preventKey = true;
828
+ setSelectTagUserIndex((s) => s + 1 >= foundUsers.length ? 0 : s + 1);
829
+ }
830
+ else if (e.key === 'Escape') {
831
+ preventKey = true;
832
+ setSelectTagUserIndex(0);
833
+ setFoundUsers([]);
834
+ }
835
+ else if (e.key === 'ArrowUp') {
836
+ preventKey = true;
837
+ setSelectTagUserIndex((s) => s - 1 < 0 ? foundUsers.length - 1 : s - 1);
838
+ }
839
+ else if (e.key === 'Enter' || e.key === 'Tab') {
840
+ const user = foundUsers[selectTagUserIndex];
841
+ if (user) {
842
+ preventKey = true;
843
+ setSelectUser(user.id, user.name);
844
+ }
845
+ }
846
+ if (preventKey) {
847
+ e.preventDefault();
848
+ return false;
849
+ }
850
+ }
851
+ } },
852
+ React__default.createElement(CustomToolbar, { id: toolbarId, onAddLink: (text, href) => {
853
+ var _a, _b;
854
+ const insertIndex = contentEditableCaretPos.current + 1;
855
+ const currHTML = (_b = (_a = reactQuillRef.current) === null || _a === void 0 ? void 0 : _a.getEditor()) === null || _b === void 0 ? void 0 : _b.root.innerHTML;
856
+ const newHTML = ((currHTML === null || currHTML === void 0 ? void 0 : currHTML.substring(0, insertIndex)) || '') +
857
+ `<mocka data-href="${href}" data-url="true">${text}</mocka> ` +
858
+ ((currHTML === null || currHTML === void 0 ? void 0 : currHTML.substring(insertIndex)) || '');
859
+ onChange === null || onChange === void 0 ? void 0 : onChange(newHTML);
860
+ debounceInputModify(newHTML);
861
+ } }),
862
+ ReactQuill && (React__default.createElement(ReactQuill, { ref: reactQuillRef, theme: "snow", value: html, onChange: (t) => {
863
+ onChange === null || onChange === void 0 ? void 0 : onChange(t);
864
+ debounceInputModify(t);
865
+ handleSelectionChange();
866
+ }, onChangeSelection: () => {
867
+ handleSelectionChange();
868
+ }, modules: cachedModules.current, formats: [
869
+ 'mocka1',
870
+ 'mention',
871
+ 'id',
872
+ 'key',
873
+ 'bold',
874
+ 'italic',
875
+ 'underline',
876
+ 'list',
877
+ 'bullet',
878
+ ] })),
879
+ !!(foundUsers === null || foundUsers === void 0 ? void 0 : foundUsers.length) && (React__default.createElement("div", { ref: foundUsersListRef, className: "mention-search-container", style: searchUserPosition }, foundUsers.map((foundUser, index) => (React__default.createElement("div", { className: `mention-search-item ${selectTagUserIndex === index ? 'item-selected' : ''}`, key: foundUser.id, onClick: (e) => {
880
+ e.preventDefault();
881
+ e.stopPropagation();
882
+ setSelectUser(foundUser.id, foundUser.name);
883
+ }, onMouseEnter: () => {
884
+ setSelectTagUserIndex(index);
885
+ } },
886
+ React__default.createElement(UserAvatar, { className: "search-avatar", username: foundUser.name, avatar: foundUser.avatar }),
887
+ React__default.createElement("div", null,
888
+ React__default.createElement(Text, { size: "p2" }, foundUser.name),
889
+ React__default.createElement(Text, { size: "p4", color: "#595959" },
890
+ "@",
891
+ foundUser.username)))))))));
892
+ };
893
+ const CustomToolbar = ({ onAddLink, id, }) => {
894
+ return (React__default.createElement("div", { id: 'toolbar-' + id, onClick: (e) => {
895
+ e.preventDefault();
896
+ e.stopPropagation();
897
+ } },
898
+ React__default.createElement("span", { className: "ql-formats" },
899
+ React__default.createElement("button", { className: "ql-bold", type: "button" }),
900
+ React__default.createElement("button", { className: "ql-italic", type: "button" }),
901
+ React__default.createElement("button", { className: "ql-underline", type: "button" })),
902
+ React__default.createElement("span", { className: "ql-formats" },
903
+ React__default.createElement("button", { className: "ql-list", value: "ordered", type: "button" }),
904
+ React__default.createElement("button", { className: "ql-list", value: "bullet", type: "button" })),
905
+ React__default.createElement("span", { className: "ql-formats" },
906
+ React__default.createElement("button", { className: "ql-image", type: "button" }),
907
+ onAddLink && (React__default.createElement(PopoverMenu, { className: "link-tool-wrapper", toggleButtonContent: React__default.createElement("img", { className: "link-icon", src: IconLink, loading: "lazy" }), buttonProps: {
908
+ size: 'md',
909
+ color: 'transparent',
910
+ }, align: "end" }, ({ setShow }) => (React__default.createElement(LinkToolInputPopover, { onAddUrl: onAddLink, setShow: setShow })))))));
911
+ };
912
+ const URL_WARN_MAP = [
913
+ 'notification.limitUrlDomain',
914
+ 'notification.urlWrongFormat',
915
+ ];
916
+ const LinkToolInputPopover = ({ onAddUrl, setShow }) => {
917
+ const { data: { env: { isMarryBaby }, }, } = useContext(TogetherComponentGlobalContext);
918
+ const { t } = useTranslations();
919
+ const [urlValue, setUrlValue] = useState('');
920
+ const [textValue, setTextValue] = useState('');
921
+ const [urlWarnType, setUrlWarnType] = useState(-1);
922
+ const checkUrlValid = (v) => {
923
+ const trimmedUrl = reformatUrl(v.trim());
924
+ try {
925
+ const jsUrl = new URL(trimmedUrl);
926
+ if (!jsUrl.protocol.startsWith('http')) {
927
+ setUrlWarnType(1);
928
+ return false;
929
+ }
930
+ if (!ALLOW_DOMAIN_URL.some((o) => jsUrl.origin.endsWith('/' + o) || jsUrl.origin.endsWith('.' + o))) {
931
+ setUrlWarnType(0);
932
+ return false;
933
+ }
934
+ setUrlWarnType(-1);
935
+ return true;
936
+ }
937
+ catch (_a) {
938
+ setUrlWarnType(1);
939
+ return false;
940
+ }
941
+ };
942
+ const isValid = urlValue.trim() && textValue.trim() && urlWarnType < 0;
943
+ return (React__default.createElement("div", { className: "link-tool-popover" },
944
+ React__default.createElement(Input, { name: "url", value: urlValue, size: "md", label: "URL", placeholder: t('placeholder.enterUrlHere'), type: "text", className: "link-input-url", onChange: (v) => {
945
+ setUrlValue(v);
946
+ checkUrlValid(v);
947
+ } }),
948
+ urlWarnType >= 0 && (React__default.createElement(Text, { size: "c2", className: "error-text" }, t(URL_WARN_MAP[urlWarnType]))),
949
+ React__default.createElement(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) }),
950
+ React__default.createElement("div", { "data-is-marrybaby": isMarryBaby, className: "link-input-button-wrapper" },
951
+ React__default.createElement(Button, { theme: isMarryBaby ? 'marryBaby' : 'helloSites', size: "sm", color: "primary", className: "link-input-button", onClick: () => {
952
+ if (!isValid)
953
+ return;
954
+ onAddUrl(textValue.trim(), reformatUrl(urlValue.trim()));
955
+ setShow && setShow(false);
956
+ }, isDisabled: !isValid }, t('insert')))));
957
+ };
958
+
959
+ export { RichTextEditor as R, StyledCreatePostDescription as S };