tinymce-rails 5.9.2 → 5.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/source/tinymce/tinymce.js +720 -1059
  3. data/lib/tinymce/rails/version.rb +2 -2
  4. data/vendor/assets/javascripts/tinymce/plugins/advlist/plugin.js +1 -1
  5. data/vendor/assets/javascripts/tinymce/plugins/anchor/plugin.js +1 -1
  6. data/vendor/assets/javascripts/tinymce/plugins/autolink/plugin.js +1 -1
  7. data/vendor/assets/javascripts/tinymce/plugins/autoresize/plugin.js +2 -2
  8. data/vendor/assets/javascripts/tinymce/plugins/autosave/plugin.js +1 -1
  9. data/vendor/assets/javascripts/tinymce/plugins/bbcode/plugin.js +2 -2
  10. data/vendor/assets/javascripts/tinymce/plugins/charmap/plugin.js +1 -1
  11. data/vendor/assets/javascripts/tinymce/plugins/code/plugin.js +1 -1
  12. data/vendor/assets/javascripts/tinymce/plugins/codesample/plugin.js +2 -2
  13. data/vendor/assets/javascripts/tinymce/plugins/colorpicker/plugin.js +2 -2
  14. data/vendor/assets/javascripts/tinymce/plugins/contextmenu/plugin.js +2 -2
  15. data/vendor/assets/javascripts/tinymce/plugins/directionality/plugin.js +1 -1
  16. data/vendor/assets/javascripts/tinymce/plugins/emoticons/plugin.js +1 -1
  17. data/vendor/assets/javascripts/tinymce/plugins/fullpage/plugin.js +2 -2
  18. data/vendor/assets/javascripts/tinymce/plugins/fullscreen/plugin.js +2 -2
  19. data/vendor/assets/javascripts/tinymce/plugins/help/plugin.js +2 -2
  20. data/vendor/assets/javascripts/tinymce/plugins/hr/plugin.js +1 -1
  21. data/vendor/assets/javascripts/tinymce/plugins/image/plugin.js +2 -2
  22. data/vendor/assets/javascripts/tinymce/plugins/imagetools/plugin.js +2 -2
  23. data/vendor/assets/javascripts/tinymce/plugins/importcss/plugin.js +1 -1
  24. data/vendor/assets/javascripts/tinymce/plugins/insertdatetime/plugin.js +2 -2
  25. data/vendor/assets/javascripts/tinymce/plugins/legacyoutput/plugin.js +2 -2
  26. data/vendor/assets/javascripts/tinymce/plugins/link/plugin.js +2 -2
  27. data/vendor/assets/javascripts/tinymce/plugins/lists/plugin.js +2 -2
  28. data/vendor/assets/javascripts/tinymce/plugins/media/plugin.js +2 -2
  29. data/vendor/assets/javascripts/tinymce/plugins/nonbreaking/plugin.js +1 -1
  30. data/vendor/assets/javascripts/tinymce/plugins/noneditable/plugin.js +1 -1
  31. data/vendor/assets/javascripts/tinymce/plugins/pagebreak/plugin.js +1 -1
  32. data/vendor/assets/javascripts/tinymce/plugins/paste/plugin.js +2 -2
  33. data/vendor/assets/javascripts/tinymce/plugins/preview/plugin.js +1 -1
  34. data/vendor/assets/javascripts/tinymce/plugins/print/plugin.js +1 -1
  35. data/vendor/assets/javascripts/tinymce/plugins/quickbars/plugin.js +1 -1
  36. data/vendor/assets/javascripts/tinymce/plugins/save/plugin.js +1 -1
  37. data/vendor/assets/javascripts/tinymce/plugins/searchreplace/plugin.js +1 -1
  38. data/vendor/assets/javascripts/tinymce/plugins/spellchecker/plugin.js +2 -2
  39. data/vendor/assets/javascripts/tinymce/plugins/tabfocus/plugin.js +1 -1
  40. data/vendor/assets/javascripts/tinymce/plugins/table/plugin.js +2 -2
  41. data/vendor/assets/javascripts/tinymce/plugins/template/plugin.js +1 -1
  42. data/vendor/assets/javascripts/tinymce/plugins/textcolor/plugin.js +2 -2
  43. data/vendor/assets/javascripts/tinymce/plugins/textpattern/plugin.js +2 -2
  44. data/vendor/assets/javascripts/tinymce/plugins/toc/plugin.js +1 -1
  45. data/vendor/assets/javascripts/tinymce/plugins/visualblocks/plugin.js +1 -1
  46. data/vendor/assets/javascripts/tinymce/plugins/visualchars/plugin.js +1 -1
  47. data/vendor/assets/javascripts/tinymce/plugins/wordcount/plugin.js +1 -1
  48. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.css +1 -1
  49. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.inline.css +1 -1
  50. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.inline.min.css +1 -1
  51. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.min.css +1 -1
  52. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.css +1 -1
  53. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.min.css +1 -1
  54. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.shadowdom.css +1 -1
  55. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.shadowdom.min.css +1 -1
  56. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.css +1 -1
  57. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.inline.css +1 -1
  58. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.inline.min.css +1 -1
  59. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.min.css +1 -1
  60. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.css +1 -1
  61. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.min.css +1 -1
  62. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +1 -1
  63. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +1 -1
  64. data/vendor/assets/javascripts/tinymce/themes/mobile/theme.js +2 -2
  65. data/vendor/assets/javascripts/tinymce/themes/silver/theme.js +2 -2
  66. data/vendor/assets/javascripts/tinymce/tinymce.d.ts +9 -1
  67. data/vendor/assets/javascripts/tinymce/tinymce.js +2 -2
  68. metadata +2 -2
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.9.2 (2021-09-08)
7
+ * Version: 5.10.0 (2021-10-11)
8
8
  */
9
- !function(){"use strict";function c(n){var e=n;return{get:function(){return e},set:function(n){e=n}}}function n(r){return function(n){return t=typeof(e=n),(null===e?"null":"object"==t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t)===r;var e,t}}function e(e){return function(n){return typeof n===e}}function l(n){return!(null==n)}function f(){}function u(n){return function(){return n}}function t(n){return n}var r=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=n("string"),d=n("array"),o=e("boolean"),h=e("function"),i=e("number");function s(){return p}var g=u(!1),m=u(!0),p={fold:function(n,e){return n()},isSome:g,isNone:m,getOr:t,getOrThunk:v,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(void 0),or:t,orThunk:v,map:s,each:f,bind:s,exists:g,forall:m,filter:function(){return p},toArray:function(){return[]},toString:u("none()")};function v(n){return n()}function y(n){function e(){return t.get().each(n)}var t=c(C.none());return{clear:function(){e(),t.set(C.none())},isSet:function(){return t.get().isSome()},get:function(){return t.get()},set:function(n){e(),t.set(C.some(n))}}}function w(){return y(function(n){return n.unbind()})}function O(n,e){for(var t=n.length,r=new Array(t),o=0;o<t;o++){var u=n[o];r[o]=e(u,o)}return r}function A(n,e){for(var t=0,r=n.length;t<r;t++)e(n[t],t)}function b(n,e){for(var t=[],r=0,o=n.length;r<o;r++){var u=n[r];e(u,r)&&t.push(u)}return t}function S(n){return void 0!==n.style&&h(n.style.getPropertyValue)}function E(n){if(null==n)throw new Error("Node cannot be null or undefined");return{dom:n}}var T=function(t){function n(){return o}function e(n){return n(t)}var r=u(t),o={fold:function(n,e){return e(t)},isSome:m,isNone:g,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:n,orThunk:n,map:function(n){return T(n(t))},each:function(n){n(t)},bind:e,exists:e,forall:e,filter:function(n){return n(t)?o:p},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},C={some:T,none:s,from:function(n){return null==n?p:T(n)}},F=function(){return(F=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}).apply(this,arguments)},x=Array.prototype.push,D=Object.keys,M={fromHtml:function(n,e){var t=(e||document).createElement("div");if(t.innerHTML=n,!t.hasChildNodes()||1<t.childNodes.length)throw console.error("HTML does not have a single root node",n),new Error("HTML must have a single root node");return E(t.childNodes[0])},fromTag:function(n,e){var t=(e||document).createElement(n);return E(t)},fromText:function(n,e){var t=(e||document).createTextNode(n);return E(t)},fromDom:E,fromPoint:function(n,e,t){return C.from(n.dom.elementFromPoint(e,t)).map(E)}};function k(e){return function(n){return n.dom.nodeType===e}}function N(n,e){var t=n.dom;if(1!==t.nodeType)return!1;var r=t;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")}function P(n){return M.fromDom(n.dom.ownerDocument)}function L(n){var e,t=on(n);return nn(e=t)&&l(e.dom.host)?C.some(t):C.none()}function H(n){return M.fromDom(n.dom.host)}function q(n,e,t){!function(n,e,t){if(!(a(t)||o(t)||i(t)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",t,":: Element ",n),new Error("Attribute value was not simple");n.setAttribute(e,t+"")}(n.dom,e,t)}function R(n,e){var t=n.dom.getAttribute(e);return null===t?void 0:t}function V(n,e){n.dom.removeAttribute(e)}function j(n,e){var i=n.dom;!function(n){for(var e,t=D(n),r=0,o=t.length;r<o;r++){var u=t[r];e=n[u],function(n,e,t){if(!a(t))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",t,":: Element ",n),new Error("CSS value must be a string: "+t);S(n)&&n.style.setProperty(e,t)}(i,u,e)}}(e)}function W(n){function e(){return n.stopPropagation()}function t(){return n.preventDefault()}var r,o,u=M.fromDom(function(n){if(rn()&&l(n.target)){var e=M.fromDom(n.target);if(Q(e)&&un(e)&&n.composed&&n.composedPath){var t=n.composedPath();if(t)return 0<(r=t).length?C.some(r[0]):C.none()}}var r;return C.from(n.target)}(n).getOr(n.target)),i=(r=t,o=e,function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return r(o.apply(null,n))});return{target:u,x:n.clientX,y:n.clientY,stop:e,prevent:t,kill:i,raw:n}}function B(n,e,t){return o=e,u=!1,i=an,l=t,c=function(n){i(n)&&l(W(n))},(r=n).dom.addEventListener(o,c,u),{unbind:function(r){for(var o=[],n=1;n<arguments.length;n++)o[n-1]=arguments[n];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=o.concat(n);return r.apply(null,t)}}(fn,r,o,c,u)};var r,o,u,i,l,c}function z(n){var e=void 0===n?window:n;return C.from(e.visualViewport)}function I(n,e,t,r){return{x:n,y:e,width:t,height:r,right:n+t,bottom:e+r}}function U(t,r,n){return z(n).map(function(n){function e(n){return r(W(n))}return n.addEventListener(t,e),{unbind:function(){return n.removeEventListener(t,e)}}}).getOrThunk(function(){return{unbind:f}})}function K(n,e){n.fire("FullscreenStateChanged",{state:e})}function X(n){return n.getParam("fullscreen_native",!1,"boolean")}function Y(n){return n.dom===(void 0!==(e=P(n).dom).fullscreenElement?e.fullscreenElement:void 0!==e.msFullscreenElement?e.msFullscreenElement:void 0!==e.webkitFullscreenElement?e.webkitFullscreenElement:null);var e}function _(n,e){return r=function(n){return N(n,e)},b((t=n,C.from(t.dom.parentNode).map(M.fromDom).map(en).map(function(n){return b(n,function(n){return t.dom!==n.dom})}).getOr([])),r);var t,r}function G(o,n,e){function t(r){return function(n){var e=R(n,"style"),t=void 0===e?"no-styles":e.trim();t===r||(q(n,pn,t),j(n,o.parseStyle(r)))}}var r,u,i,l,c,f,a=(f=function(n){return N(n,"*")},b(function(n,e){for(var t=h(e)?e:g,r=n.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var u=r.parentNode,i=M.fromDom(u);if(o.push(i),!0===t(i))break;r=u}return o}(n,void 0),f)),s=function(n){for(var e=[],t=0,r=n.length;t<r;++t){if(!d(n[t]))throw new Error("Arr.flatten item "+t+" was not an array, input: "+n);x.apply(e,n[t])}return e}(O(a,function(n){return _(n,"*:not(.tox-silver-sink)")})),m=(u="background-color",i=(r=e).dom,void 0!==(c=""!==(l=window.getComputedStyle(i).getPropertyValue(u))||ln(r)?l:cn(i,u))&&""!==c?"background-color:"+c+"!important":"background-color:rgb(255,255,255)!important;");A(s,t("display:none!important;")),A(a,t(vn+yn+m)),t((!0===wn?"":vn)+yn+m)(n)}function J(t,r){return function(e){function n(n){return e.setActive(n.state)}return e.setActive(null!==r.get()),t.on("FullscreenStateChanged",n),function(){return t.off("FullscreenStateChanged",n)}}}"undefined"!=typeof window||Function("return this;")();var Q=k(1),Z=k(3),$=k(9),nn=k(11),en=function(n){return O(n.dom.childNodes,M.fromDom)},tn=h(Element.prototype.attachShadow)&&h(Node.prototype.getRootNode),rn=u(tn),on=tn?function(n){return M.fromDom(n.dom.getRootNode())}:function(n){return $(n)?n:P(n)},un=function(n){return l(n.dom.shadowRoot)},ln=function(n){var e=Z(n)?n.dom.parentNode:n.dom;if(null==e||null===e.ownerDocument)return!1;var t,r,o=e.ownerDocument;return L(M.fromDom(e)).fold(function(){return o.body.contains(e)},(t=ln,r=H,function(n){return t(r(n))}))},cn=function(n,e){return S(n)?n.style.getPropertyValue(e):""},fn=function(n,e,t,r){n.dom.removeEventListener(e,t,r)},an=m,sn=function(t,r){return{left:t,top:r,translate:function(n,e){return sn(t+n,r+e)}}},mn=sn,dn=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),hn=tinymce.util.Tools.resolve("tinymce.Env"),gn=tinymce.util.Tools.resolve("tinymce.util.Delay"),pn="data-ephox-mobile-fullscreen-style",vn="position:absolute!important;",yn="top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;height:100%!important;overflow:visible!important;",wn=hn.os.isAndroid(),bn=dn.DOM,Sn=z().fold(function(){return{bind:f,unbind:f}},function(e){var t,r=(t=y(f),F(F({},t),{on:function(n){return t.get().each(n)}})),o=w(),u=w(),i=gn.throttle(function(){document.body.scrollTop=0,document.documentElement.scrollTop=0,window.requestAnimationFrame(function(){r.on(function(n){return j(n,{top:e.offsetTop+"px",left:e.offsetLeft+"px",height:e.height+"px",width:e.width+"px"})})})},50);return{bind:function(n){r.set(n),i(),o.set(U("resize",i)),u.set(U("scroll",i))},unbind:function(){r.on(function(){o.clear(),u.clear()}),r.clear()}}}),En=function(o,u){function i(e){e(y,"tox-fullscreen"),e(w,"tox-fullscreen"),e(b,"tox-fullscreen"),L(S).map(function(n){return H(n).dom}).each(function(n){e(n,"tox-fullscreen"),e(n,"tox-shadowhost")})}function n(){var t,n,e,r;x&&(t=o.dom,n="["+pn+"]",A(1!==(e=r=document).nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount?[]:O(r.querySelectorAll(n),M.fromDom),function(n){var e=R(n,pn);"no-styles"!==e?j(n,t.parseStyle(e)):V(n,"style"),V(n,pn)})),i(bn.removeClass),Sn.unbind(),C.from(u.get()).each(function(n){return n.fullscreenChangeHandler.unbind()})}var e,t,r,l,c,f,a,s,m,d,h,g,p,v,y=document.body,w=document.documentElement,b=o.getContainer(),S=M.fromDom(b),E=L(f=M.fromDom(o.getElement())).map(H).getOrThunk(function(){var n=P(f).dom.body;if(null==n)throw new Error("Body is not available yet");return M.fromDom(n)}),T=u.get(),F=M.fromDom(o.getBody()),x=hn.deviceType.isTouch(),D=b.style,k=o.iframeElement.style;T?(T.fullscreenChangeHandler.unbind(),X(o)&&Y(E)&&((l=P(E).dom).exitFullscreen?l.exitFullscreen():l.msExitFullscreen?l.msExitFullscreen():l.webkitCancelFullScreen&&l.webkitCancelFullScreen()),k.width=T.iframeWidth,k.height=T.iframeHeight,D.width=T.containerWidth,D.height=T.containerHeight,D.top=T.containerTop,D.left=T.containerLeft,r=T.scrollPos,window.scrollTo(r.x,r.y),u.set(null),K(o,!1),n(),o.off("remove",n)):(e=B(P(E),void 0!==document.fullscreenElement?"fullscreenchange":void 0!==document.msFullscreenElement?"MSFullscreenChange":void 0!==document.webkitFullscreenElement?"webkitfullscreenchange":"fullscreenchange",function(n){X(o)&&(Y(E)||null===u.get()||En(o,u))}),t={scrollPos:(a=window,g=void 0===a?window:a,p=g.document,d=(m=void 0!==(s=M.fromDom(p))?s.dom:document).body.scrollLeft||m.documentElement.scrollLeft,h=m.body.scrollTop||m.documentElement.scrollTop,v=mn(d,h),z(g).fold(function(){var n=g.document.documentElement,e=n.clientWidth,t=n.clientHeight;return I(v.left,v.top,e,t)},function(n){return I(Math.max(n.pageLeft,v.left),Math.max(n.pageTop,v.top),n.width,n.height)})),containerWidth:D.width,containerHeight:D.height,containerTop:D.top,containerLeft:D.left,iframeWidth:k.width,iframeHeight:k.height,fullscreenChangeHandler:e},x&&G(o.dom,S,F),k.width=k.height="100%",D.width=D.height="",i(bn.addClass),Sn.bind(S),o.on("remove",n),u.set(t),X(o)&&((c=E.dom).requestFullscreen?c.requestFullscreen():c.msRequestFullscreen?c.msRequestFullscreen():c.webkitRequestFullScreen&&c.webkitRequestFullScreen()),K(o,!0))};r.add("fullscreen",function(n){var e,t,r,o,u,i=c(null);return n.inline||(t=i,(e=n).addCommand("mceFullScreen",function(){En(e,t)}),(r=n).ui.registry.addToggleMenuItem("fullscreen",{text:"Fullscreen",icon:"fullscreen",shortcut:"Meta+Shift+F",onAction:l,onSetup:J(r,o=i)}),r.ui.registry.addToggleButton("fullscreen",{tooltip:"Fullscreen",icon:"fullscreen",onAction:l,onSetup:J(r,o)}),n.addShortcut("Meta+Shift+F","","mceFullScreen")),u=i,{isFullscreen:function(){return null!==u.get()}};function l(){return r.execCommand("mceFullScreen")}})}();
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})}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,t=E.scrollPos,window.scrollTo(t.x,t.y),i.set(null),J(o,!1),e(),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,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.9.2 (2021-09-08)
7
+ * Version: 5.10.0 (2021-10-11)
8
8
  */
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"),y=function(){return(y=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 f(e){var n=m.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 m.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:function(e){for(var t=[],n=0,a=e.length;n<a;n++){var o=e[n];(function(e,t){return-1<h.call(e,t)})(r,o)||t.push(o)}return t}(i)),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: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>"+C.translate(["Plugins installed ({0}):",l])+"</b></p><ul>"+c+"</ul>")+"</div>",(t=b(["Accessibility Checker","Advanced Code Editor","Advanced Tables","Case Change","Checklist","Export","Tiny Comments","Tiny Drive","Enhanced Media Embed","Format Painter","Link Checker","Mentions","MoxieManager","Page Embed","Permanent Pen","PowerPaste","Spell Checker Pro"],function(e){return"<li>"+C.translate(e)+"</li>"}).join(""),'<div data-mce-tabstop="1" tabindex="-1"><p><b>'+C.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">'+C.translate("Learn more...")+"</a></li></ul></div>")].join("")}]}}function l(d,g){return function(){var e,t,n,a,o,i,r,s,l,c,u,h=(e=d,t=g,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=T.majorVersion,o=T.minorVersion,i=0===a.indexOf("@")?"X.X.X":a+"."+o,c={name:"versions",title:"Version",items:[{type:"htmlpanel",html:"<p>"+C.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=y(((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})),m=h.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(h.names,function(e){return A(t=m,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)},m=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"}],C=tinymce.util.Tools.resolve("tinymce.util.I18n"),p="premium",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:"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:"advcode",name:"Advanced Code Editor*",type:p},{key:"formatpainter",name:"Format Painter*",type:p},{key:"powerpaste",name:"PowerPaste*",type:p},{key:"tinydrive",name:"Tiny Drive*",type:p},{key:"tinymcespellchecker",name:"Spell Checker Pro*",type:p},{key:"a11ychecker",name:"Accessibility Checker*",type:p},{key:"linkchecker",name:"Link Checker*",type:p},{key:"mentions",name:"Mentions*",type:p},{key:"mediaembed",name:"Enhanced Media Embed*",type:p},{key:"checklist",name:"Checklist*",type:p},{key:"casechange",name:"Case Change*",type:p},{key:"permanentpen",name:"Permanent Pen*",type:p},{key:"pageembed",name:"Page Embed*",type:p},{key:"tinycomments",name:"Tiny Comments*",type:p,slug:"comments"},{key:"advtable",name:"Advanced Tables*",type:p},{key:"autocorrect",name:"Autocorrect*",type:p},{key:"export",name:"Export*",type:p}],function(e){return y(y({},e),{type:e.type||"opensource",slug:e.slug||e.key})}),T=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})}();
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,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.9.2 (2021-09-08)
7
+ * Version: 5.10.0 (2021-10-11)
8
8
  */
9
9
  !function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("hr",function(n){var o,t;function e(){return t.execCommand("InsertHorizontalRule")}(o=n).addCommand("InsertHorizontalRule",function(){o.execCommand("mceInsertContent",!1,"<hr />")}),(t=n).ui.registry.addButton("hr",{icon:"horizontal-rule",tooltip:"Horizontal line",onAction:e}),t.ui.registry.addMenuItem("hr",{icon:"horizontal-rule",text:"Horizontal line",onAction:e})})}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.9.2 (2021-09-08)
7
+ * Version: 5.10.0 (2021-10-11)
8
8
  */
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 i(e){return function(){return e}}function n(e){return e}function r(){return g}var a,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),y=function(){return(y=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},T=e("string"),s=e("object"),c=e("array"),N=t("boolean"),w=t("function"),u=t("number"),m=i(!1),d=i(!(a=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:i(null),getOrUndefined:i(void 0),or:n,orThunk:p,map:r,each:l,bind:r,exists:m,forall:d,filter:function(){return g},toArray:function(){return[]},toString:i("none()")};function p(e){return e()}function f(e,i,o,l){return function(e){for(var t=v(e),n=0,r=t.length;n<r;n++){var a=t[n];!function(e,t){(i(e,t)?o:l)(e,t)}(e[a],a)}}(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 a}function t(e){return e(n)}var r=i(n),a={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)?a:g},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return a},L={some:b,none:r,from:function(e){return null==e?g:b(e)}},v=Object.keys,A=Object.hasOwnProperty,U=Array.prototype.push;function C(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 I(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){return e.style.marginLeft&&e.style.marginRight&&e.style.marginLeft===e.style.marginRight?O(e.style.marginLeft):""}function k(e){return e.style.marginTop&&e.style.marginBottom&&e.style.marginTop===e.style.marginBottom?O(e.style.marginTop):""}function z(e){return e.style.borderWidth?O(e.style.borderWidth):""}function M(e,t){return e.hasAttribute(t)?e.getAttribute(t):""}function j(e,t){return e.style[t]||""}function B(e){return null!==e.parentNode&&"FIGURE"===e.parentNode.nodeName}function H(e,t,n){""===n?e.removeAttribute(t):e.setAttribute(t,n)}function F(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 G(e,r){return function(e,t,n){e.style[t]?(e.style[t]=P(n),F(e,r)):H(e,t,n)}}function W(e,t){return e.style[t]?O(e.style[t]):M(e,t)}function V(e,t){var n=P(t);e.style.marginLeft=n,e.style.marginRight=n}function $(e,t){var n=P(t);e.style.marginTop=n,e.style.marginBottom=n}function J(e,t){var n=P(t);e.style.borderWidth=n}function K(e,t){e.style.borderStyle=t}function X(e){return"FIGURE"===e.nodeName}function Z(e){return 0===we.getAttrib(e,"alt").length&&"presentation"===we.getAttrib(e,"role")}function q(){return{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}}function Q(e,t){return{src:M(t,"src"),alt:Z(n=t)?"":M(n,"alt"),title:M(t,"title"),width:W(t,"width"),height:W(t,"height"),class:M(t,"class"),style:e(M(t,"style")),caption:B(t),hspace:R(t),vspace:k(t),border:z(t),borderStyle:j(t,"borderStyle"),isDecorative:Z(t)};var n}function Y(e,t,n,r,a){n[r]!==t[r]&&a(e,r,n[r])}function ee(r,a){return function(e,t,n){r(e,n),F(e,a)}}function te(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 ne(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 re(n,e){var r,t,a=n.dom,i=(f(n.schema.getTextBlockElements(),function(e,t){return!n.schema.isValidChild(t,"figure")},(r=t={},function(e,t){r[t]=e}),l),t),o=a.getParent(e.parentNode,function(e){return h(t=i,n=e.nodeName)&&null!=t[n];var t,n},n.getBody());return o?a.split(o,e):e}function ae(r,e){var t=function(e){var t=document.createElement("img");if(Ue(function(e){return te(r,e)},y(y({},e),{caption:!1}),t),Se(t,e.alt,e.isDecorative),e.caption){var n=we.create("figure",{class:"image"});return n.appendChild(t),n.appendChild(we.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,a=r.dom.select('*[data-mce-id="__mcenew"]')[0];r.dom.setAttrib(a,"data-mce-id",null),X(a)?(n=re(r,a),r.selection.select(n)):r.selection.select(a)}function ie(e){return T(e.value)?e.value:""}function oe(t){return void 0===t&&(t=ie),function(e){return e?L.from(e).map(function(e){return Oe(e,t)}):L.none()}}function le(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"}]:[],[y(y({},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 se(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 ce(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 ue(e,t,n,r){var a,i,o,l,s,c,u,m,d,g,p,f,h,b,y,v,A,D,w,S,U,C,I,x,O;U=t,I=(C=r).getData(),x=U,O=I.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){C.setData({src:{value:e,meta:I.src.meta}})}),h=t,w=(b=r).getData(),void 0!==(S=w.src.meta)&&(y=Ce({},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)&&Pe(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)),a=e,i=t,o=n,c=(s=(l=r).getData()).src.value,(u=s.src.meta||{}).width||u.height||!i.hasDimensions||(0<c.length?a.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=Pe(m.imageList,p.src.value),d.prevImage=f,g.setData({images:f.map(function(e){return e.value}).getOr("")})}function me(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(i)}function a(e){c.setData({src:{value:e,meta:{}}}),c.showTab("general"),ue(l,s,t,c)}var i=URL.createObjectURL(n),o=n;new Ae(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,i,e);s.automaticUploads?l.uploadImage(t).then(function(e){a(e.url),r()}).catch(function(e){r(),l.alertErr(e)}):(l.addToBlobCache(t),a(t.blobUri()),c.unblock())})})}function de(S,U,C){return function(e,t){var n,r,a,i,o,l,s,c,u,m,d,g,p,f,h,b,y,v,A,D,w;"src"===t.name?ue(S,U,C,e):"images"===t.name?(c=S,u=U,m=C,g=(d=e).getData(),(p=Pe(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,ue(c,u,m,d)):"alt"===t.name?C.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=Ce({},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,a=Ce(se(U.image),(r=e).getData()),f=n.normalizeCss,h=ce(a,!1),H(b=document.createElement("img"),"style",h.style),!R(b)&&""===h.hspace||V(b,h.hspace),!k(b)&&""===h.vspace||$(b,h.vspace),!z(b)&&""===h.border||J(b,h.border),!j(b,"borderStyle")&&""===h.borderStyle||K(b,h.borderStyle),i=f(b.getAttribute("style")),r.setData({style:i})):"fileinput"===t.name?me(S,U,C,e):"isDecorative"===t.name&&(e.getData().isDecorative?e.disable("alt"):e.enable("alt"))}}function ge(v){var t,n,r,a,i,o,l,s,c,A={onSubmit:function(n){return function(e){var t=Ce(se(n.image),e.getData());c.execCommand("mceUpdateImage",!1,ce(t,n.hasAccessibilityOptions)),c.editorUpload.uploadImagesAuto(),e.close()}},imageSize:function(e){return a=s.documentBaseURI.toAbsolute(e),new Ae(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(Ae.resolve({width:e,height:t}))},r.onerror=function(){n(Ae.reject("Failed to get image dimensions for: "+a))};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=a}).then(function(e){return{width:String(e.width),height:String(e.height)}});var a},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){i.windowManager.alert(e)},normalizeCss:function(e){return te(a,e)},parseStyle:function(e){return r.dom.parseStyle(e)},serializeStyle:function(e,t){return n.dom.serializeStyle(e,t)},uploadImage:(t=n=r=a=i=o=l=s=c=v,function(e){return Ie(t).upload([e],!1).then(function(e){return 0===e.length?Ae.reject("Failed to upload image"):!1===e[0].status?Ae.reject(e[0].error.message):e[0]})})};return{open:function(){var i,r,t,e,a,n,o,l,s,c,u,m,d,g,p,f,h,b,y;r=v,a=Ne(function(e){return r.convertURL(e.value||e.url,"src")}),n=new Ae(function(t){var n=function(e){t(a(e).map(function(e){return S([[{text:"None",value:""}],e])}))},e=r.getParam("image_list",!1);T(e)?De.send({url:e,success:function(e){n(JSON.parse(e))}}):w(e)?e(n):n(e)}),o=Le(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=ne(t=r))?Q(function(e){return te(t,e)},e):q(),d=r.getParam("image_description",!0,"boolean"),g=r.getParam("image_title",!1,"boolean"),p=I(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((i=A,function(e){var t,n,r,a={prevImage:Pe((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([[Ee(r)],r.hasAdvTab?[_e(r)]:[],r.hasUploadTab&&(r.hasUploadUrl||r.hasUploadHandler)?[ke(r)]:[]])}:{type:"panel",items:Re(r)},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:se(e.image),onSubmit:i.onSubmit(e),onChange:de(i,e,a),onClose:(n=a,function(){n.open=!1})}})).then(v.windowManager.open)}}}function pe(b){b.addCommand("mceImage",ge(b).open),b.addCommand("mceUpdateImage",function(e,h){b.undoManager.transact(function(){var t,e,n,r,a,i,o,l,s,c,u,m,d,g,p;function f(){g.onload=g.onerror=null,m.selection&&(m.selection.select(g),m.nodeChanged())}e=h,(l=ne(t=b))?(n=Q(function(e){return te(t,e)},l),(r=y(y({},n),e)).src?(c=r,p=ne(s=t),Ue(function(e){return te(s,e)},c,p),s.dom.setAttrib(p,"src",p.getAttribute("src")),X(p.parentNode)?(u=p.parentNode,re(s,u),s.selection.select(p.parentNode)):(s.selection.select(p),m=s,d=c,(g=p).onload=function(){d.width||d.height||!I(m)||m.dom.setAttribs(g,{width:String(g.clientWidth),height:String(g.clientHeight)}),f()},g.onerror=f)):(a=t,(i=l)&&(o=a.dom.is(i.parentNode,"figure.image")?i.parentNode:i,a.dom.remove(o),a.focus(),a.nodeChanged(),a.dom.isEmpty(a.getBody())&&(a.setContent(""),a.selection.setCursorLocation())))):e.src&&ae(t,y(y({},q()),e))})})}function fe(i){return function(e){for(var t=e.length,n=function(e){e.attr("contenteditable",i?"true":null)};t--;){var r,a=e[t];(r=a.attr("class"))&&/\bimage\b/.test(r)&&(a.attr("contenteditable",i?"false":null),xe.each(a.getAll("figcaption"),n))}}}"undefined"!=typeof window||Function("return this;")();function he(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}}var be,ye=he,ve=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Ae=tinymce.util.Tools.resolve("tinymce.util.Promise"),De=tinymce.util.Tools.resolve("tinymce.util.XHR"),we=ve.DOM,Se=function(e,t,n){n?(we.setAttrib(e,"role","presentation"),C(ye(e),"alt","")):(a===t?ye(e).dom.removeAttribute("alt"):C(ye(e),"alt",t),"presentation"===we.getAttrib(e,"role")&&we.setAttrib(e,"role",""))},Ue=function(e,t,n){var r=Q(e,n);Y(n,r,t,"caption",function(e,t,n){return B(r=e)?(o=r.parentNode,we.insertAfter(r,o),we.remove(o)):(a=r,i=we.create("figure",{class:"image"}),we.insertAfter(i,a),i.appendChild(a),i.appendChild(we.create("figcaption",{contentEditable:"true"},"Caption")),i.contentEditable="false"),0;var r,a,i,o}),Y(n,r,t,"src",H),Y(n,r,t,"title",H),Y(n,r,t,"width",G(0,e)),Y(n,r,t,"height",G(0,e)),Y(n,r,t,"class",H),Y(n,r,t,"style",ee(function(e,t){return H(e,"style",t),0},e)),Y(n,r,t,"hspace",ee(V,e)),Y(n,r,t,"vspace",ee($,e)),Y(n,r,t,"border",ee(J,e)),Y(n,r,t,"borderStyle",ee(K,e)),t.alt===r.alt&&t.isDecorative===r.isDecorative||Se(n,t.alt,t.isDecorative)},Ce=(be=function(e,t){return s(e)&&s(t)?Ce(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 a,i=e[r];for(a in i)h(i,a)&&(n[a]=be(n[a],i[a]))}return n}),Ie=tinymce.util.Tools.resolve("tinymce.util.ImageUploader"),xe=tinymce.util.Tools.resolve("tinymce.util.Tools"),Oe=function(e,i){var o=[];return xe.each(e,function(e){var t,n,r,a=T((t=e).text)?t.text:T(t.title)?t.title:"";void 0!==e.menu?(n=Oe(e.menu,i),o.push({text:a,items:n})):(r=i(e),o.push({text:a,value:r}))}),o},Te=function(e,a){return function(e){for(var t,n=0;n<e.length;n++){var r=h(t=e[n],"items")?Te(t.items,a):t.value===a?L.some(t):L.none();if(r.isSome())return r}return L.none()}(e)},Ne=oe,Le=function(e){return oe(ie)(e)},Pe=function(e,t){return e.bind(function(e){return Te(e,t)})},_e=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"}]}]}]}},Ee=function(e){return{title:"General",name:"general",items:le(e)}},Re=le,ke=function(e){return{title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput"}]}};o.add("image",function(e){var t,n;(t=e).on("PreInit",function(){t.parser.addNodeFilter("figure",fe(!0)),t.serializer.addNodeFilter("figure",fe(!1))}),(n=e).ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:ge(n).open,onSetup:function(e){return 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:ge(n).open}),n.ui.registry.addContextMenu("image",{update:function(e){return X(e)||"IMG"===e.nodeName&&!E(e)?["image"]:[]}}),pe(e)})}();
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,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.9.2 (2021-09-08)
7
+ * Version: 5.10.0 (2021-10-11)
8
8
  */
9
- !function(){"use strict";function c(t){var e=t;return{get:function(){return e},set:function(t){e=t}}}function h(t){return null!=t}function r(){}function i(t){return function(){return t}}function t(t){return t}function e(){return d}function s(t){return n=typeof(e=t),"array"==(null===e?"null":"object"==n&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":n);var e,n}var n,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=function(t){return typeof t===n},u=i(!(n="function")),f=i(!0),d={fold:function(t,e){return t()},isSome:u,isNone:f,getOr:t,getOrThunk:m,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:t,orThunk:m,map:e,each:r,bind:e,exists:u,forall:f,filter:function(){return d},toArray:function(){return[]},toString:i("none()")};function m(t){return t()}function g(t,e){return _(document.createElement("canvas"),t,e)}function p(t){var e=g(t.width,t.height);return A(e).drawImage(t,0,0),e}var v,y,w,b,E,I=function(n){function t(){return o}function e(t){return t(n)}var r=i(n),o={fold:function(t,e){return e(n)},isSome:f,isNone:u,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:t,orThunk:t,map:function(t){return I(t(n))},each:function(t){t(n)},bind:e,exists:e,forall:e,filter:function(t){return t(n)?o:d},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},T={some:I,none:e,from:function(t){return null==t?d:I(t)}},A=function(t){return t.getContext("2d")},_=function(t,e,n){return t.width=e,t.height=n,t},R=window.Promise||(v=window,y=x.immediateFn||"function"==typeof v.setImmediate&&v.setImmediate||function(t){return setTimeout(t,1)},w=function(n,r){return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n.apply(r,t)}},b=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},E=function(t,e,n){var r=!1;try{t(function(t){r||(r=!0,e(t))},function(t){r||(r=!0,n(t))})}catch(t){if(r)return;r=!0,n(t)}},x.prototype.catch=function(t){return this.then(null,t)},x.prototype.then=function(n,r){var o=this;return new x(function(t,e){U.call(o,new O(n,r,t,e))})},x.all=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var u=Array.prototype.slice.call(1===t.length&&b(t[0])?t[0]:t);return new x(function(r,o){if(0===u.length)return r([]);for(var i=u.length,a=function(e,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void n.call(t,function(t){a(e,t)},o)}u[e]=t,0==--i&&r(u)}catch(t){o(t)}},t=0;t<u.length;t++)a(t,u[t])})},x.resolve=function(e){return e&&"object"==typeof e&&e.constructor===x?e:new x(function(t){t(e)})},x.reject=function(n){return new x(function(t,e){e(n)})},x.race=function(o){return new x(function(t,e){for(var n=0,r=o;n<r.length;n++)r[n].then(t,e)})},x);function x(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],E(t,w(j,this),w(S,this))}function U(n){var r=this;null!==this._state?y(function(){var t,e=r._state?n.onFulfilled:n.onRejected;if(null!==e){try{t=e(r._value)}catch(t){return void n.reject(t)}n.resolve(t)}else(r._state?n.resolve:n.reject)(r._value)}):this._deferreds.push(n)}function j(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void E(w(e,t),w(j,this),w(S,this))}this._state=!0,this._value=t,M.call(this)}catch(t){S.call(this,t)}}function S(t){this._state=!1,this._value=t,M.call(this)}function M(){for(var t=0,e=this._deferreds;t<e.length;t++){var n=e[t];U.call(this,n)}this._deferreds=[]}function O(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}function L(u){return new R(function(t,e){function n(){o.removeEventListener("load",i),o.removeEventListener("error",a)}var r=URL.createObjectURL(u),o=new Image,i=function(){n(),t(o)},a=function(){n(),e("Unable to load data of type "+u.type+": "+r)};o.addEventListener("load",i),o.addEventListener("error",a),o.src=r,o.complete&&setTimeout(i,0)})}function k(t,r,o){return r=r||"image/png",a(HTMLCanvasElement.prototype.toBlob)?new R(function(e,n){t.toBlob(function(t){t?e(t):n()},r,o)}):N(t.toDataURL(r,o))}function P(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)}function C(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return T.some(i);if(n(i,r))break}return T.none()}(t,e,u)}var B=function(r){return new R(function(t,e){var n=new XMLHttpRequest;n.open("GET",r,!0),n.responseType="blob",n.onload=function(){200===this.status&&t(this.response)},n.onerror=function(){var t;e(0===this.status?((t=new Error("No access to download image")).code=18,t.name="SecurityError",t):new Error("Error "+this.status+" downloading image"))},n.send()})},N=function(h){return new R(function(t,e){!function(){var t=h.split(","),e=/data:([^;]+)/.exec(t[0]);if(!e)return T.none();for(var n=e[1],r=t[1],o=atob(r),i=o.length,a=Math.ceil(i/1024),u=new Array(a),c=0;c<a;++c){for(var s=1024*c,l=Math.min(1024+s,i),f=new Array(l-s),d=s,m=0;d<l;++m,++d)f[m]=o[d].charCodeAt(0);u[c]=new Uint8Array(f)}return T.some(new Blob(u,{type:n}))}().fold(function(){e("uri is not base64: "+h)},t)})},D=function(t){URL.revokeObjectURL(t.src)},F=L,H=Array.prototype.indexOf,z=Object.keys;function q(t,e,n){function r(e,n){return t.then(function(t){return t.toDataURL(e||"image/png",n)})}return{getType:i(e.type),toBlob:function(){return R.resolve(e)},toDataURL:i(n),toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(e,n){return t.then(function(t){return k(t,e,n)})},toAdjustedDataURL:r,toAdjustedBase64:function(t,e){return r(t,e).then(function(t){return t.split(",")[1]})},toCanvas:function(){return t.then(p)}}}function $(e,t){return k(e,t).then(function(t){return q(R.resolve(e),t,e.toDataURL())})}function W(t,e){void 0===e&&(e=2);var n=Math.pow(10,e),r=Math.round(t*n);return Math.ceil(r/n)}function V(e,n,r){return void 0===r&&(r=!1),new R(function(t){var a=new XMLHttpRequest;a.onreadystatechange=function(){4===a.readyState&&t({status:a.status,blob:a.response})},a.open("GET",e,!0),a.withCredentials=r,function(t){for(var e,n=z(t),r=0,o=n.length;r<o;r++){var i=n[r];e=t[i],a.setRequestHeader(i,e)}}(n),a.responseType="blob",a.send()})}function G(t){var e,n=(e=t,"ImageProxy HTTP error: "+C(rt,function(t){return e===t.code}).fold(i("Unknown ImageProxy error"),function(t){return t.message}));return R.reject(n)}function J(e){return C(ot,function(t){return t.type===e}).fold(i("Unknown service error"),function(t){return t.message})}function K(t){return"ImageProxy Service error: "+function(t){try{return T.some(JSON.parse(t))}catch(t){return T.none()}}(t).bind(function(t){return n=function(t,e){return h(t)?t[e]:void 0},r=t,P(["error","type"],function(t,e){r=n(r,t)}),e=r,T.from(e).map(J);var n,r,e}).getOr("Invalid JSON in service error message")}function X(t){return t<200||300<=t}function Q(t,e){var n,r,o,i={"Content-Type":"application/json;charset=UTF-8","tiny-api-key":e};return V((r=e,o=-1===(n=t).indexOf("?")?"?":"&",/[?&]apiKey=/.test(n)?n:n+o+"apiKey="+encodeURIComponent(r)),i).then(function(t){return X(t.status)?(e=t.status,"application/json"!==(null==(n=t.blob)?void 0:n.type)||400!==e&&403!==e&&404!==e&&500!==e?G(e):(r=n,new R(function(t,e){var n=new FileReader;n.onload=function(){t(n.result)},n.onerror=function(t){e(t)},n.readAsText(r)}).then(function(t){var e=K(t);return R.reject(e)}))):R.resolve(t.blob);var r,e,n})}function Y(t,e,n){return void 0===n&&(n=!1),e?Q(t,e):V(t,{},n).then(function(t){return X(t.status)?G(t.status):R.resolve(t.blob)})}function Z(e){return n=e,new R(function(t){var e=new FileReader;e.onloadend=function(){t(e.result)},e.readAsDataURL(n)}).then(function(t){return q(L(e).then(function(t){D(t);var e=g(t.naturalWidth||t.width,t.naturalHeight||t.height);return A(e).drawImage(t,0,0),e}),e,t)});var n}!function(a){if(!s(a))throw new Error("cases must be an array");if(0===a.length)throw new Error("there must be at least one case");var u=[],n={};P(a,function(t,r){var e=z(t);if(1!==e.length)throw new Error("one and only one name per case");var i=e[0],o=t[i];if(void 0!==n[i])throw new Error("duplicate key detected:"+i);if("cata"===i)throw new Error("cannot have a case named cata (sorry)");if(!s(o))throw new Error("case arguments must be an array");u.push(i),n[i]=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=n.length;if(e!==o.length)throw new Error("Wrong number of arguments to case "+i+". Expected "+o.length+" ("+o+"), got "+e);return{fold:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length!==a.length)throw new Error("Wrong number of arguments to fold. Expected "+a.length+", got "+t.length);return t[r].apply(null,n)},match:function(t){var o=z(t);if(u.length!==o.length)throw new Error("Wrong number of arguments to match. Expected: "+u.join(",")+"\nActual: "+o.join(","));if(!function(t){for(var e,n=0,r=t.length;n<r;++n)if(!0!==(e=t[n],function(t,e){return-1<H.call(t,e)}(o,e)))return;return 1}(u))throw new Error("Not all branches were specified when using match. Specified: "+o.join(", ")+"\nRequired: "+u.join(", "));return t[i].apply(null,n)},log:function(t){console.log(t,{constructors:u,constructor:i,params:n})}}}})}([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);function tt(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}}var et=function(t,e,n){var r=(n<0?360+n:n)*Math.PI/180,o=t.width,i=t.height,a=Math.sin(r),u=Math.cos(r),c=W(Math.abs(o*u)+Math.abs(i*a)),s=W(Math.abs(o*a)+Math.abs(i*u)),l=g(c,s),f=A(l);return f.translate(c/2,s/2),f.rotate(r),f.drawImage(t,-o/2,-i/2),$(l,e)},nt=function(t,e,n){var r=g(t.width,t.height),o=A(r);return"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),$(r,e)},rt=[{code:404,message:"Could not find Image Proxy"},{code:403,message:"Rejected request"},{code:0,message:"Incorrect Image Proxy URL"}],ot=[{type:"not_found",message:"Failed to load image."},{type:"key_missing",message:"The request did not include an api key."},{type:"key_not_found",message:"The provided api key could not be found."},{type:"domain_not_trusted",message:"The api key is not valid for the request origins."}],it={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return tt(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return tt(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return tt(n)},fromDom:tt,fromPoint:function(t,e,n){return T.from(t.dom.elementFromPoint(e,n)).map(tt)}};function at(t){return t.getParam("imagetools_proxy")}function ut(t){function e(t){return/^[0-9\.]+px$/.test(t)}var n=t.style.width,r=t.style.height;return n||r?e(n)&&e(r)?{w:parseInt(n,10),h:parseInt(r,10)}:null:(n=t.width,r=t.height,n&&r?{w:parseInt(n,10),h:parseInt(r,10)}:null)}function ct(t){return{w:t.naturalWidth,h:t.naturalHeight}}function st(t){return e=it.fromDom(t),n="img",r=function(r){return function(t){var e=r.dom;if(1!==e.nodeType)return!1;var n=e;if(void 0!==n.matches)return n.matches(t);if(void 0!==n.msMatchesSelector)return n.msMatchesSelector(t);if(void 0!==n.webkitMatchesSelector)return n.webkitMatchesSelector(t);if(void 0!==n.mozMatchesSelector)return n.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}(n)},C(e.dom.childNodes,function(t){return r(it.fromDom(t))}).map(it.fromDom);var e,n,r}function lt(t,e){return t.dom.is(e,"figure")}function ft(t,e){return t.dom.is(e,"img:not([data-mce-object],[data-mce-placeholder])")}function dt(e,t){function n(t){return ft(e,t)&&(jt(e,t)||St(e,t)||h(at(e)))}return lt(e,t)?st(t).bind(function(t){return n(t.dom)?T.some(t.dom):T.none()}):n(t)?T.some(t):T.none()}function mt(t,e){t.notificationManager.open({text:e,type:"error"})}function ht(t){var e=t.selection.getNode(),n=t.dom.getParent(e,"figure.image");return null!==n&&lt(t,n)?st(n):ft(t,e)?T.some(it.fromDom(e)):T.none()}function gt(t,e,n){var r=e.match(/(?:\/|^)(([^\/\?]+)\.(?:[a-z0-9.]+))(?:\?|$)/i);return h(r)?t.dom.encode(r[n]):null}function pt(t,e){if(St(t,e))return Y(e.src,null,(n=e,-1!==l.inArray(t.getParam("imagetools_credentials_hosts",[],"string[]"),new xt(n.src).host)));var n,r;if(jt(t,e))return(0===(r=e.src).indexOf("data:")?N:B)(r);var o=at(t);return Y(o+(-1===o.indexOf("?")?"?":"&")+"url="+encodeURIComponent(e.src),t.getParam("api_key",t.getParam("imagetools_api_key","","string"),"string"),!1)}function vt(t,e){var n,r,o=t.editorUpload.blobCache.getByUri(e.src);return o?Rt.resolve(o.blob()):(n=t,r=e,T.from(n.getParam("imagetools_fetch_image",null,"function")).fold(function(){return pt(n,r)},function(t){return t(r)}))}function yt(t){_t.clearTimeout(t.get())}function wt(u,c,s,l,f,d,m){return s.toBlob().then(function(t){var e,n,o,r=u.editorUpload.blobCache,i=d.src,a=c.type===t.type;return u.getParam("images_reuse_filename",!1,"boolean")&&(n=h(o=r.getByUri(i))?(i=o.uri(),e=o.name(),o.filename()):(e=gt(u,i,2),gt(u,i,1))),o=r.create({id:"imagetools"+Ut++,blob:t,base64:s.toBase64(),uri:i,name:e,filename:a?n:void 0}),r.add(o),u.undoManager.transact(function(){var r=function(){var t,e,n;u.$(d).off("load",r),u.nodeChanged(),l?u.editorUpload.uploadImagesAuto():(yt(f),t=u,e=f,n=_t.setEditorTimeout(t,function(){t.editorUpload.uploadImagesAuto()},t.getParam("images_upload_timeout",3e4,"number")),e.set(n))};u.$(d).on("load",r),m&&u.$(d).attr({width:m.w,height:m.h}),u.$(d).attr({src:o.blobUri()}).removeAttr("data-mce-src")}),o})}function bt(r,o,t,i){return function(){return ht(r).fold(function(){mt(r,"Could not find selected image")},function(n){return r._scanForImages().then(function(){return vt(r,n.dom)}).then(function(e){return Z(e).then(t).then(function(t){return wt(r,e,t,!1,o,n.dom,i)})}).catch(function(t){mt(r,t)})})}}function Et(e,n,r){return function(){var t=ht(e).map(function(t){var e=ut(t.dom);return e?{w:e.h,h:e.w}:null}).getOrNull();return bt(e,n,function(t){return n=r,(e=t).toCanvas().then(function(t){return et(t,e.getType(),n)});var e,n},t)()}}function It(t,e,r){return function(){return bt(t,e,function(t){return n=r,(e=t).toCanvas().then(function(t){return nt(t,e.getType(),n)});var e,n})()}}function Tt(s,l){return function(){var n=ht(s),i=n.map(function(t){return ct(t.dom)});n.each(function(e){dt(s,e.dom).each(function(t){vt(s,e.dom).then(function(t){var e={blob:t,url:URL.createObjectURL(t)};s.windowManager.open({title:"Edit Image",size:"large",body:{type:"panel",items:[{type:"imagetools",name:"imagetools",label:"Edit Image",currentState:e}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0,disabled:!0}],onSubmit:function(t){var o=t.getData().imagetools.blob;n.each(function(r){i.each(function(t){var e,n,a,u,c;e=s,n=l,a=r.dom,u=t,F(c=o).then(function(t){var e,n,r,o,i=ct(t);return u.w===i.w&&u.h===i.h||ut(a)&&(e=a,(n=i)&&(r=e.style.width,o=e.style.height,(r||o)&&(e.style.width=n.w+"px",e.style.height=n.h+"px",e.removeAttribute("data-mce-style")),r=e.width,o=e.height,(r||o)&&(e.setAttribute("width",String(n.w)),e.setAttribute("height",String(n.h))))),URL.revokeObjectURL(t.src),c}).then(Z).then(function(t){return wt(e,c,t,!0,n,a)})})}),t.close()},onCancel:r,onAction:function(t,e){switch(e.name){case"save-state":e.value?t.enable("save"):t.disable("save");break;case"disable":t.disable("save"),t.disable("cancel");break;case"enable":t.enable("cancel")}}})})})})}}function At(e){function n(t){return function(){return e.execCommand(t)}}function t(){return ht(e).exists(function(t){return dt(e,t.dom).isSome()})}function r(e){function i(t){return e.setDisabled(!t)}return i(t()),o=o.concat([i]),function(){o=function(t){for(var e=[],n=0,r=t.length;n<r;n++){var o=t[n];o!==i&&e.push(o)}return e}(o)}}var o=[];e.on("NodeChange",function(){var e=t();P(o,function(t){return t(e)})}),e.ui.registry.addButton("rotateleft",{tooltip:"Rotate counterclockwise",icon:"rotate-left",onAction:n("mceImageRotateLeft"),onSetup:r}),e.ui.registry.addButton("rotateright",{tooltip:"Rotate clockwise",icon:"rotate-right",onAction:n("mceImageRotateRight"),onSetup:r}),e.ui.registry.addButton("flipv",{tooltip:"Flip vertically",icon:"flip-vertically",onAction:n("mceImageFlipVertical"),onSetup:r}),e.ui.registry.addButton("fliph",{tooltip:"Flip horizontally",icon:"flip-horizontally",onAction:n("mceImageFlipHorizontal"),onSetup:r}),e.ui.registry.addButton("editimage",{tooltip:"Edit image",icon:"edit-image",onAction:n("mceEditImage"),onSetup:r}),e.ui.registry.addButton("imageoptions",{tooltip:"Image options",icon:"image",onAction:n("mceImage")}),e.ui.registry.addContextMenu("imagetools",{update:function(t){return dt(e,t).map(function(t){return{text:"Edit image",icon:"edit-image",onAction:n("mceEditImage")}}).toArray()}})}"undefined"!=typeof window||Function("return this;")();var _t=tinymce.util.Tools.resolve("tinymce.util.Delay"),Rt=tinymce.util.Tools.resolve("tinymce.util.Promise"),xt=tinymce.util.Tools.resolve("tinymce.util.URI"),Ut=0,jt=function(t,e){var n=e.src;return 0===n.indexOf("data:")||0===n.indexOf("blob:")||new xt(n).host===t.documentBaseURI.host},St=function(t,e){return-1!==l.inArray(t.getParam("imagetools_cors_hosts",[],"string[]"),new xt(e.src).host)};o.add("imagetools",function(t){var e,r,o,i,n=c(0),a=c(null),u=t;l.each({mceImageRotateLeft:Et(u,n,-90),mceImageRotateRight:Et(u,n,90),mceImageFlipVertical:It(u,n,"v"),mceImageFlipHorizontal:It(u,n,"h"),mceEditImage:Tt(u,n)},function(t,e){u.addCommand(e,t)}),At(t),(e=t).ui.registry.addContextToolbar("imagetools",{items:e.getParam("imagetools_toolbar","rotateleft rotateright flipv fliph editimage imageoptions"),predicate:function(t){return dt(e,t).isSome()},position:"node",scope:"node"}),o=n,i=a,(r=t).on("NodeChange",function(t){var e=i.get(),n=dt(r,t.element);e&&!n.exists(function(t){return e.src===t.src})&&(yt(o),r.editorUpload.uploadImagesAuto(),i.set(null)),n.each(i.set)})})}();
9
+ !function(){"use strict";function c(e){var t=e;return{get:function(){return t},set:function(e){t=e}}}function h(e){return null!=e}function r(){}function i(e){return function(){return e}}function e(e){return e}function t(){return d}function s(e){return n=typeof(t=e),"array"==(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);var t,n}var n,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),f=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=function(e){return typeof e===n},u=i(!(n="function")),l=i(!0),d={fold:function(e,t){return e()},isSome:u,isNone:l,getOr:e,getOrThunk:m,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:e,orThunk:m,map:t,each:r,bind:t,exists:u,forall:l,filter:function(){return d},toArray:function(){return[]},toString:i("none()")};function m(e){return e()}var g=function(n){function e(){return o}function t(e){return e(n)}var r=i(n),o={fold:function(e,t){return t(n)},isSome:l,isNone:u,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:e,orThunk:e,map:function(e){return g(e(n))},each:function(e){e(n)},bind:t,exists:t,forall:t,filter:function(e){return e(n)?o:d},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},p={some:g,none:t,from:function(e){return null==e?d:g(e)}},v={},y={exports:v};function w(e,t){return U(document.createElement("canvas"),e,t)}function b(e){var t=w(e.width,e.height);return R(t).drawImage(e,0,0),t}function _(u){return new I(function(e,t){function n(){o.removeEventListener("load",i),o.removeEventListener("error",a)}var r=URL.createObjectURL(u),o=new Image,i=function(){n(),e(o)},a=function(){n(),t("Unable to load data of type "+u.type+": "+r)};o.addEventListener("load",i),o.addEventListener("error",a),o.src=r,o.complete&&setTimeout(i,0)})}function E(e,r,o){return r=r||"image/png",a(HTMLCanvasElement.prototype.toBlob)?new I(function(t,n){e.toBlob(function(e){e?t(e):n()},r,o)}):j(e.toDataURL(r,o))}function T(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)}function x(e,t){return function(e,t,n){for(var r=0,o=e.length;r<o;r++){var i=e[r];if(t(i,r))return p.some(i);if(n(i,r))break}return p.none()}(e,t,u)}!function(){var e=this,t=function(){var e,t,n,r={exports:{}};function o(){}function i(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(e,this)}function a(n,r){for(;3===n._state;)n=n._value;0!==n._state?(n._handled=!0,i._immediateFn(function(){var e,t=1===n._state?r.onFulfilled:r.onRejected;if(null!==t){try{e=t(n._value)}catch(e){return void c(r.promise,e)}u(r.promise,e)}else(1===n._state?u:c)(r.promise,n._value)})):n._deferreds.push(r)}function u(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void s(t);if("function"==typeof n)return void l((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,s(t)}catch(e){c(t,e)}var r,o}function c(e,t){e._state=2,e._value=t,s(e)}function s(e){2===e._state&&0===e._deferreds.length&&i._immediateFn(function(){e._handled||i._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)a(e,e._deferreds[t]);e._deferreds=null}function f(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function l(e,t){var n=!1;try{e(function(e){n||(n=!0,u(t,e))},function(e){n||(n=!0,c(t,e))})}catch(e){if(n)return;n=!0,c(t,e)}}e=r,t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=setTimeout,i.prototype.catch=function(e){return this.then(null,e)},i.prototype.then=function(e,t){var n=new this.constructor(o);return a(this,new f(e,t,n)),n},i.all=function(e){var u=Array.prototype.slice.call(e);return new i(function(o,i){if(0===u.length)return o([]);for(var a=u.length,e=0;e<u.length;e++)!function t(n,e){try{if(e&&("object"==typeof e||"function"==typeof e)){var r=e.then;if("function"==typeof r)return r.call(e,function(e){t(n,e)},i),0}u[n]=e,0==--a&&o(u)}catch(e){i(e)}}(e,u[e])})},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i(function(e){e(t)})},i.reject=function(n){return new i(function(e,t){t(n)})},i.race=function(o){return new i(function(e,t){for(var n=0,r=o.length;n<r;n++)o[n].then(e,t)})},i._immediateFn="function"==typeof setImmediate?function(e){setImmediate(e)}:function(e){n(e,0)},i._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},i._setImmediateFn=function(e){i._immediateFn=e},i._setUnhandledRejectionFn=function(e){i._unhandledRejectionFn=e},e.exports?e.exports=i:t.Promise||(t.Promise=i);var d=r.exports;return{boltExport:("undefined"!=typeof window?window:Function("return this;")()).Promise||d}};"object"==typeof v&&void 0!==y?y.exports=t():(e="undefined"!=typeof globalThis?globalThis:e||self).EphoxContactWrapper=t()}();var I=y.exports.boltExport,R=function(e){return e.getContext("2d")},U=function(e,t,n){return e.width=t,e.height=n,e},A=function(r){return new I(function(e,t){var n=new XMLHttpRequest;n.open("GET",r,!0),n.responseType="blob",n.onload=function(){200===this.status&&e(this.response)},n.onerror=function(){var e;t(0===this.status?((e=new Error("No access to download image")).code=18,e.name="SecurityError",e):new Error("Error "+this.status+" downloading image"))},n.send()})},j=function(h){return new I(function(e,t){!function(){var e=h.split(","),t=/data:([^;]+)/.exec(e[0]);if(!t)return p.none();for(var n=t[1],r=e[1],o=atob(r),i=o.length,a=Math.ceil(i/1024),u=new Array(a),c=0;c<a;++c){for(var s=1024*c,f=Math.min(1024+s,i),l=new Array(f-s),d=s,m=0;d<f;++m,++d)l[m]=o[d].charCodeAt(0);u[c]=new Uint8Array(l)}return p.some(new Blob(u,{type:n}))}().fold(function(){t("uri is not base64: "+h)},e)})},S=function(e){URL.revokeObjectURL(e.src)},M=_,P=Array.prototype.indexOf,O=Object.keys;function L(e,t,n){function r(t,n){return e.then(function(e){return e.toDataURL(t||"image/png",n)})}return{getType:i(t.type),toBlob:function(){return I.resolve(t)},toDataURL:i(n),toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(t,n){return e.then(function(e){return E(e,t,n)})},toAdjustedDataURL:r,toAdjustedBase64:function(e,t){return r(e,t).then(function(e){return e.split(",")[1]})},toCanvas:function(){return e.then(b)}}}function k(t,e){return E(t,e).then(function(e){return L(I.resolve(t),e,t.toDataURL())})}function C(e,t){void 0===t&&(t=2);var n=Math.pow(10,t),r=Math.round(e*n);return Math.ceil(r/n)}function F(t,n,r){return void 0===r&&(r=!1),new I(function(e){var a=new XMLHttpRequest;a.onreadystatechange=function(){4===a.readyState&&e({status:a.status,blob:a.response})},a.open("GET",t,!0),a.withCredentials=r,function(e){for(var t,n=O(e),r=0,o=n.length;r<o;r++){var i=n[r];t=e[i],a.setRequestHeader(i,t)}}(n),a.responseType="blob",a.send()})}function B(e){var t,n=(t=e,"ImageProxy HTTP error: "+x(J,function(e){return t===e.code}).fold(i("Unknown ImageProxy error"),function(e){return e.message}));return I.reject(n)}function N(t){return x(K,function(e){return e.type===t}).fold(i("Unknown service error"),function(e){return e.message})}function D(e){return"ImageProxy Service error: "+function(e){try{return p.some(JSON.parse(e))}catch(e){return p.none()}}(e).bind(function(e){return n=function(e,t){return h(e)?e[t]:void 0},r=e,T(["error","type"],function(e,t){r=n(r,e)}),t=r,p.from(t).map(N);var n,r,t}).getOr("Invalid JSON in service error message")}function H(e){return e<200||300<=e}function z(e,t){var n,r,o,i={"Content-Type":"application/json;charset=UTF-8","tiny-api-key":t};return F((r=t,o=-1===(n=e).indexOf("?")?"?":"&",/[?&]apiKey=/.test(n)?n:n+o+"apiKey="+encodeURIComponent(r)),i).then(function(e){return H(e.status)?(t=e.status,"application/json"!==(null==(n=e.blob)?void 0:n.type)||400!==t&&403!==t&&404!==t&&500!==t?B(t):(r=n,new I(function(e,t){var n=new FileReader;n.onload=function(){e(n.result)},n.onerror=function(e){t(e)},n.readAsText(r)}).then(function(e){var t=D(e);return I.reject(t)}))):I.resolve(e.blob);var r,t,n})}function q(e,t,n){return void 0===n&&(n=!1),t?z(e,t):F(e,{},n).then(function(e){return H(e.status)?B(e.status):I.resolve(e.blob)})}function W(t){return n=t,new I(function(e){var t=new FileReader;t.onloadend=function(){e(t.result)},t.readAsDataURL(n)}).then(function(e){return L(_(t).then(function(e){S(e);var t=w(e.naturalWidth||e.width,e.naturalHeight||e.height);return R(t).drawImage(e,0,0),t}),t,e)});var n}!function(a){if(!s(a))throw new Error("cases must be an array");if(0===a.length)throw new Error("there must be at least one case");var u=[],n={};T(a,function(e,r){var t=O(e);if(1!==t.length)throw new Error("one and only one name per case");var i=t[0],o=e[i];if(void 0!==n[i])throw new Error("duplicate key detected:"+i);if("cata"===i)throw new Error("cannot have a case named cata (sorry)");if(!s(o))throw new Error("case arguments must be an array");u.push(i),n[i]=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=n.length;if(t!==o.length)throw new Error("Wrong number of arguments to case "+i+". Expected "+o.length+" ("+o+"), got "+t);return{fold:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length!==a.length)throw new Error("Wrong number of arguments to fold. Expected "+a.length+", got "+e.length);return e[r].apply(null,n)},match:function(e){var o=O(e);if(u.length!==o.length)throw new Error("Wrong number of arguments to match. Expected: "+u.join(",")+"\nActual: "+o.join(","));if(!function(e){for(var t,n=0,r=e.length;n<r;++n)if(!0!==(t=e[n],function(e,t){return-1<P.call(e,t)}(o,t)))return;return 1}(u))throw new Error("Not all branches were specified when using match. Specified: "+o.join(", ")+"\nRequired: "+u.join(", "));return e[i].apply(null,n)},log:function(e){console.log(e,{constructors:u,constructor:i,params:n})}}}})}([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);function $(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}}var V=function(e,t,n){var r=(n<0?360+n:n)*Math.PI/180,o=e.width,i=e.height,a=Math.sin(r),u=Math.cos(r),c=C(Math.abs(o*u)+Math.abs(i*a)),s=C(Math.abs(o*a)+Math.abs(i*u)),f=w(c,s),l=R(f);return l.translate(c/2,s/2),l.rotate(r),l.drawImage(e,-o/2,-i/2),k(f,t)},G=function(e,t,n){var r=w(e.width,e.height),o=R(r);return"v"===n?(o.scale(1,-1),o.drawImage(e,0,-r.height)):(o.scale(-1,1),o.drawImage(e,-r.width,0)),k(r,t)},J=[{code:404,message:"Could not find Image Proxy"},{code:403,message:"Rejected request"},{code:0,message:"Incorrect Image Proxy URL"}],K=[{type:"not_found",message:"Failed to load image."},{type:"key_missing",message:"The request did not include an api key."},{type:"key_not_found",message:"The provided api key could not be found."},{type:"domain_not_trusted",message:"The api key is not valid for the request origins."}],X={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return $(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return $(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return $(n)},fromDom:$,fromPoint:function(e,t,n){return p.from(e.dom.elementFromPoint(t,n)).map($)}};function Q(e){return e.getParam("imagetools_proxy")}function Y(e){function t(e){return/^[0-9\.]+px$/.test(e)}var n=e.style.width,r=e.style.height;return n||r?t(n)&&t(r)?{w:parseInt(n,10),h:parseInt(r,10)}:null:(n=e.width,r=e.height,n&&r?{w:parseInt(n,10),h:parseInt(r,10)}:null)}function Z(e){return{w:e.naturalWidth,h:e.naturalHeight}}function ee(e){return t=X.fromDom(e),n="img",r=function(r){return function(e){var t=r.dom;if(1!==t.nodeType)return!1;var n=t;if(void 0!==n.matches)return n.matches(e);if(void 0!==n.msMatchesSelector)return n.msMatchesSelector(e);if(void 0!==n.webkitMatchesSelector)return n.webkitMatchesSelector(e);if(void 0!==n.mozMatchesSelector)return n.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")}(n)},x(t.dom.childNodes,function(e){return r(X.fromDom(e))}).map(X.fromDom);var t,n,r}function te(e,t){return e.dom.is(t,"figure")}function ne(e,t){return e.dom.is(t,"img:not([data-mce-object],[data-mce-placeholder])")}function re(t,e){function n(e){return ne(t,e)&&(be(t,e)||_e(t,e)||h(Q(t)))}return te(t,e)?ee(e).bind(function(e){return n(e.dom)?p.some(e.dom):p.none()}):n(e)?p.some(e):p.none()}function oe(e,t){e.notificationManager.open({text:t,type:"error"})}function ie(e){var t=e.selection.getNode(),n=e.dom.getParent(t,"figure.image");return null!==n&&te(e,n)?ee(n):ne(e,t)?p.some(X.fromDom(t)):p.none()}function ae(e,t,n){var r=t.match(/(?:\/|^)(([^\/\?]+)\.(?:[a-z0-9.]+))(?:\?|$)/i);return h(r)?e.dom.encode(r[n]):null}function ue(e,t){if(_e(e,t))return q(t.src,null,(n=t,-1!==f.inArray(e.getParam("imagetools_credentials_hosts",[],"string[]"),new ye(n.src).host)));var n,r;if(be(e,t))return(0===(r=t.src).indexOf("data:")?j:A)(r);var o=Q(e);return q(o+(-1===o.indexOf("?")?"?":"&")+"url="+encodeURIComponent(t.src),e.getParam("api_key",e.getParam("imagetools_api_key","","string"),"string"),!1)}function ce(e,t){var n,r,o=e.editorUpload.blobCache.getByUri(t.src);return o?ve.resolve(o.blob()):(n=e,r=t,p.from(n.getParam("imagetools_fetch_image",null,"function")).fold(function(){return ue(n,r)},function(e){return e(r)}))}function se(e){pe.clearTimeout(e.get())}function fe(u,c,s,f,l,d,m){return s.toBlob().then(function(e){var t,n,o,r=u.editorUpload.blobCache,i=d.src,a=c.type===e.type;return u.getParam("images_reuse_filename",!1,"boolean")&&(n=h(o=r.getByUri(i))?(i=o.uri(),t=o.name(),o.filename()):(t=ae(u,i,2),ae(u,i,1))),o=r.create({id:"imagetools"+we++,blob:e,base64:s.toBase64(),uri:i,name:t,filename:a?n:void 0}),r.add(o),u.undoManager.transact(function(){var r=function(){var e,t,n;u.$(d).off("load",r),u.nodeChanged(),f?u.editorUpload.uploadImagesAuto():(se(l),e=u,t=l,n=pe.setEditorTimeout(e,function(){e.editorUpload.uploadImagesAuto()},e.getParam("images_upload_timeout",3e4,"number")),t.set(n))};u.$(d).on("load",r),m&&u.$(d).attr({width:m.w,height:m.h}),u.$(d).attr({src:o.blobUri()}).removeAttr("data-mce-src")}),o})}function le(r,o,e,i){return function(){return ie(r).fold(function(){oe(r,"Could not find selected image")},function(n){return r._scanForImages().then(function(){return ce(r,n.dom)}).then(function(t){return W(t).then(e).then(function(e){return fe(r,t,e,!1,o,n.dom,i)})}).catch(function(e){oe(r,e)})})}}function de(t,n,r){return function(){var e=ie(t).map(function(e){var t=Y(e.dom);return t?{w:t.h,h:t.w}:null}).getOrNull();return le(t,n,function(e){return n=r,(t=e).toCanvas().then(function(e){return V(e,t.getType(),n)});var t,n},e)()}}function me(e,t,r){return function(){return le(e,t,function(e){return n=r,(t=e).toCanvas().then(function(e){return G(e,t.getType(),n)});var t,n})()}}function he(s,f){return function(){var n=ie(s),i=n.map(function(e){return Z(e.dom)});n.each(function(t){re(s,t.dom).each(function(e){ce(s,t.dom).then(function(e){var t={blob:e,url:URL.createObjectURL(e)};s.windowManager.open({title:"Edit Image",size:"large",body:{type:"panel",items:[{type:"imagetools",name:"imagetools",label:"Edit Image",currentState:t}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0,disabled:!0}],onSubmit:function(e){var o=e.getData().imagetools.blob;n.each(function(r){i.each(function(e){var t,n,a,u,c;t=s,n=f,a=r.dom,u=e,M(c=o).then(function(e){var t,n,r,o,i=Z(e);return u.w===i.w&&u.h===i.h||Y(a)&&(t=a,(n=i)&&(r=t.style.width,o=t.style.height,(r||o)&&(t.style.width=n.w+"px",t.style.height=n.h+"px",t.removeAttribute("data-mce-style")),r=t.width,o=t.height,(r||o)&&(t.setAttribute("width",String(n.w)),t.setAttribute("height",String(n.h))))),URL.revokeObjectURL(e.src),c}).then(W).then(function(e){return fe(t,c,e,!0,n,a)})})}),e.close()},onCancel:r,onAction:function(e,t){switch(t.name){case"save-state":t.value?e.enable("save"):e.disable("save");break;case"disable":e.disable("save"),e.disable("cancel");break;case"enable":e.enable("cancel")}}})})})})}}function ge(t){function n(e){return function(){return t.execCommand(e)}}function e(){return ie(t).exists(function(e){return re(t,e.dom).isSome()})}function r(t){function i(e){return t.setDisabled(!e)}return i(e()),o=o.concat([i]),function(){o=function(e){for(var t=[],n=0,r=e.length;n<r;n++){var o=e[n];o!==i&&t.push(o)}return t}(o)}}var o=[];t.on("NodeChange",function(){var t=e();T(o,function(e){return e(t)})}),t.ui.registry.addButton("rotateleft",{tooltip:"Rotate counterclockwise",icon:"rotate-left",onAction:n("mceImageRotateLeft"),onSetup:r}),t.ui.registry.addButton("rotateright",{tooltip:"Rotate clockwise",icon:"rotate-right",onAction:n("mceImageRotateRight"),onSetup:r}),t.ui.registry.addButton("flipv",{tooltip:"Flip vertically",icon:"flip-vertically",onAction:n("mceImageFlipVertical"),onSetup:r}),t.ui.registry.addButton("fliph",{tooltip:"Flip horizontally",icon:"flip-horizontally",onAction:n("mceImageFlipHorizontal"),onSetup:r}),t.ui.registry.addButton("editimage",{tooltip:"Edit image",icon:"edit-image",onAction:n("mceEditImage"),onSetup:r}),t.ui.registry.addButton("imageoptions",{tooltip:"Image options",icon:"image",onAction:n("mceImage")}),t.ui.registry.addContextMenu("imagetools",{update:function(e){return re(t,e).map(function(e){return{text:"Edit image",icon:"edit-image",onAction:n("mceEditImage")}}).toArray()}})}"undefined"!=typeof window||Function("return this;")();var pe=tinymce.util.Tools.resolve("tinymce.util.Delay"),ve=tinymce.util.Tools.resolve("tinymce.util.Promise"),ye=tinymce.util.Tools.resolve("tinymce.util.URI"),we=0,be=function(e,t){var n=t.src;return 0===n.indexOf("data:")||0===n.indexOf("blob:")||new ye(n).host===e.documentBaseURI.host},_e=function(e,t){return-1!==f.inArray(e.getParam("imagetools_cors_hosts",[],"string[]"),new ye(t.src).host)};o.add("imagetools",function(e){var t,r,o,i,n=c(0),a=c(null),u=e;f.each({mceImageRotateLeft:de(u,n,-90),mceImageRotateRight:de(u,n,90),mceImageFlipVertical:me(u,n,"v"),mceImageFlipHorizontal:me(u,n,"h"),mceEditImage:he(u,n)},function(e,t){u.addCommand(t,e)}),ge(e),(t=e).ui.registry.addContextToolbar("imagetools",{items:t.getParam("imagetools_toolbar","rotateleft rotateright flipv fliph editimage imageoptions"),predicate:function(e){return re(t,e).isSome()},position:"node",scope:"node"}),o=n,i=a,(r=e).on("NodeChange",function(e){var t=i.get(),n=re(r,e.element);t&&!n.exists(function(e){return t.src===e.src})&&(se(o),r.editorUpload.uploadImagesAuto(),i.set(null)),n.each(i.set)})})}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.9.2 (2021-09-08)
7
+ * Version: 5.10.0 (2021-10-11)
8
8
  */
9
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;-1===r.indexOf(".mce-")&&(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;e.add("importcss",function(t){return r(t),e=t,{convertSelectorToFormat:function(t){return h(e,t)}};var e})}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.9.2 (2021-09-08)
7
+ * Version: 5.10.0 (2021-10-11)
8
8
  */
9
- !function(){"use strict";function m(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 l(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 d(e,t){var n,r,a,i,o,u;e.getParam("insertdatetime_element",!1)?(n=l(e,t),r=/%[HMSIp]/.test(t)?l(e,"%Y-%m-%dT%H:%M"):l(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(l(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(" "),p=tinymce.util.Tools.resolve("tinymce.util.Tools");e.add("insertdatetime",function(e){var t,n,r,a,i,o,u,c;(t=e).addCommand("mceInsertDate",function(){d(t,t.getParam("insertdatetime_dateformat",t.translate("%Y-%m-%d")))}),t.addCommand("mceInsertTime",function(){d(t,m(t))}),u=s(n=e),r=0<(o=s(i=n)).length?o[0]:m(i),a=r,c={get:function(){return a},set:function(e){a=e}},n.ui.registry.addSplitButton("insertdatetime",{icon:"insert-time",tooltip:"Insert date/time",select:function(e){return e===c.get()},fetch:function(e){e(p.map(u,function(e){return{type:"choiceitem",text:l(n,e),value:e}}))},onAction:function(e){d(n,c.get())},onItemAction:function(e,t){c.set(t),d(n,t)}}),n.ui.registry.addNestedMenuItem("insertdatetime",{icon:"insert-time",text:"Date/time",getSubmenuItems:function(){return p.map(u,function(e){return{type:"menuitem",text:l(n,e),onAction:(t=e,function(){c.set(t),d(n,t)})};var t})}})})}();
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,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.9.2 (2021-09-08)
7
+ * Version: 5.10.0 (2021-10-11)
8
8
  */
9
- !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=tinymce.util.Tools.resolve("tinymce.util.Tools");e.add("legacyoutput",function(e){var s,t;console.warn("The legacyoutput plugin has been deprecated and marked for removal in TinyMCE 6.0"),(t=s=e).settings.inline_styles=!1,t.getParam("fontsize_formats")||(t.settings.fontsize_formats="8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7"),t.getParam("font_formats")||(t.settings.font_formats="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats"),s.on("PreInit",function(){var e=s,t="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table",i=l.explode(e.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large")),a=e.schema;e.formatter.register({alignleft:{selector:t,attributes:{align:"left"}},aligncenter:{selector:t,attributes:{align:"center"}},alignright:{selector:t,attributes:{align:"right"}},alignjustify:{selector:t,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all",preserve_attributes:["class","style"]},{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all",preserve_attributes:["class","style"]},{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"strike",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",toggle:!1,attributes:{face:"%value"}},fontsize:{inline:"font",toggle:!1,attributes:{size:function(e){return String(l.inArray(i,e.value)+1)}}},forecolor:{inline:"font",attributes:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0}}),l.each("b,i,u,strike".split(","),function(e){a.addValidElements(e+"[*]")}),a.getElementRule("font")||a.addValidElements("font[face|size|color|style]"),l.each(t.split(","),function(e){var t=a.getElementRule(e);t&&(t.attributes.align||(t.attributes.align={},t.attributesOrder.push("align")))})})})}();
9
+ !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=tinymce.util.Tools.resolve("tinymce.util.Tools");e.add("legacyoutput",function(e){var s,t;(t=s=e).settings.inline_styles=!1,t.getParam("fontsize_formats")||(t.settings.fontsize_formats="8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7"),t.getParam("font_formats")||(t.settings.font_formats="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats"),s.on("PreInit",function(){var e=s,t="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table",i=l.explode(e.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large")),a=e.schema;e.formatter.register({alignleft:{selector:t,attributes:{align:"left"}},aligncenter:{selector:t,attributes:{align:"center"}},alignright:{selector:t,attributes:{align:"right"}},alignjustify:{selector:t,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all",preserve_attributes:["class","style"]},{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all",preserve_attributes:["class","style"]},{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"strike",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",toggle:!1,attributes:{face:"%value"}},fontsize:{inline:"font",toggle:!1,attributes:{size:function(e){return String(l.inArray(i,e.value)+1)}}},forecolor:{inline:"font",attributes:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0}}),l.each("b,i,u,strike".split(","),function(e){a.addValidElements(e+"[*]")}),a.getElementRule("font")||a.addValidElements("font[face|size|color|style]"),l.each(t.split(","),function(e){var t=a.getElementRule(e);t&&(t.attributes.align||(t.attributes.align={},t.attributesOrder.push("align")))})})})}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.9.2 (2021-09-08)
7
+ * Version: 5.10.0 (2021-10-11)
8
8
  */
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"),s=function(t){return u===t},f=n("boolean"),p=n("function"),m=i(!1),g=i(!(u=null)),v={fold:function(t,n){return t()},isSome:m,isNone:g,getOr:e,getOrThunk:k,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:e,orThunk:k,map:o,each:h,bind:o,exists:m,forall:g,filter:function(){return v},toArray:function(){return[]},toString:i("none()")};function k(t){return t()}function y(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 P(t){return t.getParam("rel_list",[],"array")}function T(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)&&!!ht(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(),pt(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=y(["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<P(n).length||!1!==T(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,pt(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;t.hasPlugin("rtc",!0)?t.execCommand("createlink",!1,(i=e.class,u=e.href,a=e.rel,l=e.target,c=e.text,f=e.title,R({class:i.getOrNull(),href:u,rel:a.getOrNull(),target:l.getOrNull(),text:c.getOrNull(),title:f.getOrNull()},function(t,n){return!1===s(t)},(r=o={},function(t,n){r[n]=t}),h),o)):V(t,n,e)}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();pt(a)?vt(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);At(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};wt(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=xt(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=ht(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=function(t){return t.getAttribute("data-mce-href")||t.getAttribute("href")},pt=function(t){return t&&"FIGURE"===t.nodeName&&/\bimage\b/i.test(t.className)},vt=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))},yt=function(e,t){return b(t,function(t){return D(n=t,"items")&&void 0!==n.items&&null!==n.items?yt(e,t.items):w(t.value===e,t);var n})},xt=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?yt(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()))}}},bt=tinymce.util.Tools.resolve("tinymce.util.Delay"),Ot=tinymce.util.Tools.resolve("tinymce.util.Promise"),wt=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 Ot.resolve(a)},function(i){return new Ot(function(n){var e=u,t=i.message,r=function(t){n(t?i.preprocess(a):a)},o=e.selection.getRng();bt.setEditorTimeout(e,function(){e.windowManager.confirm(t,function(t){e.selection.setRng(o),r(t)})})})});var e,r},Ct=tinymce.util.Tools.resolve("tinymce.util.XHR"),Nt=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],At=function(m,g){return t=(e=m).getParam("link_list"),new Ot(function(n){l(t)?Ct.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())}}):p(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(Nt)}):!1===f?it.none():it.some(Nt)),rels:function(t,n){var e=P(t);if(0<e.length){var r=O(n,"_blank");return(!1===T(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?ht(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")})})}();
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")})})}();