/** * 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.1.4 (2019-12-11) */ !function(){"use strict";function e(){}function a(e){return function(){return e}}var t=tinymce.util.Tools.resolve("tinymce.PluginManager");function c(e,t){if((e=""+e).length&]/g,function(e){return function(e,t){return B(e,t)?L.from(e[t]):L.none()}(E,e).getOr(e)})}function k(t){return function(e){R(t,e)}}var I,J=function(n){function e(){return o}function t(e){return e(n)}var r=a(n),o={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:f,isNone:u,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:e,orThunk:e,map:function(e){return J(e(n))},each:function(e){e(n)},bind:t,exists:t,forall:t,filter:function(e){return e(n)?o:w},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(u,function(e){return t(n,e)})}};return o},L={some:J,none:n,from:function(e){return null===e||e===undefined?w:J(e)}},Y=(I="function",function(e){return function(e){if(null===e)return"null";var t=typeof e;return"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}(e)===I}),j=Array.prototype.slice,q=(Y(Array.from)&&Array.from,tinymce.util.Tools.resolve("tinymce.util.Promise")),F=Object.hasOwnProperty,B=function(e,t){return F.call(e,t)},E={'"':""","<":"<",">":">","&":"&","'":"'"},R=function(i,t){function e(e){return function(e,t){for(var n=e.length,r=new Array(n),o=0;o")){var n="";p.each(t.contentCSS,function(e){n+=''});var r=t.settings.body_class||"";-1!==r.indexOf("=")&&(r=(r=t.getParam("body_class","","hash"))[t.id]||"");var o=t.dom.encode,a=t.getBody().dir,u=a?' dir="'+o(a)+'"':"";e=""+n+'"+e+""}return S(e,y(t))}(i,n),o=[{type:"selectbox",name:"template",label:"Templates",items:c},{type:"htmlpanel",html:'

'+H(t.value.description)+"

"},{label:"Preview",type:"iframe",name:"preview",sandboxed:!1}],a={template:t.text,preview:r};e.unblock(),e.redial(u(o,a)),e.focus("template")},t=i.windowManager.open(u([],{template:"",preview:""}));t.block("Loading..."),l(n[0]).then(function(e){r(t,n[0],e)})})},z=function(e){e.ui.registry.addButton("template",{icon:"template",tooltip:"Insert template",onAction:M(e.settings,k(e))}),e.ui.registry.addMenuItem("template",{icon:"template",text:"Insert template...",onAction:M(e.settings,k(e))})};!function U(){t.add("template",function(e){z(e),P(e),A(e)})}()}();