tinymce-rails 5.10.9 → 6.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +8 -19
  3. data/Rakefile +1 -2
  4. data/app/assets/javascripts/tinymce/rails.js +1 -1
  5. data/app/assets/source/tinymce/tinymce.js +19947 -21050
  6. data/lib/tinymce/rails/asset_installer/compile.rb +2 -2
  7. data/lib/tinymce/rails/asset_installer.rb +1 -1
  8. data/lib/tinymce/rails/asset_manifest.rb +1 -1
  9. data/lib/tinymce/rails/configuration.rb +2 -2
  10. data/lib/tinymce/rails/configuration_file.rb +3 -4
  11. data/lib/tinymce/rails/version.rb +2 -2
  12. data/vendor/assets/javascripts/tinymce/license.txt +21 -504
  13. data/vendor/assets/javascripts/tinymce/models/dom/model.js +4 -0
  14. data/vendor/assets/javascripts/tinymce/plugins/advlist/plugin.js +2 -7
  15. data/vendor/assets/javascripts/tinymce/plugins/anchor/plugin.js +2 -7
  16. data/vendor/assets/javascripts/tinymce/plugins/autolink/plugin.js +2 -7
  17. data/vendor/assets/javascripts/tinymce/plugins/autoresize/plugin.js +2 -7
  18. data/vendor/assets/javascripts/tinymce/plugins/autosave/plugin.js +2 -7
  19. data/vendor/assets/javascripts/tinymce/plugins/charmap/plugin.js +2 -7
  20. data/vendor/assets/javascripts/tinymce/plugins/code/plugin.js +2 -7
  21. data/vendor/assets/javascripts/tinymce/plugins/codesample/plugin.js +2 -7
  22. data/vendor/assets/javascripts/tinymce/plugins/directionality/plugin.js +2 -7
  23. data/vendor/assets/javascripts/tinymce/plugins/emoticons/js/emojiimages.js +1 -1
  24. data/vendor/assets/javascripts/tinymce/plugins/emoticons/js/emojis.js +1 -1
  25. data/vendor/assets/javascripts/tinymce/plugins/emoticons/plugin.js +2 -7
  26. data/vendor/assets/javascripts/tinymce/plugins/fullscreen/plugin.js +2 -7
  27. data/vendor/assets/javascripts/tinymce/plugins/help/plugin.js +2 -7
  28. data/vendor/assets/javascripts/tinymce/plugins/image/plugin.js +2 -7
  29. data/vendor/assets/javascripts/tinymce/plugins/importcss/plugin.js +2 -7
  30. data/vendor/assets/javascripts/tinymce/plugins/insertdatetime/plugin.js +2 -7
  31. data/vendor/assets/javascripts/tinymce/plugins/link/plugin.js +2 -7
  32. data/vendor/assets/javascripts/tinymce/plugins/lists/plugin.js +2 -7
  33. data/vendor/assets/javascripts/tinymce/plugins/media/plugin.js +2 -7
  34. data/vendor/assets/javascripts/tinymce/plugins/nonbreaking/plugin.js +2 -7
  35. data/vendor/assets/javascripts/tinymce/plugins/pagebreak/plugin.js +2 -7
  36. data/vendor/assets/javascripts/tinymce/plugins/preview/plugin.js +2 -7
  37. data/vendor/assets/javascripts/tinymce/plugins/quickbars/plugin.js +2 -7
  38. data/vendor/assets/javascripts/tinymce/plugins/save/plugin.js +2 -7
  39. data/vendor/assets/javascripts/tinymce/plugins/searchreplace/plugin.js +2 -7
  40. data/vendor/assets/javascripts/tinymce/plugins/table/plugin.js +2 -7
  41. data/vendor/assets/javascripts/tinymce/plugins/template/plugin.js +2 -7
  42. data/vendor/assets/javascripts/tinymce/plugins/visualblocks/plugin.js +2 -7
  43. data/vendor/assets/javascripts/tinymce/plugins/visualchars/plugin.js +2 -7
  44. data/vendor/assets/javascripts/tinymce/plugins/wordcount/plugin.js +2 -7
  45. data/vendor/assets/javascripts/tinymce/skins/content/dark/content.css +1 -7
  46. data/vendor/assets/javascripts/tinymce/skins/content/dark/content.min.css +1 -7
  47. data/vendor/assets/javascripts/tinymce/skins/content/default/content.css +0 -6
  48. data/vendor/assets/javascripts/tinymce/skins/content/default/content.min.css +0 -6
  49. data/vendor/assets/javascripts/tinymce/skins/content/document/content.css +0 -6
  50. data/vendor/assets/javascripts/tinymce/skins/content/document/content.min.css +0 -6
  51. data/vendor/assets/javascripts/tinymce/skins/content/tinymce-5/content.css +1 -0
  52. data/vendor/assets/javascripts/tinymce/skins/content/tinymce-5/content.min.css +1 -0
  53. data/vendor/assets/javascripts/tinymce/skins/content/tinymce-5-dark/content.css +1 -0
  54. data/vendor/assets/javascripts/tinymce/skins/content/tinymce-5-dark/content.min.css +1 -0
  55. data/vendor/assets/javascripts/tinymce/skins/content/writer/content.css +0 -6
  56. data/vendor/assets/javascripts/tinymce/skins/content/writer/content.min.css +0 -6
  57. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.css +1 -7
  58. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.inline.css +1 -7
  59. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.inline.min.css +1 -7
  60. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.min.css +1 -7
  61. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.css +1 -7
  62. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.min.css +1 -7
  63. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.shadowdom.css +1 -7
  64. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.shadowdom.min.css +1 -7
  65. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.css +1 -7
  66. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.inline.css +1 -7
  67. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.inline.min.css +1 -7
  68. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.min.css +1 -7
  69. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.css +1 -7
  70. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.min.css +1 -7
  71. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +1 -7
  72. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +1 -7
  73. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/content.css +1 -0
  74. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/content.inline.css +1 -0
  75. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/content.inline.min.css +1 -0
  76. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/content.min.css +1 -0
  77. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/skin.css +1 -0
  78. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/skin.min.css +1 -0
  79. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/skin.shadowdom.css +1 -0
  80. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/skin.shadowdom.min.css +1 -0
  81. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/content.css +1 -0
  82. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/content.inline.css +1 -0
  83. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/content.inline.min.css +1 -0
  84. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/content.min.css +1 -0
  85. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/skin.css +1 -0
  86. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/skin.min.css +1 -0
  87. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.css +1 -0
  88. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.min.css +1 -0
  89. data/vendor/assets/javascripts/tinymce/themes/silver/theme.js +2 -7
  90. data/vendor/assets/javascripts/tinymce/tinymce.d.ts +967 -1130
  91. data/vendor/assets/javascripts/tinymce/tinymce.js +2 -7
  92. metadata +24 -32
  93. data/app/assets/javascripts/tinymce-jquery.js +0 -2
  94. data/vendor/assets/config/tinymce-rails.manifest.js +0 -3
  95. data/vendor/assets/javascripts/tinymce/jquery.tinymce.js +0 -91
  96. data/vendor/assets/javascripts/tinymce/plugins/bbcode/plugin.js +0 -9
  97. data/vendor/assets/javascripts/tinymce/plugins/colorpicker/plugin.js +0 -9
  98. data/vendor/assets/javascripts/tinymce/plugins/contextmenu/plugin.js +0 -9
  99. data/vendor/assets/javascripts/tinymce/plugins/fullpage/plugin.js +0 -9
  100. data/vendor/assets/javascripts/tinymce/plugins/hr/plugin.js +0 -9
  101. data/vendor/assets/javascripts/tinymce/plugins/imagetools/plugin.js +0 -9
  102. data/vendor/assets/javascripts/tinymce/plugins/legacyoutput/plugin.js +0 -9
  103. data/vendor/assets/javascripts/tinymce/plugins/noneditable/plugin.js +0 -9
  104. data/vendor/assets/javascripts/tinymce/plugins/paste/plugin.js +0 -9
  105. data/vendor/assets/javascripts/tinymce/plugins/print/plugin.js +0 -9
  106. data/vendor/assets/javascripts/tinymce/plugins/spellchecker/plugin.js +0 -9
  107. data/vendor/assets/javascripts/tinymce/plugins/tabfocus/plugin.js +0 -9
  108. data/vendor/assets/javascripts/tinymce/plugins/textcolor/plugin.js +0 -9
  109. data/vendor/assets/javascripts/tinymce/plugins/textpattern/plugin.js +0 -9
  110. data/vendor/assets/javascripts/tinymce/plugins/toc/plugin.js +0 -9
  111. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.mobile.css +0 -7
  112. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.mobile.min.css +0 -7
  113. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff +0 -0
  114. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.mobile.css +0 -7
  115. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.mobile.min.css +0 -7
  116. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.mobile.css +0 -7
  117. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.mobile.min.css +0 -7
  118. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/fonts/tinymce-mobile.woff +0 -0
  119. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.mobile.css +0 -7
  120. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.mobile.min.css +0 -7
  121. data/vendor/assets/javascripts/tinymce/themes/mobile/theme.js +0 -9
@@ -1,9 +1,4 @@
1
1
  /**
2
- * Copyright (c) Tiny Technologies, Inc. All rights reserved.
3
- * Licensed under the LGPL or a commercial license.
4
- * For LGPL see License.txt in the project root for license information.
5
- * For commercial licenses see https://www.tiny.cloud/
6
- *
7
- * Version: 5.10.9 (2023-11-15)
2
+ * TinyMCE version 6.0.2 (2022-04-27)
8
3
  */
9
- !function(){"use strict";function r(){}function i(t){return function(){return t}}function t(t){return t}function n(){return c}var m,e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=i(!1),a=i(!(m=null)),c={fold:function(t,n){return t()},isSome:l,isNone:a,getOr:t,getOrThunk:o,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:t,orThunk:o,map:n,each:r,bind:n,exists:l,forall:a,filter:function(){return c},toArray:function(){return[]},toString:i("none()")};function o(t){return t()}function g(t){var n=t;return{get:function(){return n},set:function(t){n=t}}}function d(t,n){for(var e=k(t),o=0,r=e.length;o<r;o++){var i=e[o];n(t[i],i)}}function h(t,n){return j.call(t,n)}function s(){var t,n,e=(t=r,n=g(O.none()),{clear:function(){o(),n.set(O.none())},isSet:function(){return n.get().isSome()},get:function(){return n.get()},set:function(t){o(),n.set(O.some(t))}});function o(){return n.get().each(t)}return C(C({},e),{on:function(t){return e.get().each(t)}})}function f(t,n){return-1!==t.indexOf(n)}function v(i,r,t){var a=s(),c=s(),f=i.getParam("emoticons_images_url","https://twemoji.maxcdn.com/v/13.0.1/72x72/","string");i.on("init",function(){_.load(t,r).then(function(t){var n,e,o,l,s,r=(n=i.getParam("emoticons_append",{},"object"),e=function(t){return C({keywords:[],category:"user"},t)},A(n,function(t,n){return{k:n,v:e(t)}}));o=w(t,r),l={},s=[],d(o,function(t,n){var e,o,r,i,a,c={title:n,keywords:t.keywords,char:(i=(r=t).char).length>=(a="<img").length&&i.substr(0,0+a.length)===a?r.char.replace(/src="([^"]+)"/,function(t,n){return'src="'+f+n+'"'}):r.char,category:h(e=D,o=t.category)?e[o]:o},u=void 0!==l[c.category]?l[c.category]:[];l[c.category]=u.concat([c]),s.push(c)}),a.set(l),c.set(s)},function(t){console.log("Failed to load emoticons: "+t),a.set({}),c.set([])})});function e(){return c.get().getOr([])}function u(){return a.isSet()&&c.isSet()}return{listCategories:function(){return[P].concat(k(a.get().getOr({})))},hasLoaded:u,waitForLoad:function(){return u()?x.resolve(!0):new x(function(t,n){var e=15,o=T.setInterval(function(){u()?(T.clearInterval(o),t(!0)):--e<0&&(console.log("Could not load emojis from url: "+r),T.clearInterval(o),n(!1))},100)})},listAll:e,listCategory:function(n){return n===P?e():a.get().bind(function(t){return O.from(t[n])}).getOr([])}}}function y(t,n,e){for(var o,r,i=[],a=n.toLowerCase(),c=e.fold(function(){return l},function(n){return function(t){return n<=t}}),u=0;u<t.length&&(0!==n.length&&(o=t[u],r=a,!f(o.title.toLowerCase(),r)&&!function(t){for(var n=0,e=t.length;n<e;n++)if(f(t[n].toLowerCase(),r))return 1}(o.keywords))||(i.push({value:t[u].char,text:t[u].title,icon:t[u].char}),!c(i.length)));u++);return i}function p(o,i){var e,r,t={pattern:"",results:y(i.listAll(),"",O.some(300))},a=g(P),c=(e=function(t){var n,e=(n=t).getData(),o=a.get(),r=y(i.listCategory(o),e[S],o===P?O.some(300):O.none());n.setData({results:r})},r=null,{cancel:u,throttle:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];u(),r=setTimeout(function(){r=null,e.apply(null,t)},200)}});function u(){m===r||(clearTimeout(r),r=null)}function n(){return{title:"Emoticons",size:"normal",body:{type:"tabpanel",tabs:function(t){for(var n=t.length,e=new Array(n),o=0;o<n;o++){var r=t[o];e[o]={title:r,name:r,items:[l,s]}}return e}(i.listCategories())},initialData:t,onTabChange:function(t,n){a.set(n.newTabName),c.throttle(t)},onChange:c.throttle,onAction:function(t,n){var e;"results"===n.name&&(e=n.value,o.insertContent(e),t.close())},buttons:[{type:"cancel",text:"Close",primary:!0}]}}var l={label:"Search",type:"input",name:S},s={type:"collection",name:"results"},f=o.windowManager.open(n());f.focus(S),i.hasLoaded()||(f.block("Loading emoticons..."),i.waitForLoad().then(function(){f.redial(n()),c.throttle(f),f.focus(S),f.unblock()}).catch(function(t){f.redial({title:"Emoticons",body:{type:"panel",items:[{type:"alertbanner",level:"error",icon:"warning",text:"<p>Could not load emoticons</p>"}]},buttons:[{type:"cancel",text:"Close",primary:!0}],initialData:{pattern:"",results:[]}}),f.focus(S),f.unblock()}))}function b(t){t.on("PreInit",function(){t.parser.addAttributeFilter("data-emoticon",function(t){!function(t){for(var n,e=0,o=t.length;e<o;e++)(n=t[e]).attr("data-mce-resize","false"),n.attr("data-mce-placeholder","1")}(t)})})}function w(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(0===t.length)throw new Error("Can't merge zero objects");for(var e={},o=0;o<t.length;o++){var r,i=t[o];for(r in i)h(i,r)&&(e[r]=(e[r],i[r]))}return e}var u=function(e){function t(){return r}function n(t){return t(e)}var o=i(e),r={fold:function(t,n){return n(e)},isSome:a,isNone:l,getOr:o,getOrThunk:o,getOrDie:o,getOrNull:o,getOrUndefined:o,or:t,orThunk:t,map:function(t){return u(t(e))},each:function(t){t(e)},bind:n,exists:n,forall:n,filter:function(t){return t(e)?r:c},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return r},O={some:u,none:n,from:function(t){return null==t?c:u(t)}},C=function(){return(C=Object.assign||function(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var r in n=arguments[e])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t}).apply(this,arguments)},k=Object.keys,j=Object.hasOwnProperty,A=function(t,o){var r={};return d(t,function(t,n){var e=o(t,n);r[e.k]=e.v}),r},_=tinymce.util.Tools.resolve("tinymce.Resource"),T=tinymce.util.Tools.resolve("tinymce.util.Delay"),x=tinymce.util.Tools.resolve("tinymce.util.Promise"),P="All",D={symbols:"Symbols",people:"People",animals_and_nature:"Animals and Nature",food_and_drink:"Food and Drink",activity:"Activity",travel_and_places:"Travel and Places",objects:"Objects",flags:"Flags",user:"User Defined"},S="pattern";e.add("emoticons",function(t,n){var e,o,r,i,a,c,u,l,s=(o=n,r=(e=t).getParam("emoticons_database","emojis","string"),e.getParam("emoticons_database_url",o+"/js/"+r+e.suffix+".js","string")),f=t.getParam("emoticons_database_id","tinymce.plugins.emoticons","string"),m=v(t,s,f);function g(){return c.execCommand("mceEmoticons")}a=m,(i=t).addCommand("mceEmoticons",function(){return p(i,a)}),(c=t).ui.registry.addButton("emoticons",{tooltip:"Emoticons",icon:"emoji",onAction:g}),c.ui.registry.addMenuItem("emoticons",{text:"Emoticons...",icon:"emoji",onAction:g}),l=m,(u=t).ui.registry.addAutocompleter("emoticons",{ch:":",columns:"auto",minChars:2,fetch:function(t,n){return l.waitForLoad().then(function(){return y(l.listAll(),t,O.some(n))})},onAction:function(t,n,e){u.selection.setRng(n),u.insertContent(e),t.hide()}}),b(t)})}();
4
+ !function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=(null,t=>null===t);const o=()=>{},n=()=>!1;class s{constructor(t,e){this.tag=t,this.value=e}static some(t){return new s(!0,t)}static none(){return s.singletonNone}fold(t,e){return this.tag?e(this.value):t()}isSome(){return this.tag}isNone(){return!this.tag}map(t){return this.tag?s.some(t(this.value)):s.none()}bind(t){return this.tag?t(this.value):s.none()}exists(t){return this.tag&&t(this.value)}forall(t){return!this.tag||t(this.value)}filter(t){return!this.tag||t(this.value)?this:s.none()}getOr(t){return this.tag?this.value:t}or(t){return this.tag?this:t}getOrThunk(t){return this.tag?this.value:t()}orThunk(t){return this.tag?this:t()}getOrDie(t){if(this.tag)return this.value;throw new Error(null!=t?t:"Called getOrDie on None")}static from(t){return null==t?s.none():s.some(t)}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(t){this.tag&&t(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}s.singletonNone=new s(!1);const r=(t,e)=>{const o=t.length,n=new Array(o);for(let s=0;s<o;s++){const o=t[s];n[s]=e(o,s)}return n},a=t=>{let e=t;return{get:()=>e,set:t=>{e=t}}},i=Object.keys,l=Object.hasOwnProperty,c=(t,e)=>{const o=i(t);for(let n=0,s=o.length;n<s;n++){const s=o[n];e(t[s],s)}},u=(t,e)=>l.call(t,e),g=(m=(t,e)=>e,(...t)=>{if(0===t.length)throw new Error("Can't merge zero objects");const e={};for(let o=0;o<t.length;o++){const n=t[o];for(const t in n)u(n,t)&&(e[t]=m(e[t],n[t]))}return e});var m;const h=()=>{const t=(t=>{const e=a(s.none()),o=()=>e.get().each(t);return{clear:()=>{o(),e.set(s.none())},isSet:()=>e.get().isSome(),get:()=>e.get(),set:t=>{o(),e.set(s.some(t))}}})(o);return{...t,on:e=>t.get().each(e)}},d=(t,e)=>-1!==t.indexOf(e);var p=tinymce.util.Tools.resolve("tinymce.Resource");const y=t=>e=>e.options.get(t),v=y("emoticons_database"),f=y("emoticons_database_url"),b=y("emoticons_database_id"),w=y("emoticons_append"),_=y("emoticons_images_url"),j="All",C={symbols:"Symbols",people:"People",animals_and_nature:"Animals and Nature",food_and_drink:"Food and Drink",activity:"Activity",travel_and_places:"Travel and Places",objects:"Objects",flags:"Flags",user:"User Defined"},k=(t,e)=>u(t,e)?t[e]:e,A=t=>{const e=w(t);return o=t=>({keywords:[],category:"user",...t}),((t,e)=>{const o={};return c(t,((t,n)=>{const s=e(t,n);o[s.k]=s.v})),o})(e,((t,e)=>({k:e,v:o(t)})));var o},O=(t,e)=>d(t.title.toLowerCase(),e)||((t,o)=>{for(let o=0,s=t.length;o<s;o++)if(n=t[o],d(n.toLowerCase(),e))return!0;var n;return!1})(t.keywords),x=(t,e,o)=>{const s=[],r=e.toLowerCase(),a=o.fold((()=>n),(t=>e=>e>=t));for(let o=0;o<t.length&&(0!==e.length&&!O(t[o],r)||(s.push({value:t[o].char,text:t[o].title,icon:t[o].char}),!a(s.length)));o++);return s},L="pattern",T=(t,o)=>{const n={pattern:"",results:x(o.listAll(),"",s.some(300))},i=a(j),l=((t,o)=>{let n=null;const s=()=>{e(n)||(clearTimeout(n),n=null)};return{cancel:s,throttle:(...e)=>{s(),n=setTimeout((()=>{n=null,t.apply(null,e)}),200)}}})((t=>{(t=>{const e=t.getData(),n=i.get(),r=o.listCategory(n),a=x(r,e.pattern,n===j?s.some(300):s.none());t.setData({results:a})})(t)})),c={label:"Search",type:"input",name:L},u={type:"collection",name:"results"},g=()=>({title:"Emojis",size:"normal",body:{type:"tabpanel",tabs:r(o.listCategories(),(t=>({title:t,name:t,items:[c,u]})))},initialData:n,onTabChange:(t,e)=>{i.set(e.newTabName),l.throttle(t)},onChange:l.throttle,onAction:(e,o)=>{"results"===o.name&&(((t,e)=>{t.insertContent(e)})(t,o.value),e.close())},buttons:[{type:"cancel",text:"Close",primary:!0}]}),m=t.windowManager.open(g());m.focus(L),o.hasLoaded()||(m.block("Loading emojis..."),o.waitForLoad().then((()=>{m.redial(g()),l.throttle(m),m.focus(L),m.unblock()})).catch((t=>{m.redial({title:"Emojis",body:{type:"panel",items:[{type:"alertbanner",level:"error",icon:"warning",text:"Could not load emojis"}]},buttons:[{type:"cancel",text:"Close",primary:!0}],initialData:{pattern:"",results:[]}}),m.focus(L),m.unblock()})))};t.add("emoticons",((t,e)=>{((t,e)=>{const o=t.options.register;o("emoticons_database",{processor:"string",default:"emojis"}),o("emoticons_database_url",{processor:"string",default:`${e}/js/${v(t)}${t.suffix}.js`}),o("emoticons_database_id",{processor:"string",default:"tinymce.plugins.emoticons"}),o("emoticons_append",{processor:"object",default:{}}),o("emoticons_images_url",{processor:"string",default:"https://twemoji.maxcdn.com/v/13.0.1/72x72/"})})(t,e);const o=((t,e,o)=>{const n=h(),r=h(),a=_(t),l=t=>{return o="<img",(e=t.char).length>=o.length&&e.substr(0,0+o.length)===o?t.char.replace(/src="([^"]+)"/,((t,e)=>`src="${a}${e}"`)):t.char;var e,o};t.on("init",(()=>{p.load(o,e).then((e=>{const o=A(t);(t=>{const e={},o=[];c(t,((t,n)=>{const s={title:n,keywords:t.keywords,char:l(t),category:k(C,t.category)},r=void 0!==e[s.category]?e[s.category]:[];e[s.category]=r.concat([s]),o.push(s)})),n.set(e),r.set(o)})(g(e,o))}),(t=>{console.log(`Failed to load emojis: ${t}`),n.set({}),r.set([])}))}));const u=()=>r.get().getOr([]),m=()=>n.isSet()&&r.isSet();return{listCategories:()=>[j].concat(i(n.get().getOr({}))),hasLoaded:m,waitForLoad:()=>m()?Promise.resolve(!0):new Promise(((t,o)=>{let n=15;const s=setInterval((()=>{m()?(clearInterval(s),t(!0)):(n--,n<0&&(console.log("Could not load emojis from url: "+e),clearInterval(s),o(!1)))}),100)})),listAll:u,listCategory:t=>t===j?u():n.get().bind((e=>s.from(e[t]))).getOr([])}})(t,f(t),b(t));((t,e)=>{t.addCommand("mceEmoticons",(()=>T(t,e)))})(t,o),(t=>{const e=()=>t.execCommand("mceEmoticons");t.ui.registry.addButton("emoticons",{tooltip:"Emojis",icon:"emoji",onAction:e}),t.ui.registry.addMenuItem("emoticons",{text:"Emojis...",icon:"emoji",onAction:e})})(t),((t,e)=>{t.ui.registry.addAutocompleter("emoticons",{ch:":",columns:"auto",minChars:2,fetch:(t,o)=>e.waitForLoad().then((()=>{const n=e.listAll();return x(n,t,s.some(o))})),onAction:(e,o,n)=>{t.selection.setRng(o),t.insertContent(n),e.hide()}})})(t,o),(t=>{t.on("PreInit",(()=>{t.parser.addAttributeFilter("data-emoticon",(t=>{((t,e)=>{for(let e=0,n=t.length;e<n;e++)(o=t[e]).attr("data-mce-resize","false"),o.attr("data-mce-placeholder","1");var o})(t)}))}))})(t)}))}();
@@ -1,9 +1,4 @@
1
1
  /**
2
- * Copyright (c) Tiny Technologies, Inc. All rights reserved.
3
- * Licensed under the LGPL or a commercial license.
4
- * For LGPL see License.txt in the project root for license information.
5
- * For commercial licenses see https://www.tiny.cloud/
6
- *
7
- * Version: 5.10.9 (2023-11-15)
2
+ * TinyMCE version 6.0.2 (2022-04-27)
8
3
  */
9
- !function(){"use strict";function a(e){var n=e;return{get:function(){return n},set:function(e){n=e}}}function e(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"==r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"==r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}}function n(n){return function(e){return typeof e===n}}function c(e){return!(null==e)}function s(){}function y(e){return function(){return e}}function r(e){return e}var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=e("string"),d=e("array"),o=n("boolean"),h=n("function"),i=n("number");function u(){return m}var v=y(!1),f=y(!0),m={fold:function(e,n){return e()},isSome:v,isNone:f,getOr:r,getOrThunk:g,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:y(null),getOrUndefined:y(void 0),or:r,orThunk:g,map:u,each:s,bind:u,exists:v,forall:f,filter:function(){return m},toArray:function(){return[]},toString:y("none()")};function g(e){return e()}function p(e){function n(){return r.get().each(e)}var r=a(A.none());return{clear:function(){n(),r.set(A.none())},isSet:function(){return r.get().isSome()},get:function(){return r.get()},set:function(e){n(),r.set(A.some(e))}}}function w(){return p(function(e){return e.unbind()})}function C(e,n){for(var r=e.length,t=new Array(r),o=0;o<r;o++){var i=e[o];t[o]=n(i,o)}return t}function D(e,n){for(var r=0,t=e.length;r<t;r++)n(e[r],r)}function b(e,n){for(var r=[],t=0,o=e.length;t<o;t++){var i=e[t];n(i,t)&&r.push(i)}return r}function S(e,n){return function(e,n,r){for(var t=0,o=e.length;t<o;t++){var i=e[t];if(n(i,t))return A.some(i);if(r(i,t))break}return A.none()}(e,n,v)}function x(e,n){return-1!==e.indexOf(n)}function E(e){return void 0!==e.style&&h(e.style.getPropertyValue)}function O(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}}var F=function(r){function e(){return o}function n(e){return e(r)}var t=y(r),o={fold:function(e,n){return n(r)},isSome:f,isNone:v,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:e,orThunk:e,map:function(e){return F(e(r))},each:function(e){e(r)},bind:n,exists:n,forall:n,filter:function(e){return e(r)?o:m},toArray:function(){return[r]},toString:function(){return"some("+r+")"}};return o},A={some:F,none:u,from:function(e){return null==e?m:F(e)}},T=function(){return(T=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)},k=Array.prototype.push,R=Object.keys,L={fromHtml:function(e,n){var r=(n||document).createElement("div");if(r.innerHTML=e,!r.hasChildNodes()||1<r.childNodes.length)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return O(r.childNodes[0])},fromTag:function(e,n){var r=(n||document).createElement(e);return O(r)},fromText:function(e,n){var r=(n||document).createTextNode(e);return O(r)},fromDom:O,fromPoint:function(e,n,r){return A.from(e.dom.elementFromPoint(n,r)).map(O)}};function P(n){return function(e){return e.dom.nodeType===n}}function M(t,e){return function(e){for(var n=0;n<e.length;n++){var r=function(n){var r=n.brand.toLowerCase();return S(t,function(e){var n;return r===(null===(n=e.brand)||void 0===n?void 0:n.toLowerCase())}).map(function(e){return{current:e.name,version:he.nu(parseInt(n.version,10),0)}})}(e[n]);if(r.isSome())return r}return A.none()}(e.brands)}function N(e,n){var r=String(n).toLowerCase();return S(e,function(e){return e.search(r)})}function H(n){return function(e){return x(e,n)}}function W(e){return window.matchMedia(e).matches}function q(e,n){var r=e.dom;if(1!==r.nodeType)return!1;var t=r;if(void 0!==t.matches)return t.matches(n);if(void 0!==t.msMatchesSelector)return t.msMatchesSelector(n);if(void 0!==t.webkitMatchesSelector)return t.webkitMatchesSelector(n);if(void 0!==t.mozMatchesSelector)return t.mozMatchesSelector(n);throw new Error("Browser lacks native selectors")}function I(e){return L.fromDom(e.dom.ownerDocument)}function j(e){var n,r=Re(e);return me(n=r)&&c(n.dom.host)?A.some(r):A.none()}function B(e){return L.fromDom(e.dom.host)}function V(e,n,r){!function(e,n,r){if(!(l(r)||o(r)||i(r)))throw console.error("Invalid call to Attribute.set. Key ",n,":: Value ",r,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(n,r+"")}(e.dom,n,r)}function X(e,n){var r=e.dom.getAttribute(n);return null===r?void 0:r}function _(e,n){e.dom.removeAttribute(n)}function z(e,n){var u=e.dom;!function(e){for(var n,r=R(e),t=0,o=r.length;t<o;t++){var i=r[t];n=e[i],function(e,n,r){if(!l(r))throw console.error("Invalid call to CSS.set. Property ",n,":: Value ",r,":: Element ",e),new Error("CSS value must be a string: "+r);E(e)&&e.style.setProperty(n,r)}(u,i,n)}}(n)}function U(e){function n(){return e.stopPropagation()}function r(){return e.preventDefault()}var t,o,i=L.fromDom(function(e){if(Ae()&&c(e.target)){var n=L.fromDom(e.target);if(se(n)&&Le(n)&&e.composed&&e.composedPath){var r=e.composedPath();if(r)return 0<(t=r).length?A.some(t[0]):A.none()}}var t;return A.from(e.target)}(e).getOr(e.target)),u=(t=r,o=n,function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t(o.apply(null,e))});return{target:i,x:e.clientX,y:e.clientY,stop:n,prevent:r,kill:u,raw:e}}function $(e,n,r){return o=n,i=!1,u=He,c=r,a=function(e){u(e)&&c(U(e))},(t=e).dom.addEventListener(o,a,i),{unbind:function(t){for(var o=[],e=1;e<arguments.length;e++)o[e-1]=arguments[e];return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=o.concat(e);return t.apply(null,r)}}(Ne,t,o,a,i)};var t,o,i,u,c,a}function K(e){var n=void 0===e?window:e;return ke().browser.isFirefox()?A.none():A.from(n.visualViewport)}function Y(e,n,r,t){return{x:e,y:n,width:r,height:t,right:e+r,bottom:n+t}}function G(r,t,e){return K(e).map(function(e){function n(e){return t(U(e))}return e.addEventListener(r,n),{unbind:function(){return e.removeEventListener(r,n)}}}).getOrThunk(function(){return{unbind:s}})}function J(e,n){e.fire("FullscreenStateChanged",{state:n}),e.fire("ResizeEditor")}function Q(e){return e.getParam("fullscreen_native",!1,"boolean")}function Z(e){return e.dom===(void 0!==(n=I(e).dom).fullscreenElement?n.fullscreenElement:void 0!==n.msFullscreenElement?n.msFullscreenElement:void 0!==n.webkitFullscreenElement?n.webkitFullscreenElement:null);var n}function ee(e,n){return t=function(e){return q(e,n)},b((r=e,A.from(r.dom.parentNode).map(L.fromDom).map(Ce).map(function(e){return b(e,function(e){return r.dom!==e.dom})}).getOr([])),t);var r,t}function ne(o,e,n){function r(t){return function(e){var n=X(e,"style"),r=void 0===n?"no-styles":n.trim();r===t||(V(e,Ve,r),z(e,o.parseStyle(t)))}}var t,i,u,c,a,s,l=(s=function(e){return q(e,"*")},b(function(e,n){for(var r=h(n)?n:v,t=e.dom,o=[];null!==t.parentNode&&void 0!==t.parentNode;){var i=t.parentNode,u=L.fromDom(i);if(o.push(u),!0===r(u))break;t=i}return o}(e,void 0),s)),f=function(e){for(var n=[],r=0,t=e.length;r<t;++r){if(!d(e[r]))throw new Error("Arr.flatten item "+r+" was not an array, input: "+e);k.apply(n,e[r])}return n}(C(l,function(e){return ee(e,"*:not(.tox-silver-sink)")})),m=(i="background-color",u=(t=n).dom,void 0!==(a=""!==(c=window.getComputedStyle(u).getPropertyValue(i))||Pe(t)?c:Me(u,i))&&""!==a?"background-color:"+a+"!important":"background-color:rgb(255,255,255)!important;");D(f,r("display:none!important;")),D(l,r(Xe+_e+m)),r((!0===ze?"":Xe)+_e+m)(e)}function re(r,t){return function(n){function e(e){return n.setActive(e.state)}return n.setActive(null!==t.get()),r.on("FullscreenStateChanged",e),function(){return r.off("FullscreenStateChanged",e)}}}"undefined"!=typeof window||Function("return this;")();function te(){return de(0,0)}function oe(e){function n(e){return function(){return r===e}}var r=e.current,t=e.version;return{current:r,version:t,isEdge:n("Edge"),isChrome:n("Chrome"),isIE:n("IE"),isOpera:n("Opera"),isFirefox:n(pe),isSafari:n("Safari")}}function ie(e){function n(e){return function(){return r===e}}var r=e.current,t=e.version;return{current:r,version:t,isWindows:n(be),isiOS:n("iOS"),isAndroid:n(Se),isOSX:n("OSX"),isLinux:n("Linux"),isSolaris:n(xe),isFreeBSD:n(Ee),isChromeOS:n(Oe)}}var ue,ce,ae,se=P(1),le=P(3),fe=P(9),me=P(11),de=function(e,n){return{major:e,minor:n}},he={nu:de,detect:function(e,n){var r,t,o=String(n).toLowerCase();return 0===e.length?te():(t=function(e,n){for(var r=0;r<e.length;r++){var t=e[r];if(t.test(n))return t}}(e,r=o))?de(i(1),i(2)):{major:0,minor:0};function i(e){return Number(r.replace(t,"$"+e))}},unknown:te},ve=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,ge={browsers:y([{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return x(e,"edge/")&&x(e,"chrome")&&x(e,"safari")&&x(e,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,ve],search:function(e){return x(e,"chrome")&&!x(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return x(e,"msie")||x(e,"trident")}},{name:"Opera",versionRegexes:[ve,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:H("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:H("firefox")},{name:"Safari",versionRegexes:[ve,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(x(e,"safari")||x(e,"mobile/"))&&x(e,"applewebkit")}}]),oses:y([{name:"Windows",search:H("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return x(e,"iphone")||x(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:H("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:H("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:H("linux"),versionRegexes:[]},{name:"Solaris",search:H("sunos"),versionRegexes:[]},{name:"FreeBSD",search:H("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:H("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}])},pe="Firefox",we=function(){return oe({current:void 0,version:he.unknown()})},ye=oe,be=(y("Edge"),y("Chrome"),y("IE"),y("Opera"),y(pe),y("Safari"),"Windows"),Se="Android",xe="Solaris",Ee="FreeBSD",Oe="ChromeOS",Fe=function(){return ie({current:void 0,version:he.unknown()})},Te=ie,ke=(y(be),y("iOS"),y(Se),y("Linux"),y("OSX"),y(xe),y(Ee),y(Oe),ae=!(ue=function(){return e=navigator.userAgent,n=A.from(navigator.userAgentData),r=W,v=ge.browsers(),g=ge.oses(),p=n.bind(function(e){return M(v,e)}).orThunk(function(){return N(v,r=e).map(function(e){var n=he.detect(e.versionRegexes,r);return{current:e.name,version:n}});var r}).fold(we,ye),w=N(g,t=e).map(function(e){var n=he.detect(e.versionRegexes,t);return{current:e.name,version:n}}).fold(Fe,Te),{browser:p,os:w,deviceType:(i=p,u=e,c=r,a=(o=w).isiOS()&&!0===/ipad/i.test(u),s=o.isiOS()&&!a,f=(l=o.isiOS()||o.isAndroid())||c("(pointer:coarse)"),m=a||!s&&l&&c("(min-device-width:768px)"),d=s||l&&!m,h=i.isSafari()&&o.isiOS()&&!1===/safari/i.test(u),{isiPad:y(a),isiPhone:y(s),isTablet:y(m),isPhone:y(d),isTouch:y(f),isAndroid:o.isAndroid,isiOS:o.isiOS,isWebView:y(h),isDesktop:y(!d&&!m&&!h)})};var e,n,r,t,o,i,u,c,a,s,l,f,m,d,h,v,g,p,w}),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return ae||(ae=!0,ce=ue.apply(null,e)),ce}),Ce=function(e){return C(e.dom.childNodes,L.fromDom)},De=h(Element.prototype.attachShadow)&&h(Node.prototype.getRootNode),Ae=y(De),Re=De?function(e){return L.fromDom(e.dom.getRootNode())}:function(e){return fe(e)?e:I(e)},Le=function(e){return c(e.dom.shadowRoot)},Pe=function(e){var n=le(e)?e.dom.parentNode:e.dom;if(null==n||null===n.ownerDocument)return!1;var r,t,o=n.ownerDocument;return j(L.fromDom(n)).fold(function(){return o.body.contains(n)},(r=Pe,t=B,function(e){return r(t(e))}))},Me=function(e,n){return E(e)?e.style.getPropertyValue(n):""},Ne=function(e,n,r,t){e.dom.removeEventListener(n,r,t)},He=f,We=function(r,t){return{left:r,top:t,translate:function(e,n){return We(r+e,t+n)}}},qe=We,Ie=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),je=tinymce.util.Tools.resolve("tinymce.Env"),Be=tinymce.util.Tools.resolve("tinymce.util.Delay"),Ve="data-ephox-mobile-fullscreen-style",Xe="position:absolute!important;",_e="top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;height:100%!important;overflow:visible!important;",ze=je.os.isAndroid(),Ue=Ie.DOM,$e=K().fold(function(){return{bind:s,unbind:s}},function(n){var r,t=(r=p(s),T(T({},r),{on:function(e){return r.get().each(e)}})),o=w(),i=w(),u=Be.throttle(function(){document.body.scrollTop=0,document.documentElement.scrollTop=0,window.requestAnimationFrame(function(){t.on(function(e){return z(e,{top:n.offsetTop+"px",left:n.offsetLeft+"px",height:n.height+"px",width:n.width+"px"})})})},50);return{bind:function(e){t.set(e),u(),o.set(G("resize",u)),i.set(G("scroll",u))},unbind:function(){t.on(function(){o.clear(),i.clear()}),t.clear()}}}),Ke=function(o,i){function u(n){n(w,"tox-fullscreen"),n(y,"tox-fullscreen"),n(b,"tox-fullscreen"),j(S).map(function(e){return B(e).dom}).each(function(e){n(e,"tox-fullscreen"),n(e,"tox-shadowhost")})}function e(){var r,e,n,t;F&&(r=o.dom,e="["+Ve+"]",D(1!==(n=t=document).nodeType&&9!==n.nodeType&&11!==n.nodeType||0===n.childElementCount?[]:C(t.querySelectorAll(e),L.fromDom),function(e){var n=X(e,Ve);"no-styles"!==n?z(e,r.parseStyle(n)):_(e,"style"),_(e,Ve)})),u(Ue.removeClass),$e.unbind(),A.from(i.get()).each(function(e){return e.fullscreenChangeHandler.unbind()})}var n,r,t,c,a,s,l,f,m,d,h,v,g,p,w=document.body,y=document.documentElement,b=o.getContainer(),S=L.fromDom(b),x=j(s=L.fromDom(o.getElement())).map(B).getOrThunk(function(){var e=I(s).dom.body;if(null==e)throw new Error("Body is not available yet");return L.fromDom(e)}),E=i.get(),O=L.fromDom(o.getBody()),F=je.deviceType.isTouch(),T=b.style,k=o.iframeElement.style;E?(E.fullscreenChangeHandler.unbind(),Q(o)&&Z(x)&&((c=I(x).dom).exitFullscreen?c.exitFullscreen():c.msExitFullscreen?c.msExitFullscreen():c.webkitCancelFullScreen&&c.webkitCancelFullScreen()),k.width=E.iframeWidth,k.height=E.iframeHeight,T.width=E.containerWidth,T.height=E.containerHeight,T.top=E.containerTop,T.left=E.containerLeft,e(),t=E.scrollPos,window.scrollTo(t.x,t.y),i.set(null),J(o,!1),o.off("remove",e)):(n=$(I(x),void 0!==document.fullscreenElement?"fullscreenchange":void 0!==document.msFullscreenElement?"MSFullscreenChange":void 0!==document.webkitFullscreenElement?"webkitfullscreenchange":"fullscreenchange",function(e){Q(o)&&(Z(x)||null===i.get()||Ke(o,i))}),r={scrollPos:(l=window,v=void 0===l?window:l,g=v.document,d=(m=void 0!==(f=L.fromDom(g))?f.dom:document).body.scrollLeft||m.documentElement.scrollLeft,h=m.body.scrollTop||m.documentElement.scrollTop,p=qe(d,h),K(v).fold(function(){var e=v.document.documentElement,n=e.clientWidth,r=e.clientHeight;return Y(p.left,p.top,n,r)},function(e){return Y(Math.max(e.pageLeft,p.left),Math.max(e.pageTop,p.top),e.width,e.height)})),containerWidth:T.width,containerHeight:T.height,containerTop:T.top,containerLeft:T.left,iframeWidth:k.width,iframeHeight:k.height,fullscreenChangeHandler:n},F&&ne(o.dom,S,O),k.width=k.height="100%",T.width=T.height="",u(Ue.addClass),$e.bind(S),o.on("remove",e),i.set(r),Q(o)&&((a=x.dom).requestFullscreen?a.requestFullscreen():a.msRequestFullscreen?a.msRequestFullscreen():a.webkitRequestFullScreen&&a.webkitRequestFullScreen()),J(o,!0))};t.add("fullscreen",function(e){var n,r,t,o,i,u=a(null);return e.inline||(r=u,(n=e).addCommand("mceFullScreen",function(){Ke(n,r)}),(t=e).ui.registry.addToggleMenuItem("fullscreen",{text:"Fullscreen",icon:"fullscreen",shortcut:"Meta+Shift+F",onAction:c,onSetup:re(t,o=u)}),t.ui.registry.addToggleButton("fullscreen",{tooltip:"Fullscreen",icon:"fullscreen",onAction:c,onSetup:re(t,o)}),e.addShortcut("Meta+Shift+F","","mceFullScreen")),i=u,{isFullscreen:function(){return null!==i.get()}};function c(){return t.execCommand("mceFullScreen")}})}();
4
+ !function(){"use strict";const e=e=>{let t=e;return{get:()=>t,set:e=>{t=e}}};var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const n=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(n=r=e,(o=String).prototype.isPrototypeOf(n)||(null===(s=r.constructor)||void 0===s?void 0:s.name)===o.name)?"string":t;var n,r,o,s})(t)===e,r=e=>t=>typeof t===e,o=n("string"),s=n("array"),i=(null,e=>null===e);const l=r("boolean"),a=e=>!(e=>null==e)(e),c=r("function"),u=r("number"),d=()=>{},m=e=>()=>e;function h(e,...t){return(...n)=>{const r=t.concat(n);return e.apply(null,r)}}const g=m(!1),p=m(!0);class f{constructor(e,t){this.tag=e,this.value=t}static some(e){return new f(!0,e)}static none(){return f.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?f.some(e(this.value)):f.none()}bind(e){return this.tag?e(this.value):f.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:f.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return a(e)?f.some(e):f.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}f.singletonNone=new f(!1);const v=t=>{const n=e(f.none()),r=()=>n.get().each(t);return{clear:()=>{r(),n.set(f.none())},isSet:()=>n.get().isSome(),get:()=>n.get(),set:e=>{r(),n.set(f.some(e))}}},w=()=>v((e=>e.unbind())),y=Array.prototype.push,b=(e,t)=>{const n=e.length,r=new Array(n);for(let o=0;o<n;o++){const n=e[o];r[o]=t(n,o)}return r},S=(e,t)=>{for(let n=0,r=e.length;n<r;n++)t(e[n],n)},x=(e,t)=>{const n=[];for(let r=0,o=e.length;r<o;r++){const o=e[r];t(o,r)&&n.push(o)}return n},E=(e,t)=>((e,t,n)=>{for(let r=0,o=e.length;r<o;r++){const o=e[r];if(t(o,r))return f.some(o);if(n(o,r))break}return f.none()})(e,t,g),F=Object.keys,O=(e,t)=>-1!==e.indexOf(t),T=e=>void 0!==e.style&&c(e.style.getPropertyValue),k=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},C=k;"undefined"!=typeof window?window:Function("return this;")();const A=e=>t=>(e=>e.dom.nodeType)(t)===e,R=A(1),L=A(3),M=A(9),N=A(11),P=(e,t)=>{const n=e.dom;if(1!==n.nodeType)return!1;{const e=n;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},D=e=>C(e.dom.ownerDocument),W=e=>b(e.dom.childNodes,C),q=c(Element.prototype.attachShadow)&&c(Node.prototype.getRootNode),H=m(q),I=q?e=>C(e.dom.getRootNode()):e=>M(e)?e:D(e),B=e=>{const t=I(e);return N(n=t)&&a(n.dom.host)?f.some(t):f.none();var n},V=e=>C(e.dom.host),_=e=>{const t=L(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const n=t.ownerDocument;return B(C(t)).fold((()=>n.body.contains(t)),(r=_,o=V,e=>r(o(e))));var r,o},j=(e,t)=>{const n=e.dom.getAttribute(t);return null===n?void 0:n},z=(e,t)=>{e.dom.removeAttribute(t)},$=(e,t)=>{const n=e.dom;((e,t)=>{const n=F(e);for(let r=0,o=n.length;r<o;r++){const o=n[r];t(e[o],o)}})(t,((e,t)=>{((e,t,n)=>{if(!o(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);T(e)&&e.style.setProperty(t,n)})(n,t,e)}))},U=e=>{const t=C((e=>{if(H()&&a(e.target)){const t=C(e.target);if(R(t)&&a(t.dom.shadowRoot)&&e.composed&&e.composedPath){const t=e.composedPath();if(t)return((e,t)=>0<e.length?f.some(e[0]):f.none())(t)}}return f.from(e.target)})(e).getOr(e.target)),n=()=>e.stopPropagation(),r=()=>e.preventDefault(),o=(s=r,i=n,(...e)=>s(i.apply(null,e)));var s,i;return((e,t,n,r,o,s,i)=>({target:e,x:t,y:n,stop:r,prevent:o,kill:s,raw:i}))(t,e.clientX,e.clientY,n,r,o,e)},K=(e,t,n,r)=>{e.dom.removeEventListener(t,n,r)},X=p,Y=(e,t,n)=>((e,t,n,r)=>((e,t,n,r,o)=>{const s=((e,t)=>n=>{e(n)&&t(U(n))})(n,r);return e.dom.addEventListener(t,s,o),{unbind:h(K,e,t,s,o)}})(e,t,n,r,!1))(e,t,X,n),G=()=>J(0,0),J=(e,t)=>({major:e,minor:t}),Q={nu:J,detect:(e,t)=>{const n=String(t).toLowerCase();return 0===e.length?G():((e,t)=>{const n=((e,t)=>{for(let n=0;n<e.length;n++){const r=e[n];if(r.test(t))return r}})(e,t);if(!n)return{major:0,minor:0};const r=e=>Number(t.replace(n,"$"+e));return J(r(1),r(2))})(e,n)},unknown:G},Z=(e,t)=>{const n=String(t).toLowerCase();return E(e,(e=>e.search(n)))},ee=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,te=e=>t=>O(t,e),ne=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>O(e,"edge/")&&O(e,"chrome")&&O(e,"safari")&&O(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,ee],search:e=>O(e,"chrome")&&!O(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>O(e,"msie")||O(e,"trident")},{name:"Opera",versionRegexes:[ee,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:te("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:te("firefox")},{name:"Safari",versionRegexes:[ee,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(O(e,"safari")||O(e,"mobile/"))&&O(e,"applewebkit")}],re=[{name:"Windows",search:te("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>O(e,"iphone")||O(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:te("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:te("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:te("linux"),versionRegexes:[]},{name:"Solaris",search:te("sunos"),versionRegexes:[]},{name:"FreeBSD",search:te("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:te("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],oe={browsers:m(ne),oses:m(re)},se="Edge",ie="Chromium",le="Opera",ae="Firefox",ce="Safari",ue=e=>{const t=e.current,n=e.version,r=e=>()=>t===e;return{current:t,version:n,isEdge:r(se),isChromium:r(ie),isIE:r("IE"),isOpera:r(le),isFirefox:r(ae),isSafari:r(ce)}},de=()=>ue({current:void 0,version:Q.unknown()}),me=ue,he=(m(se),m(ie),m("IE"),m(le),m(ae),m(ce),"Windows"),ge="Android",pe="Linux",fe="macOS",ve="Solaris",we="FreeBSD",ye="ChromeOS",be=e=>{const t=e.current,n=e.version,r=e=>()=>t===e;return{current:t,version:n,isWindows:r(he),isiOS:r("iOS"),isAndroid:r(ge),isMacOS:r(fe),isLinux:r(pe),isSolaris:r(ve),isFreeBSD:r(we),isChromeOS:r(ye)}},Se=()=>be({current:void 0,version:Q.unknown()}),xe=be,Ee=(m(he),m("iOS"),m(ge),m(pe),m(fe),m(ve),m(we),m(ye),(e,t,n)=>{const r=oe.browsers(),o=oe.oses(),s=t.bind((e=>((e,t)=>((e,t)=>{for(let n=0;n<e.length;n++){const r=t(e[n]);if(r.isSome())return r}return f.none()})(t.brands,(t=>{const n=t.brand.toLowerCase();return E(e,(e=>{var t;return n===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())})).map((e=>({current:e.name,version:Q.nu(parseInt(t.version,10),0)})))})))(r,e))).orThunk((()=>((e,t)=>Z(e,t).map((e=>{const n=Q.detect(e.versionRegexes,t);return{current:e.name,version:n}})))(r,e))).fold(de,me),i=((e,t)=>Z(e,t).map((e=>{const n=Q.detect(e.versionRegexes,t);return{current:e.name,version:n}})))(o,e).fold(Se,xe),l=((e,t,n,r)=>{const o=e.isiOS()&&!0===/ipad/i.test(n),s=e.isiOS()&&!o,i=e.isiOS()||e.isAndroid(),l=i||r("(pointer:coarse)"),a=o||!s&&i&&r("(min-device-width:768px)"),c=s||i&&!a,u=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(n),d=!c&&!a&&!u;return{isiPad:m(o),isiPhone:m(s),isTablet:m(a),isPhone:m(c),isTouch:m(l),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:m(u),isDesktop:m(d)}})(i,s,e,n);return{browser:s,os:i,deviceType:l}}),Fe=e=>window.matchMedia(e).matches;let Oe=(e=>{let t,n=!1;return(...r)=>(n||(n=!0,t=e.apply(null,r)),t)})((()=>Ee(navigator.userAgent,f.from(navigator.userAgentData),Fe)));const Te=(e,t)=>({left:e,top:t,translate:(n,r)=>Te(e+n,t+r)}),ke=Te,Ce=e=>{const t=void 0===e?window:e;return Oe().browser.isFirefox()?f.none():f.from(t.visualViewport)},Ae=(e,t,n,r)=>({x:e,y:t,width:n,height:r,right:e+n,bottom:t+r}),Re=e=>{const t=void 0===e?window:e,n=t.document,r=(e=>{const t=void 0!==e?e.dom:document,n=t.body.scrollLeft||t.documentElement.scrollLeft,r=t.body.scrollTop||t.documentElement.scrollTop;return ke(n,r)})(C(n));return Ce(t).fold((()=>{const e=t.document.documentElement,n=e.clientWidth,o=e.clientHeight;return Ae(r.left,r.top,n,o)}),(e=>Ae(Math.max(e.pageLeft,r.left),Math.max(e.pageTop,r.top),e.width,e.height)))},Le=(e,t,n)=>Ce(n).map((n=>{const r=e=>t(U(e));return n.addEventListener(e,r),{unbind:()=>n.removeEventListener(e,r)}})).getOrThunk((()=>({unbind:d})));var Me=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Ne=tinymce.util.Tools.resolve("tinymce.Env");const Pe=(e,t)=>{e.dispatch("FullscreenStateChanged",{state:t})},De=("fullscreen_native",e=>e.options.get("fullscreen_native"));const We=e=>{return e.dom===(void 0!==(t=D(e).dom).fullscreenElement?t.fullscreenElement:void 0!==t.msFullscreenElement?t.msFullscreenElement:void 0!==t.webkitFullscreenElement?t.webkitFullscreenElement:null);var t},qe=(e,t,n)=>((e,t,n)=>x(((e,t)=>{const n=c(t)?t:g;let r=e.dom;const o=[];for(;null!==r.parentNode&&void 0!==r.parentNode;){const e=r.parentNode,t=C(e);if(o.push(t),!0===n(t))break;r=e}return o})(e,n),t))(e,(e=>P(e,t)),n),He=(e,t)=>((e,n)=>{return x((e=>f.from(e.dom.parentNode).map(C))(r=e).map(W).map((e=>x(e,(e=>{return t=e,!(r.dom===t.dom);var t})))).getOr([]),(e=>P(e,t)));var r})(e),Ie="data-ephox-mobile-fullscreen-style",Be="position:absolute!important;",Ve="top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;height:100%!important;overflow:visible!important;",_e=Ne.os.isAndroid(),je=e=>{const t=((e,t)=>{const n=e.dom,r=window.getComputedStyle(n).getPropertyValue(t);return""!==r||_(e)?r:((e,t)=>T(e)?e.style.getPropertyValue(t):"")(n,t)})(e,"background-color");return void 0!==t&&""!==t?"background-color:"+t+"!important":"background-color:rgb(255,255,255)!important;"},ze=Me.DOM,$e=Ce().fold((()=>({bind:d,unbind:d})),(e=>{const t=(()=>{const e=v(d);return{...e,on:t=>e.get().each(t)}})(),n=w(),r=w(),o=((e,t)=>{let n=null;return{cancel:()=>{i(n)||(clearTimeout(n),n=null)},throttle:(...t)=>{i(n)&&(n=setTimeout((()=>{n=null,e.apply(null,t)}),50))}}})((()=>{document.body.scrollTop=0,document.documentElement.scrollTop=0,window.requestAnimationFrame((()=>{t.on((t=>$(t,{top:e.offsetTop+"px",left:e.offsetLeft+"px",height:e.height+"px",width:e.width+"px"})))}))}));return{bind:e=>{t.set(e),o.throttle(),n.set(Le("resize",o.throttle)),r.set(Le("scroll",o.throttle))},unbind:()=>{t.on((()=>{n.clear(),r.clear()})),t.clear()}}})),Ue=(e,t)=>{const n=document.body,r=document.documentElement,i=e.getContainer(),a=C(i),c=(e=>{const t=C(e.getElement());return B(t).map(V).getOrThunk((()=>(e=>{const t=e.dom.body;if(null==t)throw new Error("Body is not available yet");return C(t)})(D(t))))})(e),d=t.get(),m=C(e.getBody()),h=Ne.deviceType.isTouch(),g=i.style,p=e.iframeElement.style,v=e=>{e(n,"tox-fullscreen"),e(r,"tox-fullscreen"),e(i,"tox-fullscreen"),B(a).map((e=>V(e).dom)).each((t=>{e(t,"tox-fullscreen"),e(t,"tox-shadowhost")}))},w=()=>{h&&(e=>{const t=((e,t)=>{const n=document;return 1!==(r=n).nodeType&&9!==r.nodeType&&11!==r.nodeType||0===r.childElementCount?[]:b(n.querySelectorAll(e),C);var r})("["+Ie+"]");S(t,(t=>{const n=j(t,Ie);"no-styles"!==n?$(t,e.parseStyle(n)):z(t,"style"),z(t,Ie)}))})(e.dom),v(ze.removeClass),$e.unbind(),f.from(t.get()).each((e=>e.fullscreenChangeHandler.unbind()))};if(d)d.fullscreenChangeHandler.unbind(),De(e)&&We(c)&&(e=>{const t=e.dom;t.exitFullscreen?t.exitFullscreen():t.msExitFullscreen?t.msExitFullscreen():t.webkitCancelFullScreen&&t.webkitCancelFullScreen()})(D(c)),p.width=d.iframeWidth,p.height=d.iframeHeight,g.width=d.containerWidth,g.height=d.containerHeight,g.top=d.containerTop,g.left=d.containerLeft,w(),x=d.scrollPos,window.scrollTo(x.x,x.y),t.set(null),Pe(e,!1),e.off("remove",w);else{const n=Y(D(c),void 0!==document.fullscreenElement?"fullscreenchange":void 0!==document.msFullscreenElement?"MSFullscreenChange":void 0!==document.webkitFullscreenElement?"webkitfullscreenchange":"fullscreenchange",(n=>{De(e)&&(We(c)||null===t.get()||Ue(e,t))})),r={scrollPos:Re(window),containerWidth:g.width,containerHeight:g.height,containerTop:g.top,containerLeft:g.left,iframeWidth:p.width,iframeHeight:p.height,fullscreenChangeHandler:n};h&&((e,t,n)=>{const r=t=>n=>{const r=j(n,"style"),s=void 0===r?"no-styles":r.trim();s!==t&&(((e,t,n)=>{((e,t,n)=>{if(!(o(n)||l(n)||u(n)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")})(e.dom,t,n)})(n,Ie,s),$(n,e.parseStyle(t)))},i=qe(t,"*"),a=(e=>{const t=[];for(let n=0,r=e.length;n<r;++n){if(!s(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);y.apply(t,e[n])}return t})(b(i,(e=>He(e,"*:not(.tox-silver-sink)")))),c=je(n);S(a,r("display:none!important;")),S(i,r(Be+Ve+c)),r((!0===_e?"":Be)+Ve+c)(t)})(e.dom,a,m),p.width=p.height="100%",g.width=g.height="",v(ze.addClass),$e.bind(a),e.on("remove",w),t.set(r),De(e)&&(e=>{const t=e.dom;t.requestFullscreen?t.requestFullscreen():t.msRequestFullscreen?t.msRequestFullscreen():t.webkitRequestFullScreen&&t.webkitRequestFullScreen()})(c),Pe(e,!0)}var x},Ke=(e,t)=>n=>{n.setActive(null!==t.get());const r=e=>n.setActive(e.state);return e.on("FullscreenStateChanged",r),()=>e.off("FullscreenStateChanged",r)};t.add("fullscreen",(t=>{const n=e(null);return t.inline||((e=>{(0,e.options.register)("fullscreen_native",{processor:"boolean",default:!1})})(t),((e,t)=>{e.addCommand("mceFullScreen",(()=>{Ue(e,t)}))})(t,n),((e,t)=>{const n=()=>e.execCommand("mceFullScreen");e.ui.registry.addToggleMenuItem("fullscreen",{text:"Fullscreen",icon:"fullscreen",shortcut:"Meta+Shift+F",onAction:n,onSetup:Ke(e,t)}),e.ui.registry.addToggleButton("fullscreen",{tooltip:"Fullscreen",icon:"fullscreen",onAction:n,onSetup:Ke(e,t)})})(t,n),t.addShortcut("Meta+Shift+F","","mceFullScreen")),(e=>({isFullscreen:()=>null!==e.get()}))(n)}))}();
@@ -1,9 +1,4 @@
1
1
  /**
2
- * Copyright (c) Tiny Technologies, Inc. All rights reserved.
3
- * Licensed under the LGPL or a commercial license.
4
- * For LGPL see License.txt in the project root for license information.
5
- * For commercial licenses see https://www.tiny.cloud/
6
- *
7
- * Version: 5.10.9 (2023-11-15)
2
+ * TinyMCE version 6.0.2 (2022-04-27)
8
3
  */
9
- !function(){"use strict";function i(e){return function(){return e}}function e(e){return e}function t(){return s}var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),g=function(){return(g=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},u=i(!1),r=i(!0),s={fold:function(e,t){return e()},isSome:u,isNone:r,getOr:e,getOrThunk:a,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:e,orThunk:a,map:t,each:function(){},bind:t,exists:u,forall:r,filter:function(){return s},toArray:function(){return[]},toString:i("none()")};function a(e){return e()}function b(e,t){for(var n=e.length,a=new Array(n),o=0;o<n;o++){var i=e[o];a[o]=t(i,o)}return a}function m(e,t){for(var n=[],a=0,o=e.length;a<o;a++){var i=e[a];t(i,a)&&n.push(i)}return n}function f(e){var n=p.mac?{alt:"&#x2325;",ctrl:"&#x2303;",shift:"&#x21E7;",meta:"&#x2318;",access:"&#x2303;&#x2325;"}:{meta:"Ctrl ",access:"Shift + Alt "},t=b(e.split("+"),function(e){var t=e.toLowerCase().trim();return A(n,t)?n[t]:e});return p.mac?t.join("").replace(/\s/,""):t.join("+")}function k(e){function a(e){return'<a href="'+e.url+'" target="_blank" rel="noopener">'+e.name+"</a>"}var t,o,n,i,r,s,l,c;return{name:"plugins",title:"Plugins",items:[{type:"htmlpanel",presets:"document",html:[null==e?"":'<div data-mce-tabstop="1" tabindex="-1">'+(s=b((i=w((n=o=e).plugins),void 0===(r=n.getParam("forced_plugins"))?i:m(i,function(e){return!(-1<h.call(r,e))})),function(e){return"<li>"+(t=o,n=e,function(e,t,n){for(var a=0,o=e.length;a<o;a++){var i=e[a];if(t(i,a))return v.some(i);if(n(i,a))break}return v.none()}(d,function(e){return e.key===n},u).fold(function(){var e=t.plugins[n].getMetadata;return"function"==typeof e?a(e()):n},function(e){return a({name:"premium"===e.type?e.name+"*":e.name,url:"https://www.tiny.cloud/docs/plugins/"+e.type+"/"+e.slug})}))+"</li>";var t,n}),l=s.length,c=s.join(""),"<p><b>"+T.translate(["Plugins installed ({0}):",l])+"</b></p><ul>"+c+"</ul>")+"</div>",(t=b(m(d,function(e){var t=e.key,n=e.type;return"autocorrect"!==t&&"premium"===n}),function(e){return"<li>"+T.translate(e.name)+"</li>"}).join(""),'<div data-mce-tabstop="1" tabindex="-1"><p><b>'+T.translate("Premium plugins:")+"</b></p><ul>"+t+'<li class="tox-help__more-link" "><a href="https://www.tiny.cloud/pricing/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">'+T.translate("Learn more...")+"</a></li></ul></div>")].join("")}]}}function l(d,y){return function(){var e,t,n,a,o,i,r,s,l,c,u,m=(e=d,t=y,r={name:"shortcuts",title:"Handy Shortcuts",items:[{type:"table",header:["Action","Shortcut"],cells:b(x,function(e){var t=b(e.shortcuts,f).join(" or ");return[e.action,t]})}]},s={name:"keyboardnav",title:"Keyboard Navigation",items:[{type:"htmlpanel",presets:"document",html:"<h1>Editor UI keyboard navigation</h1>\n\n<h2>Activating keyboard navigation</h2>\n\n<p>The sections of the outer UI of the editor - the menubar, toolbar, sidebar and footer - are all keyboard navigable. As such, there are multiple ways to activate keyboard navigation:</p>\n<ul>\n <li>Focus the menubar: Alt + F9 (Windows) or &#x2325;F9 (MacOS)</li>\n <li>Focus the toolbar: Alt + F10 (Windows) or &#x2325;F10 (MacOS)</li>\n <li>Focus the footer: Alt + F11 (Windows) or &#x2325;F11 (MacOS)</li>\n</ul>\n\n<p>Focusing the menubar or toolbar will start keyboard navigation at the first item in the menubar or toolbar, which will be highlighted with a gray background. Focusing the footer will start keyboard navigation at the first item in the element path, which will be highlighted with an underline. </p>\n\n<h2>Moving between UI sections</h2>\n\n<p>When keyboard navigation is active, pressing tab will move the focus to the next major section of the UI, where applicable. These sections are:</p>\n<ul>\n <li>the menubar</li>\n <li>each group of the toolbar </li>\n <li>the sidebar</li>\n <li>the element path in the footer </li>\n <li>the wordcount toggle button in the footer </li>\n <li>the branding link in the footer </li>\n <li>the editor resize handle in the footer</li>\n</ul>\n\n<p>Pressing shift + tab will move backwards through the same sections, except when moving from the footer to the toolbar. Focusing the element path then pressing shift + tab will move focus to the first toolbar group, not the last.</p>\n\n<h2>Moving within UI sections</h2>\n\n<p>Keyboard navigation within UI sections can usually be achieved using the left and right arrow keys. This includes:</p>\n<ul>\n <li>moving between menus in the menubar</li>\n <li>moving between buttons in a toolbar group</li>\n <li>moving between items in the element path</li>\n</ul>\n\n<p>In all these UI sections, keyboard navigation will cycle within the section. For example, focusing the last button in a toolbar group then pressing right arrow will move focus to the first item in the same toolbar group. </p>\n\n<h1>Executing buttons</h1>\n\n<p>To execute a button, navigate the selection to the desired button and hit space or enter.</p>\n\n<h1>Opening, navigating and closing menus</h1>\n\n<p>When focusing a menubar button or a toolbar button with a menu, pressing space, enter or down arrow will open the menu. When the menu opens the first item will be selected. To move up or down the menu, press the up or down arrow key respectively. This is the same for submenus, which can also be opened and closed using the left and right arrow keys.</p>\n\n<p>To close any active menu, hit the escape key. When a menu is closed the selection will be restored to its previous selection. This also works for closing submenus.</p>\n\n<h1>Context toolbars and menus</h1>\n\n<p>To focus an open context toolbar such as the table context toolbar, press Ctrl + F9 (Windows) or &#x2303;F9 (MacOS).</p>\n\n<p>Context toolbar navigation is the same as toolbar navigation, and context menu navigation is the same as standard menu navigation.</p>\n\n<h1>Dialog navigation</h1>\n\n<p>There are two types of dialog UIs in TinyMCE: tabbed dialogs and non-tabbed dialogs.</p>\n\n<p>When a non-tabbed dialog is opened, the first interactive component in the dialog will be focused. Users can navigate between interactive components by pressing tab. This includes any footer buttons. Navigation will cycle back to the first dialog component if tab is pressed while focusing the last component in the dialog. Pressing shift + tab will navigate backwards.</p>\n\n<p>When a tabbed dialog is opened, the first button in the tab menu is focused. Pressing tab will navigate to the first interactive component in that tab, and will cycle through the tab\u2019s components, the footer buttons, then back to the tab button. To switch to another tab, focus the tab button for the current tab, then use the arrow keys to cycle through the tab buttons.</p>"}]},l=k(e),a=C.majorVersion,o=C.minorVersion,i=0===a.indexOf("@")?"X.X.X":a+"."+o,c={name:"versions",title:"Version",items:[{type:"htmlpanel",html:"<p>"+T.translate(["You are using {0}",'<a href="https://www.tiny.cloud/docs/changelog/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">TinyMCE '+i+"</a>"])+"</p>",presets:"document"}]},u=g(((n={})[r.name]=r,n[s.name]=s,n[l.name]=l,n[c.name]=c,n),t.get()),v.from(e.getParam("help_tabs")).fold(function(){return-1!==(n=(t=w(e=u)).indexOf("versions"))&&(t.splice(n,1),t.push("versions")),{tabs:e,names:t};var e,t,n},function(e){return t=u,n={},a=b(e,function(e){return"string"==typeof e?(A(t,e)&&(n[e]=t[e]),e):(n[e.name]=e).name}),{tabs:n,names:a};var t,n,a})),h=m.tabs,p=function(e){for(var t=[],n=function(e){t.push(e)},a=0;a<e.length;a++)e[a].each(n);return t}(b(m.names,function(e){return A(t=h,n=e)?v.from(t[n]):v.none();var t,n}));d.windowManager.open({title:"Help",size:"medium",body:{type:"tabpanel",tabs:p},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{}})}}var c=function(n){function e(){return o}function t(e){return e(n)}var a=i(n),o={fold:function(e,t){return t(n)},isSome:r,isNone:u,getOr:a,getOrThunk:a,getOrDie:a,getOrNull:a,getOrUndefined:a,or:e,orThunk:e,map:function(e){return c(e(n))},each:function(e){e(n)},bind:t,exists:t,forall:t,filter:function(e){return e(n)?o:s},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},v={some:c,none:t,from:function(e){return null==e?s:c(e)}},h=Array.prototype.indexOf,w=Object.keys,o=Object.hasOwnProperty,A=function(e,t){return o.call(e,t)},p=tinymce.util.Tools.resolve("tinymce.Env"),x=[{shortcuts:["Meta + B"],action:"Bold"},{shortcuts:["Meta + I"],action:"Italic"},{shortcuts:["Meta + U"],action:"Underline"},{shortcuts:["Meta + A"],action:"Select all"},{shortcuts:["Meta + Y","Meta + Shift + Z"],action:"Redo"},{shortcuts:["Meta + Z"],action:"Undo"},{shortcuts:["Access + 1"],action:"Heading 1"},{shortcuts:["Access + 2"],action:"Heading 2"},{shortcuts:["Access + 3"],action:"Heading 3"},{shortcuts:["Access + 4"],action:"Heading 4"},{shortcuts:["Access + 5"],action:"Heading 5"},{shortcuts:["Access + 6"],action:"Heading 6"},{shortcuts:["Access + 7"],action:"Paragraph"},{shortcuts:["Access + 8"],action:"Div"},{shortcuts:["Access + 9"],action:"Address"},{shortcuts:["Alt + 0"],action:"Open help dialog"},{shortcuts:["Alt + F9"],action:"Focus to menubar"},{shortcuts:["Alt + F10"],action:"Focus to toolbar"},{shortcuts:["Alt + F11"],action:"Focus to element path"},{shortcuts:["Ctrl + F9"],action:"Focus to contextual toolbar"},{shortcuts:["Shift + Enter"],action:"Open popup menu for split buttons"},{shortcuts:["Meta + K"],action:"Insert link (if link plugin activated)"},{shortcuts:["Meta + S"],action:"Save (if save plugin activated)"},{shortcuts:["Meta + F"],action:"Find (if searchreplace plugin activated)"},{shortcuts:["Meta + Shift + F"],action:"Switch to or from fullscreen mode"}],T=tinymce.util.Tools.resolve("tinymce.util.I18n"),d=b([{key:"advlist",name:"Advanced List"},{key:"anchor",name:"Anchor"},{key:"autolink",name:"Autolink"},{key:"autoresize",name:"Autoresize"},{key:"autosave",name:"Autosave"},{key:"bbcode",name:"BBCode"},{key:"charmap",name:"Character Map"},{key:"code",name:"Code"},{key:"codesample",name:"Code Sample"},{key:"colorpicker",name:"Color Picker"},{key:"directionality",name:"Directionality"},{key:"emoticons",name:"Emoticons"},{key:"fullpage",name:"Full Page"},{key:"fullscreen",name:"Full Screen"},{key:"help",name:"Help"},{key:"hr",name:"Horizontal Rule"},{key:"image",name:"Image"},{key:"imagetools",name:"Image Tools"},{key:"importcss",name:"Import CSS"},{key:"insertdatetime",name:"Insert Date/Time"},{key:"legacyoutput",name:"Legacy Output"},{key:"link",name:"Link"},{key:"lists",name:"Lists"},{key:"media",name:"Media"},{key:"nonbreaking",name:"Nonbreaking"},{key:"noneditable",name:"Noneditable"},{key:"pagebreak",name:"Page Break"},{key:"paste",name:"Paste"},{key:"preview",name:"Preview"},{key:"print",name:"Print"},{key:"quickbars",name:"Quick Toolbars"},{key:"save",name:"Save"},{key:"searchreplace",name:"Search and Replace"},{key:"spellchecker",name:"Spell Checker"},{key:"tabfocus",name:"Tab Focus"},{key:"table",name:"Table"},{key:"template",name:"Template"},{key:"textcolor",name:"Text Color"},{key:"textpattern",name:"Text Pattern"},{key:"toc",name:"Table of Contents"},{key:"visualblocks",name:"Visual Blocks"},{key:"visualchars",name:"Visual Characters"},{key:"wordcount",name:"Word Count"},{key:"a11ychecker",name:"Accessibility Checker",type:"premium"},{key:"advcode",name:"Advanced Code Editor",type:"premium"},{key:"advtable",name:"Advanced Tables",type:"premium"},{key:"autocorrect",name:"Autocorrect",type:"premium"},{key:"casechange",name:"Case Change",type:"premium"},{key:"checklist",name:"Checklist",type:"premium"},{key:"export",name:"Export",type:"premium"},{key:"mediaembed",name:"Enhanced Media Embed",type:"premium"},{key:"formatpainter",name:"Format Painter",type:"premium"},{key:"linkchecker",name:"Link Checker",type:"premium"},{key:"mentions",name:"Mentions",type:"premium"},{key:"pageembed",name:"Page Embed",type:"premium"},{key:"permanentpen",name:"Permanent Pen",type:"premium"},{key:"powerpaste",name:"PowerPaste",type:"premium"},{key:"rtc",name:"Real-Time Collaboration",type:"premium"},{key:"tinymcespellchecker",name:"Spell Checker Pro",type:"premium"},{key:"tinycomments",name:"Tiny Comments",type:"premium",slug:"comments"},{key:"tinydrive",name:"Tiny Drive",type:"premium"}],function(e){return g(g({},e),{type:e.type||"opensource",slug:e.slug||e.key})}),C=tinymce.util.Tools.resolve("tinymce.EditorManager");n.add("help",function(e){var t,n,a,o=(t={},{get:function(){return t},set:function(e){t=e}}),i={addTab:function(e){var t=n.get();t[e.name]=e,n.set(t)}},r=l(e,n=o),s=r;return(a=e).ui.registry.addButton("help",{icon:"help",tooltip:"Help",onAction:s}),a.ui.registry.addMenuItem("help",{text:"Help",icon:"help",shortcut:"Alt+0",onAction:s}),e.addCommand("mceHelp",r),e.shortcuts.add("Alt+0","Open help dialog","mceHelp"),i})}();
4
+ !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>t.options.get(e),n=t("help_tabs"),a=t("forced_plugins"),o=(void 0,e=>undefined===e);const i=(!1,()=>false);class s{constructor(e,t){this.tag=e,this.value=t}static some(e){return new s(!0,e)}static none(){return s.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?s.some(e(this.value)):s.none()}bind(e){return this.tag?e(this.value):s.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:s.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return null==e?s.none():s.some(e)}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}s.singletonNone=new s(!1);const r=Array.prototype.indexOf,l=(e,t)=>{const n=e.length,a=new Array(n);for(let o=0;o<n;o++){const n=e[o];a[o]=t(n,o)}return a},c=(e,t)=>{const n=[];for(let a=0,o=e.length;a<o;a++){const o=e[a];t(o,a)&&n.push(o)}return n},u=Object.keys,h=Object.hasOwnProperty,m=(e,t)=>h.call(e,t);var p=tinymce.util.Tools.resolve("tinymce.Env");const d=e=>{const t=p.os.isMacOS()||p.os.isiOS(),n=t?{alt:"&#x2325;",ctrl:"&#x2303;",shift:"&#x21E7;",meta:"&#x2318;",access:"&#x2303;&#x2325;"}:{meta:"Ctrl ",access:"Shift + Alt "},a=e.split("+"),o=l(a,(e=>{const t=e.toLowerCase().trim();return m(n,t)?n[t]:e}));return t?o.join("").replace(/\s/,""):o.join("+")},g=[{shortcuts:["Meta + B"],action:"Bold"},{shortcuts:["Meta + I"],action:"Italic"},{shortcuts:["Meta + U"],action:"Underline"},{shortcuts:["Meta + A"],action:"Select all"},{shortcuts:["Meta + Y","Meta + Shift + Z"],action:"Redo"},{shortcuts:["Meta + Z"],action:"Undo"},{shortcuts:["Access + 1"],action:"Heading 1"},{shortcuts:["Access + 2"],action:"Heading 2"},{shortcuts:["Access + 3"],action:"Heading 3"},{shortcuts:["Access + 4"],action:"Heading 4"},{shortcuts:["Access + 5"],action:"Heading 5"},{shortcuts:["Access + 6"],action:"Heading 6"},{shortcuts:["Access + 7"],action:"Paragraph"},{shortcuts:["Access + 8"],action:"Div"},{shortcuts:["Access + 9"],action:"Address"},{shortcuts:["Alt + 0"],action:"Open help dialog"},{shortcuts:["Alt + F9"],action:"Focus to menubar"},{shortcuts:["Alt + F10"],action:"Focus to toolbar"},{shortcuts:["Alt + F11"],action:"Focus to element path"},{shortcuts:["Ctrl + F9"],action:"Focus to contextual toolbar"},{shortcuts:["Shift + Enter"],action:"Open popup menu for split buttons"},{shortcuts:["Meta + K"],action:"Insert link (if link plugin activated)"},{shortcuts:["Meta + S"],action:"Save (if save plugin activated)"},{shortcuts:["Meta + F"],action:"Find (if searchreplace plugin activated)"},{shortcuts:["Meta + Shift + F"],action:"Switch to or from fullscreen mode"}],y=()=>({name:"shortcuts",title:"Handy Shortcuts",items:[{type:"table",header:["Action","Shortcut"],cells:l(g,(e=>{const t=l(e.shortcuts,d).join(" or ");return[e.action,t]}))}]});var b=tinymce.util.Tools.resolve("tinymce.util.I18n");const k=l([{key:"advlist",name:"Advanced List"},{key:"anchor",name:"Anchor"},{key:"autolink",name:"Autolink"},{key:"autoresize",name:"Autoresize"},{key:"autosave",name:"Autosave"},{key:"charmap",name:"Character Map"},{key:"code",name:"Code"},{key:"codesample",name:"Code Sample"},{key:"colorpicker",name:"Color Picker"},{key:"directionality",name:"Directionality"},{key:"emoticons",name:"Emoticons"},{key:"fullscreen",name:"Full Screen"},{key:"help",name:"Help"},{key:"image",name:"Image"},{key:"importcss",name:"Import CSS"},{key:"insertdatetime",name:"Insert Date/Time"},{key:"link",name:"Link"},{key:"lists",name:"Lists"},{key:"media",name:"Media"},{key:"nonbreaking",name:"Nonbreaking"},{key:"pagebreak",name:"Page Break"},{key:"preview",name:"Preview"},{key:"quickbars",name:"Quick Toolbars"},{key:"save",name:"Save"},{key:"searchreplace",name:"Search and Replace"},{key:"table",name:"Table"},{key:"template",name:"Template"},{key:"textcolor",name:"Text Color"},{key:"visualblocks",name:"Visual Blocks"},{key:"visualchars",name:"Visual Characters"},{key:"wordcount",name:"Word Count"},{key:"a11ychecker",name:"Accessibility Checker",type:"premium"},{key:"advcode",name:"Advanced Code Editor",type:"premium"},{key:"advtable",name:"Advanced Tables",type:"premium"},{key:"autocorrect",name:"Autocorrect",type:"premium"},{key:"casechange",name:"Case Change",type:"premium"},{key:"checklist",name:"Checklist",type:"premium"},{key:"editimage",name:"Enhanced Image Editing",type:"premium"},{key:"mediaembed",name:"Enhanced Media Embed",type:"premium",slug:"introduction-to-mediaembed"},{key:"export",name:"Export",type:"premium"},{key:"formatpainter",name:"Format Painter",type:"premium"},{key:"linkchecker",name:"Link Checker",type:"premium"},{key:"mentions",name:"Mentions",type:"premium"},{key:"pageembed",name:"Page Embed",type:"premium"},{key:"permanentpen",name:"Permanent Pen",type:"premium"},{key:"powerpaste",name:"PowerPaste",type:"premium",slug:"introduction-to-powerpaste"},{key:"rtc",name:"Real-Time Collaboration",type:"premium",slug:"rtc-introduction"},{key:"tinymcespellchecker",name:"Spell Checker Pro",type:"premium",slug:"introduction-to-tiny-spellchecker"},{key:"tinycomments",name:"Tiny Comments",type:"premium",slug:"introduction-to-tiny-comments"},{key:"tinydrive",name:"Tiny Drive",type:"premium",slug:"tinydrive-introduction"},{key:"tableofcontents",name:"Table of Contents",type:"premium"}],(e=>({...e,type:e.type||"opensource",slug:e.slug||e.key}))),v=e=>{const t=e=>`<a href="${e.url}" target="_blank" rel="noopener">${e.name}</a>`,n=e=>{const n=(e=>{const t=u(e.plugins),n=a(e);return o(n)?t:c(t,(e=>!(((e,t)=>r.call(e,t))(n,e)>-1)))})(e),h=l(n,(n=>"<li>"+((e,n)=>{return(a=k,o=e=>e.key===n,((e,t,n)=>{for(let a=0,o=e.length;a<o;a++){const o=e[a];if(t(o,a))return s.some(o);if(n(o,a))break}return s.none()})(a,o,i)).fold((()=>{const a=e.plugins[n].getMetadata;return"function"==typeof a?t(a()):n}),(e=>{const n="premium"===e.type?`${e.name}*`:e.name;return t({name:n,url:`https://www.tiny.cloud/docs/tinymce/6/${e.slug}/`})}));var a,o})(e,n)+"</li>")),m=h.length,p=h.join("");return"<p><b>"+b.translate(["Plugins installed ({0}):",m])+"</b></p><ul>"+p+"</ul>"},h={type:"htmlpanel",presets:"document",html:[(e=>null==e?"":'<div data-mce-tabstop="1" tabindex="-1">'+n(e)+"</div>")(e),(()=>{const e=c(k,(({key:e,type:t})=>"autocorrect"!==e&&"premium"===t)),t=l(e,(e=>"<li>"+b.translate(e.name)+"</li>")).join("");return'<div data-mce-tabstop="1" tabindex="-1"><p><b>'+b.translate("Premium plugins:")+"</b></p><ul>"+t+'<li class="tox-help__more-link" "><a href="https://www.tiny.cloud/pricing/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">'+b.translate("Learn more...")+"</a></li></ul></div>"})()].join("")};return{name:"plugins",title:"Plugins",items:[h]}};var f=tinymce.util.Tools.resolve("tinymce.EditorManager");const w=(e,t)=>()=>{const{tabs:a,names:o}=((e,t)=>{const a=y(),o={name:"keyboardnav",title:"Keyboard Navigation",items:[{type:"htmlpanel",presets:"document",html:"<h1>Editor UI keyboard navigation</h1>\n\n<h2>Activating keyboard navigation</h2>\n\n<p>The sections of the outer UI of the editor - the menubar, toolbar, sidebar and footer - are all keyboard navigable. As such, there are multiple ways to activate keyboard navigation:</p>\n<ul>\n <li>Focus the menubar: Alt + F9 (Windows) or &#x2325;F9 (MacOS)</li>\n <li>Focus the toolbar: Alt + F10 (Windows) or &#x2325;F10 (MacOS)</li>\n <li>Focus the footer: Alt + F11 (Windows) or &#x2325;F11 (MacOS)</li>\n</ul>\n\n<p>Focusing the menubar or toolbar will start keyboard navigation at the first item in the menubar or toolbar, which will be highlighted with a gray background. Focusing the footer will start keyboard navigation at the first item in the element path, which will be highlighted with an underline. </p>\n\n<h2>Moving between UI sections</h2>\n\n<p>When keyboard navigation is active, pressing tab will move the focus to the next major section of the UI, where applicable. These sections are:</p>\n<ul>\n <li>the menubar</li>\n <li>each group of the toolbar </li>\n <li>the sidebar</li>\n <li>the element path in the footer </li>\n <li>the wordcount toggle button in the footer </li>\n <li>the branding link in the footer </li>\n <li>the editor resize handle in the footer</li>\n</ul>\n\n<p>Pressing shift + tab will move backwards through the same sections, except when moving from the footer to the toolbar. Focusing the element path then pressing shift + tab will move focus to the first toolbar group, not the last.</p>\n\n<h2>Moving within UI sections</h2>\n\n<p>Keyboard navigation within UI sections can usually be achieved using the left and right arrow keys. This includes:</p>\n<ul>\n <li>moving between menus in the menubar</li>\n <li>moving between buttons in a toolbar group</li>\n <li>moving between items in the element path</li>\n</ul>\n\n<p>In all these UI sections, keyboard navigation will cycle within the section. For example, focusing the last button in a toolbar group then pressing right arrow will move focus to the first item in the same toolbar group. </p>\n\n<h1>Executing buttons</h1>\n\n<p>To execute a button, navigate the selection to the desired button and hit space or enter.</p>\n\n<h1>Opening, navigating and closing menus</h1>\n\n<p>When focusing a menubar button or a toolbar button with a menu, pressing space, enter or down arrow will open the menu. When the menu opens the first item will be selected. To move up or down the menu, press the up or down arrow key respectively. This is the same for submenus, which can also be opened and closed using the left and right arrow keys.</p>\n\n<p>To close any active menu, hit the escape key. When a menu is closed the selection will be restored to its previous selection. This also works for closing submenus.</p>\n\n<h1>Context toolbars and menus</h1>\n\n<p>To focus an open context toolbar such as the table context toolbar, press Ctrl + F9 (Windows) or &#x2303;F9 (MacOS).</p>\n\n<p>Context toolbar navigation is the same as toolbar navigation, and context menu navigation is the same as standard menu navigation.</p>\n\n<h1>Dialog navigation</h1>\n\n<p>There are two types of dialog UIs in TinyMCE: tabbed dialogs and non-tabbed dialogs.</p>\n\n<p>When a non-tabbed dialog is opened, the first interactive component in the dialog will be focused. Users can navigate between interactive components by pressing tab. This includes any footer buttons. Navigation will cycle back to the first dialog component if tab is pressed while focusing the last component in the dialog. Pressing shift + tab will navigate backwards.</p>\n\n<p>When a tabbed dialog is opened, the first button in the tab menu is focused. Pressing tab will navigate to the first interactive component in that tab, and will cycle through the tab\u2019s components, the footer buttons, then back to the tab button. To switch to another tab, focus the tab button for the current tab, then use the arrow keys to cycle through the tab buttons.</p>"}]},i=v(e),r=(()=>{var e,t;const n='<a href="https://www.tiny.cloud/docs/tinymce/6/changelog/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">TinyMCE '+(e=f.majorVersion,t=f.minorVersion,(0===e.indexOf("@")?"X.X.X":e+"."+t)+"</a>");return{name:"versions",title:"Version",items:[{type:"htmlpanel",html:"<p>"+b.translate(["You are using {0}",n])+"</p>",presets:"document"}]}})(),c={[a.name]:a,[o.name]:o,[i.name]:i,[r.name]:r,...t.get()};return s.from(n(e)).fold((()=>(e=>{const t=u(e),n=t.indexOf("versions");return-1!==n&&(t.splice(n,1),t.push("versions")),{tabs:e,names:t}})(c)),(e=>((e,t)=>{const n={},a=l(e,(e=>"string"==typeof e?(m(t,e)&&(n[e]=t[e]),e):(n[e.name]=e,e.name)));return{tabs:n,names:a}})(e,c)))})(e,t),i={type:"tabpanel",tabs:(e=>{const t=[],n=e=>{t.push(e)};for(let t=0;t<e.length;t++)e[t].each(n);return t})(l(o,(e=>{return m(t=a,n=e)?s.from(t[n]):s.none();var t,n})))};e.windowManager.open({title:"Help",size:"medium",body:i,buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{}})};e.add("help",(e=>{const t=(e=>{let t={};return{get:()=>t,set:e=>{t=e}}})(),n=(e=>({addTab:t=>{const n=e.get();n[t.name]=t,e.set(n)}}))(t);(e=>{(0,e.options.register)("help_tabs",{processor:"array"})})(e);const a=w(e,t);return((e,t)=>{e.ui.registry.addButton("help",{icon:"help",tooltip:"Help",onAction:t}),e.ui.registry.addMenuItem("help",{text:"Help",icon:"help",shortcut:"Alt+0",onAction:t})})(e,a),((e,t)=>{e.addCommand("mceHelp",t)})(e,a),e.shortcuts.add("Alt+0","Open help dialog","mceHelp"),n}))}();
@@ -1,9 +1,4 @@
1
1
  /**
2
- * Copyright (c) Tiny Technologies, Inc. All rights reserved.
3
- * Licensed under the LGPL or a commercial license.
4
- * For LGPL see License.txt in the project root for license information.
5
- * For commercial licenses see https://www.tiny.cloud/
6
- *
7
- * Version: 5.10.9 (2023-11-15)
2
+ * TinyMCE version 6.0.2 (2022-04-27)
8
3
  */
9
- !function(){"use strict";function e(r){return function(e){return n=typeof(t=e),(null===t?"null":"object"==n&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":n)===r;var t,n}}function t(t){return function(e){return typeof e===t}}function D(e){return!(null==e)}function l(){}function a(e){return function(){return e}}function n(e){return e}function r(){return g}var i,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),v=function(){return(v=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},T=e("string"),s=e("object"),c=e("array"),N=t("boolean"),w=t("function"),u=t("number"),m=a(!1),d=a(!(i=null)),g={fold:function(e,t){return e()},isSome:m,isNone:d,getOr:n,getOrThunk:p,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:a(null),getOrUndefined:a(void 0),or:n,orThunk:p,map:r,each:l,bind:r,exists:m,forall:d,filter:function(){return g},toArray:function(){return[]},toString:a("none()")};function p(e){return e()}function f(e,a,o,l){return function(e){for(var t=y(e),n=0,r=t.length;n<r;n++){var i=t[n];!function(e,t){(a(e,t)?o:l)(e,t)}(e[i],i)}}(e),1}function h(e,t){return A.call(e,t)}function S(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!c(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);U.apply(t,e[n])}return t}var b=function(n){function e(){return i}function t(e){return e(n)}var r=a(n),i={fold:function(e,t){return t(n)},isSome:d,isNone:m,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:e,orThunk:e,map:function(e){return b(e(n))},each:function(e){e(n)},bind:t,exists:t,forall:t,filter:function(e){return e(n)?i:g},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return i},L={some:b,none:r,from:function(e){return null==e?g:b(e)}},y=Object.keys,A=Object.hasOwnProperty,U=Array.prototype.push;function I(e,t,n){!function(e,t,n){if(!(T(n)||N(n)||u(n)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")}(e.dom,t,n)}function C(e){return e.getParam("image_dimensions",!0,"boolean")}function x(e,t){return Math.max(parseInt(e,10),parseInt(t,10))}function O(e){return e&&e.replace(/px$/,"")}function P(e){return 0<e.length&&/^[0-9]+$/.test(e)&&(e+="px"),e}function _(e){if(e.margin){var t=String(e.margin).split(" ");switch(t.length){case 1:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[0],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[0];break;case 2:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[1];break;case 3:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[1];break;case 4:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[3]}delete e.margin}return e}function E(e){return"IMG"===e.nodeName&&(e.hasAttribute("data-mce-object")||e.hasAttribute("data-mce-placeholder"))}function R(e,t){return we.isDomSafe(t,"img",e.settings)}function k(e){return e.style.marginLeft&&e.style.marginRight&&e.style.marginLeft===e.style.marginRight?O(e.style.marginLeft):""}function z(e){return e.style.marginTop&&e.style.marginBottom&&e.style.marginTop===e.style.marginBottom?O(e.style.marginTop):""}function M(e){return e.style.borderWidth?O(e.style.borderWidth):""}function j(e,t){return e.hasAttribute(t)?e.getAttribute(t):""}function B(e,t){return e.style[t]||""}function H(e){return null!==e.parentNode&&"FIGURE"===e.parentNode.nodeName}function F(e,t,n){""===n?e.removeAttribute(t):e.setAttribute(t,n)}function G(e,t){var n=e.getAttribute("style"),r=t(null!==n?n:"");0<r.length?(e.setAttribute("style",r),e.setAttribute("data-mce-style",r)):e.removeAttribute("style")}function W(e,r){return function(e,t,n){e.style[t]?(e.style[t]=P(n),G(e,r)):F(e,t,n)}}function V(e,t){return e.style[t]?O(e.style[t]):j(e,t)}function $(e,t){var n=P(t);e.style.marginLeft=n,e.style.marginRight=n}function J(e,t){var n=P(t);e.style.marginTop=n,e.style.marginBottom=n}function K(e,t){var n=P(t);e.style.borderWidth=n}function X(e,t){e.style.borderStyle=t}function Z(e){return"FIGURE"===e.nodeName}function q(e){return 0===Ue.getAttrib(e,"alt").length&&"presentation"===Ue.getAttrib(e,"role")}function Q(){return{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}}function Y(e,t){return{src:j(t,"src"),alt:q(n=t)?"":j(n,"alt"),title:j(t,"title"),width:V(t,"width"),height:V(t,"height"),class:j(t,"class"),style:e(j(t,"style")),caption:H(t),hspace:k(t),vspace:z(t),border:M(t),borderStyle:B(t,"borderStyle"),isDecorative:q(t)};var n}function ee(e,t,n,r,i){n[r]!==t[r]&&i(e,r,n[r])}function te(r,i){return function(e,t,n){r(e,n),G(e,i)}}function ne(e,t){var n=_(e.dom.styles.parse(t)),r=e.dom.styles.parse(e.dom.styles.serialize(n));return e.dom.styles.serialize(r)}function re(e){var t=e.selection.getNode(),n=e.dom.getParent(t,"figure.image");return n?e.dom.select("img",n)[0]:t&&("IMG"!==t.nodeName||E(t))?null:t}function ie(n,e){var r,t,i=n.dom,a=(f(n.schema.getTextBlockElements(),function(e,t){return!n.schema.isValidChild(t,"figure")},(r=t={},function(e,t){r[t]=e}),l),t),o=i.getParent(e.parentNode,function(e){return h(t=a,n=e.nodeName)&&null!=t[n];var t,n},n.getBody());return o?i.split(o,e):e}function ae(r,e){var t=function(e){var t=document.createElement("img");if(Ce(function(e){return ne(r,e)},v(v({},e),{caption:!1}),t),Ie(t,e.alt,e.isDecorative),e.caption){var n=Ue.create("figure",{class:"image"});return n.appendChild(t),n.appendChild(Ue.create("figcaption",{contentEditable:"true"},"Caption")),n.contentEditable="false",n}return t}(e);r.dom.setAttrib(t,"data-mce-id","__mcenew"),r.focus(),r.selection.setContent(t.outerHTML);var n,i=r.dom.select('*[data-mce-id="__mcenew"]')[0];r.dom.setAttrib(i,"data-mce-id",null),Z(i)?(n=ie(r,i),r.selection.select(n)):r.selection.select(i)}function oe(t,e){var n,r,i,a,o,l,s,c,u,m,d,g,p,f,h,b=re(t);function y(){f.onload=f.onerror=null,g.selection&&(g.selection.select(f),g.nodeChanged())}b?(n=Y(function(e){return ne(t,e)},b),r=v(v({},n),e),s=t,c=r.src,i=v(v({},r),{src:R(s,c)?c:""}),r.src?(m=i,h=re(u=t),Ce(function(e){return ne(u,e)},m,h),u.dom.setAttrib(h,"src",h.getAttribute("src")),Z(h.parentNode)?(d=h.parentNode,ie(u,d),u.selection.select(h.parentNode)):(u.selection.select(h),g=u,p=m,(f=h).onload=function(){p.width||p.height||!C(g)||g.dom.setAttribs(f,{width:String(f.clientWidth),height:String(f.clientHeight)}),y()},f.onerror=y)):(a=t,(o=b)&&(l=a.dom.is(o.parentNode,"figure.image")?o.parentNode:o,a.dom.remove(l),a.focus(),a.nodeChanged(),a.dom.isEmpty(a.getBody())&&(a.setContent(""),a.selection.setCursorLocation())))):e.src&&ae(t,v(v({},Q()),e))}function le(e){return T(e.value)?e.value:""}function se(t){return void 0===t&&(t=le),function(e){return e?L.from(e).map(function(e){return Ne(e,t)}):L.none()}}function ce(e){var t=e.imageList.map(function(e){return{name:"images",type:"listbox",label:"Image list",items:e}}),n={name:"alt",type:"input",label:"Alternative description",disabled:e.hasAccessibilityOptions&&e.image.isDecorative},r=e.classList.map(function(e){return{name:"classes",type:"listbox",label:"Class",items:e}});return S([[{name:"src",type:"urlinput",filetype:"image",label:"Source"}],t.toArray(),e.hasAccessibilityOptions&&e.hasDescription?[{type:"label",label:"Accessibility",items:[{name:"isDecorative",type:"checkbox",label:"Image is decorative"}]}]:[],e.hasDescription?[n]:[],e.hasImageTitle?[{name:"title",type:"input",label:"Image title"}]:[],e.hasDimensions?[{name:"dimensions",type:"sizeinput"}]:[],[v(v({},e.classList.isSome()&&e.hasImageCaption?{type:"grid",columns:2}:{type:"panel"}),{items:S([r.toArray(),e.hasImageCaption?[{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[]])})]])}function ue(e){return{src:{value:e.src,meta:{}},images:e.src,alt:e.alt,title:e.title,dimensions:{width:e.width,height:e.height},classes:e.class,caption:e.caption,style:e.style,vspace:e.vspace,border:e.border,hspace:e.hspace,borderstyle:e.borderStyle,fileinput:[],isDecorative:e.isDecorative}}function me(e,t){return{src:e.src.value,alt:0===e.alt.length&&t?null:e.alt,title:e.title,width:e.dimensions.width,height:e.dimensions.height,class:e.classes,style:e.style,caption:e.caption,hspace:e.hspace,vspace:e.vspace,border:e.border,borderStyle:e.borderstyle,isDecorative:e.isDecorative}}function de(e,t,n,r){var i,a,o,l,s,c,u,m,d,g,p,f,h,b,y,v,A,D,w,S,U,I,C,x,O;U=t,C=(I=r).getData(),x=U,O=C.src.value,(/^(?:[a-zA-Z]+:)?\/\//.test(O)?L.none():x.prependURL.bind(function(e){return O.substring(0,e.length)!==e?L.some(e+O):L.none()})).each(function(e){I.setData({src:{value:e,meta:C.src.meta}})}),h=t,w=(b=r).getData(),void 0!==(S=w.src.meta)&&(y=xe({},w),A=y,D=S,(v=h).hasDescription&&T(D.alt)&&(A.alt=D.alt),v.hasAccessibilityOptions&&(A.isDecorative=D.isDecorative||A.isDecorative||!1),v.hasImageTitle&&T(D.title)&&(A.title=D.title),v.hasDimensions&&(T(D.width)&&(A.dimensions.width=D.width),T(D.height)&&(A.dimensions.height=D.height)),T(D.class)&&Ee(v.classList,D.class).each(function(e){A.classes=e.value}),v.hasImageCaption&&N(D.caption)&&(A.caption=D.caption),v.hasAdvTab&&(T(D.style)&&(A.style=D.style),T(D.vspace)&&(A.vspace=D.vspace),T(D.border)&&(A.border=D.border),T(D.hspace)&&(A.hspace=D.hspace),T(D.borderstyle)&&(A.borderstyle=D.borderstyle)),b.setData(y)),i=e,a=t,o=n,c=(s=(l=r).getData()).src.value,(u=s.src.meta||{}).width||u.height||!a.hasDimensions||(0<c.length?i.imageSize(c).then(function(e){o.open&&l.setData({dimensions:e})}).catch(function(e){return console.error(e)}):l.setData({dimensions:{width:"",height:""}})),m=t,d=n,p=(g=r).getData(),f=Ee(m.imageList,p.src.value),d.prevImage=f,g.setData({images:f.map(function(e){return e.value}).getOr("")})}function ge(l,s,t,c){var e,n=c.getData();c.block("Uploading image"),(0<(e=n.fileinput).length?L.some(e[0]):L.none()).fold(function(){c.unblock()},function(n){function r(){c.unblock(),URL.revokeObjectURL(a)}function i(e){c.setData({src:{value:e,meta:{}}}),c.showTab("general"),de(l,s,t,c)}var a=URL.createObjectURL(n),o=n;new De(function(e,t){var n=new FileReader;n.onload=function(){e(n.result)},n.onerror=function(){t(n.error.message)},n.readAsDataURL(o)}).then(function(e){var t=l.createBlobCache(n,a,e);s.automaticUploads?l.uploadImage(t).then(function(e){i(e.url),r()}).catch(function(e){r(),l.alertErr(e)}):(l.addToBlobCache(t),i(t.blobUri()),c.unblock())})})}function pe(S,U,I){return function(e,t){var n,r,i,a,o,l,s,c,u,m,d,g,p,f,h,b,y,v,A,D,w;"src"===t.name?de(S,U,I,e):"images"===t.name?(c=S,u=U,m=I,g=(d=e).getData(),(p=Ee(u.imageList,g.images)).each(function(e){""===g.alt||m.prevImage.map(function(e){return e.text===g.alt}).getOr(!1)?""===e.value?d.setData({src:e,alt:m.prevAlt}):d.setData({src:e,alt:e.text}):d.setData({src:e})}),m.prevImage=p,de(c,u,m,d)):"alt"===t.name?I.prevAlt=e.getData().alt:"style"===t.name?(o=S,s=(l=e).getData(),y=o.parseStyle,v=o.serializeStyle,D=_(y((A=s).style)),(w=xe({},A)).vspace=D["margin-top"]&&D["margin-bottom"]&&D["margin-top"]===D["margin-bottom"]?O(String(D["margin-top"])):"",w.hspace=D["margin-right"]&&D["margin-left"]&&D["margin-right"]===D["margin-left"]?O(String(D["margin-right"])):"",w.border=D["border-width"]?O(String(D["border-width"])):"",w.borderstyle=D["border-style"]?String(D["border-style"]):"",w.style=v(y(v(D))),l.setData(w)):"vspace"===t.name||"hspace"===t.name||"border"===t.name||"borderstyle"===t.name?(n=S,i=xe(ue(U.image),(r=e).getData()),f=n.normalizeCss,h=me(i,!1),F(b=document.createElement("img"),"style",h.style),!k(b)&&""===h.hspace||$(b,h.hspace),!z(b)&&""===h.vspace||J(b,h.vspace),!M(b)&&""===h.border||K(b,h.border),!B(b,"borderStyle")&&""===h.borderStyle||X(b,h.borderStyle),a=f(b.getAttribute("style")),r.setData({style:a})):"fileinput"===t.name?ge(S,U,I,e):"isDecorative"===t.name&&(e.getData().isDecorative?e.disable("alt"):e.enable("alt"))}}function fe(v){var t,n,r,i,a,o,l,s,c,A={onSubmit:function(n){return function(e){var t=xe(ue(n.image),e.getData());c.execCommand("mceUpdateImage",!1,me(t,n.hasAccessibilityOptions)),c.editorUpload.uploadImagesAuto(),e.close()}},imageSize:function(e){return R(s,e)?(i=s.documentBaseURI.toAbsolute(e),new De(function(t){function n(e){r.onload=r.onerror=null,r.parentNode&&r.parentNode.removeChild(r),t(e)}var r=document.createElement("img");r.onload=function(){var e=x(r.width,r.clientWidth),t=x(r.height,r.clientHeight);n(De.resolve({width:e,height:t}))},r.onerror=function(){n(De.reject("Failed to get image dimensions for: "+i))};var e=r.style;e.visibility="hidden",e.position="fixed",e.bottom=e.left="0px",e.width=e.height="auto",document.body.appendChild(r),r.src=i}).then(function(e){return{width:String(e.width),height:String(e.height)}})):De.resolve({width:"",height:""});var i},addToBlobCache:function(e){l.editorUpload.blobCache.add(e)},createBlobCache:function(e,t,n){return o.editorUpload.blobCache.create({blob:e,blobUri:t,name:e.name?e.name.replace(/\.[^\.]+$/,""):null,filename:e.name,base64:n.split(",")[1]})},alertErr:function(e){a.windowManager.alert(e)},normalizeCss:function(e){return ne(i,e)},parseStyle:function(e){return r.dom.parseStyle(e)},serializeStyle:function(e,t){return n.dom.serializeStyle(e,t)},uploadImage:(t=n=r=i=a=o=l=s=c=v,function(e){return Oe(t).upload([e],!1).then(function(e){return 0===e.length?De.reject("Failed to upload image"):!1===e[0].status?De.reject(e[0].error.message):e[0]})})};return{open:function(){var a,r,t,e,i,n,o,l,s,c,u,m,d,g,p,f,h,b,y;r=v,i=Pe(function(e){return r.convertURL(e.value||e.url,"src")}),n=new De(function(t){var n=function(e){t(i(e).map(function(e){return S([[{text:"None",value:""}],e])}))},e=r.getParam("image_list",!1);T(e)?Se.send({url:e,success:function(e){n(JSON.parse(e))}}):w(e)?e(n):n(e)}),o=_e(r.getParam("image_class_list")),l=r.getParam("image_advtab",!1,"boolean"),s=r.getParam("image_uploadtab",!0,"boolean"),c=D(r.getParam("images_upload_url")),u=D(r.getParam("images_upload_handler")),m=(e=re(t=r))?Y(function(e){return ne(t,e)},e):Q(),d=r.getParam("image_description",!0,"boolean"),g=r.getParam("image_title",!1,"boolean"),p=C(r),f=r.getParam("image_caption",!1,"boolean"),h=r.getParam("a11y_advanced_options",!1,"boolean"),b=r.getParam("automatic_uploads",!0,"boolean"),y=L.some(r.getParam("image_prepend_url","","string")).filter(function(e){return T(e)&&0<e.length}),n.then(function(e){return{image:m,imageList:e,classList:o,hasAdvTab:l,hasUploadTab:s,hasUploadUrl:c,hasUploadHandler:u,hasDescription:d,hasImageTitle:g,hasDimensions:p,hasImageCaption:f,prependURL:y,hasAccessibilityOptions:h,automaticUploads:b}}).then((a=A,function(e){var t,n,r,i={prevImage:Ee((t=e).imageList,t.image.src),prevAlt:t.image.alt,open:!0};return{title:"Insert/Edit Image",size:"normal",body:(r=e).hasAdvTab||r.hasUploadUrl||r.hasUploadHandler?{type:"tabpanel",tabs:S([[ke(r)],r.hasAdvTab?[Re(r)]:[],r.hasUploadTab&&(r.hasUploadUrl||r.hasUploadHandler)?[Me(r)]:[]])}:{type:"panel",items:ze(r)},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:ue(e.image),onSubmit:a.onSubmit(e),onChange:pe(a,e,i),onClose:(n=i,function(){n.open=!1})}})).then(v.windowManager.open)}}}function he(a){return function(e){for(var t=e.length,n=function(e){e.attr("contenteditable",a?"true":null)};t--;){var r,i=e[t];(r=i.attr("class"))&&/\bimage\b/.test(r)&&(i.attr("contenteditable",a?"false":null),Te.each(i.getAll("figcaption"),n))}}}"undefined"!=typeof window||Function("return this;")();function be(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}}var ye,ve=be,Ae=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),De=tinymce.util.Tools.resolve("tinymce.util.Promise"),we=tinymce.util.Tools.resolve("tinymce.util.URI"),Se=tinymce.util.Tools.resolve("tinymce.util.XHR"),Ue=Ae.DOM,Ie=function(e,t,n){n?(Ue.setAttrib(e,"role","presentation"),I(ve(e),"alt","")):(i===t?ve(e).dom.removeAttribute("alt"):I(ve(e),"alt",t),"presentation"===Ue.getAttrib(e,"role")&&Ue.setAttrib(e,"role",""))},Ce=function(e,t,n){var r=Y(e,n);ee(n,r,t,"caption",function(e,t,n){return H(r=e)?(o=r.parentNode,Ue.insertAfter(r,o),Ue.remove(o)):(i=r,a=Ue.create("figure",{class:"image"}),Ue.insertAfter(a,i),a.appendChild(i),a.appendChild(Ue.create("figcaption",{contentEditable:"true"},"Caption")),a.contentEditable="false"),0;var r,i,a,o}),ee(n,r,t,"src",F),ee(n,r,t,"title",F),ee(n,r,t,"width",W(0,e)),ee(n,r,t,"height",W(0,e)),ee(n,r,t,"class",F),ee(n,r,t,"style",te(function(e,t){return F(e,"style",t),0},e)),ee(n,r,t,"hspace",te($,e)),ee(n,r,t,"vspace",te(J,e)),ee(n,r,t,"border",te(K,e)),ee(n,r,t,"borderStyle",te(X,e)),t.alt===r.alt&&t.isDecorative===r.isDecorative||Ie(n,t.alt,t.isDecorative)},xe=(ye=function(e,t){return s(e)&&s(t)?xe(e,t):t},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var i,a=e[r];for(i in a)h(a,i)&&(n[i]=ye(n[i],a[i]))}return n}),Oe=tinymce.util.Tools.resolve("tinymce.util.ImageUploader"),Te=tinymce.util.Tools.resolve("tinymce.util.Tools"),Ne=function(e,a){var o=[];return Te.each(e,function(e){var t,n,r,i=T((t=e).text)?t.text:T(t.title)?t.title:"";void 0!==e.menu?(n=Ne(e.menu,a),o.push({text:i,items:n})):(r=a(e),o.push({text:i,value:r}))}),o},Le=function(e,i){return function(e){for(var t,n=0;n<e.length;n++){var r=h(t=e[n],"items")?Le(t.items,i):t.value===i?L.some(t):L.none();if(r.isSome())return r}return L.none()}(e)},Pe=se,_e=function(e){return se(le)(e)},Ee=function(e,t){return e.bind(function(e){return Le(e,t)})},Re=function(e){return{title:"Advanced",name:"advanced",items:[{type:"input",label:"Style",name:"style"},{type:"grid",columns:2,items:[{type:"input",label:"Vertical space",name:"vspace",inputMode:"numeric"},{type:"input",label:"Horizontal space",name:"hspace",inputMode:"numeric"},{type:"input",label:"Border width",name:"border",inputMode:"numeric"},{type:"listbox",name:"borderstyle",label:"Border style",items:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]}]}]}},ke=function(e){return{title:"General",name:"general",items:ce(e)}},ze=ce,Me=function(e){return{title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput"}]}};o.add("image",function(e){var t,n,r;(t=e).on("PreInit",function(){t.parser.addNodeFilter("figure",he(!0)),t.serializer.addNodeFilter("figure",he(!1))}),(n=e).ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:fe(n).open,onSetup:function(e){return e.setActive(D(re(n))),n.selection.selectorChangedWithUnbind("img:not([data-mce-object],[data-mce-placeholder]),figure.image",e.setActive).unbind}}),n.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:fe(n).open}),n.ui.registry.addContextMenu("image",{update:function(e){return Z(e)||"IMG"===e.nodeName&&!E(e)?["image"]:[]}}),(r=e).addCommand("mceImage",fe(r).open),r.addCommand("mceUpdateImage",function(e,t){r.undoManager.transact(function(){return oe(r,t)})})})}();
4
+ !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=Object.getPrototypeOf,a=(e,t,a)=>{var i;return!!a(e,t.prototype)||(null===(i=e.constructor)||void 0===i?void 0:i.name)===t.name},i=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&a(e,String,((e,t)=>t.isPrototypeOf(e)))?"string":t})(t)===e,s=e=>t=>typeof t===e,r=i("string"),o=i("object"),n=e=>((e,i)=>o(e)&&a(e,i,((e,a)=>t(e)===a)))(e,Object),l=i("array"),c=(null,e=>null===e);const m=s("boolean"),d=e=>!(e=>null==e)(e),g=s("function"),p=s("number"),u=()=>{};class h{constructor(e,t){this.tag=e,this.value=t}static some(e){return new h(!0,e)}static none(){return h.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?h.some(e(this.value)):h.none()}bind(e){return this.tag?e(this.value):h.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:h.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return d(e)?h.some(e):h.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}h.singletonNone=new h(!1);const b=Object.keys,y=Object.hasOwnProperty,v=(e,t)=>y.call(e,t),f=Array.prototype.push,w=e=>{const t=[];for(let a=0,i=e.length;a<i;++a){if(!l(e[a]))throw new Error("Arr.flatten item "+a+" was not an array, input: "+e);f.apply(t,e[a])}return t};"undefined"!=typeof window?window:Function("return this;")();const A=(e,t,a)=>{((e,t,a)=>{if(!(r(a)||m(a)||p(a)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",a,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,a+"")})(e.dom,t,a)},D=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},_=D;var C=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),I=tinymce.util.Tools.resolve("tinymce.util.URI");const U=e=>e.length>0,x=e=>t=>t.options.get(e),S=x("image_dimensions"),N=x("image_advtab"),T=x("image_uploadtab"),O=x("image_prepend_url"),L=x("image_class_list"),E=x("image_description"),j=x("image_title"),M=x("image_caption"),R=x("image_list"),k=x("a11y_advanced_options"),z=x("automatic_uploads"),P=(e,t)=>Math.max(parseInt(e,10),parseInt(t,10)),B=e=>(e&&(e=e.replace(/px$/,"")),e),F=e=>(e.length>0&&/^[0-9]+$/.test(e)&&(e+="px"),e),H=e=>"IMG"===e.nodeName&&(e.hasAttribute("data-mce-object")||e.hasAttribute("data-mce-placeholder")),G=(e,t)=>{const a=e.options.get;return I.isDomSafe(t,"img",{allow_html_data_urls:a("allow_html_data_urls"),allow_script_urls:a("allow_script_urls"),allow_svg_data_urls:a("allow_svg_data_urls")})},W=C.DOM,$=e=>e.style.marginLeft&&e.style.marginRight&&e.style.marginLeft===e.style.marginRight?B(e.style.marginLeft):"",V=e=>e.style.marginTop&&e.style.marginBottom&&e.style.marginTop===e.style.marginBottom?B(e.style.marginTop):"",K=e=>e.style.borderWidth?B(e.style.borderWidth):"",Z=(e,t)=>e.hasAttribute(t)?e.getAttribute(t):"",q=(e,t)=>e.style[t]?e.style[t]:"",J=e=>null!==e.parentNode&&"FIGURE"===e.parentNode.nodeName,Q=(e,t,a)=>{""===a?e.removeAttribute(t):e.setAttribute(t,a)},X=(e,t)=>{const a=e.getAttribute("style"),i=t(null!==a?a:"");i.length>0?(e.setAttribute("style",i),e.setAttribute("data-mce-style",i)):e.removeAttribute("style")},Y=(e,t)=>(e,a,i)=>{e.style[a]?(e.style[a]=F(i),X(e,t)):Q(e,a,i)},ee=(e,t)=>e.style[t]?B(e.style[t]):Z(e,t),te=(e,t)=>{const a=F(t);e.style.marginLeft=a,e.style.marginRight=a},ae=(e,t)=>{const a=F(t);e.style.marginTop=a,e.style.marginBottom=a},ie=(e,t)=>{const a=F(t);e.style.borderWidth=a},se=(e,t)=>{e.style.borderStyle=t},re=e=>"FIGURE"===e.nodeName,oe=e=>0===W.getAttrib(e,"alt").length&&"presentation"===W.getAttrib(e,"role"),ne=e=>oe(e)?"":Z(e,"alt"),le=(e,t)=>{const a=document.createElement("img");return Q(a,"style",t.style),($(a)||""!==t.hspace)&&te(a,t.hspace),(V(a)||""!==t.vspace)&&ae(a,t.vspace),(K(a)||""!==t.border)&&ie(a,t.border),((e=>q(e,"borderStyle"))(a)||""!==t.borderStyle)&&se(a,t.borderStyle),e(a.getAttribute("style"))},ce=(e,t)=>({src:Z(t,"src"),alt:ne(t),title:Z(t,"title"),width:ee(t,"width"),height:ee(t,"height"),class:Z(t,"class"),style:e(Z(t,"style")),caption:J(t),hspace:$(t),vspace:V(t),border:K(t),borderStyle:q(t,"borderStyle"),isDecorative:oe(t)}),me=(e,t,a,i,s)=>{a[i]!==t[i]&&s(e,i,a[i])},de=(e,t,a)=>{if(a){W.setAttrib(e,"role","presentation");const t=_(e);A(t,"alt","")}else{if(c(t)){"alt",_(e).dom.removeAttribute("alt")}else{const a=_(e);A(a,"alt",t)}"presentation"===W.getAttrib(e,"role")&&W.setAttrib(e,"role","")}},ge=(e,t)=>(a,i,s)=>{e(a,s),X(a,t)},pe=(e,t,a)=>{const i=ce(e,a);me(a,i,t,"caption",((e,t,a)=>(e=>{J(e)?(e=>{const t=e.parentNode;W.insertAfter(e,t),W.remove(t)})(e):(e=>{const t=W.create("figure",{class:"image"});W.insertAfter(t,e),t.appendChild(e),t.appendChild(W.create("figcaption",{contentEditable:"true"},"Caption")),t.contentEditable="false"})(e)})(e))),me(a,i,t,"src",Q),me(a,i,t,"title",Q),me(a,i,t,"width",Y(0,e)),me(a,i,t,"height",Y(0,e)),me(a,i,t,"class",Q),me(a,i,t,"style",ge(((e,t)=>Q(e,"style",t)),e)),me(a,i,t,"hspace",ge(te,e)),me(a,i,t,"vspace",ge(ae,e)),me(a,i,t,"border",ge(ie,e)),me(a,i,t,"borderStyle",ge(se,e)),((e,t,a)=>{a.alt===t.alt&&a.isDecorative===t.isDecorative||de(e,a.alt,a.isDecorative)})(a,i,t)},ue=(e,t)=>{const a=(e=>{if(e.margin){const t=String(e.margin).split(" ");switch(t.length){case 1:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[0],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[0];break;case 2:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[1];break;case 3:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[1];break;case 4:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[3]}delete e.margin}return e})(e.dom.styles.parse(t)),i=e.dom.styles.parse(e.dom.styles.serialize(a));return e.dom.styles.serialize(i)},he=e=>{const t=e.selection.getNode(),a=e.dom.getParent(t,"figure.image");return a?e.dom.select("img",a)[0]:t&&("IMG"!==t.nodeName||H(t))?null:t},be=(e,t)=>{const a=e.dom,i=((t,a)=>{const i={};var s;return((e,t,a,i)=>{((e,t)=>{const a=b(e);for(let i=0,s=a.length;i<s;i++){const s=a[i];t(e[s],s)}})(e,((e,s)=>{(t(e,s)?a:i)(e,s)}))})(t,((t,a)=>!e.schema.isValidChild(a,"figure")),(s=i,(e,t)=>{s[t]=e}),u),i})(e.schema.getTextBlockElements()),s=a.getParent(t.parentNode,(e=>{return t=i,a=e.nodeName,v(t,a)&&void 0!==t[a]&&null!==t[a];var t,a}),e.getBody());return s?a.split(s,t):t},ye=(e,t)=>{const a=((t,a)=>{const i=document.createElement("img");if(pe((t=>ue(e,t)),{...a,caption:!1},i),de(i,a.alt,a.isDecorative),a.caption){const e=W.create("figure",{class:"image"});return e.appendChild(i),e.appendChild(W.create("figcaption",{contentEditable:"true"},"Caption")),e.contentEditable="false",e}return i})(0,t);e.dom.setAttrib(a,"data-mce-id","__mcenew"),e.focus(),e.selection.setContent(a.outerHTML);const i=e.dom.select('*[data-mce-id="__mcenew"]')[0];if(e.dom.setAttrib(i,"data-mce-id",null),re(i)){const t=be(e,i);e.selection.select(t)}else e.selection.select(i)},ve=(e,t)=>{const a=he(e);if(a){const i={...ce((t=>ue(e,t)),a),...t},s=((e,t)=>{const a=t.src;return{...t,src:G(e,a)?a:""}})(e,i);i.src?((e,t)=>{const a=he(e);if(pe((t=>ue(e,t)),t,a),((e,t)=>{e.dom.setAttrib(t,"src",t.getAttribute("src"))})(e,a),re(a.parentNode)){const t=a.parentNode;be(e,t),e.selection.select(a.parentNode)}else e.selection.select(a),((e,t,a)=>{const i=()=>{a.onload=a.onerror=null,e.selection&&(e.selection.select(a),e.nodeChanged())};a.onload=()=>{t.width||t.height||!S(e)||e.dom.setAttribs(a,{width:String(a.clientWidth),height:String(a.clientHeight)}),i()},a.onerror=i})(e,t,a)})(e,s):((e,t)=>{if(t){const a=e.dom.is(t.parentNode,"figure.image")?t.parentNode:t;e.dom.remove(a),e.focus(),e.nodeChanged(),e.dom.isEmpty(e.getBody())&&(e.setContent(""),e.selection.setCursorLocation())}})(e,a)}else t.src&&ye(e,{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1,...t})},fe=(we=(e,t)=>n(e)&&n(t)?fe(e,t):t,(...e)=>{if(0===e.length)throw new Error("Can't merge zero objects");const t={};for(let a=0;a<e.length;a++){const i=e[a];for(const e in i)v(i,e)&&(t[e]=we(t[e],i[e]))}return t});var we,Ae=tinymce.util.Tools.resolve("tinymce.util.ImageUploader"),De=tinymce.util.Tools.resolve("tinymce.util.Tools");const _e=e=>r(e.value)?e.value:"",Ce=(e,t)=>{const a=[];return De.each(e,(e=>{const i=(e=>r(e.text)?e.text:r(e.title)?e.title:"")(e);if(void 0!==e.menu){const s=Ce(e.menu,t);a.push({text:i,items:s})}else{const s=t(e);a.push({text:i,value:s})}})),a},Ie=(e=_e)=>t=>t?h.from(t).map((t=>Ce(t,e))):h.none(),Ue=(e,t)=>((e,a)=>{for(let a=0;a<e.length;a++){const s=(e=>v(e,"items"))(i=e[a])?Ue(i.items,t):i.value===t?h.some(i):h.none();if(s.isSome())return s}var i;return h.none()})(e),xe=Ie,Se=(e,t)=>e.bind((e=>Ue(e,t))),Ne=e=>{const t=xe((t=>e.convertURL(t.value||t.url,"src"))),a=new Promise((a=>{((e,t)=>{const a=R(e);r(a)?fetch(a).then((e=>{e.ok&&e.json().then(t)})):g(a)?a(t):t(a)})(e,(e=>{a(t(e).map((e=>w([[{text:"None",value:""}],e]))))}))})),i=(A=L(e),Ie(_e)(A)),s=N(e),o=T(e),n=(e=>U(e.options.get("images_upload_url")))(e),l=(e=>d(e.options.get("images_upload_handler")))(e),c=(e=>{const t=he(e);return t?ce((t=>ue(e,t)),t):{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}})(e),m=E(e),p=j(e),u=S(e),b=M(e),y=k(e),v=z(e),f=h.some(O(e)).filter((e=>r(e)&&e.length>0));var A;return a.then((e=>({image:c,imageList:e,classList:i,hasAdvTab:s,hasUploadTab:o,hasUploadUrl:n,hasUploadHandler:l,hasDescription:m,hasImageTitle:p,hasDimensions:u,hasImageCaption:b,prependURL:f,hasAccessibilityOptions:y,automaticUploads:v})))},Te=e=>{const t=e.imageList.map((e=>({name:"images",type:"listbox",label:"Image list",items:e}))),a={name:"alt",type:"input",label:"Alternative description",enabled:!(e.hasAccessibilityOptions&&e.image.isDecorative)},i=e.classList.map((e=>({name:"classes",type:"listbox",label:"Class",items:e})));return w([[{name:"src",type:"urlinput",filetype:"image",label:"Source"}],t.toArray(),e.hasAccessibilityOptions&&e.hasDescription?[{type:"label",label:"Accessibility",items:[{name:"isDecorative",type:"checkbox",label:"Image is decorative"}]}]:[],e.hasDescription?[a]:[],e.hasImageTitle?[{name:"title",type:"input",label:"Image title"}]:[],e.hasDimensions?[{name:"dimensions",type:"sizeinput"}]:[],[{...(s=e.classList.isSome()&&e.hasImageCaption,s?{type:"grid",columns:2}:{type:"panel"}),items:w([i.toArray(),e.hasImageCaption?[{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[]])}]]);var s},Oe=e=>({title:"General",name:"general",items:Te(e)}),Le=Te,Ee=e=>({src:{value:e.src,meta:{}},images:e.src,alt:e.alt,title:e.title,dimensions:{width:e.width,height:e.height},classes:e.class,caption:e.caption,style:e.style,vspace:e.vspace,border:e.border,hspace:e.hspace,borderstyle:e.borderStyle,fileinput:[],isDecorative:e.isDecorative}),je=(e,t)=>({src:e.src.value,alt:0===e.alt.length&&t?null:e.alt,title:e.title,width:e.dimensions.width,height:e.dimensions.height,class:e.classes,style:e.style,caption:e.caption,hspace:e.hspace,vspace:e.vspace,border:e.border,borderStyle:e.borderstyle,isDecorative:e.isDecorative}),Me=(e,t,a,i)=>{((e,t)=>{const a=t.getData();((e,t)=>/^(?:[a-zA-Z]+:)?\/\//.test(t)?h.none():e.prependURL.bind((e=>t.substring(0,e.length)!==e?h.some(e+t):h.none())))(e,a.src.value).each((e=>{t.setData({src:{value:e,meta:a.src.meta}})}))})(t,i),((e,t)=>{const a=t.getData(),i=a.src.meta;if(void 0!==i){const s=fe({},a);((e,t,a)=>{e.hasDescription&&r(a.alt)&&(t.alt=a.alt),e.hasAccessibilityOptions&&(t.isDecorative=a.isDecorative||t.isDecorative||!1),e.hasImageTitle&&r(a.title)&&(t.title=a.title),e.hasDimensions&&(r(a.width)&&(t.dimensions.width=a.width),r(a.height)&&(t.dimensions.height=a.height)),r(a.class)&&Se(e.classList,a.class).each((e=>{t.classes=e.value})),e.hasImageCaption&&m(a.caption)&&(t.caption=a.caption),e.hasAdvTab&&(r(a.style)&&(t.style=a.style),r(a.vspace)&&(t.vspace=a.vspace),r(a.border)&&(t.border=a.border),r(a.hspace)&&(t.hspace=a.hspace),r(a.borderstyle)&&(t.borderstyle=a.borderstyle))})(e,s,i),t.setData(s)}})(t,i),((e,t,a,i)=>{const s=i.getData(),r=s.src.value,o=s.src.meta||{};o.width||o.height||!t.hasDimensions||(U(r)?e.imageSize(r).then((e=>{a.open&&i.setData({dimensions:e})})).catch((e=>console.error(e))):i.setData({dimensions:{width:"",height:""}}))})(e,t,a,i),((e,t,a)=>{const i=a.getData(),s=Se(e.imageList,i.src.value);t.prevImage=s,a.setData({images:s.map((e=>e.value)).getOr("")})})(t,a,i)},Re=(e,t,a,i)=>{const s=i.getData();var r;i.block("Uploading image"),(r=s.fileinput,((e,t)=>0<e.length?h.some(e[0]):h.none())(r)).fold((()=>{i.unblock()}),(s=>{const r=URL.createObjectURL(s),o=()=>{i.unblock(),URL.revokeObjectURL(r)},n=s=>{i.setData({src:{value:s,meta:{}}}),i.showTab("general"),Me(e,t,a,i)};var l;(l=s,new Promise(((e,t)=>{const a=new FileReader;a.onload=()=>{e(a.result)},a.onerror=()=>{t(a.error.message)},a.readAsDataURL(l)}))).then((a=>{const l=e.createBlobCache(s,r,a);t.automaticUploads?e.uploadImage(l).then((e=>{n(e.url),o()})).catch((t=>{o(),e.alertErr(t)})):(e.addToBlobCache(l),n(l.blobUri()),i.unblock())}))}))},ke=(e,t,a)=>(i,s)=>{"src"===s.name?Me(e,t,a,i):"images"===s.name?((e,t,a,i)=>{const s=i.getData(),r=Se(t.imageList,s.images);r.each((e=>{const t=""===s.alt||a.prevImage.map((e=>e.text===s.alt)).getOr(!1);t?""===e.value?i.setData({src:e,alt:a.prevAlt}):i.setData({src:e,alt:e.text}):i.setData({src:e})})),a.prevImage=r,Me(e,t,a,i)})(e,t,a,i):"alt"===s.name?a.prevAlt=i.getData().alt:"fileinput"===s.name?Re(e,t,a,i):"isDecorative"===s.name&&i.setEnabled("alt",!i.getData().isDecorative)},ze=e=>()=>{e.open=!1},Pe=e=>e.hasAdvTab||e.hasUploadUrl||e.hasUploadHandler?{type:"tabpanel",tabs:w([[Oe(e)],e.hasAdvTab?[{title:"Advanced",name:"advanced",items:[{type:"grid",columns:2,items:[{type:"input",label:"Vertical space",name:"vspace",inputMode:"numeric"},{type:"input",label:"Horizontal space",name:"hspace",inputMode:"numeric"},{type:"input",label:"Border width",name:"border",inputMode:"numeric"},{type:"listbox",name:"borderstyle",label:"Border style",items:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]}]}]}]:[],e.hasUploadTab&&(e.hasUploadUrl||e.hasUploadHandler)?[{title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput"}]}]:[]])}:{type:"panel",items:Le(e)},Be=(e,t,a)=>i=>{const s=fe(Ee(t.image),i.getData()),r={...s,style:le(a.normalizeCss,je(s,!1))};e.execCommand("mceUpdateImage",!1,je(r,t.hasAccessibilityOptions)),e.editorUpload.uploadImagesAuto(),i.close()},Fe=e=>t=>G(e,t)?(e=>new Promise((t=>{const a=document.createElement("img"),i=e=>{a.onload=a.onerror=null,a.parentNode&&a.parentNode.removeChild(a),t(e)};a.onload=()=>{const e={width:P(a.width,a.clientWidth),height:P(a.height,a.clientHeight)};i(Promise.resolve(e))},a.onerror=()=>{i(Promise.reject(`Failed to get image dimensions for: ${e}`))};const s=a.style;s.visibility="hidden",s.position="fixed",s.bottom=s.left="0px",s.width=s.height="auto",document.body.appendChild(a),a.src=e})))(e.documentBaseURI.toAbsolute(t)).then((e=>({width:String(e.width),height:String(e.height)}))):Promise.resolve({width:"",height:""}),He=e=>(t,a,i)=>e.editorUpload.blobCache.create({blob:t,blobUri:a,name:t.name?t.name.replace(/\.[^\.]+$/,""):null,filename:t.name,base64:i.split(",")[1]}),Ge=e=>t=>{e.editorUpload.blobCache.add(t)},We=e=>t=>{e.windowManager.alert(t)},$e=e=>t=>ue(e,t),Ve=e=>t=>e.dom.parseStyle(t),Ke=e=>(t,a)=>e.dom.serializeStyle(t,a),Ze=e=>t=>Ae(e).upload([t],!1).then((e=>0===e.length?Promise.reject("Failed to upload image"):!1===e[0].status?Promise.reject(e[0].error.message):e[0])),qe=e=>{const t={imageSize:Fe(e),addToBlobCache:Ge(e),createBlobCache:He(e),alertErr:We(e),normalizeCss:$e(e),parseStyle:Ve(e),serializeStyle:Ke(e),uploadImage:Ze(e)};return{open:()=>{Ne(e).then((a=>{const i=(e=>({prevImage:Se(e.imageList,e.image.src),prevAlt:e.image.alt,open:!0}))(a);return{title:"Insert/Edit Image",size:"normal",body:Pe(a),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Ee(a.image),onSubmit:Be(e,a,t),onChange:ke(t,a,i),onClose:ze(i)}})).then(e.windowManager.open)}}},Je=e=>{const t=e.attr("class");return t&&/\bimage\b/.test(t)},Qe=e=>t=>{let a=t.length;const i=t=>{t.attr("contenteditable",e?"true":null)};for(;a--;){const s=t[a];Je(s)&&(s.attr("contenteditable",e?"false":null),De.each(s.getAll("figcaption"),i))}};e.add("image",(e=>{(e=>{const t=e.options.register;t("image_dimensions",{processor:"boolean",default:!0}),t("image_advtab",{processor:"boolean",default:!1}),t("image_uploadtab",{processor:"boolean",default:!0}),t("image_prepend_url",{processor:"string",default:""}),t("image_class_list",{processor:"object[]"}),t("image_description",{processor:"boolean",default:!0}),t("image_title",{processor:"boolean",default:!1}),t("image_caption",{processor:"boolean",default:!1}),t("image_list",{processor:e=>{const t=!1===e||r(e)||((e,t)=>{if(l(e)){for(let a=0,i=e.length;a<i;++a)if(!t(e[a]))return!1;return!0}return!1})(e,o)||g(e);return t?{value:e,valid:t}:{valid:!1,message:"Must be false, a string, an array or a function."}},default:!1})})(e),(e=>{e.on("PreInit",(()=>{e.parser.addNodeFilter("figure",Qe(!0)),e.serializer.addNodeFilter("figure",Qe(!1))}))})(e),(e=>{e.ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:qe(e).open,onSetup:t=>(t.setActive(d(he(e))),e.selection.selectorChangedWithUnbind("img:not([data-mce-object]):not([data-mce-placeholder]),figure.image",t.setActive).unbind)}),e.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:qe(e).open}),e.ui.registry.addContextMenu("image",{update:e=>re(e)||"IMG"===e.nodeName&&!H(e)?["image"]:[]})})(e),(e=>{e.addCommand("mceImage",qe(e).open),e.addCommand("mceUpdateImage",((t,a)=>{e.undoManager.transact((()=>ve(e,a)))}))})(e)}))}();
@@ -1,9 +1,4 @@
1
1
  /**
2
- * Copyright (c) Tiny Technologies, Inc. All rights reserved.
3
- * Licensed under the LGPL or a commercial license.
4
- * For LGPL see License.txt in the project root for license information.
5
- * For commercial licenses see https://www.tiny.cloud/
6
- *
7
- * Version: 5.10.9 (2023-11-15)
2
+ * TinyMCE version 6.0.2 (2022-04-27)
8
3
  */
9
- !function(){"use strict";function t(n){return function(t){return r=typeof(e=t),(null===e?"null":"object"==r&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==r&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":r)===n;var e,r}}function y(t){return t.getParam("importcss_selector_converter")}function u(e){return l(e)?function(t){return-1!==t.indexOf(e)}:e instanceof RegExp?function(t){return e.test(t)}:e}function h(t,e){var r,n=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(e);if(n){var o=n[1],i=n[2].substr(1).split(".").join(" "),c=x.makeMap("a,img");return n[1]?(r={title:e},t.schema.getTextBlockElements()[o]?r.block=o:t.schema.getBlockElements()[o]||c[o.toLowerCase()]?r.selector=o:r.inline=o):n[2]&&(r={inline:"span",title:e.substr(1),classes:i}),!1!==t.getParam("importcss_merge_classes")?r.classes=i:r.attributes={class:i},r}}function d(t,e){return null===e||!1!==t.getParam("importcss_exclusive")}function r(v){v.on("init",function(){function o(t,e){if(f=t,p=g,!(d(v,m=e)?f in p:f in m.selectors)){a=t,l=g,d(v,u=e)?l[a]=!0:u.selectors[a]=!0;var r=(i=(o=v).plugins.importcss,c=t,((s=e)&&s.selector_converter?s.selector_converter:y(o)?y(o):function(){return h(o,c)}).call(i,c,s));if(r){var n=r.name||_.DOM.uniqueId();return v.formatter.register(n,r),{title:r.title,format:n}}}var o,i,c,s,a,u,l,f,m,p;return null}var e,r,n,t,i=(e=[],r=[],n={},{addItemToGroup:function(t,e){n[t]?n[t].push(e):(r.push(t),n[t]=[e])},addItem:function(t){e.push(t)},toFormats:function(){return function(t){for(var e=[],r=0,n=t.length;r<n;++r){if(!f(t[r]))throw new Error("Arr.flatten item "+r+" was not an array, input: "+t);P.apply(e,t[r])}return e}(function(t,e){for(var r=t.length,n=new Array(r),o=0;o<r;o++){var i=t[o];n[o]=e(i,o)}return n}(r,function(t){var e=n[t];return 0===e.length?[]:[{title:t,items:e}]})).concat(e)}}),g={},c=u(v.getParam("importcss_selector_filter")),s=(t=v.getParam("importcss_groups"),x.map(t,function(t){return x.extend({},t,{original:t,selectors:{},filter:u(t.filter)})}));x.each(function(c,t,s){var a=[],r={},u=function(t,e){var r,n,o=n=t.href,i=p.cacheSuffix;if((n=o=l(o)?o.replace("?"+i,"").replace("&"+i,""):o)&&s(n,e)&&!function(t,e){var r,n=!1!==(r=t.getParam("skin"))&&(r||"oxide");if(n){var o=t.getParam("skin_url"),i=o?t.documentBaseURI.toAbsolute(o):m.baseURL+"/skins/ui/"+n,c=m.baseURL+"/skins/content/";return e===i+"/content"+(t.inline?".inline":"")+".min.css"||-1!==e.indexOf(c)}}(c,n)){x.each(t.imports,function(t){u(t,!0)});try{r=t.cssRules||t.rules}catch(t){}x.each(r,function(t){t.styleSheet?u(t.styleSheet,!0):t.selectorText&&x.each(t.selectorText.split(","),function(t){a.push(x.trim(t))})})}};x.each(c.contentCSS,function(t){r[t]=!0}),s=s||function(t,e){return e||r[t]};try{x.each(t.styleSheets,function(t){u(t)})}catch(t){}return a}(v,v.getDoc(),u(v.getParam("importcss_file_filter"))),function(r){var t,e,n;T.test(r)||c&&!c(r)||(n=r,0<(t=x.grep(s,function(t){return!t.filter||t.filter(n)})).length?x.each(t,function(t){var e=o(r,t);e&&i.addItemToGroup(t.title,e)}):(e=o(r,null))&&i.addItem(e))});var a=i.toFormats();v.fire("addStyleModifications",{items:a,replace:!v.getParam("importcss_append")})})}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=t("string"),f=t("array"),_=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),m=tinymce.util.Tools.resolve("tinymce.EditorManager"),p=tinymce.util.Tools.resolve("tinymce.Env"),x=tinymce.util.Tools.resolve("tinymce.util.Tools"),P=Array.prototype.push,T=/^\.(?:ephox|tiny-pageembed|mce)(?:[.-]+\w+)+$/;e.add("importcss",function(t){return r(t),e=t,{convertSelectorToFormat:function(t){return h(e,t)}};var e})}();
4
+ !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(s=r=e,(o=String).prototype.isPrototypeOf(s)||(null===(n=r.constructor)||void 0===n?void 0:n.name)===o.name)?"string":t;var s,r,o,n})(t)===e,s=t("string"),r=t("object"),o=t("array"),n=("function",e=>"function"==typeof e);var c=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),i=tinymce.util.Tools.resolve("tinymce.EditorManager"),l=tinymce.util.Tools.resolve("tinymce.Env"),a=tinymce.util.Tools.resolve("tinymce.util.Tools");const p=e=>t=>t.options.get(e),u=p("importcss_merge_classes"),m=p("importcss_exclusive"),f=p("importcss_selector_converter"),y=p("importcss_selector_filter"),d=p("importcss_groups"),h=p("importcss_append"),_=p("importcss_file_filter"),g=p("skin"),v=p("skin_url"),b=Array.prototype.push,x=/^\.(?:ephox|tiny-pageembed|mce)(?:[.-]+\w+)+$/,T=e=>s(e)?t=>-1!==t.indexOf(e):e instanceof RegExp?t=>e.test(t):e,S=(e,t)=>{let s;const r=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(t);if(!r)return;const o=r[1],n=r[2].substr(1).split(".").join(" "),c=a.makeMap("a,img");return r[1]?(s={title:t},e.schema.getTextBlockElements()[o]?s.block=o:e.schema.getBlockElements()[o]||c[o.toLowerCase()]?s.selector=o:s.inline=o):r[2]&&(s={inline:"span",title:t.substr(1),classes:n}),u(e)?s.classes=n:s.attributes={class:n},s},k=(e,t)=>null===t||m(e),w=e=>{e.on("init",(()=>{const t=(()=>{const e=[],t=[],s={};return{addItemToGroup:(e,r)=>{s[e]?s[e].push(r):(t.push(e),s[e]=[r])},addItem:t=>{e.push(t)},toFormats:()=>{return(r=t,n=e=>{const t=s[e];return 0===t.length?[]:[{title:e,items:t}]},(e=>{const t=[];for(let s=0,r=e.length;s<r;++s){if(!o(e[s]))throw new Error("Arr.flatten item "+s+" was not an array, input: "+e);b.apply(t,e[s])}return t})(((e,t)=>{const s=e.length,r=new Array(s);for(let o=0;o<s;o++){const s=e[o];r[o]=t(s,o)}return r})(r,n))).concat(e);var r,n}}})(),r={},n=T(y(e)),p=(e=>a.map(e,(e=>a.extend({},e,{original:e,selectors:{},filter:T(e.filter)}))))(d(e)),u=(t,s)=>{if(((e,t,s,r)=>!(k(e,s)?t in r:t in s.selectors))(e,t,s,r)){((e,t,s,r)=>{k(e,s)?r[t]=!0:s.selectors[t]=!0})(e,t,s,r);const o=((e,t,s,r)=>{let o;return o=r&&r.selector_converter?r.selector_converter:f(e)?f(e):()=>S(e,s),o.call(t,s,r)})(e,e.plugins.importcss,t,s);if(o){const t=o.name||c.DOM.uniqueId();return e.formatter.register(t,o),{title:o.title,format:t}}}return null};a.each(((e,t,r)=>{const o=[],n={},c=(t,n)=>{let p,u=t.href;if(u=(e=>{const t=l.cacheSuffix;return s(e)&&(e=e.replace("?"+t,"").replace("&"+t,"")),e})(u),u&&r(u,n)&&!((e,t)=>{const s=g(e);if(s){const r=v(e),o=r?e.documentBaseURI.toAbsolute(r):i.baseURL+"/skins/ui/"+s,n=i.baseURL+"/skins/content/";return t===o+"/content"+(e.inline?".inline":"")+".min.css"||-1!==t.indexOf(n)}return!1})(e,u)){a.each(t.imports,(e=>{c(e,!0)}));try{p=t.cssRules||t.rules}catch(e){}a.each(p,(e=>{e.styleSheet?c(e.styleSheet,!0):e.selectorText&&a.each(e.selectorText.split(","),(e=>{o.push(a.trim(e))}))}))}};a.each(e.contentCSS,(e=>{n[e]=!0})),r||(r=(e,t)=>t||n[e]);try{a.each(t.styleSheets,(e=>{c(e)}))}catch(e){}return o})(e,e.getDoc(),T(_(e))),(e=>{if(!x.test(e)&&(!n||n(e))){const s=((e,t)=>a.grep(e,(e=>!e.filter||e.filter(t))))(p,e);if(s.length>0)a.each(s,(s=>{const r=u(e,s);r&&t.addItemToGroup(s.title,r)}));else{const s=u(e,null);s&&t.addItem(s)}}}));const m=t.toFormats();e.dispatch("addStyleModifications",{items:m,replace:!h(e)})}))};e.add("importcss",(e=>((e=>{const t=e.options.register,o=e=>s(e)||n(e)||r(e);t("importcss_merge_classes",{processor:"boolean",default:!0}),t("importcss_exclusive",{processor:"boolean",default:!0}),t("importcss_selector_converter",{processor:"function"}),t("importcss_selector_filter",{processor:o}),t("importcss_file_filter",{processor:o}),t("importcss_groups",{processor:"object[]"}),t("importcss_append",{processor:"boolean",default:!1})})(e),w(e),(e=>({convertSelectorToFormat:t=>S(e,t)}))(e))))}();
@@ -1,9 +1,4 @@
1
1
  /**
2
- * Copyright (c) Tiny Technologies, Inc. All rights reserved.
3
- * Licensed under the LGPL or a commercial license.
4
- * For LGPL see License.txt in the project root for license information.
5
- * For commercial licenses see https://www.tiny.cloud/
6
- *
7
- * Version: 5.10.9 (2023-11-15)
2
+ * TinyMCE version 6.0.2 (2022-04-27)
8
3
  */
9
- !function(){"use strict";function l(e){return e.getParam("insertdatetime_timeformat",e.translate("%H:%M:%S"))}function s(e){return e.getParam("insertdatetime_formats",["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"])}function r(e,t){if((e=""+e).length<t)for(var n=0;n<t-e.length;n++)e="0"+e;return e}function d(e,t,n){return void 0===n&&(n=new Date),(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+n.getFullYear())).replace("%y",""+n.getYear())).replace("%m",r(n.getMonth()+1,2))).replace("%d",r(n.getDate(),2))).replace("%H",""+r(n.getHours(),2))).replace("%M",""+r(n.getMinutes(),2))).replace("%S",""+r(n.getSeconds(),2))).replace("%I",""+((n.getHours()+11)%12+1))).replace("%p",n.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(u[n.getMonth()]))).replace("%b",""+e.translate(o[n.getMonth()]))).replace("%A",""+e.translate(i[n.getDay()]))).replace("%a",""+e.translate(a[n.getDay()]))).replace("%%","%")}function p(e,t){var n,r,a,i,o,u;e.getParam("insertdatetime_element",!1)?(n=d(e,t),r=/%[HMSIp]/.test(t)?d(e,"%Y-%m-%dT%H:%M"):d(e,"%Y-%m-%d"),(a=e.dom.getParent(e.selection.getStart(),"time"))?(o=a,u=(i=e).dom.create("time",{datetime:r},n),o.parentNode.insertBefore(u,o),i.dom.remove(o),i.selection.select(u,!0),i.selection.collapse(!1)):e.insertContent('<time datetime="'+r+'">'+n+"</time>")):e.insertContent(d(e,t))}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),i="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),o="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),u="January February March April May June July August September October November December".split(" "),g=tinymce.util.Tools.resolve("tinymce.util.Tools");e.add("insertdatetime",function(e){var n,r,t,a,i,o,u,c;function m(e){return r.execCommand("mceInsertDate",!1,e)}(n=e).addCommand("mceInsertDate",function(e,t){p(n,null!=t?t:n.getParam("insertdatetime_dateformat",n.translate("%Y-%m-%d")))}),n.addCommand("mceInsertTime",function(e,t){p(n,null!=t?t:l(n))}),u=s(r=e),t=0<(o=s(i=r)).length?o[0]:l(i),a=t,c={get:function(){return a},set:function(e){a=e}},r.ui.registry.addSplitButton("insertdatetime",{icon:"insert-time",tooltip:"Insert date/time",select:function(e){return e===c.get()},fetch:function(e){e(g.map(u,function(e){return{type:"choiceitem",text:d(r,e),value:e}}))},onAction:function(e){m(c.get())},onItemAction:function(e,t){c.set(t),m(t)}}),r.ui.registry.addNestedMenuItem("insertdatetime",{icon:"insert-time",text:"Date/time",getSubmenuItems:function(){return g.map(u,function(e){return{type:"menuitem",text:d(r,e),onAction:(t=e,function(){c.set(t),m(t)})};var t})}})})}();
4
+ !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>t.options.get(e),r=t("insertdatetime_dateformat"),a=t("insertdatetime_timeformat"),n=t("insertdatetime_formats"),s=t("insertdatetime_element"),i="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),o="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),l="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),m="January February March April May June July August September October November December".split(" "),c=(e,t)=>{if((e=""+e).length<t)for(let r=0;r<t-e.length;r++)e="0"+e;return e},d=(e,t,r=new Date)=>(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+r.getFullYear())).replace("%y",""+r.getYear())).replace("%m",c(r.getMonth()+1,2))).replace("%d",c(r.getDate(),2))).replace("%H",""+c(r.getHours(),2))).replace("%M",""+c(r.getMinutes(),2))).replace("%S",""+c(r.getSeconds(),2))).replace("%I",""+((r.getHours()+11)%12+1))).replace("%p",r.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(m[r.getMonth()]))).replace("%b",""+e.translate(l[r.getMonth()]))).replace("%A",""+e.translate(o[r.getDay()]))).replace("%a",""+e.translate(i[r.getDay()]))).replace("%%","%"),u=(e,t)=>{if(s(e)){const r=d(e,t);let a;a=/%[HMSIp]/.test(t)?d(e,"%Y-%m-%dT%H:%M"):d(e,"%Y-%m-%d");const n=e.dom.getParent(e.selection.getStart(),"time");n?((e,t,r,a)=>{const n=e.dom.create("time",{datetime:r},a);t.parentNode.insertBefore(n,t),e.dom.remove(t),e.selection.select(n,!0),e.selection.collapse(!1)})(e,n,a,r):e.insertContent('<time datetime="'+a+'">'+r+"</time>")}else e.insertContent(d(e,t))};var p=tinymce.util.Tools.resolve("tinymce.util.Tools");e.add("insertdatetime",(e=>{(e=>{const t=e.options.register;t("insertdatetime_dateformat",{processor:"string",default:e.translate("%Y-%m-%d")}),t("insertdatetime_timeformat",{processor:"string",default:e.translate("%H:%M:%S")}),t("insertdatetime_formats",{processor:"string[]",default:["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"]}),t("insertdatetime_element",{processor:"boolean",default:!1})})(e),(e=>{e.addCommand("mceInsertDate",((t,a)=>{u(e,null!=a?a:r(e))})),e.addCommand("mceInsertTime",((t,r)=>{u(e,null!=r?r:a(e))}))})(e),(e=>{const t=n(e),r=(e=>{let t=e;return{get:()=>t,set:e=>{t=e}}})((e=>{const t=n(e);return t.length>0?t[0]:a(e)})(e)),s=t=>e.execCommand("mceInsertDate",!1,t);e.ui.registry.addSplitButton("insertdatetime",{icon:"insert-time",tooltip:"Insert date/time",select:e=>e===r.get(),fetch:r=>{r(p.map(t,(t=>({type:"choiceitem",text:d(e,t),value:t}))))},onAction:e=>{s(r.get())},onItemAction:(e,t)=>{r.set(t),s(t)}});const i=e=>()=>{r.set(e),s(e)};e.ui.registry.addNestedMenuItem("insertdatetime",{icon:"insert-time",text:"Date/time",getSubmenuItems:()=>p.map(t,(t=>({type:"menuitem",text:d(e,t),onAction:i(t)})))})})(e)}))}();
@@ -1,9 +1,4 @@
1
1
  /**
2
- * Copyright (c) Tiny Technologies, Inc. All rights reserved.
3
- * Licensed under the LGPL or a commercial license.
4
- * For LGPL see License.txt in the project root for license information.
5
- * For commercial licenses see https://www.tiny.cloud/
6
- *
7
- * Version: 5.10.9 (2023-11-15)
2
+ * TinyMCE version 6.0.2 (2022-04-27)
8
3
  */
9
- !function(){"use strict";function t(r){return function(t){return e=typeof(n=t),(null===n?"null":"object"==e&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"==e&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":e)===r;var n,e}}function n(n){return function(t){return typeof t===n}}function h(){}function i(t){return function(){return t}}function e(t){return t}function r(t,n){return t===n}function o(){return v}var u,a=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=tinymce.util.Tools.resolve("tinymce.util.VK"),l=t("string"),d=t("array"),p=function(t){return u===t},f=n("boolean"),s=n("function"),m=i(!1),g=i(!(u=null)),v={fold:function(t,n){return t()},isSome:m,isNone:g,getOr:e,getOrThunk:y,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:e,orThunk:y,map:o,each:h,bind:o,exists:m,forall:g,filter:function(){return v},toArray:function(){return[]},toString:i("none()")};function y(t){return t()}function k(t,o,i){return function(t){for(var n,e=0,r=t.length;e<r;e++)n=t[e],i=o(i,n,e)}(t),i}function x(t){for(var n=[],e=0,r=t.length;e<r;++e){if(!d(t[e]))throw new Error("Arr.flatten item "+e+" was not an array, input: "+t);at.apply(n,t[e])}return n}function b(t,n){for(var e=0;e<t.length;e++){var r=n(t[e],e);if(r.isSome())return r}return it.none()}function O(t,n,e){return void 0===e&&(e=r),t.exists(function(t){return e(t,n)})}function w(t,n){return t?it.some(n):it.none()}function C(t){var n=t.getParam("link_assume_external_targets",!1);return f(n)&&n?1:!l(n)||"http"!==n&&"https"!==n?0:n}function N(t){return t.getParam("default_link_target")}function A(t){return t.getParam("target_list",!0)}function T(t){return t.getParam("rel_list",[],"array")}function P(t){return t.getParam("allow_unsafe_link_target",!1,"boolean")}function S(t){return l(t.value)?t.value:""}function _(n){return void 0===n&&(n=S),function(t){return it.from(t).map(function(t){return ct(t,n)})}}function R(t,i,u,a){return function(t){for(var n=mt(t),e=0,r=n.length;e<r;e++){var o=n[e];!function(t,n){(i(t,n)?u:a)(t,n)}(t[o],o)}}(t),1}function D(t,n){return gt.call(t,n)}function L(t){return t&&"a"===t.nodeName.toLowerCase()}function E(t){return L(t)&&!!pt(t)}function M(t,n){if(t.collapsed)return[];for(var e=t.cloneContents(),r=new dt(e.firstChild,e),o=[],i=e.firstChild;n(i)&&o.push(i),i=r.next(););return o}function U(t){return/^\w+:/i.test(t)}function B(t,n){function e(t){return t.filter(function(t){return-1===lt.inArray(o,t)})}var r,o=["noopener"],i=t?t.split(/\s+/):[],u=n?0<(r=e(r=i)).length?r.concat(o):o:e(i);return 0<u.length?lt.trim(u.sort().join(" ")):""}function I(t,n){return n=n||t.selection.getNode(),vt(n)?t.dom.select("a[href]",n)[0]:t.dom.getParent(n,"a[href]")}function K(t,n){return(n?n.innerText||n.textContent:t.getContent({format:"text"})).replace(/\uFEFF/g,"")}function z(t){return 0<lt.grep(t,E).length}function j(t){var n=t.schema.getTextInlineElements();return 0===M(t.selection.getRng(),function(t){return 1===t.nodeType&&!L(t)&&!D(n,t.nodeName.toLowerCase())}).length}function V(l,c,f){var t,n,e,r,o,i,u,s=l.selection.getNode(),m=I(l,s),g=(n=l,e=k(["title","rel","class","target"],function(n,e){return t[e].each(function(t){n[e]=0<t.length?t:null}),n},{href:(t=f).href}),u=st({},e),0<T(n).length||!1!==P(n)||(r=B(u.rel,"_blank"===u.target),u.rel=r||null),it.from(u.target).isNone()&&!1===A(n)&&(u.target=N(n)),u.href=(o=u.href,"http"!==(i=C(n))&&"https"!==i||U(o)?o:i+"://"+o),u);l.undoManager.transact(function(){var n,t,e,r,o,i,u,a;f.href===c.href&&c.attach(),m?(l.focus(),o=l,i=m,u=f.text,a=g,u.each(function(t){D(i,"innerText")?i.innerText=t:i.textContent=t}),o.dom.setAttribs(i,a),o.selection.select(i)):(n=l,e=f.text,r=g,vt(t=s)?kt(n,t,r):e.fold(function(){n.execCommand("mceInsertLink",!1,r)},function(t){n.insertContent(n.dom.createHTML("a",r,n.dom.encode(t)))}))})}function q(t,n,e){var r,o,i,u,a,l,c,f,s,m,g=(r=t,o=e.href,st(st({},e),{href:ht.isDomSafe(o,"a",r.settings)?o:""}));t.hasPlugin("rtc",!0)?t.execCommand("createlink",!1,(a=g.class,l=g.href,c=g.rel,f=g.target,s=g.text,m=g.title,R({class:a.getOrNull(),href:l,rel:c.getOrNull(),target:f.getOrNull(),text:s.getOrNull(),title:m.getOrNull()},function(t,n){return!1===p(t)},(i=u={},function(t,n){i[n]=t}),h),u)):V(t,n,g)}function F(t){var l;t.hasPlugin("rtc",!0)?t.execCommand("unlink"):(l=t).undoManager.transact(function(){var t,n,e,r,o,i,u,a=l.selection.getNode();vt(a)?yt(l,a):(n=(t=l).dom,r=(e=t.selection).getBookmark(),o=e.getRng().cloneRange(),i=n.getParent(o.startContainer,"a[href]",t.getBody()),u=n.getParent(o.endContainer,"a[href]",t.getBody()),i&&o.setStartBefore(i),u&&o.setEndAfter(u),e.setRng(o),t.execCommand("unlink"),e.moveToBookmark(r)),l.focus()})}function W(t){var n=t.href;return 0<n.indexOf("@")&&-1===n.indexOf("/")&&-1===n.indexOf("mailto:")?it.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:function(t){return st(st({},t),{href:"mailto:"+n})}}):it.none()}function H(t,n,e){var r=t.getAttrib(n,e);return null!==r&&0<r.length?it.some(r):it.none()}function G(d){var t,n=I(t=d);Tt(t,n).then(function(t){var n,e,i,u,r=function(t){var e=t.getData();if(!e.url.value)return F(i),void t.close();function n(n){return it.from(e[n]).filter(function(t){return!O(u.anchor[n],t)})}var r={href:e.url.value,text:n("text"),target:n("target"),rel:n("rel"),class:n("linkClass"),title:n("title")},o={href:e.url.value,attach:void 0!==e.url.meta&&e.url.meta.attach?e.url.meta.attach:h};Ct(i,r).then(function(t){q(i,o,t)}),t.close()},o=i=d,a=(n=u=t).anchor.text.map(function(){return{name:"text",type:"input",label:"Text to display"}}).toArray(),l=n.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],c=it.from(N(o)),f=n.anchor,s={url:{value:e=f.url.getOr(""),meta:{original:{value:e}}},text:f.text.getOr(""),title:f.title.getOr(""),anchor:e,link:e,rel:f.rel.getOr(""),target:f.target.or(c).getOr(""),linkClass:f.linkClass.getOr("")},m=n.catalogs,g=bt(s,m);return{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:x([[{name:"url",type:"urlinput",filetype:"file",label:"URL"}],a,l,function(t){for(var n=[],e=function(t){n.push(t)},r=0;r<t.length;r++)t[r].each(e);return n}([m.anchor.map(ft.createUi("anchor","Anchors")),m.rels.map(ft.createUi("rel","Rel")),m.targets.map(ft.createUi("target","Open link in...")),m.link.map(ft.createUi("link","Link list")),m.classes.map(ft.createUi("linkClass","Class"))])])},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:s,onChange:function(n,t){var e=t.name;g.onChange(n.getData,{name:e}).each(function(t){n.setData(t)})},onSubmit:r}}).then(function(t){d.windowManager.open(t)})}function J(t,n){return t.dom.getParent(n,"a[href]")}function X(t){return J(t,t.selection.getStart())}function $(t,n){var e,r;n&&(e=pt(n),/^#/.test(e)?(r=t.$(e)).length&&t.selection.scrollIntoView(r[0],!0):function(t){var n=document.createElement("a");n.target="_blank",n.href=t,n.rel="noreferrer noopener";var e,r,o=document.createEvent("MouseEvents");o.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),e=n,r=o,document.body.appendChild(e),e.dispatchEvent(r),document.body.removeChild(e)}(n.href))}function Q(t){return function(){G(t)}}function Y(t){return function(){$(t,X(t))}}function Z(t,n){return t.on("NodeChange",n),function(){return t.off("NodeChange",n)}}function tt(e){return function(t){function n(){return t.setActive(!e.mode.isReadOnly()&&null!==I(e,e.selection.getNode()))}return n(),Z(e,n)}}function nt(e){return function(t){function n(){return t.setDisabled(null===I(e,e.selection.getNode()))}return n(),Z(e,n)}}function et(r){return function(n){function e(t){return z(t)||0<M(r.selection.getRng(),E).length}var t=r.dom.getParents(r.selection.getStart());return n.setDisabled(!e(t)),Z(r,function(t){return n.setDisabled(!e(t.parents))})}}function rt(t){var n=x(function(t,n){for(var e=t.length,r=new Array(e),o=0;o<e;o++){var i=t[o];r[o]=n(i,o)}return r}(t.dom.select("a:not([href])"),function(t){var n=t.name||t.id;return n?[{text:n,value:"#"+n}]:[]}));return 0<n.length?it.some([{text:"None",value:""}].concat(n)):it.none()}var ot=function(e){function t(){return o}function n(t){return t(e)}var r=i(e),o={fold:function(t,n){return n(e)},isSome:g,isNone:m,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:t,orThunk:t,map:function(t){return ot(t(e))},each:function(t){t(e)},bind:n,exists:n,forall:n,filter:function(t){return t(e)?o:v},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},it={some:ot,none:o,from:function(t){return null==t?v:ot(t)}},ut=Array.prototype.indexOf,at=Array.prototype.push,lt=tinymce.util.Tools.resolve("tinymce.util.Tools"),ct=function(t,i){var u=[];return lt.each(t,function(t){var n,e,r,o=l((n=t).text)?n.text:l(n.title)?n.title:"";void 0!==t.menu?(e=ct(t.menu,i),u.push({text:o,items:e})):(r=i(t),u.push({text:o,value:r}))}),u},ft={sanitize:function(t){return _(S)(t)},sanitizeWith:_,createUi:function(n,e){return function(t){return{name:n,type:"listbox",label:e,items:t}}},getValue:S},st=function(){return(st=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)},mt=Object.keys,gt=Object.hasOwnProperty,dt=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),ht=tinymce.util.Tools.resolve("tinymce.util.URI"),pt=function(t){return t.getAttribute("data-mce-href")||t.getAttribute("href")},vt=function(t){return t&&"FIGURE"===t.nodeName&&/\bimage\b/i.test(t.className)},yt=function(t,n){var e,r=t.dom.select("img",n)[0];!r||(e=t.dom.getParents(r,"a[href]",n)[0])&&(e.parentNode.insertBefore(r,e),t.dom.remove(e))},kt=function(t,n,e){var r,o=t.dom.select("img",n)[0];o&&(r=t.dom.create("a",e),o.parentNode.insertBefore(r,o),r.appendChild(o))},xt=function(e,t){return b(t,function(t){return D(n=t,"items")&&void 0!==n.items&&null!==n.items?xt(e,t.items):w(t.value===e,t);var n})},bt=function(t,c){function f(t,n){var e,r,o,i,u,a,l=("link"===(e=n.name)?c.link:"anchor"===e?c.anchor:it.none()).getOr([]);return r=s.text,o=n.name,i=l,u=t[o],a=0<r.length,void 0!==u?xt(u,i).map(function(t){return{url:{value:t.value,meta:{text:a?r:t.text,attach:h}},text:a?r:t.text}}):it.none()}var s={text:t.text,title:t.title};return{onChange:function(t,n){var e,r,o,i,u,a,l=n.name;return"url"===l?(r=t(),o=r.url,u=w(s.text.length<=0,it.from(o.meta.text).getOr(o.value)),i=r.url,a=w(s.title.length<=0,it.from(i.meta.title).getOr("")),u.isSome()||a.isSome()?it.some(st(st({},u.map(function(t){return{text:t}}).getOr({})),a.map(function(t){return{title:t}}).getOr({}))):it.none()):(e=["anchor","link"],-1<ut.call(e,l)?f(t(),n):("text"!==l&&"title"!==l||(s[l]=t()[l]),it.none()))}}},Ot=tinymce.util.Tools.resolve("tinymce.util.Delay"),wt=tinymce.util.Tools.resolve("tinymce.util.Promise"),Ct=function(u,a){return b([W,(e=C(u),r=u.getParam("link_default_protocol","http","string"),function(t){var n=t.href;return 1===e&&!U(n)||0===e&&/^\s*www(\.|\d\.)/i.test(n)?it.some({message:"The URL you entered seems to be an external link. Do you want to add the required "+r+":// prefix?",preprocess:function(t){return st(st({},t),{href:r+"://"+n})}}):it.none()})],function(t){return t(a)}).fold(function(){return wt.resolve(a)},function(i){return new wt(function(n){var e=u,t=i.message,r=function(t){n(t?i.preprocess(a):a)},o=e.selection.getRng();Ot.setEditorTimeout(e,function(){e.windowManager.confirm(t,function(t){e.selection.setRng(o),r(t)})})})});var e,r},Nt=tinymce.util.Tools.resolve("tinymce.util.XHR"),At=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],Tt=function(m,g){return t=(e=m).getParam("link_list"),new wt(function(n){l(t)?Nt.send({url:t,success:function(t){return n(function(t){try{return it.some(JSON.parse(t))}catch(t){return it.none()}}(t))},error:function(t){return n(it.none())}}):s(t)?t(function(t){return n(it.some(t))}):n(it.from(t))}).then(function(t){return t.bind(ft.sanitizeWith(n)).map(function(t){return 0<t.length?[{text:"None",value:""}].concat(t):t})}).then(function(t){var n,e,r,o,i,u,a,l,c,f,s=(e=g,r=(n=m).dom,o=j(n)?it.some(K(n.selection,e)):it.none(),i=e?it.some(r.getAttrib(e,"href")):it.none(),u=e?it.from(r.getAttrib(e,"target")):it.none(),a=H(r,e,"rel"),l=H(r,e,"class"),{url:i,text:o,title:H(r,e,"title"),target:u,rel:a,linkClass:l});return{anchor:s,catalogs:{targets:(f=A(m),d(f)?ft.sanitize(f).orThunk(function(){return it.some(At)}):!1===f?it.none():it.some(At)),rels:function(t,n){var e=T(t);if(0<e.length){var r=O(n,"_blank");return(!1===P(t)?ft.sanitizeWith(function(t){return B(ft.getValue(t),r)}):ft.sanitize)(e)}return it.none()}(m,s.target),classes:0<(c=m.getParam("link_class_list",[],"array")).length?ft.sanitize(c):it.none(),anchor:rt(m),link:t},optNode:it.from(g),flags:{titleEnabled:m.getParam("link_title",!0,"boolean")}}});function n(t){return e.convertURL(t.value||t.url,"href")}var e,t};a.add("link",function(t){var n,e,r,o,i,u,a;function l(t){var n=a.selection.getNode();return t.setDisabled(!I(a,n)),h}(n=t).ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:Q(n),onSetup:tt(n)}),n.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:Y(n),onSetup:nt(n)}),n.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:function(){return F(n)},onSetup:et(n)}),(e=t).ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:Y(e),onSetup:nt(e)}),e.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onAction:Q(e)}),e.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:function(){return F(e)},onSetup:et(e)}),(r=t).ui.registry.addContextMenu("link",{update:function(t){return z(r.dom.getParents(t,"a"))?"link unlink openlink":"link"}}),(a=t).ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:tt(a)},label:"Link",predicate:function(t){return!!I(a,t)&&a.getParam("link_context_toolbar",!1,"boolean")},initValue:function(){var t=I(a);return t?pt(t):""},commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:function(t){var n=a.selection.getNode();return t.setActive(!!I(a,n)),tt(a)(t)},onAction:function(t){var n=t.getValue(),e=function(t){var n=I(a),e=j(a);if(n||!e)return it.none();var r=K(a.selection,n);return it.some(0<r.length?r:t)}(n);q(a,{href:n,attach:h},{href:n,text:e,title:it.none(),rel:it.none(),target:it.none(),class:it.none()}),a.selection.collapse(!1),t.hide()}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:l,onAction:function(t){F(a),t.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:l,onAction:function(t){Y(a)(),t.hide()}}]}),(u=t).on("click",function(t){var n=J(u,t.target);n&&c.metaKeyPressed(t)&&(t.preventDefault(),$(u,n))}),u.on("keydown",function(t){var n=X(u);n&&13===t.keyCode&&!0===t.altKey&&!1===t.shiftKey&&!1===t.ctrlKey&&!1===t.metaKey&&(t.preventDefault(),$(u,n))}),(o=t).addCommand("mceLink",function(){o.getParam("link_quicklink",!1,"boolean")?o.fire("contexttoolbar-show",{toolbarKey:"quicklink"}):Q(o)()}),(i=t).addShortcut("Meta+K","",function(){i.execCommand("mceLink")})})}();
4
+ !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.util.VK");const n=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(n=o=e,(r=String).prototype.isPrototypeOf(n)||(null===(l=o.constructor)||void 0===l?void 0:l.name)===r.name)?"string":t;var n,o,r,l})(t)===e,o=e=>t=>typeof t===e,r=n("string"),l=n("object"),a=n("array"),s=(null,e=>null===e);const i=o("boolean"),c=o("function"),u=(e,t)=>{if(a(e)){for(let n=0,o=e.length;n<o;++n)if(!t(e[n]))return!1;return!0}return!1},g=()=>{},m=(e,t)=>e===t;class h{constructor(e,t){this.tag=e,this.value=t}static some(e){return new h(!0,e)}static none(){return h.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?h.some(e(this.value)):h.none()}bind(e){return this.tag?e(this.value):h.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:h.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return null==e?h.none():h.some(e)}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}h.singletonNone=new h(!1);const d=Array.prototype.indexOf,p=Array.prototype.push,f=e=>{const t=[];for(let n=0,o=e.length;n<o;++n){if(!a(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);p.apply(t,e[n])}return t},k=(e,t)=>{for(let n=0;n<e.length;n++){const o=t(e[n],n);if(o.isSome())return o}return h.none()},v=(e,t,n=m)=>e.exists((e=>n(e,t))),y=e=>{const t=[],n=e=>{t.push(e)};for(let t=0;t<e.length;t++)e[t].each(n);return t},x=(e,t)=>e?h.some(t):h.none(),_=e=>t=>t.options.get(e),b=_("link_assume_external_targets"),w=_("link_context_toolbar"),C=_("link_list"),O=_("link_default_target"),N=_("link_default_protocol"),A=_("link_target_list"),T=_("link_rel_list"),S=_("link_class_list"),E=_("link_title"),R=_("allow_unsafe_link_target"),P=_("link_quicklink");var L=tinymce.util.Tools.resolve("tinymce.util.Tools");const M=e=>r(e.value)?e.value:"",D=(e,t)=>{const n=[];return L.each(e,(e=>{const o=(e=>r(e.text)?e.text:r(e.title)?e.title:"")(e);if(void 0!==e.menu){const r=D(e.menu,t);n.push({text:o,items:r})}else{const r=t(e);n.push({text:o,value:r})}})),n},B=(e=M)=>t=>h.from(t).map((t=>D(t,e))),I=e=>B(M)(e),j=B,K=(e,t)=>n=>({name:e,type:"listbox",label:t,items:n}),U=M,q=Object.keys,F=Object.hasOwnProperty,V=(e,t)=>F.call(e,t);var $=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),z=tinymce.util.Tools.resolve("tinymce.util.URI");const G=e=>e&&"a"===e.nodeName.toLowerCase(),H=e=>G(e)&&!!Q(e),J=(e,t)=>{if(e.collapsed)return[];{const n=e.cloneContents(),o=new $(n.firstChild,n),r=[];let l=n.firstChild;do{t(l)&&r.push(l)}while(l=o.next());return r}},W=e=>/^\w+:/i.test(e),Q=e=>e.getAttribute("data-mce-href")||e.getAttribute("href"),X=(e,t)=>{const n=["noopener"],o=e?e.split(/\s+/):[],r=e=>e.filter((e=>-1===L.inArray(n,e))),l=t?(e=>(e=r(e)).length>0?e.concat(n):n)(o):r(o);return l.length>0?(e=>L.trim(e.sort().join(" ")))(l):""},Y=(e,t)=>(t=t||e.selection.getNode(),ne(t)?e.dom.select("a[href]",t)[0]:e.dom.getParent(t,"a[href]")),Z=(e,t)=>(t?t.innerText||t.textContent:e.getContent({format:"text"})).replace(/\uFEFF/g,""),ee=e=>L.grep(e,H).length>0,te=e=>{const t=e.schema.getTextInlineElements();return 0===J(e.selection.getRng(),(e=>1===e.nodeType&&!G(e)&&!V(t,e.nodeName.toLowerCase()))).length},ne=e=>e&&"FIGURE"===e.nodeName&&/\bimage\b/i.test(e.className),oe=(e,t,n)=>{const o=e.selection.getNode(),r=Y(e,o),l=((e,t)=>{const n={...t};if(0===T(e).length&&!R(e)){const e=X(n.rel,"_blank"===n.target);n.rel=e||null}return h.from(n.target).isNone()&&!1===A(e)&&(n.target=O(e)),n.href=((e,t)=>"http"!==t&&"https"!==t||W(e)?e:t+"://"+e)(n.href,b(e)),n})(e,(e=>{return t=["title","rel","class","target"],n=(t,n)=>(e[n].each((e=>{t[n]=e.length>0?e:null})),t),o={href:e.href},((e,t)=>{for(let n=0,o=e.length;n<o;n++)t(e[n],n)})(t,((e,t)=>{o=n(o,e)})),o;var t,n,o})(n));e.undoManager.transact((()=>{n.href===t.href&&t.attach(),r?(e.focus(),((e,t,n,o)=>{n.each((e=>{V(t,"innerText")?t.innerText=e:t.textContent=e})),e.dom.setAttribs(t,o),e.selection.select(t)})(e,r,n.text,l)):((e,t,n,o)=>{ne(t)?ie(e,t,o):n.fold((()=>{e.execCommand("mceInsertLink",!1,o)}),(t=>{e.insertContent(e.dom.createHTML("a",o,e.dom.encode(t)))}))})(e,o,n.text,l)}))},re=e=>{const{class:t,href:n,rel:o,target:r,text:l,title:a}=e;return((e,t)=>{const n={};var o;return((e,t,n,o)=>{((e,t)=>{const n=q(e);for(let o=0,r=n.length;o<r;o++){const r=n[o];t(e[r],r)}})(e,((e,r)=>{(t(e,r)?n:o)(e,r)}))})(e,((e,t)=>!1===s(e)),(o=n,(e,t)=>{o[t]=e}),g),n})({class:t.getOrNull(),href:n,rel:o.getOrNull(),target:r.getOrNull(),text:l.getOrNull(),title:a.getOrNull()})},le=(e,t,n)=>{const o=((e,t)=>{const n=e.options.get,o={allow_html_data_urls:n("allow_html_data_urls"),allow_script_urls:n("allow_script_urls"),allow_svg_data_urls:n("allow_svg_data_urls")},r=t.href;return{...t,href:z.isDomSafe(r,"a",o)?r:""}})(e,n);e.hasPlugin("rtc",!0)?e.execCommand("createlink",!1,re(o)):oe(e,t,o)},ae=e=>{e.hasPlugin("rtc",!0)?e.execCommand("unlink"):(e=>{e.undoManager.transact((()=>{const t=e.selection.getNode();ne(t)?se(e,t):(e=>{const t=e.dom,n=e.selection,o=n.getBookmark(),r=n.getRng().cloneRange(),l=t.getParent(r.startContainer,"a[href]",e.getBody()),a=t.getParent(r.endContainer,"a[href]",e.getBody());l&&r.setStartBefore(l),a&&r.setEndAfter(a),n.setRng(r),e.execCommand("unlink"),n.moveToBookmark(o)})(e),e.focus()}))})(e)},se=(e,t)=>{const n=e.dom.select("img",t)[0];if(n){const o=e.dom.getParents(n,"a[href]",t)[0];o&&(o.parentNode.insertBefore(n,o),e.dom.remove(o))}},ie=(e,t,n)=>{const o=e.dom.select("img",t)[0];if(o){const t=e.dom.create("a",n);o.parentNode.insertBefore(t,o),t.appendChild(o)}},ce=(e,t)=>k(t,(t=>(e=>{return V(t=e,n="items")&&void 0!==t[n]&&null!==t[n];var t,n})(t)?ce(e,t.items):x(t.value===e,t))),ue=(e,t)=>{const n={text:e.text,title:e.title},o=(e,o)=>{const r=(l=t,a=o.name,"link"===a?l.link:"anchor"===a?l.anchor:h.none()).getOr([]);var l,a;return((e,t,n,o)=>{const r=o[t],l=e.length>0;return void 0!==r?ce(r,n).map((t=>({url:{value:t.value,meta:{text:l?e:t.text,attach:g}},text:l?e:t.text}))):h.none()})(n.text,o.name,r,e)};return{onChange:(e,t)=>{const r=t.name;return"url"===r?(e=>{const t=(o=e.url,x(n.text.length<=0,h.from(o.meta.text).getOr(o.value)));var o;const r=(e=>x(n.title.length<=0,h.from(e.meta.title).getOr("")))(e.url);return t.isSome()||r.isSome()?h.some({...t.map((e=>({text:e}))).getOr({}),...r.map((e=>({title:e}))).getOr({})}):h.none()})(e()):((e,t)=>d.call(e,t))(["anchor","link"],r)>-1?o(e(),t):"text"===r||"title"===r?(n[r]=e()[r],h.none()):h.none()}}};var ge=tinymce.util.Tools.resolve("tinymce.util.Delay");const me=e=>{const t=e.href;return t.indexOf("@")>0&&-1===t.indexOf("/")&&-1===t.indexOf("mailto:")?h.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:e=>({...e,href:"mailto:"+t})}):h.none()},he=(e,t)=>n=>{const o=n.href;return 1===e&&!W(o)||0===e&&/^\s*www(\.|\d\.)/i.test(o)?h.some({message:`The URL you entered seems to be an external link. Do you want to add the required ${t}:// prefix?`,preprocess:e=>({...e,href:t+"://"+o})}):h.none()},de=e=>{const t=e.dom.select("a:not([href])"),n=f(((e,t)=>{const n=e.length,o=new Array(n);for(let r=0;r<n;r++){const n=e[r];o[r]=t(n,r)}return o})(t,(e=>{const t=e.name||e.id;return t?[{text:t,value:"#"+t}]:[]})));return n.length>0?h.some([{text:"None",value:""}].concat(n)):h.none()},pe=e=>{const t=S(e);return t.length>0?I(t):h.none()},fe=e=>{try{return h.some(JSON.parse(e))}catch(e){return h.none()}},ke=(e,t)=>{const n=T(e);if(n.length>0){const o=v(t,"_blank"),r=e=>X(U(e),o);return(!1===R(e)?j(r):I)(n)}return h.none()},ve=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],ye=e=>{const t=A(e);return a(t)?I(t).orThunk((()=>h.some(ve))):!1===t?h.none():h.some(ve)},xe=(e,t,n)=>{const o=e.getAttrib(t,n);return null!==o&&o.length>0?h.some(o):h.none()},_e=(e,t)=>(e=>{const t=t=>e.convertURL(t.value||t.url,"href"),n=C(e);return new Promise((e=>{r(n)?fetch(n).then((e=>e.ok?e.text().then(fe):Promise.reject())).then(e,(()=>e(h.none()))):c(n)?n((t=>e(h.some(t)))):e(h.from(n))})).then((e=>e.bind(j(t)).map((e=>e.length>0?[{text:"None",value:""}].concat(e):e))))})(e).then((n=>{const o=((e,t)=>{const n=e.dom,o=te(e)?h.some(Z(e.selection,t)):h.none(),r=t?h.some(n.getAttrib(t,"href")):h.none(),l=t?h.from(n.getAttrib(t,"target")):h.none(),a=xe(n,t,"rel"),s=xe(n,t,"class");return{url:r,text:o,title:xe(n,t,"title"),target:l,rel:a,linkClass:s}})(e,t);return{anchor:o,catalogs:{targets:ye(e),rels:ke(e,o.target),classes:pe(e),anchor:de(e),link:n},optNode:h.from(t),flags:{titleEnabled:E(e)}}})),be=e=>{const t=(e=>{const t=Y(e);return _e(e,t)})(e);t.then((t=>{const n=((e,t)=>n=>{const o=n.getData();if(!o.url.value)return ae(e),void n.close();const r=e=>h.from(o[e]).filter((n=>!v(t.anchor[e],n))),l={href:o.url.value,text:r("text"),target:r("target"),rel:r("rel"),class:r("linkClass"),title:r("title")},a={href:o.url.value,attach:void 0!==o.url.meta&&o.url.meta.attach?o.url.meta.attach:g};((e,t)=>k([me,he(b(e),N(e))],(e=>e(t))).fold((()=>Promise.resolve(t)),(n=>new Promise((o=>{((e,t,n)=>{const o=e.selection.getRng();ge.setEditorTimeout(e,(()=>{e.windowManager.confirm(t,(t=>{e.selection.setRng(o),n(t)}))}))})(e,n.message,(e=>{o(e?n.preprocess(t):t)}))})))))(e,l).then((t=>{le(e,a,t)})),n.close()})(e,t);return((e,t,n)=>{const o=e.anchor.text.map((()=>({name:"text",type:"input",label:"Text to display"}))).toArray(),r=e.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],l=((e,t)=>{const n=e.anchor,o=n.url.getOr("");return{url:{value:o,meta:{original:{value:o}}},text:n.text.getOr(""),title:n.title.getOr(""),anchor:o,link:o,rel:n.rel.getOr(""),target:n.target.or(t).getOr(""),linkClass:n.linkClass.getOr("")}})(e,h.from(O(n))),a=e.catalogs,s=ue(l,a);return{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:f([[{name:"url",type:"urlinput",filetype:"file",label:"URL"}],o,r,y([a.anchor.map(K("anchor","Anchors")),a.rels.map(K("rel","Rel")),a.targets.map(K("target","Open link in...")),a.link.map(K("link","Link list")),a.classes.map(K("linkClass","Class"))])])},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:l,onChange:(e,{name:t})=>{s.onChange(e.getData,{name:t}).each((t=>{e.setData(t)}))},onSubmit:t}})(t,n,e)})).then((t=>{e.windowManager.open(t)}))},we=(e,t)=>e.dom.getParent(t,"a[href]"),Ce=e=>we(e,e.selection.getStart()),Oe=(e,t)=>{if(t){const n=Q(t);if(/^#/.test(n)){const t=e.dom.select(n);t.length&&e.selection.scrollIntoView(t[0],!0)}else(e=>{const t=document.createElement("a");t.target="_blank",t.href=e,t.rel="noreferrer noopener";const n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),((e,t)=>{document.body.appendChild(e),e.dispatchEvent(t),document.body.removeChild(e)})(t,n)})(t.href)}},Ne=e=>()=>{be(e)},Ae=e=>()=>{Oe(e,Ce(e))},Te=(e,t)=>(e.on("NodeChange",t),()=>e.off("NodeChange",t)),Se=e=>t=>{const n=()=>t.setActive(!e.mode.isReadOnly()&&null!==Y(e,e.selection.getNode()));return n(),Te(e,n)},Ee=e=>t=>{const n=()=>t.setEnabled(null!==Y(e,e.selection.getNode()));return n(),Te(e,n)},Re=e=>t=>{const n=t=>{return ee(t)||(n=e.selection.getRng(),J(n,H).length>0);var n},o=e.dom.getParents(e.selection.getStart());return t.setEnabled(n(o)),Te(e,(e=>t.setEnabled(n(e.parents))))};e.add("link",(e=>{(e=>{const t=e.options.register;t("link_assume_external_targets",{processor:e=>{const t=r(e)||i(e);return t?!0===e?{value:1,valid:t}:"http"===e||"https"===e?{value:e,valid:t}:{value:0,valid:t}:{valid:!1,message:"Must be a string or a boolean."}},default:!1}),t("link_context_toolbar",{processor:"boolean",default:!1}),t("link_list",{processor:e=>r(e)||c(e)||u(e,l)}),t("link_default_target",{processor:"string"}),t("link_default_protocol",{processor:"string",default:"https"}),t("link_target_list",{processor:e=>i(e)||u(e,l),default:!0}),t("link_rel_list",{processor:"object[]",default:[]}),t("link_class_list",{processor:"object[]",default:[]}),t("link_title",{processor:"boolean",default:!0}),t("allow_unsafe_link_target",{processor:"boolean",default:!1}),t("link_quicklink",{processor:"boolean",default:!1})})(e),(e=>{e.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:Ne(e),onSetup:Se(e)}),e.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:Ae(e),onSetup:Ee(e)}),e.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:()=>ae(e),onSetup:Re(e)})})(e),(e=>{e.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:Ae(e),onSetup:Ee(e)}),e.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onAction:Ne(e)}),e.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:()=>ae(e),onSetup:Re(e)})})(e),(e=>{e.ui.registry.addContextMenu("link",{update:t=>ee(e.dom.getParents(t,"a"))?"link unlink openlink":"link"})})(e),(e=>{const t=t=>{const n=e.selection.getNode();return t.setEnabled(null!==Y(e,n)),g};e.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:Se(e)},label:"Link",predicate:t=>!!Y(e,t)&&w(e),initValue:()=>{const t=Y(e);return t?Q(t):""},commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:t=>{const n=e.selection.getNode();return t.setActive(!!Y(e,n)),Se(e)(t)},onAction:t=>{const n=t.getValue(),o=(t=>{const n=Y(e),o=te(e);if(!n&&o){const o=Z(e.selection,n);return h.some(o.length>0?o:t)}return h.none()})(n);le(e,{href:n,attach:g},{href:n,text:o,title:h.none(),rel:h.none(),target:h.none(),class:h.none()}),(e=>{e.selection.collapse(!1)})(e),t.hide()}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:t,onAction:t=>{ae(e),t.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:t,onAction:t=>{Ae(e)(),t.hide()}}]})})(e),(e=>{e.on("click",(n=>{const o=we(e,n.target);o&&t.metaKeyPressed(n)&&(n.preventDefault(),Oe(e,o))})),e.on("keydown",(t=>{const n=Ce(e);n&&13===t.keyCode&&(e=>!0===e.altKey&&!1===e.shiftKey&&!1===e.ctrlKey&&!1===e.metaKey)(t)&&(t.preventDefault(),Oe(e,n))}))})(e),(e=>{e.addCommand("mceLink",(()=>{P(e)?e.dispatch("contexttoolbar-show",{toolbarKey:"quicklink"}):Ne(e)()}))})(e),(e=>{e.addShortcut("Meta+K","",(()=>{e.execCommand("mceLink")}))})(e)}))}();