!function(){"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(document.createElement("canvas"),t,e)}functiono(t){returnt.getContext("2d")}functioni(t,e,n){returnt.width=e,t.height=n,t}vara,u,c,l,h={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"==typeofsetImmediate&&setImmediate||function(t){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}(),s=function(t){returnfunction(){returnt}},f=function(i){for(vart=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];for(vara=newArray(arguments.length-1),n=1;n<arguments.length;n++)a[n-1]=arguments[n];returnfunction(){for(vart=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(varn=newArray(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];varo=a.concat(n);returni.apply(null,o)}},d=s(!1),m=s(!0),y=d,v=m,b=function(){returnw},w=(l={fold:function(t,e){returnt()},is:y,isSome:y,isNone:v,getOr:c=function(t){returnt},getOrThunk:u=function(t){returnt()},getOrDie:function(t){thrownewError(t||"error: getOrDie called on none.")},getOrNull:function(){returnnull},getOrUndefined:function(){returnundefined},or:c,orThunk:u,map:b,ap:b,each:function(){},bind:b,flatten:b,exists:y,forall:v,filter:b,equals:a=function(t){returnt.isNone()},equals_:a,toArray:function(){return[]},toString:s("none()")},Object.freeze&&Object.freeze(l),l),x=function(n){vart=function(){returnn},e=function(