/** * 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.9.2 (2021-09-08) */ !function(){"use strict";function t(o){return function(t){return e=typeof(n=t),(null===n?"null":"object"==e&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"==e&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":e)===o;var n,e}}function n(n){return function(t){return typeof t===n}}function e(n){return function(t){return n===t}}function g(t){return null==t}function f(t){return!g(t)}function d(t,n){if(c(t)){for(var e=0,o=t.length;e=n.length&&t.substr(e,e+n.length)===n}function Cn(t,n){return-1!==t.indexOf(n)}function On(t){return 0 "+o.toString()},function(t,n){return"state("+t+")"})}).join("\n")+"}"}}},ne=r(zt,te),ee=tt(Zn),oe=Lt(u,"number"),re=Lt(y,"string"),ie=Lt(w,"boolean"),ue=Lt(m,"function"),ae=function(n){if(Object(n)!==n)return!0;switch({}.toString.call(n).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(n).every(function(t){return ae(n[t])});default:return!1}},ce=It(function(t){return ae(t)?zn(t):Nn("Expected value to be acceptable for sending via postMessage")}),se=function(t){return"Errors: \n"+A(10<(n=t.errors).length?n.slice(0,10).concat([{path:[],getErrorInfo:tt("... (only showing first ten failures)")}]):n,function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}).join("\n")+"\n\nInput object: "+Mt(t.input);var n},le=ht,fe=function(t,n){return{tag:"custom",newKey:t,instantiator:n}},de={fromHtml:function(t,n){var e=(n||document).createElement("div");if(e.innerHTML=t,!e.hasChildNodes()||1 "):r[0].name;return Ae(u,{handler:e,purpose:o})})});return n={},e=[],o=[],dt(c,function(t){t.fold(function(t){e.push(t)},function(t){o.push(t)})}),0<(u={errors:e,values:o}).errors.length?mt.error(lt(u.errors)):(i=n,0===(r=u.values).length?mt.value(i):mt.value(Jn(i,$n.apply(void 0,r))))},su="alloy.base.behaviour",lu=te([le("dom","dom",Tt(),te([Jt("tag"),dn("styles",{}),dn("classes",[]),dn("attributes",{}),rn("value"),rn("innerHtml")])),Jt("components"),Jt("uid"),dn("events",{}),dn("apis",{}),le("eventOrder","eventOrder",((Ii={})[Eo()]=["disabling",su,"toggling","typeaheadevents"],Ii[Co()]=[su,"focusing","keying"],Ii[Io()]=[su,"disabling","toggling","representing"],Ii[ho()]=[su,"representing","streaming","invalidating"],Ii[No()]=[su,"representing","item-events","tooltipping"],Ii[uo()]=["focusing",su,"item-type-events"],Ii[eo()]=["focusing",su,"item-type-events"],Ii[lo()]=["item-type-events","tooltipping"],Ii[To()]=["receiving","reflecting","tooltipping"],At(tt(Ii))),ee()),rn("domModification")]),fu=function(t,n,e){return t.isSome()&&n.isSome()?ft.some(e(t.getOrDie(),n.getOrDie())):ft.none()},du=function(t){var n=Vi(t)?t.dom.parentNode:t.dom;if(null==n||null===n.ownerDocument)return!1;var e,o,r=n.ownerDocument;return Wi(de.fromDom(n)).fold(function(){return r.body.contains(n)},(e=du,o=pr,function(t){return e(o(t))}))},mu=function(){return gu(de.fromDom(document))},gu=function(t){var n=t.dom.body;if(null==n)throw new Error("Body is not available yet");return de.fromDom(n)},pu=function(t,n){return Qr(t)?t.style.getPropertyValue(n):""},hu=function(t){var n=Yt("external.component",Ht([Jt("element"),rn("uid")]),t),e=wn(Fr()),o=n.uid.getOrThunk(function(){return nu("external")});tu(n.element,o);var r={uid:o,getSystem:e.get,config:ft.none,hasConfigured:O,connect:function(t){e.set(t)},disconnect:function(){e.set(Fr(function(){return r}))},getApis:function(){return{}},element:n.element,spec:t,readState:tt("No state"),syncComponents:ct,components:tt([]),events:{}};return Rr(r)},vu=nu,bu=function(u){return kt(u,iu).getOrThunk(function(){var t,n,e,o,r,i=Kn(u,"uid")?u:st({uid:vu("")},u);return t=eu(i),n=t.events,e=s(t,["events"]),o=A(kt(e,"components").getOr([]),bu),r=st(st({},e),{events:st(st({},qi),n),components:o}),mt.value(gi(r)).getOrDie()})},yu=Rr,xu=hi("height",function(t){var n=t.dom;return du(t)?n.getBoundingClientRect().height:n.offsetHeight}),wu=function(e,o){return{left:e,top:o,translate:function(t,n){return wu(e+t,o+n)}}},Su=wu,ku=function(t){var n,e=t.dom,o=e.ownerDocument.body;return o===e?Su(o.offsetLeft,o.offsetTop):du(t)?(n=e.getBoundingClientRect(),Su(n.left,n.top)):Su(0,0)},Cu=hi("width",function(t){return t.dom.offsetWidth}),Ou=function(t,n,e,o){t.dom.removeEventListener(n,e,o)},_u=function(o,t){return o.view(t).fold(tt([]),function(t){var n=o.owner(t),e=_u(o,n);return[t].concat(e)})},Tu=Object.freeze({__proto__:null,view:function(t){var n;return(t.dom===document?ft.none():ft.from(null===(n=t.dom.defaultView)||void 0===n?void 0:n.frameElement)).map(de.fromDom)},owner:or});function Eu(t,n,e,o,r){return t(e,o)?ft.some(e):m(r)&&r(e)?ft.none():n(e,o,r)}function Du(t,n,e){for(var o=t.dom,r=m(e)?e:O;o.parentNode;){var o=o.parentNode,i=de.fromDom(o);if(n(i))return ft.some(i);if(r(i))break}return ft.none()}function Bu(t,n,e){return Eu(function(t,n){return n(t)},Du,t,n,e)}function Au(t,n,e){return Bu(t,n,e).isSome()}function Mu(t,n,e){return Du(t,function(t){return En(t,n)},e)}function Fu(t,n){return e=n,Dn(o=void 0===t?document:t.dom)?ft.none():ft.from(o.querySelector(e)).map(de.fromDom);var e,o}function Iu(t,n,e){return Eu(En,Mu,t,n,e)}function Ru(){var n=Ar("aria-owns");return{id:n,link:function(t){Or(t,"aria-owns",n)},unlink:function(t){Dr(t,"aria-owns")}}}var Vu,Pu,Hu=function(n,t){return Au(t,function(t){return Bn(t,n.element)},O)||(e=n,Bu(t,function(t){if(!Ri(t))return!1;var n=_r(t,"id");return void 0!==n&&-1"}),ee()),Nf=fe("schema",function(){return[rn("preprocess")]}),Lf=dn("defaults",tt({})),jf=dn("overrides",tt({})),Wf=te([Vf,Pf,Hf,zf,Lf,jf]),Uf=te([Vf,Pf,Hf,Lf,jf]),Gf=te([Vf,Pf,Hf,zf,Lf,jf]),Xf=te([Vf,Nf,Hf,Jt("unit"),zf,Lf,jf]),Yf=el(Rf.required,Wf),qf=el(Rf.external,Uf),Kf=el(Rf.optional,Gf),Jf=el(Rf.group,Xf),$f=tt("entirety"),Qf=Object.freeze({__proto__:null,required:Yf,external:qf,optional:Kf,group:Jf,asNamedPart:tl,name:nl,asCommon:function(t){return t.fold(h,h,h,h)},original:$f}),Zf=function(t,n){return{uiType:If(),owner:t,name:n}},td=Object.freeze({__proto__:null,generate:rl,generateOne:il,schemas:ul,names:al,substitutes:cl,components:sl,defaultUids:hl,defaultUidsSchema:vl,getAllParts:ml,getAllPartNames:gl,getPart:ll,getPartOrDie:fl,getParts:dl,getPartsOrDie:pl}),nd=function(t){return Kn(t,"uid")?t:st(st({},t),{uid:nu("uid")})},ed=Ht([Jt("name"),Jt("factory"),Jt("configFields"),dn("apis",{}),dn("extraApis",{})]),od=Ht([Jt("name"),Jt("factory"),Jt("configFields"),Jt("partFields"),dn("apis",{}),dn("extraApis",{})]),rd=Object.freeze({__proto__:null,getCurrent:function(t,n,e){return n.find(t)}}),id=xa({fields:[Jt("find")],name:"composing",apis:rd}),ud=["input","button","textarea","select"],ad=function(n,t,e){t.disableClass.each(function(t){Ur(n.element,t)}),(Cl(n,t)?function(t){Or(t.element,"disabled","disabled")}:function(t){Or(t.element,"aria-disabled","true")})(n),t.onDisabled(n)},cd=function(n,t,e){t.disableClass.each(function(t){Gr(n.element,t)}),(Cl(n,t)?function(t){Dr(t.element,"disabled")}:function(t){Or(t.element,"aria-disabled","false")})(n),t.onEnabled(n)},sd=Object.freeze({__proto__:null,enable:cd,disable:ad,isDisabled:Ol,onLoad:kl,set:function(t,n,e,o){(o?ad:cd)(t,n)}}),ld=Object.freeze({__proto__:null,exhibit:function(t,n){return Hr({classes:n.disabled()?n.disableClass.toArray():[]})},events:function(e,t){return Jo([Ue(Eo(),function(t,n){return Ol(t,e)}),ba(e,t,kl)])}}),fd=xa({fields:[bn("disabled",O),dn("useNative",!0),rn("disableClass"),Ku("onDisabled"),Ku("onEnabled")],name:"disabling",active:ld,apis:sd}),dd=Object.freeze({__proto__:null,dehighlightAll:function(t,n,e){return _l(t,n,0,[])},dehighlight:function(t,n,e,o){Ul(0,n,0,o)&&(Gr(o.element,n.highlightClass),n.onDehighlight(t,o),ze(o,qo()))},highlight:Tl,highlightFirst:function(n,e,t){Gl(n,e).each(function(t){Tl(n,e,0,t)})},highlightLast:function(n,e,t){Xl(n,e).each(function(t){Tl(n,e,0,t)})},highlightAt:function(n,e,t,o){var r,i,u;i=o,u=gs((r=n).element,"."+e.itemClass),ft.from(u[i]).fold(function(){return mt.error(new Error("No element found with index "+i))},r.getSystem().getByDom).fold(function(t){throw t},function(t){Tl(n,e,0,t)})},highlightBy:function(n,e,t,o){V(Yl(n,e),o).each(function(t){Tl(n,e,0,t)})},isHighlighted:Ul,getHighlighted:function(n,t,e){return Fu(n.element,"."+t.highlightClass).bind(function(t){return n.getSystem().getByDom(t).toOptional()})},getFirst:Gl,getLast:Xl,getPrevious:function(t,n,e){return El(t,n,0,-1)},getNext:function(t,n,e){return El(t,n,0,1)},getCandidates:Yl}),md=xa({fields:[Jt("highlightClass"),Jt("itemClass"),Ku("onHighlight"),Ku("onDehighlight")],name:"highlighting",apis:dd}),gd=[8],pd=[9],hd=[13],vd=[27],bd=[32],yd=[37],xd=[38],wd=[39],Sd=[40],kd=k(Rl);function Cd(t,n,e,o,a){function c(n,e,t,o,r){var i=t(n,e,o,r),u=e.event;return V(i,function(t){return t.matches(u)}).map(function(t){return t.classification}).bind(function(t){return t(n,e,o,r)})}var r={schema:function(){return t.concat([dn("focusManager",zl()),mn("focusInside","onFocus",Wt(function(t){return et(["onFocus","onEnterOrSpace","onApi"],t)?mt.value(t):mt.error("Invalid value for focusInside")})),Zu("handler",r),Zu("state",n),Zu("sendFocusIn",a)])},processKey:c,toEvents:function(i,u){var t=i.focusInside!==Jl.OnFocusMode?ft.none():a(i).map(function(e){return Xe(Co(),function(t,n){e(t,i,u),n.stop()})}),n=[Xe(go(),function(o,r){c(o,r,e,i,u).fold(function(){var n=o,e=r,t=Fl(bd.concat(hd))(e.event);i.focusInside===Jl.OnEnterOrSpaceMode&&t&&Ve(n,e)&&a(i).each(function(t){t(n,i,u),e.stop()})},function(t){r.stop()})}),Xe(po(),function(t,n){c(t,n,o,i,u).each(function(t){n.stop()})})];return Jo(t.toArray().concat(n))}};return r}function Od(t){function a(t,n){return 0',e.getDoc());return Gi(t,de.fromDom(n.extractContents())),n.insertNode(t.dom),ar(t).each(function(t){return t.dom.normalize()}),i=ms,(u=function(t){for(var n=sr(t),e=n.length-1;0<=e;e--){var o=n[e];if(i(o))return ft.some(o);var r=u(o);if(r.isSome())return r}return ft.none()})(t).map(function(t){var n;e.selection.setCursorLocation(t.dom,"img"===nr(n=t)?1:ds(n).fold(function(){return sr(n).length},function(t){return t.length}))}),t})}function vp(t){return t.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")}function bp(t){return""!==t&&-1!==" \xa0\f\n\r\t\v".indexOf(t)}function yp(t,n){return t.substring(n.length)}function xp(o,t,r,n){return void 0===n&&(n=0),Ep(de.fromDom(t.startContainer)).fold(function(){return function(t,o,i,r){if(void 0===r&&(r=0),!o.collapsed||3!==o.startContainer.nodeType)return ft.none();var n=t.getParent(o.startContainer,t.isBlock)||t.getRoot();return pp(t,o.startContainer,o.startOffset,function(t,r,n){return function(t,n){for(var e=r-1;0<=e;e--){var o=t.charAt(e);if(bp(o))return ft.none();if(o===n)break}return ft.some(e)}(n,i).getOr(r)},n).bind(function(t){var n=o.cloneRange();if(n.setStart(t.container,t.offset),n.setEnd(o.endContainer,o.endOffset),n.collapsed)return ft.none();var e=vp(n);return 0!==e.lastIndexOf(i)||yp(e,i).length=t.minChars&&t.matches.getOrThunk(function(){return e=n.dom,function(t){var n=Ap(t.startContainer,t.startOffset);return!pp(e,n.container,n.offset,function(t,n){return 0===n?-1:n},e.getRoot()).filter(function(t){return!bp(t.container.data.charAt(t.offset-1))}).isSome()};var e})(e.range,i,e.text)});if(0===u.length)return ft.none();var a=Dp.all(A(u,function(n){return n.fetch(e.text,n.maxResults,o).then(function(t){return{matchText:e.text,items:t,columns:n.columns,onAction:n.onAction,highlightOn:n.highlightOn}})}));return ft.some({lookupData:a,context:e})}var Op,_p,Tp=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),Ep=function(t){return Iu(t,"[data-mce-autocompleter]")},Dp=tinymce.util.Tools.resolve("tinymce.util.Promise"),Bp=function(t){if(3===t.nodeType)return wp(t,t.data.length);var n=t.childNodes;return 0o}).getOr(r.length);return ft.some({numColumns:e,numRows:Math.ceil(r.length/e)})}return ft.none()}function ih(t,n,e){t.getSystem().broadcastOn([Yh],{})}function uh(t){return t.getParam("height",Math.max(t.getElement().offsetHeight,200))}function ah(t){return t.getParam("width",Zh.DOM.getStyle(t.getElement(),"width"))}function ch(t){return ft.from(t.getParam("min_width")).filter(u)}function sh(t){return ft.from(t.getParam("min_height")).filter(u)}function lh(t){return ft.from(t.getParam("max_width")).filter(u)}function fh(t){return ft.from(t.getParam("max_height")).filter(u)}function dh(t){return!1!==t.getParam("menubar",!0,"boolean")}function mh(t){var n=t.getParam("toolbar",!0),e=!0===n,o=y(n),r=c(n)&&0'+t+""})}return o}function Ev(t){return{value:t}}function Dv(t){return nb.test(t)||eb.test(t)}function Bv(t){var n=t.toString(16);return(1===n.length?"0"+n:n).toUpperCase()}function Av(t){return Ev(Bv(t.red)+Bv(t.green)+Bv(t.blue))}function Mv(t,n,e,o){return{red:t,green:n,blue:e,alpha:o}}function Fv(t){var n=parseInt(t,10);return n.toString()===t&&0<=n&&n<=255}function Iv(t){var n,e,o,r=(t.hue||0)%360,i=t.saturation/100,u=t.value/100,i=rb(0,ob(i,1)),u=rb(0,ob(u,1));if(0===i)return Mv(n=e=o=ib(255*u),e,o,1);var a=r/60,c=u*i,s=c*(1-Math.abs(a%2-1)),l=u-c;switch(Math.floor(a)){case 0:n=c,e=s,o=0;break;case 1:n=s,e=c,o=0;break;case 2:n=0,e=c,o=s;break;case 3:n=0,e=s,o=c;break;case 4:n=s,e=0,o=c;break;case 5:n=c,e=0,o=s;break;default:n=e=o=0}return Mv(n=ib(255*(n+l)),e=ib(255*(e+l)),o=ib(255*(o+l)),1)}function Rv(t){var n,e,o=(n={value:t.value.replace(nb,function(t,n,e,o){return n+n+e+e+o+o})},null===(e=eb.exec(n.value))?["FFFFFF","FF","FF","FF"]:e);return Mv(parseInt(o[1],16),parseInt(o[2],16),parseInt(o[3],16),1)}function Vv(t,n,e,o){return Mv(parseInt(t,10),parseInt(n,10),parseInt(e,10),parseFloat(o))}function Pv(t){if("transparent"===t)return ft.some(Mv(0,0,0,0));var n=ub.exec(t);if(null!==n)return ft.some(Vv(n[1],n[2],n[3],"1"));var e=ab.exec(t);return null!==e?ft.some(Vv(e[1],e[2],e[3],e[4])):ft.none()}function Hv(t){return"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")"}function zv(t,n){return t.fire("ResizeContent",n)}function Nv(t,n,e){return{hue:t,saturation:n,value:e}}function Lv(t){var n,e,o=0,r=t.red/255,i=t.green/255,u=t.blue/255,a=Math.min(r,Math.min(i,u)),c=Math.max(r,Math.max(i,u));return a===c?Nv(0,0,100*(o=a)):(e=60*((r===a?3:u===a?1:5)-(r===a?i-u:u===a?r-i:u-r)/(c-a)),n=(c-a)/c,o=c,Nv(Math.round(e),Math.round(100*n),Math.round(100*o)))}function jv(t){return Av(Iv(t))}function Wv(o){return(Dv(n=o)?ft.some({value:(pe(t=n,"#")?t.substring("#".length):t).toUpperCase()}):ft.none()).orThunk(function(){return Pv(o).map(Av)}).getOrThunk(function(){var t=document.createElement("canvas");t.height=1,t.width=1;var n=t.getContext("2d");n.clearRect(0,0,t.width,t.height),n.fillStyle="#FFFFFF",n.fillStyle=o,n.fillRect(0,0,1,1);var e=n.getImageData(0,0,1,1).data;return Av(Mv(e[0],e[1],e[2],e[3]))});var t,n}(hh=ph=ph||{}).default="wrap",hh.floating="floating",hh.sliding="sliding",hh.scrolling="scrolling",(bh=vh=vh||{}).auto="auto",bh.top="top",bh.bottom="bottom";function Uv(t){return fd.config({disabled:t,disableClass:"tox-tbtn--disabled"})}var Gv,Xv="silver.readonly",Yv=te([$t("readonly",ie)]),qv=function(t){return fd.config({disabled:t})},Kv=function(t){return fd.config({disabled:t,disableClass:"tox-tbtn--disabled",useNative:!1})},Jv=((Gv={})[Eo()]=["disabling","alloy.base.behaviour","toggling","item-events"],Gv),$v=Jr,Qv=tinymce.util.Tools.resolve("tinymce.Env"),Zv=function(t,a){return A(t,function(t){switch(t.type){case"cardcontainer":return r=Zv((o=t).items,a),i="vertical"===o.direction?"tox-collection__item-container--column":Bh,u="left"===o.align?"tox-collection__item-container--align-left":"tox-collection__item-container--align-right",{dom:{tag:"div",classes:[Dh,i,u,function(){switch(o.valign){case"top":return"tox-collection__item-container--valign-top";case"middle":return"tox-collection__item-container--valign-middle";case"bottom":return"tox-collection__item-container--valign-bottom"}}()]},components:r};case"cardimage":return e=t.src,{dom:{tag:"img",classes:t.classes,attributes:{src:e,alt:t.alt.getOr("")}}};case"cardtext":var n=t.name.exists(function(t){return et(a.cardText.highlightOn,t)})?ft.from(a.cardText.matchText).getOr(""):"";return xv(Tv(t.text,n),t.classes)}var e,o,r,i,u})},tb=rl(Gg(),Xg()),nb=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,eb=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,ob=Math.min,rb=Math.max,ib=Math.round,ub=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,ab=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,cb=Mv(255,0,0,1),sb=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),lb="tinymce-custom-colors";function fb(t){return!1!==t.getParam("custom_colors")}function db(t){var n=t.getParam("color_map");return void 0!==n?function(t){for(var n=[],e=0;ee&&i.pop(),sb.setItem(lb,JSON.stringify(i))},state:function(){return i.slice(0)}}}(10),Db=function(r){return function(e,t){var o=!1;r.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{colorpicker:t},onAction:function(t,n){"hex-valid"===n.name&&(o=n.value)},onSubmit:function(t){var n=t.getData().colorpicker;o?(e(ft.from(n)),t.close()):r.windowManager.alert(r.translate(["Invalid hex color code: {0}",n]))},onClose:ct,onCancel:function(){e(ft.none())}})}},Bb=function(e,o,r,i,u,a,c){return Jr(A(e,function(n){return"choiceitem"===n.type?Gt("choicemenuitem",Nh,n).fold(nh,function(t){return ft.some(function(n,t,e,o,r,i,u,a){void 0===a&&(a=!0);var c=Ov({presets:e,textContent:t?n.text:ft.none(),htmlContent:ft.none(),ariaLabel:n.text,iconContent:n.icon,shortcutContent:t?n.shortcut:ft.none(),checkMark:t?ft.some(kv(u.icons)):ft.none(),caret:ft.none(),value:n.value},u,a);return Jn(hv({data:vv(n),disabled:n.disabled,getApi:function(n){return{setActive:function(t){Hg.set(n,t)},isActive:function(){return Hg.isOn(n)},isDisabled:function(){return fd.isDisabled(n)},setDisabled:function(t){return fd.set(n,t)}}},onAction:function(t){return o(n.value)},onSetup:function(t){return t.setActive(r),ct},triggersSubmenu:!1,itemBehaviours:[]},c,i,u),{toggling:{toggleClass:Ch,toggleOnExecute:!1,selected:n.active}})}(t,1===r,i,o,a(n.value),u,c,th(e)))}):ft.none()}))},Ab=Ar("cell-over"),Mb=Ar("cell-execute"),Fb={inserttable:function(o){var t=Ar("size-label"),i=function(t){for(var n=[],e=0;e<10;e++){for(var o=[],r=0;r<10;r++)o.push(function(n,e,t){function o(t){return Ne(t,Mb,{row:n,col:e})}function r(t,n){n.stop(),o(t)}var i;return bu({dom:{tag:"div",attributes:((i={role:"button"})["aria-labelledby"]=t,i)},behaviours:Za([lm("insert-table-picker-cell",[Xe(lo(),Rg.focus),Xe(Eo(),o),Xe(bo(),r),Xe(Bo(),r)]),Hg.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),Rg.config({onFocus:function(t){return Ne(t,Ab,{row:n,col:e})}})])})}(e,r,t));n.push(o)}return n}(t),u=Vm({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:t}},components:[pi("0x0")],behaviours:Za([Mg.config({})])});return{type:"widget",data:{value:Ar("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[tb.widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:z(i,function(t){return A(t,yu)}).concat(u.asSpec()),behaviours:Za([lm("insert-table-picker",[Je(Ab,function(t,n,e){var o=e.event.row,r=e.event.col;!function(t,n,e){for(var o=0;o<10;o++)for(var r=0;r<10;r++)Hg.set(t[o][r],o<=n&&r<=e)}(i,o,r),Mg.set(u.get(t),[pi(r+1+"x"+(o+1))])}),Je(Mb,function(t,n,e){o.onAction({numRows:e.event.row+1,numColumns:e.event.col+1}),ze(t,Mo())})]),Bg.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:function(n,t){var e,o,r,i=(o=t,r=(e=n).initData.allowCustomColors&&o.colorinput.hasCustomColors(),e.initData.colors.fold(function(){return vb(o.colorinput.getColors(),r)},function(t){return t.concat(pb(r))})),u=t.colorinput.getColorCols(),a=Sb(Ar("menu-value"),i,function(t){n.onAction({value:t})},u,"color",yh.CLOSE_ON_EXECUTE,O,t.shared.providers),c=st(st({},a),{markers:Kp("color"),movement:kb(u,"color")});return{type:"widget",data:{value:Ar("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[tb.widget($g.sketch(c))]}}},Ib=function(t){var n=t.text.fold(function(){return{}},function(t){return{innerHtml:t}});return{type:"separator",dom:st({tag:"div",classes:[wh,"tox-collection__group-heading"]},n),components:[]}},Rb=function(t,n,e,o){void 0===o&&(o=!0);var r=Ov({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:ft.none(),ariaLabel:t.text,caret:ft.none(),checkMark:ft.none(),shortcutContent:t.shortcut},e,o);return hv({data:vv(t),getApi:function(n){return{isDisabled:function(){return fd.isDisabled(n)},setDisabled:function(t){return fd.set(n,t)}}},disabled:t.disabled,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},r,n,e)},Vb=function(t,n,e,o,r){void 0===o&&(o=!0);var i=(r=void 0!==r&&r)?bv("chevron-down",e.icons,[Th]):bv("chevron-right",e.icons,[Th]),u=Ov({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:ft.none(),ariaLabel:t.text,caret:ft.some(i),checkMark:ft.none(),shortcutContent:t.shortcut},e,o);return hv({data:vv(t),getApi:function(n){return{isDisabled:function(){return fd.isDisabled(n)},setDisabled:function(t){return fd.set(n,t)}}},disabled:t.disabled,onAction:ct,onSetup:t.onSetup,triggersSubmenu:!0,itemBehaviours:[]},u,n,e)},Pb=function(t,n,e,o){void 0===o&&(o=!0);var r=Ov({iconContent:t.icon,textContent:t.text,htmlContent:ft.none(),ariaLabel:t.text,checkMark:ft.some(kv(e.icons)),caret:ft.none(),shortcutContent:t.shortcut,presets:"normal",meta:t.meta},e,o);return Jn(hv({data:vv(t),disabled:t.disabled,getApi:function(n){return{setActive:function(t){Hg.set(n,t)},isActive:function(){return Hg.isOn(n)},isDisabled:function(){return fd.isDisabled(n)},setDisabled:function(t){return fd.set(n,t)}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},r,n,e),{toggling:{toggleClass:Ch,toggleOnExecute:!1,selected:t.active}})},Hb=function(n,e){return kt(Fb,n.fancytype).map(function(t){return t(n,e)})};function zb(t,u,a,n,c,s,l){var e=1===n,o=!e||th(t);return Jr(A(t,function(t){switch(t.type){case"separator":return Gt("Autocompleter.Separator",Mp,t).fold(nh,function(t){return ft.some(Ib(t))});case"cardmenuitem":return Gt("cardmenuitem",zh,t).fold(nh,function(n){return ft.some((t=st(st({},n),{onAction:function(t){n.onAction(t),a(n.value,n.meta)}}),e=c,o=s,r={itemBehaviours:_v(n.meta,s),cardText:{matchText:u,highlightOn:l}},i={dom:Cv(t.label),optComponents:[ft.some({dom:{tag:"div",classes:[Dh,Bh]},components:Zv(t.items,r)})]},hv({data:vv(st({text:ft.none()},t)),disabled:t.disabled,getApi:function(e){return{isDisabled:function(){return fd.isDisabled(e)},setDisabled:function(n){fd.set(e,n),dt(gs(e.element,"*"),function(t){e.getSystem().getByDom(t).each(function(t){t.hasConfigured(fd)&&fd.set(t,n)})})}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:ft.from(r.itemBehaviours).getOr([])},i,e,o.providers)));var t,e,o,r,i});default:return Gt("Autocompleter.Item",Fp,t).fold(nh,function(t){return ft.some(function(n,e,t,o,r,i,u,a){void 0===a&&(a=!0);var c=Ov({presets:o,textContent:ft.none(),htmlContent:t?n.text.map(function(t){return Tv(t,e)}):ft.none(),ariaLabel:n.text,iconContent:n.icon,shortcutContent:ft.none(),checkMark:ft.none(),caret:ft.none(),value:n.value},u.providers,a,n.icon);return hv({data:vv(n),disabled:n.disabled,getApi:tt({}),onAction:function(t){return r(n.value,n.meta)},onSetup:tt(ct),triggersSubmenu:!1,itemBehaviours:_v(n.meta,u)},c,i,u.providers)}(t,u,e,"normal",a,c,s,o))})}}))}function Nb(t,n,e,o,r){var i=th(n),u=Jr(A(n,function(t){function n(t){return function(t,n,e,o,r){function i(t){return r?st(st({},t),{shortcut:ft.none(),icon:t.text.isSome()?ft.none():t.icon}):t}var u=e.shared.providers;switch(t.type){case"menuitem":return Gt("menuitem",Wh,t).fold(nh,function(t){return ft.some(Rb(i(t),n,u,o))});case"nestedmenuitem":return Gt("nestedmenuitem",Uh,t).fold(nh,function(t){return ft.some(Vb(i(t),n,u,o,r))});case"togglemenuitem":return Gt("togglemenuitem",Gh,t).fold(nh,function(t){return ft.some(Pb(i(t),n,u,o))});case"separator":return Gt("separatormenuitem",Mp,t).fold(nh,function(t){return ft.some(Ib(t))});case"fancymenuitem":return Gt("fancymenuitem",jh,t).fold(nh,function(t){return Hb(i(t),e)});default:return console.error("Unknown item in general menu",t),ft.none()}}(t,e,o,r?!Kn(t,"text"):i,r)}return"nestedmenuitem"===t.type&&t.getSubmenuItems().length<=0?n(st(st({},t),{disabled:!0})):n(t)}));return(r?eh:oh)(t,i,u,1,"normal")}function Lb(t){return ep.singleData(t.value,t)}function jb(t,n,e){return Iu(t,n,e).isSome()}function Wb(e,o){var r=null;return{cancel:function(){null!==r&&(clearTimeout(r),r=null)},schedule:function(){for(var t=[],n=0;n"}function i0(f,d,m,g){function p(t,n,e,o,r){var i,u,a=f(xw+"range"),c=[dy.parts.label({dom:{tag:"label",innerHtml:e,attributes:{"aria-label":o}}}),dy.parts.field({data:r,factory:Ey,inputAttributes:st({type:"text"},"hex"===n?{"aria-live":"polite"}:{}),inputClasses:[d("textfield")],inputBehaviours:Za([(i=n,u=t,qy.config({invalidClass:d("invalid"),notify:{onValidate:function(t){Ne(t,yw,{type:i})},onValid:function(t){Ne(t,vw,{type:i,value:_f.getValue(t)})},onInvalid:function(t){Ne(t,bw,{type:i,value:_f.getValue(t)})}},validator:{validate:function(t){var n=_f.getValue(t),e=u(n)?mt.value(!0):mt.error(f("aria.input.invalid"));return Uy(e)},validateOnLoad:!1}})),gy.config({})]),onSetValue:function(t){qy.isInvalid(t)&&qy.run(t).get(ct)}})],s="hex"!==n?[dy.parts["aria-descriptor"]({text:a})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:c.concat(s)}}function h(t,n){var e=n.red,o=n.green,r=n.blue;_f.setValue(t,{red:e,green:o,blue:r})}function v(t,n){b.getOpt(t).each(function(t){ni(t.element,"background-color","#"+n.value)})}var b=Vm({dom:{tag:"div",classes:[d("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}});return xl({factory:function(){function a(t){return o[t].get()}function c(t,n){o[t].set(n)}function n(t,n){var e=n.event;"hex"!==e.type?c(e.type,ft.none()):g(t)}function e(t,n){var r,e,o,i,u=n.event;"hex"===u.type?function(t,n){m(t);var e=Ev(n);c("hex",ft.some(n));var o=Rv(e);h(t,o),s(o),Ne(t,dw,{hex:e}),v(t,e)}(t,u.value):(r=t,e=u.type,o=u.value,i=parseInt(o,10),c(e,ft.some(i)),a("red").bind(function(e){return a("green").bind(function(n){return a("blue").map(function(t){return Mv(e,n,t,1)})})}).each(function(t){var n,e,o=(n=r,e=Av(t),hw.getField(n,"hex").each(function(t){Rg.isFocused(t)||_f.setValue(n,{hex:e.value})}),e);Ne(r,dw,{hex:o}),v(r,o)}))}function t(t){return{label:f(xw+t+".label"),description:f(xw+t+".description")}}function s(t){var n=t.red,e=t.green,o=t.blue;c("red",ft.some(n)),c("green",ft.some(e)),c("blue",ft.some(o))}var o={red:wn(ft.some(255)),green:wn(ft.some(255)),blue:wn(ft.some(255)),hex:wn(ft.some("ffffff"))},r=t("red"),i=t("green"),u=t("blue"),l=t("hex");return Jn(hw.sketch(function(t){return{dom:{tag:"form",classes:[d("rgb-form")],attributes:{"aria-label":f("aria.color.picker")}},components:[t.field("red",dy.sketch(p(Fv,"red",r.label,r.description,255))),t.field("green",dy.sketch(p(Fv,"green",i.label,i.description,255))),t.field("blue",dy.sketch(p(Fv,"blue",u.label,u.description,255))),t.field("hex",dy.sketch(p(Dv,"hex",l.label,l.description,"ffffff"))),b.asSpec()],formBehaviours:Za([qy.config({invalidClass:d("form-invalid")}),lm("rgb-form-events",[Xe(vw,e),Xe(bw,n),Xe(yw,n)])])}}),{apis:{updateHex:function(t,n){var e;_f.setValue(t,{hex:n.value}),h(t,e=Rv(n)),s(e),v(t,n)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,n,e){t.updateHex(n,e)}},extraApis:{}})}function u0(x,w){return xl({name:"ColourPicker",configFields:[Jt("dom"),dn("onValidHex",ct),dn("onInvalidHex",ct)],factory:function(t){function n(t,n,e){v.getOpt(t).each(function(t){g.setHue(t,e)})}function e(t,n){b.getOpt(t).each(function(t){m.updateHex(t,n)})}function r(n,e,o,t){var r=o,i=Rv(e);p.paletteRgba.set(i),p.paletteHue.set(r),dt(t,function(t){t(n,e,o)})}var o,i,u,a,c,s,l,f,d,m=i0(x,w,t.onValidHex,t.onInvalidHex),g=(l=w,f=fw.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[l("sv-palette-spectrum")]}}),d=fw.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[l("sv-palette-thumb")],innerHtml:"'}}),xl({factory:function(t){var n=tt({x:0,y:0}),e=Za([id.config({find:ft.some}),Rg.config({})]);return fw.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[l("sv-palette")]},model:{mode:"xy",getInitialValue:n},rounded:!1,components:[f,d],onChange:function(t,n,e){Ne(t,gw,{value:e})},onInit:function(t,n,e,o){y(e.element.dom,Hv(cb))},sliderBehaviours:e})},name:"SaturationBrightnessPalette",configFields:[],apis:{setHue:function(t,n,e){var o=e;y(n.components()[0].element.dom,Hv(Iv(Nv(o,100,100))))},setThumb:function(t,n,e){var o=n,r=Lv(Rv(e));fw.setValue(o,{x:r.saturation,y:100-r.value})}},extraApis:{}})),p={paletteRgba:wn(cb),paletteHue:wn(0)},h=Vm((i=fw.parts.spectrum({dom:{tag:"div",classes:[(o=w)("hue-slider-spectrum")],attributes:{role:"presentation"}}}),u=fw.parts.thumb({dom:{tag:"div",classes:[o("hue-slider-thumb")],attributes:{role:"presentation"}}}),fw.sketch({dom:{tag:"div",classes:[o("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:tt({y:0})},components:[i,u],sliderBehaviours:Za([Rg.config({})]),onChange:function(t,n,e){Ne(t,mw,{value:e})}}))),v=Vm(g.sketch({})),b=Vm(m.sketch({}));function y(t,n){var e,o,r=t.width,i=t.height,u=t.getContext("2d");null!==u&&(u.fillStyle=n,u.fillRect(0,0,r,i),(e=u.createLinearGradient(0,0,r,0)).addColorStop(0,"rgba(255,255,255,1)"),e.addColorStop(1,"rgba(255,255,255,0)"),u.fillStyle=e,u.fillRect(0,0,r,i),(o=u.createLinearGradient(0,0,0,i)).addColorStop(0,"rgba(0,0,0,0)"),o.addColorStop(1,"rgba(0,0,0,1)"),u.fillStyle=o,u.fillRect(0,0,r,i))}return{uid:t.uid,dom:t.dom,components:[v.asSpec(),h.asSpec(),b.asSpec()],behaviours:Za([lm("colour-picker-events",[Xe(dw,(s=[n,function(t,n,e){h.getOpt(t).each(function(t){fw.setValue(t,{y:100-e/360*100})})},function(t,n){v.getOpt(t).each(function(t){g.setThumb(t,n)})}],function(t,n){var e=n.event.hex;r(t,e,Lv(Rv(e)).hue,s)})),Xe(gw,(c=[e],function(t,n){var e=n.event.value,o=p.paletteHue.get();r(t,jv(Nv(o,e.x,100-e.y)),o,c)})),Xe(mw,(a=[n,e],function(t,n){var e=(100-n.event.value.y)/100*360,o=Lv(p.paletteRgba.get());r(t,jv(Nv(e,o.saturation,o.value)),e,a)}))]),id.config({find:function(t){return b.getOpt(t)}}),Bg.config({mode:"acyclic"})])}}})}function a0(t){return kw[t]}function c0(t,n,e){return _f.config(Jn({store:{mode:"manual",getValue:n,setValue:e}},t.map(function(t){return{store:{initialValue:t}}}).getOr({})))}function s0(r,i){function n(t,n){n.stop()}function e(t){return function(n,e){dt(t,function(t){t(n,e)})}}function o(t,n){var e;fd.isDisabled(t)||(e=n.event.raw,a(t,e.dataTransfer.files))}function u(t,n){var e=n.event.raw.target;a(t,e.files)}function a(t,n){var e,o;_f.setValue(t,(e=n,o=Ow.explode(i.getSetting("images_file_types","jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp","string")),F(rt(e),function(n){return T(o,function(t){return he(n.name.toLowerCase(),"."+t.toLowerCase())})}))),Ne(t,by,{name:r.name})}var c=Vm({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:Za([lm("input-file-events",[$e(bo()),$e(Bo())])])});return $b(r.label.map(function(t){return Qb(t,i)}),dy.parts.field({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:Za([Dw([]),x0(),fd.config({}),Hg.config({toggleClass:"dragenter",toggleOnExecute:!1}),lm("dropzone-events",[Xe("dragenter",e([n,Hg.toggle])),Xe("dragleave",e([n,Hg.toggle])),Xe("dragover",n),Xe("drop",e([n,o])),Xe(vo(),u)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:i.translate("Drop an image here")}},cp.sketch({dom:{tag:"button",innerHtml:i.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[c.asSpec()],action:function(t){c.get(t).element.dom.click()},buttonBehaviours:Za([gy.config({}),qv(i.isDisabled),dv()])})]}]}}}}),["tox-form__group--stretched"],[])}function l0(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:Za([Rg.config({ignore:!0}),gy.config({})])}}function f0(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[l0([Bw]),t,l0([Aw])],behaviours:Za([Sw(1)])}}function d0(t,n){Ne(t,go(),{raw:{which:9,shiftKey:n}})}function m0(t,n){var e=n.element;Xr(e,Bw)?d0(t,!0):Xr(e,Aw)&&d0(t,!1)}function g0(t){return jb(t,["."+Bw,"."+Aw].join(","),O)}function p0(t,n){return Iw(document.createElement("canvas"),t,n)}function h0(t){var n=p0(t.width,t.height);return Fw(n).drawImage(t,0,0),n}function v0(t){return t.naturalWidth||t.width}function b0(t){return t.naturalHeight||t.height}(Hy=Py=Py||{})[Hy.HighlightFirst=0]="HighlightFirst",Hy[Hy.HighlightNone=1]="HighlightNone";function y0(o,t){return{uid:o.uid,dom:o.dom,components:t,behaviours:Qs(o.formBehaviours,[_f.config({store:{mode:"manual",getValue:function(t){return yt(ml(t,o),function(t,o){return t().bind(function(t){var n=id.getCurrent(t),e=new Error("Cannot find a current component to extract the value from for form part '"+o+"': "+Br(t.element));return n.fold(function(){return mt.error(e)},mt.value)}).map(_f.getValue)})},setValue:function(e,t){bt(t,function(n,t){ll(e,o,t).each(function(t){id.getCurrent(t).each(function(t){_f.setValue(t,n)})})})}}})]),apis:{getField:function(t,n){return ll(t,o,n).bind(id.getCurrent)}}}}function x0(){return id.config({find:ft.some})}function w0(t){return n=Sr,e=kr,c0(t,function(t){return n(t.element)},function(t,n){return e(t.element,n)});var n,e}var S0,k0,C0,O0,_0,T0=function(n,t){return n.getSystem().getByUid(t.uid+"-"+$y()).map(function(t){return function(){return mt.value(t)}}).getOrThunk(function(){return t.lazySink.fold(function(){return function(){return mt.error(new Error("No internal sink is specified, nor could an external sink be found"))}},function(t){return function(){return t(n)}})})},E0=tt([Jt("dom"),Jt("fetch"),Ku("onOpen"),Ju("onExecute"),dn("getHotspot",ft.some),dn("getAnchorOverrides",tt({})),zc(),Js("dropdownBehaviours",[Hg,Jy,Bg,Rg]),Jt("toggleClass"),dn("eventOrder",{}),rn("lazySink"),dn("matchWidth",!1),dn("useMinWidth",!1),rn("role")].concat(ix())),D0=tt([qf({schema:[Xu()],name:"menu",defaults:function(t){return{onExecute:t.onExecute}}}),Qy()]),B0=wl({name:"Dropdown",configFields:E0(),partFields:D0(),factory:function(n,t,e,o){function r(t){pf.getState(t).each(function(t){ep.highlightPrimary(t)})}function i(t,n){return Le(t),ft.some(!0)}var u,a={expand:function(t){Hg.isOn(t)||nx(n,h,t,o,ct,Py.HighlightNone).get(ct)},open:function(t){Hg.isOn(t)||nx(n,h,t,o,ct,Py.HighlightFirst).get(ct)},isOpen:Hg.isOn,close:function(t){Hg.isOn(t)&&nx(n,h,t,o,ct,Py.HighlightFirst).get(ct)},repositionMenus:function(t){Hg.isOn(t)&&rx(t)}};return{uid:n.uid,dom:n.dom,components:t,behaviours:Qs(n.dropdownBehaviours,[Hg.config({toggleClass:n.toggleClass,aria:{mode:"expanded"}}),Jy.config({others:{sandbox:function(t){return ox(n,t,{onOpen:function(){return Hg.on(t)},onClose:function(){return Hg.off(t)}})}}}),Bg.config({mode:"special",onSpace:i,onEnter:i,onDown:function(t,n){return B0.isOpen(t)?r(Jy.getCoupled(t,"sandbox")):B0.open(t),ft.some(!0)},onEscape:function(t,n){return B0.isOpen(t)?(B0.close(t),ft.some(!0)):ft.none()}}),Rg.config({})]),events:ym(ft.some(function(t){nx(n,h,t,o,r,Py.HighlightFirst).get(ct)})),eventOrder:st(st({},n.eventOrder),((u={})[Eo()]=["disabling","toggling","alloy.base.behaviour"],u)),apis:a,domModification:{attributes:st(st({"aria-haspopup":"true"},n.role.fold(function(){return{}},function(t){return{role:t}})),"button"===n.dom.tag?{type:kt(n.dom,"attributes").bind(function(t){return kt(t,"type")}).getOr("button")}:{})}}},apis:{open:function(t,n){return t.open(n)},expand:function(t,n){return t.expand(n)},close:function(t,n){return t.close(n)},isOpen:function(t,n){return t.isOpen(n)},repositionMenus:function(t,n){return t.repositionMenus(n)}}}),A0=xa({fields:[],name:"unselecting",active:Object.freeze({__proto__:null,events:function(){return Jo([Ue(So(),_)])},exhibit:function(){return Hr({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),M0=Ar("color-input-change"),F0=Ar("color-swatch-change"),I0=Ar("color-picker-cancel"),R0=Kf({schema:[Jt("dom")],name:"label"}),V0=ux("top-left"),P0=ux("top"),H0=ux("top-right"),z0=ux("right"),N0=ux("bottom-right"),L0=ux("bottom"),j0=ux("bottom-left"),W0=[R0,ux("left"),z0,P0,L0,V0,H0,j0,N0,Yf({name:"thumb",defaults:tt({dom:{styles:{position:"absolute"}}}),overrides:function(t){return{events:Jo([Ke(eo(),t,"spectrum"),Ke(oo(),t,"spectrum"),Ke(ro(),t,"spectrum"),Ke(uo(),t,"spectrum"),Ke(ao(),t,"spectrum"),Ke(so(),t,"spectrum")])}}}),Yf({schema:[fe("mouseIsDown",function(){return wn(!1)})],name:"spectrum",overrides:function(e){function o(n,t){return r.getValueFromEvent(t).map(function(t){return r.setValueFrom(n,e,t)})}var r=e.model.manager;return{behaviours:Za([Bg.config({mode:"special",onLeft:function(t){return r.onLeft(t,e)},onRight:function(t){return r.onRight(t,e)},onUp:function(t){return r.onUp(t,e)},onDown:function(t){return r.onDown(t,e)}}),Rg.config({})]),events:Jo([Xe(eo(),o),Xe(oo(),o),Xe(uo(),o),Xe(ao(),function(t,n){e.mouseIsDown.get()&&o(t,n)})])}}})],U0=tt("slider.change.value"),G0="left",X0=Kx(-1),Y0=Kx(1),q0=ft.none,K0=ft.none,J0={"top-left":ft.none(),top:ft.none(),"top-right":ft.none(),right:ft.some(function(t,n){Mx(t,{x:gx(n)})}),"bottom-right":ft.none(),bottom:ft.none(),"bottom-left":ft.none(),left:ft.some(function(t,n){Mx(t,{x:lx(n)})})},$0=Object.freeze({__proto__:null,setValueFrom:function(t,n,e){var o=qx(t,n,e);return Yx(t,{x:o}),o},setToMin:function(t,n){Yx(t,{x:cx(n)})},setToMax:function(t,n){Yx(t,{x:dx(n)})},findValueOfOffset:qx,getValueFromEvent:function(t){return ax(t).map(function(t){return t.left})},findPositionOfValue:Jx,setPositionFromValue:function(t,n,e,o){var r=Bx(e),i=Jx(t,o.getSpectrum(t),r.x,o.getLeftEdge(t),o.getRightEdge(t),e),u=wi(n.element)/2;ni(n.element,"left",i-u+"px")},onLeft:X0,onRight:Y0,onUp:q0,onDown:K0,edgeActions:J0}),Q0=ft.none,Z0=ft.none,tw=Zx(-1),nw=Zx(1),ew={"top-left":ft.none(),top:ft.some(function(t,n){Mx(t,{y:fx(n)})}),"top-right":ft.none(),right:ft.none(),"bottom-right":ft.none(),bottom:ft.some(function(t,n){Mx(t,{y:px(n)})}),"bottom-left":ft.none(),left:ft.none()},ow=Object.freeze({__proto__:null,setValueFrom:function(t,n,e){var o=Qx(t,n,e);return $x(t,{y:o}),o},setToMin:function(t,n){$x(t,{y:sx(n)})},setToMax:function(t,n){$x(t,{y:mx(n)})},findValueOfOffset:Qx,getValueFromEvent:function(t){return ax(t).map(function(t){return t.top})},findPositionOfValue:t0,setPositionFromValue:function(t,n,e,o){var r=Bx(e),i=t0(t,o.getSpectrum(t),r.y,o.getTopEdge(t),o.getBottomEdge(t),e),u=vi(n.element)/2;ni(n.element,"top",i-u+"px")},onLeft:Q0,onRight:Z0,onUp:tw,onDown:nw,edgeActions:ew}),rw=ax,iw=o0(-1,!1),uw=o0(1,!1),aw=o0(-1,!0),cw=o0(1,!0),sw={"top-left":ft.some(function(t,n){Mx(t,Ax(lx(n),fx(n)))}),top:ft.some(function(t,n){Mx(t,Ax(yx(n),fx(n)))}),"top-right":ft.some(function(t,n){Mx(t,Ax(gx(n),fx(n)))}),right:ft.some(function(t,n){Mx(t,Ax(gx(n),xx(n)))}),"bottom-right":ft.some(function(t,n){Mx(t,Ax(gx(n),px(n)))}),bottom:ft.some(function(t,n){Mx(t,Ax(yx(n),px(n)))}),"bottom-left":ft.some(function(t,n){Mx(t,Ax(lx(n),px(n)))}),left:ft.some(function(t,n){Mx(t,Ax(lx(n),xx(n)))})},lw=Object.freeze({__proto__:null,setValueFrom:function(t,n,e){var o=e0(qx(t,n,e.left),Qx(t,n,e.top));return n0(t,o),o},setToMin:function(t,n){n0(t,e0(cx(n),sx(n)))},setToMax:function(t,n){n0(t,e0(dx(n),mx(n)))},getValueFromEvent:rw,setPositionFromValue:function(t,n,e,o){var r=Bx(e),i=Jx(t,o.getSpectrum(t),r.x,o.getLeftEdge(t),o.getRightEdge(t),e),u=t0(t,o.getSpectrum(t),r.y,o.getTopEdge(t),o.getBottomEdge(t),e),a=wi(n.element)/2,c=vi(n.element)/2;ni(n.element,"left",i-a+"px"),ni(n.element,"top",u-c+"px")},onLeft:iw,onRight:uw,onUp:aw,onDown:cw,edgeActions:sw}),fw=wl({name:"Slider",configFields:[dn("stepSize",1),dn("onChange",ct),dn("onChoose",ct),dn("onInit",ct),dn("onDragStart",ct),dn("onDragEnd",ct),dn("snapToGrid",!1),dn("rounded",!0),rn("snapStart"),$t("model",qt("mode",{x:[dn("minX",0),dn("maxX",100),fe("value",function(t){return wn(t.mode.minX)}),Jt("getInitialValue"),Zu("manager",$0)],y:[dn("minY",0),dn("maxY",100),fe("value",function(t){return wn(t.mode.minY)}),Jt("getInitialValue"),Zu("manager",ow)],xy:[dn("minX",0),dn("maxX",100),dn("minY",0),dn("maxY",100),fe("value",function(t){return wn({x:t.mode.minX,y:t.mode.minY})}),Jt("getInitialValue"),Zu("manager",lw)]})),Js("sliderBehaviours",[Bg,_f]),fe("mouseIsDown",function(){return wn(!1)})],partFields:W0,factory:function(i,t,n,e){function u(t){return fl(t,i,"thumb")}function a(t){return fl(t,i,"spectrum")}function o(t){return ll(t,i,"left-edge")}function r(t){return ll(t,i,"right-edge")}function c(t){return ll(t,i,"top-edge")}function s(t){return ll(t,i,"bottom-edge")}function l(t,n){v.setPositionFromValue(t,n,i,{getLeftEdge:o,getRightEdge:r,getTopEdge:c,getBottomEdge:s,getSpectrum:a})}function f(t,n){h.value.set(n),l(t,u(t))}function d(e){var t=i.mouseIsDown.get();i.mouseIsDown.set(!1),t&&ll(e,i,"thumb").each(function(t){var n=h.value.get();i.onChoose(e,t,n)})}function m(t,n){n.stop(),i.mouseIsDown.set(!0),i.onDragStart(t,u(t))}function g(t,n){n.stop(),i.onDragEnd(t,u(t)),d(t)}var p,h=i.model,v=h.manager;return{uid:i.uid,dom:i.dom,components:t,behaviours:Qs(i.sliderBehaviours,[Bg.config({mode:"special",focusIn:function(t){return ll(t,i,"spectrum").map(Bg.focusIn).map(_)}}),_f.config({store:{mode:"manual",getValue:function(t){return h.value.get()}}}),oc.config({channels:((p={})[bf()]={onReceive:d},p)})]),events:Jo([Xe(U0(),function(t,n){!function(t,n){f(t,n);var e=u(t);i.onChange(t,e,n),ft.some(!0)}(t,n.event.value)}),$o(function(t,n){var e=h.getInitialValue();h.value.set(e);var o=u(t);l(t,o);var r=a(t);i.onInit(t,o,r,h.value.get())}),Xe(eo(),m),Xe(ro(),g),Xe(uo(),m),Xe(so(),g)]),apis:{resetToMin:function(t){v.setToMin(t,i)},resetToMax:function(t){v.setToMax(t,i)},setValue:f,refresh:l},domModification:{styles:{position:"relative"}}}},apis:{setValue:function(t,n,e){t.setValue(n,e)},resetToMin:function(t,n){t.resetToMin(n)},resetToMax:function(t,n){t.resetToMax(n)},refresh:function(t,n){t.refresh(n)}}}),dw=Ar("rgb-hex-update"),mw=Ar("slider-update"),gw=Ar("palette-update"),pw=[Js("formBehaviours",[_f])],hw={getField:Vr(function(t,n,e){return t.getField(n,e)}),sketch:function(t){var e,n={field:function(t,n){return e.push(t),il("form",r0(t),n)},record:tt(e=[])},o=t(n),r=A(n.record(),function(t){return Yf({name:t,pname:r0(t)})});return yl("form",pw,r,y0,o)}},vw=Ar("valid-input"),bw=Ar("invalid-input"),yw=Ar("validating-input"),xw="colorcustom.rgb.",ww=function(t){return id.config({find:t.getOpt})},Sw=function(t){return id.config({find:function(n){return lr(n.element,t).bind(function(t){return n.getSystem().getByDom(t).toOptional()})}})},kw={"colorcustom.rgb.red.label":"R","colorcustom.rgb.red.description":"Red component","colorcustom.rgb.green.label":"G","colorcustom.rgb.green.description":"Green component","colorcustom.rgb.blue.label":"B","colorcustom.rgb.blue.description":"Blue component","colorcustom.rgb.hex.label":"#","colorcustom.rgb.hex.description":"Hex color code","colorcustom.rgb.range":"Range 0 to 255","colorcustom.sb.saturation":"Saturation","colorcustom.sb.brightness":"Brightness","colorcustom.sb.picker":"Saturation and Brightness Picker","colorcustom.sb.palette":"Saturation and Brightness Palette","colorcustom.sb.instructions":"Use arrow keys to select saturation and brightness, on x and y axes","colorcustom.hue.hue":"Hue","colorcustom.hue.slider":"Hue Slider","colorcustom.hue.palette":"Hue Palette","colorcustom.hue.instructions":"Use arrow keys to select a hue","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"},Cw=tinymce.util.Tools.resolve("tinymce.Resource"),Ow=tinymce.util.Tools.resolve("tinymce.util.Tools"),_w=te([dn("preprocess",h),dn("postprocess",h)]),Tw=function(r,t){var i=Yt("RepresentingConfigs.memento processors",_w,t);return _f.config({store:{mode:"manual",getValue:function(t){var n=r.get(t),e=_f.getValue(n);return i.postprocess(e)},setValue:function(t,n){var e=i.preprocess(n),o=r.get(t);_f.setValue(o,e)}}})},Ew=c0,Dw=function(t){return _f.config({store:{mode:"memory",initialValue:t}})},Bw=Ar("alloy-fake-before-tabstop"),Aw=Ar("alloy-fake-after-tabstop"),Mw=!(Be().browser.isIE()||Be().browser.isEdge()),Fw=function(t){return t.getContext("2d")},Iw=function(t,n,e){return t.width=n,t.height=e,t},Rw=window.Promise||(S0=window,k0=Vw.immediateFn||"function"==typeof S0.setImmediate&&S0.setImmediate||function(t){return setTimeout(t,1)},C0=function(e,o){return function(){for(var t=[],n=0;n").css({position:"absolute",top:0,left:0,width:l.width,height:l.height,zIndex:2147483647,opacity:1e-4,cursor:s}).appendTo(b.body),uk(b).on("mousemove touchmove",m).on("mouseup touchend",x),d.start(t)}),{destroy:function(){uk(y).off()}}}function lk(t,n,e,o,r){return hS({name:t,icon:ft.some(n),disabled:e,tooltip:ft.some(t),primary:!1,borderless:!1},o,r)}function fk(t,n){n?fd.enable(t):fd.disable(t)}var dk=0,mk=function(s,e,l,o,r){function f(t,n){return{x:n.x-t.x,y:n.y-t.y,w:n.w,h:n.h}}function u(t,n,e,o){var r,i=n.x,u=n.y,a=n.w,c=n.h;i+=e*t.deltaX,u+=o*t.deltaY,a+=e*t.deltaW,c+=o*t.deltaH,s=ik.clamp({x:i,y:u,w:a=a<20?20:a,h:c=c<20?20:c},l,"move"===t.name),r=f(l,s),p.fire("updateRect",{rect:r}),g(r)}function i(t){n(s=t)}function n(n){function t(t,n){n.h<0&&(n.h=0),n.w<0&&(n.w=0),uk("#"+c+"-"+t,o).css({left:n.x,top:n.y,width:n.w,height:n.h})}Ow.each(d,function(t){uk("#"+c+"-"+t.name,o).css({left:n.w*t.xMul+n.x,top:n.h*t.yMul+n.y})}),t("top",{x:e.x,y:e.y,w:e.w,h:n.y-e.y}),t("right",{x:n.x+n.w,y:n.y,w:e.w-n.x-n.w+e.x,h:n.h}),t("bottom",{x:e.x,y:n.y+n.h,w:e.w,h:e.h-n.y-n.h+e.y}),t("left",{x:e.x,y:n.y,w:n.x-e.x,h:n.h}),t("move",n)}var t,a="tox-",c="tox-crid-"+dk++,d=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0,label:"Crop Mask"},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1,label:"Top Left Crop Handle"},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1,label:"Top Right Crop Handle"},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1,label:"Bottom Left Crop Handle"},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1,label:"Bottom Right Crop Handle"}],m=["top","right","bottom","left"],g=function(t){var n;i((n=l,{x:t.x+n.x,y:t.y+n.y,w:t.w,h:t.h}))};uk('
').appendTo(o),Ow.each(m,function(t){uk("#"+c,o).append('