!function(){"use strict";functionf(t,e,n){t.execCommand("UL"===e?"InsertUnorderedList":"InsertOrderedList",!1,!1===n?null:{"list-style-type":n})}functioni(t){returnfunction(){returnt}}functiont(t){returnt}functione(){returns}varn=tinymce.util.Tools.resolve("tinymce.PluginManager"),g=tinymce.util.Tools.resolve("tinymce.util.Tools"),u=i(!1),l=i(!0),s={fold:function(t,e){returnt()},isSome:u,isNone:l,getOr:t,getOrThunk:r,getOrDie:function(t){thrownewError(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void0),or:t,orThunk:r,map:e,each:function(){},bind:e,exists:u,forall:l,filter:function(){returns},toArray:function(){return[]},toString:i("none()")};functionr(t){returnt()}functiond(t){returnt&&/^(TH|TD)$/.test(t.nodeName)}functionm(c,a){returnfunction(s){functiont(t){vare,n,r,o,i,u,l;s.setActive((e=c,r=a,i=-1!==(o=function(t,e){for(varn=0;n<t.length;n++)if(e(t[n]))returnn;return-1}((n=t).parents,d))?n.parents.slice(0,o):n.parents,0<(u=g.grep(i,(l=e,function(t){returnt&&/^(OL|UL|DL)$/.test(t.nodeName)&&(e=t,l.$.contains(l.getBody(),e));vare}))).length&&u[0].nodeName===r))}returnc.on("NodeChange",t),function(){returnc.off("NodeChange",t)}}}functionc(t,e,n,r,o,i){varu,l,s,c,a,d;1<i.length?(c=r,a=o,d=i,(s=t).ui.registry.addSplitButton(e,{tooltip:n,icon:"OL"===a?"ordered-list":"unordered-list",presets:"listpreview",columns:3,fetch:function(t){t(g.map(d,function(t){return{type:"choiceitem",value:"default"===t?"":t,icon:"list-"+("OL"===a?"num":"bull")+"-"+("disc"===t||"decimal"===t?"default":t),text:t.replace(/\-/g," ").replace(/\b\w/g,function(t){returnt.toUpperCase()})}}))},onAction:function(){returns.execCommand(c)},onItemAction:function(t,e){f(s,a,e)},select:function(e){vart,n=(t=s).dom.getParent(t.selection.getNode(),"ol,ul"),r=t.dom.getStyle(n,"listStyleType");returnp(r).map(function(t){returne===t}).getOr(!1)},onSetup:m(s,a)})):(l=r,(u=t).ui.registry.addToggleButton(e,{active:!1,tooltip:n,icon:"OL"===o?"ordered-list":"unordered-list",onSetup:m(u,o),onAction:function(){returnu.execCommand(l)}}))}vara=function(n){functiont(){returno}functione(t){returnt(n)}varr=i(n),o={fold:function(t,e){returne(n)},isSome:l,isNone:u,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:t,orThunk:t,map:function(t){returna(t(n))},each:function(t){t(n)},bind:e,exists:e,forall:e,filter:function(t){returnt(n)?o:s},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};returno},p=function(t){returnnull==t?s:a(t)};n.add("advlist",function(t){varn,e,r,o;t.hasPlugin("lists")?(c(e=t,"numlist","Numbered list","InsertOrderedList","OL",(r=e.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman"))?r.split(/[ ,]/):[]),c(e,"bullist","Bullet list","InsertUnorderedList","UL",(o=e.getParam("advlist_bullet_styles","default,circle,square"))?o.split(/[ ,]/):[]),(n=t).addCommand("ApplyUnorderedListStyle",function(t,e){f(n,"UL",e["list-style-type"])}),n.addCommand("ApplyOrderedListStyle",function(t,e){f(n,"OL",e["list-style-type"])})):console.error("Please use the Lists plugin together with the Advanced List plugin.")})}();