@editora/plugins 1.0.9 → 1.0.10

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 (140) hide show
  1. package/README.md +5 -0
  2. package/dist/_commonjsHelpers-6763f629.js +1 -0
  3. package/dist/_commonjsHelpers-c5d32002.mjs +30 -0
  4. package/dist/a11y-checker.cjs.js +12 -12
  5. package/dist/a11y-checker.esm.js +98 -80
  6. package/dist/anchor.cjs.js +12 -12
  7. package/dist/anchor.esm.js +128 -115
  8. package/dist/anchoredPopover-33f1358d.mjs +109 -0
  9. package/dist/anchoredPopover-8151d535.js +1 -0
  10. package/dist/approval-workflow.cjs.js +40 -40
  11. package/dist/approval-workflow.esm.js +249 -208
  12. package/dist/background-color.cjs.js +2 -2
  13. package/dist/background-color.esm.js +68 -55
  14. package/dist/blockquote.esm.js +2 -1
  15. package/dist/blocks-library.cjs.js +45 -45
  16. package/dist/blocks-library.esm.js +245 -178
  17. package/dist/capitalization.esm.js +2 -1
  18. package/dist/checklist.cjs.js +1 -1
  19. package/dist/checklist.esm.js +82 -58
  20. package/dist/citations.cjs.js +37 -37
  21. package/dist/citations.esm.js +512 -439
  22. package/dist/clear-formatting.cjs.js +1 -1
  23. package/dist/clear-formatting.esm.js +33 -27
  24. package/dist/code-sample.cjs.js +14 -14
  25. package/dist/code-sample.esm.js +93 -82
  26. package/dist/code.cjs.js +32 -32
  27. package/dist/code.esm.js +653 -594
  28. package/dist/comments.cjs.js +6 -6
  29. package/dist/comments.esm.js +158 -116
  30. package/dist/conditional-content.cjs.js +90 -90
  31. package/dist/conditional-content.esm.js +432 -371
  32. package/dist/content-rules.cjs.js +7 -7
  33. package/dist/content-rules.esm.js +159 -105
  34. package/dist/data-binding.cjs.js +46 -46
  35. package/dist/data-binding.esm.js +368 -328
  36. package/dist/direction.esm.js +18 -9
  37. package/dist/doc-schema.cjs.js +29 -29
  38. package/dist/doc-schema.esm.js +308 -240
  39. package/dist/document-manager.cjs.js +1 -1
  40. package/dist/document-manager.esm.js +5 -4
  41. package/dist/documentManager-25b6203c.mjs +9122 -0
  42. package/dist/documentManager-b69e7054.js +17 -0
  43. package/dist/{editorContainerHelpers-C7kdWnS0.mjs → editorContainerHelpers-69585c07.mjs} +2 -1
  44. package/dist/embed-iframe.cjs.js +4 -4
  45. package/dist/embed-iframe.esm.js +81 -73
  46. package/dist/emojis.cjs.js +8 -8
  47. package/dist/emojis.esm.js +77 -65
  48. package/dist/enterprise.cjs.js +1 -1
  49. package/dist/enterprise.esm.js +56 -54
  50. package/dist/font-family.cjs.js +1 -1
  51. package/dist/font-family.esm.js +47 -39
  52. package/dist/font-size.cjs.js +1 -1
  53. package/dist/font-size.esm.js +53 -37
  54. package/dist/footnote.cjs.js +2 -2
  55. package/dist/footnote.esm.js +117 -76
  56. package/dist/history.cjs.js +1 -1
  57. package/dist/history.esm.js +92 -70
  58. package/dist/html2canvas.esm-09133e29.js +22 -0
  59. package/dist/{html2canvas.esm-BWVIUcAF.mjs → html2canvas.esm-1a1724a1.mjs} +225 -141
  60. package/dist/indent.cjs.js +1 -1
  61. package/dist/indent.esm.js +24 -12
  62. package/dist/index-656d224b.js +231 -0
  63. package/dist/index-6a8c48bb.js +1 -0
  64. package/dist/index-d027b7e2.mjs +16859 -0
  65. package/dist/{index-BFsKNTTj.mjs → index-f04538f2.mjs} +71 -70
  66. package/dist/index.cjs.js +1 -1
  67. package/dist/index.es-730f2d98.mjs +5775 -0
  68. package/dist/index.es-dd40173b.js +18 -0
  69. package/dist/index.esm.js +128 -125
  70. package/dist/italic.cjs.js +1 -1
  71. package/dist/italic.esm.js +9 -8
  72. package/dist/jspdf.es.min-90db2c97.js +243 -0
  73. package/dist/{jspdf.es.min-DQCoX5yh.mjs → jspdf.es.min-c36a4fd8.mjs} +4682 -3658
  74. package/dist/line-height.cjs.js +1 -1
  75. package/dist/line-height.esm.js +24 -11
  76. package/dist/link.cjs.js +5 -5
  77. package/dist/link.esm.js +30 -24
  78. package/dist/list.cjs.js +1 -1
  79. package/dist/list.esm.js +25 -20
  80. package/dist/lite.cjs.js +1 -1
  81. package/dist/lite.esm.js +61 -59
  82. package/dist/math.cjs.js +21 -21
  83. package/dist/math.esm.js +146 -139
  84. package/dist/media-manager.cjs.js +38 -38
  85. package/dist/media-manager.esm.js +325 -308
  86. package/dist/mentions.cjs.js +9 -9
  87. package/dist/mentions.esm.js +286 -238
  88. package/dist/merge-tag.cjs.js +2 -2
  89. package/dist/merge-tag.esm.js +216 -177
  90. package/dist/page-break.cjs.js +2 -2
  91. package/dist/page-break.esm.js +49 -33
  92. package/dist/pii-redaction.cjs.js +19 -19
  93. package/dist/pii-redaction.esm.js +463 -393
  94. package/dist/preview.esm.js +10 -5
  95. package/dist/print.cjs.js +4 -4
  96. package/dist/print.esm.js +20 -17
  97. package/dist/{purify.es-DHhaBdbu.mjs → purify.es-35a15df8.mjs} +19 -9
  98. package/dist/{purify.es-T2a3nLiC.js → purify.es-a8d731c6.js} +1 -1
  99. package/dist/slash-commands.cjs.js +3 -3
  100. package/dist/slash-commands.esm.js +212 -176
  101. package/dist/smart-paste.cjs.js +27 -27
  102. package/dist/smart-paste.esm.js +336 -280
  103. package/dist/special-characters.cjs.js +7 -7
  104. package/dist/special-characters.esm.js +69 -61
  105. package/dist/spell-check.cjs.js +5 -5
  106. package/dist/spell-check.esm.js +123 -97
  107. package/dist/strikethrough.cjs.js +1 -1
  108. package/dist/strikethrough.esm.js +19 -14
  109. package/dist/style.css +1 -0
  110. package/dist/table.cjs.js +4 -4
  111. package/dist/table.esm.js +225 -191
  112. package/dist/template.cjs.js +11 -11
  113. package/dist/template.esm.js +153 -124
  114. package/dist/text-alignment.cjs.js +1 -1
  115. package/dist/text-alignment.esm.js +27 -21
  116. package/dist/text-color.cjs.js +3 -3
  117. package/dist/text-color.esm.js +87 -70
  118. package/dist/track-changes.cjs.js +2 -2
  119. package/dist/track-changes.esm.js +162 -100
  120. package/dist/translation-workflow.cjs.js +74 -74
  121. package/dist/translation-workflow.esm.js +678 -602
  122. package/dist/version-diff.cjs.js +14 -14
  123. package/dist/version-diff.esm.js +157 -128
  124. package/package.json +13 -7
  125. package/LICENSE +0 -21
  126. package/dist/_commonjsHelpers-BH3jXuIh.js +0 -1
  127. package/dist/_commonjsHelpers-ByX85dGu.mjs +0 -33
  128. package/dist/anchoredPopover-BzqGPOAE.js +0 -1
  129. package/dist/anchoredPopover-Dts0IrgU.mjs +0 -106
  130. package/dist/documentManager-CTqRftU8.mjs +0 -8369
  131. package/dist/documentManager-Jf0RbSks.js +0 -17
  132. package/dist/html2canvas.esm-B5qzocYs.js +0 -5
  133. package/dist/index-CvJk4DKa.js +0 -221
  134. package/dist/index-D3CycEFU.mjs +0 -16543
  135. package/dist/index-tqLTHcO6.js +0 -1
  136. package/dist/index.es-CE_A4QSm.js +0 -5
  137. package/dist/index.es-DQ78mYYo.mjs +0 -6665
  138. package/dist/jspdf.es.min-BoS80556.js +0 -77
  139. package/dist/plugins.css +0 -1
  140. /package/dist/{editorContainerHelpers-CFbfiOJI.js → editorContainerHelpers-36b8ddf3.js} +0 -0
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const g={all:{name:"All",characters:["€","£","¥","¢","₹","₽","₩","₿","₺","₴","₦","₨","₪","₫","₭","₮","₯","₰","₱","₲","₳","₴","₵","₶","₷","₹","₺","₼","₽","₾","₿",'"',"'","«","»","„","‟","‹","›","‚","‛","〝","〞","〟","‟","„","©","®","™","°","§","¶","†","‡","•","‣","⁃","‰","‱","′","″","‴","‵","‶","‷","※","‼","‽","‾","‿","⁀","⁁","⁂","⁃","⁇","⁈","⁉","+","-","×","÷","=","≠","≈","≡","≤","≥","<",">","±","∓","∴","∵","∶","∷","∸","∹","∺","∻","∼","∽","∾","∿","≀","≁","≂","≃","≄","≅","≆","≇","≈","≉","≊","≋","≌","≍","≎","≏","≐","≑","≒","≓","≔","≕","≖","≗","≘","≙","≚","≛","≜","≝","≞","≟","≠","≡","≢","≣","≤","≥","≦","≧","≨","≩","≪","≫","≬","≭","≮","≯","≰","≱","≲","≳","≴","≵","≶","≷","≸","≹","≺","≻","≼","≽","≾","≿","À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø","Ù","Ú","Û","Ü","Ý","Þ","ß","à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ý","þ","ÿ","¡","¿","‽","‼","⁇","⁈","⁉","※","‾","‿","⁀","⁁","⁂","⁃","←","↑","→","↓","↔","↕","↖","↗","↘","↙","↚","↛","↜","↝","↞","↟","↠","↡","↢","↣","↤","↥","↦","↧","↨","↩","↪","↫","↬","↭","↮","↯","↰","↱","↲","↳","↴","↵","↶","↷","↸","↹","↺","↻","↼","↽","↾","↿","⇀","⇁","⇂","⇃","⇄","⇅","⇆","⇇","⇈","⇉","⇊","⇋","⇌","⇍","⇎","⇏","⇐","⇑","⇒","⇓","⇔","⇕","⇖","⇗","⇘","⇙","⇚","⇛","⇜","⇝","⇞","⇟","⇠","⇡","⇢","⇣","⇤","⇥","⇦","⇧","⇨","⇩","⇪","⇫","⇬","⇭","⇮","⇯","⇰","⇱","⇲","⇳","⇴","⇵","⇶","⇷","⇸","⇹","⇺","⇻","⇼","⇽","⇾","⇿"]},currency:{name:"Currency",characters:["€","£","¥","¢","₹","₽","₩","₿","₺","₴","₦","₨","₪","₫","₭","₮","₯","₰","₱","₲","₳","₵","₶","₷","₼","₾","₿"]},text:{name:"Text",characters:["©","®","™","°","§","¶","†","‡","•","‣","⁃","‰","‱","′","″","‴","‵","‶","‷","※","‼","‽","‾","‿","⁀","⁁","⁂"]},quotation:{name:"Quotation",characters:['"',"'","«","»","„","‟","‹","›","‚","‛","〝","〞","〟"]},mathematical:{name:"Mathematical",characters:["+","-","×","÷","=","≠","≈","≡","≤","≥","<",">","±","∓","∴","∵","∶","∷","∸","∹","∺","∻","∼","∽","∾","∿","≀","≁","≂","≃","≄","≅","≆","≇","≉","≊","≋","≌","≍","≎","≏","≐","≑","≒","≓","≔","≕","≖","≗","≘","≙","≚","≛","≜","≝","≞","≟","≢","≣","≦","≧","≨","≩","≪","≫","≬","≭","≮","≯","≰","≱","≲","≳","≴","≵","≶","≷","≸","≹","≺","≻","≼","≽","≾","≿"]},"extended-latin":{name:"Extended Latin",characters:["À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø","Ù","Ú","Û","Ü","Ý","Þ","ß","à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ý","þ","ÿ"]},symbols:{name:"Symbols",characters:["¡","¿","‽","‼","⁇","⁈","⁉","※","‾","‿","⁀","⁁","⁂","⁃"]},arrows:{name:"Arrows",characters:["←","↑","→","↓","↔","↕","↖","↗","↘","↙","↚","↛","↜","↝","↞","↟","↠","↡","↢","↣","↤","↥","↦","↧","↨","↩","↪","↫","↬","↭","↮","↯","↰","↱","↲","↳","↴","↵","↶","↷","↸","↹","↺","↻","↼","↽","↾","↿","⇀","⇁","⇂","⇃","⇄","⇅","⇆","⇇","⇈","⇉","⇊","⇋","⇌","⇍","⇎","⇏","⇐","⇑","⇒","⇓","⇔","⇕","⇖","⇗","⇘","⇙","⇚","⇛","⇜","⇝","⇞","⇟","⇠","⇡","⇢","⇣","⇤","⇥","⇦","⇧","⇨","⇩","⇪","⇫","⇬","⇭","⇮","⇯","⇰","⇱","⇲","⇳","⇴","⇵","⇶","⇷","⇸","⇹","⇺","⇻","⇼","⇽","⇾","⇿"]}},x={"€":"euro","£":"pound","¥":"yen","¢":"cent","₹":"rupee","₽":"ruble","₩":"won","₿":"bitcoin",'"':"quote","'":"apostrophe","«":"left angle quote","»":"right angle quote","„":"low quote","©":"copyright","®":"registered","™":"trademark","°":"degree","§":"section","¶":"paragraph","†":"dagger","‡":"double dagger","•":"bullet","‰":"per mille","′":"prime","″":"double prime","+":"plus","-":"minus","×":"multiplication","÷":"division","=":"equals","≠":"not equal","≈":"approximately","≡":"identical","≤":"less or equal","≥":"greater or equal","±":"plus minus",À:"a grave",Á:"a acute",Â:"a circumflex",Ã:"a tilde",Ä:"a diaeresis",Ç:"c cedilla","←":"left arrow","↑":"up arrow","→":"right arrow","↓":"down arrow","↔":"left right arrow"};let u=!1;const C='[data-theme="dark"], .dark, .editora-theme-dark',k=()=>{const t=window.getSelection();if(!t||t.rangeCount===0)return null;const e=t.anchorNode;return(e instanceof HTMLElement?e:e?.parentElement)?.closest(".rte-content, .editora-content")||null},E=t=>{const e=t||k();return e?!!e.closest(C):!1},z=()=>{if(typeof document>"u")return;const t="special-characters-plugin-styles";if(document.getElementById(t))return;const e=document.createElement("style");e.id=t,e.textContent=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const m={all:{name:"All",characters:["€","£","¥","¢","₹","₽","₩","₿","₺","₴","₦","₨","₪","₫","₭","₮","₯","₰","₱","₲","₳","₴","₵","₶","₷","₹","₺","₼","₽","₾","₿",'"',"'","«","»","„","‟","‹","›","‚","‛","〝","〞","〟","‟","„","©","®","™","°","§","¶","†","‡","•","‣","⁃","‰","‱","′","″","‴","‵","‶","‷","※","‼","‽","‾","‿","⁀","⁁","⁂","⁃","⁇","⁈","⁉","+","-","×","÷","=","≠","≈","≡","≤","≥","<",">","±","∓","∴","∵","∶","∷","∸","∹","∺","∻","∼","∽","∾","∿","≀","≁","≂","≃","≄","≅","≆","≇","≈","≉","≊","≋","≌","≍","≎","≏","≐","≑","≒","≓","≔","≕","≖","≗","≘","≙","≚","≛","≜","≝","≞","≟","≠","≡","≢","≣","≤","≥","≦","≧","≨","≩","≪","≫","≬","≭","≮","≯","≰","≱","≲","≳","≴","≵","≶","≷","≸","≹","≺","≻","≼","≽","≾","≿","À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø","Ù","Ú","Û","Ü","Ý","Þ","ß","à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ý","þ","ÿ","¡","¿","‽","‼","⁇","⁈","⁉","※","‾","‿","⁀","⁁","⁂","⁃","←","↑","→","↓","↔","↕","↖","↗","↘","↙","↚","↛","↜","↝","↞","↟","↠","↡","↢","↣","↤","↥","↦","↧","↨","↩","↪","↫","↬","↭","↮","↯","↰","↱","↲","↳","↴","↵","↶","↷","↸","↹","↺","↻","↼","↽","↾","↿","⇀","⇁","⇂","⇃","⇄","⇅","⇆","⇇","⇈","⇉","⇊","⇋","⇌","⇍","⇎","⇏","⇐","⇑","⇒","⇓","⇔","⇕","⇖","⇗","⇘","⇙","⇚","⇛","⇜","⇝","⇞","⇟","⇠","⇡","⇢","⇣","⇤","⇥","⇦","⇧","⇨","⇩","⇪","⇫","⇬","⇭","⇮","⇯","⇰","⇱","⇲","⇳","⇴","⇵","⇶","⇷","⇸","⇹","⇺","⇻","⇼","⇽","⇾","⇿"]},currency:{name:"Currency",characters:["€","£","¥","¢","₹","₽","₩","₿","₺","₴","₦","₨","₪","₫","₭","₮","₯","₰","₱","₲","₳","₵","₶","₷","₼","₾","₿"]},text:{name:"Text",characters:["©","®","™","°","§","¶","†","‡","•","‣","⁃","‰","‱","′","″","‴","‵","‶","‷","※","‼","‽","‾","‿","⁀","⁁","⁂"]},quotation:{name:"Quotation",characters:['"',"'","«","»","„","‟","‹","›","‚","‛","〝","〞","〟"]},mathematical:{name:"Mathematical",characters:["+","-","×","÷","=","≠","≈","≡","≤","≥","<",">","±","∓","∴","∵","∶","∷","∸","∹","∺","∻","∼","∽","∾","∿","≀","≁","≂","≃","≄","≅","≆","≇","≉","≊","≋","≌","≍","≎","≏","≐","≑","≒","≓","≔","≕","≖","≗","≘","≙","≚","≛","≜","≝","≞","≟","≢","≣","≦","≧","≨","≩","≪","≫","≬","≭","≮","≯","≰","≱","≲","≳","≴","≵","≶","≷","≸","≹","≺","≻","≼","≽","≾","≿"]},"extended-latin":{name:"Extended Latin",characters:["À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø","Ù","Ú","Û","Ü","Ý","Þ","ß","à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ý","þ","ÿ"]},symbols:{name:"Symbols",characters:["¡","¿","‽","‼","⁇","⁈","⁉","※","‾","‿","⁀","⁁","⁂","⁃"]},arrows:{name:"Arrows",characters:["←","↑","→","↓","↔","↕","↖","↗","↘","↙","↚","↛","↜","↝","↞","↟","↠","↡","↢","↣","↤","↥","↦","↧","↨","↩","↪","↫","↬","↭","↮","↯","↰","↱","↲","↳","↴","↵","↶","↷","↸","↹","↺","↻","↼","↽","↾","↿","⇀","⇁","⇂","⇃","⇄","⇅","⇆","⇇","⇈","⇉","⇊","⇋","⇌","⇍","⇎","⇏","⇐","⇑","⇒","⇓","⇔","⇕","⇖","⇗","⇘","⇙","⇚","⇛","⇜","⇝","⇞","⇟","⇠","⇡","⇢","⇣","⇤","⇥","⇦","⇧","⇨","⇩","⇪","⇫","⇬","⇭","⇮","⇯","⇰","⇱","⇲","⇳","⇴","⇵","⇶","⇷","⇸","⇹","⇺","⇻","⇼","⇽","⇾","⇿"]}},k={"€":"euro","£":"pound","¥":"yen","¢":"cent","₹":"rupee","₽":"ruble","₩":"won","₿":"bitcoin",'"':"quote","'":"apostrophe","«":"left angle quote","»":"right angle quote","„":"low quote","©":"copyright","®":"registered","™":"trademark","°":"degree","§":"section","¶":"paragraph","†":"dagger","‡":"double dagger","•":"bullet","‰":"per mille","′":"prime","″":"double prime","+":"plus","-":"minus","×":"multiplication","÷":"division","=":"equals","≠":"not equal","≈":"approximately","≡":"identical","≤":"less or equal","≥":"greater or equal","±":"plus minus",À:"a grave",Á:"a acute",Â:"a circumflex",Ã:"a tilde",Ä:"a diaeresis",Ç:"c cedilla","←":"left arrow","↑":"up arrow","→":"right arrow","↓":"down arrow","↔":"left right arrow"};let v=!1;const C='[data-theme="dark"], .dark, .editora-theme-dark',w=()=>{const a=window.getSelection();if(!a||a.rangeCount===0)return null;const e=a.anchorNode,t=e instanceof HTMLElement?e:e==null?void 0:e.parentElement;return(t==null?void 0:t.closest(".rte-content, .editora-content"))||null},E=a=>{const e=a||w();return e?!!e.closest(C):!1},z=()=>{if(typeof document>"u")return;const a="special-characters-plugin-styles";if(document.getElementById(a))return;const e=document.createElement("style");e.id=a,e.textContent=`
2
2
  .special-characters-overlay {
3
3
  --rte-sc-overlay-bg: rgba(15, 23, 36, 0.56);
4
4
  --rte-sc-dialog-bg: #ffffff;
@@ -264,16 +264,16 @@
264
264
  font-size: 16px;
265
265
  }
266
266
  }
267
- `,document.head.appendChild(e)},S=t=>{const e=window.getSelection();if(e&&e.rangeCount>0){const a=e.getRangeAt(0);a.deleteContents();const c=document.createTextNode(t);a.insertNode(c),a.setStartAfter(c),a.setEndAfter(c),e.removeAllRanges(),e.addRange(a)}},L=t=>{if(typeof window>"u"||u)return;u=!0,z();let e="all",a="",c=null;const i=document.createElement("div");i.className="special-characters-overlay",E(t)&&i.classList.add("rte-ui-theme-dark");const s=document.createElement("div");s.className="special-characters-dialog",s.setAttribute("role","dialog"),s.setAttribute("aria-modal","true"),s.innerHTML=`
267
+ `,document.head.appendChild(e)},S=a=>{const e=window.getSelection();if(e&&e.rangeCount>0){const t=e.getRangeAt(0);t.deleteContents();const c=document.createTextNode(a);t.insertNode(c),t.setStartAfter(c),t.setEndAfter(c),e.removeAllRanges(),e.addRange(t)}},L=a=>{if(typeof window>"u"||v)return;v=!0,z();let e="all",t="",c=null;const i=document.createElement("div");i.className="special-characters-overlay",E(a)&&i.classList.add("rte-ui-theme-dark");const s=document.createElement("div");s.className="special-characters-dialog",s.setAttribute("role","dialog"),s.setAttribute("aria-modal","true"),s.innerHTML=`
268
268
  <div class="special-characters-header">
269
269
  <h2>Insert Special Characters</h2>
270
270
  <button class="special-characters-close">×</button>
271
271
  </div>
272
272
  <div class="special-characters-content">
273
273
  <div class="special-characters-tabs">
274
- ${Object.keys(g).map(r=>`
274
+ ${Object.keys(m).map(r=>`
275
275
  <button class="special-characters-tab ${e===r?"active":""}" data-category="${r}">
276
- ${g[r].name}
276
+ ${m[r].name}
277
277
  </button>
278
278
  `).join("")}
279
279
  </div>
@@ -288,8 +288,8 @@
288
288
  <div class="special-characters-grid"></div>
289
289
  </div>
290
290
  </div>
291
- `;const b=s.querySelector(".special-characters-tabs"),d=s.querySelector(".special-characters-grid"),m=s.querySelector(".special-characters-search-input"),w=s.querySelector(".special-characters-close"),y=()=>g[e].characters.filter(r=>{if(!a.trim())return!0;const o=a.toLowerCase();return r.toLowerCase().includes(o)||(x[r]||"").toLowerCase().includes(o)}),v=()=>{b?.querySelectorAll(".special-characters-tab").forEach(r=>{r.classList.toggle("active",r.getAttribute("data-category")===e)})},h=()=>{if(!d)return;const r=y();if(r.length===0){d.innerHTML=`<div class="special-characters-no-results">No characters found for "${a}"</div>`;return}d.innerHTML=r.map(o=>`
292
- <button class="special-characters-item" data-char="${o}" title="${x[o]||o}">
291
+ `;const l=s.querySelector(".special-characters-tabs"),n=s.querySelector(".special-characters-grid"),d=s.querySelector(".special-characters-search-input"),u=s.querySelector(".special-characters-close"),y=()=>m[e].characters.filter(r=>{if(!t.trim())return!0;const o=t.toLowerCase();return r.toLowerCase().includes(o)||(k[r]||"").toLowerCase().includes(o)}),f=()=>{l==null||l.querySelectorAll(".special-characters-tab").forEach(r=>{r.classList.toggle("active",r.getAttribute("data-category")===e)})},b=()=>{if(!n)return;const r=y();if(r.length===0){n.innerHTML=`<div class="special-characters-no-results">No characters found for "${t}"</div>`;return}n.innerHTML=r.map(o=>`
292
+ <button class="special-characters-item" data-char="${o}" title="${k[o]||o}">
293
293
  ${o}
294
294
  </button>
295
- `).join("")},p=()=>{c!==null&&(window.clearTimeout(c),c=null),i.parentNode&&i.parentNode.removeChild(i),u=!1,document.removeEventListener("keydown",f,!0)},f=r=>{r.key==="Escape"&&(r.preventDefault(),r.stopPropagation(),p())};w?.addEventListener("click",p),b?.addEventListener("click",r=>{const l=r.target.closest(".special-characters-tab");if(!l)return;const n=l.getAttribute("data-category");!n||e===n||(e=n,v(),h())}),m?.addEventListener("input",r=>{a=r.target.value,c!==null&&window.clearTimeout(c),c=window.setTimeout(()=>{c=null,h()},90)}),d?.addEventListener("click",r=>{const l=r.target.closest(".special-characters-item");if(!l)return;const n=l.getAttribute("data-char");n&&(S(n),p())}),i.addEventListener("click",r=>{r.target===i&&p()}),document.addEventListener("keydown",f,!0),v(),h(),i.appendChild(s),document.body.appendChild(i),requestAnimationFrame(()=>m?.focus())},T=()=>({name:"specialCharacters",toolbar:[{label:"Special Characters",command:"insertSpecialCharacter",icon:'<svg width="24" height="24" focusable="false"><path d="M15 18h4l1-2v4h-6v-3.3l1.4-1a6 6 0 0 0 1.8-2.9 6.3 6.3 0 0 0-.1-4.1 5.8 5.8 0 0 0-3-3.2c-.6-.3-1.3-.5-2.1-.5a5.1 5.1 0 0 0-3.9 1.8 6.3 6.3 0 0 0-1.3 6 6.2 6.2 0 0 0 1.8 3l1.4.9V20H4v-4l1 2h4v-.5l-2-1L5.4 15A6.5 6.5 0 0 1 4 11c0-1 .2-1.9.6-2.7A7 7 0 0 1 6.3 6C7.1 5.4 8 5 9 4.5c1-.3 2-.5 3.1-.5a8.8 8.8 0 0 1 5.7 2 7 7 0 0 1 1.7 2.3 6 6 0 0 1 .2 4.8c-.2.7-.6 1.3-1 1.9a7.6 7.6 0 0 1-3.6 2.5v.5Z" fill-rule="evenodd"></path></svg>'}],commands:{insertSpecialCharacter:(t,e)=>{const a=e?.contentElement instanceof HTMLElement?e.contentElement:k();return L(a),!0}},keymap:{}});exports.SpecialCharactersPlugin=T;
295
+ `).join("")},g=()=>{c!==null&&(window.clearTimeout(c),c=null),i.parentNode&&i.parentNode.removeChild(i),v=!1,document.removeEventListener("keydown",x,!0)},x=r=>{r.key==="Escape"&&(r.preventDefault(),r.stopPropagation(),g())};u==null||u.addEventListener("click",g),l==null||l.addEventListener("click",r=>{const h=r.target.closest(".special-characters-tab");if(!h)return;const p=h.getAttribute("data-category");!p||e===p||(e=p,f(),b())}),d==null||d.addEventListener("input",r=>{t=r.target.value,c!==null&&window.clearTimeout(c),c=window.setTimeout(()=>{c=null,b()},90)}),n==null||n.addEventListener("click",r=>{const h=r.target.closest(".special-characters-item");if(!h)return;const p=h.getAttribute("data-char");p&&(S(p),g())}),i.addEventListener("click",r=>{r.target===i&&g()}),document.addEventListener("keydown",x,!0),f(),b(),i.appendChild(s),document.body.appendChild(i),requestAnimationFrame(()=>d==null?void 0:d.focus())},T=()=>({name:"specialCharacters",toolbar:[{label:"Special Characters",command:"insertSpecialCharacter",icon:'<svg width="24" height="24" focusable="false"><path d="M15 18h4l1-2v4h-6v-3.3l1.4-1a6 6 0 0 0 1.8-2.9 6.3 6.3 0 0 0-.1-4.1 5.8 5.8 0 0 0-3-3.2c-.6-.3-1.3-.5-2.1-.5a5.1 5.1 0 0 0-3.9 1.8 6.3 6.3 0 0 0-1.3 6 6.2 6.2 0 0 0 1.8 3l1.4.9V20H4v-4l1 2h4v-.5l-2-1L5.4 15A6.5 6.5 0 0 1 4 11c0-1 .2-1.9.6-2.7A7 7 0 0 1 6.3 6C7.1 5.4 8 5 9 4.5c1-.3 2-.5 3.1-.5a8.8 8.8 0 0 1 5.7 2 7 7 0 0 1 1.7 2.3 6 6 0 0 1 .2 4.8c-.2.7-.6 1.3-1 1.9a7.6 7.6 0 0 1-3.6 2.5v.5Z" fill-rule="evenodd"></path></svg>'}],commands:{insertSpecialCharacter:(a,e)=>{const t=(e==null?void 0:e.contentElement)instanceof HTMLElement?e.contentElement:w();return L(t),!0}},keymap:{}});exports.SpecialCharactersPlugin=T;
@@ -1,4 +1,4 @@
1
- const g = {
1
+ const m = {
2
2
  all: {
3
3
  name: "All",
4
4
  characters: [
@@ -389,7 +389,7 @@ const g = {
389
389
  name: "Arrows",
390
390
  characters: ["←", "↑", "→", "↓", "↔", "↕", "↖", "↗", "↘", "↙", "↚", "↛", "↜", "↝", "↞", "↟", "↠", "↡", "↢", "↣", "↤", "↥", "↦", "↧", "↨", "↩", "↪", "↫", "↬", "↭", "↮", "↯", "↰", "↱", "↲", "↳", "↴", "↵", "↶", "↷", "↸", "↹", "↺", "↻", "↼", "↽", "↾", "↿", "⇀", "⇁", "⇂", "⇃", "⇄", "⇅", "⇆", "⇇", "⇈", "⇉", "⇊", "⇋", "⇌", "⇍", "⇎", "⇏", "⇐", "⇑", "⇒", "⇓", "⇔", "⇕", "⇖", "⇗", "⇘", "⇙", "⇚", "⇛", "⇜", "⇝", "⇞", "⇟", "⇠", "⇡", "⇢", "⇣", "⇤", "⇥", "⇦", "⇧", "⇨", "⇩", "⇪", "⇫", "⇬", "⇭", "⇮", "⇯", "⇰", "⇱", "⇲", "⇳", "⇴", "⇵", "⇶", "⇷", "⇸", "⇹", "⇺", "⇻", "⇼", "⇽", "⇾", "⇿"]
391
391
  }
392
- }, x = {
392
+ }, k = {
393
393
  "€": "euro",
394
394
  "£": "pound",
395
395
  "¥": "yen",
@@ -438,21 +438,24 @@ const g = {
438
438
  "↓": "down arrow",
439
439
  "↔": "left right arrow"
440
440
  };
441
- let u = !1;
442
- const C = '[data-theme="dark"], .dark, .editora-theme-dark', k = () => {
443
- const t = window.getSelection();
444
- if (!t || t.rangeCount === 0) return null;
445
- const e = t.anchorNode;
446
- return (e instanceof HTMLElement ? e : e?.parentElement)?.closest(".rte-content, .editora-content") || null;
447
- }, E = (t) => {
448
- const e = t || k();
449
- return e ? !!e.closest(C) : !1;
450
- }, z = () => {
451
- if (typeof document > "u") return;
452
- const t = "special-characters-plugin-styles";
453
- if (document.getElementById(t)) return;
441
+ let v = !1;
442
+ const E = '[data-theme="dark"], .dark, .editora-theme-dark', w = () => {
443
+ const a = window.getSelection();
444
+ if (!a || a.rangeCount === 0)
445
+ return null;
446
+ const e = a.anchorNode, t = e instanceof HTMLElement ? e : e == null ? void 0 : e.parentElement;
447
+ return (t == null ? void 0 : t.closest(".rte-content, .editora-content")) || null;
448
+ }, z = (a) => {
449
+ const e = a || w();
450
+ return e ? !!e.closest(E) : !1;
451
+ }, C = () => {
452
+ if (typeof document > "u")
453
+ return;
454
+ const a = "special-characters-plugin-styles";
455
+ if (document.getElementById(a))
456
+ return;
454
457
  const e = document.createElement("style");
455
- e.id = t, e.textContent = `
458
+ e.id = a, e.textContent = `
456
459
  .special-characters-overlay {
457
460
  --rte-sc-overlay-bg: rgba(15, 23, 36, 0.56);
458
461
  --rte-sc-dialog-bg: #ffffff;
@@ -719,20 +722,21 @@ const C = '[data-theme="dark"], .dark, .editora-theme-dark', k = () => {
719
722
  }
720
723
  }
721
724
  `, document.head.appendChild(e);
722
- }, L = (t) => {
725
+ }, L = (a) => {
723
726
  const e = window.getSelection();
724
727
  if (e && e.rangeCount > 0) {
725
- const a = e.getRangeAt(0);
726
- a.deleteContents();
727
- const c = document.createTextNode(t);
728
- a.insertNode(c), a.setStartAfter(c), a.setEndAfter(c), e.removeAllRanges(), e.addRange(a);
728
+ const t = e.getRangeAt(0);
729
+ t.deleteContents();
730
+ const c = document.createTextNode(a);
731
+ t.insertNode(c), t.setStartAfter(c), t.setEndAfter(c), e.removeAllRanges(), e.addRange(t);
729
732
  }
730
- }, S = (t) => {
731
- if (typeof window > "u" || u) return;
732
- u = !0, z();
733
- let e = "all", a = "", c = null;
733
+ }, S = (a) => {
734
+ if (typeof window > "u" || v)
735
+ return;
736
+ v = !0, C();
737
+ let e = "all", t = "", c = null;
734
738
  const i = document.createElement("div");
735
- i.className = "special-characters-overlay", E(t) && i.classList.add("rte-ui-theme-dark");
739
+ i.className = "special-characters-overlay", z(a) && i.classList.add("rte-ui-theme-dark");
736
740
  const s = document.createElement("div");
737
741
  s.className = "special-characters-dialog", s.setAttribute("role", "dialog"), s.setAttribute("aria-modal", "true"), s.innerHTML = `
738
742
  <div class="special-characters-header">
@@ -741,9 +745,9 @@ const C = '[data-theme="dark"], .dark, .editora-theme-dark', k = () => {
741
745
  </div>
742
746
  <div class="special-characters-content">
743
747
  <div class="special-characters-tabs">
744
- ${Object.keys(g).map((r) => `
748
+ ${Object.keys(m).map((r) => `
745
749
  <button class="special-characters-tab ${e === r ? "active" : ""}" data-category="${r}">
746
- ${g[r].name}
750
+ ${m[r].name}
747
751
  </button>
748
752
  `).join("")}
749
753
  </div>
@@ -759,48 +763,52 @@ const C = '[data-theme="dark"], .dark, .editora-theme-dark', k = () => {
759
763
  </div>
760
764
  </div>
761
765
  `;
762
- const b = s.querySelector(".special-characters-tabs"), d = s.querySelector(".special-characters-grid"), m = s.querySelector(".special-characters-search-input"), w = s.querySelector(".special-characters-close"), y = () => g[e].characters.filter((r) => {
763
- if (!a.trim()) return !0;
764
- const o = a.toLowerCase();
765
- return r.toLowerCase().includes(o) || (x[r] || "").toLowerCase().includes(o);
766
- }), v = () => {
767
- b?.querySelectorAll(".special-characters-tab").forEach((r) => {
766
+ const l = s.querySelector(".special-characters-tabs"), n = s.querySelector(".special-characters-grid"), d = s.querySelector(".special-characters-search-input"), u = s.querySelector(".special-characters-close"), y = () => m[e].characters.filter((r) => {
767
+ if (!t.trim())
768
+ return !0;
769
+ const o = t.toLowerCase();
770
+ return r.toLowerCase().includes(o) || (k[r] || "").toLowerCase().includes(o);
771
+ }), f = () => {
772
+ l == null || l.querySelectorAll(".special-characters-tab").forEach((r) => {
768
773
  r.classList.toggle("active", r.getAttribute("data-category") === e);
769
774
  });
770
- }, h = () => {
771
- if (!d) return;
775
+ }, b = () => {
776
+ if (!n)
777
+ return;
772
778
  const r = y();
773
779
  if (r.length === 0) {
774
- d.innerHTML = `<div class="special-characters-no-results">No characters found for "${a}"</div>`;
780
+ n.innerHTML = `<div class="special-characters-no-results">No characters found for "${t}"</div>`;
775
781
  return;
776
782
  }
777
- d.innerHTML = r.map((o) => `
778
- <button class="special-characters-item" data-char="${o}" title="${x[o] || o}">
783
+ n.innerHTML = r.map((o) => `
784
+ <button class="special-characters-item" data-char="${o}" title="${k[o] || o}">
779
785
  ${o}
780
786
  </button>
781
787
  `).join("");
782
- }, p = () => {
783
- c !== null && (window.clearTimeout(c), c = null), i.parentNode && i.parentNode.removeChild(i), u = !1, document.removeEventListener("keydown", f, !0);
784
- }, f = (r) => {
785
- r.key === "Escape" && (r.preventDefault(), r.stopPropagation(), p());
788
+ }, g = () => {
789
+ c !== null && (window.clearTimeout(c), c = null), i.parentNode && i.parentNode.removeChild(i), v = !1, document.removeEventListener("keydown", x, !0);
790
+ }, x = (r) => {
791
+ r.key === "Escape" && (r.preventDefault(), r.stopPropagation(), g());
786
792
  };
787
- w?.addEventListener("click", p), b?.addEventListener("click", (r) => {
788
- const l = r.target.closest(".special-characters-tab");
789
- if (!l) return;
790
- const n = l.getAttribute("data-category");
791
- !n || e === n || (e = n, v(), h());
792
- }), m?.addEventListener("input", (r) => {
793
- a = r.target.value, c !== null && window.clearTimeout(c), c = window.setTimeout(() => {
794
- c = null, h();
793
+ u == null || u.addEventListener("click", g), l == null || l.addEventListener("click", (r) => {
794
+ const h = r.target.closest(".special-characters-tab");
795
+ if (!h)
796
+ return;
797
+ const p = h.getAttribute("data-category");
798
+ !p || e === p || (e = p, f(), b());
799
+ }), d == null || d.addEventListener("input", (r) => {
800
+ t = r.target.value, c !== null && window.clearTimeout(c), c = window.setTimeout(() => {
801
+ c = null, b();
795
802
  }, 90);
796
- }), d?.addEventListener("click", (r) => {
797
- const l = r.target.closest(".special-characters-item");
798
- if (!l) return;
799
- const n = l.getAttribute("data-char");
800
- n && (L(n), p());
803
+ }), n == null || n.addEventListener("click", (r) => {
804
+ const h = r.target.closest(".special-characters-item");
805
+ if (!h)
806
+ return;
807
+ const p = h.getAttribute("data-char");
808
+ p && (L(p), g());
801
809
  }), i.addEventListener("click", (r) => {
802
- r.target === i && p();
803
- }), document.addEventListener("keydown", f, !0), v(), h(), i.appendChild(s), document.body.appendChild(i), requestAnimationFrame(() => m?.focus());
810
+ r.target === i && g();
811
+ }), document.addEventListener("keydown", x, !0), f(), b(), i.appendChild(s), document.body.appendChild(i), requestAnimationFrame(() => d == null ? void 0 : d.focus());
804
812
  }, q = () => ({
805
813
  name: "specialCharacters",
806
814
  toolbar: [{
@@ -809,9 +817,9 @@ const C = '[data-theme="dark"], .dark, .editora-theme-dark', k = () => {
809
817
  icon: '<svg width="24" height="24" focusable="false"><path d="M15 18h4l1-2v4h-6v-3.3l1.4-1a6 6 0 0 0 1.8-2.9 6.3 6.3 0 0 0-.1-4.1 5.8 5.8 0 0 0-3-3.2c-.6-.3-1.3-.5-2.1-.5a5.1 5.1 0 0 0-3.9 1.8 6.3 6.3 0 0 0-1.3 6 6.2 6.2 0 0 0 1.8 3l1.4.9V20H4v-4l1 2h4v-.5l-2-1L5.4 15A6.5 6.5 0 0 1 4 11c0-1 .2-1.9.6-2.7A7 7 0 0 1 6.3 6C7.1 5.4 8 5 9 4.5c1-.3 2-.5 3.1-.5a8.8 8.8 0 0 1 5.7 2 7 7 0 0 1 1.7 2.3 6 6 0 0 1 .2 4.8c-.2.7-.6 1.3-1 1.9a7.6 7.6 0 0 1-3.6 2.5v.5Z" fill-rule="evenodd"></path></svg>'
810
818
  }],
811
819
  commands: {
812
- insertSpecialCharacter: (t, e) => {
813
- const a = e?.contentElement instanceof HTMLElement ? e.contentElement : k();
814
- return S(a), !0;
820
+ insertSpecialCharacter: (a, e) => {
821
+ const t = (e == null ? void 0 : e.contentElement) instanceof HTMLElement ? e.contentElement : w();
822
+ return S(t), !0;
815
823
  }
816
824
  },
817
825
  keymap: {}
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const j=new Set(["the","a","an","and","or","but","in","on","at","to","for","of","with","by","from","is","are","be","was","were","have","has","had","do","does","did","will","would","could","should","may","might","must","can","this","that","these","those","what","which","who","whom","where","when","why","how","all","each","every","both","few","more","most","other","same","such","no","nor","not","only","own","so","than","too","very","just","as","if","because","while","although","though","it","its","their","them","they","you","he","she","we","me","him","her","us","our","i","my","your","his","hers","ours","yours","theirs","editor","document","text","word","paragraph","line","page","content","hello","world","test","example","sample","demo","lorem","ipsum"]),C=new Set,S=new Set;let u=!1,d=null,f=null,a=null,s=null,x=null,y=!1,h=null,_=!1,b=0,g=null;const B={characterData:!0,childList:!0,subtree:!0},H="rte-spellcheck-styles",R="__editoraCommandEditorRoot";function K(e){const t=e?.contentElement||e?.editorElement||null;if(!(t instanceof HTMLElement))return;const r=t.getAttribute("contenteditable")==="true"?t:t.querySelector?.('[contenteditable="true"]');if(r instanceof HTMLElement){s=r,h=r;return}const l=t.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")||(t.matches("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")?t:null),o=A(l);o&&(s=o,h=o)}function P(){if(typeof window>"u")return null;const e=window[R];if(!(e instanceof HTMLElement))return null;window[R]=null;const t=e.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")||(e.matches("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")?e:null);if(t){const l=A(t);if(l)return l;if(t.getAttribute("contenteditable")==="true")return t}if(e.getAttribute("contenteditable")==="true")return e;const r=e.closest('[contenteditable="true"]');return r instanceof HTMLElement?r:null}function T(){let e=document.getElementById(H);e||(e=document.createElement("style"),e.id=H,document.head.appendChild(e)),e.textContent=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const j=new Set(["the","a","an","and","or","but","in","on","at","to","for","of","with","by","from","is","are","be","was","were","have","has","had","do","does","did","will","would","could","should","may","might","must","can","this","that","these","those","what","which","who","whom","where","when","why","how","all","each","every","both","few","more","most","other","same","such","no","nor","not","only","own","so","than","too","very","just","as","if","because","while","although","though","it","its","their","them","they","you","he","she","we","me","him","her","us","our","i","my","your","his","hers","ours","yours","theirs","editor","document","text","word","paragraph","line","page","content","hello","world","test","example","sample","demo","lorem","ipsum"]),C=new Set,S=new Set;let u=!1,d=null,f=null,a=null,s=null,x=null,y=!1,h=null,_=!1,b=0,g=null;const P={characterData:!0,childList:!0,subtree:!0},H="rte-spellcheck-styles",R="__editoraCommandEditorRoot";function K(e){var l;const t=(e==null?void 0:e.contentElement)||(e==null?void 0:e.editorElement)||null;if(!(t instanceof HTMLElement))return;const r=t.getAttribute("contenteditable")==="true"?t:(l=t.querySelector)==null?void 0:l.call(t,'[contenteditable="true"]');if(r instanceof HTMLElement){s=r,h=r;return}const n=t.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")||(t.matches("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")?t:null),o=A(n);o&&(s=o,h=o)}function B(){if(typeof window>"u")return null;const e=window[R];if(!(e instanceof HTMLElement))return null;window[R]=null;const t=e.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")||(e.matches("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")?e:null);if(t){const n=A(t);if(n)return n;if(t.getAttribute("contenteditable")==="true")return t}if(e.getAttribute("contenteditable")==="true")return e;const r=e.closest('[contenteditable="true"]');return r instanceof HTMLElement?r:null}function T(){let e=document.getElementById(H);e||(e=document.createElement("style"),e.id=H,document.head.appendChild(e)),e.textContent=`
2
2
  .rte-spell-check-panel {
3
3
  position: absolute;
4
4
  top: 12px;
@@ -466,7 +466,7 @@
466
466
  :is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spellcheck-menu-item.positive {
467
467
  color: #93c5fd;
468
468
  }
469
- `}function k(){if(s&&document.contains(s))return s;const e=V();return e&&(s=e),e}function W(e){if(!e)return;const r=(e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest('[contenteditable="true"]');r&&(s=r)}function A(e){if(!e)return null;const t=e.querySelector('[contenteditable="true"]');return t instanceof HTMLElement?t:null}function Q(){if(_)return;const e=t=>{const r=t.target;if(!r)return;const l=r.closest('.editora-toolbar-button[data-command="toggleSpellCheck"], .rte-toolbar-button[data-command="toggleSpellCheck"]');if(!l)return;const o=l.closest("[data-editora-editor]"),n=A(o);n&&(h=n,s=n)};document.addEventListener("pointerdown",e,!0),_=!0}function ee(){const e=P();if(e&&document.contains(e))return s=e,h=null,e;if(h&&document.contains(h)){const t=h;return h=null,s=t,t}return V()}function te(){b+=1,b===1&&d&&d.disconnect()}function re(){if(b===0||(b-=1,b>0)||!d)return;const e=k();e&&d.observe(e,B)}function N(e){te();try{return e()}finally{re()}}const oe=()=>{try{const e=localStorage.getItem("rte-custom-dictionary");e&&JSON.parse(e).forEach(r=>C.add(r.toLowerCase()))}catch(e){console.warn("Failed to load custom dictionary:",e)}},le=()=>{try{const e=Array.from(C);localStorage.setItem("rte-custom-dictionary",JSON.stringify(e))}catch(e){console.warn("Failed to save custom dictionary:",e)}};function ne(e,t){const r=[];for(let l=0;l<=t.length;l++)r[l]=[l];for(let l=0;l<=e.length;l++)r[0][l]=l;for(let l=1;l<=t.length;l++)for(let o=1;o<=e.length;o++)t.charAt(l-1)===e.charAt(o-1)?r[l][o]=r[l-1][o-1]:r[l][o]=Math.min(r[l-1][o-1]+1,r[l][o-1]+1,r[l-1][o]+1);return r[t.length][e.length]}function ce(e){const t=e.toLowerCase();return j.has(t)||C.has(t)||S.has(t)}function ae(e,t=5){const r=e.toLowerCase(),o=Array.from(j).map(n=>({word:n,distance:ne(r,n)}));return o.sort((n,c)=>n.distance-c.distance),o.filter(n=>n.distance<=3).slice(0,t).map(n=>n.word)}function se(e){if(e.nodeType!==Node.ELEMENT_NODE)return!1;const t=e;return!!(t.closest('code, pre, [contenteditable="false"], .rte-widget, .rte-template, .rte-comment, .rte-merge-tag')||t.hasAttribute("data-comment-id")||t.hasAttribute("data-template")||t.hasAttribute("data-merge-tag"))}function ie(e){const t=[],r=/([\p{L}\p{M}\p{N}\p{Emoji_Presentation}\u200d'-]+|[\uD800-\uDBFF][\uDC00-\uDFFF])/gu;let l;for(;(l=r.exec(e.data))!==null;){const o=l[0],n=l.index,c=n+o.length;/https?:\/\//.test(o)||/@/.test(o)||/\{\{.*\}\}/.test(o)||/^\d+$/.test(o)||ce(o)||/[a-z][A-Z]/.test(o)||/-/.test(o)||o[0]===o[0].toUpperCase()&&o.length>1||t.push({id:`${o}-${n}`,node:e,startOffset:n,endOffset:c,word:o,suggestions:ae(o),ignored:!1})}return t}const V=()=>{const e=P();if(e&&document.contains(e))return s=e,e;const t=window.getSelection();if(t&&t.rangeCount>0){let l=t.getRangeAt(0).startContainer;for(;l&&l!==document.body;){if(l.nodeType===Node.ELEMENT_NODE){const o=l;if(o.getAttribute("contenteditable")==="true")return o}l=l.parentNode}}const r=document.activeElement;if(r){if(r.getAttribute("contenteditable")==="true")return r;const l=r.closest('[contenteditable="true"]');if(l)return l;const o=r.closest("[data-editora-editor]");if(o){const n=o.querySelector('[contenteditable="true"]');if(n)return n}}return document.querySelector('[contenteditable="true"]')};function M(){const e=k();if(!e)return[];const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:o=>!o.textContent?.trim()||o.parentNode&&se(o.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let l=r.nextNode();for(;l;)t.push(...ie(l)),l=r.nextNode();return t}function m(e){const t=k();t&&(e||(e=M()),N(()=>{t.querySelectorAll(".rte-misspelled").forEach(r=>{const l=r.parentNode;if(l){for(;r.firstChild;)l.insertBefore(r.firstChild,r);l.removeChild(r)}}),e.forEach(r=>{if(S.has(r.word.toLowerCase()))return;const l=r.node.data.length;if(!(r.startOffset<0||r.endOffset>l||r.startOffset>=r.endOffset))try{const o=document.createRange();o.setStart(r.node,r.startOffset),o.setEnd(r.node,r.endOffset);const n=document.createElement("span");n.className="rte-misspelled",n.setAttribute("data-word",r.word),n.setAttribute("data-suggestions",r.suggestions.join(",")),n.setAttribute("title",`Suggestions: ${r.suggestions.join(", ")}`),n.style.borderBottom="2px wavy red",n.style.cursor="pointer",o.surroundContents(n)}catch{}})}),E(e))}function L(){const e=k();e&&N(()=>{e.querySelectorAll(".rte-misspelled").forEach(t=>{const r=t.parentNode;if(r){for(;t.firstChild;)r.insertBefore(t.firstChild,t);r.removeChild(t)}})})}function de(e,t){N(()=>{const r=document.createRange();r.setStart(e.node,e.startOffset),r.setEnd(e.node,e.endOffset);const l=document.createTextNode(t);r.deleteContents(),r.insertNode(l)})}function G(e){S.add(e.toLowerCase()),L(),m()}function J(e){C.add(e.toLowerCase()),le(),L(),m()}function pe(e){const t=k();if(!t)return{total:0,misspelled:0,accuracy:100};e||(e=M());const r=e.filter(c=>!S.has(c.word.toLowerCase())).length,n=((t.textContent||"").match(/[\p{L}\p{M}\p{N}]+/gu)||[]).length;return{total:n,misspelled:r,accuracy:n>0?(n-r)/n*100:100}}function he(e,t){const r=document.createTextNode(t);e.replaceWith(r)}function ue(e){e.classList.remove("rte-misspelled"),e.removeAttribute("data-word"),e.removeAttribute("data-suggestions"),e.removeAttribute("title"),e.style.borderBottom="",e.style.cursor=""}function me(e,t,r,l,o){W(o),document.querySelectorAll(".rte-spellcheck-menu").forEach(p=>p.remove());const n=document.createElement("div");if(n.className="rte-spellcheck-menu",l.slice(0,5).forEach(p=>{const v=document.createElement("div");v.className="rte-spellcheck-menu-item",v.textContent=p,v.onclick=()=>{he(o,p),window.setTimeout(()=>{u&&(m(),E())},0),n.remove()},n.appendChild(v)}),l.length>0){const p=document.createElement("div");p.style.cssText="height: 1px; background: #ddd; margin: 4px 0;",n.appendChild(p)}const c=document.createElement("div");c.className="rte-spellcheck-menu-item meta",c.textContent="Ignore Once",c.onclick=()=>{ue(o),n.remove()},n.appendChild(c);const i=document.createElement("div");i.className="rte-spellcheck-menu-item meta",i.textContent="Ignore All",i.onclick=()=>{G(r),n.remove()},n.appendChild(i);const w=document.createElement("div");w.className="rte-spellcheck-menu-item positive",w.textContent="Add to Dictionary",w.onclick=()=>{J(r),n.remove()},n.appendChild(w),document.body.appendChild(n);const D=n.getBoundingClientRect(),X=window.innerWidth-D.width-8,Z=window.innerHeight-D.height-8;n.style.left=`${Math.max(8,Math.min(e,X))}px`,n.style.top=`${Math.max(8,Math.min(t,Z))}px`;const F=p=>{n.contains(p.target)||(n.remove(),document.removeEventListener("mousedown",F))};setTimeout(()=>document.addEventListener("mousedown",F),0)}function I(){y||(x=e=>{const t=e.target;if(t&&t.classList.contains("rte-misspelled")){e.preventDefault(),W(t);const r=t.getAttribute("data-word"),l=(t.getAttribute("data-suggestions")||"").split(",").filter(o=>o);me(e.clientX,e.clientY,r,l,t)}},document.addEventListener("contextmenu",x),y=!0)}function ke(){!y||!x||(document.removeEventListener("contextmenu",x),x=null,y=!1)}function fe(e){return e.closest("[data-editora-editor]")||e.parentElement||e}function q(){const e=k();if(!e)throw new Error("Spell check panel requested without active editor");const t=fe(e);T();const r=document.createElement("div");return r.className="rte-spell-check-panel",window.getComputedStyle(t).position==="static"&&(t.style.position="relative"),t.appendChild(r),r}function E(e){if(!a)return;const t=e||M(),r=pe(t);a.innerHTML=`
469
+ `}function k(){if(s&&document.contains(s))return s;const e=V();return e&&(s=e),e}function W(e){if(!e)return;const t=e.nodeType===Node.ELEMENT_NODE?e:e.parentElement,r=t==null?void 0:t.closest('[contenteditable="true"]');r&&(s=r)}function A(e){if(!e)return null;const t=e.querySelector('[contenteditable="true"]');return t instanceof HTMLElement?t:null}function Q(){if(_)return;const e=t=>{const r=t.target;if(!r)return;const n=r.closest('.editora-toolbar-button[data-command="toggleSpellCheck"], .rte-toolbar-button[data-command="toggleSpellCheck"]');if(!n)return;const o=n.closest("[data-editora-editor]"),l=A(o);l&&(h=l,s=l)};document.addEventListener("pointerdown",e,!0),_=!0}function ee(){const e=B();if(e&&document.contains(e))return s=e,h=null,e;if(h&&document.contains(h)){const t=h;return h=null,s=t,t}return V()}function te(){b+=1,b===1&&d&&d.disconnect()}function re(){if(b===0||(b-=1,b>0)||!d)return;const e=k();e&&d.observe(e,P)}function N(e){te();try{return e()}finally{re()}}const oe=()=>{try{const e=localStorage.getItem("rte-custom-dictionary");e&&JSON.parse(e).forEach(r=>C.add(r.toLowerCase()))}catch(e){console.warn("Failed to load custom dictionary:",e)}},le=()=>{try{const e=Array.from(C);localStorage.setItem("rte-custom-dictionary",JSON.stringify(e))}catch(e){console.warn("Failed to save custom dictionary:",e)}};function ne(e,t){const r=[];for(let n=0;n<=t.length;n++)r[n]=[n];for(let n=0;n<=e.length;n++)r[0][n]=n;for(let n=1;n<=t.length;n++)for(let o=1;o<=e.length;o++)t.charAt(n-1)===e.charAt(o-1)?r[n][o]=r[n-1][o-1]:r[n][o]=Math.min(r[n-1][o-1]+1,r[n][o-1]+1,r[n-1][o]+1);return r[t.length][e.length]}function ce(e){const t=e.toLowerCase();return j.has(t)||C.has(t)||S.has(t)}function ae(e,t=5){const r=e.toLowerCase(),o=Array.from(j).map(l=>({word:l,distance:ne(r,l)}));return o.sort((l,c)=>l.distance-c.distance),o.filter(l=>l.distance<=3).slice(0,t).map(l=>l.word)}function se(e){if(e.nodeType!==Node.ELEMENT_NODE)return!1;const t=e;return!!(t.closest('code, pre, [contenteditable="false"], .rte-widget, .rte-template, .rte-comment, .rte-merge-tag')||t.hasAttribute("data-comment-id")||t.hasAttribute("data-template")||t.hasAttribute("data-merge-tag"))}function ie(e){const t=[],r=/([\p{L}\p{M}\p{N}\p{Emoji_Presentation}\u200d'-]+|[\uD800-\uDBFF][\uDC00-\uDFFF])/gu;let n;for(;(n=r.exec(e.data))!==null;){const o=n[0],l=n.index,c=l+o.length;/https?:\/\//.test(o)||/@/.test(o)||/\{\{.*\}\}/.test(o)||/^\d+$/.test(o)||ce(o)||/[a-z][A-Z]/.test(o)||/-/.test(o)||o[0]===o[0].toUpperCase()&&o.length>1||t.push({id:`${o}-${l}`,node:e,startOffset:l,endOffset:c,word:o,suggestions:ae(o),ignored:!1})}return t}const V=()=>{const e=B();if(e&&document.contains(e))return s=e,e;const t=window.getSelection();if(t&&t.rangeCount>0){let n=t.getRangeAt(0).startContainer;for(;n&&n!==document.body;){if(n.nodeType===Node.ELEMENT_NODE){const o=n;if(o.getAttribute("contenteditable")==="true")return o}n=n.parentNode}}const r=document.activeElement;if(r){if(r.getAttribute("contenteditable")==="true")return r;const n=r.closest('[contenteditable="true"]');if(n)return n;const o=r.closest("[data-editora-editor]");if(o){const l=o.querySelector('[contenteditable="true"]');if(l)return l}}return document.querySelector('[contenteditable="true"]')};function M(){const e=k();if(!e)return[];const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:o=>{var l;return!((l=o.textContent)!=null&&l.trim())||o.parentNode&&se(o.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});let n=r.nextNode();for(;n;)t.push(...ie(n)),n=r.nextNode();return t}function m(e){const t=k();t&&(e||(e=M()),N(()=>{t.querySelectorAll(".rte-misspelled").forEach(r=>{const n=r.parentNode;if(n){for(;r.firstChild;)n.insertBefore(r.firstChild,r);n.removeChild(r)}}),e.forEach(r=>{if(S.has(r.word.toLowerCase()))return;const n=r.node.data.length;if(!(r.startOffset<0||r.endOffset>n||r.startOffset>=r.endOffset))try{const o=document.createRange();o.setStart(r.node,r.startOffset),o.setEnd(r.node,r.endOffset);const l=document.createElement("span");l.className="rte-misspelled",l.setAttribute("data-word",r.word),l.setAttribute("data-suggestions",r.suggestions.join(",")),l.setAttribute("title",`Suggestions: ${r.suggestions.join(", ")}`),l.style.borderBottom="2px wavy red",l.style.cursor="pointer",o.surroundContents(l)}catch{}})}),E(e))}function L(){const e=k();e&&N(()=>{e.querySelectorAll(".rte-misspelled").forEach(t=>{const r=t.parentNode;if(r){for(;t.firstChild;)r.insertBefore(t.firstChild,t);r.removeChild(t)}})})}function de(e,t){N(()=>{const r=document.createRange();r.setStart(e.node,e.startOffset),r.setEnd(e.node,e.endOffset);const n=document.createTextNode(t);r.deleteContents(),r.insertNode(n)})}function G(e){S.add(e.toLowerCase()),L(),m()}function J(e){C.add(e.toLowerCase()),le(),L(),m()}function pe(e){const t=k();if(!t)return{total:0,misspelled:0,accuracy:100};e||(e=M());const r=e.filter(c=>!S.has(c.word.toLowerCase())).length,l=((t.textContent||"").match(/[\p{L}\p{M}\p{N}]+/gu)||[]).length;return{total:l,misspelled:r,accuracy:l>0?(l-r)/l*100:100}}function he(e,t){const r=document.createTextNode(t);e.replaceWith(r)}function ue(e){e.classList.remove("rte-misspelled"),e.removeAttribute("data-word"),e.removeAttribute("data-suggestions"),e.removeAttribute("title"),e.style.borderBottom="",e.style.cursor=""}function me(e,t,r,n,o){W(o),document.querySelectorAll(".rte-spellcheck-menu").forEach(p=>p.remove());const l=document.createElement("div");if(l.className="rte-spellcheck-menu",n.slice(0,5).forEach(p=>{const v=document.createElement("div");v.className="rte-spellcheck-menu-item",v.textContent=p,v.onclick=()=>{he(o,p),window.setTimeout(()=>{u&&(m(),E())},0),l.remove()},l.appendChild(v)}),n.length>0){const p=document.createElement("div");p.style.cssText="height: 1px; background: #ddd; margin: 4px 0;",l.appendChild(p)}const c=document.createElement("div");c.className="rte-spellcheck-menu-item meta",c.textContent="Ignore Once",c.onclick=()=>{ue(o),l.remove()},l.appendChild(c);const i=document.createElement("div");i.className="rte-spellcheck-menu-item meta",i.textContent="Ignore All",i.onclick=()=>{G(r),l.remove()},l.appendChild(i);const w=document.createElement("div");w.className="rte-spellcheck-menu-item positive",w.textContent="Add to Dictionary",w.onclick=()=>{J(r),l.remove()},l.appendChild(w),document.body.appendChild(l);const D=l.getBoundingClientRect(),X=window.innerWidth-D.width-8,Z=window.innerHeight-D.height-8;l.style.left=`${Math.max(8,Math.min(e,X))}px`,l.style.top=`${Math.max(8,Math.min(t,Z))}px`;const F=p=>{l.contains(p.target)||(l.remove(),document.removeEventListener("mousedown",F))};setTimeout(()=>document.addEventListener("mousedown",F),0)}function I(){y||(x=e=>{const t=e.target;if(t&&t.classList.contains("rte-misspelled")){e.preventDefault(),W(t);const r=t.getAttribute("data-word"),n=(t.getAttribute("data-suggestions")||"").split(",").filter(o=>o);me(e.clientX,e.clientY,r,n,t)}},document.addEventListener("contextmenu",x),y=!0)}function ke(){!y||!x||(document.removeEventListener("contextmenu",x),x=null,y=!1)}function fe(e){return e.closest("[data-editora-editor]")||e.parentElement||e}function q(){const e=k();if(!e)throw new Error("Spell check panel requested without active editor");const t=fe(e);T();const r=document.createElement("div");return r.className="rte-spell-check-panel",window.getComputedStyle(t).position==="static"&&(t.style.position="relative"),t.appendChild(r),r}function E(e){if(!a)return;const t=e||M(),r=pe(t);a.innerHTML=`
470
470
  <div class="rte-spellcheck-header">
471
471
  <div>
472
472
  <h3 class="rte-spellcheck-title">Spell Check</h3>
@@ -491,8 +491,8 @@
491
491
  </div>
492
492
 
493
493
  <div class="rte-spellcheck-list">
494
- ${t.length===0?'<div class="rte-spellcheck-empty">No spelling errors found in this editor.</div>':t.map((o,n)=>`
495
- <div class="rte-spellcheck-item" data-word="${o.word}" data-index="${n}">
494
+ ${t.length===0?'<div class="rte-spellcheck-empty">No spelling errors found in this editor.</div>':t.map((o,l)=>`
495
+ <div class="rte-spellcheck-item" data-word="${o.word}" data-index="${l}">
496
496
  <button class="rte-spellcheck-word-header" type="button">
497
497
  <span class="rte-spellcheck-word">${o.word}</span>
498
498
  <span class="rte-spellcheck-caret">▶</span>
@@ -509,4 +509,4 @@
509
509
  </div>
510
510
  `).join("")}
511
511
  </div>
512
- `,a.querySelector(".rte-spellcheck-close")?.addEventListener("click",o=>{o.preventDefault(),o.stopPropagation(),O()}),a.querySelectorAll(".rte-spellcheck-word-header").forEach(o=>{o.addEventListener("click",()=>{const c=o.closest(".rte-spellcheck-item")?.querySelector(".rte-spellcheck-suggestions"),i=o.querySelector(".rte-spellcheck-caret");c&&i&&(c.classList.contains("show")?(c.classList.remove("show"),i.textContent="▶"):(c.classList.add("show"),i.textContent="▼"))})}),a.querySelectorAll(".suggestion-btn").forEach(o=>{o.addEventListener("click",()=>{const n=o.getAttribute("data-suggestion"),c=o.closest(".rte-spellcheck-item");c?.getAttribute("data-word");const i=parseInt(c?.getAttribute("data-index")||"0");t[i]&&(de(t[i],n),m())})}),a.querySelectorAll(".ignore-btn").forEach(o=>{o.addEventListener("click",()=>{const c=o.closest(".rte-spellcheck-item")?.getAttribute("data-word");G(c)})}),a.querySelectorAll(".add-btn").forEach(o=>{o.addEventListener("click",()=>{const c=o.closest(".rte-spellcheck-item")?.getAttribute("data-word");J(c)})})}function $(){const e=k();e&&(d&&d.disconnect(),d=new MutationObserver(t=>{b>0||t.some(r=>r.type==="characterData"||r.type==="childList")&&(f&&clearTimeout(f),f=window.setTimeout(()=>{u&&m()},350))}),d.observe(e,{...B}))}function U(){d&&(d.disconnect(),d=null),f&&(clearTimeout(f),f=null)}function Y(){document.querySelectorAll(".rte-spellcheck-menu").forEach(e=>e.remove())}function z(){g||(g=e=>{e.key!=="Escape"||!u||(e.preventDefault(),e.stopPropagation(),O())},document.addEventListener("keydown",g,!0))}function be(){g&&(document.removeEventListener("keydown",g,!0),g=null)}function O(){return u&&(L(),U(),ke(),Y(),a&&(a.remove(),a=null),s=null,h=null,u=!1,be()),!1}function ge(){const e=ee();return e?u&&s&&s!==e?(L(),U(),Y(),a&&(a.remove(),a=null),s=e,T(),I(),z(),m(),$(),a=q(),E(),!0):u?O():(s=e,u=!0,T(),I(),z(),m(),$(),a&&(a.remove(),a=null),a=q(),E(),!0):!1}const xe=()=>({name:"spellCheck",init:()=>{oe(),Q()},toolbar:[{label:"Spell Check",command:"toggleSpellCheck",icon:'<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M3 12.5L3.84375 9.5M3.84375 9.5L5 5.38889C5 5.38889 5.25 4.5 6 4.5C6.75 4.5 7 5.38889 7 5.38889L8.15625 9.5M3.84375 9.5H8.15625M9 12.5L8.15625 9.5M13 16.8333L15.4615 19.5L21 13.5M12 8.5H15C16.1046 8.5 17 7.60457 17 6.5C17 5.39543 16.1046 4.5 15 4.5H12V8.5ZM12 8.5H16C17.1046 8.5 18 9.39543 18 10.5C18 11.6046 17.1046 12.5 16 12.5H12V8.5Z" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path> </g></svg>',shortcut:"F7"}],commands:{toggleSpellCheck:(e,t)=>(K(t),ge(),!0)},keymap:{F7:"toggleSpellCheck"}});exports.SpellCheckPlugin=xe;
512
+ `;const n=a.querySelector(".rte-spellcheck-close");n==null||n.addEventListener("click",o=>{o.preventDefault(),o.stopPropagation(),O()}),a.querySelectorAll(".rte-spellcheck-word-header").forEach(o=>{o.addEventListener("click",()=>{const l=o.closest(".rte-spellcheck-item"),c=l==null?void 0:l.querySelector(".rte-spellcheck-suggestions"),i=o.querySelector(".rte-spellcheck-caret");c&&i&&(c.classList.contains("show")?(c.classList.remove("show"),i.textContent="▶"):(c.classList.add("show"),i.textContent="▼"))})}),a.querySelectorAll(".suggestion-btn").forEach(o=>{o.addEventListener("click",()=>{const l=o.getAttribute("data-suggestion"),c=o.closest(".rte-spellcheck-item");c==null||c.getAttribute("data-word");const i=parseInt((c==null?void 0:c.getAttribute("data-index"))||"0");t[i]&&(de(t[i],l),m())})}),a.querySelectorAll(".ignore-btn").forEach(o=>{o.addEventListener("click",()=>{const l=o.closest(".rte-spellcheck-item"),c=l==null?void 0:l.getAttribute("data-word");G(c)})}),a.querySelectorAll(".add-btn").forEach(o=>{o.addEventListener("click",()=>{const l=o.closest(".rte-spellcheck-item"),c=l==null?void 0:l.getAttribute("data-word");J(c)})})}function $(){const e=k();e&&(d&&d.disconnect(),d=new MutationObserver(t=>{b>0||t.some(r=>r.type==="characterData"||r.type==="childList")&&(f&&clearTimeout(f),f=window.setTimeout(()=>{u&&m()},350))}),d.observe(e,{...P}))}function U(){d&&(d.disconnect(),d=null),f&&(clearTimeout(f),f=null)}function Y(){document.querySelectorAll(".rte-spellcheck-menu").forEach(e=>e.remove())}function z(){g||(g=e=>{e.key!=="Escape"||!u||(e.preventDefault(),e.stopPropagation(),O())},document.addEventListener("keydown",g,!0))}function be(){g&&(document.removeEventListener("keydown",g,!0),g=null)}function O(){return u&&(L(),U(),ke(),Y(),a&&(a.remove(),a=null),s=null,h=null,u=!1,be()),!1}function ge(){const e=ee();return e?u&&s&&s!==e?(L(),U(),Y(),a&&(a.remove(),a=null),s=e,T(),I(),z(),m(),$(),a=q(),E(),!0):u?O():(s=e,u=!0,T(),I(),z(),m(),$(),a&&(a.remove(),a=null),a=q(),E(),!0):!1}const xe=()=>({name:"spellCheck",init:()=>{oe(),Q()},toolbar:[{label:"Spell Check",command:"toggleSpellCheck",icon:'<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M3 12.5L3.84375 9.5M3.84375 9.5L5 5.38889C5 5.38889 5.25 4.5 6 4.5C6.75 4.5 7 5.38889 7 5.38889L8.15625 9.5M3.84375 9.5H8.15625M9 12.5L8.15625 9.5M13 16.8333L15.4615 19.5L21 13.5M12 8.5H15C16.1046 8.5 17 7.60457 17 6.5C17 5.39543 16.1046 4.5 15 4.5H12V8.5ZM12 8.5H16C17.1046 8.5 18 9.39543 18 10.5C18 11.6046 17.1046 12.5 16 12.5H12V8.5Z" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path> </g></svg>',shortcut:"F7"}],commands:{toggleSpellCheck:(e,t)=>(K(t),ge(),!0)},keymap:{F7:"toggleSpellCheck"}});exports.SpellCheckPlugin=xe;