reactjs-tiptap-editor 1.0.1 → 1.0.2

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 (590) hide show
  1. package/lib/{ActionMenuButton-DLQyd_gx.cjs → ActionMenuButton-BRWFTb3V.cjs} +1 -1
  2. package/lib/{ActionMenuButton-BKOg7hkq.js → ActionMenuButton-DgjFjzC8.js} +8 -8
  3. package/lib/Attachment.cjs +2 -2
  4. package/lib/Attachment.js +27 -29
  5. package/lib/Blockquote.cjs +1 -1
  6. package/lib/Blockquote.js +4 -4
  7. package/lib/Bold.cjs +1 -1
  8. package/lib/Bold.js +7 -7
  9. package/lib/BulletList.cjs +1 -1
  10. package/lib/BulletList.js +4 -4
  11. package/lib/Clear.cjs +1 -1
  12. package/lib/Clear.js +3 -3
  13. package/lib/Code.cjs +1 -1
  14. package/lib/Code.js +7 -7
  15. package/lib/CodeBlock.cjs +36 -36
  16. package/lib/CodeBlock.js +593 -596
  17. package/lib/CodeView.cjs +1 -1
  18. package/lib/CodeView.js +4 -4
  19. package/lib/Color.cjs +1 -1
  20. package/lib/Color.js +9 -9
  21. package/lib/Column.cjs +1 -1
  22. package/lib/Column.js +9 -9
  23. package/lib/Drawer-1_PmP-H0.cjs +1 -0
  24. package/lib/{Drawer-DZ5jvmrX.js → Drawer-DNnkwfnI.js} +48 -49
  25. package/lib/Drawer.cjs +1 -1
  26. package/lib/Drawer.js +5 -6
  27. package/lib/Emoji.cjs +1 -1
  28. package/lib/Emoji.js +155 -150
  29. package/lib/Excalidraw-DreGyrmJ.cjs +1 -0
  30. package/lib/Excalidraw-StBAUhjt.js +355 -0
  31. package/lib/Excalidraw.cjs +1 -1
  32. package/lib/Excalidraw.js +4 -5
  33. package/lib/ExportPdf.cjs +1 -1
  34. package/lib/ExportPdf.js +4 -4
  35. package/lib/ExportWord.cjs +1 -1
  36. package/lib/ExportWord.js +4 -4
  37. package/lib/FontFamily.cjs +1 -1
  38. package/lib/FontFamily.js +6 -6
  39. package/lib/FontSize.cjs +1 -1
  40. package/lib/FontSize.js +6 -6
  41. package/lib/Heading.cjs +1 -1
  42. package/lib/Heading.js +6 -6
  43. package/lib/Highlight.cjs +1 -1
  44. package/lib/Highlight.js +9 -9
  45. package/lib/History.cjs +1 -1
  46. package/lib/History.js +36 -36
  47. package/lib/HorizontalRule.cjs +1 -1
  48. package/lib/HorizontalRule.js +4 -4
  49. package/lib/{Icon-DUpv2cI6.cjs → Icon-B9hI3gal.cjs} +1 -1
  50. package/lib/{Icon-jKs8Hr6p.js → Icon-D3AdnMCj.js} +2 -2
  51. package/lib/Iframe-BDm-w-lg.cjs +1 -0
  52. package/lib/{Iframe-CmXkEqOd.js → Iframe-BIgQtyZo.js} +26 -28
  53. package/lib/Iframe.cjs +1 -1
  54. package/lib/Iframe.js +4 -5
  55. package/lib/Image.cjs +1 -1
  56. package/lib/Image.js +208 -229
  57. package/lib/ImageGif.cjs +1 -1
  58. package/lib/ImageGif.js +98 -91
  59. package/lib/ImportWord.cjs +28 -28
  60. package/lib/ImportWord.js +5 -5
  61. package/lib/Indent-BzyTbroV.cjs +1 -0
  62. package/lib/Indent-CnPAv7eT.js +153 -0
  63. package/lib/Indent.cjs +1 -1
  64. package/lib/Indent.js +4 -149
  65. package/lib/Italic.cjs +1 -1
  66. package/lib/Italic.js +4 -4
  67. package/lib/Katex-BE_GROI2.cjs +4 -0
  68. package/lib/{Katex-DsYXsjSS.js → Katex-D-SUWkkU.js} +771 -783
  69. package/lib/Katex.cjs +1 -1
  70. package/lib/Katex.js +4 -5
  71. package/lib/LineHeight.cjs +1 -1
  72. package/lib/LineHeight.js +17 -17
  73. package/lib/Link.cjs +1 -1
  74. package/lib/Link.js +2 -2
  75. package/lib/LinkEditBlock-5NRB9DRC.cjs +5 -0
  76. package/lib/{LinkEditBlock-CB8yIffE.js → LinkEditBlock-DcxIMK_D.js} +221 -221
  77. package/lib/Mention.cjs +1 -1
  78. package/lib/Mention.js +17 -19
  79. package/lib/Mermaid.cjs +2 -2
  80. package/lib/Mermaid.js +24 -26
  81. package/lib/MoreMark.cjs +1 -1
  82. package/lib/MoreMark.js +16 -16
  83. package/lib/OrderedList.cjs +1 -1
  84. package/lib/OrderedList.js +4 -4
  85. package/lib/SearchAndReplace.cjs +1 -1
  86. package/lib/SearchAndReplace.js +52 -52
  87. package/lib/SlashCommand.cjs +1 -1
  88. package/lib/SlashCommand.js +125 -120
  89. package/lib/Strike.cjs +1 -1
  90. package/lib/Strike.js +4 -4
  91. package/lib/Table-BYg26eMf.cjs +9 -0
  92. package/lib/{Table-Db8TcQX8.js → Table-DtC2-bqx.js} +30 -30
  93. package/lib/Table.cjs +1 -1
  94. package/lib/Table.js +1 -1
  95. package/lib/TaskList.cjs +1 -1
  96. package/lib/TaskList.js +4 -4
  97. package/lib/TextAlign.cjs +1 -1
  98. package/lib/TextAlign.js +14 -13
  99. package/lib/TextDirection.cjs +1 -1
  100. package/lib/TextDirection.js +7 -7
  101. package/lib/TextUnderline.cjs +1 -1
  102. package/lib/TextUnderline.js +4 -4
  103. package/lib/{Twitter-CXmmjz9R.js → Twitter-B3n8vc45.js} +73 -75
  104. package/lib/Twitter-DJ6JzZPJ.cjs +1 -0
  105. package/lib/Twitter.cjs +1 -1
  106. package/lib/Twitter.js +3 -4
  107. package/lib/Video.cjs +1 -1
  108. package/lib/Video.js +41 -33
  109. package/lib/bubble.cjs +4 -2
  110. package/lib/bubble.d.ts +1 -310
  111. package/lib/bubble.js +8782 -1104
  112. package/lib/button-BTnV4TZ7.cjs +1 -0
  113. package/lib/{button-DXMsXUEn.js → button-DHZeIKzF.js} +6 -6
  114. package/lib/checkbox-BoBTXwkF.cjs +1 -0
  115. package/lib/checkbox-Dm8Nfwg8.js +27 -0
  116. package/lib/components/ActionButton.d.ts +23 -0
  117. package/lib/components/ActionMenuButton.d.ts +28 -0
  118. package/lib/components/Bubble/RichTextBubbleColumns.d.ts +1 -0
  119. package/lib/components/Bubble/RichTextBubbleDrawer.d.ts +1 -0
  120. package/lib/components/Bubble/RichTextBubbleExcalidraw.d.ts +1 -0
  121. package/lib/components/Bubble/RichTextBubbleIframe.d.ts +1 -0
  122. package/lib/components/Bubble/RichTextBubbleKatex.d.ts +1 -0
  123. package/lib/components/Bubble/RichTextBubbleLink.d.ts +6 -0
  124. package/lib/components/Bubble/RichTextBubbleMedia.d.ts +4 -0
  125. package/lib/components/Bubble/RichTextBubbleMenuDragHandle.d.ts +1 -0
  126. package/lib/components/Bubble/RichTextBubbleMermaid.d.ts +1 -0
  127. package/lib/components/Bubble/RichTextBubbleTable.d.ts +5 -0
  128. package/lib/components/Bubble/RichTextBubbleText.d.ts +5 -0
  129. package/lib/components/Bubble/RichTextBubbleTwitter.d.ts +1 -0
  130. package/lib/components/Bubble/formatBubble.d.ts +55 -0
  131. package/lib/components/Bubble/index.d.ts +12 -0
  132. package/lib/components/ColorPicker.d.ts +11 -0
  133. package/lib/components/RichTextProvider.d.ts +8 -0
  134. package/lib/components/SizeSetter/SizeSetter.d.ts +13 -0
  135. package/lib/components/icons/Activity.d.ts +2 -0
  136. package/lib/components/icons/Animas.d.ts +2 -0
  137. package/lib/components/icons/AspectRatio.d.ts +2 -0
  138. package/lib/components/icons/Blockquote.d.ts +2 -0
  139. package/lib/components/icons/CodeView.d.ts +1 -0
  140. package/lib/components/icons/ColumnAddLeft.d.ts +1 -0
  141. package/lib/components/icons/ColumnAddRight.d.ts +1 -0
  142. package/lib/components/icons/DeleteColumn.d.ts +2 -0
  143. package/lib/components/icons/DeleteRow.d.ts +2 -0
  144. package/lib/components/icons/Direction.d.ts +1 -0
  145. package/lib/components/icons/Excalidraw.d.ts +1 -0
  146. package/lib/components/icons/ExportPdf.d.ts +1 -0
  147. package/lib/components/icons/ExportWord.d.ts +2 -0
  148. package/lib/components/icons/FileWordOutline.d.ts +2 -0
  149. package/lib/components/icons/Flag.d.ts +2 -0
  150. package/lib/components/icons/Food.d.ts +2 -0
  151. package/lib/components/icons/GIfIcon.d.ts +1 -0
  152. package/lib/components/icons/Html.d.ts +1 -0
  153. package/lib/components/icons/Icon.d.ts +8 -0
  154. package/lib/components/icons/IconColorFill.d.ts +5 -0
  155. package/lib/components/icons/IconHighlightFill.d.ts +3 -0
  156. package/lib/components/icons/ImportWord.d.ts +2 -0
  157. package/lib/components/icons/LeftToRight.d.ts +1 -0
  158. package/lib/components/icons/LineHeight.d.ts +2 -0
  159. package/lib/components/icons/MenuDown.d.ts +2 -0
  160. package/lib/components/icons/Mermaid.d.ts +1 -0
  161. package/lib/components/icons/NoFill.d.ts +1 -0
  162. package/lib/components/icons/Object.d.ts +2 -0
  163. package/lib/components/icons/RightToLeft.d.ts +1 -0
  164. package/lib/components/icons/SizeL.d.ts +2 -0
  165. package/lib/components/icons/SizeM.d.ts +2 -0
  166. package/lib/components/icons/SizeS.d.ts +2 -0
  167. package/lib/components/icons/Symbol.d.ts +2 -0
  168. package/lib/components/icons/Travel.d.ts +2 -0
  169. package/lib/components/icons/Twitter.d.ts +1 -0
  170. package/lib/components/icons/icons.d.ts +1 -0
  171. package/lib/components/icons/index.d.ts +12 -0
  172. package/lib/components/index.d.ts +6 -0
  173. package/lib/components/ui/button.d.ts +11 -0
  174. package/lib/components/ui/checkbox.d.ts +4 -0
  175. package/lib/components/ui/dialog.d.ts +19 -0
  176. package/lib/components/ui/dropdown-menu.d.ts +27 -0
  177. package/lib/components/ui/emoji-picker.d.ts +7 -0
  178. package/lib/components/ui/index.d.ts +14 -0
  179. package/lib/components/ui/input.d.ts +5 -0
  180. package/lib/components/ui/label.d.ts +5 -0
  181. package/lib/components/ui/popover.d.ts +6 -0
  182. package/lib/components/ui/select.d.ts +13 -0
  183. package/lib/components/ui/separator.d.ts +4 -0
  184. package/lib/components/ui/switch.d.ts +4 -0
  185. package/lib/components/ui/tabs.d.ts +7 -0
  186. package/lib/components/ui/textarea.d.ts +5 -0
  187. package/lib/components/ui/toast.d.ts +15 -0
  188. package/lib/components/ui/toaster.d.ts +1 -0
  189. package/lib/components/ui/toggle.d.ts +12 -0
  190. package/lib/components/ui/tooltip.d.ts +7 -0
  191. package/lib/components/ui/use-toast.d.ts +44 -0
  192. package/lib/constants/index.d.ts +47 -0
  193. package/lib/constants/resetCSS.d.ts +1 -0
  194. package/lib/dialog-DXF2Q8LZ.cjs +1 -0
  195. package/lib/dialog-xrO7nV_z.js +101 -0
  196. package/lib/dropdown-menu-Bh-wEgI8.cjs +1 -0
  197. package/lib/{dropdown-menu-BPp2Z_U-.js → dropdown-menu-ByeBPPyv.js} +32 -26
  198. package/lib/events.constant-B-VGURJp.cjs +1 -0
  199. package/lib/events.constant-CBPIqO_g.js +25 -0
  200. package/lib/extensions/Attachment/Attachment.d.ts +15 -0
  201. package/lib/extensions/Attachment/components/NodeViewAttachment/FileIcon.d.ts +1 -0
  202. package/lib/extensions/Attachment/components/NodeViewAttachment/FileIconString.d.ts +1 -0
  203. package/lib/extensions/Attachment/components/NodeViewAttachment/NodeViewAttachment.d.ts +1 -0
  204. package/lib/extensions/Attachment/components/RichTextAttachment.d.ts +1 -0
  205. package/lib/extensions/Attachment/index.d.ts +1 -0
  206. package/lib/extensions/Blockquote/Blockquote.d.ts +6 -0
  207. package/lib/extensions/Blockquote/components/RichTextBlockquote.d.ts +1 -0
  208. package/lib/extensions/Blockquote/index.d.ts +1 -0
  209. package/lib/extensions/Bold/Bold.d.ts +6 -0
  210. package/lib/extensions/Bold/components/RichTextBold.d.ts +1 -0
  211. package/lib/extensions/Bold/index.d.ts +1 -0
  212. package/lib/extensions/BulletList/BulletList.d.ts +6 -0
  213. package/lib/extensions/BulletList/components/RichTextBulletList.d.ts +1 -0
  214. package/lib/extensions/BulletList/index.d.ts +1 -0
  215. package/lib/extensions/Clear/Clear.d.ts +6 -0
  216. package/lib/extensions/Clear/components/RichTextClear.d.ts +1 -0
  217. package/lib/extensions/Clear/index.d.ts +1 -0
  218. package/lib/extensions/Code/Code.d.ts +6 -0
  219. package/lib/extensions/Code/components/RichTextCode.d.ts +1 -0
  220. package/lib/extensions/Code/index.d.ts +1 -0
  221. package/lib/extensions/CodeBlock/CodeBlock.d.ts +21 -0
  222. package/lib/extensions/CodeBlock/components/NodeViewCodeBlock/NodeViewCodeBlock.d.ts +1 -0
  223. package/lib/extensions/CodeBlock/components/RichTextCodeBlock.d.ts +1 -0
  224. package/lib/extensions/CodeBlock/index.d.ts +1 -0
  225. package/lib/extensions/CodeView/CodeView.d.ts +17 -0
  226. package/lib/extensions/CodeView/components/RichTextCodeView.d.ts +1 -0
  227. package/lib/extensions/CodeView/index.d.ts +1 -0
  228. package/lib/extensions/Color/Color.d.ts +22 -0
  229. package/lib/extensions/Color/components/RichTextColor.d.ts +1 -0
  230. package/lib/extensions/Color/index.d.ts +1 -0
  231. package/lib/extensions/Column/Column.d.ts +17 -0
  232. package/lib/extensions/Column/components/RichTextColumn.d.ts +1 -0
  233. package/lib/extensions/Column/index.d.ts +1 -0
  234. package/lib/extensions/Drawer/Drawer.d.ts +15 -0
  235. package/lib/extensions/Drawer/components/ControlDrawer/ControlDrawer.d.ts +2 -0
  236. package/lib/extensions/Drawer/components/ControlDrawer/icon.d.ts +28 -0
  237. package/lib/extensions/Drawer/components/EditDrawerBlock.d.ts +1 -0
  238. package/lib/extensions/Drawer/components/NodeViewDrawer/NodeViewDrawer.d.ts +1 -0
  239. package/lib/extensions/Drawer/components/RichTextDrawer.d.ts +1 -0
  240. package/lib/extensions/Drawer/index.d.ts +1 -0
  241. package/lib/extensions/Emoji/Emoji.d.ts +3 -0
  242. package/lib/extensions/Emoji/components/EmojiList/EmojiNodeView.d.ts +3 -0
  243. package/lib/extensions/Emoji/components/EmojiList/emojis.d.ts +4 -0
  244. package/lib/extensions/Emoji/components/RichTextEmoji.d.ts +1 -0
  245. package/lib/extensions/Emoji/index.d.ts +1 -0
  246. package/lib/extensions/Excalidraw/Excalidraw.d.ts +17 -0
  247. package/lib/extensions/Excalidraw/components/NodeViewExcalidraw/NodeViewExcalidraw.d.ts +2 -0
  248. package/lib/extensions/Excalidraw/components/RichTextExcalidraw.d.ts +1 -0
  249. package/lib/extensions/Excalidraw/index.d.ts +1 -0
  250. package/lib/extensions/ExportPdf/ExportPdf.d.ts +21 -0
  251. package/lib/extensions/ExportPdf/components/RichTextExportPdf.d.ts +1 -0
  252. package/lib/extensions/ExportPdf/index.d.ts +1 -0
  253. package/lib/extensions/ExportWord/ExportWord.d.ts +13 -0
  254. package/lib/extensions/ExportWord/components/RichTextExportWord.d.ts +1 -0
  255. package/lib/extensions/ExportWord/index.d.ts +1 -0
  256. package/lib/extensions/FontFamily/FontFamily.d.ts +10 -0
  257. package/lib/extensions/FontFamily/components/RichTextFontFamily.d.ts +15 -0
  258. package/lib/extensions/FontFamily/index.d.ts +1 -0
  259. package/lib/extensions/FontSize/FontSize.d.ts +32 -0
  260. package/lib/extensions/FontSize/components/RichTextFontSize.d.ts +12 -0
  261. package/lib/extensions/FontSize/index.d.ts +1 -0
  262. package/lib/extensions/Heading/Heading.d.ts +6 -0
  263. package/lib/extensions/Heading/components/RichTextHeading.d.ts +15 -0
  264. package/lib/extensions/Heading/index.d.ts +1 -0
  265. package/lib/extensions/Highlight/Highlight.d.ts +18 -0
  266. package/lib/extensions/Highlight/components/RichTextHighlight.d.ts +1 -0
  267. package/lib/extensions/Highlight/index.d.ts +1 -0
  268. package/lib/extensions/History/History.d.ts +6 -0
  269. package/lib/extensions/History/components/RichTextHistory.d.ts +2 -0
  270. package/lib/extensions/History/index.d.ts +1 -0
  271. package/lib/extensions/HorizontalRule/HorizontalRule.d.ts +6 -0
  272. package/lib/extensions/HorizontalRule/components/RichTextHorizontalRule.d.ts +1 -0
  273. package/lib/extensions/HorizontalRule/index.d.ts +1 -0
  274. package/lib/extensions/Iframe/Iframe.d.ts +16 -0
  275. package/lib/extensions/Iframe/components/IframeNodeView.d.ts +2 -0
  276. package/lib/extensions/Iframe/components/RichTextIframe.d.ts +1 -0
  277. package/lib/extensions/Iframe/index.d.ts +1 -0
  278. package/lib/extensions/Iframe/utils.d.ts +9 -0
  279. package/lib/extensions/Image/Image.d.ts +56 -0
  280. package/lib/extensions/Image/components/ImageCropper.d.ts +1 -0
  281. package/lib/extensions/Image/components/ImageView.d.ts +2 -0
  282. package/lib/extensions/Image/components/RichTextImage.d.ts +1 -0
  283. package/lib/extensions/Image/index.d.ts +1 -0
  284. package/lib/extensions/Image/store.d.ts +4 -0
  285. package/lib/extensions/ImageGif/ImageGif.d.ts +39 -0
  286. package/lib/extensions/ImageGif/components/ImageGifView.d.ts +2 -0
  287. package/lib/extensions/ImageGif/components/RichTextImageGif.d.ts +1 -0
  288. package/lib/extensions/ImageGif/components/services.d.ts +458 -0
  289. package/lib/extensions/ImageGif/index.d.ts +1 -0
  290. package/lib/extensions/ImportWord/ImportWord.d.ts +18 -0
  291. package/lib/extensions/ImportWord/components/RichTextImportWord.d.ts +1 -0
  292. package/lib/extensions/ImportWord/index.d.ts +1 -0
  293. package/lib/extensions/Indent/Indent.d.ts +23 -0
  294. package/lib/extensions/Indent/components/RichTextIndent.d.ts +1 -0
  295. package/lib/extensions/Indent/index.d.ts +1 -0
  296. package/lib/extensions/Italic/Italic.d.ts +6 -0
  297. package/lib/extensions/Italic/components/RichTextItalic.d.ts +1 -0
  298. package/lib/extensions/Italic/index.d.ts +1 -0
  299. package/lib/extensions/Katex/Katex.d.ts +17 -0
  300. package/lib/extensions/Katex/components/KatexWrapper.d.ts +1 -0
  301. package/lib/extensions/Katex/components/RichTextKatex.d.ts +1 -0
  302. package/lib/extensions/Katex/index.d.ts +1 -0
  303. package/lib/extensions/LineHeight/LineHeight.d.ts +7 -0
  304. package/lib/extensions/LineHeight/components/RichTextLightHeight.d.ts +1 -0
  305. package/lib/extensions/LineHeight/index.d.ts +1 -0
  306. package/lib/extensions/Link/Link.d.ts +6 -0
  307. package/lib/extensions/Link/components/LinkEditBlock.d.ts +8 -0
  308. package/lib/extensions/Link/components/LinkViewBlock.d.ts +8 -0
  309. package/lib/extensions/Link/components/RichTextLink.d.ts +1 -0
  310. package/lib/extensions/Link/index.d.ts +1 -0
  311. package/lib/extensions/Mention/Mention.d.ts +1 -0
  312. package/lib/extensions/Mention/components/NodeViewMentionList.d.ts +10 -0
  313. package/lib/extensions/Mention/index.d.ts +1 -0
  314. package/lib/extensions/Mermaid/Mermaid.d.ts +15 -0
  315. package/lib/extensions/Mermaid/components/EditMermaidBlock.d.ts +8 -0
  316. package/lib/extensions/Mermaid/components/NodeViewMermaid/NodeViewMermaid.d.ts +1 -0
  317. package/lib/extensions/Mermaid/components/RichTextMermaid.d.ts +1 -0
  318. package/lib/extensions/Mermaid/index.d.ts +1 -0
  319. package/lib/extensions/MoreMark/MoreMark.d.ts +20 -0
  320. package/lib/extensions/MoreMark/components/RichTextMoreMark.d.ts +14 -0
  321. package/lib/extensions/MoreMark/index.d.ts +1 -0
  322. package/lib/extensions/OrderedList/OrderedList.d.ts +6 -0
  323. package/lib/extensions/OrderedList/components/RichTextOrderedList.d.ts +1 -0
  324. package/lib/extensions/OrderedList/index.d.ts +1 -0
  325. package/lib/extensions/SearchAndReplace/SearchAndReplace.d.ts +36 -0
  326. package/lib/extensions/SearchAndReplace/components/RichTextSearchAndReplace.d.ts +1 -0
  327. package/lib/extensions/SearchAndReplace/index.d.ts +1 -0
  328. package/lib/extensions/SlashCommand/SlashCommand.d.ts +4 -0
  329. package/lib/extensions/SlashCommand/components/SlashCommandList.d.ts +6 -0
  330. package/lib/extensions/SlashCommand/components/SlashCommandNodeView.d.ts +3 -0
  331. package/lib/extensions/SlashCommand/index.d.ts +1 -0
  332. package/lib/extensions/SlashCommand/renderCommandListDefault.d.ts +7 -0
  333. package/lib/extensions/SlashCommand/types.d.ts +19 -0
  334. package/lib/extensions/Strike/Strike.d.ts +6 -0
  335. package/lib/extensions/Strike/components/RichTextStrike.d.ts +1 -0
  336. package/lib/extensions/Strike/index.d.ts +1 -0
  337. package/lib/extensions/Table/Table.d.ts +21 -0
  338. package/lib/extensions/Table/TableCellBackground.d.ts +14 -0
  339. package/lib/extensions/Table/components/CreateTablePopover.d.ts +7 -0
  340. package/lib/extensions/Table/components/RichTextTable.d.ts +1 -0
  341. package/lib/extensions/Table/index.d.ts +1 -0
  342. package/lib/extensions/TaskList/TaskList.d.ts +11 -0
  343. package/lib/extensions/TaskList/components/RichTextTaskList.d.ts +1 -0
  344. package/lib/extensions/TaskList/index.d.ts +1 -0
  345. package/lib/extensions/TextAlign/TextAlign.d.ts +17 -0
  346. package/lib/extensions/TextAlign/components/RichTextAlign.d.ts +14 -0
  347. package/lib/extensions/TextAlign/index.d.ts +1 -0
  348. package/lib/extensions/TextDirection/TextDirection.d.ts +5 -0
  349. package/lib/extensions/TextDirection/components/RichTextTextDirection.d.ts +15 -0
  350. package/lib/extensions/TextDirection/index.d.ts +1 -0
  351. package/lib/extensions/TextUnderline/TextUnderline.d.ts +6 -0
  352. package/lib/extensions/TextUnderline/components/RichTextUnderline.d.ts +1 -0
  353. package/lib/extensions/TextUnderline/index.d.ts +1 -0
  354. package/lib/extensions/Twitter/Twitter.d.ts +46 -0
  355. package/lib/extensions/Twitter/components/FormEditLinkTwitter.d.ts +6 -0
  356. package/lib/extensions/Twitter/components/NodeViewTweet.d.ts +8 -0
  357. package/lib/extensions/Twitter/components/RichTextTwitter.d.ts +1 -0
  358. package/lib/extensions/Twitter/index.d.ts +1 -0
  359. package/lib/extensions/Video/Video.d.ts +66 -0
  360. package/lib/extensions/Video/components/RichTextVideo.d.ts +1 -0
  361. package/lib/extensions/Video/index.d.ts +1 -0
  362. package/lib/extensions/Video/store.d.ts +4 -0
  363. package/lib/hooks/useActive.d.ts +21 -0
  364. package/lib/hooks/useAttributes.d.ts +2 -0
  365. package/lib/hooks/useButtonProps.d.ts +1 -0
  366. package/lib/hooks/useCopy.d.ts +5 -0
  367. package/lib/hooks/useExtension.d.ts +1 -0
  368. package/lib/hooks/useLocalStorage.d.ts +13 -0
  369. package/lib/index-B0fWAhpK.cjs +1 -0
  370. package/lib/{icons-Cllpys39.js → index-BQ17A_37.js} +173 -142
  371. package/lib/{index-Bnmd0WvY.js → index-BeUrdBxf.js} +23 -23
  372. package/lib/{index-DYkucCoF.js → index-CEbbM7Gx.js} +57 -76
  373. package/lib/{index-BPfVXs5_.js → index-ClAEwR0V.js} +580 -403
  374. package/lib/{index-CBce_TWY.js → index-D-FhWysc.js} +1 -1
  375. package/lib/{index-DzvuNTxo.cjs → index-DCJheRBq.cjs} +1 -1
  376. package/lib/index-DLqogznp.cjs +54 -0
  377. package/lib/index-DM3mpxB-.cjs +7 -0
  378. package/lib/index-DmOTQudI.cjs +1 -0
  379. package/lib/{index-N--9MohJ.cjs → index-DylewabB.cjs} +1 -1
  380. package/lib/{index-D-5U8dY8.cjs → index-TMqmkmT6.cjs} +1 -1
  381. package/lib/index-nFjllrEl.js +7390 -0
  382. package/lib/{index-D2TUfKkC.js → index-prphFVsp.js} +1 -1
  383. package/lib/index.cjs +3 -27
  384. package/lib/index.d.ts +1 -279
  385. package/lib/index.js +22 -129
  386. package/lib/input-CadAYBdT.cjs +1 -0
  387. package/lib/input-U-XBy56K.js +21 -0
  388. package/lib/{isNumber-ClPupm7P.cjs → isNumber-C2saEiG2.cjs} +1 -1
  389. package/lib/{isNumber-fpLGS0AZ.js → isNumber-CTm1pIvN.js} +1 -1
  390. package/lib/label-23SJWQ49.js +19 -0
  391. package/lib/label-C09fAh5p.cjs +1 -0
  392. package/lib/lib/utils.d.ts +2 -0
  393. package/lib/locale-bundle.cjs +1 -1
  394. package/lib/locale-bundle.d.ts +1 -6722
  395. package/lib/locale-bundle.js +1 -1
  396. package/lib/locales/en.d.ts +179 -0
  397. package/lib/locales/fi.d.ts +179 -0
  398. package/lib/locales/hu.d.ts +179 -0
  399. package/lib/{locale-bundle.d.cts → locales/index.d.ts} +5365 -6707
  400. package/lib/locales/pt-br.d.ts +179 -0
  401. package/lib/locales/vi.d.ts +179 -0
  402. package/lib/locales/zh-cn.d.ts +179 -0
  403. package/lib/plugins/image-upload.d.ts +13 -0
  404. package/lib/popover-C64cn4Pd.cjs +1 -0
  405. package/lib/{popover-CAuEW0Mr.js → popover-ydZ2mHXy.js} +7 -6
  406. package/lib/separator-BoKhvBG9.cjs +1 -0
  407. package/lib/separator-DqqiRHfY.js +241 -0
  408. package/lib/store/ProviderUniqueId.d.ts +6 -0
  409. package/lib/store/commandList.d.ts +2 -0
  410. package/lib/store/editor.d.ts +21 -0
  411. package/lib/store/fast-context.d.ts +7 -0
  412. package/lib/store/store.d.ts +23 -0
  413. package/lib/store-BPiGnThe.cjs +1 -0
  414. package/lib/store-Cu0gDf4G.js +10 -0
  415. package/lib/style.css +1 -1
  416. package/lib/{tabs-B5mVSN1I.js → tabs-BiYU230B.js} +3 -3
  417. package/lib/{tabs-BoLCMcCI.cjs → tabs-DebGjFBg.cjs} +1 -1
  418. package/lib/{textarea-DUUM1jZd.js → textarea--_-Ve3AB.js} +3 -3
  419. package/lib/textarea-BIkB9h_0.cjs +1 -0
  420. package/lib/theme/theme.d.ts +364 -0
  421. package/lib/theme.cjs +1 -0
  422. package/lib/theme.js +372 -0
  423. package/lib/{throttle-CdwDrFpn.js → throttle-CGM5M2yG.js} +10 -10
  424. package/lib/{throttle-qX7Yjtsg.cjs → throttle-DXN-aiH5.cjs} +1 -1
  425. package/lib/toggle-BWfca8kh.cjs +1 -0
  426. package/lib/{toggle-Cdp4IT2U.js → toggle-Crvm3Tcn.js} +20 -13
  427. package/lib/tooltip-9jtsGIcX.cjs +1 -0
  428. package/lib/tooltip-D_0vo9Xj.js +24 -0
  429. package/lib/types.d.ts +230 -0
  430. package/lib/{updatePosition-8Sdem5jb.cjs → updatePosition-C17CDdjq.cjs} +1 -1
  431. package/lib/{updatePosition-BPmcE0YD.js → updatePosition-DpMKxYdN.js} +1 -1
  432. package/lib/useButtonProps--5ytUuGi.js +136 -0
  433. package/lib/useButtonProps-DJ51kDtM.cjs +1 -0
  434. package/lib/utils/_event.d.ts +13 -0
  435. package/lib/utils/base64.d.ts +2 -0
  436. package/lib/utils/color.d.ts +7 -0
  437. package/lib/utils/columns.d.ts +14 -0
  438. package/lib/utils/customEvents/customEvents.d.ts +3 -0
  439. package/lib/utils/customEvents/events.constant.d.ts +9 -0
  440. package/lib/utils/delete-node.d.ts +2 -0
  441. package/lib/utils/dom-dataset.d.ts +28 -0
  442. package/lib/utils/download.d.ts +1 -0
  443. package/lib/utils/dynamicCSS.d.ts +25 -0
  444. package/lib/utils/editor-container-size.d.ts +4 -0
  445. package/lib/utils/file.d.ts +30 -0
  446. package/lib/utils/getRenderContainer.d.ts +3 -0
  447. package/lib/utils/indent.d.ts +14 -0
  448. package/lib/utils/is-mobile.d.ts +19 -0
  449. package/lib/utils/json.d.ts +2 -0
  450. package/lib/utils/lru-cache.d.ts +31 -0
  451. package/lib/utils/mitt.d.ts +21 -0
  452. package/lib/utils/node.d.ts +15 -0
  453. package/lib/utils/pdf.d.ts +3 -0
  454. package/lib/utils/plateform.d.ts +11 -0
  455. package/lib/utils/shortId.d.ts +1 -0
  456. package/lib/utils/storage.d.ts +2 -0
  457. package/lib/utils/updatePosition.d.ts +1 -0
  458. package/lib/utils/utils.d.ts +20 -0
  459. package/lib/utils/validateFile.d.ts +16 -0
  460. package/package.json +155 -169
  461. package/lib/Attachment.d.cts +0 -351
  462. package/lib/Attachment.d.ts +0 -351
  463. package/lib/Blockquote.d.cts +0 -350
  464. package/lib/Blockquote.d.ts +0 -350
  465. package/lib/Bold.d.cts +0 -350
  466. package/lib/Bold.d.ts +0 -350
  467. package/lib/BulletList.d.cts +0 -350
  468. package/lib/BulletList.d.ts +0 -350
  469. package/lib/Clear.d.cts +0 -349
  470. package/lib/Clear.d.ts +0 -349
  471. package/lib/Code.d.cts +0 -350
  472. package/lib/Code.d.ts +0 -350
  473. package/lib/CodeBlock.d.cts +0 -359
  474. package/lib/CodeBlock.d.ts +0 -359
  475. package/lib/CodeView.d.cts +0 -349
  476. package/lib/CodeView.d.ts +0 -349
  477. package/lib/Color.d.cts +0 -361
  478. package/lib/Color.d.ts +0 -361
  479. package/lib/Column.d.cts +0 -280
  480. package/lib/Column.d.ts +0 -280
  481. package/lib/Drawer-SRhwOc6T.cjs +0 -1
  482. package/lib/Drawer.d.cts +0 -351
  483. package/lib/Drawer.d.ts +0 -351
  484. package/lib/Emoji.d.cts +0 -279
  485. package/lib/Emoji.d.ts +0 -279
  486. package/lib/Excalidraw-DwBRXEtC.js +0 -345
  487. package/lib/Excalidraw-ZN3DQvDC.cjs +0 -1
  488. package/lib/Excalidraw.d.cts +0 -283
  489. package/lib/Excalidraw.d.ts +0 -283
  490. package/lib/ExportPdf.d.cts +0 -360
  491. package/lib/ExportPdf.d.ts +0 -360
  492. package/lib/ExportWord.d.cts +0 -348
  493. package/lib/ExportWord.d.ts +0 -348
  494. package/lib/FontFamily.d.cts +0 -372
  495. package/lib/FontFamily.d.ts +0 -372
  496. package/lib/FontSize.d.cts +0 -374
  497. package/lib/FontSize.d.ts +0 -374
  498. package/lib/Heading.d.cts +0 -364
  499. package/lib/Heading.d.ts +0 -364
  500. package/lib/Highlight.d.cts +0 -359
  501. package/lib/Highlight.d.ts +0 -359
  502. package/lib/History.d.cts +0 -352
  503. package/lib/History.d.ts +0 -352
  504. package/lib/HorizontalRule.d.cts +0 -350
  505. package/lib/HorizontalRule.d.ts +0 -350
  506. package/lib/Iframe-Cvca2G7X.cjs +0 -1
  507. package/lib/Iframe.d.cts +0 -275
  508. package/lib/Iframe.d.ts +0 -275
  509. package/lib/Image.d.cts +0 -384
  510. package/lib/Image.d.ts +0 -384
  511. package/lib/ImageGif.d.cts +0 -296
  512. package/lib/ImageGif.d.ts +0 -296
  513. package/lib/ImportWord.d.cts +0 -360
  514. package/lib/ImportWord.d.ts +0 -360
  515. package/lib/Indent.d.cts +0 -351
  516. package/lib/Indent.d.ts +0 -351
  517. package/lib/Italic.d.cts +0 -350
  518. package/lib/Italic.d.ts +0 -350
  519. package/lib/Katex-XfrNne6U.cjs +0 -4
  520. package/lib/Katex.d.cts +0 -284
  521. package/lib/Katex.d.ts +0 -284
  522. package/lib/LineHeight.d.cts +0 -350
  523. package/lib/LineHeight.d.ts +0 -350
  524. package/lib/Link.d.cts +0 -350
  525. package/lib/Link.d.ts +0 -350
  526. package/lib/LinkEditBlock-BZenZq-Z.cjs +0 -5
  527. package/lib/Mention.d.cts +0 -274
  528. package/lib/Mention.d.ts +0 -274
  529. package/lib/Mermaid.d.cts +0 -351
  530. package/lib/Mermaid.d.ts +0 -351
  531. package/lib/MoreMark.d.cts +0 -375
  532. package/lib/MoreMark.d.ts +0 -375
  533. package/lib/OrderedList.d.cts +0 -350
  534. package/lib/OrderedList.d.ts +0 -350
  535. package/lib/SearchAndReplace.d.cts +0 -292
  536. package/lib/SearchAndReplace.d.ts +0 -292
  537. package/lib/SlashCommand.d.cts +0 -309
  538. package/lib/SlashCommand.d.ts +0 -309
  539. package/lib/Strike.d.cts +0 -350
  540. package/lib/Strike.d.ts +0 -350
  541. package/lib/Table-B1j1Ebmh.cjs +0 -9
  542. package/lib/Table.d.cts +0 -371
  543. package/lib/Table.d.ts +0 -371
  544. package/lib/TaskList.d.cts +0 -356
  545. package/lib/TaskList.d.ts +0 -356
  546. package/lib/TextAlign.d.cts +0 -373
  547. package/lib/TextAlign.d.ts +0 -373
  548. package/lib/TextDirection.d.cts +0 -304
  549. package/lib/TextDirection.d.ts +0 -304
  550. package/lib/TextUnderline.d.cts +0 -350
  551. package/lib/TextUnderline.d.ts +0 -350
  552. package/lib/Twitter-CtVTIWJW.cjs +0 -1
  553. package/lib/Twitter.d.cts +0 -300
  554. package/lib/Twitter.d.ts +0 -300
  555. package/lib/Video.d.cts +0 -385
  556. package/lib/Video.d.ts +0 -385
  557. package/lib/bubble.d.cts +0 -310
  558. package/lib/button-B12K7BJ4.cjs +0 -1
  559. package/lib/clsx-C11secjj.cjs +0 -1
  560. package/lib/clsx-OuTLNxxd.js +0 -16
  561. package/lib/dialog-CaCS-W5S.cjs +0 -1
  562. package/lib/dialog-PtQivpHS.js +0 -100
  563. package/lib/dropdown-menu-CdSm4emp.cjs +0 -1
  564. package/lib/icons-CqHjeW5T.cjs +0 -1
  565. package/lib/index-BH4bc3jN.cjs +0 -33
  566. package/lib/index-DV5kbgRU.cjs +0 -1
  567. package/lib/index-Dfmm6FTT.cjs +0 -1
  568. package/lib/index-DnWWK9F_.js +0 -6374
  569. package/lib/index-DzcKxutn.js +0 -632
  570. package/lib/index-RfTlOzIr.cjs +0 -22
  571. package/lib/index.d.cts +0 -279
  572. package/lib/input-_ECRfn3Y.cjs +0 -1
  573. package/lib/input-wJ9PDEzZ.js +0 -21
  574. package/lib/label-BkgAe7IY.cjs +0 -1
  575. package/lib/label-CGdLYWv7.js +0 -19
  576. package/lib/popover-BgmUNMHj.cjs +0 -1
  577. package/lib/separator-CuBW_w98.js +0 -328
  578. package/lib/separator-DRIrVZ2N.cjs +0 -1
  579. package/lib/store-DX599H5W.js +0 -10
  580. package/lib/store-WStcMOiW.cjs +0 -1
  581. package/lib/switch-CnLJ7Y-b.cjs +0 -1
  582. package/lib/switch-Coix_FA1.js +0 -27
  583. package/lib/textarea-B-6zTKQz.cjs +0 -1
  584. package/lib/theme-B7aAsK_T.js +0 -15
  585. package/lib/theme-D8_cxGqB.cjs +0 -1
  586. package/lib/toggle-D41PzQLJ.cjs +0 -1
  587. package/lib/tooltip-BuEiE96N.cjs +0 -1
  588. package/lib/tooltip-CopwsU8q.js +0 -23
  589. package/lib/useButtonProps-BsEd4zYM.js +0 -141
  590. package/lib/useButtonProps-C6Vpn190.cjs +0 -1
@@ -1,17 +1,15 @@
1
- import { N as At, m as Vt, a3 as Mt } from "./index-DnWWK9F_.js";
2
- import { s as rt, N as jt, R as Wt } from "./index-DzcKxutn.js";
1
+ import { C as U, aa as rt, s as At, N as Vt, m as Mt, ab as jt, R as Wt } from "./index-nFjllrEl.js";
3
2
  import { jsx as r, jsxs as h, Fragment as Bt } from "react/jsx-runtime";
4
3
  import Be, { useState as se, Fragment as Ft, useEffect as Fe, useMemo as Pe, createContext as Pt, useLayoutEffect as Ut, useContext as zt, useRef as K, useCallback as be, useDebugValue as Ht } from "react";
5
- import { c as U } from "./clsx-OuTLNxxd.js";
6
- import { A as Gt } from "./toggle-Cdp4IT2U.js";
7
- import { a as Xt } from "./index-BPfVXs5_.js";
8
- import { I as Kt } from "./Icon-jKs8Hr6p.js";
9
- import { u as Qt } from "./index-DYkucCoF.js";
10
- import { L as Jt } from "./label-CGdLYWv7.js";
11
- import { I as Yt } from "./input-wJ9PDEzZ.js";
12
- import { B as Zt } from "./button-DXMsXUEn.js";
13
- import { u as en, a as tn } from "./useButtonProps-BsEd4zYM.js";
14
- import { P as nn, a as rn, b as on } from "./popover-CAuEW0Mr.js";
4
+ import { A as Gt } from "./toggle-Crvm3Tcn.js";
5
+ import "./index-ClAEwR0V.js";
6
+ import { u as Xt } from "./index-CEbbM7Gx.js";
7
+ import { L as Kt } from "./label-23SJWQ49.js";
8
+ import { I as Qt } from "./input-U-XBy56K.js";
9
+ import { B as Jt } from "./button-DHZeIKzF.js";
10
+ import { c as Yt, u as Zt, a as en } from "./useButtonProps--5ytUuGi.js";
11
+ import { P as tn, a as nn, b as rn } from "./popover-ydZ2mHXy.js";
12
+ import { I as on } from "./Icon-D3AdnMCj.js";
15
13
  const sn = "_verified_lvyh0_1", Ue = {
16
14
  verified: sn
17
15
  }, an = () => /* @__PURE__ */ r("svg", {
@@ -126,7 +124,7 @@ const sn = "_verified_lvyh0_1", Ue = {
126
124
  })
127
125
  }), vt = (e) => /* @__PURE__ */ r("img", {
128
126
  ...e
129
- }), fn = "_header_nqq4j_1", hn = "_avatar_nqq4j_11", _n = "_avatarOverflow_nqq4j_16", mn = "_avatarSquare_nqq4j_23", pn = "_avatarShadow_nqq4j_26", vn = "_author_nqq4j_37", gn = "_authorLink_nqq4j_44", wn = "_authorVerified_nqq4j_53", yn = "_authorLinkText_nqq4j_56", Tn = "_authorMeta_nqq4j_63", bn = "_authorFollow_nqq4j_66", xn = "_username_nqq4j_69", Nn = "_follow_nqq4j_74", Rn = "_separator_nqq4j_82", kn = "_brand_nqq4j_86", In = "_twitterIcon_nqq4j_90", N = {
127
+ }), fn = "_header_nqq4j_1", hn = "_avatar_nqq4j_11", _n = "_avatarOverflow_nqq4j_16", mn = "_avatarSquare_nqq4j_23", pn = "_avatarShadow_nqq4j_26", vn = "_author_nqq4j_37", gn = "_authorLink_nqq4j_44", wn = "_authorVerified_nqq4j_53", yn = "_authorLinkText_nqq4j_56", Tn = "_authorMeta_nqq4j_63", bn = "_authorFollow_nqq4j_66", xn = "_username_nqq4j_69", Nn = "_follow_nqq4j_74", Rn = "_separator_nqq4j_82", In = "_brand_nqq4j_86", kn = "_twitterIcon_nqq4j_90", N = {
130
128
  header: fn,
131
129
  avatar: hn,
132
130
  avatarOverflow: _n,
@@ -141,8 +139,8 @@ const sn = "_verified_lvyh0_1", Ue = {
141
139
  username: xn,
142
140
  follow: Nn,
143
141
  separator: Rn,
144
- brand: kn,
145
- twitterIcon: In
142
+ brand: In,
143
+ twitterIcon: kn
146
144
  }, Sn = "_verifiedOld_lcna5_1", En = "_verifiedBlue_lcna5_4", Cn = "_verifiedGovernment_lcna5_7", xe = {
147
145
  verifiedOld: Sn,
148
146
  verifiedBlue: En,
@@ -611,10 +609,10 @@ const Qn = (e) => ({
611
609
  })
612
610
  })
613
611
  ]
614
- }), Rr = "_actions_n2anf_1", kr = "_like_n2anf_13", Ir = "_reply_n2anf_14", Sr = "_copy_n2anf_15", Er = "_likeIconWrapper_n2anf_27", Cr = "_likeCount_n2anf_30", Lr = "_replyIconWrapper_n2anf_35", Or = "_copyIconWrapper_n2anf_36", qr = "_likeIcon_n2anf_27", Dr = "_replyIcon_n2anf_35", $r = "_copyIcon_n2anf_36", Ar = "_replyText_n2anf_56", Vr = "_copyText_n2anf_57", S = {
612
+ }), Rr = "_actions_n2anf_1", Ir = "_like_n2anf_13", kr = "_reply_n2anf_14", Sr = "_copy_n2anf_15", Er = "_likeIconWrapper_n2anf_27", Cr = "_likeCount_n2anf_30", Lr = "_replyIconWrapper_n2anf_35", Or = "_copyIconWrapper_n2anf_36", qr = "_likeIcon_n2anf_27", Dr = "_replyIcon_n2anf_35", $r = "_copyIcon_n2anf_36", Ar = "_replyText_n2anf_56", Vr = "_copyText_n2anf_57", S = {
615
613
  actions: Rr,
616
- like: kr,
617
- reply: Ir,
614
+ like: Ir,
615
+ reply: kr,
618
616
  copy: Sr,
619
617
  likeIconWrapper: Er,
620
618
  likeCount: Cr,
@@ -957,28 +955,28 @@ function qe(e, t) {
957
955
  return e !== e && t !== t;
958
956
  }
959
957
  const F = /* @__PURE__ */ new WeakMap(), P = () => {
960
- }, k = (
958
+ }, I = (
961
959
  /*#__NOINLINE__*/
962
960
  P()
963
- ), De = Object, u = (e) => e === k, j = (e) => typeof e == "function", z = (e, t) => ({
961
+ ), De = Object, u = (e) => e === I, j = (e) => typeof e == "function", z = (e, t) => ({
964
962
  ...e,
965
963
  ...t
966
- }), Rt = (e) => j(e.then), ke = {}, ve = {}, He = "undefined", ue = typeof window != He, $e = typeof document != He, _o = ue && "Deno" in window, mo = () => ue && typeof window.requestAnimationFrame != He, kt = (e, t) => {
964
+ }), Rt = (e) => j(e.then), Ie = {}, ve = {}, He = "undefined", ue = typeof window != He, $e = typeof document != He, _o = ue && "Deno" in window, mo = () => ue && typeof window.requestAnimationFrame != He, It = (e, t) => {
967
965
  const n = F.get(e);
968
966
  return [
969
967
  // Getter
970
- () => !u(t) && e.get(t) || ke,
968
+ () => !u(t) && e.get(t) || Ie,
971
969
  // Setter
972
970
  (o) => {
973
971
  if (!u(t)) {
974
972
  const i = e.get(t);
975
- t in ve || (ve[t] = i), n[5](t, z(i, o), i || ke);
973
+ t in ve || (ve[t] = i), n[5](t, z(i, o), i || Ie);
976
974
  }
977
975
  },
978
976
  // Subscriber
979
977
  n[6],
980
978
  // Get server cache snapshot
981
- () => !u(t) && t in ve ? ve[t] : !u(t) && e.get(t) || ke
979
+ () => !u(t) && t in ve ? ve[t] : !u(t) && e.get(t) || Ie
982
980
  ];
983
981
  };
984
982
  let Ae = !0;
@@ -1008,7 +1006,7 @@ const po = () => Ae, [Ve, Me] = ue && window.addEventListener ? [
1008
1006
  }, To = {
1009
1007
  initFocus: go,
1010
1008
  initReconnect: wo
1011
- }, ut = !Be.useId, ae = !ue || _o, bo = (e) => mo() ? window.requestAnimationFrame(e) : setTimeout(e, 1), Ie = ae ? Fe : Ut, Se = typeof navigator < "u" && navigator.connection, ft = !ae && Se && ([
1009
+ }, ut = !Be.useId, ae = !ue || _o, bo = (e) => mo() ? window.requestAnimationFrame(e) : setTimeout(e, 1), ke = ae ? Fe : Ut, Se = typeof navigator < "u" && navigator.connection, ft = !ae && Se && ([
1012
1010
  "slow-2g",
1013
1011
  "2g"
1014
1012
  ].includes(Se.effectiveType) || Se.saveData), ge = /* @__PURE__ */ new WeakMap(), xo = (e) => De.prototype.toString.call(e), Ee = (e, t) => e === `[object ${t}]`;
@@ -1048,7 +1046,7 @@ const je = (e) => {
1048
1046
  };
1049
1047
  let Ro = 0;
1050
1048
  const We = () => ++Ro;
1051
- async function It(...e) {
1049
+ async function kt(...e) {
1052
1050
  const [t, n, o, i] = e, a = z({
1053
1051
  populateCache: !0,
1054
1052
  throwOnError: !0
@@ -1070,7 +1068,7 @@ async function It(...e) {
1070
1068
  async function m(T) {
1071
1069
  const [R] = Ge(T);
1072
1070
  if (!R) return;
1073
- const [E, O] = kt(t, R), [$, ce, l, fe] = F.get(t), J = () => {
1071
+ const [E, O] = It(t, R), [$, ce, l, fe] = F.get(t), J = () => {
1074
1072
  const q = $[R];
1075
1073
  return (j(a.revalidate) ? a.revalidate(E().data, T) : a.revalidate !== !1) && (delete l[R], delete fe[R], q && q[0]) ? q[0](Nt).then(() => E().data) : E().data;
1076
1074
  };
@@ -1100,25 +1098,25 @@ async function It(...e) {
1100
1098
  return b;
1101
1099
  } else V && p && d(A) && (s = !0, O({
1102
1100
  data: H,
1103
- _c: k
1101
+ _c: I
1104
1102
  }));
1105
1103
  if (s && !V)
1106
1104
  if (j(s)) {
1107
1105
  const q = s(b, H);
1108
1106
  O({
1109
1107
  data: q,
1110
- error: k,
1111
- _c: k
1108
+ error: I,
1109
+ _c: I
1112
1110
  });
1113
1111
  } else
1114
1112
  O({
1115
1113
  data: b,
1116
- error: k,
1117
- _c: k
1114
+ error: I,
1115
+ _c: I
1118
1116
  });
1119
1117
  if (ce[R][1] = We(), Promise.resolve(J()).then(() => {
1120
1118
  O({
1121
- _c: k
1119
+ _c: I
1122
1120
  });
1123
1121
  }), V) {
1124
1122
  if (g) throw A;
@@ -1130,9 +1128,9 @@ async function It(...e) {
1130
1128
  const ht = (e, t) => {
1131
1129
  for (const n in e)
1132
1130
  e[n][0] && e[n][0](t);
1133
- }, ko = (e, t) => {
1131
+ }, Io = (e, t) => {
1134
1132
  if (!F.has(e)) {
1135
- const n = z(To, t), o = /* @__PURE__ */ Object.create(null), i = It.bind(k, e);
1133
+ const n = z(To, t), o = /* @__PURE__ */ Object.create(null), i = kt.bind(I, e);
1136
1134
  let a = P;
1137
1135
  const s = /* @__PURE__ */ Object.create(null), c = (g, m) => {
1138
1136
  const T = s[g] || [];
@@ -1153,7 +1151,7 @@ const ht = (e, t) => {
1153
1151
  f,
1154
1152
  c
1155
1153
  ]), !ae)) {
1156
- const g = n.initFocus(setTimeout.bind(k, ht.bind(k, o, bt))), m = n.initReconnect(setTimeout.bind(k, ht.bind(k, o, xt)));
1154
+ const g = n.initFocus(setTimeout.bind(I, ht.bind(I, o, bt))), m = n.initReconnect(setTimeout.bind(I, ht.bind(I, o, xt)));
1157
1155
  a = () => {
1158
1156
  g && g(), m && m(), F.delete(e);
1159
1157
  };
@@ -1170,16 +1168,16 @@ const ht = (e, t) => {
1170
1168
  e,
1171
1169
  F.get(e)[4]
1172
1170
  ];
1173
- }, Io = (e, t, n, o, i) => {
1171
+ }, ko = (e, t, n, o, i) => {
1174
1172
  const a = n.errorRetryCount, s = i.retryCount, c = ~~((Math.random() + 0.5) * (1 << (s < 8 ? s : 8))) * n.errorRetryInterval;
1175
1173
  !u(a) && s > a || setTimeout(o, c, i);
1176
- }, So = qe, [St, Eo] = ko(/* @__PURE__ */ new Map()), Co = z(
1174
+ }, So = qe, [St, Eo] = Io(/* @__PURE__ */ new Map()), Co = z(
1177
1175
  {
1178
1176
  // events
1179
1177
  onLoadingSlow: P,
1180
1178
  onSuccess: P,
1181
1179
  onError: P,
1182
- onErrorRetry: Io,
1180
+ onErrorRetry: ko,
1183
1181
  onDiscarded: P,
1184
1182
  // switches
1185
1183
  revalidateOnFocus: !0,
@@ -1264,8 +1262,8 @@ const Ce = Be.use || // This extra generic is to avoid TypeScript mixing up the
1264
1262
  }
1265
1263
  }), Le = {
1266
1264
  dedupe: !0
1267
- }, _t = Promise.resolve(k), Fo = (e, t, n) => {
1268
- const { cache: o, compare: i, suspense: a, fallbackData: s, revalidateOnMount: c, revalidateIfStale: f, refreshInterval: d, refreshWhenHidden: g, refreshWhenOffline: m, keepPreviousData: T, strictServerPrefetchWarning: R } = n, [E, O, $, ce] = F.get(o), [l, fe] = Ge(e), J = K(!1), b = K(!1), A = K(l), V = K(t), Y = K(n), p = () => Y.current, Z = () => p().isVisible() && p().isOnline(), [M, ee, H, q] = kt(o, l), te = K({}).current, he = u(s) ? u(n.fallback) ? k : n.fallback[l] : s, Xe = (_, v) => {
1265
+ }, _t = Promise.resolve(I), Fo = (e, t, n) => {
1266
+ const { cache: o, compare: i, suspense: a, fallbackData: s, revalidateOnMount: c, revalidateIfStale: f, refreshInterval: d, refreshWhenHidden: g, refreshWhenOffline: m, keepPreviousData: T, strictServerPrefetchWarning: R } = n, [E, O, $, ce] = F.get(o), [l, fe] = Ge(e), J = K(!1), b = K(!1), A = K(l), V = K(t), Y = K(n), p = () => Y.current, Z = () => p().isVisible() && p().isOnline(), [M, ee, H, q] = It(o, l), te = K({}).current, he = u(s) ? u(n.fallback) ? I : n.fallback[l] : s, Xe = (_, v) => {
1269
1267
  for (const y in te) {
1270
1268
  const w = y;
1271
1269
  if (w === "data") {
@@ -1276,8 +1274,8 @@ const Ce = Be.use || // This extra generic is to avoid TypeScript mixing up the
1276
1274
  }
1277
1275
  return !0;
1278
1276
  }, Ke = Pe(() => {
1279
- const _ = !l || !t ? !1 : u(c) ? p().isPaused() || a ? !1 : f !== !1 : c, v = (I) => {
1280
- const W = z(I);
1277
+ const _ = !l || !t ? !1 : u(c) ? p().isPaused() || a ? !1 : f !== !1 : c, v = (k) => {
1278
+ const W = z(k);
1281
1279
  return delete W._k, _ ? {
1282
1280
  isValidating: !0,
1283
1281
  isLoading: !0,
@@ -1287,8 +1285,8 @@ const Ce = Be.use || // This extra generic is to avoid TypeScript mixing up the
1287
1285
  let x = D;
1288
1286
  return [
1289
1287
  () => {
1290
- const I = v(M());
1291
- return Xe(I, x) ? (x.data = I.data, x.isLoading = I.isLoading, x.isValidating = I.isValidating, x.error = I.error, x) : (x = I, I);
1288
+ const k = v(M());
1289
+ return Xe(k, x) ? (x.data = k.data, x.isLoading = k.isLoading, x.isValidating = k.isValidating, x.error = k.error, x) : (x = k, k);
1292
1290
  },
1293
1291
  () => oe
1294
1292
  ];
@@ -1313,7 +1311,7 @@ const Ce = Be.use || // This extra generic is to avoid TypeScript mixing up the
1313
1311
  if (!l || !v || b.current || p().isPaused())
1314
1312
  return !1;
1315
1313
  let y, w, D = !0;
1316
- const oe = _ || {}, x = !$[l] || !oe.dedupe, I = () => ut ? !b.current && l === A.current && J.current : l === A.current, W = {
1314
+ const oe = _ || {}, x = !$[l] || !oe.dedupe, k = () => ut ? !b.current && l === A.current && J.current : l === A.current, W = {
1317
1315
  isValidating: !1,
1318
1316
  isLoading: !1
1319
1317
  }, et = () => {
@@ -1327,25 +1325,25 @@ const Ce = Be.use || // This extra generic is to avoid TypeScript mixing up the
1327
1325
  u(M().data) && (nt.isLoading = !0);
1328
1326
  try {
1329
1327
  if (x && (ee(nt), n.loadingTimeout && u(M().data) && setTimeout(() => {
1330
- D && I() && p().onLoadingSlow(l, n);
1328
+ D && k() && p().onLoadingSlow(l, n);
1331
1329
  }, n.loadingTimeout), $[l] = [
1332
1330
  v(fe),
1333
1331
  We()
1334
1332
  ]), [y, w] = $[l], y = await y, x && setTimeout(tt, n.dedupingInterval), !$[l] || $[l][1] !== w)
1335
- return x && I() && p().onDiscarded(l), !1;
1336
- W.error = k;
1333
+ return x && k() && p().onDiscarded(l), !1;
1334
+ W.error = I;
1337
1335
  const L = O[l];
1338
1336
  if (!u(L) && // case 1
1339
1337
  (w <= L[0] || // case 2
1340
1338
  w <= L[1] || // case 3
1341
1339
  L[1] === 0))
1342
- return et(), x && I() && p().onDiscarded(l), !1;
1340
+ return et(), x && k() && p().onDiscarded(l), !1;
1343
1341
  const B = M().data;
1344
- W.data = i(B, y) ? B : y, x && I() && p().onSuccess(y, l, n);
1342
+ W.data = i(B, y) ? B : y, x && k() && p().onSuccess(y, l, n);
1345
1343
  } catch (L) {
1346
1344
  tt();
1347
1345
  const B = p(), { shouldRetryOnError: ye } = B;
1348
- B.isPaused() || (W.error = L, x && I() && (B.onError(L, l, B), (ye === !0 || j(ye) && ye(L)) && (!p().revalidateOnFocus || !p().revalidateOnReconnect || Z()) && B.onErrorRetry(L, l, B, ($t) => {
1346
+ B.isPaused() || (W.error = L, x && k() && (B.onError(L, l, B), (ye === !0 || j(ye) && ye(L)) && (!p().revalidateOnFocus || !p().revalidateOnReconnect || Z()) && B.onErrorRetry(L, l, B, ($t) => {
1349
1347
  const Te = E[l];
1350
1348
  Te && Te[0] && Te[0](lt, $t);
1351
1349
  }, {
@@ -1372,15 +1370,15 @@ const Ce = Be.use || // This extra generic is to avoid TypeScript mixing up the
1372
1370
  ]
1373
1371
  ), Ze = be(
1374
1372
  // Use callback to make sure `keyRef.current` returns latest result every time
1375
- (..._) => It(o, A.current, ..._),
1373
+ (..._) => kt(o, A.current, ..._),
1376
1374
  // eslint-disable-next-line react-hooks/exhaustive-deps
1377
1375
  []
1378
1376
  );
1379
- if (Ie(() => {
1377
+ if (ke(() => {
1380
1378
  V.current = t, Y.current = n, u(re) || (we.current = re);
1381
- }), Ie(() => {
1379
+ }), ke(() => {
1382
1380
  if (!l) return;
1383
- const _ = le.bind(k, Le);
1381
+ const _ = le.bind(I, Le);
1384
1382
  let v = 0;
1385
1383
  p().revalidateOnFocus && (v = Date.now() + p().focusThrottleInterval);
1386
1384
  const w = Bo(l, E, (D, oe = {}) => {
@@ -1403,7 +1401,7 @@ const Ce = Be.use || // This extra generic is to avoid TypeScript mixing up the
1403
1401
  };
1404
1402
  }, [
1405
1403
  l
1406
- ]), Ie(() => {
1404
+ ]), ke(() => {
1407
1405
  let _;
1408
1406
  function v() {
1409
1407
  const w = j(d) ? d(M().data) : d;
@@ -1494,10 +1492,10 @@ const Go = (e, t, n) => {
1494
1492
  function Ko({ node: e }) {
1495
1493
  var o;
1496
1494
  const t = ((o = e == null ? void 0 : e.attrs) == null ? void 0 : o.src) || "", n = t == null ? void 0 : t.split("/").pop();
1497
- return n ? /* @__PURE__ */ r(jt, { children: /* @__PURE__ */ r("div", { "data-twitter": "", children: /* @__PURE__ */ r(Xo, { id: n }) }) }) : null;
1495
+ return n ? /* @__PURE__ */ r(At, { children: /* @__PURE__ */ r("div", { "data-twitter": "", children: /* @__PURE__ */ r(Xo, { id: n }) }) }) : null;
1498
1496
  }
1499
1497
  function Qo(e) {
1500
- const { t } = Qt(), [n, o] = se("");
1498
+ const { t } = Xt(), [n, o] = se("");
1501
1499
  Fe(() => {
1502
1500
  var a;
1503
1501
  if (e != null && e.editor) {
@@ -1508,15 +1506,15 @@ function Qo(e) {
1508
1506
  function i(a) {
1509
1507
  a.preventDefault(), a.stopPropagation(), e == null || e.onSetLink(n);
1510
1508
  }
1511
- return /* @__PURE__ */ r("div", { className: "border-neutral-200 richtext-rounded-lg !richtext-border richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black", children: /* @__PURE__ */ h(
1509
+ return /* @__PURE__ */ h(
1512
1510
  "form",
1513
1511
  {
1514
1512
  className: "richtext-flex richtext-flex-col richtext-gap-2",
1515
1513
  onSubmit: i,
1516
1514
  children: [
1517
- /* @__PURE__ */ r(Jt, { className: "mb-[6px]", children: t("editor.link.dialog.text") }),
1515
+ /* @__PURE__ */ r(Kt, { className: "mb-[6px]", children: t("editor.link.dialog.text") }),
1518
1516
  /* @__PURE__ */ r("div", { className: "richtext-mb-[10px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5", children: /* @__PURE__ */ r("div", { className: "richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center", children: /* @__PURE__ */ r(
1519
- Yt,
1517
+ Qt,
1520
1518
  {
1521
1519
  className: "richtext-w-80",
1522
1520
  onChange: (a) => o(a.target.value),
@@ -1527,7 +1525,7 @@ function Qo(e) {
1527
1525
  }
1528
1526
  ) }) }),
1529
1527
  /* @__PURE__ */ r(
1530
- Zt,
1528
+ Jt,
1531
1529
  {
1532
1530
  className: "richtext-mt-2 richtext-self-end",
1533
1531
  type: "submit",
@@ -1536,38 +1534,38 @@ function Qo(e) {
1536
1534
  )
1537
1535
  ]
1538
1536
  }
1539
- ) });
1537
+ );
1540
1538
  }
1541
- function _i() {
1542
- const [e, t] = se(!1), n = Xt(), o = en(Ct.name), {
1539
+ function fi() {
1540
+ const [e, t] = se(!1), n = Yt(), o = Zt(Ct.name), {
1543
1541
  icon: i = void 0,
1544
1542
  tooltip: a = void 0,
1545
1543
  tooltipOptions: s = {},
1546
1544
  action: c = void 0,
1547
1545
  isActive: f = void 0
1548
- } = (o == null ? void 0 : o.componentProps) ?? {}, { editorDisabled: d } = tn(f);
1546
+ } = (o == null ? void 0 : o.componentProps) ?? {}, { editorDisabled: d } = en(f);
1549
1547
  function g(m) {
1550
1548
  d || c && (c(m), t(!1));
1551
1549
  }
1552
1550
  return /* @__PURE__ */ h(
1553
- nn,
1551
+ tn,
1554
1552
  {
1555
1553
  modal: !0,
1556
1554
  onOpenChange: t,
1557
1555
  open: e,
1558
1556
  children: [
1559
- /* @__PURE__ */ r(rn, { asChild: !0, children: /* @__PURE__ */ r(
1557
+ /* @__PURE__ */ r(nn, { asChild: !0, children: /* @__PURE__ */ r(
1560
1558
  Gt,
1561
1559
  {
1562
1560
  disabled: d,
1563
1561
  isActive: f,
1564
1562
  tooltip: a,
1565
1563
  tooltipOptions: s,
1566
- children: /* @__PURE__ */ r(Kt, { name: i })
1564
+ children: /* @__PURE__ */ r(on, { name: i })
1567
1565
  }
1568
1566
  ) }),
1569
1567
  /* @__PURE__ */ r(
1570
- on,
1568
+ rn,
1571
1569
  {
1572
1570
  align: "start",
1573
1571
  className: "richtext-w-full",
@@ -1590,7 +1588,7 @@ const Jo = /(https?:\/\/)?(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?/g
1590
1588
  function pt(e) {
1591
1589
  return e.match(Yo);
1592
1590
  }
1593
- const Ct = /* @__PURE__ */ At.create({
1591
+ const Ct = /* @__PURE__ */ Vt.create({
1594
1592
  name: "twitter",
1595
1593
  draggable: !0,
1596
1594
  selectable: !0,
@@ -1648,7 +1646,7 @@ const Ct = /* @__PURE__ */ At.create({
1648
1646
  },
1649
1647
  addPasteRules() {
1650
1648
  return this.options.addPasteHandler ? [
1651
- Mt({
1649
+ jt({
1652
1650
  find: Jo,
1653
1651
  type: this.type,
1654
1652
  getAttributes: (e) => ({ src: e.input })
@@ -1656,11 +1654,11 @@ const Ct = /* @__PURE__ */ At.create({
1656
1654
  ] : [];
1657
1655
  },
1658
1656
  renderHTML({ HTMLAttributes: e }) {
1659
- return ["div", Vt({ "data-twitter": "" }, e)];
1657
+ return ["div", Mt({ "data-twitter": "" }, e)];
1660
1658
  }
1661
1659
  });
1662
1660
  export {
1663
1661
  Qo as F,
1664
- _i as R,
1662
+ fi as R,
1665
1663
  Ct as T
1666
1664
  };
@@ -0,0 +1 @@
1
+ "use strict";const k=require("./index-DLqogznp.cjs"),n=require("react/jsx-runtime"),h=require("react"),Lt=require("./toggle-BWfca8kh.cjs");require("./index-DM3mpxB-.cjs");const Ot=require("./index-B0fWAhpK.cjs"),qt=require("./label-C09fAh5p.cjs"),Dt=require("./input-CadAYBdT.cjs"),$t=require("./button-BTnV4TZ7.cjs"),je=require("./useButtonProps-DJ51kDtM.cjs"),we=require("./popover-C64cn4Pd.cjs"),At=require("./Icon-B9hI3gal.cjs"),Vt="_verified_lvyh0_1",We={verified:Vt},Mt=()=>n.jsx("svg",{viewBox:"0 0 24 24","aria-label":"Verified account",role:"img",className:We.verified,children:n.jsx("g",{children:n.jsx("path",{d:"M22.25 12c0-1.43-.88-2.67-2.19-3.34.46-1.39.2-2.9-.81-3.91s-2.52-1.27-3.91-.81c-.66-1.31-1.91-2.19-3.34-2.19s-2.67.88-3.33 2.19c-1.4-.46-2.91-.2-3.92.81s-1.26 2.52-.8 3.91c-1.31.67-2.2 1.91-2.2 3.34s.89 2.67 2.2 3.34c-.46 1.39-.21 2.9.8 3.91s2.52 1.26 3.91.81c.67 1.31 1.91 2.19 3.34 2.19s2.68-.88 3.34-2.19c1.39.45 2.9.2 3.91-.81s1.27-2.52.81-3.91c1.31-.67 2.19-1.91 2.19-3.34zm-11.71 4.2L6.8 12.46l1.41-1.42 2.26 2.26 4.8-5.23 1.47 1.36-6.2 6.77z"})})}),Wt=()=>n.jsx("svg",{viewBox:"0 0 22 22","aria-label":"Verified account",role:"img",className:We.verified,children:n.jsxs("g",{children:[n.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"0-a",x1:"4.411",x2:"18.083",y1:"2.495",y2:"21.508",children:[n.jsx("stop",{offset:"0",stopColor:"#f4e72a"}),n.jsx("stop",{offset:".539",stopColor:"#cd8105"}),n.jsx("stop",{offset:".68",stopColor:"#cb7b00"}),n.jsx("stop",{offset:"1",stopColor:"#f4ec26"}),n.jsx("stop",{offset:"1",stopColor:"#f4e72a"})]}),n.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"0-b",x1:"5.355",x2:"16.361",y1:"3.395",y2:"19.133",children:[n.jsx("stop",{offset:"0",stopColor:"#f9e87f"}),n.jsx("stop",{offset:".406",stopColor:"#e2b719"}),n.jsx("stop",{offset:".989",stopColor:"#e2b719"})]}),n.jsxs("g",{clipRule:"evenodd",fillRule:"evenodd",children:[n.jsx("path",{d:"M13.324 3.848L11 1.6 8.676 3.848l-3.201-.453-.559 3.184L2.06 8.095 3.48 11l-1.42 2.904 2.856 1.516.559 3.184 3.201-.452L11 20.4l2.324-2.248 3.201.452.559-3.184 2.856-1.516L18.52 11l1.42-2.905-2.856-1.516-.559-3.184zm-7.09 7.575l3.428 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fill:"url(#0-a)"}),n.jsx("path",{d:"M13.101 4.533L11 2.5 8.899 4.533l-2.895-.41-.505 2.88-2.583 1.37L4.2 11l-1.284 2.627 2.583 1.37.505 2.88 2.895-.41L11 19.5l2.101-2.033 2.895.41.505-2.88 2.583-1.37L17.8 11l1.284-2.627-2.583-1.37-.505-2.88zm-6.868 6.89l3.429 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fill:"url(#0-b)"}),n.jsx("path",{d:"M6.233 11.423l3.429 3.428 5.65-6.17.038-.033-.005 1.398-5.683 6.206-3.429-3.429-.003-1.405.005.003z",fill:"#d18800"})]})]})}),Bt=()=>n.jsx("svg",{viewBox:"0 0 22 22","aria-label":"Verified account",role:"img",className:We.verified,children:n.jsx("g",{children:n.jsx("path",{clipRule:"evenodd",d:"M12.05 2.056c-.568-.608-1.532-.608-2.1 0l-1.393 1.49c-.284.303-.685.47-1.1.455L5.42 3.932c-.832-.028-1.514.654-1.486 1.486l.069 2.039c.014.415-.152.816-.456 1.1l-1.49 1.392c-.608.568-.608 1.533 0 2.101l1.49 1.393c.304.284.47.684.456 1.1l-.07 2.038c-.027.832.655 1.514 1.487 1.486l2.038-.069c.415-.014.816.152 1.1.455l1.392 1.49c.569.609 1.533.609 2.102 0l1.393-1.49c.283-.303.684-.47 1.099-.455l2.038.069c.832.028 1.515-.654 1.486-1.486L18 14.542c-.015-.415.152-.815.455-1.099l1.49-1.393c.608-.568.608-1.533 0-2.101l-1.49-1.393c-.303-.283-.47-.684-.455-1.1l.068-2.038c.029-.832-.654-1.514-1.486-1.486l-2.038.07c-.415.013-.816-.153-1.1-.456zm-5.817 9.367l3.429 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fillRule:"evenodd"})})}),Pt="_root_98iqw_1",Ft="_article_98iqw_21",et={root:Pt,article:Ft},Be=({className:e,children:t})=>n.jsx("div",{className:k.clsx("react-tweet-theme",et.root,e),children:n.jsx("article",{className:et.article,children:t})}),ht=e=>n.jsx("img",{...e}),Ut="_header_nqq4j_1",zt="_avatar_nqq4j_11",Ht="_avatarOverflow_nqq4j_16",Gt="_avatarSquare_nqq4j_23",Xt="_avatarShadow_nqq4j_26",Kt="_author_nqq4j_37",Qt="_authorLink_nqq4j_44",Jt="_authorVerified_nqq4j_53",Yt="_authorLinkText_nqq4j_56",Zt="_authorMeta_nqq4j_63",en="_authorFollow_nqq4j_66",tn="_username_nqq4j_69",nn="_follow_nqq4j_74",rn="_separator_nqq4j_82",sn="_brand_nqq4j_86",on="_twitterIcon_nqq4j_90",b={header:Ut,avatar:zt,avatarOverflow:Ht,avatarSquare:Gt,avatarShadow:Xt,author:Kt,authorLink:Qt,authorVerified:Jt,authorLinkText:Yt,authorMeta:Zt,authorFollow:en,username:tn,follow:nn,separator:rn,brand:sn,twitterIcon:on},an="_verifiedOld_lcna5_1",cn="_verifiedBlue_lcna5_4",ln="_verifiedGovernment_lcna5_7",ye={verifiedOld:an,verifiedBlue:cn,verifiedGovernment:ln},_t=({user:e,className:t})=>{const r=e.verified||e.is_blue_verified||e.verified_type;let s=n.jsx(Mt,{}),o=ye.verifiedBlue;if(r)switch(e.is_blue_verified||(o=ye.verifiedOld),e.verified_type){case"Government":s=n.jsx(Bt,{}),o=ye.verifiedGovernment;break;case"Business":s=n.jsx(Wt,{}),o=null;break}return r?n.jsx("div",{className:k.clsx(t,o),children:s}):null},dn=({tweet:e,components:t})=>{var r;const s=(r=t==null?void 0:t.AvatarImg)!=null?r:ht,{user:o}=e;return n.jsxs("div",{className:b.header,children:[n.jsxs("a",{href:e.url,className:b.avatar,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("div",{className:k.clsx(b.avatarOverflow,o.profile_image_shape==="Square"&&b.avatarSquare),children:n.jsx(s,{src:o.profile_image_url_https,alt:o.name,width:48,height:48})}),n.jsx("div",{className:b.avatarOverflow,children:n.jsx("div",{className:b.avatarShadow})})]}),n.jsxs("div",{className:b.author,children:[n.jsxs("a",{href:e.url,className:b.authorLink,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("div",{className:b.authorLinkText,children:n.jsx("span",{title:o.name,children:o.name})}),n.jsx(_t,{user:o,className:b.authorVerified})]}),n.jsxs("div",{className:b.authorMeta,children:[n.jsx("a",{href:e.url,className:b.username,target:"_blank",rel:"noopener noreferrer",children:n.jsxs("span",{title:`@${o.screen_name}`,children:["@",o.screen_name]})}),n.jsxs("div",{className:b.authorFollow,children:[n.jsx("span",{className:b.separator,children:"·"}),n.jsx("a",{href:o.follow_url,className:b.follow,target:"_blank",rel:"noopener noreferrer",children:"Follow"})]})]})]}),n.jsx("a",{href:e.url,className:b.brand,target:"_blank",rel:"noopener noreferrer","aria-label":"View on Twitter",children:n.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:b.twitterIcon,children:n.jsx("g",{children:n.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})})})]})},un="_root_1ec15_1",fn={root:un},hn=({tweet:e})=>n.jsxs("a",{href:e.in_reply_to_url,className:fn.root,target:"_blank",rel:"noopener noreferrer",children:["Replying to @",e.in_reply_to_screen_name]}),_n="_root_eihfa_1",pn={root:_n},mn=({href:e,children:t})=>n.jsx("a",{href:e,className:pn.root,target:"_blank",rel:"noopener noreferrer nofollow",children:t}),xn="_root_1xq52_1",vn={root:xn},gn=({tweet:e})=>n.jsx("p",{className:vn.root,lang:e.lang,dir:"auto",children:e.entities.map((t,r)=>{switch(t.type){case"hashtag":case"mention":case"url":case"symbol":return n.jsx(mn,{href:t.href,children:t.text},r);case"media":return;default:return n.jsx("span",{dangerouslySetInnerHTML:{__html:t.text}},r)}})}),tt=e=>`https://x.com/${e.user.screen_name}/status/${e.id_str}`,pt=e=>`https://x.com/${typeof e=="string"?e:e.user.screen_name}`,jn=e=>`https://x.com/intent/like?tweet_id=${e.id_str}`,wn=e=>`https://x.com/intent/tweet?in_reply_to=${e.id_str}`,yn=e=>`https://x.com/intent/follow?screen_name=${e.user.screen_name}`,Tn=e=>`https://x.com/hashtag/${e.text}`,bn=e=>`https://x.com/search?q=%24${e.text}`,Nn=e=>`https://x.com/${e.in_reply_to_screen_name}/status/${e.in_reply_to_status_id_str}`,mt=(e,t)=>{const r=new URL(e.media_url_https),s=r.pathname.split(".").pop();return s?(r.pathname=r.pathname.replace(`.${s}`,""),r.searchParams.set("format",s),r.searchParams.set("name",t),r.toString()):e.media_url_https},Rn=e=>{const{variants:t}=e.video_info;return t.filter(s=>s.content_type==="video/mp4").sort((s,o)=>{var a,i;return((a=o.bitrate)!=null?a:0)-((i=s.bitrate)!=null?i:0)})},Sn=e=>{const t=Rn(e);return t.length>1?t[1]:t[0]},Ce=e=>e>999999?`${(e/1e6).toFixed(1)}M`:e>999?`${(e/1e3).toFixed(1)}K`:e.toString();function nt(e){const t=Array.from(e.text),r=[{indices:e.display_text_range,type:"text"}];return ce(r,"hashtag",e.entities.hashtags),ce(r,"mention",e.entities.user_mentions),ce(r,"url",e.entities.urls),ce(r,"symbol",e.entities.symbols),e.entities.media&&ce(r,"media",e.entities.media),kn(e,r),r.map(s=>{const o=t.slice(s.indices[0],s.indices[1]).join("");switch(s.type){case"hashtag":return Object.assign(s,{href:Tn(s),text:o});case"mention":return Object.assign(s,{href:pt(s.screen_name),text:o});case"url":case"media":return Object.assign(s,{href:s.expanded_url,text:s.display_url});case"symbol":return Object.assign(s,{href:bn(s),text:o});default:return Object.assign(s,{text:o})}})}function ce(e,t,r){for(const s of r)for(const[o,a]of e.entries()){if(a.indices[0]>s.indices[0]||a.indices[1]<s.indices[1])continue;const i=[{...s,type:t}];a.indices[0]<s.indices[0]&&i.unshift({indices:[a.indices[0],s.indices[0]],type:"text"}),a.indices[1]>s.indices[1]&&i.push({indices:[s.indices[1],a.indices[1]],type:"text"}),e.splice(o,1,...i);break}}function kn(e,t){e.entities.media&&e.entities.media[0].indices[0]<e.display_text_range[1]&&(e.display_text_range[1]=e.entities.media[0].indices[0]);const r=t.at(-1);r&&r.indices[1]>e.display_text_range[1]&&(r.indices[1]=e.display_text_range[1])}const En=e=>({...e,url:tt(e),user:{...e.user,url:pt(e),follow_url:yn(e)},like_url:jn(e),reply_url:wn(e),in_reply_to_url:e.in_reply_to_screen_name?Nn(e):void 0,entities:nt(e),quoted_tweet:e.quoted_tweet?{...e.quoted_tweet,url:tt(e.quoted_tweet),entities:nt(e.quoted_tweet)}:void 0}),In="_root_g9tkv_1",Cn="_rounded_g9tkv_6",Ln="_mediaWrapper_g9tkv_10",On="_grid2Columns_g9tkv_17",qn="_grid3_g9tkv_20",Dn="_grid2x2_g9tkv_23",$n="_mediaContainer_g9tkv_26",An="_mediaLink_g9tkv_34",Vn="_skeleton_g9tkv_38",Mn="_image_g9tkv_43",C={root:In,rounded:Cn,mediaWrapper:Ln,grid2Columns:On,grid3:qn,grid2x2:Dn,mediaContainer:$n,mediaLink:An,skeleton:Vn,image:Mn},Wn="_anchor_fp31d_1",Bn="_videoButton_fp31d_17",Pn="_videoButtonIcon_fp31d_35",Fn="_watchOnTwitter_fp31d_44",Un="_viewReplies_fp31d_60",se={anchor:Wn,videoButton:Bn,videoButtonIcon:Pn,watchOnTwitter:Fn,viewReplies:Un},zn=({tweet:e,media:t})=>{const[r,s]=h.useState(!0),[o,a]=h.useState(!1),[i,c]=h.useState(!1),f=Sn(t);let d=0;return n.jsxs(n.Fragment,{children:[n.jsx("video",{className:C.image,poster:mt(t,"small"),controls:!r,playsInline:!0,preload:"none",tabIndex:r?-1:0,onPlay:()=>{d&&window.clearTimeout(d),o||a(!0),i&&c(!1)},onPause:()=>{d&&window.clearTimeout(d),d=window.setTimeout(()=>{o&&a(!1),d=0},100)},onEnded:()=>{c(!0)},children:n.jsx("source",{src:f.url,type:f.content_type})}),r&&n.jsx("button",{type:"button",className:se.videoButton,"aria-label":"View video on X",onClick:v=>{const p=v.currentTarget.previousSibling;v.preventDefault(),s(!1),p.load(),p.play().then(()=>{a(!0),p.focus()}).catch(w=>{console.error("Error playing video:",w),s(!0),a(!1)})},children:n.jsx("svg",{viewBox:"0 0 24 24",className:se.videoButtonIcon,"aria-hidden":"true",children:n.jsx("g",{children:n.jsx("path",{d:"M21 12L4 2v20l17-10z"})})})}),!o&&!i&&n.jsx("div",{className:se.watchOnTwitter,children:n.jsx("a",{href:e.url,className:se.anchor,target:"_blank",rel:"noopener noreferrer",children:r?"Watch on X":"Continue watching on X"})}),i&&n.jsx("a",{href:e.url,className:k.clsx(se.anchor,se.viewReplies),target:"_blank",rel:"noopener noreferrer",children:"View replies"})]})},Hn=e=>n.jsx("img",{...e}),rt=(e,t)=>{let r=56.25;return t===1&&(r=100/e.original_info.width*e.original_info.height),t===2&&(r=r*2),{width:e.type==="photo"?void 0:"unset",paddingBottom:`${r}%`}},xt=({tweet:e,components:t,quoted:r})=>{var s,o,a;const i=(a=(s=e.mediaDetails)==null?void 0:s.length)!=null?a:0;var c;const f=(c=t==null?void 0:t.MediaImg)!=null?c:Hn;return n.jsx("div",{className:k.clsx(C.root,!r&&C.rounded),children:n.jsx("div",{className:k.clsx(C.mediaWrapper,i>1&&C.grid2Columns,i===3&&C.grid3,i>4&&C.grid2x2),children:(o=e.mediaDetails)==null?void 0:o.map(d=>n.jsx(h.Fragment,{children:d.type==="photo"?n.jsxs("a",{href:e.url,className:k.clsx(C.mediaContainer,C.mediaLink),target:"_blank",rel:"noopener noreferrer",children:[n.jsx("div",{className:C.skeleton,style:rt(d,i)}),n.jsx(f,{src:mt(d,"small"),alt:d.ext_alt_text||"Image",className:C.image,draggable:!0})]},d.media_url_https):n.jsxs("div",{className:C.mediaContainer,children:[n.jsx("div",{className:C.skeleton,style:rt(d,i)}),n.jsx(zn,{tweet:e,media:d})]},d.media_url_https)},d.media_url_https))})})},Gn={hour:"numeric",minute:"2-digit",hour12:!0,weekday:"short",month:"short",day:"numeric",year:"numeric"},Xn=new Intl.DateTimeFormat("en-US",Gn),Kn=e=>{const t={};for(const r of e)t[r.type]=r.value;return t},Qn=e=>{const t=Kn(Xn.formatToParts(e)),r=`${t.hour}:${t.minute} ${t.dayPeriod}`,s=`${t.month} ${t.day}, ${t.year}`;return`${r} · ${s}`},Jn="_root_i24yn_1",Yn={root:Jn},Zn=({tweet:e})=>{const t=new Date(e.created_at),r=Qn(t);return n.jsx("a",{className:Yn.root,href:e.url,target:"_blank",rel:"noopener noreferrer","aria-label":r,children:n.jsx("time",{dateTime:t.toISOString(),children:r})})},er="_info_19qcj_1",tr="_infoLink_19qcj_10",nr="_infoIcon_19qcj_30",Te={info:er,infoLink:tr,infoIcon:nr},rr=({tweet:e})=>n.jsxs("div",{className:Te.info,children:[n.jsx(Zn,{tweet:e}),n.jsx("a",{className:Te.infoLink,href:"https://help.x.com/en/x-for-websites-ads-info-and-privacy",target:"_blank",rel:"noopener noreferrer","aria-label":"Twitter for Websites, Ads Information and Privacy",children:n.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:Te.infoIcon,children:n.jsx("g",{children:n.jsx("path",{d:"M13.5 8.5c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5S11.17 7 12 7s1.5.67 1.5 1.5zM13 17v-5h-2v5h2zm-1 5.25c5.66 0 10.25-4.59 10.25-10.25S17.66 1.75 12 1.75 1.75 6.34 1.75 12 6.34 22.25 12 22.25zM20.25 12c0 4.56-3.69 8.25-8.25 8.25S3.75 16.56 3.75 12 7.44 3.75 12 3.75s8.25 3.69 8.25 8.25z"})})})})]}),sr="_actions_n2anf_1",or="_like_n2anf_13",ir="_reply_n2anf_14",ar="_copy_n2anf_15",cr="_likeIconWrapper_n2anf_27",lr="_likeCount_n2anf_30",dr="_replyIconWrapper_n2anf_35",ur="_copyIconWrapper_n2anf_36",fr="_likeIcon_n2anf_27",hr="_replyIcon_n2anf_35",_r="_copyIcon_n2anf_36",pr="_replyText_n2anf_56",mr="_copyText_n2anf_57",E={actions:sr,like:or,reply:ir,copy:ar,likeIconWrapper:cr,likeCount:lr,replyIconWrapper:dr,copyIconWrapper:ur,likeIcon:fr,replyIcon:hr,copyIcon:_r,replyText:pr,copyText:mr},xr=({tweet:e})=>{const[t,r]=h.useState(!1),s=()=>{navigator.clipboard.writeText(e.url),r(!0)};return h.useEffect(()=>{if(t){const o=setTimeout(()=>{r(!1)},6e3);return()=>clearTimeout(o)}},[t]),n.jsxs("button",{type:"button",className:E.copy,"aria-label":"Copy link",onClick:s,children:[n.jsx("div",{className:E.copyIconWrapper,children:t?n.jsx("svg",{viewBox:"0 0 24 24",className:E.copyIcon,"aria-hidden":"true",children:n.jsx("g",{children:n.jsx("path",{d:"M9.64 18.952l-5.55-4.861 1.317-1.504 3.951 3.459 8.459-10.948L19.4 6.32 9.64 18.952z"})})}):n.jsx("svg",{viewBox:"0 0 24 24",className:E.copyIcon,"aria-hidden":"true",children:n.jsx("g",{children:n.jsx("path",{d:"M18.36 5.64c-1.95-1.96-5.11-1.96-7.07 0L9.88 7.05 8.46 5.64l1.42-1.42c2.73-2.73 7.16-2.73 9.9 0 2.73 2.74 2.73 7.17 0 9.9l-1.42 1.42-1.41-1.42 1.41-1.41c1.96-1.96 1.96-5.12 0-7.07zm-2.12 3.53l-7.07 7.07-1.41-1.41 7.07-7.07 1.41 1.41zm-12.02.71l1.42-1.42 1.41 1.42-1.41 1.41c-1.96 1.96-1.96 5.12 0 7.07 1.95 1.96 5.11 1.96 7.07 0l1.41-1.41 1.42 1.41-1.42 1.42c-2.73 2.73-7.16 2.73-9.9 0-2.73-2.74-2.73-7.17 0-9.9z"})})})}),n.jsx("span",{className:E.copyText,children:t?"Copied!":"Copy link"})]})},vr=({tweet:e})=>{const t=Ce(e.favorite_count);return n.jsxs("div",{className:E.actions,children:[n.jsxs("a",{className:E.like,href:e.like_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Like. This Tweet has ${t} likes`,children:[n.jsx("div",{className:E.likeIconWrapper,children:n.jsx("svg",{viewBox:"0 0 24 24",className:E.likeIcon,"aria-hidden":"true",children:n.jsx("g",{children:n.jsx("path",{d:"M20.884 13.19c-1.351 2.48-4.001 5.12-8.379 7.67l-.503.3-.504-.3c-4.379-2.55-7.029-5.19-8.382-7.67-1.36-2.5-1.41-4.86-.514-6.67.887-1.79 2.647-2.91 4.601-3.01 1.651-.09 3.368.56 4.798 2.01 1.429-1.45 3.146-2.1 4.796-2.01 1.954.1 3.714 1.22 4.601 3.01.896 1.81.846 4.17-.514 6.67z"})})})}),n.jsx("span",{className:E.likeCount,children:t})]}),n.jsxs("a",{className:E.reply,href:e.reply_url,target:"_blank",rel:"noopener noreferrer","aria-label":"Reply to this Tweet on Twitter",children:[n.jsx("div",{className:E.replyIconWrapper,children:n.jsx("svg",{viewBox:"0 0 24 24",className:E.replyIcon,"aria-hidden":"true",children:n.jsx("g",{children:n.jsx("path",{d:"M1.751 10c0-4.42 3.584-8 8.005-8h4.366c4.49 0 8.129 3.64 8.129 8.13 0 2.96-1.607 5.68-4.196 7.11l-8.054 4.46v-3.69h-.067c-4.49.1-8.183-3.51-8.183-8.01z"})})})}),n.jsx("span",{className:E.replyText,children:"Reply"})]}),n.jsx(xr,{tweet:e})]})},gr="_replies_1cutb_1",jr="_link_1cutb_4",wr="_text_1cutb_23",be={replies:gr,link:jr,text:wr},yr=({tweet:e})=>n.jsx("div",{className:be.replies,children:n.jsx("a",{className:be.link,href:e.url,target:"_blank",rel:"noopener noreferrer",children:n.jsx("span",{className:be.text,children:e.conversation_count===0?"Read more on X":e.conversation_count===1?`Read ${Ce(e.conversation_count)} reply`:`Read ${Ce(e.conversation_count)} replies`})})}),Tr="_root_q5799_1",br="_article_q5799_16",st={root:Tr,article:br},Nr=({tweet:e,children:t})=>n.jsx("div",{className:st.root,onClick:r=>{r.preventDefault(),window.open(e.url,"_blank")},children:n.jsx("article",{className:st.article,children:t})}),Rr="_header_r31i5_1",Sr="_avatar_r31i5_11",kr="_avatarSquare_r31i5_17",Er="_author_r31i5_21",Ir="_authorText_r31i5_26",Cr="_username_r31i5_33",K={header:Rr,avatar:Sr,avatarSquare:kr,author:Er,authorText:Ir,username:Cr},Lr=({tweet:e})=>{const{user:t}=e;return n.jsxs("div",{className:K.header,children:[n.jsx("a",{href:e.url,className:K.avatar,target:"_blank",rel:"noopener noreferrer",children:n.jsx("div",{className:k.clsx(K.avatarOverflow,t.profile_image_shape==="Square"&&K.avatarSquare),children:n.jsx(ht,{src:t.profile_image_url_https,alt:t.name,width:20,height:20})})}),n.jsxs("div",{className:K.author,children:[n.jsx("div",{className:K.authorText,children:n.jsx("span",{title:t.name,children:t.name})}),n.jsx(_t,{user:t}),n.jsx("div",{className:K.username,children:n.jsxs("span",{title:`@${t.screen_name}`,children:["@",t.screen_name]})})]})]})},Or="_root_175ot_1",qr={root:Or},Dr=({tweet:e})=>n.jsx("p",{className:qr.root,lang:e.lang,dir:"auto",children:e.entities.map((t,r)=>n.jsx("span",{dangerouslySetInnerHTML:{__html:t.text}},r))}),$r=({tweet:e})=>{var t;return n.jsxs(Nr,{tweet:e,children:[n.jsx(Lr,{tweet:e}),n.jsx(Dr,{tweet:e}),(t=e.mediaDetails)!=null&&t.length?n.jsx(xt,{quoted:!0,tweet:e}):null]})},Ar=({tweet:e,components:t})=>{var r;const s=h.useMemo(()=>En(e),[e]);return n.jsxs(Be,{children:[n.jsx(dn,{tweet:s,components:t}),s.in_reply_to_status_id_str&&n.jsx(hn,{tweet:s}),n.jsx(gn,{tweet:s}),(r=s.mediaDetails)!=null&&r.length?n.jsx(xt,{tweet:s,components:t}):null,s.quoted_tweet&&n.jsx($r,{tweet:s.quoted_tweet}),n.jsx(rr,{tweet:s}),n.jsx(vr,{tweet:s}),n.jsx(yr,{tweet:s})]})},Vr="_root_16yxa_1",Mr={root:Vr},Wr=e=>n.jsx(Be,{children:n.jsxs("div",{className:Mr.root,children:[n.jsx("h3",{children:"Tweet not found"}),n.jsx("p",{children:"The embedded tweet could not be found…"})]})}),Br="_skeleton_oi7hr_1",Pr={skeleton:Br},_e=({style:e})=>n.jsx("span",{className:Pr.skeleton,style:e}),Fr="_root_17qqv_1",Ur={root:Fr},zr=()=>n.jsxs(Be,{className:Ur.root,children:[n.jsx(_e,{style:{height:"3rem",marginBottom:"0.75rem"}}),n.jsx(_e,{style:{height:"6rem",margin:"0.5rem 0"}}),n.jsx("div",{style:{borderTop:"var(--tweet-border)",margin:"0.5rem 0"}}),n.jsx(_e,{style:{height:"2rem"}}),n.jsx(_e,{style:{height:"2rem",borderRadius:"9999px",marginTop:"0.5rem"}})]}),vt=0,gt=1,jt=2,ot=3;var it=Object.prototype.hasOwnProperty;function Le(e,t){var r,s;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((s=e.length)===t.length)for(;s--&&Le(e[s],t[s]););return s===-1}if(!r||typeof e=="object"){s=0;for(r in e)if(it.call(e,r)&&++s&&!it.call(t,r)||!(r in t)||!Le(e[r],t[r]))return!1;return Object.keys(t).length===s}}return e!==e&&t!==t}const F=new WeakMap,U=()=>{},R=U(),Oe=Object,u=e=>e===R,W=e=>typeof e=="function",z=(e,t)=>({...e,...t}),wt=e=>W(e.then),Ne={},pe={},Pe="undefined",le=typeof window!=Pe,qe=typeof document!=Pe,Hr=le&&"Deno"in window,Gr=()=>le&&typeof window.requestAnimationFrame!=Pe,yt=(e,t)=>{const r=F.get(e);return[()=>!u(t)&&e.get(t)||Ne,s=>{if(!u(t)){const o=e.get(t);t in pe||(pe[t]=o),r[5](t,z(o,s),o||Ne)}},r[6],()=>!u(t)&&t in pe?pe[t]:!u(t)&&e.get(t)||Ne]};let De=!0;const Xr=()=>De,[$e,Ae]=le&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[U,U],Kr=()=>{const e=qe&&document.visibilityState;return u(e)||e!=="hidden"},Qr=e=>(qe&&document.addEventListener("visibilitychange",e),$e("focus",e),()=>{qe&&document.removeEventListener("visibilitychange",e),Ae("focus",e)}),Jr=e=>{const t=()=>{De=!0,e()},r=()=>{De=!1};return $e("online",t),$e("offline",r),()=>{Ae("online",t),Ae("offline",r)}},Yr={isOnline:Xr,isVisible:Kr},Zr={initFocus:Qr,initReconnect:Jr},at=!h.useId,oe=!le||Hr,es=e=>Gr()?window.requestAnimationFrame(e):setTimeout(e,1),Re=oe?h.useEffect:h.useLayoutEffect,Se=typeof navigator<"u"&&navigator.connection,ct=!oe&&Se&&(["slow-2g","2g"].includes(Se.effectiveType)||Se.saveData),me=new WeakMap,ts=e=>Oe.prototype.toString.call(e),ke=(e,t)=>e===`[object ${t}]`;let ns=0;const Ve=e=>{const t=typeof e,r=ts(e),s=ke(r,"Date"),o=ke(r,"RegExp"),a=ke(r,"Object");let i,c;if(Oe(e)===e&&!s&&!o){if(i=me.get(e),i)return i;if(i=++ns+"~",me.set(e,i),Array.isArray(e)){for(i="@",c=0;c<e.length;c++)i+=Ve(e[c])+",";me.set(e,i)}if(a){i="#";const f=Oe.keys(e).sort();for(;!u(c=f.pop());)u(e[c])||(i+=c+":"+Ve(e[c])+",");me.set(e,i)}}else i=s?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return i},Fe=e=>{if(W(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Ve(e):"",[e,t]};let rs=0;const Me=()=>++rs;async function Tt(...e){const[t,r,s,o]=e,a=z({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let i=a.populateCache;const c=a.rollbackOnError;let f=a.optimisticData;const d=w=>typeof c=="function"?c(w):c!==!1,v=a.throwOnError;if(W(r)){const w=r,N=[],I=t.keys();for(const O of I)!/^\$(inf|sub)\$/.test(O)&&w(t.get(O)._k)&&N.push(O);return Promise.all(N.map(p))}return p(r);async function p(w){const[N]=Fe(w);if(!N)return;const[I,O]=yt(t,N),[$,ie,l,de]=F.get(t),Q=()=>{const q=$[N];return(W(a.revalidate)?a.revalidate(I().data,w):a.revalidate!==!1)&&(delete l[N],delete de[N],q&&q[0])?q[0](jt).then(()=>I().data):I().data};if(e.length<3)return Q();let y=s,A,V=!1;const J=Me();ie[N]=[J,0];const m=!u(f),Y=I(),M=Y.data,Z=Y._c,H=u(Z)?M:Z;if(m&&(f=W(f)?f(H,M):f,O({data:f,_c:H})),W(y))try{y=y(H)}catch(q){A=q,V=!0}if(y&&wt(y))if(y=await y.catch(q=>{A=q,V=!0}),J!==ie[N][0]){if(V)throw A;return y}else V&&m&&d(A)&&(i=!0,O({data:H,_c:R}));if(i&&!V)if(W(i)){const q=i(y,H);O({data:q,error:R,_c:R})}else O({data:y,error:R,_c:R});if(ie[N][1]=Me(),Promise.resolve(Q()).then(()=>{O({_c:R})}),V){if(v)throw A;return}return y}}const lt=(e,t)=>{for(const r in e)e[r][0]&&e[r][0](t)},ss=(e,t)=>{if(!F.has(e)){const r=z(Zr,t),s=Object.create(null),o=Tt.bind(R,e);let a=U;const i=Object.create(null),c=(v,p)=>{const w=i[v]||[];return i[v]=w,w.push(p),()=>w.splice(w.indexOf(p),1)},f=(v,p,w)=>{e.set(v,p);const N=i[v];if(N)for(const I of N)I(p,w)},d=()=>{if(!F.has(e)&&(F.set(e,[s,Object.create(null),Object.create(null),Object.create(null),o,f,c]),!oe)){const v=r.initFocus(setTimeout.bind(R,lt.bind(R,s,vt))),p=r.initReconnect(setTimeout.bind(R,lt.bind(R,s,gt)));a=()=>{v&&v(),p&&p(),F.delete(e)}}};return d(),[e,o,d,a]}return[e,F.get(e)[4]]},os=(e,t,r,s,o)=>{const a=r.errorRetryCount,i=o.retryCount,c=~~((Math.random()+.5)*(1<<(i<8?i:8)))*r.errorRetryInterval;!u(a)&&i>a||setTimeout(s,c,o)},is=Le,[bt,as]=ss(new Map),cs=z({onLoadingSlow:U,onSuccess:U,onError:U,onErrorRetry:os,onDiscarded:U,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:ct?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:ct?5e3:3e3,compare:is,isPaused:()=>!1,cache:bt,mutate:as,fallback:{}},Yr),ls=(e,t)=>{const r=z(e,t);if(t){const{use:s,fallback:o}=e,{use:a,fallback:i}=t;s&&a&&(r.use=s.concat(a)),o&&i&&(r.fallback=z(o,i))}return r},ds=h.createContext({}),us="$inf$",Nt=le&&window.__SWR_DEVTOOLS_USE__,fs=Nt?window.__SWR_DEVTOOLS_USE__:[],hs=()=>{Nt&&(window.__SWR_DEVTOOLS_REACT__=h)},_s=e=>W(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],ps=()=>{const e=h.useContext(ds);return h.useMemo(()=>z(cs,e),[e])},ms=e=>(t,r,s)=>e(t,r&&((...a)=>{const[i]=Fe(t),[,,,c]=F.get(bt);if(i.startsWith(us))return r(...a);const f=c[i];return u(f)?r(...a):(delete c[i],f)}),s),xs=fs.concat(ms),vs=e=>function(...r){const s=ps(),[o,a,i]=_s(r),c=ls(s,i);let f=e;const{use:d}=c,v=(d||[]).concat(xs);for(let p=v.length;p--;)f=v[p](f);return f(o,a||c.fetcher||null,c)},gs=(e,t,r)=>{const s=t[e]||(t[e]=[]);return s.push(r),()=>{const o=s.indexOf(r);o>=0&&(s[o]=s[s.length-1],s.pop())}};hs();const Ee=h.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),Ie={dedupe:!0},dt=Promise.resolve(R),js=(e,t,r)=>{const{cache:s,compare:o,suspense:a,fallbackData:i,revalidateOnMount:c,revalidateIfStale:f,refreshInterval:d,refreshWhenHidden:v,refreshWhenOffline:p,keepPreviousData:w,strictServerPrefetchWarning:N}=r,[I,O,$,ie]=F.get(s),[l,de]=Fe(e),Q=h.useRef(!1),y=h.useRef(!1),A=h.useRef(l),V=h.useRef(t),J=h.useRef(r),m=()=>J.current,Y=()=>m().isVisible()&&m().isOnline(),[M,Z,H,q]=yt(s,l),ee=h.useRef({}).current,ue=u(i)?u(r.fallback)?R:r.fallback[l]:i,ze=(_,x)=>{for(const j in ee){const g=j;if(g==="data"){if(!o(_[g],x[g])&&(!u(_[g])||!o(he,x[g])))return!1}else if(x[g]!==_[g])return!1}return!0},He=h.useMemo(()=>{const _=!l||!t?!1:u(c)?m().isPaused()||a?!1:f!==!1:c,x=S=>{const B=z(S);return delete B._k,_?{isValidating:!0,isLoading:!0,...B}:B},j=M(),g=q(),D=x(j),re=j===g?D:x(g);let T=D;return[()=>{const S=x(M());return ze(S,T)?(T.data=S.data,T.isLoading=S.isLoading,T.isValidating=S.isValidating,T.error=S.error,T):(T=S,S)},()=>re]},[s,l]),te=k.shimExports.useSyncExternalStore(h.useCallback(_=>H(l,(x,j)=>{ze(j,x)||_()}),[s,l]),He[0],He[1]),Ge=!Q.current,St=I[l]&&I[l].length>0,ne=te.data,G=u(ne)?ue&&wt(ue)?Ee(ue):ue:ne,fe=te.error,xe=h.useRef(G),he=w?u(ne)?u(xe.current)?G:xe.current:ne:G,X=l&&u(G),kt=!oe&&k.shimExports.useSyncExternalStore(()=>U,()=>!1,()=>!0);N&&kt&&!a&&X&&console.warn(`Missing pre-initiated data for serialized key "${l}" during server-side rendering. Data fethcing should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const Xe=St&&!u(fe)?!1:Ge&&!u(c)?c:m().isPaused()?!1:a?u(G)?!1:f:u(G)||f,Ke=!!(l&&t&&Ge&&Xe),Et=u(te.isValidating)?Ke:te.isValidating,It=u(te.isLoading)?Ke:te.isLoading,ae=h.useCallback(async _=>{const x=V.current;if(!l||!x||y.current||m().isPaused())return!1;let j,g,D=!0;const re=_||{},T=!$[l]||!re.dedupe,S=()=>at?!y.current&&l===A.current&&Q.current:l===A.current,B={isValidating:!1,isLoading:!1},Je=()=>{Z(B)},Ye=()=>{const L=$[l];L&&L[1]===g&&delete $[l]},Ze={isValidating:!0};u(M().data)&&(Ze.isLoading=!0);try{if(T&&(Z(Ze),r.loadingTimeout&&u(M().data)&&setTimeout(()=>{D&&S()&&m().onLoadingSlow(l,r)},r.loadingTimeout),$[l]=[x(de),Me()]),[j,g]=$[l],j=await j,T&&setTimeout(Ye,r.dedupingInterval),!$[l]||$[l][1]!==g)return T&&S()&&m().onDiscarded(l),!1;B.error=R;const L=O[l];if(!u(L)&&(g<=L[0]||g<=L[1]||L[1]===0))return Je(),T&&S()&&m().onDiscarded(l),!1;const P=M().data;B.data=o(P,j)?P:j,T&&S()&&m().onSuccess(j,l,r)}catch(L){Ye();const P=m(),{shouldRetryOnError:ve}=P;P.isPaused()||(B.error=L,T&&S()&&(P.onError(L,l,P),(ve===!0||W(ve)&&ve(L))&&(!m().revalidateOnFocus||!m().revalidateOnReconnect||Y())&&P.onErrorRetry(L,l,P,Ct=>{const ge=I[l];ge&&ge[0]&&ge[0](ot,Ct)},{retryCount:(re.retryCount||0)+1,dedupe:!0})))}return D=!1,Je(),!0},[l,s]),Qe=h.useCallback((..._)=>Tt(s,A.current,..._),[]);if(Re(()=>{V.current=t,J.current=r,u(ne)||(xe.current=ne)}),Re(()=>{if(!l)return;const _=ae.bind(R,Ie);let x=0;m().revalidateOnFocus&&(x=Date.now()+m().focusThrottleInterval);const g=gs(l,I,(D,re={})=>{if(D==vt){const T=Date.now();m().revalidateOnFocus&&T>x&&Y()&&(x=T+m().focusThrottleInterval,_())}else if(D==gt)m().revalidateOnReconnect&&Y()&&_();else{if(D==jt)return ae();if(D==ot)return ae(re)}});return y.current=!1,A.current=l,Q.current=!0,Z({_k:de}),Xe&&($[l]||(u(G)||oe?_():es(_))),()=>{y.current=!0,g()}},[l]),Re(()=>{let _;function x(){const g=W(d)?d(M().data):d;g&&_!==-1&&(_=setTimeout(j,g))}function j(){!M().error&&(v||m().isVisible())&&(p||m().isOnline())?ae(Ie).then(x):x()}return x(),()=>{_&&(clearTimeout(_),_=-1)}},[d,v,p,l]),h.useDebugValue(he),a){if(!at&&oe&&X)throw new Error("Fallback data is required when using Suspense in SSR.");X&&(V.current=t,J.current=r,y.current=!1);const _=ie[l],x=!u(_)&&X?Qe(_):dt;if(Ee(x),!u(fe)&&X)throw fe;const j=X?ae(Ie):dt;!u(he)&&X&&(j.status="fulfilled",j.value=!0),Ee(j)}return{mutate:Qe,get data(){return ee.data=!0,he},get error(){return ee.error=!0,fe},get isValidating(){return ee.isValidating=!0,Et},get isLoading(){return ee.isLoading=!0,It}}},ut=vs(js);class ws extends Error{constructor({message:t,status:r,data:s}){super(t),this.name="TwitterApiError",this.status=r,this.data=s}}const ys=ut.default||ut,Ts="https://react-tweet.vercel.app";async function bs([e,t]){const r=await fetch(e,t),s=await r.json();if(r.ok)return s.data||null;throw new ws({message:`Failed to fetch tweet at "${e}" with "${r.status}".`,data:s,status:r.status})}const Ns=(e,t,r)=>{const{isLoading:s,data:o,error:a}=ys(()=>t||e?[t||e&&`${Ts}/api/tweet/${e}`,r]:null,bs,{revalidateIfStale:!1,revalidateOnFocus:!1,shouldRetryOnError:!1});return{isLoading:!!(s||o===void 0&&!a),data:o,error:a}},Rs=({id:e,apiUrl:t,fallback:r=n.jsx(zr,{}),components:s,fetchOptions:o,onError:a})=>{const{data:i,error:c,isLoading:f}=Ns(e,t,o);if(f)return r;if(c||!i){const d=(s==null?void 0:s.TweetNotFound)||Wr;return n.jsx(d,{error:a?a(c):c})}return n.jsx(Ar,{tweet:i,components:s})};function Ss({node:e}){var s;const t=((s=e==null?void 0:e.attrs)==null?void 0:s.src)||"",r=t==null?void 0:t.split("/").pop();return r?n.jsx(k.NodeViewWrapper,{children:n.jsx("div",{"data-twitter":"",children:n.jsx(Rs,{id:r})})}):null}function Rt(e){const{t}=Ot.useLocale(),[r,s]=h.useState("");h.useEffect(()=>{var a;if(e!=null&&e.editor){const{src:i}=(a=e.editor)==null?void 0:a.getAttributes(Ue.name);i&&s(i)}},[e==null?void 0:e.editor]);function o(a){a.preventDefault(),a.stopPropagation(),e==null||e.onSetLink(r)}return n.jsxs("form",{className:"richtext-flex richtext-flex-col richtext-gap-2",onSubmit:o,children:[n.jsx(qt.Label,{className:"mb-[6px]",children:t("editor.link.dialog.text")}),n.jsx("div",{className:"richtext-mb-[10px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:n.jsx("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center",children:n.jsx(Dt.Input,{className:"richtext-w-80",onChange:a=>s(a.target.value),placeholder:"Text",required:!0,type:"text",value:r})})}),n.jsx($t.Button,{className:"richtext-mt-2 richtext-self-end",type:"submit",children:t("editor.link.dialog.button.apply")})]})}function ks(){const[e,t]=h.useState(!1),r=je.useEditorInstance(),s=je.useButtonProps(Ue.name),{icon:o=void 0,tooltip:a=void 0,tooltipOptions:i={},action:c=void 0,isActive:f=void 0}=(s==null?void 0:s.componentProps)??{},{editorDisabled:d}=je.useToggleActive(f);function v(p){d||c&&(c(p),t(!1))}return n.jsxs(we.Popover,{modal:!0,onOpenChange:t,open:e,children:[n.jsx(we.PopoverTrigger,{asChild:!0,children:n.jsx(Lt.ActionButton,{disabled:d,isActive:f,tooltip:a,tooltipOptions:i,children:n.jsx(At.IconComponent,{name:o})})}),n.jsx(we.PopoverContent,{align:"start",className:"richtext-w-full",hideWhenDetached:!0,side:"bottom",children:n.jsx(Rt,{editor:r,onSetLink:v})})]})}const Es=/(https?:\/\/)?(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?/g,Is=/^https?:\/\/(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?$/;function ft(e){return e.match(Is)}const Ue=k.Node3.create({name:"twitter",draggable:!0,selectable:!0,addOptions(){return{addPasteHandler:!0,HTMLAttributes:{},inline:!1,origin:"",button:({editor:e,t})=>({componentProps:{action:r=>{e.commands.setTweet({src:r})},isActive:()=>!1,disabled:!1,icon:"Twitter",tooltip:t("editor.twitter.tooltip"),editor:e}})}},addNodeView(){return k.ReactNodeViewRenderer(Ss,{attrs:this.options.HTMLAttributes})},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addAttributes(){return{src:{default:null}}},parseHTML(){return[{tag:"div[data-twitter]"}]},addCommands(){return{setTweet:e=>({commands:t})=>ft(e.src)?t.insertContent({type:this.name,attrs:e}):!1,updateTweet:e=>({commands:t})=>ft(e.src)?t.updateAttributes(this.name,{src:e.src}):!1}},addPasteRules(){return this.options.addPasteHandler?[k.nodePasteRule({find:Es,type:this.type,getAttributes:e=>({src:e.input})})]:[]},renderHTML({HTMLAttributes:e}){return["div",k.mergeAttributes({"data-twitter":""},e)]}});exports.FormEditLinkTwitter=Rt;exports.RichTextTwitter=ks;exports.Twitter=Ue;
package/lib/Twitter.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-RfTlOzIr.cjs");require("./index-BH4bc3jN.cjs");const e=require("./Twitter-CtVTIWJW.cjs");exports.RichTextTwitter=e.RichTextTwitter;exports.Twitter=e.Twitter;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-DLqogznp.cjs");const t=require("./Twitter-DJ6JzZPJ.cjs");exports.RichTextTwitter=t.RichTextTwitter;exports.Twitter=t.Twitter;
package/lib/Twitter.js CHANGED
@@ -1,7 +1,6 @@
1
- import "./index-DnWWK9F_.js";
2
- import "./index-DzcKxutn.js";
3
- import { R as o, T } from "./Twitter-CXmmjz9R.js";
1
+ import "./index-nFjllrEl.js";
2
+ import { R as i, T } from "./Twitter-B3n8vc45.js";
4
3
  export {
5
- o as RichTextTwitter,
4
+ i as RichTextTwitter,
6
5
  T as Twitter
7
6
  };
package/lib/Video.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("./index-RfTlOzIr.cjs"),b=require("./index-Dfmm6FTT.cjs"),x=require("./useButtonProps-C6Vpn190.cjs"),o=require("react/jsx-runtime"),d=require("react"),$=require("./toggle-D41PzQLJ.cjs"),E=require("./index-DV5kbgRU.cjs"),g=require("./dialog-CaCS-W5S.cjs"),u=require("./tabs-BoLCMcCI.cjs"),D=require("./button-B12K7BJ4.cjs"),I=require("./input-_ECRfn3Y.cjs");function R(e,t){let s;try{s=new URL(e)}catch{return!1}return!(t!=null&&t.length)||t.length===1&&t[0]==="."?!0:t.some(n=>{if(n.includes("*")){const l=n.replace(/\./g,"\\.").replace(/\*/g,".*");return new RegExp(`^${l}$`).test(s.hostname)}return s.hostname.includes(n)})}function H(){const{t:e}=b.useLocale(),t=E.useEditorInstance(),s=x.useButtonProps(V.name),{icon:n,tooltip:l}=(s==null?void 0:s.componentProps)??{},{editorDisabled:c}=x.useToggleActive(),[p,w]=d.useState(""),y=d.useRef(null),[j,f]=d.useState(""),[L,h]=d.useState(!1),m=x.useExtension(V.name),k=r=>{h(r.detail)};d.useEffect(()=>{const r=b.listenEvent(b.EVENTS.UPLOAD_VIDEO(t.id),k);return()=>{r()}},[t]);const i=d.useMemo(()=>(m==null?void 0:m.options)??{},[m]);async function C(r){var M;const a=(M=r==null?void 0:r.target)==null?void 0:M.files;if(!t||t.isDestroyed||a.length===0)return;const v=a[0];let T="";i.upload?T=await i.upload(v):T=URL.createObjectURL(v),t.chain().focus().setVideo({src:T,width:"100%"}).run(),h(!1)}function A(r){r.preventDefault(),r.stopPropagation(),p&&(t.chain().focus().setVideo({src:p,width:"100%"}).run(),h(!1),w(""))}function S(r){var a;r.preventDefault(),(a=y.current)==null||a.click()}return o.jsxs(g.Dialog,{onOpenChange:h,open:L,children:[o.jsx(g.DialogTrigger,{asChild:!0,children:o.jsx($.ActionButton,{action:()=>{c||h(!0)},icon:n,tooltip:l,disabled:c})}),o.jsxs(g.DialogContent,{children:[o.jsx(g.DialogTitle,{children:e("editor.video.dialog.title")}),o.jsxs(u.Tabs,{activationMode:"manual",defaultValue:(i==null?void 0:i.resourceVideo)==="both"||(i==null?void 0:i.resourceVideo)==="upload"?"upload":"link",children:[o.jsxs(u.TabsList,{className:"richtext-grid richtext-w-full richtext-grid-cols-2",children:[((i==null?void 0:i.resourceVideo)==="both"||(i==null?void 0:i.resourceVideo)==="upload")&&o.jsx(u.TabsTrigger,{value:"upload",children:e("editor.video.dialog.tab.upload")}),((i==null?void 0:i.resourceVideo)==="both"||(i==null?void 0:i.resourceVideo)==="link")&&o.jsx(u.TabsTrigger,{value:"link",children:e("editor.video.dialog.link")})]}),o.jsxs(u.TabsContent,{value:"upload",children:[o.jsx("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:o.jsx(D.Button,{className:"richtext-mt-1 richtext-w-full",onClick:S,size:"sm",children:e("editor.video.dialog.tab.upload")})}),o.jsx("input",{accept:"video/*",multiple:!0,onChange:C,ref:y,type:"file",style:{display:"none"}})]}),o.jsxs(u.TabsContent,{value:"link",children:[o.jsx("div",{children:o.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2",children:[o.jsx(I.Input,{autoFocus:!0,placeholder:e("editor.video.dialog.placeholder"),required:!0,type:"url",value:p,onChange:r=>{w(r.target.value)},onBlur:r=>{const a=r.target.value,v=i.videoProviders||["."];a&&!R(a,v)?f("Invalid video URL"):f("")}}),o.jsx(D.Button,{type:"button",onClick:A,children:e("editor.video.dialog.button.apply")})]})}),j&&o.jsx("div",{className:"richtext-my-[5px] richtext-text-red-500",children:j})]})]})]})]})}function B(e){e=e.replace("https://youtu.be/","https://www.youtube.com/watch?v=").replace("watch?v=","embed/");const t=e.match(/^https:\/\/www\.youtube\.com\/shorts\/([a-zA-Z0-9_-]+)/);t&&(e=`https://www.youtube.com/embed/${t[1]}`);const s=e.match(/^https:\/\/vimeo\.com\/(\d+)(?:\/([a-zA-Z0-9]+))?/);if(s){const l=s[1],c=s[2];c?e=`https://player.vimeo.com/video/${l}?h=${c}`:e=`https://player.vimeo.com/video/${l}`}return/^https?:\/\/www.bilibili.com\/video\/.*/i.test(e)&&(e=e.replace(/\?.*$/,"").replace("https://www.bilibili.com/video/","https://player.bilibili.com/player.html?bvid=")),e.includes("drive.google.com")&&(e=e.replace("/view","/preview")),e}const V=q.Node3.create({name:"video",group:"block",atom:!0,draggable:!0,addOptions(){return{divider:!1,spacer:!1,allowFullscreen:!0,upload:void 0,frameborder:!1,resourceVideo:"both",width:b.VIDEO_SIZE["size-medium"],HTMLAttributes:{class:"iframe-wrapper"},button:({editor:e,t})=>{var s,n;return{componentProps:{action:()=>{},isActive:()=>e.isActive("video")||!1,disabled:!((n=(s=e.can()).setVideo)!=null&&n.call(s,{})),icon:"Video",tooltip:t("editor.video.tooltip"),videoProviders:["."],editor:e}}}}},addAttributes(){return{src:{default:null,renderHTML:({src:e})=>({src:e?B(e):null})},width:{default:this.options.width,renderHTML:({width:e})=>({width:x.getCssUnitWithDefault(e)})},frameborder:{default:this.options.frameborder?1:0,parseHTML:()=>this.options.frameborder?1:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen},align:{default:"center",renderHTML:({align:e})=>({align:e})}}},parseHTML(){return[{tag:"div[data-video] iframe"}]},renderHTML({HTMLAttributes:e}){const{width:t="100%",align:s="center"}=e??{},n={...e,width:"100%",height:"100%"},l=`position: relative;overflow: hidden;display: flex;flex: 1;max-width: ${t};`,c=`flex: 1;padding-bottom: ${9/16*100}%;`,f=["div",{style:`display: flex; justify-content: ${s};`},["div",{style:l},["div",{style:c}],["iframe",n]]];return["div",{...this.options.HTMLAttributes,class:"iframe-wrapper","data-video":""},f]},addCommands(){return{setVideo:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e}),updateVideo:e=>({commands:t})=>t.updateAttributes(this.name,e)}}});exports.RichTextVideo=H;exports.Video=V;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("./index-DLqogznp.cjs"),k=require("./index-B0fWAhpK.cjs"),p=require("./useButtonProps-DJ51kDtM.cjs"),o=require("react/jsx-runtime"),d=require("react"),I=require("./toggle-BWfca8kh.cjs");require("./index-DM3mpxB-.cjs");const b=require("./dialog-DXF2Q8LZ.cjs"),M=require("./events.constant-B-VGURJp.cjs"),u=require("./tabs-DebGjFBg.cjs"),D=require("./button-BTnV4TZ7.cjs"),$=require("./input-CadAYBdT.cjs");function R(e,t){let s;try{s=new URL(e)}catch{return!1}return!(t!=null&&t.length)||t.length===1&&t[0]==="."?!0:t.some(n=>{if(n.includes("*")){const l=n.replace(/\./g,String.raw`\.`).replace(/\*/g,".*");return new RegExp(`^${l}$`).test(s.hostname)}return s.hostname.includes(n)})}function H(){const{t:e}=k.useLocale(),t=p.useEditorInstance(),s=p.useButtonProps(T.name),{icon:n,tooltip:l}=(s==null?void 0:s.componentProps)??{},{editorDisabled:c}=p.useToggleActive(),[f,x]=d.useState(""),w=d.useRef(null),[y,m]=d.useState(""),[V,h]=d.useState(!1),v=p.useExtension(T.name),C=r=>{h(r.detail)};d.useEffect(()=>{const r=M.listenEvent(M.EVENTS.UPLOAD_VIDEO(t.id),C);return()=>{r()}},[t]);const i=d.useMemo(()=>(v==null?void 0:v.options)??{},[v]);async function S(r){var L;const a=(L=r==null?void 0:r.target)==null?void 0:L.files;if(!t||t.isDestroyed||a.length===0)return;const g=a[0];let j="";i.upload?j=await i.upload(g):j=URL.createObjectURL(g),t.chain().focus().setVideo({src:j,width:"100%"}).run(),h(!1)}function q(r){r.preventDefault(),r.stopPropagation(),f&&(t.chain().focus().setVideo({src:f,width:"100%"}).run(),h(!1),x(""))}function A(r){var a;r.preventDefault(),(a=w.current)==null||a.click()}return o.jsxs(b.Dialog,{onOpenChange:h,open:V,children:[o.jsx(b.DialogTrigger,{asChild:!0,children:o.jsx(I.ActionButton,{disabled:c,icon:n,tooltip:l,action:()=>{c||h(!0)}})}),o.jsxs(b.DialogContent,{children:[o.jsx(b.DialogTitle,{children:e("editor.video.dialog.title")}),o.jsxs(u.Tabs,{activationMode:"manual",defaultValue:(i==null?void 0:i.resourceVideo)==="both"||(i==null?void 0:i.resourceVideo)==="upload"?"upload":"link",children:[o.jsxs(u.TabsList,{className:"richtext-grid richtext-w-full richtext-grid-cols-2",children:[((i==null?void 0:i.resourceVideo)==="both"||(i==null?void 0:i.resourceVideo)==="upload")&&o.jsx(u.TabsTrigger,{value:"upload",children:e("editor.video.dialog.tab.upload")}),((i==null?void 0:i.resourceVideo)==="both"||(i==null?void 0:i.resourceVideo)==="link")&&o.jsx(u.TabsTrigger,{value:"link",children:e("editor.video.dialog.link")})]}),o.jsxs(u.TabsContent,{value:"upload",children:[o.jsx("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:o.jsx(D.Button,{className:"richtext-mt-1 richtext-w-full",onClick:A,size:"sm",children:e("editor.video.dialog.tab.upload")})}),o.jsx("input",{accept:"video/*",multiple:!0,onChange:S,ref:w,type:"file",style:{display:"none"}})]}),o.jsxs(u.TabsContent,{value:"link",children:[o.jsx("div",{children:o.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2",children:[o.jsx($.Input,{autoFocus:!0,placeholder:e("editor.video.dialog.placeholder"),required:!0,type:"url",value:f,onBlur:r=>{const a=r.target.value,g=i.videoProviders||["."];a&&!R(a,g)?m("Invalid video URL"):m("")},onChange:r=>{x(r.target.value)}}),o.jsx(D.Button,{onClick:q,type:"button",children:e("editor.video.dialog.button.apply")})]})}),y&&o.jsx("div",{className:"richtext-my-[5px] richtext-text-red-500",children:y})]})]})]})]})}function B(e){e=e.replace("https://youtu.be/","https://www.youtube.com/watch?v=").replace("watch?v=","embed/");const t=e.match(/^https:\/\/www\.youtube\.com\/shorts\/([a-zA-Z0-9_-]+)/);t&&(e=`https://www.youtube.com/embed/${t[1]}`);const s=e.match(/^https:\/\/vimeo\.com\/(\d+)(?:\/([a-zA-Z0-9]+))?/);if(s){const l=s[1],c=s[2];c?e=`https://player.vimeo.com/video/${l}?h=${c}`:e=`https://player.vimeo.com/video/${l}`}return/^https?:\/\/www.bilibili.com\/video\/.*/i.test(e)&&(e=e.replace(/\?.*$/,"").replace("https://www.bilibili.com/video/","https://player.bilibili.com/player.html?bvid=")),e.includes("drive.google.com")&&(e=e.replace("/view","/preview")),e}const T=E.Node3.create({name:"video",group:"block",atom:!0,draggable:!0,addOptions(){return{divider:!1,spacer:!1,allowFullscreen:!0,upload:void 0,frameborder:!1,resourceVideo:"both",width:k.VIDEO_SIZE["size-medium"],HTMLAttributes:{class:"iframe-wrapper"},button:({editor:e,t})=>{var s,n;return{componentProps:{action:()=>{},isActive:()=>e.isActive("video")||!1,disabled:!((n=(s=e.can()).setVideo)!=null&&n.call(s,{})),icon:"Video",tooltip:t("editor.video.tooltip"),videoProviders:["."],editor:e}}}}},addAttributes(){return{src:{default:null,renderHTML:({src:e})=>({src:e?B(e):null})},width:{default:this.options.width,renderHTML:({width:e})=>({width:p.getCssUnitWithDefault(e)})},frameborder:{default:this.options.frameborder?1:0,parseHTML:()=>this.options.frameborder?1:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen},align:{default:"center",renderHTML:({align:e})=>({align:e})}}},parseHTML(){return[{tag:"div[data-video] iframe"}]},renderHTML({HTMLAttributes:e}){const{width:t="100%",align:s="center"}=e??{},n={...e,width:"100%",height:"100%"},l=`position: relative;overflow: hidden;display: flex;flex: 1;max-width: ${t};`,c=`flex: 1;padding-bottom: ${9/16*100}%;`,m=["div",{style:`display: flex; justify-content: ${s};`},["div",{style:l},["div",{style:c}],["iframe",n]]];return["div",{...this.options.HTMLAttributes,class:"iframe-wrapper","data-video":""},m]},addCommands(){return{setVideo:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e}),updateVideo:e=>({commands:t})=>t.updateAttributes(this.name,e)}}});exports.RichTextVideo=H;exports.Video=T;