@richscripts/richtexteditor 2.15.0 → 2.16.0

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 (96) hide show
  1. package/README.md +9 -0
  2. package/angular/build-manifest.json +4 -4
  3. package/angular/index.mjs +1 -1
  4. package/index.d.ts +42 -33
  5. package/integrations/shared.js +10 -0
  6. package/package.json +1 -1
  7. package/richtexteditor/all_plugins.js +2062 -1542
  8. package/richtexteditor/all_plugins.min.js +76 -61
  9. package/richtexteditor/lang/rte-lang-de.js +33 -0
  10. package/richtexteditor/lang/rte-lang-es.js +33 -0
  11. package/richtexteditor/lang/rte-lang-fr.js +33 -0
  12. package/richtexteditor/lang/rte-lang-it.js +33 -0
  13. package/richtexteditor/lang/rte-lang-ja.js +33 -0
  14. package/richtexteditor/lang/rte-lang-ko.js +33 -0
  15. package/richtexteditor/lang/rte-lang-nl.js +33 -0
  16. package/richtexteditor/lang/rte-lang-pt-pt.js +33 -0
  17. package/richtexteditor/lang/rte-lang-pt.js +33 -0
  18. package/richtexteditor/lang/rte-lang-ru.js +33 -0
  19. package/richtexteditor/lang/rte-lang-zh-Hans.js +33 -0
  20. package/richtexteditor/lang/rte-lang-zh-Hant.js +33 -0
  21. package/richtexteditor/plugins/a11yenhance.js +3 -1
  22. package/richtexteditor/plugins/a11yenhance.min.js +1 -1
  23. package/richtexteditor/plugins/accessibilitychecker.js +7 -7
  24. package/richtexteditor/plugins/accessibilitychecker.min.js +1 -1
  25. package/richtexteditor/plugins/aitoolkit.js +91 -83
  26. package/richtexteditor/plugins/aitoolkit.min.js +4 -4
  27. package/richtexteditor/plugins/all_plugins.js +2062 -1542
  28. package/richtexteditor/plugins/all_plugins.min.js +76 -61
  29. package/richtexteditor/plugins/autoembed.js +1 -1
  30. package/richtexteditor/plugins/autoembed.min.js +1 -1
  31. package/richtexteditor/plugins/charlimit.js +2 -2
  32. package/richtexteditor/plugins/charlimit.min.js +2 -2
  33. package/richtexteditor/plugins/comments.js +2 -2
  34. package/richtexteditor/plugins/comments.min.js +2 -2
  35. package/richtexteditor/plugins/contentminimap.js +3 -3
  36. package/richtexteditor/plugins/contentminimap.min.js +1 -1
  37. package/richtexteditor/plugins/crdt-engine.js +27 -1
  38. package/richtexteditor/plugins/documentimport.js +30 -8
  39. package/richtexteditor/plugins/documentimport.min.js +4 -4
  40. package/richtexteditor/plugins/docxexport.js +30 -1
  41. package/richtexteditor/plugins/docxexport.min.js +2 -2
  42. package/richtexteditor/plugins/emojiautocomplete.js +1 -1
  43. package/richtexteditor/plugins/emojiautocomplete.min.js +1 -1
  44. package/richtexteditor/plugins/html2pdf.js +7 -7
  45. package/richtexteditor/plugins/html2pdf.min.js +1 -1
  46. package/richtexteditor/plugins/imageeditor.js +19 -6
  47. package/richtexteditor/plugins/imageeditor.min.js +1 -1
  48. package/richtexteditor/plugins/insertcode.js +8 -8
  49. package/richtexteditor/plugins/insertcode.min.js +4 -4
  50. package/richtexteditor/plugins/insertemoji.js +4 -4
  51. package/richtexteditor/plugins/insertemoji.min.js +1 -1
  52. package/richtexteditor/plugins/insertgallery.js +4 -4
  53. package/richtexteditor/plugins/insertgallery.min.js +1 -1
  54. package/richtexteditor/plugins/inserttemplate.js +10 -2
  55. package/richtexteditor/plugins/inserttemplate.min.js +1 -1
  56. package/richtexteditor/plugins/markdownexport.js +1 -1
  57. package/richtexteditor/plugins/markdownexport.min.js +2 -2
  58. package/richtexteditor/plugins/mentionplugin.js +2 -2
  59. package/richtexteditor/plugins/mentionplugin.min.js +1 -1
  60. package/richtexteditor/plugins/mermaiddiagram.js +5 -5
  61. package/richtexteditor/plugins/mermaiddiagram.min.js +2 -2
  62. package/richtexteditor/plugins/nodetypes.js +1 -1
  63. package/richtexteditor/plugins/nodetypes.min.js +1 -1
  64. package/richtexteditor/plugins/pagination.js +2 -2
  65. package/richtexteditor/plugins/pagination.min.js +1 -1
  66. package/richtexteditor/plugins/pdfexport.js +1751 -1366
  67. package/richtexteditor/plugins/pdfexport.min.js +28 -13
  68. package/richtexteditor/plugins/readaloud.js +1 -1
  69. package/richtexteditor/plugins/readaloud.min.js +1 -1
  70. package/richtexteditor/plugins/revisionhistory.js +4 -4
  71. package/richtexteditor/plugins/revisionhistory.min.js +2 -2
  72. package/richtexteditor/plugins/rubyannotation.js +2 -2
  73. package/richtexteditor/plugins/rubyannotation.min.js +1 -1
  74. package/richtexteditor/plugins/sanitizer.js +57 -4
  75. package/richtexteditor/plugins/sanitizer.min.js +1 -1
  76. package/richtexteditor/plugins/slashcommand.js +2 -2
  77. package/richtexteditor/plugins/slashcommand.min.js +2 -2
  78. package/richtexteditor/plugins/smartchips.js +3 -3
  79. package/richtexteditor/plugins/smartchips.min.js +1 -1
  80. package/richtexteditor/plugins/spellcheck.js +3 -3
  81. package/richtexteditor/plugins/spellcheck.min.js +1 -1
  82. package/richtexteditor/plugins/stateinspector.js +2 -2
  83. package/richtexteditor/plugins/stateinspector.min.js +2 -2
  84. package/richtexteditor/plugins/structured-content-bridge.js +34 -8
  85. package/richtexteditor/plugins/structured-content-bridge.min.js +5 -5
  86. package/richtexteditor/plugins/textdirection.js +1 -1
  87. package/richtexteditor/plugins/textdirection.min.js +1 -1
  88. package/richtexteditor/plugins/trackedchanges.js +1 -1
  89. package/richtexteditor/plugins/trackedchanges.min.js +1 -1
  90. package/richtexteditor/plugins/yjscollab.js +2 -2
  91. package/richtexteditor/plugins/yjscollab.min.js +1 -1
  92. package/richtexteditor/rte-config.js +14 -36
  93. package/richtexteditor/rte-watchdog.js +3 -1
  94. package/richtexteditor/rte-webcomponent.js +3 -1
  95. package/richtexteditor/rte.js +16 -38
  96. package/richtexteditor/runtime/colorpicker_more_ns.htm +3 -1
@@ -1 +1 @@
1
- window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_sanitizer=RTE_Plugin_Sanitizer,typeof RTE_DefaultConfig.contentSanitizer>"u"&&(RTE_DefaultConfig.contentSanitizer=!0);function RTE_Plugin_Sanitizer(){var S=this,p,l,O=!1,m={removedTags:[],removedAttributes:[],calls:0,lastPasses:0},P=[];S.PluginName="Sanitizer",S.InitConfig=function(t){p=t},S.InitEditor=function(t){if(l=t,p.contentSanitizer===!1)return;l.sanitizeHtml=function(r){return T(String(r??""))},l.getSanitizerReport=function(){return JSON.parse(JSON.stringify(m))};function e(){try{Q(),V()}catch{}try{re()}catch{}try{te()}catch{}}e();try{l.attachEvent("ready",e)}catch{}setTimeout(e,0),setTimeout(e,400)};var D={};"p,div,span,br,hr,h1,h2,h3,h4,h5,h6,b,strong,i,em,u,s,strike,del,ins,mark,small,sub,sup,abbr,cite,q,dfn,kbd,samp,var,time,data,bdi,bdo,wbr,ruby,rt,rp,ul,ol,li,dl,dt,dd,table,thead,tbody,tfoot,tr,td,th,caption,colgroup,col,blockquote,pre,code,figure,figcaption,section,article,header,footer,main,aside,nav,address,details,summary,a,img,picture,source,video,audio,track,map,area,video-container,input,label,button,svg,g,path,circle,ellipse,rect,line,polyline,polygon,text,tspan,defs,marker,linearGradient,radialGradient,stop,clipPath,mask,pattern,use,symbol,title,desc".split(",").forEach(function(t){D[t]=!0});var G={script:1,noscript:1,template:1,object:1,embed:1,applet:1,base:1,meta:1,link:1,frame:1,frameset:1,foreignobject:1,xml:1,"script:":1},k={};"id,class,style,title,lang,dir,translate,hidden,tabindex,role,contenteditable,spellcheck,autocomplete,draggable,sandbox,allowfullscreen,allow,frameborder,scrolling,href,src,srcset,sizes,alt,width,height,loading,decoding,referrerpolicy,target,rel,hreflang,media,download,type,value,name,placeholder,checked,disabled,readonly,colspan,rowspan,headers,scope,abbr,span,align,valign,bgcolor,border,cellpadding,cellspacing,start,reversed,datetime,cite,open,controls,autoplay,loop,muted,playsinline,poster,preload,kind,srclang,label,usemap,ismap,coords,shape,viewbox,xmlns,fill,stroke,stroke-width,stroke-linecap,stroke-linejoin,stroke-dasharray,d,cx,cy,r,rx,ry,x,y,x1,y1,x2,y2,points,transform,opacity,fill-rule,clip-rule,gradientunits,offset,stop-color,stop-opacity,text-anchor,font-size,font-family,font-weight,preserveaspectratio,version".split(",").forEach(function(t){k[t]=!0});var $={href:1,src:1,action:1,formaction:1,poster:1,cite:1,data:1,longdesc:1,background:1,ping:1,srcset:1},F=/^(https?|mailto|tel|ftp|sms|callto|webcal|geo|bitcoin):/i,U=/^data:image\/(png|jpe?g|gif|webp|bmp|x-icon|avif);base64,[a-z0-9+/=\s]+$/i;function y(t,e,r){var a=String(t??"").replace(/[\u0000-\u0020\u007F-\u00A0]+/g,"").trim();if(!a)return!1;if(e==="use")return a.charAt(0)==="#";if(/^[#?/]/.test(a))return!0;var o=/^([a-z][a-z0-9+.\-]*):/i.exec(a);return o?U.test(a)?e==="img"||e==="source"||r==="poster"||r==="srcset":/^blob:/i.test(a)?e==="img"||e==="video"||e==="audio"||e==="source":F.test(a):!0}function B(t){for(var e=[],r=String(t??"").split(";"),a=0;a<r.length;a++){var o=r[a];if(o.trim()&&!/expression\s*\(|(javascript|vbscript|livescript)\s*:|-moz-binding|behaviou?r\s*:|@import|-o-link/i.test(o)){var n=/url\s*\(\s*(['"]?)([^'")]*)\1\s*\)/i.exec(o);n&&!y(n[2],"img","src")||e.push(o.trim())}}return e.join("; ")}var W="allow-scripts allow-same-origin allow-presentation",Z={1:"x-small",2:"small",3:"medium",4:"large",5:"x-large",6:"xx-large",7:"xxx-large"};function q(t){var e=[],r=t.getAttribute("face");if(r){var a=r.split(",").map(function(s){return s.trim().replace(/^['"]|['"]$/g,"")}).filter(function(s){return/^[A-Za-z0-9][A-Za-z0-9 \-]{0,63}$/.test(s)}).map(function(s){return/\s/.test(s)?"'"+s+"'":s});a.length&&e.push("font-family:"+a.join(","))}var o=(t.getAttribute("color")||"").trim();(/^#[0-9a-f]{3}(?:[0-9a-f]{3})?$/i.test(o)||/^rgb\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*\)$/i.test(o)||/^[a-z]{3,20}$/i.test(o))&&e.push("color:"+o);var n=Z[(t.getAttribute("size")||"").trim()];return n&&e.push("font-size:"+n),e.join(";")}function J(t,e){var r=W.split(" "),a=!1;try{a=new URL(e,location.href).origin===location.origin}catch{}if(a&&(r=r.filter(function(n){return n!=="allow-same-origin"})),t.hasAttribute("sandbox")){var o=(t.getAttribute("sandbox")||"").toLowerCase().split(/\s+/);r=r.filter(function(n){return o.indexOf(n)>=0})}t.setAttribute("sandbox",r.join(" "))}function X(t){if(p.sanitizerAllowIframes===!1)return!1;var e=t.getAttribute("src")||"";if(!/^https?:/i.test(e))return!1;var r=p.sanitizerAllowedIframeHosts;if(!r||!r.length)return J(t,e),!0;try{for(var a=new URL(e).hostname.toLowerCase(),o=0;o<r.length;o++){var n=String(r[o]).toLowerCase();if(a===n||a.slice(-(n.length+1))==="."+n)return!0}}catch{}return!1}function R(t){var e={},r=[],a=[];(t||[]).forEach(function(n){if(n instanceof RegExp){a.push(n);return}var s=String(n).toLowerCase();if(s.indexOf("*")===-1){e[s]=!0;return}r.push(s.split("*"))});function o(n,s){var i=n[0];if(s.lastIndexOf(i,0)!==0)return!1;var u=n[n.length-1];if(u&&(s.length<u.length||s.indexOf(u,s.length-u.length)===-1))return!1;for(var b=i.length,h=1;h<n.length;h++)if(n[h]){var g=s.indexOf(n[h],b);if(g===-1)return!1;b=g+n[h].length}return!0}return function(n){if(e[n])return!0;for(var s=0;s<r.length;s++)if(o(r[s],n))return!0;for(var i=0;i<a.length;i++)if(a[i].test(n))return!0;return!1}}function z(t,e){var r=R(p.sanitizerAllowTags),a=R(p.sanitizerAllowAttributes),o=p.sanitizerAllowStyleTags===!0,n=[];(function L(x){for(var N=0;N<x.childNodes.length;N++){var w=x.childNodes[N];w.nodeType===1?(n.push(w),L(w)):w.nodeType===8&&n.push(w)}})(t);for(var s=0;s<n.length;s++){var i=n[s];if(i.parentNode){if(i.nodeType===8){M(i.data)&&(c(e.removedTags,"#comment"),i.parentNode.removeChild(i));continue}var u=(i.localName||i.nodeName||"").toLowerCase();if(u==="style"){if(!o){c(e.removedTags,"style"),i.parentNode.removeChild(i);continue}}else if(u==="iframe"){if(i.hasAttribute("srcdoc")&&(c(e.removedAttributes,"iframe[srcdoc]"),i.removeAttribute("srcdoc")),!X(i)){c(e.removedTags,"iframe"),i.parentNode.removeChild(i);continue}}else if(u==="title"||u==="desc"){if(!i.closest||!i.closest("svg")){c(e.removedTags,u),i.parentNode.removeChild(i);continue}}else if(u==="center"||u==="big"||u==="tt"){c(e.removedTags,u);var b=i.ownerDocument.createElement(u==="center"?"div":u==="big"?"span":"code");for(u==="center"&&b.setAttribute("style","text-align:center"),u==="big"&&b.setAttribute("style","font-size:larger");i.firstChild;)b.appendChild(i.firstChild);i.parentNode.replaceChild(b,i);continue}else if(u==="font"){var h=q(i);if(c(e.removedTags,"font"),!h){I(i);continue}var g=i.ownerDocument.createElement("span");for(g.setAttribute("style",h);i.firstChild;)g.appendChild(i.firstChild);i.parentNode.replaceChild(g,i);continue}else if(G[u]){c(e.removedTags,u),i.parentNode.removeChild(i);continue}else if(!D[u]&&!r(u)){c(e.removedTags,u),I(i);continue}for(var d=[],H=!1,_=0;_<i.attributes.length;_++)d.push(i.attributes[_]);for(var v=0;v<d.length;v++){var f=d[v].name.toLowerCase(),A=d[v].value;if(f.indexOf("on")===0){c(e.removedAttributes,f),i.removeAttribute(d[v].name);continue}if(f==="xlink:href"||f==="xmlns:xlink"){y(A,u,f)||(c(e.removedAttributes,f),i.removeAttribute(d[v].name));continue}if(f==="srcdoc"){c(e.removedAttributes,"srcdoc"),i.removeAttribute(d[v].name);continue}if(f==="style"){i.setAttribute("style",B(A));continue}if(/^data-(.*-)?(src|srcset|original)$/i.test(f)){var ie=/srcset$/i.test(f)?A.split(",").every(function(L){var x=L.trim().split(/\s+/)[0];return!x||y(x,u,"src")}):y(A,u,"src");ie||(c(e.removedAttributes,u+"["+f+"]"),i.removeAttribute(d[v].name));continue}if(!(f.indexOf("data-")===0||f.indexOf("aria-")===0)){if($[f]){y(A,u,f)||(c(e.removedAttributes,u+"["+f+"]"),i.removeAttribute(d[v].name),f==="src"&&(H=!0));continue}!k[f]&&!a(f)&&(c(e.removedAttributes,f),i.removeAttribute(d[v].name))}}if(u==="img"&&H&&!i.hasAttribute("srcset")&&!K(i)){c(e.removedTags,"img"),i.parentNode.removeChild(i);continue}if(u==="a"&&(i.getAttribute("target")||"").toLowerCase()==="_blank"){var E=(i.getAttribute("rel")||"").toLowerCase();E.indexOf("noopener")<0&&i.setAttribute("rel",(E?E+" ":"")+"noopener noreferrer")}}}return t}function I(t){for(var e=t.parentNode;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t)}function c(t,e){t.indexOf(e)<0&&t.push(e)}function K(t){for(var e=0;e<t.attributes.length;e++)if(/^data-(.*-)?(src|srcset|original)$/i.test(t.attributes[e].name))return!0;return!1}function T(t){var e=String(t).replace(/<!--\s*(Start|End)Fragment\s*-->/gi,"");m.calls++;for(var r=0;r<3;r++){var a=new DOMParser().parseFromString("<body>"+e+"</body>","text/html");z(a.body,m);var o=a.body.innerHTML;if(m.lastPasses=r+1,o===e)break;e=o}return e}function Q(){if(!O){for(var t=["getHTMLCode","getHTMLContent"],e=!1,r=0;r<t.length;r++)(function(a){var o=l[a];if(!(typeof o!="function"||o.__rteSanitized)){var n=function(){var s=o.apply(l,arguments);return typeof s!="string"?s:T(s)};n.__rteSanitized=!0,l[a]=n,e=!0}})(t[r]);e&&(O=!0)}}function V(){for(var t=["setHTMLCode","setHTMLContent"],e=0;e<t.length;e++)(function(r){var a=l[r];if(!(typeof a!="function"||a.__rteSanitizedIn)){var o=function(n){var s=[].slice.call(arguments);return typeof n=="string"&&(s[0]=T(n)),a.apply(l,s)};o.__rteSanitizedIn=!0,l[r]=o}})(t[e])}function Y(t){return/\son[a-z]+\s*=/i.test(t)||/<\s*(script|iframe|object|embed|base)\b/i.test(t)||/srcdoc\s*=/i.test(t)||/(javascript|vbscript)\s*:/i.test(t)||/data:\s*text\/html/i.test(t)}function M(t){var e=String(t??"");return e.indexOf("-->")!==-1||e.indexOf("--!>")!==-1||e.charAt(0)===">"||e.charAt(0)==="-"&&e.charAt(1)===">"}var j=/^(script|iframe|object|embed|base|meta|link|form)$/;function C(t){if(!t.attributes)return!1;for(var e=0;e<t.attributes.length;e++){var r=t.attributes[e].name.toLowerCase();if(r.indexOf("on")===0||r==="srcdoc"||(r==="href"||r==="src"||r==="data"||r==="action"||r==="xlink:href")&&/(javascript|vbscript)\s*:|data:\s*text\/html/i.test(t.attributes[e].value||""))return!0}return!1}function ee(t){if(j.test(t.localName||"")||C(t))return!0;for(var e=t.getElementsByTagName?t.getElementsByTagName("*"):[],r=0;r<e.length;r++)if(j.test(e[r].localName||"")||C(e[r]))return!0;return!1}function te(){if(p.sanitizerGuardLiveDom!==!1){var t=null;try{t=l.getEditable()}catch{return}if(!(!t||t.__rteLiveGuard)){t.__rteLiveGuard=!0;var e=new MutationObserver(function(r){for(var a=!1,o=0;o<r.length&&!a;o++){var n=r[o];if(n.type==="attributes"){var s=(n.attributeName||"").toLowerCase();(s.indexOf("on")===0||s==="srcdoc"||C(n.target))&&(a=!0);continue}for(var i=0;i<n.addedNodes.length;i++){var u=n.addedNodes[i];if(u.nodeType===8){if(M(u.data)){a=!0;break}continue}if(u.nodeType===1&&ee(u)){a=!0;break}}}if(a)try{z(t,m)}catch{}});e.observe(t,{childList:!0,subtree:!0,attributes:!0}),P.push(e)}}}function re(){var t=null;try{t=l.getEditable()}catch{return}if(!t||t.__rteSanitizePaste)return;t.__rteSanitizePaste=!0,t.addEventListener("paste",function(r){var a=r.clipboardData||window.clipboardData;if(a){var o="";try{o=a.getData("text/html")||""}catch{return}if(!(!o||!Y(o))){r.preventDefault(),r.stopImmediatePropagation();var n=T(o);try{l.insertHTML(n)}catch{try{l.insertText(a.getData("text/plain")||"")}catch{}}}}},!0);function e(){var r=function(){try{z(t,m)}catch{}};setTimeout(r,0),setTimeout(r,250)}t.addEventListener("paste",e,!1),t.addEventListener("drop",e,!0)}}
1
+ window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_sanitizer=RTE_Plugin_Sanitizer,typeof RTE_DefaultConfig.contentSanitizer>"u"&&(RTE_DefaultConfig.contentSanitizer=!0);function RTE_Plugin_Sanitizer(){var L=this,g,d,M=!1,h={removedTags:[],removedAttributes:[],calls:0,lastPasses:0},Z=[];L.PluginName="Sanitizer",L.InitConfig=function(t){g=t},L.InitEditor=function(t){if(d=t,g.contentSanitizer===!1)return;d.sanitizeHtml=function(r){return C(String(r??""))},d.getSanitizerReport=function(){return JSON.parse(JSON.stringify(h))};function e(){try{ue(),fe()}catch{}try{ve()}catch{}try{de()}catch{}}e();try{d.attachEvent("ready",e)}catch{}setTimeout(e,0),setTimeout(e,400)};var I={};"p,div,span,br,hr,h1,h2,h3,h4,h5,h6,b,strong,i,em,u,s,strike,del,ins,mark,small,sub,sup,abbr,cite,q,dfn,kbd,samp,var,time,data,bdi,bdo,wbr,ruby,rt,rp,ul,ol,li,dl,dt,dd,table,thead,tbody,tfoot,tr,td,th,caption,colgroup,col,blockquote,pre,code,figure,figcaption,section,article,header,footer,main,aside,nav,address,details,summary,a,img,picture,source,video,audio,track,map,area,video-container,input,label,button,svg,g,path,circle,ellipse,rect,line,polyline,polygon,text,tspan,defs,marker,linearGradient,radialGradient,stop,clipPath,mask,pattern,use,symbol,title,desc".split(",").forEach(function(t){I[t.toLowerCase()]=!0});var q={script:1,noscript:1,template:1,object:1,embed:1,applet:1,base:1,meta:1,link:1,frame:1,frameset:1,foreignobject:1,xml:1,"script:":1},P={};"id,class,style,title,lang,dir,translate,hidden,tabindex,role,contenteditable,spellcheck,autocomplete,draggable,sandbox,allowfullscreen,allow,frameborder,scrolling,href,src,srcset,sizes,alt,width,height,loading,decoding,referrerpolicy,target,rel,hreflang,media,download,type,value,name,placeholder,checked,disabled,readonly,colspan,rowspan,headers,scope,abbr,span,align,valign,bgcolor,border,cellpadding,cellspacing,start,reversed,datetime,cite,open,controls,autoplay,loop,muted,playsinline,poster,preload,kind,srclang,label,usemap,ismap,coords,shape,viewbox,xmlns,fill,stroke,stroke-width,stroke-linecap,stroke-linejoin,stroke-dasharray,d,cx,cy,r,rx,ry,x,y,x1,y1,x2,y2,points,transform,opacity,fill-rule,clip-rule,gradientunits,offset,stop-color,stop-opacity,text-anchor,font-size,font-family,font-weight,preserveaspectratio,version".split(",").forEach(function(t){P[t]=!0});var J={href:1,src:1,action:1,formaction:1,poster:1,cite:1,data:1,longdesc:1,background:1,ping:1,srcset:1},X=/^(https?|mailto|tel|ftp|sms|callto|webcal|geo|bitcoin):/i,K=/^data:image\/(png|jpe?g|gif|webp|bmp|x-icon|avif);base64,[a-z0-9+/=\s]+$/i;function A(t,e,r){var a=String(t??"").replace(/[\u0000-\u0020\u007F-\u00A0]+/g,"").trim();if(!a)return!1;if(e==="use")return a.charAt(0)==="#";if(/^[#?/]/.test(a))return!0;var s=/^([a-z][a-z0-9+.\-]*):/i.exec(a);return s?K.test(a)?e==="img"||e==="source"||r==="poster"||r==="srcset":/^blob:/i.test(a)?e==="img"||e==="video"||e==="audio"||e==="source":X.test(a):!0}function Q(t){for(var e=[],r=String(t??"").split(";"),a=0;a<r.length;a++){var s=r[a];if(s.trim()&&!/expression\s*\(|(javascript|vbscript|livescript)\s*:|-moz-binding|behaviou?r\s*:|@import|-o-link/i.test(s)){var i=/url\s*\(\s*(['"]?)([^'")]*)\1\s*\)/i.exec(s);i&&!A(i[2],"img","src")||e.push(s.trim())}}return e.join("; ")}var V="allow-scripts allow-same-origin allow-presentation",Y={1:"x-small",2:"small",3:"medium",4:"large",5:"x-large",6:"xx-large",7:"xxx-large"};function ee(t){var e=[],r=t.getAttribute("face");if(r){var a=r.split(",").map(function(o){return o.trim().replace(/^['"]|['"]$/g,"")}).filter(function(o){return/^[A-Za-z0-9][A-Za-z0-9 \-]{0,63}$/.test(o)}).map(function(o){return/\s/.test(o)?"'"+o+"'":o});a.length&&e.push("font-family:"+a.join(","))}var s=(t.getAttribute("color")||"").trim();(/^#[0-9a-f]{3}(?:[0-9a-f]{3})?$/i.test(s)||/^rgb\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*\)$/i.test(s)||/^[a-z]{3,20}$/i.test(s))&&e.push("color:"+s);var i=Y[(t.getAttribute("size")||"").trim()];return i&&e.push("font-size:"+i),e.join(";")}function te(t,e){var r=V.split(" "),a=!1;try{a=new URL(e,location.href).origin===location.origin}catch{}if(a&&(r=r.filter(function(i){return i!=="allow-same-origin"})),t.hasAttribute("sandbox")){var s=(t.getAttribute("sandbox")||"").toLowerCase().split(/\s+/);r=r.filter(function(i){return s.indexOf(i)>=0})}t.setAttribute("sandbox",r.join(" "))}function re(t){if(g.sanitizerAllowIframes===!1)return!1;var e=t.getAttribute("src")||"";if(!/^https?:/i.test(e))return!1;var r=g.sanitizerAllowedIframeHosts;if(!r||!r.length)return te(t,e),!0;try{for(var a=new URL(e).hostname.toLowerCase(),s=0;s<r.length;s++){var i=String(r[s]).toLowerCase();if(a===i||a.slice(-(i.length+1))==="."+i)return!0}}catch{}return!1}function H(t){var e={},r=[],a=[];(t||[]).forEach(function(i){if(i instanceof RegExp){a.push(i);return}var o=String(i).toLowerCase();if(o.indexOf("*")===-1){e[o]=!0;return}r.push(o.split("*"))});function s(i,o){var v=i[0];if(o.lastIndexOf(v,0)!==0)return!1;var c=i[i.length-1];if(c&&(o.length<c.length||o.indexOf(c,o.length-c.length)===-1))return!1;for(var y=v.length,b=1;b<i.length;b++)if(i[b]){var n=o.indexOf(i[b],y);if(n===-1)return!1;y=n+i[b].length}return!0}return function(i){if(e[i])return!0;for(var o=0;o<r.length;o++)if(s(r[o],i))return!0;for(var v=0;v<a.length;v++)if(a[v].test(i))return!0;return!1}}function z(t,e){var r=H(g.sanitizerAllowTags),a=H(g.sanitizerAllowAttributes),s=g.sanitizerAllowStyleTags===!0,i=[];(function k(T){for(var j=0;j<T.childNodes.length;j++){var S=T.childNodes[j];S.nodeType===1?(i.push(S),k(S)):S.nodeType===8&&i.push(S)}})(t);for(var o=0;o<i.length;o++)if(i[o].nodeType===1)for(var v=(i[o].localName||i[o].nodeName||"").toLowerCase(),c=0;c<x.length;c++){var y=i[o].getAttribute(x[c]);y&&ae(v,x[c],y,r)&&(l(e.removedAttributes,v+"["+x[c]+"]"),i[o].removeAttribute(x[c]))}for(var b=0;b<i.length;b++){var n=i[b];if(n.parentNode){if(n.nodeType===8){$(n.data)&&(l(e.removedTags,"#comment"),n.parentNode.removeChild(n));continue}var u=(n.localName||n.nodeName||"").toLowerCase();if(u==="style"){if(!s){l(e.removedTags,"style"),n.parentNode.removeChild(n);continue}}else if(u==="iframe"){if(n.hasAttribute("srcdoc")&&(l(e.removedAttributes,"iframe[srcdoc]"),n.removeAttribute("srcdoc")),!re(n)){l(e.removedTags,"iframe"),n.parentNode.removeChild(n);continue}}else if(u==="title"||u==="desc"){if(!n.closest||!n.closest("svg")){l(e.removedTags,u),n.parentNode.removeChild(n);continue}}else if(u==="center"||u==="big"||u==="tt"){l(e.removedTags,u);var E=n.ownerDocument.createElement(u==="center"?"div":u==="big"?"span":"code");for(u==="center"&&E.setAttribute("style","text-align:center"),u==="big"&&E.setAttribute("style","font-size:larger");n.firstChild;)E.appendChild(n.firstChild);n.parentNode.replaceChild(E,n);continue}else if(u==="font"){var U=ee(n);if(l(e.removedTags,"font"),!U){F(n);continue}var N=n.ownerDocument.createElement("span");for(N.setAttribute("style",U);n.firstChild;)N.appendChild(n.firstChild);n.parentNode.replaceChild(N,n);continue}else if(q[u]){l(e.removedTags,u),n.parentNode.removeChild(n);continue}else if(!I[u]&&!r(u)){l(e.removedTags,u),F(n);continue}for(var p=[],W=!1,D=0;D<n.attributes.length;D++)p.push(n.attributes[D]);for(var m=0;m<p.length;m++){var f=p[m].name.toLowerCase(),w=p[m].value;if(f.indexOf("on")===0){l(e.removedAttributes,f),n.removeAttribute(p[m].name);continue}if(f==="xlink:href"||f==="xmlns:xlink"){A(w,u,f)||(l(e.removedAttributes,f),n.removeAttribute(p[m].name));continue}if(f==="srcdoc"){l(e.removedAttributes,"srcdoc"),n.removeAttribute(p[m].name);continue}if(f==="style"){n.setAttribute("style",Q(w));continue}if(/^data-(.*-)?(src|srcset|original)$/i.test(f)){var pe=/srcset$/i.test(f)?w.split(",").every(function(k){var T=k.trim().split(/\s+/)[0];return!T||A(T,u,"src")}):A(w,u,"src");pe||(l(e.removedAttributes,u+"["+f+"]"),n.removeAttribute(p[m].name));continue}if(!(f.indexOf("data-")===0||f.indexOf("aria-")===0)){if(J[f]){A(w,u,f)||(l(e.removedAttributes,u+"["+f+"]"),n.removeAttribute(p[m].name),f==="src"&&(W=!0));continue}!P[f]&&!a(f)&&(l(e.removedAttributes,f),n.removeAttribute(p[m].name))}}if(u==="img"&&W&&!n.hasAttribute("srcset")&&!se(n)){l(e.removedTags,"img"),n.parentNode.removeChild(n);continue}if(u==="a"&&(n.getAttribute("target")||"").toLowerCase()==="_blank"){var R=(n.getAttribute("rel")||"").toLowerCase();R.indexOf("noopener")<0&&n.setAttribute("rel",(R?R+" ":"")+"noopener noreferrer")}}}return t}var x=["name","id"],ie={img:1,form:1,embed:1,iframe:1,object:1,input:1,button:1,select:1,textarea:1,fieldset:1,output:1},ne={input:1,button:1,select:1,textarea:1},_=null,G=null;function ae(t,e,r,a){return!r||e==="id"&&!ie[t]?!1:e==="name"&&ne[t]&&!a("form")?!0:(_||(_=document.implementation.createHTMLDocument(""),G=_.createElement("form")),r in _||r in G)}function oe(t){for(var e=Object.getPrototypeOf(t);e;e=Object.getPrototypeOf(e)){var r=Object.getOwnPropertyDescriptor(e,"body");if(r&&r.get)return r.get.call(t)}return t.body}function F(t){for(var e=t.parentNode;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t)}function l(t,e){t.indexOf(e)<0&&t.push(e)}function se(t){for(var e=0;e<t.attributes.length;e++)if(/^data-(.*-)?(src|srcset|original)$/i.test(t.attributes[e].name))return!0;return!1}function C(t){var e=String(t).replace(/<!--\s*(Start|End)Fragment\s*-->/gi,"");h.calls++;for(var r=0;r<3;r++){var a=new DOMParser().parseFromString(__RTE_TT("<body>"+e+"</body>"),"text/html"),s=oe(a);z(s,h);var i=s.innerHTML;if(h.lastPasses=r+1,i===e)break;e=i}return e}function ue(){if(!M){for(var t=["getHTMLCode","getHTMLContent"],e=!1,r=0;r<t.length;r++)(function(a){var s=d[a];if(!(typeof s!="function"||s.__rteSanitized)){var i=function(){var o=s.apply(d,arguments);return typeof o!="string"?o:C(o)};i.__rteSanitized=!0,d[a]=i,e=!0}})(t[r]);e&&(M=!0)}}function fe(){for(var t=["setHTMLCode","setHTMLContent"],e=0;e<t.length;e++)(function(r){var a=d[r];if(!(typeof a!="function"||a.__rteSanitizedIn)){var s=function(i){var o=[].slice.call(arguments);return typeof i=="string"&&(o[0]=C(i)),a.apply(d,o)};s.__rteSanitizedIn=!0,d[r]=s}})(t[e])}function le(t){return/\son[a-z]+\s*=/i.test(t)||/<\s*(script|iframe|object|embed|base)\b/i.test(t)||/srcdoc\s*=/i.test(t)||/(javascript|vbscript)\s*:/i.test(t)||/data:\s*text\/html/i.test(t)}function $(t){var e=String(t??"");return e.indexOf("-->")!==-1||e.indexOf("--!>")!==-1||e.charAt(0)===">"||e.charAt(0)==="-"&&e.charAt(1)===">"}var B=/^(script|iframe|object|embed|base|meta|link|form)$/;function O(t){if(!t.attributes)return!1;for(var e=0;e<t.attributes.length;e++){var r=t.attributes[e].name.toLowerCase();if(r.indexOf("on")===0||r==="srcdoc"||(r==="href"||r==="src"||r==="data"||r==="action"||r==="xlink:href")&&/(javascript|vbscript)\s*:|data:\s*text\/html/i.test(t.attributes[e].value||""))return!0}return!1}function ce(t){if(B.test(t.localName||"")||O(t))return!0;for(var e=t.getElementsByTagName?t.getElementsByTagName("*"):[],r=0;r<e.length;r++)if(B.test(e[r].localName||"")||O(e[r]))return!0;return!1}function de(){if(g.sanitizerGuardLiveDom!==!1){var t=null;try{t=d.getEditable()}catch{return}if(!(!t||t.__rteLiveGuard)){t.__rteLiveGuard=!0;var e=new MutationObserver(function(r){for(var a=!1,s=0;s<r.length&&!a;s++){var i=r[s];if(i.type==="attributes"){var o=(i.attributeName||"").toLowerCase();(o.indexOf("on")===0||o==="srcdoc"||O(i.target))&&(a=!0);continue}for(var v=0;v<i.addedNodes.length;v++){var c=i.addedNodes[v];if(c.nodeType===8){if($(c.data)){a=!0;break}continue}if(c.nodeType===1&&ce(c)){a=!0;break}}}if(a)try{z(t,h)}catch{}});e.observe(t,{childList:!0,subtree:!0,attributes:!0}),Z.push(e)}}}function ve(){var t=null;try{t=d.getEditable()}catch{return}if(!t||t.__rteSanitizePaste)return;t.__rteSanitizePaste=!0,t.addEventListener("paste",function(r){var a=r.clipboardData||window.clipboardData;if(a){var s="";try{s=a.getData("text/html")||""}catch{return}if(!(!s||!le(s))){r.preventDefault(),r.stopImmediatePropagation();var i=C(s);try{d.insertHTML(i)}catch{try{d.insertText(a.getData("text/plain")||"")}catch{}}}}},!0);function e(){var r=function(){try{z(t,h)}catch{}};setTimeout(r,0),setTimeout(r,250)}t.addEventListener("paste",e,!1),t.addEventListener("drop",e,!0)}}
@@ -659,7 +659,7 @@ function RTE_Plugin_SlashCommand() {
659
659
 
660
660
  function renderItems() {
661
661
  if (!popupEl) return;
662
- popupEl.innerHTML = "";
662
+ popupEl.innerHTML = __RTE_TT("");
663
663
 
664
664
  if (!filtered.length) {
665
665
  var empty = popupHost.createElement("div");
@@ -688,7 +688,7 @@ function RTE_Plugin_SlashCommand() {
688
688
 
689
689
  var icon = popupHost.createElement("span");
690
690
  icon.className = "rte-slash-item-icon";
691
- icon.innerHTML = cmd.iconSvg || iconDot();
691
+ icon.innerHTML = __RTE_TT(cmd.iconSvg || iconDot());
692
692
  item.appendChild(icon);
693
693
 
694
694
  var body = popupHost.createElement("span");
@@ -1,2 +1,2 @@
1
- window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_slashcommand=RTE_Plugin_SlashCommand;function RTE_Plugin_SlashCommand(){var T=this,c,e,v=null,s=null,m=null,h=[],g=[],p=0,E=!1,P=!1;T.PluginName="SlashCommand",T.InitConfig=function(o){c=o,c.slashCommandEnabled!==!1&&(c.slashCommandTrigger=c.slashCommandTrigger||"/",c.slashCommandMaxItems=c.slashCommandMaxItems||40,c.slashCommandIncludeAi=c.slashCommandIncludeAi!==!1,c.slashCommands=c.slashCommands||null)},T.InitEditor=function(o){if(e=o,c.slashCommandEnabled!==!1){if(e.slashCommands={register:H,remove:oe,list:function(){return B(),h.slice()},open:function(){z(!0)},close:f,isOpen:function(){return!!s}},h=O(),Array.isArray(c.slashCommands))for(var t=0;t<c.slashCommands.length;t++)H(c.slashCommands[t]);setTimeout(B,0),pe();var n=function(i,a,l){e.bindDocumentEvent?e.bindDocumentEvent(i,a,l):e.getDocument().addEventListener(i,a,l)};n("keydown",ie,!0),n("input",ae,!0),n("compositionstart",function(){E=!0}),n("compositionend",function(){E=!1}),n("mousedown",function(){f()},!0),n("blur",function(){setTimeout(f,150)},!0),window.addEventListener("scroll",V,!0),window.addEventListener("resize",V,!0)}};function H(o){if(!(!o||!o.id)){var t=N(o.id);t>=0?h[t]=b(o):h.push(b(o))}}var F={};function B(){if(e){for(var o=[],t=0;t<h.length;t++)h[t]._default||o.push(h[t]);for(var n=O(),i=[],a=0;a<n.length;a++){var l=n[a].id;if(!F[l]){for(var d=!1,r=0;r<o.length;r++)if(o[r].id===l){d=!0;break}d||i.push(n[a])}}h=i.concat(o)}}function oe(o){F[o]=!0;var t=N(o);t>=0&&h.splice(t,1)}function N(o){for(var t=0;t<h.length;t++)if(h[t].id===o)return t;return-1}function I(o,t){try{var n=String(o).toLowerCase().replace(/[^a-z0-9_]/g,"_");if(c&&c["text_"+n]&&e&&typeof e.getLangText=="function")return e.getLangText(n)}catch{}return t}function b(o){var t=o.section||"Blocks";return{id:o.id,section:I("slash_section_"+t,t),title:I("slash_"+o.id,o.title||o.id),description:I("slash_"+o.id+"_desc",o.description||""),keywords:(o.keywords||[]).slice(),icon:o.icon||"",iconSvg:o.iconSvg||"",run:o.run||o.action}}var ne={P:1,DIV:1,H1:1,H2:1,H3:1,H4:1,H5:1,H6:1,BLOCKQUOTE:1,PRE:1,LI:1};function re(){var o=e.getSelection();if(!o||o.rangeCount===0)return null;for(var t=o.getRangeAt(0).startContainer,n=e.getEditable();t&&t!==n;){if(t.nodeType===1&&ne[t.nodeName])return t;t=t.parentNode}return null}function C(o){var t=re();if(o=o.toUpperCase(),t&&!t.textContent.trim()){var n=e.getDocument(),i=n.createElement(o);i.appendChild(n.createElement("br")),t.parentNode.replaceChild(i,t);var a=n.createRange();a.setStart(i,0),a.setEnd(i,0);var l=e.getSelection();l.removeAllRanges(),l.addRange(a);return}e.execCommand("formatblock",o)}function O(){var o=[];function t(r,u,x,w,k,Ge,Qe){var te=b({id:u,section:r,title:x,description:w,keywords:k,iconSvg:Ge,run:Qe});te._default=!0,o.push(te)}if(t("Blocks","heading1","Heading 1","Large section heading",["h1","title"],j("1"),function(){C("H1")}),t("Blocks","heading2","Heading 2","Medium section heading",["h2","subtitle"],j("2"),function(){C("H2")}),t("Blocks","heading3","Heading 3","Small section heading",["h3"],j("3"),function(){C("H3")}),t("Blocks","paragraph","Paragraph","Plain body text",["p","text","body"],fe(),function(){C("P")}),t("Blocks","bulletlist","Bulleted list","Unordered list",["ul","bullets","list"],me(),function(){e.execCommand("insertunorderedlist")}),t("Blocks","numberlist","Numbered list","Ordered list",["ol","numbered"],ge(),function(){e.execCommand("insertorderedlist")}),t("Blocks","quote","Quote","Block quotation",["blockquote"],ve(),function(){e.execCommand("insertblockquote")}),t("Blocks","code","Code block","Monospaced code block",["pre","snippet"],ke(),function(){e.isCommandEnabled&&e.isCommandEnabled("insertcode")?e.execCommand("insertcode"):e.execCommand("formatblock","PRE")}),t("Blocks","divider","Divider","Horizontal rule",["hr","line","separator"],xe(),function(){e.execCommand("inserthorizontalrule")}),(!e.isCommandEnabled||e.isCommandEnabled("insertcallout"))&&t("Blocks","callout","Callout","Highlighted info / warning box",["admonition","info","warning","note","tip"],Te(),function(){e.execCommand("insertcallout")}),(!e.isCommandEnabled||e.isCommandEnabled("insertcolumns"))&&t("Blocks","columns","Columns","Multi-column layout",["layout","grid","column"],Ee(),function(){e.execCommand("insertcolumns")}),(!e.isCommandEnabled||e.isCommandEnabled("inserttoggle"))&&t("Blocks","toggle","Toggle list","Collapsible toggle block",["collapse","details","accordion","expand"],Be(),function(){e.execCommand("inserttoggle")}),(!e.isCommandEnabled||e.isCommandEnabled("insertmath"))&&t("Insert","equation","Equation","Insert a math equation (TeX)",["math","latex","tex","formula","katex"],Ie(),function(){e.execCommand("insertmath")}),(!e.isCommandEnabled||e.isCommandEnabled("inserttodolist"))&&t("Blocks","todolist","To-do list","Checklist with clickable checkboxes",["task","todo","checklist","checkbox","check"],ze(),function(){e.execCommand("inserttodolist")}),(!e.isCommandEnabled||e.isCommandEnabled("insertdiagram"))&&t("Insert","diagram","Diagram","Insert a Mermaid diagram",["mermaid","flowchart","sequence","gantt","graph","uml"],je(),function(){e.execCommand("insertdiagram")}),(!e.isCommandEnabled||e.isCommandEnabled("insertbookmark"))&&t("Insert","bookmark","Bookmark","Insert a link preview card",["link","url","embed","preview","card"],Ae(),function(){e.execCommand("insertbookmark")}),(!e.isCommandEnabled||e.isCommandEnabled("spellcheck"))&&t("Tools","spellcheck","Spell check","Check spelling",["spelling","grammar","proofread","typo"],W(),function(){e.execCommand("spellcheck")}),(!e.isCommandEnabled||e.isCommandEnabled("insertdatechip"))&&t("Insert","datechip","Date chip","Insert an interactive date chip",["date","calendar","chip","today"],G(),function(){e.execCommand("insertdatechip")}),(!e.isCommandEnabled||e.isCommandEnabled("insertchip"))&&t("Insert","chip","Smart chip","Insert a date / person / link chip",["chip","person","mention","link","pill"],G(),function(){e.execCommand("insertchip")}),(!e.isCommandEnabled||e.isCommandEnabled("emailexport"))&&t("Tools","emailexport","Export email HTML","Inline-styled HTML for email",["email","inline","mail","newsletter","html"],Se(),function(){e.execCommand("emailexport")}),typeof e.openFindDialog=="function"&&t("Tools","findreplace","Find & replace","Search the document and replace text",["find","replace","search","query","substitute"],qe(),function(){e.openFindDialog()}),typeof e.showShortcuts=="function"&&t("Tools","shortcuts","Keyboard shortcuts","Show the keyboard shortcut cheat sheet (Ctrl+/)",["keyboard","shortcuts","hotkeys","keys","help","cheat"],_e(),function(){e.showShortcuts()}),typeof e.foldAtCaret=="function"&&(t("Tools","foldsection","Fold section","Collapse the section under the current heading",["fold","collapse","heading","outline","section"],$(),function(){e.foldAtCaret()}),t("Tools","unfoldall","Unfold all","Expand every collapsed heading section",["unfold","expand","headings","collapse"],$(),function(){e.unfoldAll&&e.unfoldAll()})),(!e.isCommandEnabled||e.isCommandEnabled("readaloud"))&&t("Tools","readaloud","Read aloud","Speak the selection or document (text-to-speech)",["tts","speak","speech","voice","accessibility","narrate"],Q(),function(){e.execCommand("readaloud")}),typeof e.sortTableAtCaret=="function"&&(t("Tools","sorttableasc","Sort table by this column","Sort the table rows by the column the caret is in",["sort","table","column","order","ascending"],L(),function(){e.sortTableAtCaret("asc")}),t("Tools","sorttabledesc","Sort table (descending)","Sort the table rows by this column, largest first",["sort","table","column","descending","reverse"],L(),function(){e.sortTableAtCaret("desc")}),t("Tools","tablerownumbers","Number table rows","Add or remove an automatic row-numbering column",["number","rows","table","count","index"],L(),function(){e.execCommand("tablerownumbers")})),typeof e.setTableLayoutMode=="function"&&(t("Insert","layouttable","Layout table","Insert a borderless table for positioning content (role=presentation)",["layout","table","grid","email","columns","presentation"],y(),function(){e.insertLayoutTable(2,2)}),t("Tools","tablelayoutmode","Mark table as layout","This table only positions content \u2014 stop screen readers announcing it as data",["layout","table","presentation","accessibility","screen reader"],y(),function(){e.setTableLayoutMode("layout")}),t("Tools","tabledatamode","Mark table as data","This table states relationships \u2014 restore its header cells",["data","table","header","accessibility"],y(),function(){e.setTableLayoutMode("data",null,{promoteFirstRow:!0})})),typeof e.moveBlockUp=="function"&&(t("Tools","moveblockup","Move block up","Move this paragraph or block above the previous one (Alt+Shift+Up)",["move","block","up","reorder","drag"],X(),function(){e.moveBlockUp()}),t("Tools","moveblockdown","Move block down","Move this paragraph or block below the next one (Alt+Shift+Down)",["move","block","down","reorder","drag"],X(),function(){e.moveBlockDown()})),typeof e.toggleRtlUserInterface=="function"&&t("Tools","rtlui","Mirror editor for RTL","Flip the toolbar, menus and dialogs for right-to-left languages",["rtl","mirror","interface","toolbar","arabic","hebrew"],D(),function(){e.toggleRtlUserInterface()}),typeof e.setTextDirection=="function"&&(t("Tools","rtl","Right-to-left","Set this paragraph to right-to-left (Arabic, Hebrew, Persian)",["rtl","arabic","hebrew","persian","urdu","direction","bidi"],D(),function(){e.setTextDirection("rtl")}),t("Tools","ltr","Left-to-right","Set this paragraph to left-to-right",["ltr","direction","bidi"],De(),function(){e.setTextDirection("ltr")}),t("Tools","autodir","Detect text direction","Set each paragraph's direction from its own content",["direction","detect","auto","rtl","bidi"],D(),function(){e.autoDetectTextDirection()})),typeof e.toggleFormattingMarks=="function"&&t("Tools","formattingmarks","Formatting marks","Show paragraph marks, block outlines and invisible characters",["marks","pilcrow","paragraph","invisible","whitespace","nbsp"],Le(),function(){e.toggleFormattingMarks()}),typeof e.toggleWatermark=="function"&&t("Tools","watermark","Watermark","Draw DRAFT or CONFIDENTIAL behind the content",["watermark","draft","confidential","background","stamp"],Re(),function(){e.toggleWatermark()}),typeof e.toggleLineNumbers=="function"&&t("Tools","linenumbers","Line numbers","Number every line in the margin, as pleadings and transcripts require",["line","numbers","margin","pleading","legal","transcript"],Pe(),function(){e.toggleLineNumbers()}),typeof e.togglePermanentPen=="function"&&t("Tools","permanentpen","Permanent pen","Keep typing in a fixed annotation format until switched off",["pen","marker","annotate","highlight","review"],Y(),function(){e.togglePermanentPen()}),typeof e.checkLinks=="function"&&t("Tools","checklinks","Check links","Find broken anchors, unsafe schemes and unlabelled links",["link","check","broken","audit","url","accessibility"],He(),function(){e.highlightLinkIssues(!0),e.checkLinks()}),typeof e.getMergeFieldDefinitions=="function"){for(var n=e.getMergeFieldDefinitions(),i=0;i<n.length;i++)(function(r){!r||!r.id||t("Insert","mergefield-"+r.id,r.label||r.id,"Insert the "+(r.label||r.id)+" merge field",["merge","field","placeholder","variable","mail merge",r.id],J(),function(){e.insertMergeField(r.id)})})(n[i]);t("Tools","mergepreview","Preview merge fields","Swap merge-field placeholders for sample data",["merge","preview","sample","data","placeholder"],J(),function(){e.toggleMergeFieldPreview()})}if(typeof e.listCrossReferenceTargets=="function"){var a=[];try{a=e.listCrossReferenceTargets()}catch{a=[]}for(var l=0;l<a.length&&l<40;l++)(function(r){if(!(!r||!r.id)){var u=r.number?r.number+" "+r.label:r.label;t("Insert","xref-"+r.id,"Reference: "+u,"Insert a cross-reference to this "+r.type+" that updates itself",["cross","reference","xref","see","refer",r.type,r.number||""],Z(),function(){e.insertCrossReference(r.id,r.number?"label":"text")})}})(a[l])}if(typeof e.insertTableOfContents=="function"&&t("Insert","toc","Table of contents","Insert a contents block that updates itself from your headings",["toc","contents","outline","index","headings"],Fe(),function(){e.insertTableOfContents()}),typeof e.insertFootnote=="function"&&t("Insert","footnote","Footnote","Insert a numbered footnote reference and note",["footnote","note","citation","reference","endnote","cite"],Ne(),function(){e.insertFootnote()}),typeof e.toggleFormatPainter=="function"&&t("Tools","formatpainter","Format painter","Copy formatting here, then select the text to paint it onto",["format","painter","brush","copy","style","clone"],Oe(),function(){e.toggleFormatPainter()}),typeof e.changeCase=="function"&&(t("Tools","caseupper","UPPERCASE","Convert the selection to upper case",["case","upper","caps","capitals"],M(),function(){e.changeCase("upper")}),t("Tools","caselower","lowercase","Convert the selection to lower case",["case","lower","small"],M(),function(){e.changeCase("lower")}),t("Tools","casetitle","Title Case","Capitalise each significant word in the selection",["case","title","headline","capitalise","capitalize"],M(),function(){e.changeCase("title")}),t("Tools","casesentence","Sentence case","Capitalise the first letter of each sentence",["case","sentence","capitalise","capitalize"],M(),function(){e.changeCase("sentence")})),typeof e.requestGhostText=="function"&&t("Tools","aicomplete","AI complete","Suggest an inline AI completion of the current sentence",["ai","complete","autocomplete","ghost","suggest","continue","copilot"],Ke(),function(){e.requestGhostText()}),typeof e.exportToPdf=="function"&&t("Tools","exportpdf","Export to PDF","Real text, not a screenshot \u2014 selectable, searchable and screen-reader friendly",["pdf","export","download","save","print","text","accessible","searchable"],We(),function(){e.exportToPdf()}),typeof e.exportToDocx=="function"&&t("Tools","exportdocx","Export to Word (.docx)","A real OOXML document, built in the browser with no upload",["word","docx","ooxml","export","download","save","office"],ee(),function(){e.exportToDocx()}),typeof e.openImportDialog=="function"&&t("Tools","import-document","Import document","Open a Markdown, HTML, text, or Word file into the editor",["import","open","file","word","docx","markdown","upload"],ee(),function(){e.openImportDialog({})}),typeof e.getReadabilityStats=="function"&&t("Tools","readability-stats","Readability statistics","Flesch reading ease, grade level, and reading time",["readability","flesch","grade","reading","stats","score"],W(),function(){e.execCommand("readability")}),typeof e.insertCrossReference=="function"&&t("Insert","crossreference","Cross-reference","Insert a live reference to a heading, figure, table, or bookmark",["cross","reference","xref","see","figure","heading"],Z(),function(){e.execCommand("insertcrossreference")}),e.restrictedEditing&&t("Tools","restrictedediting","Restricted editing","Lock the document and mark only the regions others may edit",["restrict","lock","protect","editable","region","permission"],Y(),function(){e.execCommand("restrictedediting")}),e.dictation&&t("Tools","dictation","Dictation","Speak and have your words typed into the document",["dictate","speech","voice","microphone","talk"],Q(),function(){e.execCommand("dictation")}),typeof e.copyAsMarkdown=="function"&&(t("Tools","copymarkdown","Copy as Markdown","Copy the whole document to the clipboard as Markdown",["markdown","md","copy","clipboard","export"],R(),function(){e.copyAsMarkdown()}),t("Tools","downloadmarkdown","Download as Markdown","Save the document as a .md file",["markdown","md","download","export","save","file"],R(),function(){e.downloadMarkdown()}),t("Tools","markdownmode","Edit as Markdown","Show the document as Markdown text, and back to the visual view",["markdown","md","source","text","edit","mode"],R(),function(){e.toggleMarkdownMode()})),typeof e.toggleTypewriterMode=="function"&&(t("Tools","typewriter","Typewriter mode","Keep the caret line centred as you type",["typewriter","center","scroll","focus","distraction","zen"],Ue(),function(){e.toggleTypewriterMode()}),t("Tools","focusmode","Focus mode","Dim everything except the current paragraph",["focus","dim","highlight","distraction","zen","concentrate"],Ve(),function(){e.toggleFocusMode()})),t("Insert","table","Table","Insert a table",["grid","rows","columns"],y(),function(){e.execCommand("inserttable")}),t("Insert","image","Image","Upload or embed an image",["picture","photo","img"],K(),function(){e.execCommand("imageupload")}),typeof e.openImageGenerator=="function"&&t("Insert","generate-image","Generate image","Describe an image and insert it (your own image provider)",["picture","generate","ai","draw","image","create"],K(),function(){e.openImageGenerator()}),t("Insert","link","Link","Insert a hyperlink",["url","anchor"],we(),function(){e.execCommand("insertlink")}),t("Insert","emoji","Emoji","Insert an emoji",["smiley","icon"],be(),function(){e.execCommand("insertemoji")}),t("Insert","template","Template","Insert from template gallery",["snippet"],Ce(),function(){e.execCommand("inserttemplate")}),t("Insert","date","Today's date","Insert the current date",["time","now"],ye(),function(){e.execCommand("insertdate")}),c.slashCommandIncludeAi&&Array.isArray(c.aiToolkitActions))for(var d=0;d<c.aiToolkitActions.length;d++)(function(r){o.push(b({id:"ai-"+r.id,section:"AI",title:r.title||r.id,description:r.description||"",keywords:["ai",r.id],iconSvg:c["svgCode_aiassist_"+(r.icon||r.id)]||c.svgCode_aiassist||"",run:function(){var u=e.aiToolkit;if(u){if(r.id==="chat-panel"&&typeof u.openChatPanel=="function"){u.openChatPanel();return}if(r.id==="review-panel"&&typeof u.openReviewPanel=="function"){u.openReviewPanel();return}if(r.id==="open-dialog"&&typeof u.openDialog=="function"){u.openDialog();return}if(typeof u.runQuickAction=="function"){u.runQuickAction(r.id);return}typeof u.resolveAction=="function"&&u.resolveAction(r.id)}}}))})(c.aiToolkitActions[d]);return o}function ie(o){if(!E){if(s)switch(o.key){case"ArrowDown":o.preventDefault(),o.stopPropagation(),U(1);return;case"ArrowUp":o.preventDefault(),o.stopPropagation(),U(-1);return;case"Enter":case"Tab":if(g.length){o.preventDefault(),o.stopPropagation(),A();return}f();return;case"Escape":case"Esc":o.preventDefault(),o.stopPropagation(),f();return}if(o.key===c.slashCommandTrigger&&!o.ctrlKey&&!o.metaKey&&!o.altKey){if(!se())return;P=!1,setTimeout(function(){P||z(!1)},0)}}}function ae(){s&&le()}function se(){var o=e.getSelection();if(!o||o.rangeCount===0||!o.isCollapsed)return!1;for(var t=o.getRangeAt(0),n=t.startContainer,i=t.startOffset,a=e.getEditable(),l=n.nodeType===1?n:n.parentNode;l&&l!==a;){var d=l.nodeName;if(d==="CODE"||d==="PRE")return!1;l=l.parentNode}if(n.nodeType===3){if(i===0)return!0;var r=n.nodeValue.charAt(i-1);return/\s/.test(r)}return!0}function z(o){B(),f();var t=e.getSelection();if(!(!t||t.rangeCount===0)){var n=t.getRangeAt(0).cloneRange();m={range:n,startNode:n.startContainer,startOffset:n.startOffset,triggerCharCount:o?0:1,query:""},ce(),S(),_("")}}function f(){s&&s.parentNode&&s.parentNode.removeChild(s),s=null,m=null,g=[],p=0}function le(){if(m){var o=e.getSelection();if(!o||o.rangeCount===0||!o.isCollapsed){f();return}var t=o.getRangeAt(0),n=t.startContainer;if(n!==m.startNode){f();return}var i=t.startOffset;if(i<m.startOffset){f();return}var a=(n.nodeType===3?n.nodeValue:"")||"",l=a.substring(m.startOffset,i);if(/\s/.test(l)){f();return}m.query=l,_(l),S()}}function _(o){var t=(o||"").toLowerCase();g=h.filter(function(n){if(!t||n.title.toLowerCase().indexOf(t)!==-1||n.description&&n.description.toLowerCase().indexOf(t)!==-1)return!0;for(var i=0;i<n.keywords.length;i++)if(String(n.keywords[i]).toLowerCase().indexOf(t)!==-1)return!0;return!1}).slice(0,c.slashCommandMaxItems),p=0,de()}function ce(){v=e.iframe.ownerDocument,s=v.createElement("div"),s.className="rte-slash-popup";try{var o=e.container||e.getEditable&&e.getEditable().closest&&e.getEditable().closest(".richtexteditor");o&&o.classList&&o.classList.contains("rte-dark")&&(s.className+=" rte-slash-popup-dark")}catch{}s.setAttribute("role","listbox"),s.setAttribute("aria-label",c&&c.text_slash_aria||"Slash commands"),v.body.appendChild(s)}function de(){if(s){if(s.innerHTML="",!g.length){var o=v.createElement("div");o.className="rte-slash-empty",o.textContent=c&&c.text_slash_none||"No matching commands",s.appendChild(o);return}for(var t="",n=0;n<g.length;n++)(function(i,a){if(i.section!==t){var l=v.createElement("div");l.className="rte-slash-section",l.textContent=i.section,s.appendChild(l),t=i.section}var d=v.createElement("button");d.type="button",d.className="rte-slash-item"+(a===p?" rte-slash-item-active":""),d.setAttribute("role","option"),d.setAttribute("aria-selected",a===p?"true":"false"),d.setAttribute("data-index",a);var r=v.createElement("span");r.className="rte-slash-item-icon",r.innerHTML=i.iconSvg||Me(),d.appendChild(r);var u=v.createElement("span");u.className="rte-slash-item-body";var x=v.createElement("span");if(x.className="rte-slash-item-title",x.textContent=i.title,u.appendChild(x),i.description){var w=v.createElement("span");w.className="rte-slash-item-desc",w.textContent=i.description,u.appendChild(w)}d.appendChild(u),d.addEventListener("mousedown",function(k){k.preventDefault(),k.stopPropagation(),p=a,A()}),d.addEventListener("click",function(k){s&&(k.preventDefault(),k.stopPropagation(),p=a,A())}),d.addEventListener("mouseenter",function(){p!==a&&(p=a,q())}),s.appendChild(d)})(g[n],n)}}function q(){if(s){for(var o=s.querySelectorAll(".rte-slash-item"),t=0;t<o.length;t++){var n=+o[t].getAttribute("data-index"),i=n===p;o[t].classList.toggle("rte-slash-item-active",i),o[t].setAttribute("aria-selected",i?"true":"false")}ue()}}function ue(){if(s){var o=s.querySelector(".rte-slash-item-active");if(o){var t=o.offsetTop,n=t+o.offsetHeight;t<s.scrollTop?s.scrollTop=t:n>s.scrollTop+s.clientHeight&&(s.scrollTop=n-s.clientHeight)}}}function U(o){g.length&&(p=(p+o+g.length)%g.length,q())}function A(){if(!g.length){f();return}var o=g[p],t=m;if(f(),!(!o||!t)){he(t);var n=e.getDocument();n.activeElement!==e.getEditable()&&!n.hasFocus()&&e.focus();try{o.run(e)}catch(i){console.warn("Slash command failed:",i)}}}function he(o){var t=o.startNode;if(t){var n=o.startOffset-(o.triggerCharCount||0);n<0&&(n=0);var i=e.getSelection();if(!(!i||i.rangeCount===0)){var a=i.getRangeAt(0),l,d;t.nodeType===3&&a.startContainer===t?(l=t,d=a.startOffset):(l=a.startContainer,d=a.startOffset);var r=e.getDocument().createRange();r.setStart(t,n),r.setEnd(l,d);try{r.deleteContents()}catch{return}i.removeAllRanges(),i.addRange(r)}}}function S(){if(!(!s||!m)){var o=e.iframe,t=o.getBoundingClientRect(),n=m.range.getClientRects(),i=n&&n.length?n[n.length-1]:null;i||(i=m.range.getBoundingClientRect());var a=o.offsetWidth&&t.width>0?t.width/o.offsetWidth:1,l=t.left+(i.left||0)*a+window.pageXOffset,d=t.top+(i.bottom||i.top||0)*a+window.pageYOffset+4;s.style.position="absolute",s.style.left=l+"px",s.style.top=d+"px";var r=window.innerHeight||document.documentElement.clientHeight,u=s.getBoundingClientRect();u.bottom>r-8&&t.top+(i.top||0)*a>u.height+16&&(s.style.top=t.top+(i.top||0)*a+window.pageYOffset-u.height-4+"px")}}function V(){s&&S()}function pe(){var o=e&&e.iframe&&e.iframe.ownerDocument||document;if(!o.querySelector("style[data-rte-slashcommand]")){var t=o.createElement("style");t.setAttribute("data-rte-slashcommand","1"),t.textContent=["/* 2026-07-03 slash command polish */",".rte-slash-popup{position:absolute;z-index:2147483000;min-width:280px;max-width:min(390px,calc(100vw - 24px));max-height:min(360px,64vh);overflow-y:auto;overscroll-behavior:contain;padding:6px;background:linear-gradient(180deg,rgba(255,255,255,.98),rgba(248,251,255,.96));background-clip:padding-box;border:1px solid rgba(148,163,184,.22);box-shadow:0 16px 36px rgba(29,78,216,.14),0 2px 8px rgba(15,23,42,.08);border-radius:8px;font-family:Aptos,'Segoe UI',sans-serif;font-size:13px;color:#172033;scrollbar-width:thin}",".rte-slash-section{position:sticky;top:0;z-index:1;margin:4px 0 2px;padding:6px 8px 4px;background:linear-gradient(180deg,rgba(248,251,255,.98),rgba(248,251,255,.86));color:#52657e;font-size:10px;font-weight:850;letter-spacing:.08em;text-transform:uppercase}",".rte-slash-item{display:grid;grid-template-columns:28px minmax(0,1fr);align-items:center;gap:8px;width:100%;min-height:40px;padding:6px 8px;border:0;background:transparent;text-align:left;cursor:pointer;color:inherit;font:inherit;border-radius:8px}",".rte-slash-item:hover,.rte-slash-item-active{background:#eef4ff;color:#1559d6}",".rte-slash-item:focus-visible{outline:2px solid rgba(37,99,235,.22);outline-offset:2px}",".rte-slash-item-icon{flex:0 0 28px;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;color:#315277;background:#ffffff;border-radius:8px;box-shadow:inset 0 0 0 1px rgba(148,163,184,.18)}",".rte-slash-item-active .rte-slash-item-icon{color:#1559d6;background:#ffffff}",".rte-slash-item-icon svg{display:block;width:16px;height:16px;pointer-events:none}",".rte-slash-item-body{display:flex;flex-direction:column;min-width:0;flex:1}",".rte-slash-item-title{font-weight:780;font-size:13px;line-height:1.24;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}",".rte-slash-item-desc{font-size:11px;color:#64748b;line-height:1.24;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}",".rte-slash-item-active .rte-slash-item-desc{color:#315277}",".rte-slash-empty{padding:16px;color:#52657e;font-size:12px;font-weight:700;text-align:center}",".rte-slash-popup-dark{background:linear-gradient(180deg,#1e293b,#0f172a);border-color:#334155;color:#e2e8f0;box-shadow:0 20px 46px rgba(0,0,0,.5),0 2px 8px rgba(0,0,0,.4)}",".rte-slash-popup-dark .rte-slash-section{background:linear-gradient(180deg,rgba(30,41,59,.98),rgba(30,41,59,.86));color:#94a3b8}",".rte-slash-popup-dark .rte-slash-item:hover,.rte-slash-popup-dark .rte-slash-item-active{background:#1d4ed8;color:#fff}",".rte-slash-popup-dark .rte-slash-item-icon{color:#cbd5e1;background:#0f172a;box-shadow:inset 0 0 0 1px rgba(148,163,184,.25)}",".rte-slash-popup-dark .rte-slash-item-active .rte-slash-item-icon{color:#fff;background:#1e3a8a}",".rte-slash-popup-dark .rte-slash-item-desc{color:#94a3b8}",".rte-slash-popup-dark .rte-slash-item-active .rte-slash-item-desc{color:#dbeafe}",".rte-slash-popup-dark .rte-slash-empty{color:#94a3b8}"].join(`
2
- `),o.head.appendChild(t),e&&typeof e.ensureStyleSheetLive=="function"&&e.ensureStyleSheetLive(o,t,"rte-slashcommand-style",t.textContent)}}function j(o){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 4v16"/><path d="M14 4v16"/><path d="M6 12h8"/><text x="16" y="18" font-size="9" font-weight="700" fill="currentColor" stroke="none" font-family="-apple-system,Segoe UI,sans-serif">'+o+"</text></svg>"}function fe(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M13 4h5"/><path d="M13 4v16"/><path d="M17 4v16"/><path d="M13 4a4 4 0 000 8h0"/></svg>'}function me(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="5" cy="7" r="1"/><circle cx="5" cy="12" r="1"/><circle cx="5" cy="17" r="1"/><path d="M9 7h11"/><path d="M9 12h11"/><path d="M9 17h11"/></svg>'}function ge(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 6h1v3"/><path d="M4 9h2"/><path d="M4 14h2a1 1 0 010 2H4v1h2"/><path d="M9 7h11"/><path d="M9 12h11"/><path d="M9 17h11"/></svg>'}function ve(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M7 8c-2 0-3 1.5-3 4s1 4 3 4V8z"/><path d="M16 8c-2 0-3 1.5-3 4s1 4 3 4V8z"/></svg>'}function ke(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 8l-4 4 4 4"/><path d="M15 8l4 4-4 4"/></svg>'}function xe(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 12h16"/><path d="M4 6h10"/><path d="M4 18h10"/></svg>'}function y(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="5" width="16" height="14" rx="1"/><path d="M4 10h16"/><path d="M4 15h16"/><path d="M10 5v14"/><path d="M16 5v14"/></svg>'}function K(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="5" width="18" height="14" rx="2"/><circle cx="9" cy="10" r="1.5"/><path d="M21 16l-5-5-8 8"/></svg>'}function we(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 14a4 4 0 005.7 0l3-3a4 4 0 10-5.7-5.7L11 7"/><path d="M14 10a4 4 0 00-5.7 0l-3 3a4 4 0 105.7 5.7L13 17"/></svg>'}function be(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M8 14c1 1.5 2.5 2 4 2s3-.5 4-2"/><circle cx="9" cy="10" r=".8"/><circle cx="15" cy="10" r=".8"/></svg>'}function Ce(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="4" width="16" height="16" rx="2"/><path d="M4 9h16"/><path d="M9 9v11"/></svg>'}function ye(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="6" width="16" height="14" rx="1.5"/><path d="M4 10h16"/><path d="M9 3v4"/><path d="M15 3v4"/></svg>'}function Me(){return'<svg viewBox="0 0 24 24" fill="currentColor"><circle cx="12" cy="12" r="3"/></svg>'}function Te(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="5" width="18" height="14" rx="2"/><path d="M12 9v4"/><path d="M12 16h.01"/></svg>'}function Ee(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="7" height="16" rx="1"/><rect x="14" y="4" width="7" height="16" rx="1"/></svg>'}function Be(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 6l6 6-6 6"/></svg>'}function Ie(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 5h9l-5 14"/><path d="M14 11h6"/><path d="M14 16h6"/></svg>'}function Ae(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="5" width="18" height="14" rx="2"/><path d="M3 10h18"/><circle cx="7" cy="7.5" r=".6" fill="currentColor"/></svg>'}function W(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 17l4-10 4 10"/><path d="M5.5 13.5h5"/><path d="M14 14a2.5 2.5 0 105 0v-3"/><path d="M14 20l2 2 4-4"/></svg>'}function G(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="7" width="18" height="10" rx="5"/><circle cx="8" cy="12" r="1.6"/><path d="M12 12h6"/></svg>'}function Se(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="5" width="18" height="14" rx="2"/><path d="M4 7l8 6 8-6"/></svg>'}function je(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="6" height="5" rx="1"/><rect x="15" y="3" width="6" height="5" rx="1"/><rect x="9" y="16" width="6" height="5" rx="1"/><path d="M6 8v3h12V8M12 11v5"/></svg>'}function Q(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 9v6h4l5 4V5L8 9H4z"/><path d="M16 8.5a4 4 0 010 7"/><path d="M19 6a7 7 0 010 12"/></svg>'}function X(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3v18"/><path d="M8 7l4-4 4 4"/><path d="M8 17l4 4 4-4"/></svg>'}function D(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6H10a3 3 0 000 6h3"/><path d="M13 6v12"/><path d="M17 6v12"/><path d="M7 18l-3-3 3-3"/></svg>'}function De(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 6H7a3 3 0 000 6h3"/><path d="M11 6v12"/><path d="M7 6v12"/><path d="M17 12l3 3-3 3"/></svg>'}function Le(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M13 4v16"/><path d="M17 4v16"/><path d="M13 4H9a4 4 0 000 8h4"/></svg>'}function Re(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="16" rx="2"/><path d="M7 15l4-5 3 3 3-4"/></svg>'}function Pe(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 6h1v4"/><path d="M4 14h2l-2 3h2"/><path d="M10 7h10"/><path d="M10 12h10"/><path d="M10 17h10"/></svg>'}function L(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M7 4v16"/><path d="M4 8l3-4 3 4"/><path d="M14 6h6"/><path d="M14 12h5"/><path d="M14 18h3"/></svg>'}function Y(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 3l6 6L9 21H3v-6z"/><path d="M13 5l6 6"/></svg>'}function He(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 13a4 4 0 005.7 0l2-2a4 4 0 10-5.7-5.7l-1 1"/><path d="M13 11a4 4 0 00-5.7 0l-2 2a4 4 0 105.7 5.7l1-1"/><path d="M16 18l2 2 4-4"/></svg>'}function J(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 4H7a2 2 0 00-2 2v3a2 2 0 01-2 2 2 2 0 012 2v3a2 2 0 002 2h2"/><path d="M15 4h2a2 2 0 012 2v3a2 2 0 002 2 2 2 0 00-2 2v3a2 2 0 01-2 2h-2"/></svg>'}function Z(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 7h8"/><path d="M4 12h5"/><path d="M4 17h8"/><path d="M14 12h6"/><path d="M17 9l3 3-3 3"/></svg>'}function Fe(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 6h7"/><path d="M4 11h9"/><path d="M4 16h5"/><path d="M17 6h3"/><path d="M17 11h3"/><path d="M17 16h3"/></svg>'}function Ne(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 6h9"/><path d="M4 11h9"/><path d="M4 18h16"/><path d="M17 4v6"/><path d="M20 7h-6"/></svg>'}function Oe(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 3h11a2 2 0 012 2v4a2 2 0 01-2 2H6z"/><path d="M12 11v3"/><path d="M10 14h4v5a2 2 0 01-4 0z"/></svg>'}function M(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 18L8 6l5 12"/><path d="M4.6 14.5h6.8"/><path d="M21 11.5a3 3 0 00-6 0"/><path d="M21 11.5V18"/><path d="M21 15.5a3 3 0 11-6 0 3 3 0 016 0z"/></svg>'}function ze(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="7" height="7" rx="1.5"/><path d="M4.5 7.5 6 9l2.5-3"/><line x1="13" y1="6" x2="21" y2="6"/><line x1="13" y1="13" x2="21" y2="13"/><line x1="3" y1="17" x2="21" y2="17"/><line x1="3" y1="20.5" x2="14" y2="20.5"/></svg>'}function $(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 6l3 3 3-3"/><path d="M9 18l3-3 3 3"/><line x1="4" y1="12" x2="20" y2="12"/></svg>'}function _e(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="6" width="20" height="12" rx="2"/><path d="M6 10h.01M10 10h.01M14 10h.01M18 10h.01M6 14h.01M18 14h.01M9 14h6"/></svg>'}function qe(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="10.5" cy="10.5" r="6.5"/><line x1="15.5" y1="15.5" x2="21" y2="21"/></svg>'}function Ue(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="9" width="18" height="7" rx="1"/><path d="M7 9V5h10v4"/><line x1="7" y1="20" x2="17" y2="20"/></svg>'}function Ve(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M3 12h3M18 12h3M12 3v3M12 18v3"/></svg>'}function R(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="5" width="20" height="14" rx="2"/><path d="M6 15V9l3 3 3-3v6"/><path d="M17 9v6M14.5 12.5L17 15l2.5-2.5"/></svg>'}function Ke(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 21V9a7 7 0 0114 0v12l-3-2-2 2-2-2-2 2-3-2z"/><circle cx="9.5" cy="10" r="1" fill="currentColor"/><circle cx="14.5" cy="10" r="1" fill="currentColor"/></svg>'}function We(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 3H7a2 2 0 00-2 2v14a2 2 0 002 2h10a2 2 0 002-2V8z"/><path d="M14 3v5h5"/><path d="M9 13h6M9 17h4"/></svg>'}function ee(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 3H7a2 2 0 00-2 2v14a2 2 0 002 2h10a2 2 0 002-2V8z"/><path d="M14 3v5h5"/><path d="M8.5 12l1.3 5 2.2-3.6 2.2 3.6 1.3-5"/></svg>'}}
1
+ window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_slashcommand=RTE_Plugin_SlashCommand;function RTE_Plugin_SlashCommand(){var T=this,c,e,v=null,s=null,m=null,h=[],g=[],p=0,E=!1,P=!1;T.PluginName="SlashCommand",T.InitConfig=function(o){c=o,c.slashCommandEnabled!==!1&&(c.slashCommandTrigger=c.slashCommandTrigger||"/",c.slashCommandMaxItems=c.slashCommandMaxItems||40,c.slashCommandIncludeAi=c.slashCommandIncludeAi!==!1,c.slashCommands=c.slashCommands||null)},T.InitEditor=function(o){if(e=o,c.slashCommandEnabled!==!1){if(e.slashCommands={register:H,remove:oe,list:function(){return B(),h.slice()},open:function(){_(!0)},close:f,isOpen:function(){return!!s}},h=O(),Array.isArray(c.slashCommands))for(var t=0;t<c.slashCommands.length;t++)H(c.slashCommands[t]);setTimeout(B,0),pe();var n=function(i,a,l){e.bindDocumentEvent?e.bindDocumentEvent(i,a,l):e.getDocument().addEventListener(i,a,l)};n("keydown",ie,!0),n("input",ae,!0),n("compositionstart",function(){E=!0}),n("compositionend",function(){E=!1}),n("mousedown",function(){f()},!0),n("blur",function(){setTimeout(f,150)},!0),window.addEventListener("scroll",V,!0),window.addEventListener("resize",V,!0)}};function H(o){if(!(!o||!o.id)){var t=N(o.id);t>=0?h[t]=b(o):h.push(b(o))}}var F={};function B(){if(e){for(var o=[],t=0;t<h.length;t++)h[t]._default||o.push(h[t]);for(var n=O(),i=[],a=0;a<n.length;a++){var l=n[a].id;if(!F[l]){for(var d=!1,r=0;r<o.length;r++)if(o[r].id===l){d=!0;break}d||i.push(n[a])}}h=i.concat(o)}}function oe(o){F[o]=!0;var t=N(o);t>=0&&h.splice(t,1)}function N(o){for(var t=0;t<h.length;t++)if(h[t].id===o)return t;return-1}function I(o,t){try{var n=String(o).toLowerCase().replace(/[^a-z0-9_]/g,"_");if(c&&c["text_"+n]&&e&&typeof e.getLangText=="function")return e.getLangText(n)}catch{}return t}function b(o){var t=o.section||"Blocks";return{id:o.id,section:I("slash_section_"+t,t),title:I("slash_"+o.id,o.title||o.id),description:I("slash_"+o.id+"_desc",o.description||""),keywords:(o.keywords||[]).slice(),icon:o.icon||"",iconSvg:o.iconSvg||"",run:o.run||o.action}}var ne={P:1,DIV:1,H1:1,H2:1,H3:1,H4:1,H5:1,H6:1,BLOCKQUOTE:1,PRE:1,LI:1};function re(){var o=e.getSelection();if(!o||o.rangeCount===0)return null;for(var t=o.getRangeAt(0).startContainer,n=e.getEditable();t&&t!==n;){if(t.nodeType===1&&ne[t.nodeName])return t;t=t.parentNode}return null}function C(o){var t=re();if(o=o.toUpperCase(),t&&!t.textContent.trim()){var n=e.getDocument(),i=n.createElement(o);i.appendChild(n.createElement("br")),t.parentNode.replaceChild(i,t);var a=n.createRange();a.setStart(i,0),a.setEnd(i,0);var l=e.getSelection();l.removeAllRanges(),l.addRange(a);return}e.execCommand("formatblock",o)}function O(){var o=[];function t(r,u,x,w,k,Ge,Qe){var te=b({id:u,section:r,title:x,description:w,keywords:k,iconSvg:Ge,run:Qe});te._default=!0,o.push(te)}if(t("Blocks","heading1","Heading 1","Large section heading",["h1","title"],j("1"),function(){C("H1")}),t("Blocks","heading2","Heading 2","Medium section heading",["h2","subtitle"],j("2"),function(){C("H2")}),t("Blocks","heading3","Heading 3","Small section heading",["h3"],j("3"),function(){C("H3")}),t("Blocks","paragraph","Paragraph","Plain body text",["p","text","body"],fe(),function(){C("P")}),t("Blocks","bulletlist","Bulleted list","Unordered list",["ul","bullets","list"],me(),function(){e.execCommand("insertunorderedlist")}),t("Blocks","numberlist","Numbered list","Ordered list",["ol","numbered"],ge(),function(){e.execCommand("insertorderedlist")}),t("Blocks","quote","Quote","Block quotation",["blockquote"],ve(),function(){e.execCommand("insertblockquote")}),t("Blocks","code","Code block","Monospaced code block",["pre","snippet"],ke(),function(){e.isCommandEnabled&&e.isCommandEnabled("insertcode")?e.execCommand("insertcode"):e.execCommand("formatblock","PRE")}),t("Blocks","divider","Divider","Horizontal rule",["hr","line","separator"],xe(),function(){e.execCommand("inserthorizontalrule")}),(!e.isCommandEnabled||e.isCommandEnabled("insertcallout"))&&t("Blocks","callout","Callout","Highlighted info / warning box",["admonition","info","warning","note","tip"],Te(),function(){e.execCommand("insertcallout")}),(!e.isCommandEnabled||e.isCommandEnabled("insertcolumns"))&&t("Blocks","columns","Columns","Multi-column layout",["layout","grid","column"],Ee(),function(){e.execCommand("insertcolumns")}),(!e.isCommandEnabled||e.isCommandEnabled("inserttoggle"))&&t("Blocks","toggle","Toggle list","Collapsible toggle block",["collapse","details","accordion","expand"],Be(),function(){e.execCommand("inserttoggle")}),(!e.isCommandEnabled||e.isCommandEnabled("insertmath"))&&t("Insert","equation","Equation","Insert a math equation (TeX)",["math","latex","tex","formula","katex"],Ie(),function(){e.execCommand("insertmath")}),(!e.isCommandEnabled||e.isCommandEnabled("inserttodolist"))&&t("Blocks","todolist","To-do list","Checklist with clickable checkboxes",["task","todo","checklist","checkbox","check"],_e(),function(){e.execCommand("inserttodolist")}),(!e.isCommandEnabled||e.isCommandEnabled("insertdiagram"))&&t("Insert","diagram","Diagram","Insert a Mermaid diagram",["mermaid","flowchart","sequence","gantt","graph","uml"],je(),function(){e.execCommand("insertdiagram")}),(!e.isCommandEnabled||e.isCommandEnabled("insertbookmark"))&&t("Insert","bookmark","Bookmark","Insert a link preview card",["link","url","embed","preview","card"],Ae(),function(){e.execCommand("insertbookmark")}),(!e.isCommandEnabled||e.isCommandEnabled("spellcheck"))&&t("Tools","spellcheck","Spell check","Check spelling",["spelling","grammar","proofread","typo"],W(),function(){e.execCommand("spellcheck")}),(!e.isCommandEnabled||e.isCommandEnabled("insertdatechip"))&&t("Insert","datechip","Date chip","Insert an interactive date chip",["date","calendar","chip","today"],G(),function(){e.execCommand("insertdatechip")}),(!e.isCommandEnabled||e.isCommandEnabled("insertchip"))&&t("Insert","chip","Smart chip","Insert a date / person / link chip",["chip","person","mention","link","pill"],G(),function(){e.execCommand("insertchip")}),(!e.isCommandEnabled||e.isCommandEnabled("emailexport"))&&t("Tools","emailexport","Export email HTML","Inline-styled HTML for email",["email","inline","mail","newsletter","html"],Se(),function(){e.execCommand("emailexport")}),typeof e.openFindDialog=="function"&&t("Tools","findreplace","Find & replace","Search the document and replace text",["find","replace","search","query","substitute"],qe(),function(){e.openFindDialog()}),typeof e.showShortcuts=="function"&&t("Tools","shortcuts","Keyboard shortcuts","Show the keyboard shortcut cheat sheet (Ctrl+/)",["keyboard","shortcuts","hotkeys","keys","help","cheat"],ze(),function(){e.showShortcuts()}),typeof e.foldAtCaret=="function"&&(t("Tools","foldsection","Fold section","Collapse the section under the current heading",["fold","collapse","heading","outline","section"],$(),function(){e.foldAtCaret()}),t("Tools","unfoldall","Unfold all","Expand every collapsed heading section",["unfold","expand","headings","collapse"],$(),function(){e.unfoldAll&&e.unfoldAll()})),(!e.isCommandEnabled||e.isCommandEnabled("readaloud"))&&t("Tools","readaloud","Read aloud","Speak the selection or document (text-to-speech)",["tts","speak","speech","voice","accessibility","narrate"],Q(),function(){e.execCommand("readaloud")}),typeof e.sortTableAtCaret=="function"&&(t("Tools","sorttableasc","Sort table by this column","Sort the table rows by the column the caret is in",["sort","table","column","order","ascending"],L(),function(){e.sortTableAtCaret("asc")}),t("Tools","sorttabledesc","Sort table (descending)","Sort the table rows by this column, largest first",["sort","table","column","descending","reverse"],L(),function(){e.sortTableAtCaret("desc")}),t("Tools","tablerownumbers","Number table rows","Add or remove an automatic row-numbering column",["number","rows","table","count","index"],L(),function(){e.execCommand("tablerownumbers")})),typeof e.setTableLayoutMode=="function"&&(t("Insert","layouttable","Layout table","Insert a borderless table for positioning content (role=presentation)",["layout","table","grid","email","columns","presentation"],y(),function(){e.insertLayoutTable(2,2)}),t("Tools","tablelayoutmode","Mark table as layout","This table only positions content \u2014 stop screen readers announcing it as data",["layout","table","presentation","accessibility","screen reader"],y(),function(){e.setTableLayoutMode("layout")}),t("Tools","tabledatamode","Mark table as data","This table states relationships \u2014 restore its header cells",["data","table","header","accessibility"],y(),function(){e.setTableLayoutMode("data",null,{promoteFirstRow:!0})})),typeof e.moveBlockUp=="function"&&(t("Tools","moveblockup","Move block up","Move this paragraph or block above the previous one (Alt+Shift+Up)",["move","block","up","reorder","drag"],X(),function(){e.moveBlockUp()}),t("Tools","moveblockdown","Move block down","Move this paragraph or block below the next one (Alt+Shift+Down)",["move","block","down","reorder","drag"],X(),function(){e.moveBlockDown()})),typeof e.toggleRtlUserInterface=="function"&&t("Tools","rtlui","Mirror editor for RTL","Flip the toolbar, menus and dialogs for right-to-left languages",["rtl","mirror","interface","toolbar","arabic","hebrew"],D(),function(){e.toggleRtlUserInterface()}),typeof e.setTextDirection=="function"&&(t("Tools","rtl","Right-to-left","Set this paragraph to right-to-left (Arabic, Hebrew, Persian)",["rtl","arabic","hebrew","persian","urdu","direction","bidi"],D(),function(){e.setTextDirection("rtl")}),t("Tools","ltr","Left-to-right","Set this paragraph to left-to-right",["ltr","direction","bidi"],De(),function(){e.setTextDirection("ltr")}),t("Tools","autodir","Detect text direction","Set each paragraph's direction from its own content",["direction","detect","auto","rtl","bidi"],D(),function(){e.autoDetectTextDirection()})),typeof e.toggleFormattingMarks=="function"&&t("Tools","formattingmarks","Formatting marks","Show paragraph marks, block outlines and invisible characters",["marks","pilcrow","paragraph","invisible","whitespace","nbsp"],Le(),function(){e.toggleFormattingMarks()}),typeof e.toggleWatermark=="function"&&t("Tools","watermark","Watermark","Draw DRAFT or CONFIDENTIAL behind the content",["watermark","draft","confidential","background","stamp"],Re(),function(){e.toggleWatermark()}),typeof e.toggleLineNumbers=="function"&&t("Tools","linenumbers","Line numbers","Number every line in the margin, as pleadings and transcripts require",["line","numbers","margin","pleading","legal","transcript"],Pe(),function(){e.toggleLineNumbers()}),typeof e.togglePermanentPen=="function"&&t("Tools","permanentpen","Permanent pen","Keep typing in a fixed annotation format until switched off",["pen","marker","annotate","highlight","review"],Y(),function(){e.togglePermanentPen()}),typeof e.checkLinks=="function"&&t("Tools","checklinks","Check links","Find broken anchors, unsafe schemes and unlabelled links",["link","check","broken","audit","url","accessibility"],He(),function(){e.highlightLinkIssues(!0),e.checkLinks()}),typeof e.getMergeFieldDefinitions=="function"){for(var n=e.getMergeFieldDefinitions(),i=0;i<n.length;i++)(function(r){!r||!r.id||t("Insert","mergefield-"+r.id,r.label||r.id,"Insert the "+(r.label||r.id)+" merge field",["merge","field","placeholder","variable","mail merge",r.id],J(),function(){e.insertMergeField(r.id)})})(n[i]);t("Tools","mergepreview","Preview merge fields","Swap merge-field placeholders for sample data",["merge","preview","sample","data","placeholder"],J(),function(){e.toggleMergeFieldPreview()})}if(typeof e.listCrossReferenceTargets=="function"){var a=[];try{a=e.listCrossReferenceTargets()}catch{a=[]}for(var l=0;l<a.length&&l<40;l++)(function(r){if(!(!r||!r.id)){var u=r.number?r.number+" "+r.label:r.label;t("Insert","xref-"+r.id,"Reference: "+u,"Insert a cross-reference to this "+r.type+" that updates itself",["cross","reference","xref","see","refer",r.type,r.number||""],Z(),function(){e.insertCrossReference(r.id,r.number?"label":"text")})}})(a[l])}if(typeof e.insertTableOfContents=="function"&&t("Insert","toc","Table of contents","Insert a contents block that updates itself from your headings",["toc","contents","outline","index","headings"],Fe(),function(){e.insertTableOfContents()}),typeof e.insertFootnote=="function"&&t("Insert","footnote","Footnote","Insert a numbered footnote reference and note",["footnote","note","citation","reference","endnote","cite"],Ne(),function(){e.insertFootnote()}),typeof e.toggleFormatPainter=="function"&&t("Tools","formatpainter","Format painter","Copy formatting here, then select the text to paint it onto",["format","painter","brush","copy","style","clone"],Oe(),function(){e.toggleFormatPainter()}),typeof e.changeCase=="function"&&(t("Tools","caseupper","UPPERCASE","Convert the selection to upper case",["case","upper","caps","capitals"],M(),function(){e.changeCase("upper")}),t("Tools","caselower","lowercase","Convert the selection to lower case",["case","lower","small"],M(),function(){e.changeCase("lower")}),t("Tools","casetitle","Title Case","Capitalise each significant word in the selection",["case","title","headline","capitalise","capitalize"],M(),function(){e.changeCase("title")}),t("Tools","casesentence","Sentence case","Capitalise the first letter of each sentence",["case","sentence","capitalise","capitalize"],M(),function(){e.changeCase("sentence")})),typeof e.requestGhostText=="function"&&t("Tools","aicomplete","AI complete","Suggest an inline AI completion of the current sentence",["ai","complete","autocomplete","ghost","suggest","continue","copilot"],Ke(),function(){e.requestGhostText()}),typeof e.exportToPdf=="function"&&t("Tools","exportpdf","Export to PDF","Real text, not a screenshot \u2014 selectable, searchable and screen-reader friendly",["pdf","export","download","save","print","text","accessible","searchable"],We(),function(){e.exportToPdf()}),typeof e.exportToDocx=="function"&&t("Tools","exportdocx","Export to Word (.docx)","A real OOXML document, built in the browser with no upload",["word","docx","ooxml","export","download","save","office"],ee(),function(){e.exportToDocx()}),typeof e.openImportDialog=="function"&&t("Tools","import-document","Import document","Open a Markdown, HTML, text, or Word file into the editor",["import","open","file","word","docx","markdown","upload"],ee(),function(){e.openImportDialog({})}),typeof e.getReadabilityStats=="function"&&t("Tools","readability-stats","Readability statistics","Flesch reading ease, grade level, and reading time",["readability","flesch","grade","reading","stats","score"],W(),function(){e.execCommand("readability")}),typeof e.insertCrossReference=="function"&&t("Insert","crossreference","Cross-reference","Insert a live reference to a heading, figure, table, or bookmark",["cross","reference","xref","see","figure","heading"],Z(),function(){e.execCommand("insertcrossreference")}),e.restrictedEditing&&t("Tools","restrictedediting","Restricted editing","Lock the document and mark only the regions others may edit",["restrict","lock","protect","editable","region","permission"],Y(),function(){e.execCommand("restrictedediting")}),e.dictation&&t("Tools","dictation","Dictation","Speak and have your words typed into the document",["dictate","speech","voice","microphone","talk"],Q(),function(){e.execCommand("dictation")}),typeof e.copyAsMarkdown=="function"&&(t("Tools","copymarkdown","Copy as Markdown","Copy the whole document to the clipboard as Markdown",["markdown","md","copy","clipboard","export"],R(),function(){e.copyAsMarkdown()}),t("Tools","downloadmarkdown","Download as Markdown","Save the document as a .md file",["markdown","md","download","export","save","file"],R(),function(){e.downloadMarkdown()}),t("Tools","markdownmode","Edit as Markdown","Show the document as Markdown text, and back to the visual view",["markdown","md","source","text","edit","mode"],R(),function(){e.toggleMarkdownMode()})),typeof e.toggleTypewriterMode=="function"&&(t("Tools","typewriter","Typewriter mode","Keep the caret line centred as you type",["typewriter","center","scroll","focus","distraction","zen"],Ue(),function(){e.toggleTypewriterMode()}),t("Tools","focusmode","Focus mode","Dim everything except the current paragraph",["focus","dim","highlight","distraction","zen","concentrate"],Ve(),function(){e.toggleFocusMode()})),t("Insert","table","Table","Insert a table",["grid","rows","columns"],y(),function(){e.execCommand("inserttable")}),t("Insert","image","Image","Upload or embed an image",["picture","photo","img"],K(),function(){e.execCommand("imageupload")}),typeof e.openImageGenerator=="function"&&t("Insert","generate-image","Generate image","Describe an image and insert it (your own image provider)",["picture","generate","ai","draw","image","create"],K(),function(){e.openImageGenerator()}),t("Insert","link","Link","Insert a hyperlink",["url","anchor"],we(),function(){e.execCommand("insertlink")}),t("Insert","emoji","Emoji","Insert an emoji",["smiley","icon"],be(),function(){e.execCommand("insertemoji")}),t("Insert","template","Template","Insert from template gallery",["snippet"],Ce(),function(){e.execCommand("inserttemplate")}),t("Insert","date","Today's date","Insert the current date",["time","now"],ye(),function(){e.execCommand("insertdate")}),c.slashCommandIncludeAi&&Array.isArray(c.aiToolkitActions))for(var d=0;d<c.aiToolkitActions.length;d++)(function(r){o.push(b({id:"ai-"+r.id,section:"AI",title:r.title||r.id,description:r.description||"",keywords:["ai",r.id],iconSvg:c["svgCode_aiassist_"+(r.icon||r.id)]||c.svgCode_aiassist||"",run:function(){var u=e.aiToolkit;if(u){if(r.id==="chat-panel"&&typeof u.openChatPanel=="function"){u.openChatPanel();return}if(r.id==="review-panel"&&typeof u.openReviewPanel=="function"){u.openReviewPanel();return}if(r.id==="open-dialog"&&typeof u.openDialog=="function"){u.openDialog();return}if(typeof u.runQuickAction=="function"){u.runQuickAction(r.id);return}typeof u.resolveAction=="function"&&u.resolveAction(r.id)}}}))})(c.aiToolkitActions[d]);return o}function ie(o){if(!E){if(s)switch(o.key){case"ArrowDown":o.preventDefault(),o.stopPropagation(),U(1);return;case"ArrowUp":o.preventDefault(),o.stopPropagation(),U(-1);return;case"Enter":case"Tab":if(g.length){o.preventDefault(),o.stopPropagation(),A();return}f();return;case"Escape":case"Esc":o.preventDefault(),o.stopPropagation(),f();return}if(o.key===c.slashCommandTrigger&&!o.ctrlKey&&!o.metaKey&&!o.altKey){if(!se())return;P=!1,setTimeout(function(){P||_(!1)},0)}}}function ae(){s&&le()}function se(){var o=e.getSelection();if(!o||o.rangeCount===0||!o.isCollapsed)return!1;for(var t=o.getRangeAt(0),n=t.startContainer,i=t.startOffset,a=e.getEditable(),l=n.nodeType===1?n:n.parentNode;l&&l!==a;){var d=l.nodeName;if(d==="CODE"||d==="PRE")return!1;l=l.parentNode}if(n.nodeType===3){if(i===0)return!0;var r=n.nodeValue.charAt(i-1);return/\s/.test(r)}return!0}function _(o){B(),f();var t=e.getSelection();if(!(!t||t.rangeCount===0)){var n=t.getRangeAt(0).cloneRange();m={range:n,startNode:n.startContainer,startOffset:n.startOffset,triggerCharCount:o?0:1,query:""},ce(),S(),z("")}}function f(){s&&s.parentNode&&s.parentNode.removeChild(s),s=null,m=null,g=[],p=0}function le(){if(m){var o=e.getSelection();if(!o||o.rangeCount===0||!o.isCollapsed){f();return}var t=o.getRangeAt(0),n=t.startContainer;if(n!==m.startNode){f();return}var i=t.startOffset;if(i<m.startOffset){f();return}var a=(n.nodeType===3?n.nodeValue:"")||"",l=a.substring(m.startOffset,i);if(/\s/.test(l)){f();return}m.query=l,z(l),S()}}function z(o){var t=(o||"").toLowerCase();g=h.filter(function(n){if(!t||n.title.toLowerCase().indexOf(t)!==-1||n.description&&n.description.toLowerCase().indexOf(t)!==-1)return!0;for(var i=0;i<n.keywords.length;i++)if(String(n.keywords[i]).toLowerCase().indexOf(t)!==-1)return!0;return!1}).slice(0,c.slashCommandMaxItems),p=0,de()}function ce(){v=e.iframe.ownerDocument,s=v.createElement("div"),s.className="rte-slash-popup";try{var o=e.container||e.getEditable&&e.getEditable().closest&&e.getEditable().closest(".richtexteditor");o&&o.classList&&o.classList.contains("rte-dark")&&(s.className+=" rte-slash-popup-dark")}catch{}s.setAttribute("role","listbox"),s.setAttribute("aria-label",c&&c.text_slash_aria||"Slash commands"),v.body.appendChild(s)}function de(){if(s){if(s.innerHTML=__RTE_TT(""),!g.length){var o=v.createElement("div");o.className="rte-slash-empty",o.textContent=c&&c.text_slash_none||"No matching commands",s.appendChild(o);return}for(var t="",n=0;n<g.length;n++)(function(i,a){if(i.section!==t){var l=v.createElement("div");l.className="rte-slash-section",l.textContent=i.section,s.appendChild(l),t=i.section}var d=v.createElement("button");d.type="button",d.className="rte-slash-item"+(a===p?" rte-slash-item-active":""),d.setAttribute("role","option"),d.setAttribute("aria-selected",a===p?"true":"false"),d.setAttribute("data-index",a);var r=v.createElement("span");r.className="rte-slash-item-icon",r.innerHTML=__RTE_TT(i.iconSvg||Me()),d.appendChild(r);var u=v.createElement("span");u.className="rte-slash-item-body";var x=v.createElement("span");if(x.className="rte-slash-item-title",x.textContent=i.title,u.appendChild(x),i.description){var w=v.createElement("span");w.className="rte-slash-item-desc",w.textContent=i.description,u.appendChild(w)}d.appendChild(u),d.addEventListener("mousedown",function(k){k.preventDefault(),k.stopPropagation(),p=a,A()}),d.addEventListener("click",function(k){s&&(k.preventDefault(),k.stopPropagation(),p=a,A())}),d.addEventListener("mouseenter",function(){p!==a&&(p=a,q())}),s.appendChild(d)})(g[n],n)}}function q(){if(s){for(var o=s.querySelectorAll(".rte-slash-item"),t=0;t<o.length;t++){var n=+o[t].getAttribute("data-index"),i=n===p;o[t].classList.toggle("rte-slash-item-active",i),o[t].setAttribute("aria-selected",i?"true":"false")}ue()}}function ue(){if(s){var o=s.querySelector(".rte-slash-item-active");if(o){var t=o.offsetTop,n=t+o.offsetHeight;t<s.scrollTop?s.scrollTop=t:n>s.scrollTop+s.clientHeight&&(s.scrollTop=n-s.clientHeight)}}}function U(o){g.length&&(p=(p+o+g.length)%g.length,q())}function A(){if(!g.length){f();return}var o=g[p],t=m;if(f(),!(!o||!t)){he(t);var n=e.getDocument();n.activeElement!==e.getEditable()&&!n.hasFocus()&&e.focus();try{o.run(e)}catch(i){console.warn("Slash command failed:",i)}}}function he(o){var t=o.startNode;if(t){var n=o.startOffset-(o.triggerCharCount||0);n<0&&(n=0);var i=e.getSelection();if(!(!i||i.rangeCount===0)){var a=i.getRangeAt(0),l,d;t.nodeType===3&&a.startContainer===t?(l=t,d=a.startOffset):(l=a.startContainer,d=a.startOffset);var r=e.getDocument().createRange();r.setStart(t,n),r.setEnd(l,d);try{r.deleteContents()}catch{return}i.removeAllRanges(),i.addRange(r)}}}function S(){if(!(!s||!m)){var o=e.iframe,t=o.getBoundingClientRect(),n=m.range.getClientRects(),i=n&&n.length?n[n.length-1]:null;i||(i=m.range.getBoundingClientRect());var a=o.offsetWidth&&t.width>0?t.width/o.offsetWidth:1,l=t.left+(i.left||0)*a+window.pageXOffset,d=t.top+(i.bottom||i.top||0)*a+window.pageYOffset+4;s.style.position="absolute",s.style.left=l+"px",s.style.top=d+"px";var r=window.innerHeight||document.documentElement.clientHeight,u=s.getBoundingClientRect();u.bottom>r-8&&t.top+(i.top||0)*a>u.height+16&&(s.style.top=t.top+(i.top||0)*a+window.pageYOffset-u.height-4+"px")}}function V(){s&&S()}function pe(){var o=e&&e.iframe&&e.iframe.ownerDocument||document;if(!o.querySelector("style[data-rte-slashcommand]")){var t=o.createElement("style");t.setAttribute("data-rte-slashcommand","1"),t.textContent=["/* 2026-07-03 slash command polish */",".rte-slash-popup{position:absolute;z-index:2147483000;min-width:280px;max-width:min(390px,calc(100vw - 24px));max-height:min(360px,64vh);overflow-y:auto;overscroll-behavior:contain;padding:6px;background:linear-gradient(180deg,rgba(255,255,255,.98),rgba(248,251,255,.96));background-clip:padding-box;border:1px solid rgba(148,163,184,.22);box-shadow:0 16px 36px rgba(29,78,216,.14),0 2px 8px rgba(15,23,42,.08);border-radius:8px;font-family:Aptos,'Segoe UI',sans-serif;font-size:13px;color:#172033;scrollbar-width:thin}",".rte-slash-section{position:sticky;top:0;z-index:1;margin:4px 0 2px;padding:6px 8px 4px;background:linear-gradient(180deg,rgba(248,251,255,.98),rgba(248,251,255,.86));color:#52657e;font-size:10px;font-weight:850;letter-spacing:.08em;text-transform:uppercase}",".rte-slash-item{display:grid;grid-template-columns:28px minmax(0,1fr);align-items:center;gap:8px;width:100%;min-height:40px;padding:6px 8px;border:0;background:transparent;text-align:left;cursor:pointer;color:inherit;font:inherit;border-radius:8px}",".rte-slash-item:hover,.rte-slash-item-active{background:#eef4ff;color:#1559d6}",".rte-slash-item:focus-visible{outline:2px solid rgba(37,99,235,.22);outline-offset:2px}",".rte-slash-item-icon{flex:0 0 28px;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;color:#315277;background:#ffffff;border-radius:8px;box-shadow:inset 0 0 0 1px rgba(148,163,184,.18)}",".rte-slash-item-active .rte-slash-item-icon{color:#1559d6;background:#ffffff}",".rte-slash-item-icon svg{display:block;width:16px;height:16px;pointer-events:none}",".rte-slash-item-body{display:flex;flex-direction:column;min-width:0;flex:1}",".rte-slash-item-title{font-weight:780;font-size:13px;line-height:1.24;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}",".rte-slash-item-desc{font-size:11px;color:#64748b;line-height:1.24;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}",".rte-slash-item-active .rte-slash-item-desc{color:#315277}",".rte-slash-empty{padding:16px;color:#52657e;font-size:12px;font-weight:700;text-align:center}",".rte-slash-popup-dark{background:linear-gradient(180deg,#1e293b,#0f172a);border-color:#334155;color:#e2e8f0;box-shadow:0 20px 46px rgba(0,0,0,.5),0 2px 8px rgba(0,0,0,.4)}",".rte-slash-popup-dark .rte-slash-section{background:linear-gradient(180deg,rgba(30,41,59,.98),rgba(30,41,59,.86));color:#94a3b8}",".rte-slash-popup-dark .rte-slash-item:hover,.rte-slash-popup-dark .rte-slash-item-active{background:#1d4ed8;color:#fff}",".rte-slash-popup-dark .rte-slash-item-icon{color:#cbd5e1;background:#0f172a;box-shadow:inset 0 0 0 1px rgba(148,163,184,.25)}",".rte-slash-popup-dark .rte-slash-item-active .rte-slash-item-icon{color:#fff;background:#1e3a8a}",".rte-slash-popup-dark .rte-slash-item-desc{color:#94a3b8}",".rte-slash-popup-dark .rte-slash-item-active .rte-slash-item-desc{color:#dbeafe}",".rte-slash-popup-dark .rte-slash-empty{color:#94a3b8}"].join(`
2
+ `),o.head.appendChild(t),e&&typeof e.ensureStyleSheetLive=="function"&&e.ensureStyleSheetLive(o,t,"rte-slashcommand-style",t.textContent)}}function j(o){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 4v16"/><path d="M14 4v16"/><path d="M6 12h8"/><text x="16" y="18" font-size="9" font-weight="700" fill="currentColor" stroke="none" font-family="-apple-system,Segoe UI,sans-serif">'+o+"</text></svg>"}function fe(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M13 4h5"/><path d="M13 4v16"/><path d="M17 4v16"/><path d="M13 4a4 4 0 000 8h0"/></svg>'}function me(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="5" cy="7" r="1"/><circle cx="5" cy="12" r="1"/><circle cx="5" cy="17" r="1"/><path d="M9 7h11"/><path d="M9 12h11"/><path d="M9 17h11"/></svg>'}function ge(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 6h1v3"/><path d="M4 9h2"/><path d="M4 14h2a1 1 0 010 2H4v1h2"/><path d="M9 7h11"/><path d="M9 12h11"/><path d="M9 17h11"/></svg>'}function ve(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M7 8c-2 0-3 1.5-3 4s1 4 3 4V8z"/><path d="M16 8c-2 0-3 1.5-3 4s1 4 3 4V8z"/></svg>'}function ke(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 8l-4 4 4 4"/><path d="M15 8l4 4-4 4"/></svg>'}function xe(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 12h16"/><path d="M4 6h10"/><path d="M4 18h10"/></svg>'}function y(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="5" width="16" height="14" rx="1"/><path d="M4 10h16"/><path d="M4 15h16"/><path d="M10 5v14"/><path d="M16 5v14"/></svg>'}function K(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="5" width="18" height="14" rx="2"/><circle cx="9" cy="10" r="1.5"/><path d="M21 16l-5-5-8 8"/></svg>'}function we(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 14a4 4 0 005.7 0l3-3a4 4 0 10-5.7-5.7L11 7"/><path d="M14 10a4 4 0 00-5.7 0l-3 3a4 4 0 105.7 5.7L13 17"/></svg>'}function be(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M8 14c1 1.5 2.5 2 4 2s3-.5 4-2"/><circle cx="9" cy="10" r=".8"/><circle cx="15" cy="10" r=".8"/></svg>'}function Ce(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="4" width="16" height="16" rx="2"/><path d="M4 9h16"/><path d="M9 9v11"/></svg>'}function ye(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="6" width="16" height="14" rx="1.5"/><path d="M4 10h16"/><path d="M9 3v4"/><path d="M15 3v4"/></svg>'}function Me(){return'<svg viewBox="0 0 24 24" fill="currentColor"><circle cx="12" cy="12" r="3"/></svg>'}function Te(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="5" width="18" height="14" rx="2"/><path d="M12 9v4"/><path d="M12 16h.01"/></svg>'}function Ee(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="7" height="16" rx="1"/><rect x="14" y="4" width="7" height="16" rx="1"/></svg>'}function Be(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 6l6 6-6 6"/></svg>'}function Ie(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 5h9l-5 14"/><path d="M14 11h6"/><path d="M14 16h6"/></svg>'}function Ae(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="5" width="18" height="14" rx="2"/><path d="M3 10h18"/><circle cx="7" cy="7.5" r=".6" fill="currentColor"/></svg>'}function W(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 17l4-10 4 10"/><path d="M5.5 13.5h5"/><path d="M14 14a2.5 2.5 0 105 0v-3"/><path d="M14 20l2 2 4-4"/></svg>'}function G(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="7" width="18" height="10" rx="5"/><circle cx="8" cy="12" r="1.6"/><path d="M12 12h6"/></svg>'}function Se(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="5" width="18" height="14" rx="2"/><path d="M4 7l8 6 8-6"/></svg>'}function je(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="6" height="5" rx="1"/><rect x="15" y="3" width="6" height="5" rx="1"/><rect x="9" y="16" width="6" height="5" rx="1"/><path d="M6 8v3h12V8M12 11v5"/></svg>'}function Q(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 9v6h4l5 4V5L8 9H4z"/><path d="M16 8.5a4 4 0 010 7"/><path d="M19 6a7 7 0 010 12"/></svg>'}function X(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3v18"/><path d="M8 7l4-4 4 4"/><path d="M8 17l4 4 4-4"/></svg>'}function D(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6H10a3 3 0 000 6h3"/><path d="M13 6v12"/><path d="M17 6v12"/><path d="M7 18l-3-3 3-3"/></svg>'}function De(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 6H7a3 3 0 000 6h3"/><path d="M11 6v12"/><path d="M7 6v12"/><path d="M17 12l3 3-3 3"/></svg>'}function Le(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M13 4v16"/><path d="M17 4v16"/><path d="M13 4H9a4 4 0 000 8h4"/></svg>'}function Re(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="16" rx="2"/><path d="M7 15l4-5 3 3 3-4"/></svg>'}function Pe(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 6h1v4"/><path d="M4 14h2l-2 3h2"/><path d="M10 7h10"/><path d="M10 12h10"/><path d="M10 17h10"/></svg>'}function L(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M7 4v16"/><path d="M4 8l3-4 3 4"/><path d="M14 6h6"/><path d="M14 12h5"/><path d="M14 18h3"/></svg>'}function Y(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 3l6 6L9 21H3v-6z"/><path d="M13 5l6 6"/></svg>'}function He(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 13a4 4 0 005.7 0l2-2a4 4 0 10-5.7-5.7l-1 1"/><path d="M13 11a4 4 0 00-5.7 0l-2 2a4 4 0 105.7 5.7l1-1"/><path d="M16 18l2 2 4-4"/></svg>'}function J(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 4H7a2 2 0 00-2 2v3a2 2 0 01-2 2 2 2 0 012 2v3a2 2 0 002 2h2"/><path d="M15 4h2a2 2 0 012 2v3a2 2 0 002 2 2 2 0 00-2 2v3a2 2 0 01-2 2h-2"/></svg>'}function Z(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 7h8"/><path d="M4 12h5"/><path d="M4 17h8"/><path d="M14 12h6"/><path d="M17 9l3 3-3 3"/></svg>'}function Fe(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 6h7"/><path d="M4 11h9"/><path d="M4 16h5"/><path d="M17 6h3"/><path d="M17 11h3"/><path d="M17 16h3"/></svg>'}function Ne(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 6h9"/><path d="M4 11h9"/><path d="M4 18h16"/><path d="M17 4v6"/><path d="M20 7h-6"/></svg>'}function Oe(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 3h11a2 2 0 012 2v4a2 2 0 01-2 2H6z"/><path d="M12 11v3"/><path d="M10 14h4v5a2 2 0 01-4 0z"/></svg>'}function M(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 18L8 6l5 12"/><path d="M4.6 14.5h6.8"/><path d="M21 11.5a3 3 0 00-6 0"/><path d="M21 11.5V18"/><path d="M21 15.5a3 3 0 11-6 0 3 3 0 016 0z"/></svg>'}function _e(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="7" height="7" rx="1.5"/><path d="M4.5 7.5 6 9l2.5-3"/><line x1="13" y1="6" x2="21" y2="6"/><line x1="13" y1="13" x2="21" y2="13"/><line x1="3" y1="17" x2="21" y2="17"/><line x1="3" y1="20.5" x2="14" y2="20.5"/></svg>'}function $(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 6l3 3 3-3"/><path d="M9 18l3-3 3 3"/><line x1="4" y1="12" x2="20" y2="12"/></svg>'}function ze(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="6" width="20" height="12" rx="2"/><path d="M6 10h.01M10 10h.01M14 10h.01M18 10h.01M6 14h.01M18 14h.01M9 14h6"/></svg>'}function qe(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="10.5" cy="10.5" r="6.5"/><line x1="15.5" y1="15.5" x2="21" y2="21"/></svg>'}function Ue(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="9" width="18" height="7" rx="1"/><path d="M7 9V5h10v4"/><line x1="7" y1="20" x2="17" y2="20"/></svg>'}function Ve(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M3 12h3M18 12h3M12 3v3M12 18v3"/></svg>'}function R(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="5" width="20" height="14" rx="2"/><path d="M6 15V9l3 3 3-3v6"/><path d="M17 9v6M14.5 12.5L17 15l2.5-2.5"/></svg>'}function Ke(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 21V9a7 7 0 0114 0v12l-3-2-2 2-2-2-2 2-3-2z"/><circle cx="9.5" cy="10" r="1" fill="currentColor"/><circle cx="14.5" cy="10" r="1" fill="currentColor"/></svg>'}function We(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 3H7a2 2 0 00-2 2v14a2 2 0 002 2h10a2 2 0 002-2V8z"/><path d="M14 3v5h5"/><path d="M9 13h6M9 17h4"/></svg>'}function ee(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 3H7a2 2 0 00-2 2v14a2 2 0 002 2h10a2 2 0 002-2V8z"/><path d="M14 3v5h5"/><path d="M8.5 12l1.3 5 2.2-3.6 2.2 3.6 1.3-5"/></svg>'}}
@@ -169,7 +169,7 @@ function RTE_Plugin_SmartChips() {
169
169
  }
170
170
 
171
171
  function renderBody() {
172
- body.innerHTML = "";
172
+ body.innerHTML = __RTE_TT("");
173
173
  if (current === "date") {
174
174
  var note = append(body, "div", "", "rte-chip-field-label");
175
175
  note.textContent = chText("ch_insertdate", "Insert a date chip:");
@@ -194,12 +194,12 @@ function RTE_Plugin_SmartChips() {
194
194
  if (config.chipResolver && typeof config.chipResolver === "function") {
195
195
  input.oninput = function () {
196
196
  var q = input.value.trim();
197
- results.innerHTML = "";
197
+ results.innerHTML = __RTE_TT("");
198
198
  if (!q) return;
199
199
  try {
200
200
  var p = config.chipResolver(q, current);
201
201
  if (p && p.then) p.then(function (list) {
202
- results.innerHTML = "";
202
+ results.innerHTML = __RTE_TT("");
203
203
  (list || []).slice(0, 6).forEach(function (it) {
204
204
  var r = append(results, "button", "", "rte-chip-suggestion");
205
205
  r.type = "button"; r.textContent = it.label || it.value;
@@ -1,2 +1,2 @@
1
- window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_smartchips=RTE_Plugin_SmartChips,RTE_DefaultConfig.chipResolver=RTE_DefaultConfig.chipResolver||null,RTE_DefaultConfig.chipDateFormat=RTE_DefaultConfig.chipDateFormat||null;function RTE_Plugin_SmartChips(){var m=this,b,c;m.PluginName="SmartChips",m.InitConfig=function(e){b=e};function i(e,t){for(var a=b&&b["text_"+e]||t,n=2;n<arguments.length;n++)a=a.split("{"+(n-2)+"}").join(String(arguments[n]));return a}m.InitEditor=function(e){c=e,c.attachEvent("exec_command_insertdatechip",function(t){t.returnValue=!0,m.OpenDateChip()}),c.attachEvent("exec_command_insertchip",function(t){t.returnValue=!0,m.OpenChipMenu()}),L()};function o(e,t,a,n){var s=e.ownerDocument.createElement(t);return a&&(s.style.cssText=a),n&&(s.className=n),e.appendChild(s),s}function k(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}var I=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function x(e){if(b.chipDateFormat&&typeof b.chipDateFormat=="function")try{return String(b.chipDateFormat(e))}catch{}var t=b&&b.text_uilocale;if(t&&!/^en(-|$)/i.test(t)&&typeof Intl<"u"&&Intl.DateTimeFormat)try{return new Intl.DateTimeFormat(t,{year:"numeric",month:"short",day:"numeric"}).format(e)}catch{}return I[e.getMonth()]+" "+e.getDate()+", "+e.getFullYear()}function R(e){function t(a){return(a<10?"0":"")+a}return e.getFullYear()+"-"+t(e.getMonth()+1)+"-"+t(e.getDate())}var A={date:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6"><rect x="2" y="3" width="12" height="11" rx="1.5"/><path d="M2 6.5h12"/><path d="M5 1.5v3"/><path d="M11 1.5v3"/></svg>',person:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6"><circle cx="8" cy="5" r="2.6"/><path d="M3 13.5c0-2.5 2.2-4 5-4s5 1.5 5 4"/></svg>',link:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6"><path d="M6.5 9.5a3 3 0 004.2 0l2-2a3 3 0 10-4.2-4.2L7.4 4.3"/><path d="M9.5 6.5a3 3 0 00-4.2 0l-2 2a3 3 0 104.2 4.2l1-1"/></svg>'};function S(e,t,a,n){var s=A[e]||"",p='class="rte-chip rte-chip-'+k(e)+'" data-rte-chip="'+k(e)+'" data-rte-chip-value="'+k(a||t)+'" contenteditable="false"',h='<span class="rte-chip-icon">'+s+'</span><span class="rte-chip-label">'+k(t)+"</span>";if(e==="link"&&n){var v=/^(javascript|data|vbscript):/i.test(n)?"#":n;return"<a "+p+' href="'+k(v)+'" target="_blank" rel="noopener noreferrer">'+h+"</a>"}return"<span "+p+">"+h+"</span>"}function C(e,t,a,n){L(),c.insertHTML(S(e,t,a,n)+"\u200B"),c.focus()}m.OpenDateChip=function(){var e=c.createDialog(c.getLangText&&c.getLangText("insertdatechiptitle")||"Date","rte-dialog-datechip"),t=typeof e.close=="function"?function(){e.close()}:function(){c.closeCurrentPopup()},a=o(e,"div","","rte-chip-dialog rte-chip-date-dialog");o(a,"div","","rte-chip-dialog-copy").textContent=i("ch_datecopy","Choose a quick date or insert a custom date chip.");function n(f,g){var r=o(a,"button","","rte-chip-quick");return r.type="button",r.textContent=f+" \u2014 "+x(g),r.onmouseover=function(){r.style.background="#eef2ff"},r.onmouseout=function(){r.style.background="transparent"},r.textContent="",o(r,"span","","rte-chip-quick-label").textContent=f,o(r,"span","","rte-chip-quick-value").textContent=x(g),r.onmouseover=null,r.onmouseout=null,r.setAttribute("aria-label",i("ch_insertlabel","Insert {0}, {1}",f,x(g))),r.onclick=function(){t(),C("date",x(g),R(g))},r}var s=new Date(c.__chipNow||Date.now());function p(f,g){var r=new Date(f.getTime());return r.setDate(r.getDate()+g),r}n(i("ch_today","Today"),s),n(i("ch_tomorrow","Tomorrow"),p(s,1)),n(i("ch_yesterday","Yesterday"),p(s,-1)),n(i("ch_nextweek","Next week"),p(s,7));var h=o(a,"div","","rte-chip-pick-row"),v=o(h,"input","","rte-chip-input");v.type="date",v.value=R(s),v.setAttribute("aria-label",i("ch_customdate","Custom date"));var _=o(h,"button","","rte-chip-action rte-chip-action-primary");_.type="button",_.textContent=i("insert","Insert"),_.onclick=function(){var f=(v.value||"").split("-");if(f.length===3){var g=new Date(parseInt(f[0],10),parseInt(f[1],10)-1,parseInt(f[2],10));t(),C("date",x(g),v.value)}else t()},setTimeout(function(){v.focus()},0)},m.OpenChipMenu=function(){var e=c.createDialog(c.getLangText&&c.getLangText("insertchiptitle")||"Insert chip","rte-dialog-chip"),t=typeof e.close=="function"?function(){e.close()}:function(){c.closeCurrentPopup()},a=o(e,"div","","rte-chip-dialog rte-chip-menu-dialog");o(a,"div","","rte-chip-dialog-copy").textContent=i("ch_chipcopy","Insert a date, person, or link chip into the document.");var n=o(a,"div","","rte-chip-type-tabs");n.setAttribute("role","tablist"),n.setAttribute("aria-label",i("ch_chiptype","Chip type"));var s=[["date",i("ch_date","Date")],["person",i("ch_person","Person")],["link",i("link","Link")]],p="date",h=o(a,"div","","rte-chip-dialog-body"),v={};s.forEach(function(r){var u=o(n,"button","","rte-chip-type-tab");u.type="button",u.textContent=r[1],u.setAttribute("role","tab"),u.setAttribute("aria-selected",r[0]===p?"true":"false"),v[r[0]]=u,u.onclick=function(){p=r[0],_(),f()}});function _(){s.forEach(function(r){var u=r[0]===p;v[r[0]].classList.toggle("is-selected",u),v[r[0]].setAttribute("aria-selected",u?"true":"false")})}function f(){if(h.innerHTML="",p==="date"){var r=o(h,"div","","rte-chip-field-label");r.textContent=i("ch_insertdate","Insert a date chip:");var u=o(h,"input","","rte-chip-input");u.type="date",u.value=R(new Date(c.__chipNow||Date.now())),u.setAttribute("aria-label",i("ch_datevalue","Date chip value")),g(function(){var l=(u.value||"").split("-");if(l.length===3){var T=new Date(+l[0],+l[1]-1,+l[2]);t(),C("date",x(T),u.value)}})}else{var D=o(h,"div","","rte-chip-field-label");D.textContent=p==="person"?i("ch_name","Name (or search):"):i("ch_url","URL:");var d=o(h,"input","","rte-chip-input");d.type=p==="link"?"url":"text",d.placeholder=p==="person"?i("ch_nameph","Jane Doe"):"https://example.com",d.setAttribute("aria-label",p==="person"?i("ch_personname","Person chip name"):i("ch_linkurl","Link chip URL"));var w=o(h,"div","","rte-chip-results");w.setAttribute("role","listbox"),w.setAttribute("aria-label",i("ch_suggestions","Chip suggestions")),b.chipResolver&&typeof b.chipResolver=="function"&&(d.oninput=function(){var l=d.value.trim();if(w.innerHTML="",!!l)try{var T=b.chipResolver(l,p);T&&T.then&&T.then(function(M){w.innerHTML="",(M||[]).slice(0,6).forEach(function(y){var E=o(w,"button","","rte-chip-suggestion");E.type="button",E.textContent=y.label||y.value,E.setAttribute("role","option"),E.onclick=function(){t(),C(p,y.label||y.value,y.value||y.label,y.href)}})})}catch{}}),g(function(){var l=d.value.trim();if(!l){t();return}if(p==="link"){if(/^(javascript|data|vbscript|file):/i.test(l)){d.style.borderColor="#dc2626",d.placeholder=i("ch_invalidurl","Enter a valid http(s) URL"),d.value="";return}if(!/^https?:\/\//i.test(l))if(/^[a-z0-9.-]+\.[a-z]{2,}([\/?#].*)?$/i.test(l))l="https://"+l;else{d.style.borderColor="#dc2626",d.placeholder=i("ch_invalidurl","Enter a valid http(s) URL"),d.value="";return}t(),C("link",l.replace(/^https?:\/\//i,"").replace(/\/$/,""),l,l)}else t(),C("person",l,l)}),setTimeout(function(){d.focus()},0)}}function g(r){var u=o(h,"div","","rte-chip-dialog-footer"),D=o(u,"button","","rte-chip-action rte-chip-action-primary");D.type="button",D.textContent=i("insert","Insert"),D.onclick=r}_(),f()};function L(){var e=[".rte-chip{display:inline-flex;align-items:center;gap:4px;padding:2px 8px 2px 6px;margin:0 1px;border:1px solid rgba(100,116,139,.16);border-radius:999px;background:linear-gradient(180deg,#f8fbff,#eef4ff);color:#315277;font-size:.92em;line-height:1.45;white-space:nowrap;text-decoration:none;vertical-align:baseline;cursor:default;user-select:none;box-shadow:0 1px 2px rgba(15,23,42,.06)}",".rte-chip-icon{display:inline-flex;align-items:center;opacity:.9}",".rte-chip-date{background:linear-gradient(180deg,#f0fdff,#e6f8fb);color:#0e7490;border-color:rgba(14,116,144,.18)}",".rte-chip-person{background:linear-gradient(180deg,#f6f7ff,#eef2ff);color:#3730a3;border-color:rgba(55,48,163,.18)}",".rte-chip-link{background:linear-gradient(180deg,#f5fff8,#ecfdf4);color:#15803d;border-color:rgba(21,128,61,.18);cursor:pointer}",".rte-chip-link:hover{text-decoration:underline}"].join(`
1
+ window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_smartchips=RTE_Plugin_SmartChips,RTE_DefaultConfig.chipResolver=RTE_DefaultConfig.chipResolver||null,RTE_DefaultConfig.chipDateFormat=RTE_DefaultConfig.chipDateFormat||null;function RTE_Plugin_SmartChips(){var m=this,b,c;m.PluginName="SmartChips",m.InitConfig=function(e){b=e};function i(e,t){for(var a=b&&b["text_"+e]||t,n=2;n<arguments.length;n++)a=a.split("{"+(n-2)+"}").join(String(arguments[n]));return a}m.InitEditor=function(e){c=e,c.attachEvent("exec_command_insertdatechip",function(t){t.returnValue=!0,m.OpenDateChip()}),c.attachEvent("exec_command_insertchip",function(t){t.returnValue=!0,m.OpenChipMenu()}),L()};function o(e,t,a,n){var s=e.ownerDocument.createElement(t);return a&&(s.style.cssText=a),n&&(s.className=n),e.appendChild(s),s}function k(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}var I=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function _(e){if(b.chipDateFormat&&typeof b.chipDateFormat=="function")try{return String(b.chipDateFormat(e))}catch{}var t=b&&b.text_uilocale;if(t&&!/^en(-|$)/i.test(t)&&typeof Intl<"u"&&Intl.DateTimeFormat)try{return new Intl.DateTimeFormat(t,{year:"numeric",month:"short",day:"numeric"}).format(e)}catch{}return I[e.getMonth()]+" "+e.getDate()+", "+e.getFullYear()}function R(e){function t(a){return(a<10?"0":"")+a}return e.getFullYear()+"-"+t(e.getMonth()+1)+"-"+t(e.getDate())}var A={date:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6"><rect x="2" y="3" width="12" height="11" rx="1.5"/><path d="M2 6.5h12"/><path d="M5 1.5v3"/><path d="M11 1.5v3"/></svg>',person:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6"><circle cx="8" cy="5" r="2.6"/><path d="M3 13.5c0-2.5 2.2-4 5-4s5 1.5 5 4"/></svg>',link:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6"><path d="M6.5 9.5a3 3 0 004.2 0l2-2a3 3 0 10-4.2-4.2L7.4 4.3"/><path d="M9.5 6.5a3 3 0 00-4.2 0l-2 2a3 3 0 104.2 4.2l1-1"/></svg>'};function S(e,t,a,n){var s=A[e]||"",p='class="rte-chip rte-chip-'+k(e)+'" data-rte-chip="'+k(e)+'" data-rte-chip-value="'+k(a||t)+'" contenteditable="false"',h='<span class="rte-chip-icon">'+s+'</span><span class="rte-chip-label">'+k(t)+"</span>";if(e==="link"&&n){var v=/^(javascript|data|vbscript):/i.test(n)?"#":n;return"<a "+p+' href="'+k(v)+'" target="_blank" rel="noopener noreferrer">'+h+"</a>"}return"<span "+p+">"+h+"</span>"}function x(e,t,a,n){L(),c.insertHTML(S(e,t,a,n)+"\u200B"),c.focus()}m.OpenDateChip=function(){var e=c.createDialog(c.getLangText&&c.getLangText("insertdatechiptitle")||"Date","rte-dialog-datechip"),t=typeof e.close=="function"?function(){e.close()}:function(){c.closeCurrentPopup()},a=o(e,"div","","rte-chip-dialog rte-chip-date-dialog");o(a,"div","","rte-chip-dialog-copy").textContent=i("ch_datecopy","Choose a quick date or insert a custom date chip.");function n(f,g){var r=o(a,"button","","rte-chip-quick");return r.type="button",r.textContent=f+" \u2014 "+_(g),r.onmouseover=function(){r.style.background="#eef2ff"},r.onmouseout=function(){r.style.background="transparent"},r.textContent="",o(r,"span","","rte-chip-quick-label").textContent=f,o(r,"span","","rte-chip-quick-value").textContent=_(g),r.onmouseover=null,r.onmouseout=null,r.setAttribute("aria-label",i("ch_insertlabel","Insert {0}, {1}",f,_(g))),r.onclick=function(){t(),x("date",_(g),R(g))},r}var s=new Date(c.__chipNow||Date.now());function p(f,g){var r=new Date(f.getTime());return r.setDate(r.getDate()+g),r}n(i("ch_today","Today"),s),n(i("ch_tomorrow","Tomorrow"),p(s,1)),n(i("ch_yesterday","Yesterday"),p(s,-1)),n(i("ch_nextweek","Next week"),p(s,7));var h=o(a,"div","","rte-chip-pick-row"),v=o(h,"input","","rte-chip-input");v.type="date",v.value=R(s),v.setAttribute("aria-label",i("ch_customdate","Custom date"));var C=o(h,"button","","rte-chip-action rte-chip-action-primary");C.type="button",C.textContent=i("insert","Insert"),C.onclick=function(){var f=(v.value||"").split("-");if(f.length===3){var g=new Date(parseInt(f[0],10),parseInt(f[1],10)-1,parseInt(f[2],10));t(),x("date",_(g),v.value)}else t()},setTimeout(function(){v.focus()},0)},m.OpenChipMenu=function(){var e=c.createDialog(c.getLangText&&c.getLangText("insertchiptitle")||"Insert chip","rte-dialog-chip"),t=typeof e.close=="function"?function(){e.close()}:function(){c.closeCurrentPopup()},a=o(e,"div","","rte-chip-dialog rte-chip-menu-dialog");o(a,"div","","rte-chip-dialog-copy").textContent=i("ch_chipcopy","Insert a date, person, or link chip into the document.");var n=o(a,"div","","rte-chip-type-tabs");n.setAttribute("role","tablist"),n.setAttribute("aria-label",i("ch_chiptype","Chip type"));var s=[["date",i("ch_date","Date")],["person",i("ch_person","Person")],["link",i("link","Link")]],p="date",h=o(a,"div","","rte-chip-dialog-body"),v={};s.forEach(function(r){var u=o(n,"button","","rte-chip-type-tab");u.type="button",u.textContent=r[1],u.setAttribute("role","tab"),u.setAttribute("aria-selected",r[0]===p?"true":"false"),v[r[0]]=u,u.onclick=function(){p=r[0],C(),f()}});function C(){s.forEach(function(r){var u=r[0]===p;v[r[0]].classList.toggle("is-selected",u),v[r[0]].setAttribute("aria-selected",u?"true":"false")})}function f(){if(h.innerHTML=__RTE_TT(""),p==="date"){var r=o(h,"div","","rte-chip-field-label");r.textContent=i("ch_insertdate","Insert a date chip:");var u=o(h,"input","","rte-chip-input");u.type="date",u.value=R(new Date(c.__chipNow||Date.now())),u.setAttribute("aria-label",i("ch_datevalue","Date chip value")),g(function(){var l=(u.value||"").split("-");if(l.length===3){var T=new Date(+l[0],+l[1]-1,+l[2]);t(),x("date",_(T),u.value)}})}else{var D=o(h,"div","","rte-chip-field-label");D.textContent=p==="person"?i("ch_name","Name (or search):"):i("ch_url","URL:");var d=o(h,"input","","rte-chip-input");d.type=p==="link"?"url":"text",d.placeholder=p==="person"?i("ch_nameph","Jane Doe"):"https://example.com",d.setAttribute("aria-label",p==="person"?i("ch_personname","Person chip name"):i("ch_linkurl","Link chip URL"));var w=o(h,"div","","rte-chip-results");w.setAttribute("role","listbox"),w.setAttribute("aria-label",i("ch_suggestions","Chip suggestions")),b.chipResolver&&typeof b.chipResolver=="function"&&(d.oninput=function(){var l=d.value.trim();if(w.innerHTML=__RTE_TT(""),!!l)try{var T=b.chipResolver(l,p);T&&T.then&&T.then(function(M){w.innerHTML=__RTE_TT(""),(M||[]).slice(0,6).forEach(function(y){var E=o(w,"button","","rte-chip-suggestion");E.type="button",E.textContent=y.label||y.value,E.setAttribute("role","option"),E.onclick=function(){t(),x(p,y.label||y.value,y.value||y.label,y.href)}})})}catch{}}),g(function(){var l=d.value.trim();if(!l){t();return}if(p==="link"){if(/^(javascript|data|vbscript|file):/i.test(l)){d.style.borderColor="#dc2626",d.placeholder=i("ch_invalidurl","Enter a valid http(s) URL"),d.value="";return}if(!/^https?:\/\//i.test(l))if(/^[a-z0-9.-]+\.[a-z]{2,}([\/?#].*)?$/i.test(l))l="https://"+l;else{d.style.borderColor="#dc2626",d.placeholder=i("ch_invalidurl","Enter a valid http(s) URL"),d.value="";return}t(),x("link",l.replace(/^https?:\/\//i,"").replace(/\/$/,""),l,l)}else t(),x("person",l,l)}),setTimeout(function(){d.focus()},0)}}function g(r){var u=o(h,"div","","rte-chip-dialog-footer"),D=o(u,"button","","rte-chip-action rte-chip-action-primary");D.type="button",D.textContent=i("insert","Insert"),D.onclick=r}C(),f()};function L(){var e=[".rte-chip{display:inline-flex;align-items:center;gap:4px;padding:2px 8px 2px 6px;margin:0 1px;border:1px solid rgba(100,116,139,.16);border-radius:999px;background:linear-gradient(180deg,#f8fbff,#eef4ff);color:#315277;font-size:.92em;line-height:1.45;white-space:nowrap;text-decoration:none;vertical-align:baseline;cursor:default;user-select:none;box-shadow:0 1px 2px rgba(15,23,42,.06)}",".rte-chip-icon{display:inline-flex;align-items:center;opacity:.9}",".rte-chip-date{background:linear-gradient(180deg,#f0fdff,#e6f8fb);color:#0e7490;border-color:rgba(14,116,144,.18)}",".rte-chip-person{background:linear-gradient(180deg,#f6f7ff,#eef2ff);color:#3730a3;border-color:rgba(55,48,163,.18)}",".rte-chip-link{background:linear-gradient(180deg,#f5fff8,#ecfdf4);color:#15803d;border-color:rgba(21,128,61,.18);cursor:pointer}",".rte-chip-link:hover{text-decoration:underline}"].join(`
2
2
  `);try{var t=c.getDocument();if(!t)return;var a=t.head||t.getElementsByTagName&&t.getElementsByTagName("head")[0]||t.documentElement;if(a&&!t.querySelector("style[data-rte-smartchips]")){var n=t.createElement("style");n.setAttribute("data-rte-smartchips","1"),n.textContent=e,a.appendChild(n),c&&typeof c.ensureStyleSheetLive=="function"&&c.ensureStyleSheetLive(t,n,"rte-smartchips-st",n.textContent)}}catch{}}}
@@ -128,7 +128,7 @@ function RTE_Plugin_SpellCheck() {
128
128
  var list = append(wrap, "div", "");
129
129
 
130
130
  function renderIssues(issues) {
131
- list.innerHTML = "";
131
+ list.innerHTML = __RTE_TT("");
132
132
  if (!issues || !issues.length) {
133
133
  status.innerText = (editor.getLangText && editor.getLangText("spellcheckclean")) || "No spelling issues found.";
134
134
  return;
@@ -151,8 +151,8 @@ function RTE_Plugin_SpellCheck() {
151
151
  chip.onclick = function () {
152
152
  if (replaceFirst(iss.word, s)) {
153
153
  row.style.opacity = "0.45";
154
- head.innerHTML = esc(iss.word) + ' &rarr; <span style="color:#16a34a">' + esc(s) + "</span>";
155
- sug.innerHTML = "";
154
+ head.innerHTML = __RTE_TT(esc(iss.word) + ' &rarr; <span style="color:#16a34a">' + esc(s) + "</span>");
155
+ sug.innerHTML = __RTE_TT("");
156
156
  }
157
157
  };
158
158
  });
@@ -1,2 +1,2 @@
1
- window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_spellcheck=RTE_Plugin_SpellCheck,RTE_DefaultConfig.spellCheckResolver=RTE_DefaultConfig.spellCheckResolver||null,typeof RTE_DefaultConfig.spellCheckEnabled>"u"&&(RTE_DefaultConfig.spellCheckEnabled=!0);function RTE_Plugin_SpellCheck(){var d=this,s,e;d.PluginName="SpellCheck",d.InitConfig=function(n){s=n};function u(n,r){for(var t=s&&s["text_"+n]||r,o=2;o<arguments.length;o++)t=t.split("{"+(o-2)+"}").join(String(arguments[o]));return t}d.InitEditor=function(n){e=n;try{var r=e.getEditable&&e.getEditable();r&&r.setAttribute("spellcheck",s.spellCheckEnabled===!1?"false":"true")}catch{}e.attachEvent("exec_command_spellcheck",function(t){t.returnValue=!0,d.RunSpellCheck()}),R()};function c(n,r,t,o){var i=n.ownerDocument.createElement(r);return t&&(i.style.cssText=t),o&&(i.className=o),n.appendChild(i),i}function E(n){return String(n??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function T(n){try{!e.InvokeEventHook||e.InvokeEventHook("customdialog","spellcheck",n)}catch{}try{var r=e.getEditable(),t=e&&e.iframe&&e.iframe.ownerDocument||r.ownerDocument,o=t.createElement("div");o.className="rte-spell-toast",o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),o.textContent=n,t.body.appendChild(o),setTimeout(function(){o.parentNode&&o.parentNode.removeChild(o)},2600)}catch{}}function S(n,r){try{for(var t=e.getEditable(),o=e.getDocument(),i=o.createTreeWalker(t,NodeFilter.SHOW_TEXT,null),l,h=new RegExp("\\b"+n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\b");l=i.nextNode();){var g=l.parentNode;if(!(g&&(g.nodeName==="CODE"||g.nodeName==="PRE"))){var p=l.data.search(h);if(p>=0)return l.data=l.data.substring(0,p)+r+l.data.substring(p+n.length),!0}}}catch{}return!1}d.RunSpellCheck=function(){if(!s.spellCheckResolver||typeof s.spellCheckResolver!="function"){try{var n=e.getEditable();n.setAttribute("spellcheck","true"),n.focus()}catch{}T(e.getLangText&&e.getLangText("spellchecknative")||"Browser spell-check is on \u2014 misspellings are underlined as you type.");return}var r;try{r=e.getEditable().innerText||""}catch{r=""}if(!r.trim()){T(u("sp_nothing","Nothing to check."));return}var t=e.createDialog(e.getLangText&&e.getLangText("spellchecktitle")||"Spelling","rte-dialog-spell"),o=typeof t.close=="function"?function(){t.close()}:function(){e.closeCurrentPopup()},i=c(t,"div","box-sizing:border-box;width:min(420px,calc(100vw - 32px));max-height:60vh;overflow:auto;padding:14px;font:13px -apple-system,Segoe UI,sans-serif"),l=c(i,"div","color:#64748b;margin-bottom:8px");l.innerText=u("sp_checking","Checking\u2026");var h=c(i,"div","");function g(a){if(h.innerHTML="",!a||!a.length){l.innerText=e.getLangText&&e.getLangText("spellcheckclean")||"No spelling issues found.";return}l.innerText=a.length+" issue"+(a.length===1?"":"s")+" found.",a.forEach(function(f){if(!(!f||!f.word)){var m=c(h,"div","padding:8px 0;border-bottom:1px solid rgba(15,23,42,.08)","rte-spell-row"),w=c(m,"div","font-weight:600;color:#b91c1c;margin-bottom:4px");w.textContent=f.word;var k=c(m,"div","display:flex;flex-wrap:wrap;gap:6px"),_=(f.suggestions||[]).slice(0,6);_.length||(c(k,"span","font-size:12px;color:#94a3b8").textContent="(no suggestions)"),_.forEach(function(y){var C=c(k,"button","font-size:12px;padding:4px 9px;border:1px solid #cbd5e1;border-radius:6px;background:#f8fbff;color:#315277;cursor:pointer");C.type="button",C.textContent=y,C.onclick=function(){S(f.word,y)&&(m.style.opacity="0.45",w.innerHTML=E(f.word)+' &rarr; <span style="color:#16a34a">'+E(y)+"</span>",k.innerHTML="")}})}})}var p=!1;function x(a){p||(p=!0,g(a))}try{var v=s.spellCheckResolver(r);v&&typeof v.then=="function"?(v.then(function(a){x(a||[])},function(){l.innerText=u("sp_serviceerror","Spell-check service error.")}),setTimeout(function(){p||(l.innerText=u("sp_timeout","Spell-check timed out."),p=!0)},12e3)):x(v||[])}catch{l.innerText=u("sp_error","Spell-check error.")}var D=c(i,"div","display:flex;justify-content:flex-end;margin-top:12px"),b=c(D,"button","padding:6px 14px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;cursor:pointer");b.type="button",b.textContent=u("sp_done","Done"),b.onclick=function(){o(),e.focus()}};function R(){var n=["/* 2026-07-12 spell-check feedback precision */",".rte-spell-toast{position:fixed;left:50%;bottom:28px;transform:translateX(-50%);max-width:calc(100vw - 32px);padding:9px 12px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#172033;font:600 13px/1.35 -apple-system,Segoe UI,sans-serif;z-index:2147483600;box-shadow:0 10px 24px rgba(15,23,42,.14)}",".rte-spell-row:last-child{border-bottom:0}"].join(`
1
+ window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_spellcheck=RTE_Plugin_SpellCheck,RTE_DefaultConfig.spellCheckResolver=RTE_DefaultConfig.spellCheckResolver||null,typeof RTE_DefaultConfig.spellCheckEnabled>"u"&&(RTE_DefaultConfig.spellCheckEnabled=!0);function RTE_Plugin_SpellCheck(){var d=this,s,e;d.PluginName="SpellCheck",d.InitConfig=function(n){s=n};function u(n,r){for(var t=s&&s["text_"+n]||r,o=2;o<arguments.length;o++)t=t.split("{"+(o-2)+"}").join(String(arguments[o]));return t}d.InitEditor=function(n){e=n;try{var r=e.getEditable&&e.getEditable();r&&r.setAttribute("spellcheck",s.spellCheckEnabled===!1?"false":"true")}catch{}e.attachEvent("exec_command_spellcheck",function(t){t.returnValue=!0,d.RunSpellCheck()}),S()};function c(n,r,t,o){var i=n.ownerDocument.createElement(r);return t&&(i.style.cssText=t),o&&(i.className=o),n.appendChild(i),i}function C(n){return String(n??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function E(n){try{!e.InvokeEventHook||e.InvokeEventHook("customdialog","spellcheck",n)}catch{}try{var r=e.getEditable(),t=e&&e.iframe&&e.iframe.ownerDocument||r.ownerDocument,o=t.createElement("div");o.className="rte-spell-toast",o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),o.textContent=n,t.body.appendChild(o),setTimeout(function(){o.parentNode&&o.parentNode.removeChild(o)},2600)}catch{}}function R(n,r){try{for(var t=e.getEditable(),o=e.getDocument(),i=o.createTreeWalker(t,NodeFilter.SHOW_TEXT,null),l,h=new RegExp("\\b"+n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\b");l=i.nextNode();){var g=l.parentNode;if(!(g&&(g.nodeName==="CODE"||g.nodeName==="PRE"))){var p=l.data.search(h);if(p>=0)return l.data=l.data.substring(0,p)+r+l.data.substring(p+n.length),!0}}}catch{}return!1}d.RunSpellCheck=function(){if(!s.spellCheckResolver||typeof s.spellCheckResolver!="function"){try{var n=e.getEditable();n.setAttribute("spellcheck","true"),n.focus()}catch{}E(e.getLangText&&e.getLangText("spellchecknative")||"Browser spell-check is on \u2014 misspellings are underlined as you type.");return}var r;try{r=e.getEditable().innerText||""}catch{r=""}if(!r.trim()){E(u("sp_nothing","Nothing to check."));return}var t=e.createDialog(e.getLangText&&e.getLangText("spellchecktitle")||"Spelling","rte-dialog-spell"),o=typeof t.close=="function"?function(){t.close()}:function(){e.closeCurrentPopup()},i=c(t,"div","box-sizing:border-box;width:min(420px,calc(100vw - 32px));max-height:60vh;overflow:auto;padding:14px;font:13px -apple-system,Segoe UI,sans-serif"),l=c(i,"div","color:#64748b;margin-bottom:8px");l.innerText=u("sp_checking","Checking\u2026");var h=c(i,"div","");function g(a){if(h.innerHTML=__RTE_TT(""),!a||!a.length){l.innerText=e.getLangText&&e.getLangText("spellcheckclean")||"No spelling issues found.";return}l.innerText=a.length+" issue"+(a.length===1?"":"s")+" found.",a.forEach(function(f){if(!(!f||!f.word)){var m=c(h,"div","padding:8px 0;border-bottom:1px solid rgba(15,23,42,.08)","rte-spell-row"),_=c(m,"div","font-weight:600;color:#b91c1c;margin-bottom:4px");_.textContent=f.word;var k=c(m,"div","display:flex;flex-wrap:wrap;gap:6px"),w=(f.suggestions||[]).slice(0,6);w.length||(c(k,"span","font-size:12px;color:#94a3b8").textContent="(no suggestions)"),w.forEach(function(T){var y=c(k,"button","font-size:12px;padding:4px 9px;border:1px solid #cbd5e1;border-radius:6px;background:#f8fbff;color:#315277;cursor:pointer");y.type="button",y.textContent=T,y.onclick=function(){R(f.word,T)&&(m.style.opacity="0.45",_.innerHTML=__RTE_TT(C(f.word)+' &rarr; <span style="color:#16a34a">'+C(T)+"</span>"),k.innerHTML=__RTE_TT(""))}})}})}var p=!1;function x(a){p||(p=!0,g(a))}try{var v=s.spellCheckResolver(r);v&&typeof v.then=="function"?(v.then(function(a){x(a||[])},function(){l.innerText=u("sp_serviceerror","Spell-check service error.")}),setTimeout(function(){p||(l.innerText=u("sp_timeout","Spell-check timed out."),p=!0)},12e3)):x(v||[])}catch{l.innerText=u("sp_error","Spell-check error.")}var D=c(i,"div","display:flex;justify-content:flex-end;margin-top:12px"),b=c(D,"button","padding:6px 14px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;cursor:pointer");b.type="button",b.textContent=u("sp_done","Done"),b.onclick=function(){o(),e.focus()}};function S(){var n=["/* 2026-07-12 spell-check feedback precision */",".rte-spell-toast{position:fixed;left:50%;bottom:28px;transform:translateX(-50%);max-width:calc(100vw - 32px);padding:9px 12px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#172033;font:600 13px/1.35 -apple-system,Segoe UI,sans-serif;z-index:2147483600;box-shadow:0 10px 24px rgba(15,23,42,.14)}",".rte-spell-row:last-child{border-bottom:0}"].join(`
2
2
  `);try{var r=e&&e.iframe&&e.iframe.ownerDocument||document;if(!r.querySelector("style[data-rte-spellcheck]")){var t=r.createElement("style");t.setAttribute("data-rte-spellcheck","1"),t.textContent=n,(r.head||r.documentElement).appendChild(t),e&&typeof e.ensureStyleSheetLive=="function"&&e.ensureStyleSheetLive(r,t,"rte-spellcheck-st",t.textContent)}}catch{}}}
@@ -528,7 +528,7 @@ function RTE_Plugin_StateInspector() {
528
528
  if (hostDoc.getElementById("rte-state-inspector-style")) return;
529
529
  var style = hostDoc.createElement("style");
530
530
  style.id = "rte-state-inspector-style";
531
- style.innerHTML = [
531
+ style.innerHTML = __RTE_TT([
532
532
  ".rte-state-inspector-shell{display:flex;align-items:stretch;gap:10px;}",
533
533
  ".rte-state-inspector-shell>.rte-state-inspector-host{flex:1 1 auto;min-width:0;}",
534
534
  ".rte-state-inspector-panel{display:none;flex:0 0 340px;min-width:290px;max-width:min(400px,36vw);border:1px solid rgba(148,163,184,.22);border-radius:8px;background:#fff;box-shadow:0 14px 32px rgba(29,78,216,.1),0 2px 8px rgba(15,23,42,.06);overflow:hidden;color:#172033;font-family:Aptos,'Segoe UI',sans-serif;}",
@@ -560,7 +560,7 @@ function RTE_Plugin_StateInspector() {
560
560
  ".rte-state-inspector-row-val{flex:1 1 auto;min-width:0;font-family:Consolas,'Cascadia Mono',monospace;word-break:break-all;}",
561
561
  ".rte-state-inspector-row.is-flagged .rte-state-inspector-row-val{color:#b91c1c;font-weight:750;}",
562
562
  "@media (max-width: 1100px){.rte-state-inspector-shell{display:block;}.rte-state-inspector-panel{margin-top:12px;max-width:none;width:100%;}.rte-state-inspector-body{max-height:340px;}}"
563
- ].join("");
563
+ ].join(""));
564
564
  hostDoc.head.appendChild(style);
565
565
  // A <style> element's rules are dropped under a strict style-src; this
566
566
  // re-injects them through the CSSOM in that case only. Missed in 2.9.0,