@notectl/core 2.4.0 → 2.4.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 (485) hide show
  1. package/README.md +1 -1
  2. package/dist/chunks/AlignmentPlugin-Cp7HYGaH.mjs.map +1 -1
  3. package/dist/chunks/AttrRegistry-Di936wMv.mjs.map +1 -1
  4. package/dist/chunks/AttributedMarkCommands-DKHuhZA7.mjs.map +1 -1
  5. package/dist/chunks/BidiIsolationPlugin-GWukKdgJ.mjs.map +1 -1
  6. package/dist/chunks/BlockAlignment-BqyBQ4uV.mjs.map +1 -1
  7. package/dist/chunks/BlockInsertion-CXfXqUZl.mjs +2 -0
  8. package/dist/chunks/BlockInsertion-CXfXqUZl.mjs.map +1 -0
  9. package/dist/chunks/BlockTypePickerRegistry-BTET9jM-.mjs.map +1 -1
  10. package/dist/chunks/BlockquotePlugin-CSL_7Yit.mjs.map +1 -1
  11. package/dist/chunks/CSSValueEquivalence-DeyUKPQ7.mjs.map +1 -1
  12. package/dist/chunks/{CaretNavigationPlugin-BxWjR7SN.mjs → CaretNavigationPlugin-BQPqqK4n.mjs} +2 -2
  13. package/dist/chunks/CaretNavigationPlugin-BQPqqK4n.mjs.map +1 -0
  14. package/dist/chunks/CodeBlockPlugin-B4AcDJRK.mjs +2 -0
  15. package/dist/chunks/CodeBlockPlugin-B4AcDJRK.mjs.map +1 -0
  16. package/dist/chunks/ColorGrid-DAs0--ty.mjs.map +1 -1
  17. package/dist/chunks/ColorPickerPopup-B6340f3p.mjs.map +1 -1
  18. package/dist/chunks/ColorValidation-ZBKZ_gTr.mjs.map +1 -1
  19. package/dist/chunks/Commands-Bk7Cl1nH.mjs +2 -0
  20. package/dist/chunks/Commands-Bk7Cl1nH.mjs.map +1 -0
  21. package/dist/chunks/ContentModel-dkGOh3N7.mjs +2 -0
  22. package/dist/chunks/ContentModel-dkGOh3N7.mjs.map +1 -0
  23. package/dist/chunks/CursorMarks-CqHLzGNI.mjs.map +1 -1
  24. package/dist/chunks/Decoration-BoFcdSXk.mjs.map +1 -1
  25. package/dist/chunks/DirectionDetection-a-1iksmh.mjs.map +1 -1
  26. package/dist/chunks/DirectionIcons-Bbawl9ei.mjs.map +1 -1
  27. package/dist/chunks/Document-ssR6hBzG.mjs.map +1 -1
  28. package/dist/chunks/{DocumentParser-BKUrtgw1.mjs → DocumentParser-C99N0MWF.mjs} +2 -2
  29. package/dist/chunks/DocumentParser-C99N0MWF.mjs.map +1 -0
  30. package/dist/chunks/DomUtils-Bf7JLFlx.mjs.map +1 -1
  31. package/dist/chunks/EditorEventBoundary-zpYRxryo.mjs.map +1 -1
  32. package/dist/chunks/FontPlugin-BcXNFqqO.mjs.map +1 -1
  33. package/dist/chunks/{FontSizePlugin-BQ9Aj8cT.mjs → FontSizePlugin-Dswra3oU.mjs} +2 -2
  34. package/dist/chunks/FontSizePlugin-Dswra3oU.mjs.map +1 -0
  35. package/dist/chunks/FormulaPlugin-DVpLaKi5.mjs +2 -0
  36. package/dist/chunks/FormulaPlugin-DVpLaKi5.mjs.map +1 -0
  37. package/dist/chunks/GapCursorPlugin-QDGwnaRR.mjs.map +1 -1
  38. package/dist/chunks/HTMLSanitization-Ce9dVT1q.mjs.map +1 -1
  39. package/dist/chunks/HTMLUtils-DTpsjZyK.mjs.map +1 -1
  40. package/dist/chunks/{HardBreakPlugin-svNnJ9Xj.mjs → HardBreakPlugin-gjCq8prD.mjs} +2 -2
  41. package/dist/chunks/HardBreakPlugin-gjCq8prD.mjs.map +1 -0
  42. package/dist/chunks/HeadingPlugin-B7EfynaH.mjs.map +1 -1
  43. package/dist/chunks/HighlightPlugin-LdO0INtJ.mjs.map +1 -1
  44. package/dist/chunks/{HorizontalRulePlugin-CQ5NT2Mo.mjs → HorizontalRulePlugin-YywXVZYr.mjs} +2 -2
  45. package/dist/chunks/HorizontalRulePlugin-YywXVZYr.mjs.map +1 -0
  46. package/dist/chunks/ImagePlugin-BAhZuVdE.mjs +2 -0
  47. package/dist/chunks/ImagePlugin-BAhZuVdE.mjs.map +1 -0
  48. package/dist/chunks/InlineCodePlugin-Bu9-rE4B.mjs.map +1 -1
  49. package/dist/chunks/InlineStyleMarkSpec-BhfGgfH9.mjs.map +1 -1
  50. package/dist/chunks/KeyboardNav-D0my3wuy.mjs.map +1 -1
  51. package/dist/chunks/LinkPlugin-CAUaWW5-.mjs +2 -0
  52. package/dist/chunks/LinkPlugin-CAUaWW5-.mjs.map +1 -0
  53. package/dist/chunks/{ListPlugin-DTgpvBEt.mjs → ListPlugin-U1r4p_fE.mjs} +2 -2
  54. package/dist/chunks/ListPlugin-U1r4p_fE.mjs.map +1 -0
  55. package/dist/chunks/MarkCommands-C0ps9h0z.mjs.map +1 -1
  56. package/dist/chunks/MarkInputRule-DNneF2gp.mjs.map +1 -1
  57. package/dist/chunks/MarkdownHTMLRegistry-BunUDiza.mjs.map +1 -1
  58. package/dist/chunks/{MarkdownParser-CvYOvU3d.mjs → MarkdownParser-uX1p_GQk.mjs} +2 -2
  59. package/dist/chunks/MarkdownParser-uX1p_GQk.mjs.map +1 -0
  60. package/dist/chunks/{MarkdownSerializer-CdUBWWGI.mjs → MarkdownSerializer--MrgJTdJ.mjs} +2 -2
  61. package/dist/chunks/MarkdownSerializer--MrgJTdJ.mjs.map +1 -0
  62. package/dist/chunks/MathFont-BS8IwYh2.mjs.map +1 -1
  63. package/dist/chunks/NavigationQueries-CaKfccu7.mjs.map +1 -1
  64. package/dist/chunks/NodeResolver-F4RtpoEd.mjs.map +1 -1
  65. package/dist/chunks/{NodeSelectionCommands-B0Sb4ux4.mjs → NodeSelectionCommands-CAqIHW_6.mjs} +2 -2
  66. package/dist/chunks/NodeSelectionCommands-CAqIHW_6.mjs.map +1 -0
  67. package/dist/chunks/NodeSpecPatching-BrjPAbqe.mjs.map +1 -1
  68. package/dist/chunks/Platform-ByobkiCc.mjs.map +1 -1
  69. package/dist/chunks/PluginHelpers-B3gk3VB3.mjs.map +1 -1
  70. package/dist/chunks/PopupKeyboardPatterns-BcwdDxRq.mjs.map +1 -1
  71. package/dist/chunks/PopupManager-Dxv0OVMo.mjs +2 -0
  72. package/dist/chunks/PopupManager-Dxv0OVMo.mjs.map +1 -0
  73. package/dist/chunks/PopupPositioning-CIqgpqlW.mjs.map +1 -1
  74. package/dist/chunks/{PrintPlugin-BxNlFk2c.mjs → PrintPlugin-DAEiEyKQ.mjs} +2 -2
  75. package/dist/chunks/PrintPlugin-DAEiEyKQ.mjs.map +1 -0
  76. package/dist/chunks/RangeIterator-sJ_c9MNr.mjs.map +1 -1
  77. package/dist/chunks/Schema-BSM4YLNT.mjs.map +1 -1
  78. package/dist/chunks/SchemaRegistry-Cs7rxafF.mjs.map +1 -1
  79. package/dist/chunks/Selection-DC6AOGgF.mjs.map +1 -1
  80. package/dist/chunks/SelectionReplacement-vC1xhFS0.mjs +2 -0
  81. package/dist/chunks/SelectionReplacement-vC1xhFS0.mjs.map +1 -0
  82. package/dist/chunks/SelectionSync-BkjCwGp-.mjs.map +1 -1
  83. package/dist/chunks/SelectionTransactions-mQ1NfMEg.mjs.map +1 -1
  84. package/dist/chunks/ShortcutFormatting-TwiufqeV.mjs.map +1 -1
  85. package/dist/chunks/SimpleMark-D6vz3Nfd.mjs.map +1 -1
  86. package/dist/chunks/SmartPastePlugin-BHsYKbgd.mjs +2 -0
  87. package/dist/chunks/SmartPastePlugin-BHsYKbgd.mjs.map +1 -0
  88. package/dist/chunks/StarterFonts-BDQPg-cu.mjs.map +1 -1
  89. package/dist/chunks/StrikethroughPlugin-v-VJZzUZ.mjs.map +1 -1
  90. package/dist/chunks/StyleClassNames-BsAx7k5T.mjs.map +1 -1
  91. package/dist/chunks/StyleRuntime-C0RSqKzG.mjs.map +1 -1
  92. package/dist/chunks/SuperSubPlugin-x1iPnZyt.mjs.map +1 -1
  93. package/dist/chunks/SyntaxTokenTypes-BUCOMtL8.mjs.map +1 -1
  94. package/dist/chunks/TableDimensions-BSEOEox2.mjs.map +1 -1
  95. package/dist/chunks/{TablePlugin-WPwp902E.mjs → TablePlugin-CjKThPug.mjs} +2 -2
  96. package/dist/chunks/TablePlugin-CjKThPug.mjs.map +1 -0
  97. package/dist/chunks/TextColorPlugin-Bnl9of9E.mjs.map +1 -1
  98. package/dist/chunks/TextDirectionAutoPlugin-DOH5cfyy.mjs.map +1 -1
  99. package/dist/chunks/TextDirectionPlugin-JwlR-R-b.mjs.map +1 -1
  100. package/dist/chunks/TextDirectionService-BcX07mw2.mjs.map +1 -1
  101. package/dist/chunks/TextFormattingPlugin-Kc_UNoOz.mjs.map +1 -1
  102. package/dist/chunks/ThemeEngine-kIXtSRkI.mjs.map +1 -1
  103. package/dist/chunks/{ToolbarPlugin-DmVI7MN9.mjs → ToolbarPlugin-CgZA2hz8.mjs} +2 -2
  104. package/dist/chunks/ToolbarPlugin-CgZA2hz8.mjs.map +1 -0
  105. package/dist/chunks/TypeBrands-Ch9856Gb.mjs.map +1 -1
  106. package/dist/chunks/TypedKeys-CA4bfw9O.mjs.map +1 -1
  107. package/dist/chunks/{VideoPlugin-D3zGQ6QV.mjs → VideoPlugin-DJXfuNA9.mjs} +2 -2
  108. package/dist/chunks/VideoPlugin-DJXfuNA9.mjs.map +1 -0
  109. package/dist/chunks/XmlPatterns-RN32-0ob.mjs.map +1 -1
  110. package/dist/chunks/XmlSupport-3Za6SIqF.mjs.map +1 -1
  111. package/dist/chunks/ar--Isa9OHJ.mjs.map +1 -1
  112. package/dist/chunks/ar--O0A9OTR.mjs.map +1 -1
  113. package/dist/chunks/ar-0g2bmXTn.mjs.map +1 -1
  114. package/dist/chunks/ar-4b8e2YSc.mjs.map +1 -1
  115. package/dist/chunks/ar-B03uY4xr.mjs.map +1 -1
  116. package/dist/chunks/ar-BAfInw85.mjs.map +1 -1
  117. package/dist/chunks/ar-BRX5E_Pw.mjs.map +1 -1
  118. package/dist/chunks/ar-BWOue6jG.mjs.map +1 -1
  119. package/dist/chunks/ar-Bdmunk5h.mjs.map +1 -1
  120. package/dist/chunks/ar-BwaoCUVN.mjs.map +1 -1
  121. package/dist/chunks/ar-BzqAYGER.mjs.map +1 -1
  122. package/dist/chunks/ar-C9lO1jsY.mjs.map +1 -1
  123. package/dist/chunks/ar-CMXjVzFx.mjs.map +1 -1
  124. package/dist/chunks/ar-CR6UdFL9.mjs.map +1 -1
  125. package/dist/chunks/ar-CrOb0jL2.mjs.map +1 -1
  126. package/dist/chunks/ar-Cy_77yRf.mjs.map +1 -1
  127. package/dist/chunks/ar-D1jFXqLJ.mjs.map +1 -1
  128. package/dist/chunks/ar-DahJwMI9.mjs.map +1 -1
  129. package/dist/chunks/ar-Dcl3kgtd.mjs.map +1 -1
  130. package/dist/chunks/ar-Dg9PdDet.mjs.map +1 -1
  131. package/dist/chunks/ar-DhwCFHql.mjs +2 -0
  132. package/dist/chunks/ar-DhwCFHql.mjs.map +1 -0
  133. package/dist/chunks/ar-Dx2lO0Nm.mjs.map +1 -1
  134. package/dist/chunks/ar-NV_puwI2.mjs.map +1 -1
  135. package/dist/chunks/ar-Uzo1Azdw.mjs.map +1 -1
  136. package/dist/chunks/ar-XmSFrtmd.mjs.map +1 -1
  137. package/dist/chunks/ar-eOA3UmiE.mjs.map +1 -1
  138. package/dist/chunks/ar-sGZ-oZqB.mjs.map +1 -1
  139. package/dist/chunks/color-picker-D6HrTsDM.mjs.map +1 -1
  140. package/dist/chunks/de-B8-w9gPi.mjs.map +1 -1
  141. package/dist/chunks/de-B9zSHWqY.mjs.map +1 -1
  142. package/dist/chunks/de-BX4y4PlH.mjs.map +1 -1
  143. package/dist/chunks/de-BXQBXxFJ.mjs.map +1 -1
  144. package/dist/chunks/de-BcPntcnr.mjs.map +1 -1
  145. package/dist/chunks/de-BdD3DpUB.mjs.map +1 -1
  146. package/dist/chunks/de-Bwxlcuee.mjs.map +1 -1
  147. package/dist/chunks/de-BxQIt_1Y.mjs.map +1 -1
  148. package/dist/chunks/de-C-Yf378-.mjs.map +1 -1
  149. package/dist/chunks/de-C7uehgMu.mjs.map +1 -1
  150. package/dist/chunks/de-C9ZhDqPi.mjs.map +1 -1
  151. package/dist/chunks/de-CHcv_Vmf.mjs.map +1 -1
  152. package/dist/chunks/de-CTzAMkXC.mjs.map +1 -1
  153. package/dist/chunks/de-CaeEIyzV.mjs.map +1 -1
  154. package/dist/chunks/de-CjLUbQmg.mjs +2 -0
  155. package/dist/chunks/de-CjLUbQmg.mjs.map +1 -0
  156. package/dist/chunks/de-DHs9i4af.mjs.map +1 -1
  157. package/dist/chunks/de-DJ5EkXQo.mjs.map +1 -1
  158. package/dist/chunks/de-DRbhnS4T.mjs.map +1 -1
  159. package/dist/chunks/de-DViI26lG.mjs.map +1 -1
  160. package/dist/chunks/de-DY3obIAF.mjs.map +1 -1
  161. package/dist/chunks/de-DcMhfRBu.mjs.map +1 -1
  162. package/dist/chunks/de-DiPz7abS.mjs.map +1 -1
  163. package/dist/chunks/de-Dl4QFHMa.mjs.map +1 -1
  164. package/dist/chunks/de-XCCpWyg0.mjs.map +1 -1
  165. package/dist/chunks/de-e6J6nvAD.mjs.map +1 -1
  166. package/dist/chunks/de-i95F9SDy.mjs.map +1 -1
  167. package/dist/chunks/de-uKR7koQe.mjs.map +1 -1
  168. package/dist/chunks/es-B0Za939C.mjs.map +1 -1
  169. package/dist/chunks/es-B8K3Yvf3.mjs.map +1 -1
  170. package/dist/chunks/es-BIXm2Coj.mjs.map +1 -1
  171. package/dist/chunks/es-BJHF95J_.mjs.map +1 -1
  172. package/dist/chunks/es-BMm9kqjC.mjs.map +1 -1
  173. package/dist/chunks/es-BQ9dox_E.mjs.map +1 -1
  174. package/dist/chunks/es-BQweZX6P.mjs.map +1 -1
  175. package/dist/chunks/es-BdpTTRuX.mjs.map +1 -1
  176. package/dist/chunks/es-C7uVqFYr.mjs.map +1 -1
  177. package/dist/chunks/es-CCQFu1t1.mjs.map +1 -1
  178. package/dist/chunks/es-CEAJj7aB.mjs.map +1 -1
  179. package/dist/chunks/es-CMSzvjOT.mjs +2 -0
  180. package/dist/chunks/es-CMSzvjOT.mjs.map +1 -0
  181. package/dist/chunks/es-CUKJujcb.mjs.map +1 -1
  182. package/dist/chunks/es-CXuMz87y.mjs.map +1 -1
  183. package/dist/chunks/es-CgMfhkJJ.mjs.map +1 -1
  184. package/dist/chunks/es-CtOtKQCP.mjs.map +1 -1
  185. package/dist/chunks/es-DD01rZ6N.mjs.map +1 -1
  186. package/dist/chunks/es-DDoqchUq.mjs.map +1 -1
  187. package/dist/chunks/es-DFokqQst.mjs.map +1 -1
  188. package/dist/chunks/es-DHxdoEzR.mjs.map +1 -1
  189. package/dist/chunks/es-DehVGwQ8.mjs.map +1 -1
  190. package/dist/chunks/es-DrJyl38L.mjs.map +1 -1
  191. package/dist/chunks/es-fTW0TkYV.mjs.map +1 -1
  192. package/dist/chunks/es-kfKiqpyD.mjs.map +1 -1
  193. package/dist/chunks/es-nRLq7bgP.mjs.map +1 -1
  194. package/dist/chunks/es-paXY7HFt.mjs.map +1 -1
  195. package/dist/chunks/es-xuahrvJN.mjs.map +1 -1
  196. package/dist/chunks/fr-0qEo3bRP.mjs.map +1 -1
  197. package/dist/chunks/fr-5HkMazAf.mjs.map +1 -1
  198. package/dist/chunks/fr-B9pBLaVx.mjs.map +1 -1
  199. package/dist/chunks/fr-BRXUnq3R.mjs.map +1 -1
  200. package/dist/chunks/fr-BSUKEtTk.mjs.map +1 -1
  201. package/dist/chunks/fr-BeRlON1t.mjs.map +1 -1
  202. package/dist/chunks/fr-Bg937iAy.mjs.map +1 -1
  203. package/dist/chunks/fr-BwWrFThE.mjs.map +1 -1
  204. package/dist/chunks/fr-C3EKRThN.mjs.map +1 -1
  205. package/dist/chunks/fr-CKjH6tJI.mjs.map +1 -1
  206. package/dist/chunks/fr-CQs0-pNX.mjs.map +1 -1
  207. package/dist/chunks/fr-CfhyYN-t.mjs.map +1 -1
  208. package/dist/chunks/fr-D0MDdoir.mjs.map +1 -1
  209. package/dist/chunks/fr-D5ulA3Z6.mjs.map +1 -1
  210. package/dist/chunks/fr-DB_OvHWH.mjs +2 -0
  211. package/dist/chunks/fr-DB_OvHWH.mjs.map +1 -0
  212. package/dist/chunks/fr-DEZ_oxzS.mjs.map +1 -1
  213. package/dist/chunks/fr-DciSEykY.mjs.map +1 -1
  214. package/dist/chunks/fr-DhWQzZy3.mjs.map +1 -1
  215. package/dist/chunks/fr-DiDhVhyV.mjs.map +1 -1
  216. package/dist/chunks/fr-DjMZ-3K5.mjs.map +1 -1
  217. package/dist/chunks/fr-F2ZrfVaF.mjs.map +1 -1
  218. package/dist/chunks/fr-KXmbys88.mjs.map +1 -1
  219. package/dist/chunks/fr-NVOinLyF.mjs.map +1 -1
  220. package/dist/chunks/fr-SbpHNrQ-.mjs.map +1 -1
  221. package/dist/chunks/fr-ZsRdLuys.mjs.map +1 -1
  222. package/dist/chunks/fr-eC0UdAPu.mjs.map +1 -1
  223. package/dist/chunks/fr-fshsDD66.mjs.map +1 -1
  224. package/dist/chunks/full-BsWAZr1w.mjs +2 -0
  225. package/dist/chunks/full-BsWAZr1w.mjs.map +1 -0
  226. package/dist/chunks/hi-4CiAKVjT.mjs.map +1 -1
  227. package/dist/chunks/hi-B-ZuX4aN.mjs.map +1 -1
  228. package/dist/chunks/hi-B2YB3Bo4.mjs.map +1 -1
  229. package/dist/chunks/hi-B2uhiPCN.mjs.map +1 -1
  230. package/dist/chunks/hi-B5cl8TWK.mjs.map +1 -1
  231. package/dist/chunks/hi-BNJIGWQQ.mjs.map +1 -1
  232. package/dist/chunks/hi-BOMkDPqC.mjs.map +1 -1
  233. package/dist/chunks/hi-Bl-yeeOI.mjs.map +1 -1
  234. package/dist/chunks/hi-BsZzSMfL.mjs.map +1 -1
  235. package/dist/chunks/hi-By8YwVIX.mjs.map +1 -1
  236. package/dist/chunks/hi-BzbMD_cP.mjs.map +1 -1
  237. package/dist/chunks/hi-C2jEsf8v.mjs.map +1 -1
  238. package/dist/chunks/hi-CTWubxLY.mjs.map +1 -1
  239. package/dist/chunks/hi-ChNQZZ1z.mjs +2 -0
  240. package/dist/chunks/hi-ChNQZZ1z.mjs.map +1 -0
  241. package/dist/chunks/hi-CoclKAUM.mjs.map +1 -1
  242. package/dist/chunks/hi-CrmakMVj.mjs.map +1 -1
  243. package/dist/chunks/hi-DWX6k5ZD.mjs.map +1 -1
  244. package/dist/chunks/hi-DY55FuDK.mjs.map +1 -1
  245. package/dist/chunks/hi-DrC2H81d.mjs.map +1 -1
  246. package/dist/chunks/hi-DsdXcOB6.mjs.map +1 -1
  247. package/dist/chunks/hi-Dt89SxNy.mjs.map +1 -1
  248. package/dist/chunks/hi-J8ErB5nB.mjs.map +1 -1
  249. package/dist/chunks/hi-L6pJxZam.mjs.map +1 -1
  250. package/dist/chunks/hi-SECtQQzq.mjs.map +1 -1
  251. package/dist/chunks/hi-j3TDLMYd.mjs.map +1 -1
  252. package/dist/chunks/hi-l6DA-aOw.mjs.map +1 -1
  253. package/dist/chunks/hi-uACJUw53.mjs.map +1 -1
  254. package/dist/chunks/minimal-DO7LiFTa.mjs.map +1 -1
  255. package/dist/chunks/pt-5VeuNDd2.mjs.map +1 -1
  256. package/dist/chunks/pt-BCXgUDiU.mjs.map +1 -1
  257. package/dist/chunks/pt-BDam9cDu.mjs.map +1 -1
  258. package/dist/chunks/pt-Bb908r0n.mjs.map +1 -1
  259. package/dist/chunks/pt-BkpVtod-.mjs.map +1 -1
  260. package/dist/chunks/pt-BlFAJZo7.mjs.map +1 -1
  261. package/dist/chunks/pt-Bu7Mbz67.mjs.map +1 -1
  262. package/dist/chunks/pt-BuZ7acHF.mjs.map +1 -1
  263. package/dist/chunks/pt-C8sOyw0V.mjs.map +1 -1
  264. package/dist/chunks/pt-CEUgbrii.mjs.map +1 -1
  265. package/dist/chunks/pt-CFrcl1v_.mjs.map +1 -1
  266. package/dist/chunks/pt-CI8t6oul.mjs +2 -0
  267. package/dist/chunks/pt-CI8t6oul.mjs.map +1 -0
  268. package/dist/chunks/pt-CMrFpUWS.mjs.map +1 -1
  269. package/dist/chunks/pt-CMx2wPPY.mjs.map +1 -1
  270. package/dist/chunks/pt-CR4j8gtE.mjs.map +1 -1
  271. package/dist/chunks/pt-Cc4zysaT.mjs.map +1 -1
  272. package/dist/chunks/pt-Cv6q7x5x.mjs.map +1 -1
  273. package/dist/chunks/pt-DFKJVh7k.mjs.map +1 -1
  274. package/dist/chunks/pt-DYMyMgKQ.mjs.map +1 -1
  275. package/dist/chunks/pt-D__tcM2T.mjs.map +1 -1
  276. package/dist/chunks/pt-Dg2ctkug.mjs.map +1 -1
  277. package/dist/chunks/pt-DgfMoLWR.mjs.map +1 -1
  278. package/dist/chunks/pt-OXa_IR4Q.mjs.map +1 -1
  279. package/dist/chunks/pt-UPF7DBlz.mjs.map +1 -1
  280. package/dist/chunks/pt-_qxIe7zX.mjs.map +1 -1
  281. package/dist/chunks/pt-paXY7HFt.mjs.map +1 -1
  282. package/dist/chunks/pt-zMHcNGPk.mjs.map +1 -1
  283. package/dist/chunks/register-DXLu8Njp.mjs +3 -0
  284. package/dist/chunks/register-DXLu8Njp.mjs.map +1 -0
  285. package/dist/chunks/ru-9WtNGZtl.mjs +2 -0
  286. package/dist/chunks/ru-9WtNGZtl.mjs.map +1 -0
  287. package/dist/chunks/ru-B1m8J9dl.mjs.map +1 -1
  288. package/dist/chunks/ru-BNPUT-3S.mjs.map +1 -1
  289. package/dist/chunks/ru-BotG0MFT.mjs.map +1 -1
  290. package/dist/chunks/ru-C-APN_dm.mjs.map +1 -1
  291. package/dist/chunks/ru-C9yFslEG.mjs.map +1 -1
  292. package/dist/chunks/ru-CkG_bpfo.mjs.map +1 -1
  293. package/dist/chunks/ru-Cs8KCNyq.mjs.map +1 -1
  294. package/dist/chunks/ru-CsP6mLxp.mjs.map +1 -1
  295. package/dist/chunks/ru-CvDl-yEd.mjs.map +1 -1
  296. package/dist/chunks/ru-CwyPz2Va.mjs.map +1 -1
  297. package/dist/chunks/ru-D53d-_UB.mjs.map +1 -1
  298. package/dist/chunks/ru-DJMpeuey.mjs.map +1 -1
  299. package/dist/chunks/ru-DSRv3_Rg.mjs.map +1 -1
  300. package/dist/chunks/ru-DV-lgEtM.mjs.map +1 -1
  301. package/dist/chunks/ru-DiwQV30V.mjs.map +1 -1
  302. package/dist/chunks/ru-DkW9XZFy.mjs.map +1 -1
  303. package/dist/chunks/ru-DyCTlhjg.mjs.map +1 -1
  304. package/dist/chunks/ru-QGX8lOTs.mjs.map +1 -1
  305. package/dist/chunks/ru-QcTo2yoL.mjs.map +1 -1
  306. package/dist/chunks/ru-Y11wuxOB.mjs.map +1 -1
  307. package/dist/chunks/ru-Yngw7nFP.mjs.map +1 -1
  308. package/dist/chunks/ru-d68SZpEe.mjs.map +1 -1
  309. package/dist/chunks/ru-gxbzqLL8.mjs.map +1 -1
  310. package/dist/chunks/ru-k7o3Qks3.mjs.map +1 -1
  311. package/dist/chunks/ru-l73diFXn.mjs.map +1 -1
  312. package/dist/chunks/ru-q8kz-237.mjs.map +1 -1
  313. package/dist/chunks/src-5GKFQ2mQ.mjs.map +1 -1
  314. package/dist/chunks/xml-BsV44TrJ.mjs.map +1 -1
  315. package/dist/chunks/zh-BFZOM3lF.mjs.map +1 -1
  316. package/dist/chunks/zh-BGYJXxVl.mjs.map +1 -1
  317. package/dist/chunks/zh-BP97XjlS.mjs.map +1 -1
  318. package/dist/chunks/zh-BQ73oqxc.mjs.map +1 -1
  319. package/dist/chunks/zh-BQqf3wJZ.mjs.map +1 -1
  320. package/dist/chunks/zh-Baxh6v0j.mjs.map +1 -1
  321. package/dist/chunks/zh-BrqJ4ywP.mjs +2 -0
  322. package/dist/chunks/zh-BrqJ4ywP.mjs.map +1 -0
  323. package/dist/chunks/zh-BvuAbM2S.mjs.map +1 -1
  324. package/dist/chunks/zh-C-wHnDo5.mjs.map +1 -1
  325. package/dist/chunks/zh-C7iCgCRP.mjs.map +1 -1
  326. package/dist/chunks/zh-CRsDvfPR.mjs.map +1 -1
  327. package/dist/chunks/zh-CWGAPVei.mjs.map +1 -1
  328. package/dist/chunks/zh-CWIzJcXi.mjs.map +1 -1
  329. package/dist/chunks/zh-CYV-db-K.mjs.map +1 -1
  330. package/dist/chunks/zh-CiIyOm6U.mjs.map +1 -1
  331. package/dist/chunks/zh-CnW44JEw.mjs.map +1 -1
  332. package/dist/chunks/zh-D1HSmSOf.mjs.map +1 -1
  333. package/dist/chunks/zh-DWN1Jqn3.mjs.map +1 -1
  334. package/dist/chunks/zh-DYD476c5.mjs.map +1 -1
  335. package/dist/chunks/zh-DdzgYD7k.mjs.map +1 -1
  336. package/dist/chunks/zh-DgSmvLyw.mjs.map +1 -1
  337. package/dist/chunks/zh-DlVfQn4z.mjs.map +1 -1
  338. package/dist/chunks/zh-Oj-qSUEp.mjs.map +1 -1
  339. package/dist/chunks/zh-YfuE_m2y.mjs.map +1 -1
  340. package/dist/chunks/zh-dGSDBBzb.mjs.map +1 -1
  341. package/dist/chunks/zh-ikm3rSTR.mjs.map +1 -1
  342. package/dist/chunks/zh-oZl1P_p0.mjs.map +1 -1
  343. package/dist/commands/BlockInsertion.d.ts +15 -19
  344. package/dist/commands/BlockInsertion.d.ts.map +1 -1
  345. package/dist/commands/PasteCommand.d.ts.map +1 -1
  346. package/dist/commands/SelectionDeletion.d.ts +7 -5
  347. package/dist/commands/SelectionDeletion.d.ts.map +1 -1
  348. package/dist/commands/SelectionReplacement.d.ts +42 -0
  349. package/dist/commands/SelectionReplacement.d.ts.map +1 -0
  350. package/dist/editor/BlockIdentity.d.ts +16 -0
  351. package/dist/editor/BlockIdentity.d.ts.map +1 -0
  352. package/dist/editor/ContentSerializer.d.ts +13 -11
  353. package/dist/editor/ContentSerializer.d.ts.map +1 -1
  354. package/dist/editor/NotectlEditor.d.ts +6 -5
  355. package/dist/editor/NotectlEditor.d.ts.map +1 -1
  356. package/dist/editor/styles/link.d.ts +3 -0
  357. package/dist/editor/styles/link.d.ts.map +1 -0
  358. package/dist/fonts/math.mjs +1 -1
  359. package/dist/full.mjs +1 -1
  360. package/dist/html.mjs +1 -1
  361. package/dist/index.d.ts +1 -1
  362. package/dist/index.d.ts.map +1 -1
  363. package/dist/input/PasteHTMLHandler.d.ts.map +1 -1
  364. package/dist/input/PasteHandler.d.ts.map +1 -1
  365. package/dist/input/PasteRichBlockHandler.d.ts +10 -17
  366. package/dist/input/PasteRichBlockHandler.d.ts.map +1 -1
  367. package/dist/markdown.mjs +1 -1
  368. package/dist/model/ContentModel.d.ts +6 -1
  369. package/dist/model/ContentModel.d.ts.map +1 -1
  370. package/dist/model/FileHandlerDispatcher.d.ts +3 -1
  371. package/dist/model/FileHandlerDispatcher.d.ts.map +1 -1
  372. package/dist/model/FileHandlerRegistry.d.ts +11 -2
  373. package/dist/model/FileHandlerRegistry.d.ts.map +1 -1
  374. package/dist/notectl-core.mjs +1 -1
  375. package/dist/notectl-core.umd.js +1 -1
  376. package/dist/notectl-core.umd.js.map +1 -1
  377. package/dist/plugins/caret-navigation.mjs +1 -1
  378. package/dist/plugins/code-block/CodeBlockSchema.d.ts.map +1 -1
  379. package/dist/plugins/code-block.mjs +1 -1
  380. package/dist/plugins/font-size.mjs +1 -1
  381. package/dist/plugins/formula/FormulaCommands.d.ts +6 -4
  382. package/dist/plugins/formula/FormulaCommands.d.ts.map +1 -1
  383. package/dist/plugins/formula.mjs +1 -1
  384. package/dist/plugins/hard-break.mjs +1 -1
  385. package/dist/plugins/horizontal-rule.mjs +1 -1
  386. package/dist/plugins/image/ImageCommands.d.ts +15 -3
  387. package/dist/plugins/image/ImageCommands.d.ts.map +1 -1
  388. package/dist/plugins/image/ImagePlugin.d.ts.map +1 -1
  389. package/dist/plugins/image.mjs +1 -1
  390. package/dist/plugins/link/LinkInteractionController.d.ts +26 -0
  391. package/dist/plugins/link/LinkInteractionController.d.ts.map +1 -0
  392. package/dist/plugins/link/LinkLocale.d.ts +7 -1
  393. package/dist/plugins/link/LinkLocale.d.ts.map +1 -1
  394. package/dist/plugins/link/LinkNavigation.d.ts +12 -0
  395. package/dist/plugins/link/LinkNavigation.d.ts.map +1 -0
  396. package/dist/plugins/link/LinkPlugin.d.ts +4 -4
  397. package/dist/plugins/link/LinkPlugin.d.ts.map +1 -1
  398. package/dist/plugins/link/LinkPreview.d.ts +28 -0
  399. package/dist/plugins/link/LinkPreview.d.ts.map +1 -0
  400. package/dist/plugins/link/locales/ar.d.ts.map +1 -1
  401. package/dist/plugins/link/locales/de.d.ts.map +1 -1
  402. package/dist/plugins/link/locales/es.d.ts.map +1 -1
  403. package/dist/plugins/link/locales/fr.d.ts.map +1 -1
  404. package/dist/plugins/link/locales/hi.d.ts.map +1 -1
  405. package/dist/plugins/link/locales/pt.d.ts.map +1 -1
  406. package/dist/plugins/link/locales/ru.d.ts.map +1 -1
  407. package/dist/plugins/link/locales/zh.d.ts.map +1 -1
  408. package/dist/plugins/link.mjs +1 -1
  409. package/dist/plugins/list.mjs +1 -1
  410. package/dist/plugins/print.mjs +1 -1
  411. package/dist/plugins/shared/PopupManager.d.ts +5 -0
  412. package/dist/plugins/shared/PopupManager.d.ts.map +1 -1
  413. package/dist/plugins/shared.mjs +1 -1
  414. package/dist/plugins/smart-paste/SmartPastePlugin.d.ts +0 -1
  415. package/dist/plugins/smart-paste/SmartPastePlugin.d.ts.map +1 -1
  416. package/dist/plugins/smart-paste.mjs +1 -1
  417. package/dist/plugins/table.mjs +1 -1
  418. package/dist/plugins/text-direction.mjs +1 -1
  419. package/dist/plugins/toolbar.mjs +1 -1
  420. package/dist/plugins/video.mjs +1 -1
  421. package/dist/presets/full.mjs +1 -1
  422. package/dist/presets.mjs +1 -1
  423. package/dist/register.mjs +1 -1
  424. package/dist/state/History.d.ts.map +1 -1
  425. package/dist/state/StepApplication.d.ts.map +1 -1
  426. package/dist/state/Steps.d.ts +3 -0
  427. package/dist/state/Steps.d.ts.map +1 -1
  428. package/dist/state/StructuralPositions.d.ts +15 -0
  429. package/dist/state/StructuralPositions.d.ts.map +1 -0
  430. package/dist/state/TransactionBuilder.d.ts +6 -14
  431. package/dist/state/TransactionBuilder.d.ts.map +1 -1
  432. package/dist/test/TestUtils.d.ts.map +1 -1
  433. package/dist/view/EditorViewEvents.d.ts.map +1 -1
  434. package/package.json +8 -8
  435. package/dist/chunks/BlockInsertion-CxKdCKJd.mjs +0 -2
  436. package/dist/chunks/BlockInsertion-CxKdCKJd.mjs.map +0 -1
  437. package/dist/chunks/CaretNavigationPlugin-BxWjR7SN.mjs.map +0 -1
  438. package/dist/chunks/CodeBlockPlugin-BIrkK4ER.mjs +0 -2
  439. package/dist/chunks/CodeBlockPlugin-BIrkK4ER.mjs.map +0 -1
  440. package/dist/chunks/Commands-DBBCAYBn.mjs +0 -2
  441. package/dist/chunks/Commands-DBBCAYBn.mjs.map +0 -1
  442. package/dist/chunks/ContentModel-BLC3Tez8.mjs +0 -2
  443. package/dist/chunks/ContentModel-BLC3Tez8.mjs.map +0 -1
  444. package/dist/chunks/DocumentParser-BKUrtgw1.mjs.map +0 -1
  445. package/dist/chunks/FontSizePlugin-BQ9Aj8cT.mjs.map +0 -1
  446. package/dist/chunks/FormulaPlugin-Bw_sO_lq.mjs +0 -2
  447. package/dist/chunks/FormulaPlugin-Bw_sO_lq.mjs.map +0 -1
  448. package/dist/chunks/HardBreakPlugin-svNnJ9Xj.mjs.map +0 -1
  449. package/dist/chunks/HorizontalRulePlugin-CQ5NT2Mo.mjs.map +0 -1
  450. package/dist/chunks/ImagePlugin-BzLvPXGo.mjs +0 -2
  451. package/dist/chunks/ImagePlugin-BzLvPXGo.mjs.map +0 -1
  452. package/dist/chunks/LinkPlugin-BuzrXo2c.mjs +0 -2
  453. package/dist/chunks/LinkPlugin-BuzrXo2c.mjs.map +0 -1
  454. package/dist/chunks/ListPlugin-DTgpvBEt.mjs.map +0 -1
  455. package/dist/chunks/MarkdownParser-CvYOvU3d.mjs.map +0 -1
  456. package/dist/chunks/MarkdownSerializer-CdUBWWGI.mjs.map +0 -1
  457. package/dist/chunks/NodeSelectionCommands-B0Sb4ux4.mjs.map +0 -1
  458. package/dist/chunks/PopupManager-Jz5JrUdC.mjs +0 -2
  459. package/dist/chunks/PopupManager-Jz5JrUdC.mjs.map +0 -1
  460. package/dist/chunks/PrintPlugin-BxNlFk2c.mjs.map +0 -1
  461. package/dist/chunks/SmartPastePlugin-C3SVKkWK.mjs +0 -2
  462. package/dist/chunks/SmartPastePlugin-C3SVKkWK.mjs.map +0 -1
  463. package/dist/chunks/TablePlugin-WPwp902E.mjs.map +0 -1
  464. package/dist/chunks/ToolbarPlugin-DmVI7MN9.mjs.map +0 -1
  465. package/dist/chunks/VideoPlugin-D3zGQ6QV.mjs.map +0 -1
  466. package/dist/chunks/ar-Ctrv6cIi.mjs +0 -2
  467. package/dist/chunks/ar-Ctrv6cIi.mjs.map +0 -1
  468. package/dist/chunks/de-JhGflzS5.mjs +0 -2
  469. package/dist/chunks/de-JhGflzS5.mjs.map +0 -1
  470. package/dist/chunks/es-Bv7bDbMp.mjs +0 -2
  471. package/dist/chunks/es-Bv7bDbMp.mjs.map +0 -1
  472. package/dist/chunks/fr-DtzIu6tU.mjs +0 -2
  473. package/dist/chunks/fr-DtzIu6tU.mjs.map +0 -1
  474. package/dist/chunks/full-BiQ93ERr.mjs +0 -2
  475. package/dist/chunks/full-BiQ93ERr.mjs.map +0 -1
  476. package/dist/chunks/hi-Bu799xIO.mjs +0 -2
  477. package/dist/chunks/hi-Bu799xIO.mjs.map +0 -1
  478. package/dist/chunks/pt-DmN9u3NX.mjs +0 -2
  479. package/dist/chunks/pt-DmN9u3NX.mjs.map +0 -1
  480. package/dist/chunks/register-Cb1YTAN4.mjs +0 -3
  481. package/dist/chunks/register-Cb1YTAN4.mjs.map +0 -1
  482. package/dist/chunks/ru-BxySx7an.mjs +0 -2
  483. package/dist/chunks/ru-BxySx7an.mjs.map +0 -1
  484. package/dist/chunks/zh-DuucmOns.mjs +0 -2
  485. package/dist/chunks/zh-DuucmOns.mjs.map +0 -1
@@ -1,2 +1,2 @@
1
- import{i as e,r as t}from"./HTMLUtils-DTpsjZyK.mjs";import{D as o,R as i,j as n,p as r}from"./Document-ssR6hBzG.mjs";import{c as a,d as s,f as l,i as d,n as c,u}from"./Selection-DC6AOGgF.mjs";import{a as p}from"./TypeBrands-Ch9856Gb.mjs";import{s as h}from"./BlockInsertion-CxKdCKJd.mjs";import{t as m}from"./NodeSelectionCommands-B0Sb4ux4.mjs";import{c as v,o as f}from"./PluginHelpers-B3gk3VB3.mjs";import{c as b,n as g}from"./StyleRuntime-C0RSqKzG.mjs";import{t as y}from"./Platform-ByobkiCc.mjs";import{n as x}from"./DomUtils-Bf7JLFlx.mjs";import{t as _}from"./ShortcutFormatting-TwiufqeV.mjs";import{a as w}from"./PopupPositioning-CIqgpqlW.mjs";var A=/^[A-Za-z0-9_-]{11}$/,k=/^\d+$/,P=/^[A-Za-z0-9]+$/,C=/^[A-Za-z0-9]+$/;function z(e,t){const o=e.indexOf(t);if(-1!==o)return e[o+1]}function E(e,t,o){const i=t.searchParams.get("h")??o;return i&&P.test(i)?{videoId:e,hash:i}:{videoId:e}}var L=[{id:"youtube",label:"YouTube",hostnames:["youtube.com","www.youtube.com","m.youtube.com","music.youtube.com","youtu.be","youtube-nocookie.com","www.youtube-nocookie.com"],embedHostnames:["www.youtube-nocookie.com","youtube-nocookie.com","www.youtube.com","youtube.com"],parse(e){const t=e.hostname.toLowerCase(),o=e.pathname.split("/").filter(Boolean);if("youtu.be"===t){const e=o[0];return e&&A.test(e)?{videoId:e}:null}const i=e.searchParams.get("v");if(i&&A.test(i))return{videoId:i};for(const n of["embed","shorts","live","v"]){const e=z(o,n);if(e&&A.test(e))return{videoId:e}}return null},buildEmbedUrl(e,t){const o=t.privacy?"www.youtube-nocookie.com":"www.youtube.com",i=V({rel:"0",...t.autoplay?{autoplay:"1"}:{}});return`https://${o}/embed/${e.videoId}${i}`},buildWatchUrl:e=>`https://www.youtube.com/watch?v=${e.videoId}`,thumbnailUrl:e=>`https://i.ytimg.com/vi/${e.videoId}/hqdefault.jpg`},{id:"vimeo",label:"Vimeo",hostnames:["vimeo.com","www.vimeo.com","player.vimeo.com"],embedHostnames:["player.vimeo.com"],parse(e){const t=e.pathname.split("/").filter(Boolean),o=z(t,"video");if(o&&k.test(o))return E(o,e,void 0);const i=t.find(e=>k.test(e));return i?E(i,e,t[t.indexOf(i)+1]):null},buildEmbedUrl(e,t){const o=V({...e.hash?{h:e.hash}:{},...t.privacy?{dnt:"1"}:{},...t.autoplay?{autoplay:"1"}:{}});return`https://player.vimeo.com/video/${e.videoId}${o}`},buildWatchUrl(e){const t=`https://vimeo.com/${e.videoId}`;return e.hash?`${t}/${e.hash}`:t}},{id:"dailymotion",label:"Dailymotion",hostnames:["dailymotion.com","www.dailymotion.com","geo.dailymotion.com","dai.ly"],embedHostnames:["www.dailymotion.com","geo.dailymotion.com"],parse(e){const t=e.hostname.toLowerCase(),o=e.pathname.split("/").filter(Boolean);if("dai.ly"===t){const e=o[0];return e&&C.test(e)?{videoId:e}:null}const i=z(o,"video");return i&&C.test(i)?{videoId:i}:null},buildEmbedUrl(e,t){const o=V(t.autoplay?{autoplay:"1"}:{});return`https://www.dailymotion.com/embed/video/${e.videoId}${o}`},buildWatchUrl:e=>`https://www.dailymotion.com/video/${e.videoId}`,thumbnailUrl:e=>`https://www.dailymotion.com/thumbnail/video/${e.videoId}`}];function I(e,t=L){const o=H(e);if(!o)return null;if("https:"!==o.protocol&&"http:"!==o.protocol)return null;const i=o.hostname.toLowerCase();for(const n of t){if(!n.hostnames.includes(i))continue;const e=n.parse(o);if(e)return{provider:n.id,videoId:e.videoId,...e.hash?{hash:e.hash}:{}}}return null}function S(e,t=L){return t.find(t=>t.id===e)}function R(e,t){const o=S(e.provider,t);return o?o.buildWatchUrl(e):null}function $(e,t){return S(e.provider,t)?.thumbnailUrl?.(e)}function N(e,t=L){return S(e,t)?.label??e}function H(e){try{return new URL(e.trim())}catch{return null}}function V(e){const t=Object.entries(e);return 0===t.length?"":`?${t.map(([e,t])=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`).join("&")}`}var B={growWidth:"Mod-Shift-ArrowRight",shrinkWidth:"Mod-Shift-ArrowLeft",growWidthLarge:"Mod-Shift-Alt-ArrowRight",shrinkWidthLarge:"Mod-Shift-Alt-ArrowLeft",resetSize:"Mod-Shift-0"},M={providers:L,facade:!0,useProviderThumbnail:!1,privacy:!0,allowedAspectRatios:["16/9","4/3","1/1","9/16"],defaultAspectRatio:"16/9",defaultWidthPercent:100,minWidthPercent:25,widthStep:10,widthStepLarge:25,resizable:!0},W="video",j=/^\d+(?:\.\d+)?\s*\/\s*\d+(?:\.\d+)?$/;function D(e,t){if(!e||!j.test(e.trim()))return t.defaultAspectRatio;const[o,i]=e.split("/");return`${o?.trim()} / ${i?.trim()}`}function T(e,t){return Number.isFinite(e)?Math.max(t.minWidthPercent,Math.min(100,Math.round(e))):t.defaultWidthPercent}var O=/^[A-Za-z0-9_-]+$/;function U(e){return e.length>0&&e.length<=64&&O.test(e)}function K(e,t){return{provider:e?.provider??"",videoId:e?.videoId??"",...e?.hash?{hash:e.hash}:{},aspectRatio:D(e?.aspectRatio,t),widthPercent:T(e?.widthPercent??t.defaultWidthPercent,t),align:e?.align??"center",title:e?.title??"",...e?.caption?{caption:e.caption}:{},privacy:e?.privacy??t.privacy}}function F(e,t){const o=I(e.url,t.providers);return o?{provider:o.provider,videoId:o.videoId,...o.hash?{hash:o.hash}:{},aspectRatio:D(e.aspectRatio,t),widthPercent:t.defaultWidthPercent,align:"center",title:e.title,...e.caption?{caption:e.caption}:{},privacy:t.privacy}:null}function q(e){return{provider:e.provider,videoId:e.videoId,aspectRatio:e.aspectRatio,widthPercent:e.widthPercent,align:e.align,title:e.title,privacy:e.privacy,...e.hash?{hash:e.hash}:{},...e.caption?{caption:e.caption}:{}}}function Z(e){const t=e.selection;if(!s(t))return null;const o=e.getBlock(t.nodeId);if(!o||"video"!==o.type)return null;const i=e.getNodePath(t.nodeId);return i?{block:o,path:i}:null}function G(e,t){const o=e.getState(),i=Z(o);return!!i&&(e.dispatch(o.transaction("command").setNodeAttr(i.path,t).build()),!0)}function Y(e){const t=e.getState(),o=Z(t);if(!o)return!1;const i=m(t,d(o.block.id,o.path));return!!i&&(e.dispatch(i),!0)}var X=0;function J(e){return`${e}-${X+=1}`}function Q(e,t){const o=J("notectl-video-field"),i=document.createElement("div");i.className="notectl-video-popup__field";const n=document.createElement("label");n.className="notectl-video-popup__label",n.setAttribute("for",o),n.textContent=t.label,i.appendChild(n);const r=document.createElement("input");r.id=o,r.type=t.type,r.value=t.value,r.placeholder=t.placeholder,r.className="notectl-video-popup__input",r.setAttribute("aria-label",t.ariaLabel),t.required&&r.setAttribute("aria-required","true");const a=[];if(t.hint){const e=`${o}-hint`,n=document.createElement("p");n.id=e,n.className="notectl-video-popup__hint",n.textContent=t.hint,i.appendChild(n),a.push(e)}return t.describedBy&&a.push(t.describedBy),a.length>0&&r.setAttribute("aria-describedby",a.join(" ")),i.insertBefore(r,i.children[1]??null),e.appendChild(i),r}var ee=class{context;config;locale;panel=null;outsideHandler=null;constructor(e,t,o){this.context=e,this.config=t,this.locale=o}get isOpen(){return null!==this.panel}openInsert(){this.context.isReadOnly()||this.open({rect:te(),mode:"insert",label:this.locale.insertDialogLabel,onSubmit:e=>{const t=F(e,this.config);t&&function(e,t){const n=e.getState(),a=n.selection;if(u(a))return!1;const l=q(t),c=s(a)?a.nodeId:a.anchor.blockId,m=function(e,t){if("table_cell"===e.getBlock(t)?.type)return t;const o=e.getNodePath(t);if(o)for(const i of o)if("table_cell"===e.getBlock(i)?.type)return i}(n,c);m?function(e,t,n,a){const s=e.getNodePath(n),l=e.getBlock(n);if(!s||!l)return!1;const c=r(p(W),[],void 0,a),u=e.transaction("command"),h=o(l);for(let o=h.length-1;o>=0;o--){const e=l.children.findIndex(e=>i(e)&&e.id===h[o]?.id);-1!==e&&u.removeNode(s,e)}u.insertNode(s,0,c),u.setSelection(d(c.id,[...s,c.id])),t.dispatch(u.build())}(n,e,m,l):function(e,t,o,i){const n=r(p(W),[],void 0,i),a=e.transaction("command");!!h(e,a,o,n)&&(a.setSelection(d(n.id,[])),t.dispatch(a.build()))}(n,e,c,l)}(this.context,t)}})}openInsertReplacingRange(e,t){this.context.isReadOnly()||this.open({rect:te(),mode:"insert",label:this.locale.insertDialogLabel,initial:{url:t},onSubmit:t=>{const o=F(t,this.config);o&&function(e,t,o){const a=e.getState(),s=a.getBlock(t.blockId);if(!s)return!1;const l=function(e,t){const o=e.getNodePath(t);if(!o||0===o.length)return null;if(1===o.length){const o=e.doc.children.findIndex(e=>e.id===t);return-1===o?null:{parentPath:[],index:o}}const n=o[o.length-2],r=n?e.getBlock(n):void 0;if(!r)return null;const a=r.children.findIndex(e=>i(e)&&e.id===t);return-1===a?null:{parentPath:o.slice(0,-1),index:a}}(a,t.blockId);if(!l)return!1;const c=0===Math.max(0,n(s).length-(t.end-t.start))&&"paragraph"===s.type,u=r(p(W),[],void 0,q(o)),h=0===l.parentPath.length?[]:[...l.parentPath,u.id],m=a.transaction("command");c?(m.removeNode(l.parentPath,l.index),m.insertNode(l.parentPath,l.index,u),0===l.parentPath.length&&l.index>=a.doc.children.length-1&&m.insertNode([],l.index+1,r(p("paragraph")))):(m.deleteTextAt(t.blockId,t.start,t.end),m.insertNode(l.parentPath,l.index+1,u)),m.setSelection(d(u.id,h)),e.dispatch(m.build())}(this.context,e,o)}})}openEditForSelected(){if(this.context.isReadOnly())return;const e=this.context.getState(),t=e.selection;if(!s(t))return;const o=e.getBlock(t.nodeId);if(!o||"video"!==o.type)return;const i=K(o.attrs,this.config),n={url:R({provider:i.provider,videoId:i.videoId,...i.hash?{hash:i.hash}:{}},this.config.providers)??"",title:i.title,caption:i.caption??"",aspectRatio:i.aspectRatio};this.open({rect:this.videoRect(t.nodeId),mode:"edit",label:this.locale.editDialogLabel,initial:n,onSubmit:e=>{!function(e,t,o){const i=Z(e.getState());if(!i)return!1;const n=I(t.url,o.providers);if(!n)return!1;const r=function(e,t){const o={};for(const[i,n]of Object.entries(e??{}))t.includes(i)||"string"!=typeof n&&"number"!=typeof n&&"boolean"!=typeof n||(o[i]=n);return o}(i.block.attrs,["hash","caption"]);r.provider=n.provider,r.videoId=n.videoId,r.title=t.title,r.aspectRatio=D(t.aspectRatio,o),n.hash&&(r.hash=n.hash),t.caption.trim()&&(r.caption=t.caption.trim()),G(e,r)}(this.context,e,this.config)}})}close(e){this.panel&&(this.outsideHandler&&(document.removeEventListener("mousedown",this.outsideHandler,!0),this.outsideHandler=null),this.panel.remove(),this.panel=null,e&&this.context.getContainer().focus())}open(e){this.close(!1);const t=document.createElement("div");t.className="notectl-video-overlay",t.setAttribute("role","dialog"),t.setAttribute("aria-modal","false"),t.setAttribute("aria-label",e.label),this.panel=t,function(e,t){const{config:o,locale:i,initial:n,mode:r}=t;e.classList.add("notectl-video-popup");const a=J("notectl-video-error"),s=document.createElement("p");s.id=a,s.className="notectl-video-popup__error",s.setAttribute("role","alert");const l=Q(e,{label:i.urlLabel,ariaLabel:i.urlAria,placeholder:i.urlPlaceholder,value:n?.url??"",type:"url",required:!0,describedBy:a}),d=Q(e,{label:i.titleLabel,ariaLabel:i.titleAria,placeholder:i.titlePlaceholder,value:n?.title??"",type:"text",required:!0,hint:i.titleHint}),c=Q(e,{label:i.captionLabel,ariaLabel:i.captionAria,placeholder:i.captionPlaceholder,value:n?.caption??"",type:"text"}),u=function(e,t,o,i){const n=J("notectl-video-field"),r=document.createElement("div");r.className="notectl-video-popup__field";const a=document.createElement("label");a.className="notectl-video-popup__label",a.setAttribute("for",n),a.textContent=o.aspectRatioLabel,r.appendChild(a);const s=document.createElement("select");s.id=n,s.className="notectl-video-popup__select",s.setAttribute("aria-label",o.aspectRatioAria);const l=t.allowedAspectRatios.includes(i)?t.allowedAspectRatios:[i,...t.allowedAspectRatios];for(const d of l){const e=document.createElement("option");e.value=d,e.textContent=d,d===i&&(e.selected=!0),s.appendChild(e)}return r.appendChild(s),e.appendChild(r),s}(e,o,i,n?.aspectRatio??o.defaultAspectRatio);e.appendChild(s);const p=document.createElement("div");p.className="notectl-video-popup__actions";const h=document.createElement("button");h.type="button",h.className="notectl-video-popup__cancel",h.textContent=i.cancelButton;const m=document.createElement("button");m.type="button",m.className="notectl-video-popup__submit",m.textContent="edit"===r?i.updateButton:i.insertButton,m.setAttribute("aria-label","edit"===r?i.updateAria:i.insertAria),p.append(h,m),e.appendChild(p);const v=(e,t)=>{s.textContent=e,t.focus()},f=()=>{const e=l.value.trim();if(!I(e,o.providers))return void v(i.invalidUrl,l);const n=d.value.trim();n?(s.textContent="",t.onSubmit({url:e,title:n,caption:c.value.trim(),aspectRatio:u.value}),t.onClose()):v(i.titleRequired,d)};h.addEventListener("mousedown",e=>e.preventDefault()),h.addEventListener("click",e=>{e.preventDefault(),t.onClose()}),m.addEventListener("mousedown",e=>e.preventDefault()),m.addEventListener("click",e=>{e.preventDefault(),f()});for(const b of[l,d,c])b.addEventListener("keydown",e=>{"Enter"===e.key&&(e.preventDefault(),f())});requestAnimationFrame(()=>l.focus())}(t,{mode:e.mode,initial:e.initial,config:this.config,locale:this.locale,onSubmit:e.onSubmit,onClose:()=>this.close(!0)}),t.addEventListener("keydown",e=>{"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),this.close(!0))}),this.context.getPluginContainer("top").appendChild(t),w(t),function(e,t){const o=t?t.bottom:window.innerHeight/3,i=t?t.left:window.innerWidth/3,n=e.offsetWidth||320,r=window.innerWidth-n-8,a=Math.max(8,Math.min(i,r)),s=window.innerHeight-e.offsetHeight-8,l=Math.min(o+8,Math.max(8,s));e.style.left=`${Math.round(a)}px`,e.style.top=`${Math.round(l)}px`}(t,e.rect),this.installOutsideHandler()}videoRect(e){const t=this.context.getContainer().querySelector(`[data-block-id="${e}"]`);return t?t.getBoundingClientRect():null}installOutsideHandler(){const e=e=>{this.panel&&!e.composedPath().includes(this.panel)&&this.close(!1)};this.outsideHandler=e,requestAnimationFrame(()=>{this.outsideHandler&&document.addEventListener("mousedown",e,!0)})}};function te(){const e=window.getSelection();if(!e||0===e.rangeCount)return null;const t=e.getRangeAt(0).getBoundingClientRect();return 0===t.width&&0===t.height&&0===t.top&&0===t.left?null:t}var oe={insertVideo:"Insert Video",insertVideoTooltip:"Insert Video",urlLabel:"Video URL",urlPlaceholder:"https://www.youtube.com/watch?v=...",urlAria:"Video URL",titleLabel:"Title",titlePlaceholder:"Describe the video",titleAria:"Video title",titleHint:"Describes the video for screen readers. Required.",captionLabel:"Caption",captionPlaceholder:"Optional visible caption",captionAria:"Video caption",aspectRatioLabel:"Aspect ratio",aspectRatioAria:"Video aspect ratio",insertButton:"Insert",insertAria:"Insert video",updateButton:"Update",updateAria:"Update video",cancelButton:"Cancel",insertDialogLabel:"Insert video",editDialogLabel:"Edit video",invalidUrl:"Enter a YouTube, Vimeo, or Dailymotion video URL.",titleRequired:"Enter a title so screen readers can describe the video.",play:e=>e?`Play video: ${e}`:"Play video",loading:"Loading video...",providerBadge:e=>`${e} video`,closePlayer:"Close video player",videoAria:(e,t)=>t?`${e} video: ${t}`:`${e} video`,videoSelected:"Video selected.",videoSelectedWithTitle:e=>`Video selected: ${e}.`,resizeHint:(e,t)=>`${e} / ${t} to resize.`,keyboardResizeHint:(e,t)=>`${e} / ${t} to resize`,videoResized:e=>`Video resized to ${e} percent width.`,resetToDefaultSize:"Video reset to full width.",enteredPlayer:e=>e?`Playing ${e}. Press Escape to return to the document.`:"Playing video. Press Escape to return to the document.",exitedPlayer:"Returned to the document.",videoOptions:"Video options",editVideo:"Edit video",alignStart:"Align left",alignCenter:"Align center",alignEnd:"Align right",deleteVideo:"Delete video",embedPrompt:"Embed this video?",embedConfirm:"Embed",embedDismiss:"Keep as link",embedOfferAnnounce:e=>`${e} link pasted. Press Embed to turn it into a video, or continue editing to keep it as a link.`,embeddedAnnounce:"Video embedded."},ie=/* #__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar--O0A9OTR.mjs"),"./locales/de.ts":()=>import("./de-BxQIt_1Y.mjs"),"./locales/es.ts":()=>import("./es-BQweZX6P.mjs"),"./locales/fr.ts":()=>import("./fr-C3EKRThN.mjs"),"./locales/hi.ts":()=>import("./hi-L6pJxZam.mjs"),"./locales/pt.ts":()=>import("./pt-Bb908r0n.mjs"),"./locales/ru.ts":()=>import("./ru-DkW9XZFy.mjs"),"./locales/zh.ts":()=>import("./zh-ikm3rSTR.mjs")});async function ne(e){return v(ie,e,oe)}var re={start:"notectl-video--start",center:"notectl-video--center",end:"notectl-video--end"};function ae(e,t){for(const i of Object.values(re))e.classList.remove(i);const o=re[t]??re.center;e.classList.add(o)}function se(e,t,o){b(e,"aspect-ratio",t),b(e,"width",`${o}%`)}var le=/^[A-Za-z0-9]+$/;function de(e){return{provider:e.provider,videoId:e.videoId,...e.hash?{hash:e.hash}:{}}}function ce(o,i){const n=o.providers,r=function(e){const t=new Set(e);return e=>!e.hasAttribute("srcdoc")&&function(e,t){const o=H(e);return!!o&&"https:"===o.protocol&&t.has(o.hostname.toLowerCase())}(e.getAttribute("src")??"",t)}(function(e=L){const t=/* @__PURE__ */new Set;for(const o of e)for(const e of o.embedHostnames)t.add(e.toLowerCase());return t}(n));return{type:"video",group:"block",isVoid:!0,selectable:!0,attrs:{provider:{default:""},videoId:{default:""},hash:{default:""},aspectRatio:{default:o.defaultAspectRatio},widthPercent:{default:o.defaultWidthPercent},align:{default:"center"},title:{default:""},caption:{default:""},privacy:{default:o.privacy}},toDOM(e){const t=K(e.attrs,o),r=x("figure",e.id);r.className="notectl-video",r.setAttribute("data-void","true"),r.setAttribute("data-selectable","true"),r.setAttribute("data-video-provider",t.provider),r.setAttribute("data-video-id",t.videoId),t.hash&&r.setAttribute("data-video-hash",t.hash),ae(r,t.align),r.setAttribute("aria-label",i.videoAria(N(t.provider,n),t.title));const a=document.createElement("div");a.className="notectl-video__frame",se(a,t.aspectRatio,t.widthPercent);const s=R(de(t),n);if(s){const e=document.createElement("a");e.className="notectl-video__fallback-link",e.href=s,e.rel="noopener noreferrer",e.textContent=t.title||s,a.appendChild(e)}if(r.appendChild(a),t.caption){const e=document.createElement("figcaption");e.className="notectl-video__caption",e.textContent=t.caption,r.appendChild(e)}return r},toHTML(i){const r=K(i.attrs,o),a=de(r),s=R(a,n),l=[`data-video-provider="${t(r.provider)}"`,`data-video-id="${t(r.videoId)}"`,`data-video-ratio="${t(r.aspectRatio)}"`,`data-video-width="${r.widthPercent}"`,`data-video-privacy="${r.privacy?"true":"false"}"`];r.hash&&l.push(`data-video-hash="${t(r.hash)}"`),r.title&&l.push(`data-video-title="${t(r.title)}"`);const d=o.useProviderThumbnail?$(a,n):void 0,c=d?`<img src="${t(d)}" alt="">`:e(r.title||s||""),u=s?`<a href="${t(s)}" rel="noopener noreferrer">${c}</a>`:c,p=r.caption?`<figcaption>${e(r.caption)}</figcaption>`:"";return`<figure ${l.join(" ")}>${u}${p}</figure>`},parseHTML:[{tag:"figure",priority:60,getAttrs:e=>function(e,t){const o=e.getAttribute("data-video-provider"),i=e.getAttribute("data-video-id");if(!o||!i)return!1;if(!U(i))return!1;if(!S(o,t.providers))return!1;const n=e.getAttribute("data-video-title")??e.querySelector("a")?.textContent?.trim()??e.getAttribute("aria-label")??"",r=e.querySelector("figcaption")?.textContent?.trim()??"",a=e.getAttribute("data-video-width"),s={provider:o,videoId:i,aspectRatio:D(e.getAttribute("data-video-ratio")??void 0,t),widthPercent:T(a?Number.parseFloat(a):t.defaultWidthPercent,t),align:"center",title:n,privacy:"false"!==e.getAttribute("data-video-privacy")},l=e.getAttribute("data-video-hash");return l&&le.test(l)&&(s.hash=l),r&&(s.caption=r),s}(e,o)},{tag:"iframe",priority:60,getAttrs:e=>function(e,t){const o=I(e.getAttribute("src")??"",t.providers);if(!o||!U(o.videoId))return!1;const i={provider:o.provider,videoId:o.videoId,aspectRatio:ue(e,t),widthPercent:t.defaultWidthPercent,align:"center",title:e.getAttribute("title")??"",privacy:t.privacy};return o.hash&&(i.hash=o.hash),i}(e,o)}],sanitize:{tags:["figure","figcaption","a","img","iframe"],attrs:["href","rel","src","alt","title","allow","allowfullscreen","referrerpolicy","loading","width","height","frameborder","class","style"],elementValidators:{iframe:r}}}}function ue(e,t){const o=Number.parseFloat(e.getAttribute("width")??""),i=Number.parseFloat(e.getAttribute("height")??"");return Number.isFinite(o)&&Number.isFinite(i)&&o>0&&i>0?D(`${o}/${i}`,t):t.defaultAspectRatio}function pe(e,t,o){const i=function(e,t,o){const i=S(e.provider,t);return i?i.buildEmbedUrl(e,o):null}({provider:e.provider,videoId:e.videoId,...e.hash?{hash:e.hash}:{}},t.providers,{privacy:e.privacy,autoplay:!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches})??"",n=document.createElement("iframe");return n.className="notectl-video__iframe",n.setAttribute("src",i),n.setAttribute("title",e.title||o.providerBadge(N(e.provider,t.providers))),n.setAttribute("allow","autoplay; fullscreen; picture-in-picture; encrypted-media"),n.setAttribute("allowfullscreen","true"),n.setAttribute("referrerpolicy","no-referrer"),n.setAttribute("loading","lazy"),n.setAttribute("frameborder","0"),n}var he=class{frame;getAttrs;config;locale;announce;facadeButton=null;player=null;iframe=null;escapeHandler=null;renderedKey="";constructor(e){this.frame=e.frame,this.getAttrs=e.getAttrs,this.config=e.config,this.locale=e.locale,this.announce=e.announce,this.renderFacade()}get isActive(){return null!==this.player}facadeKey(e){return[e.provider,e.videoId,e.hash??"",e.privacy,e.title,this.config.useProviderThumbnail].join("|")}renderFacade(){this.facadeButton?.remove();const e=this.getAttrs();this.renderedKey=this.facadeKey(e);const t=document.createElement("button");t.type="button",t.className="notectl-video__facade",t.setAttribute("aria-label",this.locale.play(e.title));const o=document.createElement("span");if(o.className="notectl-video__poster",o.setAttribute("aria-hidden","true"),this.config.useProviderThumbnail){const t=$({provider:e.provider,videoId:e.videoId},this.config.providers);t&&b(o,"background-image",`url("${t}")`)}const i=document.createElement("span");i.className="notectl-video__play-icon",i.setAttribute("aria-hidden","true"),i.innerHTML='<svg viewBox="0 0 68 48" width="48" height="34" aria-hidden="true" focusable="false"><path d="M66.5 7.7c-.8-2.9-2.5-5.4-5.4-6.2C55.8.1 34 0 34 0S12.2.1 6.9 1.5C4 2.3 2.3 4.8 1.5 7.7.1 13 0 24 0 24s.1 11 1.5 16.3c.8 2.9 2.5 5.4 5.4 6.2C12.2 47.9 34 48 34 48s21.8-.1 27.1-1.5c2.9-.8 4.6-3.3 5.4-6.2C67.9 35 68 24 68 24s-.1-11-1.5-16.3z" fill="currentColor"/><path d="M45 24 27 14v20z" fill="#fff"/></svg>';const n=document.createElement("span");n.className="notectl-video__badge",n.setAttribute("aria-hidden","true"),n.textContent=this.locale.providerBadge(N(e.provider,this.config.providers)),t.append(o,i,n),t.addEventListener("mousedown",e=>e.stopPropagation()),t.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),this.activate()}),this.facadeButton=t,this.frame.insertBefore(t,this.frame.firstChild)}update(){const e=this.getAttrs(),t=this.facadeKey(e);if(t!==this.renderedKey){if(this.renderedKey=t,this.isActive&&this.iframe){const t=pe(e,this.config,this.locale);return this.iframe.replaceWith(t),void(this.iframe=t)}this.renderFacade()}}activate(){if(this.isActive||!this.facadeButton)return;const e=this.getAttrs(),t=document.createElement("div");t.className="notectl-video__player";const o=document.createElement("button");o.type="button",o.className="notectl-video__exit",o.setAttribute("aria-label",this.locale.closePlayer),o.innerHTML='<svg viewBox="0 0 24 24" width="20" height="20" aria-hidden="true" focusable="false"><path d="M19 6.4 17.6 5 12 10.6 6.4 5 5 6.4 10.6 12 5 17.6 6.4 19 12 13.4 17.6 19 19 17.6 13.4 12z" fill="currentColor"/></svg>',o.addEventListener("mousedown",e=>e.stopPropagation()),o.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),this.deactivate(!0)});const i=pe(e,this.config,this.locale);t.append(o,i),this.facadeButton.remove(),this.facadeButton=null,this.frame.insertBefore(t,this.frame.firstChild),this.player=t,this.iframe=i,this.escapeHandler=e=>{"Escape"===e.key&&(e.stopPropagation(),this.deactivate(!0))},this.frame.addEventListener("keydown",this.escapeHandler),i.focus(),this.announce(this.locale.enteredPlayer(e.title))}deactivate(e){this.player&&(this.escapeHandler&&(this.frame.removeEventListener("keydown",this.escapeHandler),this.escapeHandler=null),this.player.remove(),this.player=null,this.iframe=null,this.renderFacade(),e&&this.facadeButton?.focus(),this.announce(this.locale.exitedPlayer))}destroy(){this.escapeHandler&&(this.frame.removeEventListener("keydown",this.escapeHandler),this.escapeHandler=null),this.player?.remove(),this.player=null,this.iframe=null,this.facadeButton?.remove(),this.facadeButton=null}},me=["w","e"],ve={w:-1,e:1},fe=null;function be(){fe?.remove(),fe=null}function ge(e,t,o,i,n,r){let a=0,s=0,l=0,d=0,c=ve[t];const u=e=>{const t=(e.clientX-a)*c;var o,r;o=s+(l>0?t/l*100:0),r=n.minPercent,d=Math.max(r,Math.min(100,o)),n.applyLiveWidth(d),i.textContent=n.formatPercent(Math.round(d))},p=e=>{document.removeEventListener("pointermove",u),document.removeEventListener("pointerup",p),o.classList.remove("notectl-video__resize-overlay--active"),i.classList.remove("notectl-video__size-indicator--visible"),be(),n.commit(Math.round(d)),e.target?.releasePointerCapture?.(e.pointerId)};r(()=>{document.removeEventListener("pointermove",u),document.removeEventListener("pointerup",p)}),e.addEventListener("pointerdown",e=>{e.preventDefault(),e.stopPropagation(),a=e.clientX,s=n.getWidthPercent(),d=s,l=n.getReferenceWidth(),c=n.isRtl()?-ve[t]:ve[t],o.classList.add("notectl-video__resize-overlay--active"),i.textContent=n.formatPercent(Math.round(s)),i.classList.add("notectl-video__size-indicator--visible"),function(e){be(),fe=document.createElement("style");const t=g(e);t&&fe.setAttribute("nonce",t),fe.textContent="*{cursor:ew-resize!important;user-select:none!important}",document.head.appendChild(fe)}(o),e.target.setPointerCapture(e.pointerId),document.addEventListener("pointermove",u),document.addEventListener("pointerup",p)})}function ye(e,t,o){const i=document.createElement("button");return i.type="button",i.className="notectl-video__tool",i.setAttribute("aria-label",e),i.title=e,i.innerHTML=t,i.addEventListener("mousedown",e=>e.preventDefault()),i.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),o()}),i}function xe(e){const{config:t,locale:o,resolvedKeymap:i,announce:n,actions:r}=e;return(e,a,s)=>{const l=document.createElement("figure");l.className="notectl-video",l.setAttribute("data-block-id",e.id),l.setAttribute("data-void","true"),l.setAttribute("data-selectable","true");const d=document.createElement("div");d.className="notectl-video__frame",l.appendChild(d);let c=e.id,u=K(e.attrs,t),p=null,h=null,m=null;const v=new he({frame:d,getAttrs:()=>u,config:t,locale:o,announce:n});function f(e){var i;u=K(e.attrs,t),se(d,u.aspectRatio,u.widthPercent),ae(l,u.align),l.setAttribute("aria-label",o.videoAria(N(u.provider,t.providers),u.title)),(i=u.caption)?(p||(p=document.createElement("figcaption"),p.className="notectl-video__caption",l.appendChild(p)),p.textContent!==i&&(p.textContent=i)):p&&(p.remove(),p=null),v.update(),m?.update(u.align)}function g(){h&&(h.destroy(),h.element.remove(),h=null)}return f(e),{dom:l,contentDOM:null,update:e=>"video"===e.type&&(c=e.id,l.setAttribute("data-block-id",e.id),f(e),!0),selectNode(){l.classList.add("notectl-video--selected"),t.resizable&&!h&&(h=function(e,t){const o=document.createElement("div");o.className="notectl-video__resize-overlay",o.setAttribute("data-notectl-no-print","");const i=document.createElement("div");i.className="notectl-video__size-indicator",o.appendChild(i);let n=null;for(const r of me){const t=document.createElement("div");t.className=`notectl-video__resize-handle notectl-video__resize-handle--${r}`,t.setAttribute("aria-hidden","true"),ge(t,r,o,i,e,e=>{n=e}),o.appendChild(t)}if(t){const e=document.createElement("div");e.className="notectl-video__keyboard-hint",e.setAttribute("aria-hidden","true"),e.textContent=t,o.appendChild(e)}return{element:o,destroy(){n?.(),be()}}}({minPercent:t.minWidthPercent,getWidthPercent:()=>u.widthPercent,getReferenceWidth:()=>l.clientWidth||d.clientWidth,isRtl:()=>"rtl"===y(l),applyLiveWidth:e=>b(d,"width",`${e}%`),commit:e=>function(e){const t=a(),o=t.getBlock(c);if(!o)return;const i=t.getNodePath(c);if(!i)return;const n={...o.attrs??{},widthPercent:e};s(t.transaction("command").setNodeAttr(i,n).build())}(e),formatPercent:e=>`${e}%`},function(e,t){const o=e.shrinkWidth??null,i=e.growWidth??null;return o&&i?t.keyboardResizeHint(_(o),_(i)):""}(i,o)),d.appendChild(h.element)),m||(m=function(e){const{locale:t,actions:o}=e,i=document.createElement("div");i.className="notectl-video__toolbar",i.setAttribute("role","toolbar"),i.setAttribute("aria-label",t.videoOptions),i.setAttribute("data-notectl-no-print",""),i.addEventListener("mousedown",e=>e.stopPropagation());const n=ye(t.editVideo,'<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a1 1 0 0 0 0-1.41l-2.34-2.34a1 1 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z" fill="currentColor"/></svg>',()=>o.edit()),r={start:ye(t.alignStart,'<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3 4h18v2H3V4zm0 7h12v2H3v-2zm0 7h18v2H3v-2zm0-3.5h12v-2H3v2z" fill="currentColor"/></svg>',()=>o.align("start")),center:ye(t.alignCenter,'<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3 4h18v2H3V4zm3 7h12v2H6v-2zm-3 7h18v2H3v-2zm3-3.5h12v-2H6v2z" fill="currentColor"/></svg>',()=>o.align("center")),end:ye(t.alignEnd,'<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3 4h18v2H3V4zm6 7h12v2H9v-2zm-6 7h18v2H3v-2zm6-3.5h12v-2H9v2z" fill="currentColor"/></svg>',()=>o.align("end"))},a=ye(t.deleteVideo,'<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M6 19a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z" fill="currentColor"/></svg>',()=>o.remove()),s=()=>{const e=document.createElement("span");return e.className="notectl-video__tool-separator",e.setAttribute("aria-hidden","true"),e};i.append(n,s(),r.start,r.center,r.end,s(),a);const l=e=>{for(const t of["start","center","end"]){const o=t===e;r[t].classList.toggle("notectl-video__tool--active",o),r[t].setAttribute("aria-pressed",o?"true":"false")}};return l(e.initialAlign),{element:i,update:l,destroy(){i.remove()}}}({locale:o,actions:r,initialAlign:u.align}),l.appendChild(m.element))},deselectNode(){l.classList.remove("notectl-video--selected"),g(),m?.destroy(),m=null},destroy(){g(),m?.destroy(),m=null,v.destroy()}}}}function _e(e){return(t,o,i)=>{const n=function(e,t,o){const i=e.trim();if(i&&!/\s/.test(i)){const e=I(i,o);if(e)return{url:i,match:e}}const n=function(e){if(!e)return null;const t=function(e){const t=document.createElement("template");return t.innerHTML=e,t.content}(e),o=t.querySelector("iframe");if(!o)return null;const i=t.cloneNode(!0);for(const n of Array.from(i.querySelectorAll("iframe")))n.remove();return""!==(i.textContent??"").trim()?null:o.getAttribute("src")}(t);if(n){const e=I(n,o);if(e)return{url:R(e,o)??n,match:e}}return null}(t,o,e.providers);if(!n)return null;const r=i.selection;if(!l(r)||!a(r))return null;const s=r.anchor.blockId,d=r.anchor.offset,u=d+n.url.length,p=i.transaction("paste").insertText(s,d,n.url,[]).setSelection(c(s,u)).build();return e.onOffer({blockId:s,start:d,end:u},n.match),p}}var we=class{id="video";name="Video";priority=47;config;resolvedKeymap;context=null;locale=oe;overlay=null;embedPrompt=null;constructor(e){this.config={...M,...e},this.resolvedKeymap={...B,...e?.keymap}}async init(e){this.context=e,this.locale=await f(e,this.config.locale,oe,ne),e.registerStyleSheet('.notectl-video{-webkit-user-select:none;-moz-user-select:none;user-select:none;margin:12px 0;position:relative}.notectl-video--center{text-align:center}.notectl-video--start{text-align:start}.notectl-video--end{text-align:end}.notectl-video__frame{vertical-align:top;text-align:start;background:#000;border-radius:8px;width:100%;max-width:100%;display:inline-block;position:relative;overflow:hidden}.notectl-video__facade{cursor:pointer;color:#fff;background:#14181c;border:0;justify-content:center;align-items:center;width:100%;height:100%;padding:0;display:flex;position:absolute;inset:0}.notectl-video__facade:focus-visible{outline:3px solid var(--notectl-primary);outline-offset:-3px}.notectl-video__poster{background-position:50%;background-repeat:no-repeat;background-size:cover;position:absolute;inset:0}.notectl-video__poster:after{content:"";background:#00000040;position:absolute;inset:0}.notectl-video__play-icon{z-index:1;filter:drop-shadow(0 1px 3px #00000080);transition:transform .12s;display:inline-flex;position:relative}.notectl-video__facade:hover .notectl-video__play-icon{transform:scale(1.08)}.notectl-video__badge{z-index:1;bottom:8px;color:#fff;background:#000000a6;border-radius:4px;padding:2px 6px;font-size:12px;font-weight:600;position:absolute;inset-inline-start:8px}.notectl-video__player{position:absolute;inset:0}.notectl-video__iframe{border:0;width:100%;height:100%;display:block;position:absolute;inset:0}.notectl-video__exit{z-index:2;top:6px;cursor:pointer;color:#fff;background:#000000a6;border:0;border-radius:50%;justify-content:center;align-items:center;width:28px;height:28px;display:flex;position:absolute;inset-inline-end:6px}.notectl-video__exit:focus-visible{outline-offset:2px;outline:2px solid #fff}.notectl-video__fallback-link{color:#fff;text-align:center;justify-content:center;align-items:center;padding:8px;text-decoration:underline;display:flex;position:absolute;inset:0}.notectl-video__caption{color:var(--notectl-fg-muted);text-align:center;margin-top:6px;font-size:13px}.notectl-video--selected .notectl-video__frame{outline:2px solid var(--notectl-primary);outline-offset:2px}.notectl-video__resize-overlay{pointer-events:none;position:absolute;inset:0}.notectl-video__resize-handle{border:2px solid var(--notectl-primary);background:var(--notectl-surface-raised);pointer-events:all;cursor:ew-resize;z-index:2;border-radius:6px;width:8px;height:44px;max-height:60%;position:absolute;top:50%;transform:translateY(-50%)}.notectl-video__resize-handle--w{inset-inline-start:-5px}.notectl-video__resize-handle--e{inset-inline-end:-5px}.notectl-video__size-indicator{background:var(--notectl-tooltip-bg);color:var(--notectl-tooltip-fg);white-space:nowrap;pointer-events:none;opacity:0;z-index:3;border-radius:4px;padding:2px 8px;font-size:11px;font-weight:500;transition:opacity .15s;position:absolute;bottom:-28px;left:50%;transform:translate(-50%)}.notectl-video__size-indicator--visible{opacity:1}.notectl-video__keyboard-hint{color:var(--notectl-fg-muted);white-space:nowrap;pointer-events:none;z-index:3;padding:2px 8px;font-size:11px;display:none;position:absolute;bottom:-28px;left:50%;transform:translate(-50%)}.notectl-video--selected .notectl-video__keyboard-hint{display:block}.notectl-video__resize-overlay--active~.notectl-video__keyboard-hint,.notectl-video__resize-overlay--active .notectl-video__keyboard-hint{display:none}.notectl-video__toolbar{border:1px solid var(--notectl-border);background:var(--notectl-surface-overlay);box-shadow:0 2px 8px var(--notectl-shadow);z-index:10;border-radius:6px;align-items:center;gap:2px;padding:2px;display:flex;position:absolute;top:-44px;left:50%;transform:translate(-50%)}.notectl-video__tool{cursor:pointer;width:28px;height:28px;color:var(--notectl-fg);background:0 0;border:none;border-radius:4px;justify-content:center;align-items:center;display:flex}.notectl-video__tool:hover{background:var(--notectl-hover-bg)}.notectl-video__tool--active{background:var(--notectl-active-bg);color:var(--notectl-primary)}.notectl-video__tool:focus-visible{outline:2px solid var(--notectl-primary);outline-offset:1px}.notectl-video__tool svg{width:16px;height:16px}.notectl-video__tool-separator{background:var(--notectl-border);width:1px;height:18px;margin:0 2px}@media (prefers-reduced-motion:reduce){.notectl-video__play-icon,.notectl-video__size-indicator{transition:none}}@media (forced-colors:active){.notectl-video__frame{outline:1px solid canvastext}.notectl-video__facade{border:1px solid buttontext}.notectl-video__play-icon{forced-color-adjust:none}.notectl-video__resize-handle{background:buttonface;border-color:buttontext}.notectl-video--selected .notectl-video__frame{outline:2px solid highlight}}'),e.registerStyleSheet(".notectl-video-overlay{z-index:1000;box-sizing:border-box;border:1px solid var(--notectl-border);background:var(--notectl-surface-overlay);min-width:300px;max-width:92vw;color:var(--notectl-fg);box-shadow:0 6px 24px var(--notectl-shadow);border-radius:8px;padding:12px;position:fixed}.notectl-video-popup{flex-direction:column;gap:10px;display:flex}.notectl-video-popup__field{flex-direction:column;gap:4px;display:flex}.notectl-video-popup__label{color:var(--notectl-fg-muted);font-size:12px;font-weight:600}.notectl-video-popup__input,.notectl-video-popup__select{box-sizing:border-box;border:1px solid var(--notectl-border);background:var(--notectl-surface-raised);width:100%;color:var(--notectl-fg);font:inherit;border-radius:4px;padding:6px 8px}.notectl-video-popup__input:focus-visible{outline:2px solid var(--notectl-primary);outline-offset:1px}.notectl-video-popup__select:focus-visible{outline:2px solid var(--notectl-primary);outline-offset:1px}.notectl-video-popup__hint{color:var(--notectl-fg-muted);margin:0;font-size:11px}.notectl-video-popup__error:not(:empty){background:var(--notectl-danger-muted);color:var(--notectl-danger);border-radius:4px;margin:0;padding:6px 8px;font-size:12px}.notectl-video-popup__actions{justify-content:flex-end;gap:8px;margin-top:2px;display:flex}.notectl-video-popup__cancel,.notectl-video-popup__submit{cursor:pointer;border:1px solid var(--notectl-border);background:var(--notectl-surface-raised);color:var(--notectl-fg);font:inherit;border-radius:4px;padding:7px 14px}.notectl-video-popup__submit{border-color:var(--notectl-primary);background:var(--notectl-primary);color:var(--notectl-primary-fg);font-weight:600}.notectl-video-popup__cancel:focus-visible{outline:2px solid var(--notectl-primary);outline-offset:2px}.notectl-video-popup__submit:focus-visible{outline:2px solid var(--notectl-primary);outline-offset:2px}.notectl-video-embed-prompt{z-index:1000;border:1px solid var(--notectl-border);background:var(--notectl-surface-overlay);color:var(--notectl-fg);box-shadow:0 4px 16px var(--notectl-shadow);border-radius:8px;align-items:center;gap:8px;padding:6px 8px 6px 12px;font-size:13px;display:flex;position:fixed}.notectl-video-embed-prompt__text{margin-inline-end:4px}.notectl-video-embed-prompt__embed,.notectl-video-embed-prompt__dismiss{cursor:pointer;border:1px solid var(--notectl-border);background:var(--notectl-surface-raised);color:var(--notectl-fg);font:inherit;border-radius:4px;padding:4px 10px}.notectl-video-embed-prompt__embed{border-color:var(--notectl-primary);background:var(--notectl-primary);color:var(--notectl-primary-fg);font-weight:600}.notectl-video-embed-prompt__embed:focus-visible{outline:2px solid var(--notectl-primary);outline-offset:2px}.notectl-video-embed-prompt__dismiss:focus-visible{outline:2px solid var(--notectl-primary);outline-offset:2px}@media (forced-colors:active){.notectl-video-overlay,.notectl-video-embed-prompt{border:1px solid canvastext}.notectl-video-popup__submit,.notectl-video-embed-prompt__embed{border:1px solid buttontext}}"),e.registerNodeSpec(ce(this.config,this.locale)),this.overlay=new ee(e,this.config,this.locale),this.registerNodeView(e),function(e){e.registerCommand("removeVideo",()=>Y(e))}(e),this.registerInsertCommand(e),this.registerResizeCommands(e),this.registerResizeKeymaps(e),this.registerPasteInterceptor(e),this.registerToolbarItem(e)}destroy(){this.embedPrompt?.close(),this.embedPrompt=null,this.overlay?.close(!1),this.overlay=null,this.context=null}onStateChange(e,t,o){this.context&&!this.isVideoSelected(e)&&this.isVideoSelected(t)&&this.announceVideoSelection(t)}registerNodeView(e){e.registerNodeView(W,xe({config:this.config,locale:this.locale,resolvedKeymap:this.resolvedKeymap,announce:t=>e.announce(t),actions:{edit:()=>this.overlay?.openEditForSelected(),align:t=>function(e,t){const o=Z(e.getState());return!!o&&G(e,{...o.block.attrs??{},align:t})}(e,t),remove:()=>Y(e)}}))}registerInsertCommand(e){e.registerCommand("insertVideo",()=>(this.isVideoSelected(e.getState())?this.overlay?.openEditForSelected():this.overlay?.openInsert(),!0))}registerResizeCommands(e){const t=this.config.widthStep,o=this.config.widthStepLarge,i=t=>{const o=function(e,t,o){const i=Z(e.getState());if(!i)return!1;const n=i.block.attrs?.widthPercent??o.defaultWidthPercent,r=T(n+t,o);return r!==n&&G(e,{...i.block.attrs??{},widthPercent:r})}(e,t,this.config);return o&&this.announceCurrentSize(e),o};e.registerCommand("resizeVideoGrow",()=>i(t)),e.registerCommand("resizeVideoShrink",()=>i(-t)),e.registerCommand("resizeVideoGrowLarge",()=>i(o)),e.registerCommand("resizeVideoShrinkLarge",()=>i(-o)),e.registerCommand("resetVideoSize",()=>{const t=function(e,t){const o=Z(e.getState());return!!o&&G(e,{...o.block.attrs??{},widthPercent:t.defaultWidthPercent})}(e,this.config);return t&&e.announce(this.locale.resetToDefaultSize),t})}registerResizeKeymaps(e){const t={growWidth:"resizeVideoGrow",shrinkWidth:"resizeVideoShrink",growWidthLarge:"resizeVideoGrowLarge",shrinkWidthLarge:"resizeVideoShrinkLarge",resetSize:"resetVideoSize"},o={};for(const[i,n]of Object.entries(t)){const t=this.resolvedKeymap[i]??null;t&&(o[t]=()=>e.executeCommand(n))}Object.keys(o).length>0&&e.registerKeymap(o)}registerPasteInterceptor(e){e.registerPasteInterceptor(_e({providers:this.config.providers,onOffer:(e,t)=>this.offerEmbed(e,t)}),{name:"video",priority:40})}offerEmbed(e,t){if(!this.context)return;const o=this.context,i=N(t.provider,this.config.providers);this.embedPrompt?.close(),requestAnimationFrame(()=>{o.announce(this.locale.embedOfferAnnounce(i));const t=function(e,t){const o=e.getBlock(t.blockId);if(!o)return"";const i=n(o);return i.slice(t.start,Math.min(t.end,i.length))}(o.getState(),e);this.embedPrompt=function(e){const{locale:t}=e,o=document.createElement("div");o.className="notectl-video-embed-prompt",o.setAttribute("role","dialog"),o.setAttribute("aria-label",t.embedPrompt);const i=document.createElement("span");i.className="notectl-video-embed-prompt__text",i.textContent=t.embedPrompt;const n=document.createElement("button");n.type="button",n.className="notectl-video-embed-prompt__embed",n.textContent=t.embedConfirm;const r=document.createElement("button");r.type="button",r.className="notectl-video-embed-prompt__dismiss",r.textContent=t.embedDismiss,o.append(i,n,r);let a=null,s=!1;const l=()=>{s||(s=!0,a&&(document.removeEventListener("mousedown",a,!0),a=null),o.remove())},d=e=>{l(),e()};return n.addEventListener("mousedown",e=>e.preventDefault()),n.addEventListener("click",t=>{t.preventDefault(),d(e.onEmbed)}),r.addEventListener("mousedown",e=>e.preventDefault()),r.addEventListener("click",t=>{t.preventDefault(),d(e.onDismiss)}),o.addEventListener("keydown",t=>{"Escape"===t.key&&(t.preventDefault(),t.stopPropagation(),d(e.onDismiss))}),e.container.appendChild(o),w(o),function(e,t){const o=t?t.bottom:window.innerHeight/3,i=t?t.left:window.innerWidth/3,n=e.offsetWidth||240,r=window.innerWidth-n-8,a=Math.max(8,Math.min(i,r)),s=window.innerHeight-e.offsetHeight-8,l=Math.min(o+8,Math.max(8,s));e.style.left=`${Math.round(a)}px`,e.style.top=`${Math.round(l)}px`}(o,e.rect),a=t=>{t.composedPath().includes(o)||d(e.onDismiss)},requestAnimationFrame(()=>{a&&document.addEventListener("mousedown",a,!0),n.focus()}),{close:l}}({container:o.getPluginContainer("top"),rect:Ae(),locale:this.locale,onEmbed:()=>{this.embedPrompt=null,this.overlay?.openInsertReplacingRange(e,t)},onDismiss:()=>{this.embedPrompt=null,o.getContainer().focus()}})})}registerToolbarItem(e){e.registerToolbarItem({id:"video",group:"insert",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 4h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zm6 4.5v7l6-3.5-6-3.5z" fill="currentColor"/></svg>',label:this.locale.insertVideo,tooltip:this.locale.insertVideoTooltip,command:"insertVideo"})}isVideoSelected(e){const t=e.selection;return!!s(t)&&e.getBlock(t.nodeId)?.type===W}announceVideoSelection(e){if(!this.context)return;const t=e.selection;if(!s(t))return;const o=e.getBlock(t.nodeId);if(!o||"video"!==o.type)return;const i=o.attrs?.title??"",n=[i?this.locale.videoSelectedWithTitle(i):this.locale.videoSelected],r=this.resolvedKeymap.shrinkWidth??null,a=this.resolvedKeymap.growWidth??null;r&&a&&n.push(this.locale.resizeHint(_(r),_(a))),this.context.announce(n.join(" "))}announceCurrentSize(e){const t=function(e,t){const o=Z(e);return o?o.block.attrs?.widthPercent??t.defaultWidthPercent:null}(e.getState(),this.config);null!==t&&e.announce(this.locale.videoResized(t))}};function Ae(){const e=window.getSelection();if(!e||0===e.rangeCount)return null;const t=e.getRangeAt(0).getBoundingClientRect();return 0===t.width&&0===t.height&&0===t.top&&0===t.left?null:t}export{B as a,M as i,oe as n,L as o,ne as r,I as s,we as t};
2
- //# sourceMappingURL=VideoPlugin-D3zGQ6QV.mjs.map
1
+ import{i as e,r as t}from"./HTMLUtils-DTpsjZyK.mjs";import{D as o,R as i,j as n,p as r}from"./Document-ssR6hBzG.mjs";import{c as a,d as s,f as l,i as d,n as c,u}from"./Selection-DC6AOGgF.mjs";import{a as p}from"./TypeBrands-Ch9856Gb.mjs";import{a as h}from"./BlockInsertion-CXfXqUZl.mjs";import{t as m}from"./NodeSelectionCommands-CAqIHW_6.mjs";import{c as v,o as f}from"./PluginHelpers-B3gk3VB3.mjs";import{c as b,n as g}from"./StyleRuntime-C0RSqKzG.mjs";import{t as y}from"./Platform-ByobkiCc.mjs";import{n as x}from"./DomUtils-Bf7JLFlx.mjs";import{t as _}from"./ShortcutFormatting-TwiufqeV.mjs";import{a as w}from"./PopupPositioning-CIqgpqlW.mjs";var A=/^[A-Za-z0-9_-]{11}$/,k=/^\d+$/,P=/^[A-Za-z0-9]+$/,C=/^[A-Za-z0-9]+$/;function z(e,t){const o=e.indexOf(t);if(-1!==o)return e[o+1]}function E(e,t,o){const i=t.searchParams.get("h")??o;return i&&P.test(i)?{videoId:e,hash:i}:{videoId:e}}var L=[{id:"youtube",label:"YouTube",hostnames:["youtube.com","www.youtube.com","m.youtube.com","music.youtube.com","youtu.be","youtube-nocookie.com","www.youtube-nocookie.com"],embedHostnames:["www.youtube-nocookie.com","youtube-nocookie.com","www.youtube.com","youtube.com"],parse(e){const t=e.hostname.toLowerCase(),o=e.pathname.split("/").filter(Boolean);if("youtu.be"===t){const e=o[0];return e&&A.test(e)?{videoId:e}:null}const i=e.searchParams.get("v");if(i&&A.test(i))return{videoId:i};for(const n of["embed","shorts","live","v"]){const e=z(o,n);if(e&&A.test(e))return{videoId:e}}return null},buildEmbedUrl(e,t){const o=t.privacy?"www.youtube-nocookie.com":"www.youtube.com",i=V({rel:"0",...t.autoplay?{autoplay:"1"}:{}});return`https://${o}/embed/${e.videoId}${i}`},buildWatchUrl:e=>`https://www.youtube.com/watch?v=${e.videoId}`,thumbnailUrl:e=>`https://i.ytimg.com/vi/${e.videoId}/hqdefault.jpg`},{id:"vimeo",label:"Vimeo",hostnames:["vimeo.com","www.vimeo.com","player.vimeo.com"],embedHostnames:["player.vimeo.com"],parse(e){const t=e.pathname.split("/").filter(Boolean),o=z(t,"video");if(o&&k.test(o))return E(o,e,void 0);const i=t.find(e=>k.test(e));return i?E(i,e,t[t.indexOf(i)+1]):null},buildEmbedUrl(e,t){const o=V({...e.hash?{h:e.hash}:{},...t.privacy?{dnt:"1"}:{},...t.autoplay?{autoplay:"1"}:{}});return`https://player.vimeo.com/video/${e.videoId}${o}`},buildWatchUrl(e){const t=`https://vimeo.com/${e.videoId}`;return e.hash?`${t}/${e.hash}`:t}},{id:"dailymotion",label:"Dailymotion",hostnames:["dailymotion.com","www.dailymotion.com","geo.dailymotion.com","dai.ly"],embedHostnames:["www.dailymotion.com","geo.dailymotion.com"],parse(e){const t=e.hostname.toLowerCase(),o=e.pathname.split("/").filter(Boolean);if("dai.ly"===t){const e=o[0];return e&&C.test(e)?{videoId:e}:null}const i=z(o,"video");return i&&C.test(i)?{videoId:i}:null},buildEmbedUrl(e,t){const o=V(t.autoplay?{autoplay:"1"}:{});return`https://www.dailymotion.com/embed/video/${e.videoId}${o}`},buildWatchUrl:e=>`https://www.dailymotion.com/video/${e.videoId}`,thumbnailUrl:e=>`https://www.dailymotion.com/thumbnail/video/${e.videoId}`}];function I(e,t=L){const o=H(e);if(!o)return null;if("https:"!==o.protocol&&"http:"!==o.protocol)return null;const i=o.hostname.toLowerCase();for(const n of t){if(!n.hostnames.includes(i))continue;const e=n.parse(o);if(e)return{provider:n.id,videoId:e.videoId,...e.hash?{hash:e.hash}:{}}}return null}function S(e,t=L){return t.find(t=>t.id===e)}function R(e,t){const o=S(e.provider,t);return o?o.buildWatchUrl(e):null}function $(e,t){return S(e.provider,t)?.thumbnailUrl?.(e)}function N(e,t=L){return S(e,t)?.label??e}function H(e){try{return new URL(e.trim())}catch{return null}}function V(e){const t=Object.entries(e);return 0===t.length?"":`?${t.map(([e,t])=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`).join("&")}`}var B={growWidth:"Mod-Shift-ArrowRight",shrinkWidth:"Mod-Shift-ArrowLeft",growWidthLarge:"Mod-Shift-Alt-ArrowRight",shrinkWidthLarge:"Mod-Shift-Alt-ArrowLeft",resetSize:"Mod-Shift-0"},M={providers:L,facade:!0,useProviderThumbnail:!1,privacy:!0,allowedAspectRatios:["16/9","4/3","1/1","9/16"],defaultAspectRatio:"16/9",defaultWidthPercent:100,minWidthPercent:25,widthStep:10,widthStepLarge:25,resizable:!0},W="video",j=/^\d+(?:\.\d+)?\s*\/\s*\d+(?:\.\d+)?$/;function D(e,t){if(!e||!j.test(e.trim()))return t.defaultAspectRatio;const[o,i]=e.split("/");return`${o?.trim()} / ${i?.trim()}`}function T(e,t){return Number.isFinite(e)?Math.max(t.minWidthPercent,Math.min(100,Math.round(e))):t.defaultWidthPercent}var O=/^[A-Za-z0-9_-]+$/;function U(e){return e.length>0&&e.length<=64&&O.test(e)}function K(e,t){return{provider:e?.provider??"",videoId:e?.videoId??"",...e?.hash?{hash:e.hash}:{},aspectRatio:D(e?.aspectRatio,t),widthPercent:T(e?.widthPercent??t.defaultWidthPercent,t),align:e?.align??"center",title:e?.title??"",...e?.caption?{caption:e.caption}:{},privacy:e?.privacy??t.privacy}}function F(e,t){const o=I(e.url,t.providers);return o?{provider:o.provider,videoId:o.videoId,...o.hash?{hash:o.hash}:{},aspectRatio:D(e.aspectRatio,t),widthPercent:t.defaultWidthPercent,align:"center",title:e.title,...e.caption?{caption:e.caption}:{},privacy:t.privacy}:null}function q(e){return{provider:e.provider,videoId:e.videoId,aspectRatio:e.aspectRatio,widthPercent:e.widthPercent,align:e.align,title:e.title,privacy:e.privacy,...e.hash?{hash:e.hash}:{},...e.caption?{caption:e.caption}:{}}}function Z(e){const t=e.selection;if(!s(t))return null;const o=e.getBlock(t.nodeId);if(!o||"video"!==o.type)return null;const i=e.getNodePath(t.nodeId);return i?{block:o,path:i}:null}function G(e,t){const o=e.getState(),i=Z(o);return!!i&&(e.dispatch(o.transaction("command").setNodeAttr(i.path,t).build()),!0)}function Y(e){const t=e.getState(),o=Z(t);if(!o)return!1;const i=m(t,d(o.block.id,o.path));return!!i&&(e.dispatch(i),!0)}var X=0;function J(e){return`${e}-${X+=1}`}function Q(e,t){const o=J("notectl-video-field"),i=document.createElement("div");i.className="notectl-video-popup__field";const n=document.createElement("label");n.className="notectl-video-popup__label",n.setAttribute("for",o),n.textContent=t.label,i.appendChild(n);const r=document.createElement("input");r.id=o,r.type=t.type,r.value=t.value,r.placeholder=t.placeholder,r.className="notectl-video-popup__input",r.setAttribute("aria-label",t.ariaLabel),t.required&&r.setAttribute("aria-required","true");const a=[];if(t.hint){const e=`${o}-hint`,n=document.createElement("p");n.id=e,n.className="notectl-video-popup__hint",n.textContent=t.hint,i.appendChild(n),a.push(e)}return t.describedBy&&a.push(t.describedBy),a.length>0&&r.setAttribute("aria-describedby",a.join(" ")),i.insertBefore(r,i.children[1]??null),e.appendChild(i),r}var ee=class{context;config;locale;panel=null;outsideHandler=null;constructor(e,t,o){this.context=e,this.config=t,this.locale=o}get isOpen(){return null!==this.panel}openInsert(){this.context.isReadOnly()||this.open({rect:te(),mode:"insert",label:this.locale.insertDialogLabel,onSubmit:e=>{const t=F(e,this.config);t&&function(e,t){const n=e.getState(),a=n.selection;if(u(a))return!1;const l=q(t),c=s(a)?a.nodeId:a.anchor.blockId,m=function(e,t){if("table_cell"===e.getBlock(t)?.type)return t;const o=e.getNodePath(t);if(o)for(const i of o)if("table_cell"===e.getBlock(i)?.type)return i}(n,c);m?function(e,t,n,a){const s=e.getNodePath(n),l=e.getBlock(n);if(!s||!l)return!1;const c=r(p(W),[],void 0,a),u=e.transaction("command"),h=o(l);for(let o=h.length-1;o>=0;o--){const e=l.children.findIndex(e=>i(e)&&e.id===h[o]?.id);-1!==e&&u.removeNode(s,e)}u.insertNode(s,0,c),u.setSelection(d(c.id,[...s,c.id])),t.dispatch(u.build())}(n,e,m,l):function(e,t,o,i){const n=r(p(W),[],void 0,i),a=e.transaction("command");!!h(e,a,o,n)&&(a.setSelection(d(n.id,[])),t.dispatch(a.build()))}(n,e,c,l)}(this.context,t)}})}openInsertReplacingRange(e,t){this.context.isReadOnly()||this.open({rect:te(),mode:"insert",label:this.locale.insertDialogLabel,initial:{url:t},onSubmit:t=>{const o=F(t,this.config);o&&function(e,t,o){const a=e.getState(),s=a.getBlock(t.blockId);if(!s)return!1;const l=function(e,t){const o=e.getNodePath(t);if(!o||0===o.length)return null;if(1===o.length){const o=e.doc.children.findIndex(e=>e.id===t);return-1===o?null:{parentPath:[],index:o}}const n=o[o.length-2],r=n?e.getBlock(n):void 0;if(!r)return null;const a=r.children.findIndex(e=>i(e)&&e.id===t);return-1===a?null:{parentPath:o.slice(0,-1),index:a}}(a,t.blockId);if(!l)return!1;const c=0===Math.max(0,n(s).length-(t.end-t.start))&&"paragraph"===s.type,u=r(p(W),[],void 0,q(o)),h=0===l.parentPath.length?[]:[...l.parentPath,u.id],m=a.transaction("command");c?(m.removeNode(l.parentPath,l.index),m.insertNode(l.parentPath,l.index,u),0===l.parentPath.length&&l.index>=a.doc.children.length-1&&m.insertNode([],l.index+1,r(p("paragraph")))):(m.deleteTextAt(t.blockId,t.start,t.end),m.insertNode(l.parentPath,l.index+1,u)),m.setSelection(d(u.id,h)),e.dispatch(m.build())}(this.context,e,o)}})}openEditForSelected(){if(this.context.isReadOnly())return;const e=this.context.getState(),t=e.selection;if(!s(t))return;const o=e.getBlock(t.nodeId);if(!o||"video"!==o.type)return;const i=K(o.attrs,this.config),n={url:R({provider:i.provider,videoId:i.videoId,...i.hash?{hash:i.hash}:{}},this.config.providers)??"",title:i.title,caption:i.caption??"",aspectRatio:i.aspectRatio};this.open({rect:this.videoRect(t.nodeId),mode:"edit",label:this.locale.editDialogLabel,initial:n,onSubmit:e=>{!function(e,t,o){const i=Z(e.getState());if(!i)return!1;const n=I(t.url,o.providers);if(!n)return!1;const r=function(e,t){const o={};for(const[i,n]of Object.entries(e??{}))t.includes(i)||"string"!=typeof n&&"number"!=typeof n&&"boolean"!=typeof n||(o[i]=n);return o}(i.block.attrs,["hash","caption"]);r.provider=n.provider,r.videoId=n.videoId,r.title=t.title,r.aspectRatio=D(t.aspectRatio,o),n.hash&&(r.hash=n.hash),t.caption.trim()&&(r.caption=t.caption.trim()),G(e,r)}(this.context,e,this.config)}})}close(e){this.panel&&(this.outsideHandler&&(document.removeEventListener("mousedown",this.outsideHandler,!0),this.outsideHandler=null),this.panel.remove(),this.panel=null,e&&this.context.getContainer().focus())}open(e){this.close(!1);const t=document.createElement("div");t.className="notectl-video-overlay",t.setAttribute("role","dialog"),t.setAttribute("aria-modal","false"),t.setAttribute("aria-label",e.label),this.panel=t,function(e,t){const{config:o,locale:i,initial:n,mode:r}=t;e.classList.add("notectl-video-popup");const a=J("notectl-video-error"),s=document.createElement("p");s.id=a,s.className="notectl-video-popup__error",s.setAttribute("role","alert");const l=Q(e,{label:i.urlLabel,ariaLabel:i.urlAria,placeholder:i.urlPlaceholder,value:n?.url??"",type:"url",required:!0,describedBy:a}),d=Q(e,{label:i.titleLabel,ariaLabel:i.titleAria,placeholder:i.titlePlaceholder,value:n?.title??"",type:"text",required:!0,hint:i.titleHint}),c=Q(e,{label:i.captionLabel,ariaLabel:i.captionAria,placeholder:i.captionPlaceholder,value:n?.caption??"",type:"text"}),u=function(e,t,o,i){const n=J("notectl-video-field"),r=document.createElement("div");r.className="notectl-video-popup__field";const a=document.createElement("label");a.className="notectl-video-popup__label",a.setAttribute("for",n),a.textContent=o.aspectRatioLabel,r.appendChild(a);const s=document.createElement("select");s.id=n,s.className="notectl-video-popup__select",s.setAttribute("aria-label",o.aspectRatioAria);const l=t.allowedAspectRatios.includes(i)?t.allowedAspectRatios:[i,...t.allowedAspectRatios];for(const d of l){const e=document.createElement("option");e.value=d,e.textContent=d,d===i&&(e.selected=!0),s.appendChild(e)}return r.appendChild(s),e.appendChild(r),s}(e,o,i,n?.aspectRatio??o.defaultAspectRatio);e.appendChild(s);const p=document.createElement("div");p.className="notectl-video-popup__actions";const h=document.createElement("button");h.type="button",h.className="notectl-video-popup__cancel",h.textContent=i.cancelButton;const m=document.createElement("button");m.type="button",m.className="notectl-video-popup__submit",m.textContent="edit"===r?i.updateButton:i.insertButton,m.setAttribute("aria-label","edit"===r?i.updateAria:i.insertAria),p.append(h,m),e.appendChild(p);const v=(e,t)=>{s.textContent=e,t.focus()},f=()=>{const e=l.value.trim();if(!I(e,o.providers))return void v(i.invalidUrl,l);const n=d.value.trim();n?(s.textContent="",t.onSubmit({url:e,title:n,caption:c.value.trim(),aspectRatio:u.value}),t.onClose()):v(i.titleRequired,d)};h.addEventListener("mousedown",e=>e.preventDefault()),h.addEventListener("click",e=>{e.preventDefault(),t.onClose()}),m.addEventListener("mousedown",e=>e.preventDefault()),m.addEventListener("click",e=>{e.preventDefault(),f()});for(const b of[l,d,c])b.addEventListener("keydown",e=>{"Enter"===e.key&&(e.preventDefault(),f())});requestAnimationFrame(()=>l.focus())}(t,{mode:e.mode,initial:e.initial,config:this.config,locale:this.locale,onSubmit:e.onSubmit,onClose:()=>this.close(!0)}),t.addEventListener("keydown",e=>{"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),this.close(!0))}),this.context.getPluginContainer("top").appendChild(t),w(t),function(e,t){const o=t?t.bottom:window.innerHeight/3,i=t?t.left:window.innerWidth/3,n=e.offsetWidth||320,r=window.innerWidth-n-8,a=Math.max(8,Math.min(i,r)),s=window.innerHeight-e.offsetHeight-8,l=Math.min(o+8,Math.max(8,s));e.style.left=`${Math.round(a)}px`,e.style.top=`${Math.round(l)}px`}(t,e.rect),this.installOutsideHandler()}videoRect(e){const t=this.context.getContainer().querySelector(`[data-block-id="${e}"]`);return t?t.getBoundingClientRect():null}installOutsideHandler(){const e=e=>{this.panel&&!e.composedPath().includes(this.panel)&&this.close(!1)};this.outsideHandler=e,requestAnimationFrame(()=>{this.outsideHandler&&document.addEventListener("mousedown",e,!0)})}};function te(){const e=window.getSelection();if(!e||0===e.rangeCount)return null;const t=e.getRangeAt(0).getBoundingClientRect();return 0===t.width&&0===t.height&&0===t.top&&0===t.left?null:t}var oe={insertVideo:"Insert Video",insertVideoTooltip:"Insert Video",urlLabel:"Video URL",urlPlaceholder:"https://www.youtube.com/watch?v=...",urlAria:"Video URL",titleLabel:"Title",titlePlaceholder:"Describe the video",titleAria:"Video title",titleHint:"Describes the video for screen readers. Required.",captionLabel:"Caption",captionPlaceholder:"Optional visible caption",captionAria:"Video caption",aspectRatioLabel:"Aspect ratio",aspectRatioAria:"Video aspect ratio",insertButton:"Insert",insertAria:"Insert video",updateButton:"Update",updateAria:"Update video",cancelButton:"Cancel",insertDialogLabel:"Insert video",editDialogLabel:"Edit video",invalidUrl:"Enter a YouTube, Vimeo, or Dailymotion video URL.",titleRequired:"Enter a title so screen readers can describe the video.",play:e=>e?`Play video: ${e}`:"Play video",loading:"Loading video...",providerBadge:e=>`${e} video`,closePlayer:"Close video player",videoAria:(e,t)=>t?`${e} video: ${t}`:`${e} video`,videoSelected:"Video selected.",videoSelectedWithTitle:e=>`Video selected: ${e}.`,resizeHint:(e,t)=>`${e} / ${t} to resize.`,keyboardResizeHint:(e,t)=>`${e} / ${t} to resize`,videoResized:e=>`Video resized to ${e} percent width.`,resetToDefaultSize:"Video reset to full width.",enteredPlayer:e=>e?`Playing ${e}. Press Escape to return to the document.`:"Playing video. Press Escape to return to the document.",exitedPlayer:"Returned to the document.",videoOptions:"Video options",editVideo:"Edit video",alignStart:"Align left",alignCenter:"Align center",alignEnd:"Align right",deleteVideo:"Delete video",embedPrompt:"Embed this video?",embedConfirm:"Embed",embedDismiss:"Keep as link",embedOfferAnnounce:e=>`${e} link pasted. Press Embed to turn it into a video, or continue editing to keep it as a link.`,embeddedAnnounce:"Video embedded."},ie=/* #__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar--O0A9OTR.mjs"),"./locales/de.ts":()=>import("./de-BxQIt_1Y.mjs"),"./locales/es.ts":()=>import("./es-BQweZX6P.mjs"),"./locales/fr.ts":()=>import("./fr-C3EKRThN.mjs"),"./locales/hi.ts":()=>import("./hi-L6pJxZam.mjs"),"./locales/pt.ts":()=>import("./pt-Bb908r0n.mjs"),"./locales/ru.ts":()=>import("./ru-DkW9XZFy.mjs"),"./locales/zh.ts":()=>import("./zh-ikm3rSTR.mjs")});async function ne(e){return v(ie,e,oe)}var re={start:"notectl-video--start",center:"notectl-video--center",end:"notectl-video--end"};function ae(e,t){for(const i of Object.values(re))e.classList.remove(i);const o=re[t]??re.center;e.classList.add(o)}function se(e,t,o){b(e,"aspect-ratio",t),b(e,"width",`${o}%`)}var le=/^[A-Za-z0-9]+$/;function de(e){return{provider:e.provider,videoId:e.videoId,...e.hash?{hash:e.hash}:{}}}function ce(o,i){const n=o.providers,r=function(e){const t=new Set(e);return e=>!e.hasAttribute("srcdoc")&&function(e,t){const o=H(e);return!!o&&"https:"===o.protocol&&t.has(o.hostname.toLowerCase())}(e.getAttribute("src")??"",t)}(function(e=L){const t=/* @__PURE__ */new Set;for(const o of e)for(const e of o.embedHostnames)t.add(e.toLowerCase());return t}(n));return{type:"video",group:"block",isVoid:!0,selectable:!0,attrs:{provider:{default:""},videoId:{default:""},hash:{default:""},aspectRatio:{default:o.defaultAspectRatio},widthPercent:{default:o.defaultWidthPercent},align:{default:"center"},title:{default:""},caption:{default:""},privacy:{default:o.privacy}},toDOM(e){const t=K(e.attrs,o),r=x("figure",e.id);r.className="notectl-video",r.setAttribute("data-void","true"),r.setAttribute("data-selectable","true"),r.setAttribute("data-video-provider",t.provider),r.setAttribute("data-video-id",t.videoId),t.hash&&r.setAttribute("data-video-hash",t.hash),ae(r,t.align),r.setAttribute("aria-label",i.videoAria(N(t.provider,n),t.title));const a=document.createElement("div");a.className="notectl-video__frame",se(a,t.aspectRatio,t.widthPercent);const s=R(de(t),n);if(s){const e=document.createElement("a");e.className="notectl-video__fallback-link",e.href=s,e.rel="noopener noreferrer",e.textContent=t.title||s,a.appendChild(e)}if(r.appendChild(a),t.caption){const e=document.createElement("figcaption");e.className="notectl-video__caption",e.textContent=t.caption,r.appendChild(e)}return r},toHTML(i){const r=K(i.attrs,o),a=de(r),s=R(a,n),l=[`data-video-provider="${t(r.provider)}"`,`data-video-id="${t(r.videoId)}"`,`data-video-ratio="${t(r.aspectRatio)}"`,`data-video-width="${r.widthPercent}"`,`data-video-privacy="${r.privacy?"true":"false"}"`];r.hash&&l.push(`data-video-hash="${t(r.hash)}"`),r.title&&l.push(`data-video-title="${t(r.title)}"`);const d=o.useProviderThumbnail?$(a,n):void 0,c=d?`<img src="${t(d)}" alt="">`:e(r.title||s||""),u=s?`<a href="${t(s)}" rel="noopener noreferrer">${c}</a>`:c,p=r.caption?`<figcaption>${e(r.caption)}</figcaption>`:"";return`<figure ${l.join(" ")}>${u}${p}</figure>`},parseHTML:[{tag:"figure",priority:60,getAttrs:e=>function(e,t){const o=e.getAttribute("data-video-provider"),i=e.getAttribute("data-video-id");if(!o||!i)return!1;if(!U(i))return!1;if(!S(o,t.providers))return!1;const n=e.getAttribute("data-video-title")??e.querySelector("a")?.textContent?.trim()??e.getAttribute("aria-label")??"",r=e.querySelector("figcaption")?.textContent?.trim()??"",a=e.getAttribute("data-video-width"),s={provider:o,videoId:i,aspectRatio:D(e.getAttribute("data-video-ratio")??void 0,t),widthPercent:T(a?Number.parseFloat(a):t.defaultWidthPercent,t),align:"center",title:n,privacy:"false"!==e.getAttribute("data-video-privacy")},l=e.getAttribute("data-video-hash");return l&&le.test(l)&&(s.hash=l),r&&(s.caption=r),s}(e,o)},{tag:"iframe",priority:60,getAttrs:e=>function(e,t){const o=I(e.getAttribute("src")??"",t.providers);if(!o||!U(o.videoId))return!1;const i={provider:o.provider,videoId:o.videoId,aspectRatio:ue(e,t),widthPercent:t.defaultWidthPercent,align:"center",title:e.getAttribute("title")??"",privacy:t.privacy};return o.hash&&(i.hash=o.hash),i}(e,o)}],sanitize:{tags:["figure","figcaption","a","img","iframe"],attrs:["href","rel","src","alt","title","allow","allowfullscreen","referrerpolicy","loading","width","height","frameborder","class","style"],elementValidators:{iframe:r}}}}function ue(e,t){const o=Number.parseFloat(e.getAttribute("width")??""),i=Number.parseFloat(e.getAttribute("height")??"");return Number.isFinite(o)&&Number.isFinite(i)&&o>0&&i>0?D(`${o}/${i}`,t):t.defaultAspectRatio}function pe(e,t,o){const i=function(e,t,o){const i=S(e.provider,t);return i?i.buildEmbedUrl(e,o):null}({provider:e.provider,videoId:e.videoId,...e.hash?{hash:e.hash}:{}},t.providers,{privacy:e.privacy,autoplay:!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches})??"",n=document.createElement("iframe");return n.className="notectl-video__iframe",n.setAttribute("src",i),n.setAttribute("title",e.title||o.providerBadge(N(e.provider,t.providers))),n.setAttribute("allow","autoplay; fullscreen; picture-in-picture; encrypted-media"),n.setAttribute("allowfullscreen","true"),n.setAttribute("referrerpolicy","no-referrer"),n.setAttribute("loading","lazy"),n.setAttribute("frameborder","0"),n}var he=class{frame;getAttrs;config;locale;announce;facadeButton=null;player=null;iframe=null;escapeHandler=null;renderedKey="";constructor(e){this.frame=e.frame,this.getAttrs=e.getAttrs,this.config=e.config,this.locale=e.locale,this.announce=e.announce,this.renderFacade()}get isActive(){return null!==this.player}facadeKey(e){return[e.provider,e.videoId,e.hash??"",e.privacy,e.title,this.config.useProviderThumbnail].join("|")}renderFacade(){this.facadeButton?.remove();const e=this.getAttrs();this.renderedKey=this.facadeKey(e);const t=document.createElement("button");t.type="button",t.className="notectl-video__facade",t.setAttribute("aria-label",this.locale.play(e.title));const o=document.createElement("span");if(o.className="notectl-video__poster",o.setAttribute("aria-hidden","true"),this.config.useProviderThumbnail){const t=$({provider:e.provider,videoId:e.videoId},this.config.providers);t&&b(o,"background-image",`url("${t}")`)}const i=document.createElement("span");i.className="notectl-video__play-icon",i.setAttribute("aria-hidden","true"),i.innerHTML='<svg viewBox="0 0 68 48" width="48" height="34" aria-hidden="true" focusable="false"><path d="M66.5 7.7c-.8-2.9-2.5-5.4-5.4-6.2C55.8.1 34 0 34 0S12.2.1 6.9 1.5C4 2.3 2.3 4.8 1.5 7.7.1 13 0 24 0 24s.1 11 1.5 16.3c.8 2.9 2.5 5.4 5.4 6.2C12.2 47.9 34 48 34 48s21.8-.1 27.1-1.5c2.9-.8 4.6-3.3 5.4-6.2C67.9 35 68 24 68 24s-.1-11-1.5-16.3z" fill="currentColor"/><path d="M45 24 27 14v20z" fill="#fff"/></svg>';const n=document.createElement("span");n.className="notectl-video__badge",n.setAttribute("aria-hidden","true"),n.textContent=this.locale.providerBadge(N(e.provider,this.config.providers)),t.append(o,i,n),t.addEventListener("mousedown",e=>e.stopPropagation()),t.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),this.activate()}),this.facadeButton=t,this.frame.insertBefore(t,this.frame.firstChild)}update(){const e=this.getAttrs(),t=this.facadeKey(e);if(t!==this.renderedKey){if(this.renderedKey=t,this.isActive&&this.iframe){const t=pe(e,this.config,this.locale);return this.iframe.replaceWith(t),void(this.iframe=t)}this.renderFacade()}}activate(){if(this.isActive||!this.facadeButton)return;const e=this.getAttrs(),t=document.createElement("div");t.className="notectl-video__player";const o=document.createElement("button");o.type="button",o.className="notectl-video__exit",o.setAttribute("aria-label",this.locale.closePlayer),o.innerHTML='<svg viewBox="0 0 24 24" width="20" height="20" aria-hidden="true" focusable="false"><path d="M19 6.4 17.6 5 12 10.6 6.4 5 5 6.4 10.6 12 5 17.6 6.4 19 12 13.4 17.6 19 19 17.6 13.4 12z" fill="currentColor"/></svg>',o.addEventListener("mousedown",e=>e.stopPropagation()),o.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),this.deactivate(!0)});const i=pe(e,this.config,this.locale);t.append(o,i),this.facadeButton.remove(),this.facadeButton=null,this.frame.insertBefore(t,this.frame.firstChild),this.player=t,this.iframe=i,this.escapeHandler=e=>{"Escape"===e.key&&(e.stopPropagation(),this.deactivate(!0))},this.frame.addEventListener("keydown",this.escapeHandler),i.focus(),this.announce(this.locale.enteredPlayer(e.title))}deactivate(e){this.player&&(this.escapeHandler&&(this.frame.removeEventListener("keydown",this.escapeHandler),this.escapeHandler=null),this.player.remove(),this.player=null,this.iframe=null,this.renderFacade(),e&&this.facadeButton?.focus(),this.announce(this.locale.exitedPlayer))}destroy(){this.escapeHandler&&(this.frame.removeEventListener("keydown",this.escapeHandler),this.escapeHandler=null),this.player?.remove(),this.player=null,this.iframe=null,this.facadeButton?.remove(),this.facadeButton=null}},me=["w","e"],ve={w:-1,e:1},fe=null;function be(){fe?.remove(),fe=null}function ge(e,t,o,i,n,r){let a=0,s=0,l=0,d=0,c=ve[t];const u=e=>{const t=(e.clientX-a)*c;var o,r;o=s+(l>0?t/l*100:0),r=n.minPercent,d=Math.max(r,Math.min(100,o)),n.applyLiveWidth(d),i.textContent=n.formatPercent(Math.round(d))},p=e=>{document.removeEventListener("pointermove",u),document.removeEventListener("pointerup",p),o.classList.remove("notectl-video__resize-overlay--active"),i.classList.remove("notectl-video__size-indicator--visible"),be(),n.commit(Math.round(d)),e.target?.releasePointerCapture?.(e.pointerId)};r(()=>{document.removeEventListener("pointermove",u),document.removeEventListener("pointerup",p)}),e.addEventListener("pointerdown",e=>{e.preventDefault(),e.stopPropagation(),a=e.clientX,s=n.getWidthPercent(),d=s,l=n.getReferenceWidth(),c=n.isRtl()?-ve[t]:ve[t],o.classList.add("notectl-video__resize-overlay--active"),i.textContent=n.formatPercent(Math.round(s)),i.classList.add("notectl-video__size-indicator--visible"),function(e){be(),fe=document.createElement("style");const t=g(e);t&&fe.setAttribute("nonce",t),fe.textContent="*{cursor:ew-resize!important;user-select:none!important}",document.head.appendChild(fe)}(o),e.target.setPointerCapture(e.pointerId),document.addEventListener("pointermove",u),document.addEventListener("pointerup",p)})}function ye(e,t,o){const i=document.createElement("button");return i.type="button",i.className="notectl-video__tool",i.setAttribute("aria-label",e),i.title=e,i.innerHTML=t,i.addEventListener("mousedown",e=>e.preventDefault()),i.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),o()}),i}function xe(e){const{config:t,locale:o,resolvedKeymap:i,announce:n,actions:r}=e;return(e,a,s)=>{const l=document.createElement("figure");l.className="notectl-video",l.setAttribute("data-block-id",e.id),l.setAttribute("data-void","true"),l.setAttribute("data-selectable","true");const d=document.createElement("div");d.className="notectl-video__frame",l.appendChild(d);let c=e.id,u=K(e.attrs,t),p=null,h=null,m=null;const v=new he({frame:d,getAttrs:()=>u,config:t,locale:o,announce:n});function f(e){var i;u=K(e.attrs,t),se(d,u.aspectRatio,u.widthPercent),ae(l,u.align),l.setAttribute("aria-label",o.videoAria(N(u.provider,t.providers),u.title)),(i=u.caption)?(p||(p=document.createElement("figcaption"),p.className="notectl-video__caption",l.appendChild(p)),p.textContent!==i&&(p.textContent=i)):p&&(p.remove(),p=null),v.update(),m?.update(u.align)}function g(){h&&(h.destroy(),h.element.remove(),h=null)}return f(e),{dom:l,contentDOM:null,update:e=>"video"===e.type&&(c=e.id,l.setAttribute("data-block-id",e.id),f(e),!0),selectNode(){l.classList.add("notectl-video--selected"),t.resizable&&!h&&(h=function(e,t){const o=document.createElement("div");o.className="notectl-video__resize-overlay",o.setAttribute("data-notectl-no-print","");const i=document.createElement("div");i.className="notectl-video__size-indicator",o.appendChild(i);let n=null;for(const r of me){const t=document.createElement("div");t.className=`notectl-video__resize-handle notectl-video__resize-handle--${r}`,t.setAttribute("aria-hidden","true"),ge(t,r,o,i,e,e=>{n=e}),o.appendChild(t)}if(t){const e=document.createElement("div");e.className="notectl-video__keyboard-hint",e.setAttribute("aria-hidden","true"),e.textContent=t,o.appendChild(e)}return{element:o,destroy(){n?.(),be()}}}({minPercent:t.minWidthPercent,getWidthPercent:()=>u.widthPercent,getReferenceWidth:()=>l.clientWidth||d.clientWidth,isRtl:()=>"rtl"===y(l),applyLiveWidth:e=>b(d,"width",`${e}%`),commit:e=>function(e){const t=a(),o=t.getBlock(c);if(!o)return;const i=t.getNodePath(c);if(!i)return;const n={...o.attrs??{},widthPercent:e};s(t.transaction("command").setNodeAttr(i,n).build())}(e),formatPercent:e=>`${e}%`},function(e,t){const o=e.shrinkWidth??null,i=e.growWidth??null;return o&&i?t.keyboardResizeHint(_(o),_(i)):""}(i,o)),d.appendChild(h.element)),m||(m=function(e){const{locale:t,actions:o}=e,i=document.createElement("div");i.className="notectl-video__toolbar",i.setAttribute("role","toolbar"),i.setAttribute("aria-label",t.videoOptions),i.setAttribute("data-notectl-no-print",""),i.addEventListener("mousedown",e=>e.stopPropagation());const n=ye(t.editVideo,'<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a1 1 0 0 0 0-1.41l-2.34-2.34a1 1 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z" fill="currentColor"/></svg>',()=>o.edit()),r={start:ye(t.alignStart,'<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3 4h18v2H3V4zm0 7h12v2H3v-2zm0 7h18v2H3v-2zm0-3.5h12v-2H3v2z" fill="currentColor"/></svg>',()=>o.align("start")),center:ye(t.alignCenter,'<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3 4h18v2H3V4zm3 7h12v2H6v-2zm-3 7h18v2H3v-2zm3-3.5h12v-2H6v2z" fill="currentColor"/></svg>',()=>o.align("center")),end:ye(t.alignEnd,'<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3 4h18v2H3V4zm6 7h12v2H9v-2zm-6 7h18v2H3v-2zm6-3.5h12v-2H9v2z" fill="currentColor"/></svg>',()=>o.align("end"))},a=ye(t.deleteVideo,'<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M6 19a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z" fill="currentColor"/></svg>',()=>o.remove()),s=()=>{const e=document.createElement("span");return e.className="notectl-video__tool-separator",e.setAttribute("aria-hidden","true"),e};i.append(n,s(),r.start,r.center,r.end,s(),a);const l=e=>{for(const t of["start","center","end"]){const o=t===e;r[t].classList.toggle("notectl-video__tool--active",o),r[t].setAttribute("aria-pressed",o?"true":"false")}};return l(e.initialAlign),{element:i,update:l,destroy(){i.remove()}}}({locale:o,actions:r,initialAlign:u.align}),l.appendChild(m.element))},deselectNode(){l.classList.remove("notectl-video--selected"),g(),m?.destroy(),m=null},destroy(){g(),m?.destroy(),m=null,v.destroy()}}}}function _e(e){return(t,o,i)=>{const n=function(e,t,o){const i=e.trim();if(i&&!/\s/.test(i)){const e=I(i,o);if(e)return{url:i,match:e}}const n=function(e){if(!e)return null;const t=function(e){const t=document.createElement("template");return t.innerHTML=e,t.content}(e),o=t.querySelector("iframe");if(!o)return null;const i=t.cloneNode(!0);for(const n of Array.from(i.querySelectorAll("iframe")))n.remove();return""!==(i.textContent??"").trim()?null:o.getAttribute("src")}(t);if(n){const e=I(n,o);if(e)return{url:R(e,o)??n,match:e}}return null}(t,o,e.providers);if(!n)return null;const r=i.selection;if(!l(r)||!a(r))return null;const s=r.anchor.blockId,d=r.anchor.offset,u=d+n.url.length,p=i.transaction("paste").insertText(s,d,n.url,[]).setSelection(c(s,u)).build();return e.onOffer({blockId:s,start:d,end:u},n.match),p}}var we=class{id="video";name="Video";priority=47;config;resolvedKeymap;context=null;locale=oe;overlay=null;embedPrompt=null;constructor(e){this.config={...M,...e},this.resolvedKeymap={...B,...e?.keymap}}async init(e){this.context=e,this.locale=await f(e,this.config.locale,oe,ne),e.registerStyleSheet('.notectl-video{-webkit-user-select:none;-moz-user-select:none;user-select:none;margin:12px 0;position:relative}.notectl-video--center{text-align:center}.notectl-video--start{text-align:start}.notectl-video--end{text-align:end}.notectl-video__frame{vertical-align:top;text-align:start;background:#000;border-radius:8px;width:100%;max-width:100%;display:inline-block;position:relative;overflow:hidden}.notectl-video__facade{cursor:pointer;color:#fff;background:#14181c;border:0;justify-content:center;align-items:center;width:100%;height:100%;padding:0;display:flex;position:absolute;inset:0}.notectl-video__facade:focus-visible{outline:3px solid var(--notectl-primary);outline-offset:-3px}.notectl-video__poster{background-position:50%;background-repeat:no-repeat;background-size:cover;position:absolute;inset:0}.notectl-video__poster:after{content:"";background:#00000040;position:absolute;inset:0}.notectl-video__play-icon{z-index:1;filter:drop-shadow(0 1px 3px #00000080);transition:transform .12s;display:inline-flex;position:relative}.notectl-video__facade:hover .notectl-video__play-icon{transform:scale(1.08)}.notectl-video__badge{z-index:1;bottom:8px;color:#fff;background:#000000a6;border-radius:4px;padding:2px 6px;font-size:12px;font-weight:600;position:absolute;inset-inline-start:8px}.notectl-video__player{position:absolute;inset:0}.notectl-video__iframe{border:0;width:100%;height:100%;display:block;position:absolute;inset:0}.notectl-video__exit{z-index:2;top:6px;cursor:pointer;color:#fff;background:#000000a6;border:0;border-radius:50%;justify-content:center;align-items:center;width:28px;height:28px;display:flex;position:absolute;inset-inline-end:6px}.notectl-video__exit:focus-visible{outline-offset:2px;outline:2px solid #fff}.notectl-video__fallback-link{color:#fff;text-align:center;justify-content:center;align-items:center;padding:8px;text-decoration:underline;display:flex;position:absolute;inset:0}.notectl-video__caption{color:var(--notectl-fg-muted);text-align:center;margin-top:6px;font-size:13px}.notectl-video--selected .notectl-video__frame{outline:2px solid var(--notectl-primary);outline-offset:2px}.notectl-video__resize-overlay{pointer-events:none;position:absolute;inset:0}.notectl-video__resize-handle{border:2px solid var(--notectl-primary);background:var(--notectl-surface-raised);pointer-events:all;cursor:ew-resize;z-index:2;border-radius:6px;width:8px;height:44px;max-height:60%;position:absolute;top:50%;transform:translateY(-50%)}.notectl-video__resize-handle--w{inset-inline-start:-5px}.notectl-video__resize-handle--e{inset-inline-end:-5px}.notectl-video__size-indicator{background:var(--notectl-tooltip-bg);color:var(--notectl-tooltip-fg);white-space:nowrap;pointer-events:none;opacity:0;z-index:3;border-radius:4px;padding:2px 8px;font-size:11px;font-weight:500;transition:opacity .15s;position:absolute;bottom:-28px;left:50%;transform:translate(-50%)}.notectl-video__size-indicator--visible{opacity:1}.notectl-video__keyboard-hint{color:var(--notectl-fg-muted);white-space:nowrap;pointer-events:none;z-index:3;padding:2px 8px;font-size:11px;display:none;position:absolute;bottom:-28px;left:50%;transform:translate(-50%)}.notectl-video--selected .notectl-video__keyboard-hint{display:block}.notectl-video__resize-overlay--active~.notectl-video__keyboard-hint,.notectl-video__resize-overlay--active .notectl-video__keyboard-hint{display:none}.notectl-video__toolbar{border:1px solid var(--notectl-border);background:var(--notectl-surface-overlay);box-shadow:0 2px 8px var(--notectl-shadow);z-index:10;border-radius:6px;align-items:center;gap:2px;padding:2px;display:flex;position:absolute;top:-44px;left:50%;transform:translate(-50%)}.notectl-video__tool{cursor:pointer;width:28px;height:28px;color:var(--notectl-fg);background:0 0;border:none;border-radius:4px;justify-content:center;align-items:center;display:flex}.notectl-video__tool:hover{background:var(--notectl-hover-bg)}.notectl-video__tool--active{background:var(--notectl-active-bg);color:var(--notectl-primary)}.notectl-video__tool:focus-visible{outline:2px solid var(--notectl-primary);outline-offset:1px}.notectl-video__tool svg{width:16px;height:16px}.notectl-video__tool-separator{background:var(--notectl-border);width:1px;height:18px;margin:0 2px}@media (prefers-reduced-motion:reduce){.notectl-video__play-icon,.notectl-video__size-indicator{transition:none}}@media (forced-colors:active){.notectl-video__frame{outline:1px solid canvastext}.notectl-video__facade{border:1px solid buttontext}.notectl-video__play-icon{forced-color-adjust:none}.notectl-video__resize-handle{background:buttonface;border-color:buttontext}.notectl-video--selected .notectl-video__frame{outline:2px solid highlight}}'),e.registerStyleSheet(".notectl-video-overlay{z-index:1000;box-sizing:border-box;border:1px solid var(--notectl-border);background:var(--notectl-surface-overlay);min-width:300px;max-width:92vw;color:var(--notectl-fg);box-shadow:0 6px 24px var(--notectl-shadow);border-radius:8px;padding:12px;position:fixed}.notectl-video-popup{flex-direction:column;gap:10px;display:flex}.notectl-video-popup__field{flex-direction:column;gap:4px;display:flex}.notectl-video-popup__label{color:var(--notectl-fg-muted);font-size:12px;font-weight:600}.notectl-video-popup__input,.notectl-video-popup__select{box-sizing:border-box;border:1px solid var(--notectl-border);background:var(--notectl-surface-raised);width:100%;color:var(--notectl-fg);font:inherit;border-radius:4px;padding:6px 8px}.notectl-video-popup__input:focus-visible{outline:2px solid var(--notectl-primary);outline-offset:1px}.notectl-video-popup__select:focus-visible{outline:2px solid var(--notectl-primary);outline-offset:1px}.notectl-video-popup__hint{color:var(--notectl-fg-muted);margin:0;font-size:11px}.notectl-video-popup__error:not(:empty){background:var(--notectl-danger-muted);color:var(--notectl-danger);border-radius:4px;margin:0;padding:6px 8px;font-size:12px}.notectl-video-popup__actions{justify-content:flex-end;gap:8px;margin-top:2px;display:flex}.notectl-video-popup__cancel,.notectl-video-popup__submit{cursor:pointer;border:1px solid var(--notectl-border);background:var(--notectl-surface-raised);color:var(--notectl-fg);font:inherit;border-radius:4px;padding:7px 14px}.notectl-video-popup__submit{border-color:var(--notectl-primary);background:var(--notectl-primary);color:var(--notectl-primary-fg);font-weight:600}.notectl-video-popup__cancel:focus-visible{outline:2px solid var(--notectl-primary);outline-offset:2px}.notectl-video-popup__submit:focus-visible{outline:2px solid var(--notectl-primary);outline-offset:2px}.notectl-video-embed-prompt{z-index:1000;border:1px solid var(--notectl-border);background:var(--notectl-surface-overlay);color:var(--notectl-fg);box-shadow:0 4px 16px var(--notectl-shadow);border-radius:8px;align-items:center;gap:8px;padding:6px 8px 6px 12px;font-size:13px;display:flex;position:fixed}.notectl-video-embed-prompt__text{margin-inline-end:4px}.notectl-video-embed-prompt__embed,.notectl-video-embed-prompt__dismiss{cursor:pointer;border:1px solid var(--notectl-border);background:var(--notectl-surface-raised);color:var(--notectl-fg);font:inherit;border-radius:4px;padding:4px 10px}.notectl-video-embed-prompt__embed{border-color:var(--notectl-primary);background:var(--notectl-primary);color:var(--notectl-primary-fg);font-weight:600}.notectl-video-embed-prompt__embed:focus-visible{outline:2px solid var(--notectl-primary);outline-offset:2px}.notectl-video-embed-prompt__dismiss:focus-visible{outline:2px solid var(--notectl-primary);outline-offset:2px}@media (forced-colors:active){.notectl-video-overlay,.notectl-video-embed-prompt{border:1px solid canvastext}.notectl-video-popup__submit,.notectl-video-embed-prompt__embed{border:1px solid buttontext}}"),e.registerNodeSpec(ce(this.config,this.locale)),this.overlay=new ee(e,this.config,this.locale),this.registerNodeView(e),function(e){e.registerCommand("removeVideo",()=>Y(e))}(e),this.registerInsertCommand(e),this.registerResizeCommands(e),this.registerResizeKeymaps(e),this.registerPasteInterceptor(e),this.registerToolbarItem(e)}destroy(){this.embedPrompt?.close(),this.embedPrompt=null,this.overlay?.close(!1),this.overlay=null,this.context=null}onStateChange(e,t,o){this.context&&!this.isVideoSelected(e)&&this.isVideoSelected(t)&&this.announceVideoSelection(t)}registerNodeView(e){e.registerNodeView(W,xe({config:this.config,locale:this.locale,resolvedKeymap:this.resolvedKeymap,announce:t=>e.announce(t),actions:{edit:()=>this.overlay?.openEditForSelected(),align:t=>function(e,t){const o=Z(e.getState());return!!o&&G(e,{...o.block.attrs??{},align:t})}(e,t),remove:()=>Y(e)}}))}registerInsertCommand(e){e.registerCommand("insertVideo",()=>(this.isVideoSelected(e.getState())?this.overlay?.openEditForSelected():this.overlay?.openInsert(),!0))}registerResizeCommands(e){const t=this.config.widthStep,o=this.config.widthStepLarge,i=t=>{const o=function(e,t,o){const i=Z(e.getState());if(!i)return!1;const n=i.block.attrs?.widthPercent??o.defaultWidthPercent,r=T(n+t,o);return r!==n&&G(e,{...i.block.attrs??{},widthPercent:r})}(e,t,this.config);return o&&this.announceCurrentSize(e),o};e.registerCommand("resizeVideoGrow",()=>i(t)),e.registerCommand("resizeVideoShrink",()=>i(-t)),e.registerCommand("resizeVideoGrowLarge",()=>i(o)),e.registerCommand("resizeVideoShrinkLarge",()=>i(-o)),e.registerCommand("resetVideoSize",()=>{const t=function(e,t){const o=Z(e.getState());return!!o&&G(e,{...o.block.attrs??{},widthPercent:t.defaultWidthPercent})}(e,this.config);return t&&e.announce(this.locale.resetToDefaultSize),t})}registerResizeKeymaps(e){const t={growWidth:"resizeVideoGrow",shrinkWidth:"resizeVideoShrink",growWidthLarge:"resizeVideoGrowLarge",shrinkWidthLarge:"resizeVideoShrinkLarge",resetSize:"resetVideoSize"},o={};for(const[i,n]of Object.entries(t)){const t=this.resolvedKeymap[i]??null;t&&(o[t]=()=>e.executeCommand(n))}Object.keys(o).length>0&&e.registerKeymap(o)}registerPasteInterceptor(e){e.registerPasteInterceptor(_e({providers:this.config.providers,onOffer:(e,t)=>this.offerEmbed(e,t)}),{name:"video",priority:40})}offerEmbed(e,t){if(!this.context)return;const o=this.context,i=N(t.provider,this.config.providers);this.embedPrompt?.close(),requestAnimationFrame(()=>{o.announce(this.locale.embedOfferAnnounce(i));const t=function(e,t){const o=e.getBlock(t.blockId);if(!o)return"";const i=n(o);return i.slice(t.start,Math.min(t.end,i.length))}(o.getState(),e);this.embedPrompt=function(e){const{locale:t}=e,o=document.createElement("div");o.className="notectl-video-embed-prompt",o.setAttribute("role","dialog"),o.setAttribute("aria-label",t.embedPrompt);const i=document.createElement("span");i.className="notectl-video-embed-prompt__text",i.textContent=t.embedPrompt;const n=document.createElement("button");n.type="button",n.className="notectl-video-embed-prompt__embed",n.textContent=t.embedConfirm;const r=document.createElement("button");r.type="button",r.className="notectl-video-embed-prompt__dismiss",r.textContent=t.embedDismiss,o.append(i,n,r);let a=null,s=!1;const l=()=>{s||(s=!0,a&&(document.removeEventListener("mousedown",a,!0),a=null),o.remove())},d=e=>{l(),e()};return n.addEventListener("mousedown",e=>e.preventDefault()),n.addEventListener("click",t=>{t.preventDefault(),d(e.onEmbed)}),r.addEventListener("mousedown",e=>e.preventDefault()),r.addEventListener("click",t=>{t.preventDefault(),d(e.onDismiss)}),o.addEventListener("keydown",t=>{"Escape"===t.key&&(t.preventDefault(),t.stopPropagation(),d(e.onDismiss))}),e.container.appendChild(o),w(o),function(e,t){const o=t?t.bottom:window.innerHeight/3,i=t?t.left:window.innerWidth/3,n=e.offsetWidth||240,r=window.innerWidth-n-8,a=Math.max(8,Math.min(i,r)),s=window.innerHeight-e.offsetHeight-8,l=Math.min(o+8,Math.max(8,s));e.style.left=`${Math.round(a)}px`,e.style.top=`${Math.round(l)}px`}(o,e.rect),a=t=>{t.composedPath().includes(o)||d(e.onDismiss)},requestAnimationFrame(()=>{a&&document.addEventListener("mousedown",a,!0),n.focus()}),{close:l}}({container:o.getPluginContainer("top"),rect:Ae(),locale:this.locale,onEmbed:()=>{this.embedPrompt=null,this.overlay?.openInsertReplacingRange(e,t)},onDismiss:()=>{this.embedPrompt=null,o.getContainer().focus()}})})}registerToolbarItem(e){e.registerToolbarItem({id:"video",group:"insert",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 4h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zm6 4.5v7l6-3.5-6-3.5z" fill="currentColor"/></svg>',label:this.locale.insertVideo,tooltip:this.locale.insertVideoTooltip,command:"insertVideo"})}isVideoSelected(e){const t=e.selection;return!!s(t)&&e.getBlock(t.nodeId)?.type===W}announceVideoSelection(e){if(!this.context)return;const t=e.selection;if(!s(t))return;const o=e.getBlock(t.nodeId);if(!o||"video"!==o.type)return;const i=o.attrs?.title??"",n=[i?this.locale.videoSelectedWithTitle(i):this.locale.videoSelected],r=this.resolvedKeymap.shrinkWidth??null,a=this.resolvedKeymap.growWidth??null;r&&a&&n.push(this.locale.resizeHint(_(r),_(a))),this.context.announce(n.join(" "))}announceCurrentSize(e){const t=function(e,t){const o=Z(e);return o?o.block.attrs?.widthPercent??t.defaultWidthPercent:null}(e.getState(),this.config);null!==t&&e.announce(this.locale.videoResized(t))}};function Ae(){const e=window.getSelection();if(!e||0===e.rangeCount)return null;const t=e.getRangeAt(0).getBoundingClientRect();return 0===t.width&&0===t.height&&0===t.top&&0===t.left?null:t}export{B as a,M as i,oe as n,L as o,ne as r,I as s,we as t};
2
+ //# sourceMappingURL=VideoPlugin-DJXfuNA9.mjs.map