9 lines
12 KiB
JavaScript
9 lines
12 KiB
JavaScript
|
/**
|
||
|
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
|
||
|
* Licensed under the LGPL or a commercial license.
|
||
|
* For LGPL see License.txt in the project root for license information.
|
||
|
* For commercial licenses see https://www.tiny.cloud/
|
||
|
*
|
||
|
* Version: 5.8.1 (2021-05-20)
|
||
|
*/
|
||
|
!function(){"use strict";var c=function(n){var e=n;return{get:function(){return e},set:function(n){e=n}}},n=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(n){return{isFullscreen:function(){return null!==n.get()}}},e=function(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}},t=function(e){return function(n){return typeof n===e}},r=e("string"),o=e("array"),u=t("boolean"),l=function(n){return!(null===(e=n)||e===undefined);var e},f=t("function"),a=t("number"),d=function(){},s=function(n){return function(){return n}};var m,h,g,p=s(!1),v=s(!0),y=function(){return w},w=(m=function(n){return n.isNone()},{fold:function(n,e){return n()},is:p,isSome:p,isNone:v,getOr:g=function(n){return n},getOrThunk:h=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:s(null),getOrUndefined:s(undefined),or:g,orThunk:h,map:y,each:d,bind:y,exists:p,forall:v,filter:y,equals:m,equals_:m,toArray:function(){return[]},toString:s("none()")}),b=function(t){var n=s(t),e=function(){return o},r=function(n){return n(t)},o={fold:function(n,e){return e(t)},is:function(n){return t===n},isSome:v,isNone:p,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:e,orThunk:e,map:function(n){return b(n(t))},each:function(n){n(t)},bind:r,exists:r,forall:r,filter:function(n){return n(t)?o:w},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(n){return n.is(t)},equals_:function(n,e){return n.fold(p,function(n){return e(t,n)})}};return o},S={some:b,none:y,from:function(n){return null===n||n===undefined?w:b(n)}},E=function(){return n=function(n){return n.unbind()},e=c(S.none()),t=function(){return e.get().each(n)},{clear:function(){t(),e.set(S.none())},isSet:function(){return e.get().isSome()},set:function(n){t(),e.set(S.some(n))}};var n,e,t},F=Array.prototype.push,T=function(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},x=function(n,e){for(var t=0,r=n.length;t<r;t++){e(n[t],t)}},D=function(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},k=function(n,e){return function(n){for(var e=[],t=0,r=n.length;t<r;++t){if(!o(n[t]))throw new Error("Arr.flatten item "+t+" was not an array, input: "+n);F.apply(e,n[t])}return e}(T(n,e))},C=function(n){return e=n,(t=0)<=t&&t<e.length?S.some(e[t]):S.none();var e,t},O=Object.keys,A=function(n){return n.style!==undefined&&f(n.style.getPropertyValue)},N=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:n}},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 N(t.childNodes[0])},fromTag:function(n,e){var t=(e||document).createElement(n);return N(t)},fromText:function(n,e){var t=(e||document).createTextNode(n);return N(t)},fromDom:N,fromPoint:function(n,e,t){return S.from(n.dom.elementFromPoint(e,t)).map(N)}},P=("undefined"!=typeof window||Function("return this;")(),function(e){return function(n){return n.dom.nodeType===e}}),L=P(1),q=P(3),H=P(9),R=P(11),V=function(n,e){var t=n.dom;if(1!==t.nodeType)return!1;var r=t;if(r.matches!==undefined)return r.matches(e);if(r.msMatchesSelector!==undefined)return r.msMatchesSelector(e);if(r.webkitMatchesSelector!==undefined)return r.webkitMatchesSelector(e);if(r.mozMatchesSelector!==undefined)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},W=function(n){return M.fromDom(n.dom.ownerDocument)},B=function(t){var n;return n=t,S.from(n.dom.parentNode).map(M.fromDom).map(j).map(function(n){return D(n,function(n){return e=n,t.dom!==e.dom;var e})}).getOr([])},j=function(n){return T(n.dom.childNodes,M.fromDom)},z=f(Element.prototy
|