!function(s){"use strict";varr=function(t){vare=t,n=function(){returne};return{get:n,set:function(t){e=t},clone:function(){returnr(n())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),$=tinymce.util.Tools.resolve("tinymce.util.Tools");functionn(t,e){returni(s.document.createElement("canvas"),t,e)}functiono(t){returnt.getContext("2d")}functioni(t,e,n){returnt.width=e,t.height=n,t}varh={create:n,clone:function(t){vare;returno(e=n(t.width,t.height)).drawImage(t,0,0),e},resize:i,get2dContext:o,get3dContext:function(t){vare=null;try{e=t.getContext("webgl")||t.getContext("experimental-webgl")}catch(n){}returne||(e=null),e}},p={getWidth:function(t){returnt.naturalWidth||t.width},getHeight:function(t){returnt.naturalHeight||t.height}},g=window.Promise?window.Promise:function(){vart=function(t){if("object"!=typeofthis)thrownewTypeError("Promises must be constructed via new");if("function"!=typeoft)thrownewTypeError("not a function");this._state=null,this._value=null,this._deferreds=[],l(t,r(o,this),r(a,this))},e=t.immediateFn||"function"==typeofwindow.setImmediate&&window.setImmediate||function(t){s.setTimeout(t,1)};functionr(t,e){returnfunction(){t.apply(e,arguments)}}varn=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};functioni(r){varo=this;null!==this._state?e(function(){vart=o._state?r.onFulfilled:r.onRejected;if(null!==t){vare;try{e=t(o._value)}catch(n){returnvoidr.reject(n)}r.resolve(e)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}functiono(t){try{if(t===this)thrownewTypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeoft||"function"==typeoft)){vare=t.then;if("function"==typeofe)returnvoidl(r(e,t),r(o,this),r(a,this))}this._state=!0,this._value=t,u.call(this)}catch(n){a.call(this,n)}}functiona(t){this._state=!1,this._value=t,u.call(this)}functionu(){for(vart=0,e=this._deferreds.length;t<e;t++)i.call(this,this._deferreds[t]);this._deferreds=null}functionc(t,e,n,r){this.onFulfilled="function"==typeoft?t:null,this.onRejected="function"==typeofe?e:null,this.resolve=n,this.reject=r}functionl(t,e,n){varr=!1;try{t(function(t){r||(r=!0,e(t))},function(t){r||(r=!0,n(t))})}catch(o){if(r)return;r=!0,n(o)}}returnt.prototype["catch"]=function(t){returnthis.then(null,t)},t.prototype.then=function(n,r){varo=this;returnnewt(function(t,e){i.call(o,newc(n,r,t,e))})},t.all=function(){varc=Array.prototype.slice.call(1===arguments.length&&n(arguments[0])?arguments[0]:arguments);returnnewt(function(o,i){if(0===c.length)returno([]);vara=c.length;functionu(e,t){try{if(t&&("object"==typeoft||"function"==typeoft)){varn=t.then;if("function"==typeofn)returnvoidn.call(t,function(t){u(e,t)},i)}c[e]=t,0==--a&&o(c)}catch(r){i(r)}}for(vart=0;t<c.length;t++)u(t,c[t])})},t.resolve=function(e){returne&&"object"==typeofe&&e.constructor===t?e:newt(function(t){t(e)})},t.reject=function(n){returnnewt(function(t,e){e(n)})},t.race=function(o){returnnewt(function(t,e){for(varn=0,r=o.length;n<r;n++)o[n].then(t,e)})},t}(),a=function(t){returnfunction(){returnt}};functionu(r){for(varo=[],t=1;t<arguments.length;t++)o[t-1]=arguments[t];returnfunction(){for(vart=[],e=0;e<arguments.length;e++)t[e]=arguments[e];varn=o.concat(t);returnr.apply(null,n)}}varc,l,f,d,m=a(!1),y=a(!0),v=m,b=y,w=function(){returnx},x=(d={fold:function(t,e){returnt()},is:v,isSome:v,isNone:b,getOr:f=function(t){returnt},getOrThunk:l=function(t){returnt()},getOrDie:function(t){thrownewError(t||"error: getOrDie called on none.")},getOrNull:function(){returnnull},getOrUndefined:function(){returnundefined},or:f,orThunk:l,map:w,ap:w,each:function(){},bind:w,flatten:w,exists:v,forall:b,filter:w,equals:c=function(t){returnt.isNone()},equals_:c,toArray:function(){return[]},toString:a("none()")},Object.freeze&&Object.freeze(d),d),I=function(n){vart=function(){returnn},e=function(){returno},r=function(t){returnt(n)},o={fold:function(t,e){returne(n)},is:function(t){returnn===t},isSome:b,isNone:v,getOr:t,getOrThunk: