!function(f){"use strict";vart,n,e,r,o,a=function(t){varn=t,e=function(){returnn};return{get:e,set:function(t){n=t},clone:function(){returna(e())}}},i=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(){},c=function(t){returnfunction(){returnt}},s=function(t){returnt},l=c(!1),d=c(!0),m=l,g=d,p=function(){returnh},h=(r={fold:function(t,n){returnt()},is:m,isSome:m,isNone:g,getOr:e=function(t){returnt},getOrThunk:n=function(t){returnt()},getOrDie:function(t){thrownewError(t||"error: getOrDie called on none.")},getOrNull:function(){returnnull},getOrUndefined:function(){returnundefined},or:e,orThunk:n,map:p,ap:p,each:function(){},bind:p,flatten:p,exists:m,forall:g,filter:p,equals:t=function(t){returnt.isNone()},equals_:t,toArray:function(){return[]},toString:c("none()")},Object.freeze&&Object.freeze(r),r),v=function(e){vart=function(){returne},n=function(){returno},r=function(t){returnt(e)},o={fold:function(t,n){returnn(e)},is:function(t){returne===t},isSome:g,isNone:m,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){returnv(t(e))},ap:function(t){returnt.fold(p,function(t){returnv(t(e))})},each:function(t){t(e)},bind:r,flatten:t,exists:r,forall:r,filter:function(t){returnt(e)?o:h},equals:function(t){returnt.is(e)},equals_:function(t,n){returnt.fold(m,function(t){returnn(e,t)})},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};returno},y={some:v,none:p,from:function(t){returnnull===t||t===undefined?h:v(t)}},k=function(n){returnfunction(t){returnfunction(t){if(null===t)return"null";varn=typeoft;return"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}(t)===n}},b=k("string"),O=k("object"),w=k("array"),E=k("function"),C=Array.prototype.slice,x=(o=Array.prototype.indexOf)===undefined?function(t,n){returnS(t,n)}:function(t,n){returno.call(t,n)},T=function(t,n){for(vare=t.length,r=newArray(e),o=0;o<e;o++){vara=t[o];r[o]=n(a,o,t)}returnr},N=function(t,n){for(vare=0,r=t.length;e<r;e++){n(t[e],e,t)}},R=function(t,n){for(vare=[],r=0,o=t.length;r<o;r++){vara=t[r];n(a,r,t)&&e.push(a)}returne},P=function(t,n,e){returnfunction(t,n){for(vare=t.length-1;0<=e;e--)n(t[e],e,t)}(t,function(t){e=n(e,t)}),e},S=function(t,n){for(vare=0,r=t.length;e<r;++e)if(t[e]===n)returne;return-1},M=function(t,n){for(vare=0,r=t.length;e<r;++e){if(!0!==n(t[e],e,t))return!1}return!0},A=(E(Array.from)&&Array.from,Object.keys),D=Object.hasOwnProperty,j=function(t,n){returnD.call(t,n)},B=function(i){if(!w(i))thrownewError("cases must be an array");if(0===i.length)thrownewError("there must be at least one case");varu=[],e={};returnN(i,function(t,r){varn=A(t);if(1!==n.length)thrownewError("one and only one name per case");varo=n[0],a=t[o];if(e[o]!==undefined)thrownewError("duplicate key detected:"+o);if("cata"===o)thrownewError("cannot have a case named cata (sorry)");if(!w(a))thrownewError("case arguments must be an array");u.push(o),e[o]=function(){vart=arguments.length;if(t!==a.length)thrownewError("Wrong number of arguments to case "+o+". Expected "+a.length+" ("+a+"), got "+t);for(vare=newArray(t),n=0;n<e.length;n++)e[n]=arguments[n];return{fold:function(){if(arguments.length!==i.length)thrownewError("Wrong number of arguments to fold. Expected "+i.length+", got "+arguments.length);returnarguments[r].apply(null,e)},match:function(t){varn=A(t);if(u.length!==n.length)thrownewError("Wrong number of arguments to match. Expected: "+u.join(",")+"\nActual: "+n.join(","));if(!M(u,function(t){return-1<x(n,t)}))thrownewError("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+u.join(", "));returnt[o].apply(null,e)},log:function(t){f.console.log(t,{constructors:u,constructor:o,params:e})}}}}),e},I=(B([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","v